<WillMarshall>
Interesting little conundrum! I have some migrations that switch from normal tables to Postgres views, and need to reference the Model they're changing
<WillMarshall>
The problem is, when the model lazy loads, the scopes defined on it seem to attempt to access the DB - so I get a Postgres error (missing table) and the migration fails just before it would create that table
<WillMarshall>
What are good approaches to dealing with this? Just ditching scopes?
bryancp has joined #ruby-lang
<WillMarshall>
Sorry, that was really the wrong channel
<WillMarshall>
My apologies, misclick!
<shevy>
90% here are idling zombies anyway who'll never notice
<erikh>
we're zombies. we're still paying attention
<erikh>
BRAAAAAAIIIIIINS
Slackwise__ has joined #ruby-lang
neurodamage has joined #ruby-lang
twelvechairs has joined #ruby-lang
Slackwise has joined #ruby-lang
slyphon has joined #ruby-lang
t0h has joined #ruby-lang
jredvill` has joined #ruby-lang
rue has joined #ruby-lang
<rue>
Egads
delinquentme has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine>
How would one go about outputting the results of #jj to a file?
<andkerosine>
Preferably without the command line.
<ReinH>
typically one would use something like File#write to write to a file.
<ReinH>
There are a number of options, but methods that manipulate files generally reside in File
<andkerosine>
Well, yes, but is there a way to capture the output of #jj rather than having it print?
<andkerosine>
I mean, it is pretty-print for JSON, but I'd like to capture the resultant prettiness.
<ReinH>
so #jj prints to stdout?
<andkerosine>
Mm-hmm.
<ReinH>
ಠ_ಠ
<andkerosine>
As it's supposed to.
<drbrain>
for #pp there's #pretty_inspect
<andkerosine>
It's meant for testing, pretty much.
replore has joined #ruby-lang
<drbrain>
so for #jj is there #json_inspect ?
<andkerosine>
Alas, no.
<erikh>
dy-no-mite!
<andkerosine>
JSON.json_inspect(foo) is undefined.
heppy has joined #ruby-lang
<andkerosine>
JSON#pretty_generate does the trick. : )
<andkerosine>
drbrain: I've been meaning to get your opinion on this: where do you put default configuration for your gems?
twelvechairs has joined #ruby-lang
musl has joined #ruby-lang
Luxx_ has joined #ruby-lang
twelve_chairs has joined #ruby-lang
Aaaarg has joined #ruby-lang
<drbrain>
andkerosine: usually in a constant with some way of writing it to disk
andrewhl has joined #ruby-lang
<drbrain>
andkerosine: hoe has `rake config_hoe` which merges your existing config atop any unset defaults and writes it back out
<drbrain>
so if you install a new plugin the new defaults get applied
twelvechairs has joined #ruby-lang
andkerosine has quit [#ruby-lang]
twelve_chairs has joined #ruby-lang
chimkan_ has joined #ruby-lang
twelvechairs has joined #ruby-lang
twelve_chairs has joined #ruby-lang
twelve_chairs has quit [#ruby-lang]
<ReinH>
seems bad
twelve_chairs has joined #ruby-lang
<ReinH>
printing directly to stdout without some intermediary way to get the string is ಠ_ಠ
vesan has joined #ruby-lang
<rue>
Readline's bad, too. I had to write a spec extension at some point to grab output from C routines
m3nd3s has joined #ruby-lang
<delinquentme>
is ruby written in C?
brownies has joined #ruby-lang
<delinquentme>
JRuby is the ruby implementation that runs on a JVM whereas Matz's ruby is a C implementation.
<rue>
They're both secretly written in Delphi
<shevy>
matz wrote ruby in C so yeah ruby is written in C
Banistergalaxy has joined #ruby-lang
QoQOoO has joined #ruby-lang
<delinquentme>
TIL
<Banistergalaxy>
delinquentme: what did you learn boy
<delinquentme>
Ruby is written in C :P
<delinquentme>
Banistergalaxy, someone shot me a link to your breakdown of object / class inheritance
<delinquentme>
heavy. made head hurt
<Banistergalaxy>
Oh haha
<delinquentme>
also I now know that I dont actually know what who how singelton
<delinquentme>
singleton*
<delinquentme>
but! im working on Jruby rjb magicery atm
postmodern has joined #ruby-lang
looopy has joined #ruby-lang
MistyM has joined #ruby-lang
andrewhl has joined #ruby-lang
QaDeS_ has joined #ruby-lang
slimfit has joined #ruby-lang
gix has joined #ruby-lang
<ReinH>
well I mean, no
<ReinH>
Ruby's reference implementation is in C
<ReinH>
But now that there's rubyspec, it's not as obvious that any implementation is more canonical
heppy_ has joined #ruby-lang
fayimora_ has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
jfelchner has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
chendo has joined #ruby-lang
flebel has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
S1kx has joined #ruby-lang
<epitron>
delinquentme: java is written in C :D
<delinquentme>
epitron, @_@
<epitron>
therefore, by the transitive property, jruby is written in C
<delinquentme>
^^^^
thegeekinside has joined #ruby-lang
jaska has joined #ruby-lang
dv310p3r has joined #ruby-lang
gnufied has joined #ruby-lang
ryanf has joined #ruby-lang
bryanl has joined #ruby-lang
bryanl has joined #ruby-lang
bryanl has joined #ruby-lang
elux has joined #ruby-lang
<elux>
hey
<elux>
can someone explain to me how Kernel.read_nonblock works? i understand it sends a read(2) system call with O_NONBLOCK flag..
srbartlett has joined #ruby-lang
<elux>
but.. how does it behave in ruby .. if i say do data = selector.read_nonblock(256) .. that will attempt to read 256 bytes from a io descriptor... but it wil be non-blocking.. so it should return right away ..
<elux>
there is no callback.. so when do i get the data..?
<elux>
maybe O_NONBLOCK doesnt do what i think it does..
<drbrain>
elux: I think O_NONBLOCK means read(256) will raise EAGAIN or EWOULDBLOCK if 256 bytes are not available
<elux>
yep
<elux>
thats a neat idea
xsdg has joined #ruby-lang
codewrangler has joined #ruby-lang
manhunter has joined #ruby-lang
<manhunter>
who is the operator for #ruby-lang
<drbrain>
manhunter: why does it matter?
<drbrain>
the ops don't really do anything around here
<manhunter>
then make me operator
<drbrain>
manhunter: then everybody would have to leave and wait for you to join first
<drbrain>
that sounds unlikely
<manhunter>
why?
<drbrain>
only an op can make you an op
<drbrain>
without a channel op, you have to be first to join
<drbrain>
it's how IRC works
<manhunter>
drbrain: i can't understand what you are saying
<manhunter>
drbrain: as you are operator, so make me operator
<manhunter>
drbrain: make me +v then
<drbrain>
manhunter: where is my @?
<drbrain>
I don't see an @ by my name, so I'm not an op
ttilley has joined #ruby-lang
<drbrain>
… so I can't make you an op, or give you voice
<manhunter>
drbrain: get the @ then
<drbrain>
then you'll need to leave
<drbrain>
please /part, then wait for everyone else to /part
<drbrain>
when everyone has left, I will join first
<manhunter>
are you sure everyone will leave
<manhunter>
does this occur?
<drbrain>
it might take a few weeks
<manhunter>
did you ever see that all left from channel?
<drbrain>
you will have to be patient
<manhunter>
did you ever see that all left from channel?
manhunter has quit ["WeeChat 0.3.6"]
<drbrain>
yes
<brownies>
drbrain: i can't believe that worked
<drbrain>
brownies: eventually they'd get bored and leave
<brownies>
heh
eydaimon has joined #ruby-lang
eydaimon has joined #ruby-lang
<drbrain>
but, it was fun!
pp01bit has joined #ruby-lang
guns has joined #ruby-lang
<delinquentme>
if im doing this: Rjb::load(classpath = jars , jvmargs=[]) and I want to check that the value of classpath has been modified... 1) how do I do this 2) the nomenclature ... this is obv a call to the Rjb class but am I looking for the classpath object?
<delinquentme>
^ seems correct to me ( if not plz corect the hell out of me :P )
<drbrain>
you can check if it was modified by classpath = jars.dup; …; jars.equal? classpath
<drbrain>
equal? checks same-object
<drbrain>
or, jars == classpath to check if the contents have changed
<drbrain>
^^ is probably better
<drbrain>
yeah, ignore equal? that was just wrong
<delinquentme>
drbrain, so the issue is im 90% sure I've modified the class path correctly .. however I'd like to verify it *inside* that Rjb instance .. not just the isolated values of the vars
<drbrain>
delinquentme: then you'll need to pull up the source of the load method
<drbrain>
you can't look inside methods and variables without inspecting the source or using the debugger
<drbrain>
instance variables, yes, but I don't recommend it
heftig has joined #ruby-lang
bryancp has joined #ruby-lang
<drbrain>
delinquentme: you should be able to trust that Rjb is doing the right thing
<delinquentme>
drbrain, true, however I think I've loaded it up correctly and I
macmartine has joined #ruby-lang
<delinquentme>
I've verified that my oscar = Rjb::import('uk.ac.cam.ch.wwmm.oscar.Oscar') import is correct .. however im still getting NoClassDefFoundErros
<guns>
I have implemented a DirectedGraph class that can produce graphs like http://i.imgur.com/MUFeB.png via GraphViz. What is the proper way to get the "levels" of the graph? My #tsort uses Tarjan's reverse depth-first search, but that only produces a flat list.
<guns>
I can see that each "level" is defined by the longest path to a root of the graph
flebel has joined #ruby-lang
<guns>
But there must be an efficient way to determine this.
<delinquentme>
drbrain, SISO
<drbrain>
delinquentme: I'm unsure ☹
<drbrain>
delinquentme: at this point I poke around inside
wmoxam has joined #ruby-lang
<delinquentme>
drbrain, shit in shit out :D i gave it an incorrect path
<delinquentme>
>_<
<drbrain>
ah, I'm more familiar with GIGO
bryancp has joined #ruby-lang
<WillMarshall>
Hey! An interesting question for you guys. I am using Postgres views on a couple of models, and currently the way my migrations work, I have to tear down the view, make a change and rebuild the view every time I want to adjust the table behind one of these models
vesan has joined #ruby-lang
<drbrain>
WillMarshall: sounds like a question for #ror
<WillMarshall>
drbrain: Haha, sorry, I keep doing this
heppy has joined #ruby-lang
heftig has joined #ruby-lang
<wmoxam>
gh, I wish Rails would tell you that you need a js runtime on installation
twittard has joined #ruby-lang
<wmoxam>
rather than just crash when trying to do something
<drbrain>
LOL
gianlucadv has joined #ruby-lang
<wmoxam>
its pretty stupid
<whitequark>
I second that.
<whitequark>
recognizing execjs problems is one of the most stupid and annoying tasks in rails.
<WillMarshall>
Hey! Lazy-loaded classes, at what point do they get loaded?
<wmoxam>
I love how a dude in #ror is defending it as being reasonable
<wmoxam>
user friendly even
<WillMarshall>
e.g. if I run my_method(FooClass)
<WillMarshall>
Will FooClass be loaded before my_method is run? I'm assuming yes
<whitequark>
wmoxam: please, tell him I think he is stupid.
<wmoxam>
whitequark: :D
jtoy has joined #ruby-lang
<delinquentme>
drbrain, can I borrow your brain for a minute ? https://gist.github.com/1881354 specifically ln:4 ... List<ResolvedNamedEntity> entities = oscar.findAndResolveNamedEntities(s) I need to get that method within the scope of this code ... the examples are all for class instantiation .. any ideas?
achiu has joined #ruby-lang
twelvechairs has joined #ruby-lang
<drbrain>
delinquentme: guessing, but, add .new to line 28?
<delinquentme>
drbrain, ok magic im missing something here
<delinquentme>
i thought that the existing def instantiated it .. thats obv not the case
<drbrain>
I guessed that import just loaded it
bryancp_ has joined #ruby-lang
M- has joined #ruby-lang
<delinquentme>
drbrain, kind of weird that you'd place an import into a var though?
<drbrain>
delinquentme: no, I put classes in variables all the time
<drbrain>
just today I wrote patch = Class.new Net::HTTPRequest do … end
bryancp__ has joined #ruby-lang
<delinquentme>
TIL
<drbrain>
it's not common, but it's not unknown
<drbrain>
you can also use :: with a local variable
<drbrain>
arbitrary_namespace::SOME_CONSTANT
<delinquentme>
yeahh thought so!
bryancp has joined #ruby-lang
bryancp_ has joined #ruby-lang
<eydaimon>
"when you open an email and there's an attachment, you're using your upload bandwidth" -- John, centurlink tech support guy
<eydaimon>
*sigh*
<delinquentme>
mannnn
<delinquentme>
dumb ^
<delinquentme>
im getting this crazy feeling
<delinquentme>
that ... I can program
<bnagy>
fight it
<delinquentme>
had this rjb object that was giving me issues .. so I looked it up .. found out theres a way to get the methods I can use to operate on it
gjaldon has joined #ruby-lang
<delinquentme>
and transformed the java output into something usable
<delinquentme>
nuts man
rohit has joined #ruby-lang
eydaimon has joined #ruby-lang
eydaimon has joined #ruby-lang
rippa has joined #ruby-lang
twittard has joined #ruby-lang
macmartine_ has joined #ruby-lang
RenatoSilva has joined #ruby-lang
RenatoSilva has quit [#ruby-lang]
tjadc has joined #ruby-lang
<delinquentme>
overloading in Rjb: instance = str.new_with_sig('Ljava.lang.String;', 'hiki is a wiki engine')
<delinquentme>
does the Ljava look right drbrain ?
macmartine_ has joined #ruby-lang
eydaimon has joined #ruby-lang
eydaimon has joined #ruby-lang
eydaimon has joined #ruby-lang
eydaimon has joined #ruby-lang
woollyams has joined #ruby-lang
JohnBat26 has joined #ruby-lang
ovnimancer has joined #ruby-lang
amerine has joined #ruby-lang
dfr|mac has joined #ruby-lang
heppy has joined #ruby-lang
jfire has joined #ruby-lang
jfire has quit [#ruby-lang]
dc5ala has joined #ruby-lang
x0F__ has joined #ruby-lang
macmartine has joined #ruby-lang
twittard has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
butchanton has joined #ruby-lang
macmartine_ has joined #ruby-lang
QoQOoO has joined #ruby-lang
macmartine_ has joined #ruby-lang
ryanf has joined #ruby-lang
burgestrand has joined #ruby-lang
macmartine has joined #ruby-lang
butchanton has joined #ruby-lang
kitallis has joined #ruby-lang
yxhuvud has joined #ruby-lang
brownies has joined #ruby-lang
achiu has joined #ruby-lang
thone has joined #ruby-lang
|Vargas| has joined #ruby-lang
Stalkr_ has joined #ruby-lang
guns has joined #ruby-lang
macmartine has joined #ruby-lang
heftig has joined #ruby-lang
evenix has joined #ruby-lang
chimkan_ has joined #ruby-lang
burgestrand has joined #ruby-lang
achiu1 has joined #ruby-lang
QaDeS has joined #ruby-lang
frangiz has joined #ruby-lang
mytrile has joined #ruby-lang
Fullmoon has joined #ruby-lang
solars has joined #ruby-lang
bjensen has joined #ruby-lang
burgestrand has joined #ruby-lang
workmad3 has joined #ruby-lang
Indian has joined #ruby-lang
daglees has joined #ruby-lang
jtoy has joined #ruby-lang
SPYGAME has joined #ruby-lang
<yorickpeterse>
Morning lads
Defusal has joined #ruby-lang
Luxx_ has joined #ruby-lang
Z33K|Lux has joined #ruby-lang
NARKOZ has joined #ruby-lang
<duckinator>
anyone lurking and happen to know what the C portion of MRI refers to $DEBUG as? or, alternatively, what all of the side effects of having $DEBUG=true are
* duckinator
is trying to track down a bug that is magically fixed when $DEBUG==true
<hipe>
i've been doing ruby for decades, *centuries* event, and i never ran into this: what do you do when you don't want your &block s to go up in the call to super() ? https://gist.github.com/1883962
<hipe>
oh i guess i can pass super(& nil) explicitly but eew
<sweethorse>
heftig: sup heftyboy
<sweethorse>
hipe: &nil
<hipe>
sweethorse: thx !
alim_ has joined #ruby-lang
<sweethorse>
hipe: np
Mchl has joined #ruby-lang
<shevy>
ewww
<shevy>
&nil
<shevy>
ugliest thing I've ever seen
M- has joined #ruby-lang
sdeobald has joined #ruby-lang
<kke>
what's the situation with 1.9.3 debugging? seems like there's only threadframe patch for 1.9.2
looopy has joined #ruby-lang
Indian has joined #ruby-lang
<Gekz>
so er, what's the proper way to make a gem?
<Gekz>
I have foo.rb in lib/, with a foo/ directory with bar.rb
<Gekz>
what's the proper way to require it from the parent module?
<rue>
When you create the gem, and it's installed, you'll have foo.rb and foo/bar.rb available for requires
<retro|cz>
How can i get class name when I'm asking from extended module?
<rue>
retro|cz: What did you try?
<Gekz>
rue: so basically, I can just require foo/bar from foo without issue?
<retro|cz>
class Server; extends Another;end
<retro|cz>
And in another
<retro|cz>
I'm trying to print self.class
<retro|cz>
in method
<retro|cz>
but I'm getting Another when I'm calling it from Server
<retro|cz>
rue, is it understandable?
<rue>
retro|cz: That doesn't seem right
<rue>
module M; def foo; p self.class; end; end; class C; include M; end; C.new.foo # => C
<retro|cz>
But I'm extending, not including.
canton8 has joined #ruby-lang
<kke>
Gekz: there was a link to some article "so you're writing a gem" or something on rubyflow.com just today
<heftig>
module M; def foo; p self; end; end; class C; extend M; end; C.foo # => C
<heftig>
still works
<retro|cz>
heftig, :(
<rue>
retro|cz: extend == include into singleton class
sat has joined #ruby-lang
leopard_me has joined #ruby-lang
rohit has joined #ruby-lang
leopard_me has joined #ruby-lang
bjensen_ has joined #ruby-lang
mytrile has joined #ruby-lang
workmad3 has joined #ruby-lang
looopy has joined #ruby-lang
codewrangler has joined #ruby-lang
uniqanomaly has joined #ruby-lang
gnufied has joined #ruby-lang
jtoy has joined #ruby-lang
csherin has joined #ruby-lang
gnufied1 has joined #ruby-lang
Jade has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
yalue has joined #ruby-lang
headius has joined #ruby-lang
rohit has joined #ruby-lang
anthony has joined #ruby-lang
gnufied2 has joined #ruby-lang
gentz has joined #ruby-lang
Indian has joined #ruby-lang
workmad3 has joined #ruby-lang
rdw200169 has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
Spooner has joined #ruby-lang
jxie has joined #ruby-lang
m3nd3s has joined #ruby-lang
bagratte has joined #ruby-lang
mark_locklear has joined #ruby-lang
znz_v has joined #ruby-lang
workmad3 has joined #ruby-lang
seanstickle has joined #ruby-lang
chendo has joined #ruby-lang
fayimora_ has joined #ruby-lang
andrewhl has joined #ruby-lang
mosca_ has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
v0yager has joined #ruby-lang
MistyM has joined #ruby-lang
rippa has joined #ruby-lang
gnufied has joined #ruby-lang
looopy has joined #ruby-lang
NARKOZ has joined #ruby-lang
willdrew has joined #ruby-lang
robbrit has joined #ruby-lang
rayners has joined #ruby-lang
judofyr has joined #ruby-lang
<judofyr>
RUBY RUBY RUBY RUBY
<judofyr>
no?
<seanstickle>
That's what all the kids on the street are singing these days.
<ddfreyne>
too mainstream these days
hibariya has joined #ruby-lang
<seanstickle>
ddfreyne: come with me to APL-land!
<judofyr>
/o\
<seanstickle>
Is that the hands of rejoicing?
<seanstickle>
Or the hands of terror?
<ddfreyne>
terror
<ddfreyne>
\o/ is rejoicing
<seanstickle>
I thought maybe you were doing a little dance.
<judofyr>
\o\
<judofyr>
/o/
<judofyr>
|o|
bglusman has joined #ruby-lang
at5l has joined #ruby-lang
<seanstickle>
Ha
<shevy>
\o\
<shevy>
|
<shevy>
ack
<shevy>
:(
<shevy>
I think I killed the ascii man
havenn has joined #ruby-lang
<robbrit>
maybe he's all partied out
<seanstickle>
From all that APL programming
twelvechairs has joined #ruby-lang
<twelvechairs>
anyone here use sublime text?
vdrab has joined #ruby-lang
<injekt>
twelvechairs: just started playing with it like 20min ago
<injekt>
so I probably cant help much if you have questions :)
<twelvechairs>
injekt: same here. i guess you are on hn too?
<injekt>
twelvechairs: Yeah, I thought it was about time I gave it a go
<twelvechairs>
injekt: my problem is im trying to 'build' sometihng, but the gtk windows I am making dont show up...
<injekt>
twelvechairs: hmm odd, I haven't tried that yet and im on osx
<twelvechairs>
injekt: yeah. I'm on windows atm... so it could of course be that :)
<twelvechairs>
looks like a good editor otherwise. nice clean interface
<injekt>
yeah I'm actually really enjoying it, and I come from vim
<twelvechairs>
yeah. I haven't quite got there with vim yet - too many keys/commands to learn :)
leonL has joined #ruby-lang
enebo has joined #ruby-lang
<judofyr>
twelvechairs: you only need to learn :wq emacs
<injekt>
dont listen to judofry
sockmonk has joined #ruby-lang
<twelvechairs>
oh oh. A vim argument!
<seanstickle>
As long as you've symlinked emacs to vim, you'll be fine
<judofyr>
fibers would let me get rid of one level of indentation
<manveru>
yeah, until you try to find two objects by id :)
<judofyr>
this logic is inherently sync: I need to fetch the artifact-info before I can fetch comments, tags etc.
<judofyr>
manveru: indeed. fibers make async code look natural; callbacks make sync code look natural
Aengus has joined #ruby-lang
<judofyr>
in the same controller I fetch comments and tags; and those things can happen in parallel; so callbacks make more sense
<judofyr>
s/;//
<manveru>
yeah
<manveru>
dunno, i'm just lazy
<manveru>
using fibers looks overall like more work for little benefit
<manveru>
but then i'm not exactly representative of anything
<judofyr>
manveru: sure. I'm just asking around, because it seems that there are two types of people: "omg, fibers are awesome" and "wtf, y u fiber?"
<judofyr>
and I'm like: "hey guys, let's use both ALL THE TIME"
<judofyr>
(as in, both callbacks and fibers)
<manveru>
:)
<manveru>
as long as you write the code, sure
<judofyr>
manveru: that said, callbacks often require more synchronization anyway. e.g. in that Perl-snippet I wrap all callbacks in $self->parallol(), which makes sure to call `render` after all the callbacks have been invoked.
<manveru>
i actually prefer goroutines, so nothing in ruby makes me happy ^^;
<judofyr>
running "actor.increment!" is pretty much like "go increment" in Go
kitallis has joined #ruby-lang
<manveru>
neat :D
<judofyr>
anyway
<judofyr>
gotta go
<manveru>
thanks
<judofyr>
manveru: it was nice talking to ya
<manveru>
cu
leonL has joined #ruby-lang
sat has joined #ruby-lang
bagratte has joined #ruby-lang
kitallis has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
dRbiG has joined #ruby-lang
Defusal_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
evenix has joined #ruby-lang
kitallisii has joined #ruby-lang
virunga has joined #ruby-lang
delinquentme has joined #ruby-lang
pbjorklund has joined #ruby-lang
fayimora has joined #ruby-lang
andkerosine has joined #ruby-lang
pbjorklund has joined #ruby-lang
Indian has joined #ruby-lang
achiu has joined #ruby-lang
<cschneid>
anybody have a suggestion for a daemonizing gem? Specifically, I have a quick task I need to fireoff at the top of each minute (:00 seconds), within a reasonable, but small margin of error
<cschneid>
And that loop should be running in the background (daemonized)
<retro|cz>
How can I setup debug for ruby 1.9.3-p125?
malev has joined #ruby-lang
rockpapergoat has joined #ruby-lang
looopy has joined #ruby-lang
pbjorklund has joined #ruby-lang
Skif has joined #ruby-lang
kitallis has joined #ruby-lang
H2H has joined #ruby-lang
looopy has joined #ruby-lang
tbuehlmann has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
rushed has joined #ruby-lang
alexkane has joined #ruby-lang
andkerosine has quit [#ruby-lang]
amerine has joined #ruby-lang
solars has joined #ruby-lang
heppy has joined #ruby-lang
butchanton has joined #ruby-lang
<cschneid>
I need to reliably align a task to the beginning of a minute, with sub-second granularity. Does anybody have a suggestion for a library that can handle a requirement like: "Run this at the top of the minute, as close to the start of that minute as possible). Ideally within a quarter of a second.
<bitrot>
cschneid: crontab doesn't get close enough?
apeiros_ has joined #ruby-lang
virunga has joined #ruby-lang
mrsolo has joined #ruby-lang
nilibanili has joined #ruby-lang
headius has joined #ruby-lang
nilibanili has joined #ruby-lang
macmartine has joined #ruby-lang
rdw200169 has joined #ruby-lang
whatasunnyday has joined #ruby-lang
bryancp has joined #ruby-lang
whatasunnyday has joined #ruby-lang
whatasunnyday has joined #ruby-lang
Stalkr_ has joined #ruby-lang
Taranis has joined #ruby-lang
erics has joined #ruby-lang
Skif_home has joined #ruby-lang
eschwartz has joined #ruby-lang
havenn has joined #ruby-lang
gianlucadv has joined #ruby-lang
whatasunnyday has joined #ruby-lang
whatasunnyday has joined #ruby-lang
Skif has joined #ruby-lang
hipe has quit [#ruby-lang]
flebel has joined #ruby-lang
Carnage\ has joined #ruby-lang
niklasb has joined #ruby-lang
plusk has joined #ruby-lang
fayimora has joined #ruby-lang
postmodern has joined #ruby-lang
<amerine>
bitrot: jokes?
twittard has joined #ruby-lang
bryancp has joined #ruby-lang
wyhaines has joined #ruby-lang
gianlucadv has joined #ruby-lang
<bitrot>
amerine: nope.
<shevy>
bitrot: drugs?
<bitrot>
shevy: nope.
phazenine has joined #ruby-lang
nilibanili has joined #ruby-lang
srbaker has joined #ruby-lang
<bitrot>
It's the sort of "have you measured it" approach, that's all.
<phazenine>
anyone know how to sort a column using Spreadsheet?
workmad3 has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
bosie has joined #ruby-lang
<TTilus>
phazenine: this channel is about ruby the programming language, you should be looking for that kind of advanced stuff elsewhere
adambeynon has joined #ruby-lang
havenn has joined #ruby-lang
jamw has joined #ruby-lang
paddor has joined #ruby-lang
bryancp has joined #ruby-lang
<shevy>
phazenine if it is ruby bindings, the only two ways I can think of are looking for examples in the bindings, or in the source
nilibani_ has joined #ruby-lang
<phazenine>
mmm okay how bout this, is there a way to sort ObjectSpace before calling .each_object?
justinmcp has joined #ruby-lang
* outoftime
head explodes
jfelchner has joined #ruby-lang
<outoftime>
phazenine: there sure isn't.
leonL has joined #ruby-lang
bcardarella has joined #ruby-lang
klarrimore has joined #ruby-lang
nilibanili has joined #ruby-lang
<bcardarella>
When I require a file that was already required I'm assuming that was registered somewhere so if I try to register that file again I just get back 'false'. Is there a way to clear that entry so that I can force the file to be required again?
<deryldoucette>
no, require only loads it once
<deryldoucette>
load does it every time
<bcardarella>
ah, thank-you
looopy has joined #ruby-lang
<deryldoucette>
np
GiambalaGiambala has joined #ruby-lang
chris2 has joined #ruby-lang
virunga has joined #ruby-lang
curtism has joined #ruby-lang
curtism has joined #ruby-lang
codewrangler has joined #ruby-lang
bglusman has joined #ruby-lang
bjensen has joined #ruby-lang
jammi has joined #ruby-lang
imperator has joined #ruby-lang
rtl has joined #ruby-lang
s0ber_ has joined #ruby-lang
y3llow_ has joined #ruby-lang
<imperator>
good afternoon
y3llow has joined #ruby-lang
workmad3 has joined #ruby-lang
rtl has joined #ruby-lang
y3llow has joined #ruby-lang
rtl has joined #ruby-lang
<yorickpeterse>
Anybody know of a decent way to profile Rack applications? Perftools.rb is broken for 1.9.3 so rack-perftools_profiler sadly is out of the question
darkf has joined #ruby-lang
nofxx_ has joined #ruby-lang
bglusman has joined #ruby-lang
woollyams has joined #ruby-lang
havenn has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
pogopolice has joined #ruby-lang
wallerdev has joined #ruby-lang
jenaiz has joined #ruby-lang
<nofxx_>
Planning how to receive and process mail... between pooling imap X minutes or find a linux server to pipe to a ruby process
<nofxx_>
any good/bad experience around ?
butchanton has joined #ruby-lang
<nofxx_>
pool imap seems more nice, just wonder if it will work nice in a parallel scenario, is the delete message atomic? heh
robbrit has quit [#ruby-lang]
metrix has joined #ruby-lang
lsegal has joined #ruby-lang
<metrix>
If I want to create a method that I can call with 1 or 0 arguments. which would be called like: test() or test('abc') how do I do this?
<virunga>
metrix, maybe using the asterisc (*)
<virunga>
def test(args*)
wallerdev has joined #ruby-lang
<metrix>
ok, I will google
<metrix>
Thank you!
<virunga>
but so it can take n argument either
<virunga>
s
<metrix>
ok
<Mon_Ouie>
def test(*args)
<Mon_Ouie>
And in that case you'd more likely want default arguments
<virunga>
metrix, better def test(arg=nil) i think
malev_ has joined #ruby-lang
<virunga>
it can take one or zero... with * it can take n arguments
<outoftime>
also, SQL databases happen to be great fits for a lot of problems, especially if you use SQL : )
<drbrain>
ged: does PQnotifies return immediately?
<drbrain>
or does PQconsumeInput block?
<outoftime>
shevy: oh, I would be remiss not to mention ElasticSearch, which technically is a search index not a database, but actually works very nicely as a document store if fulltext search is a big part of your use case
wmoxam has joined #ruby-lang
<ged>
drbrain: Yes, it returns a NULL pointer if there aren't any pending.
<erikh>
see also: solr
<erikh>
or maybe ES uses solr
<drbrain>
found the PG documentation for these two...
<outoftime>
erikh: it does not
<drbrain>
ged: it looks like you could either switch to rb_thread_fd_select, or wrap PQconsumeInput in rb_thread_blocking_region
<outoftime>
erikh: ES is a bit better suited to be a document store as it holds on to the JSON documents that you index as-is, and allows lookup by ID
<drbrain>
ged: I was looking at the last paragraph ^^
<zenspider>
rubyinline 3.11.2 released
<drbrain>
it seems to say that PQconsumeInput will block
<erikh>
outoftime: I think chef is using solr in the way you describe, but I can't speak directly to its effectiveness
<erikh>
they use a combo of solr/lucene/couch
<ged>
drbrain: Yeah, that's pretty much exactly what #wait_for_notify does. :)
<outoftime>
erikh: you can get the same effect re: storing the full document just by setting all the fields to stored, but as far as I'm aware solr doesn't have a get-by-ID capability
<erikh>
solr has search features by key -- at least the chef implementation does
<erikh>
honestly, my only experience with solr is via chef, so I can't speak to it from a pure implementation standpoint.
<ged>
But it used to select on the PQsocket with rb_thread_select(), as it was written before there was anything else that avoided blocking.
<outoftime>
erikh: oh, sure, one could always do that. main difference is with ES get-by-ID is real-time in a distributed environment, whereas search (for both Solr and ES) is near-real-time at best
<drbrain>
ged: you can probably wrap the entire while loop in rb_thread_blocking_region to reduce GVL contention
<ged>
drbrain: Yeah, since it doesn't talk to Ruby at all, right?
<erikh>
in practice it hasn't been an issue, but I see what you're saying
<erikh>
atomic vs. non-atomic
<ged>
It's only when you need something from Ruby-land that you have to jump back.
<drbrain>
ged: *nod*
<andrewvos>
mongo loses your data!!!11
* andrewvos
has left the conversation
<erikh>
mongo doesn't lose data until it crashes
<erikh>
let's be clear
CoverSlide has joined #ruby-lang
<erikh>
the problem with these nosql stores is that I have to maintain like 5 of them at work
<erikh>
because everyone wants to use their own little version of the same thing
<erikh>
that's literally my only gripe about them
<outoftime>
erikh: not exactly an issue of atomicity, more an issue of real-time consistency. if you need atomicity, neither ES or Solr is gonna do it.
<andrewvos>
apeiros_: What the fuck is that??
<erikh>
outoftime: gotcha
<musl>
apeiros_: You will post that to the daily WTF, won't you?
<apeiros_>
andrewvos: insanity in ~1200 lines…
<andrewvos>
apeiros_: WHY WHY WHY
<burgestrand>
apeiros_: awesome, this way you can hire somebody to program in more days :d
<apeiros_>
andrewvos: I wondered the same, the answer is: "Time constants, in seconds, so you don't have to use slow ActiveSupport helpers"
* apeiros_
facepalm
<erikh>
apeiros_: my god that's beautiful
<erikh>
in the train wreck way
<apeiros_>
they should have written that as a C extension
<apeiros_>
since ruby is *too slow*
<canton7>
it gets a little more sane if you read the Rakefile. Almost a relief
<ged>
burgestrand: Don't you mean "in T_2_DAYS"?
<musl>
4871% change! OMG, it's full of the fast!
<burgestrand>
ged: :d
<apeiros_>
canton7: then you read code where it is used: remaining = Object.const_get("T_#{count}DAY#{count!=1?"S":""}")
<apeiros_>
;-)
<zenspider>
my god I love 1000 tests / second
* zenspider
kisses all his fast projects
<erikh>
hehe, you should see the IO::Compress::Zlib tests
<erikh>
around 900k tests that just fly by
<zenspider>
apeiros_: I double dog dare you to submit a pull req w/ C optimizations
<canton7>
apeiros_, ah, ouch!
<andrewvos>
apeiros_: Triple dare?
<apeiros_>
canton7: I don't know how it is used, mind you
<apeiros_>
if it weren't midnight and me only having slept 2h last night…
<rue>
erikh: Fly by nite, amirite?
<apeiros_>
I mean, it's just a couple of const definitions in C…
<apeiros_>
interesting: Copyright 2011 Twitter, Inc.
<zenspider>
vlad 2.2.5 released
* apeiros_
off to bed, gn8
<zenspider>
bah
<erikh>
rue: it's a pretty awesome test suite
<erikh>
rue: does ryan just have me on ignore or something?
<deryldoucette>
what is? (always looking to see new or different test suites)
<erikh>
IO::Compress::Zlib -- from perl
<rue>
erikh: Probably
<erikh>
meh
fredguest has joined #ruby-lang
dejongge has joined #ruby-lang
<rue>
IRC::Erikh::Ignore
<erikh>
hehe
<erikh>
so it goes.
<erikh>
oh well, it's marginally frustrating because I still don't know what I did to the guy other than disagree with him on numerous occasions.
<zenspider>
UGH... 1.9.2 is just a fucking mess.
evenix has joined #ruby-lang
tomzx has joined #ruby-lang
WillMarshall has joined #ruby-lang
dragonkh has joined #ruby-lang
leonL has joined #ruby-lang
srbaker has joined #ruby-lang
Karmaon has joined #ruby-lang
andrewhl has joined #ruby-lang
paddor has joined #ruby-lang
znz_jp has joined #ruby-lang
<unsymbol>
zenspider: why do you say that?
woollyams has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<zenspider>
unsymbol: in this case because rake isn't properly packaged as a gem and 1.9.2 does loaded features with the full path instead of basename, leading to really fucked up multiple defined constant warnings
<zenspider>
I think it is fine that ruby ships with 3rd party gems...but they should actually BE installed as gems
MistyM has joined #ruby-lang
gregmoreno has joined #ruby-lang
qz has joined #ruby-lang
andrewhl has quit [#ruby-lang]
bcardarella_ has joined #ruby-lang
ChloeD_ has joined #ruby-lang
andman has joined #ruby-lang
epitron_ has joined #ruby-lang
threeday1onk has joined #ruby-lang
<andrewvos>
hmm, sounds logial
<andrewvos>
logical*
floyd2_ has joined #ruby-lang
<unsymbol>
agreed
<deryldoucette>
i can't find fault with that argument