<WillMarshall>
HealthProduct inherits from Product
<WillMarshall>
Product includes Pipes::Pipe
<injekt>
ah
<WillMarshall>
Pipes::Pipe writes to the inherited(sub) hook, sub is a reference to HealthProduct
<WillMarshall>
then I include the appropriate module directly into sub/HealthProduct
<WillMarshall>
No longer backwards :)
<WillMarshall>
I think I might just be attempting to be a clever dick, however
<injekt>
we've all been there
<WillMarshall>
I'm refactoring an application from super-clever-dickery to somewhat-clever-dickery
<WillMarshall>
So I think it's justified
<WillMarshall>
At least the classes aren't being dynamically generated from rows in a DB table anymore >.>
<WillMarshall>
Just piced together with macroes and magic
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
slimfit [slimfit!~slimfit@50-76-131-66-static.hfc.comcastbusiness.net] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
tomzx [tomzx!~tomzx@ppp-53-5.mtl.contact.net] has joined #ruby-lang
ilyam [ilyam!~ilyam@2620:65:0:281:cda7:2992:9bd9:e3a9] has joined #ruby-lang
<WillMarshall>
Hash question! Is there any way I can either have case-insensitive keys, or downcase all my keys easily?
<zenspider>
that sounds like a GREAT idea... :/
<injekt>
lol
<WillMarshall>
Pfft. You people and your "good ideas"
<injekt>
he's got a point, it's quite a terrible one
<erikh>
eh depending on the use case...
<WillMarshall>
Well, I'm trying to represent data from a CSV in a hash, but all the col names are ALLCAPS
<erikh>
still won't prevent it from being dog slow
<optikalmouse>
you can't hash objects as keys?
<optikalmouse>
:|
<injekt>
...
<injekt>
optikalmouse: what?
<bougyman>
why not?
<injekt>
hash objects as keys?
<injekt>
bougyman: you understood that?
<erikh>
hash keys can be anything
<WillMarshall>
But I really want to access the column names either case-insensitively or just downcase them all, so I don't have Ruby code littered with ALLCAPs col references
* injekt
must be missing something
<bougyman>
injekt: i think so
<bougyman>
so did erikh :)
<erikh>
anything that implements #hash
<optikalmouse>
I'm just reading whatever WillMarshall wrote XD
<injekt>
bougyman: he meant hashes as keys?
<injekt>
bougyman: like a Hash hash?
<bougyman>
who the what?
<erikh>
and Object#hash is, IIRC, just a reference to object_id
<injekt>
the when?
<WillMarshall>
HashWithIndifferentAccess, no less
<optikalmouse>
injekt: I meant objects as keys in a hash; myHash[myObject] = whateverMan
<bougyman>
like columns.zip(values)
<WillMarshall>
{:like => :this}
<injekt>
optikalmouse: that's fine
<hagabaka>
it's fine to have your code littered with ALLCAPS
<bougyman>
injekt: yeah, not he lost me
<bougyman>
er now.
<injekt>
:D
<injekt>
\o/
<erikh>
WillMarshall: have you considered lowercasing the column names BEFORE you store them in the hash?
<WillMarshall>
erikh: Yeah, that's the other approach. I suspect it makes more sense
<erikh>
considerably.
<injekt>
i think you should uppercase them all instead
<injekt>
:o
<WillMarshall>
ALLCAPS
<WillMarshall>
I think I should drink some more coffee
<erikh>
that might be a bad idea.
<erikh>
:P
<WillMarshall>
Bollocks. More drugs is always better than fewer drugs
<injekt>
WillMarshall: are you british?
<WillMarshall>
injekt: Yesish
<injekt>
It shows
<WillMarshall>
How's that?
<erikh>
injekt: haha like you have any room to talk
<injekt>
haha
<injekt>
I talk all proper and stuff
<injekt>
WillMarshall: 'bollocks' caught me
<erikh>
injekt: you talk all proper... you mean like an american?
<injekt>
aahaha
<erikh>
(see folks, this is the way to ferret out a british man)
<WillMarshall>
My BM crew have matching tshirts emblazoned with RANTY SAYS BOLLOCKS
<WillMarshall>
It makes more sense in context
<injekt>
no proper like anyone who's not american
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
butchanton [butchanton!~butchanto@64.134.221.138] has joined #ruby-lang
MistyM [MistyM!~MistyM@50.72.70.192] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.230.17] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@subtle/user/kyrylo] has joined #ruby-lang
corecode [corecode!~2@0x2c.org] has joined #ruby-lang
plusk [plusk!~plusk@201-24-167-220.gnace703.dsl.brasiltelecom.net.br] has joined #ruby-lang
magicbeef [magicbeef!~magicbeef@74-95-6-5-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
huxtable [huxtable!~huxtable@108-90-18-133.lightspeed.cicril.sbcglobal.net] has joined #ruby-lang
<shevy>
the british will always be famous for monty python
<WillMarshall>
Any way I can print out the body of a method on a Class in IRB?
virgo12055 [virgo12055!~virgo1205@adsl-98-64-4-69.mia.bellsouth.net] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
<lianj>
method_source gem maybe, or use pry which uses that
<virgo12055>
hello
<virgo12055>
how's everyone? busy nite huh
<virgo12055>
wuts da topic of no nite?
<zenspider>
pry sounds interesting. I should try it out sometime
<virgo12055>
am new here,maybe any one wanna tell me about this chat?
<virgo12055>
lik how it works?
<zenspider>
you type something interesting... we respond. and vice-versa
<virgo12055>
hello? am I alone here?
<virgo12055>
awww thats sweet
<virgo12055>
kool , interesting like>? dunno wuts interesting to u?
<virgo12055>
interesting in wut way?
naz [naz!~n@70.44.2.190.res-cmts.bus.ptd.net] has joined #ruby-lang
<virgo12055>
can u specify s lil ?
<virgo12055>
are we lik de only ones here?
<virgo12055>
at least your nice
<zenspider>
virgo12055: this is a channel for the ruby programming language...
<zenspider>
so... that's interesting
<virgo12055>
ok,, am sorry to ask,but what do u mean by that?
<virgo12055>
and how would i get into a reg chat room?
<zenspider>
I mean if you're not here to talk about ruby, you should prolly find somewhere else
<virgo12055>
doesnt have to b where theres alot of ppl
<zenspider>
this entire IRC server, freenode, is dedicated to open-source development... so pretty much every channel will be dedicated to a programming language, or library
<virgo12055>
jajajaaaa i dont mean that sillyyy . I meant i dont really know how this works,i am into chat rooms any lontger
<virgo12055>
am toooo old for this
<virgo12055>
jajaaaaaa
<virgo12055>
ohhhhh kool
<virgo12055>
so thats out of my league
<virgo12055>
thats for smart ppl
<virgo12055>
hummm not me definitly,,,, jajajaaa
<virgo12055>
but I'll survive. Again,wut is interesting to you? wut do you consider interesting?
<virgo12055>
and why am I the only typist here?\
<virgo12055>
I guess you would say I talk to much also,right?
<virgo12055>
awwww wut a shame in the best part of the conversation. Guess he couldnt handle my geekness
<virgo12055>
:p
<virgo12055>
why u leave me?
<lianj>
type: /part
<virgo12055>
huh?
bobbywilson0 [bobbywilson0!~bobbyw@c-67-190-166-159.hsd1.co.comcast.net] has joined #ruby-lang
<virgo12055>
I am kinda lost here
<zenspider>
we can tell
<virgo12055>
gotta see how to dismiss my self from this chat
<erikh>
try /part
<zenspider>
so again... you're not here to talk about ruby, you should prolly go
<virgo12055>
u hurt my feeling,but its ok
<virgo12055>
i forgive you
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
virgo12055 [virgo12055!~virgo1205@adsl-98-64-4-69.mia.bellsouth.net] has quit [#ruby-lang]
otertore [otertore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@149.147.215.210] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@149.147.237.122] has joined #ruby-lang
<zenspider>
well that was productive
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
aroop [aroop!~aroop@50.46.157.247] has joined #ruby-lang
newbold [newbold!~adam@2002:4a86:1bda:0:8d9:5069:7174:7ede] has joined #ruby-lang
echoprinter [echoprinter!~j3@unaffiliated/echoprinter] has quit [#ruby-lang]
banister_ [banister_!~baniseter@115.189.37.117] has joined #ruby-lang
fayimora [fayimora!~fayimora@95.175.159.12] has joined #ruby-lang
slimfit [slimfit!~slimfit@c-98-245-122-231.hsd1.co.comcast.net] has joined #ruby-lang
mdel_ [mdel_!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
slippyd [slippyd!~slippyd@pool-71-241-153-24.nycmny.fios.verizon.net] has joined #ruby-lang
MistyM [MistyM!~MistyM@50.72.70.192] has joined #ruby-lang
NARKOZ [NARKOZ!~NARKOZ@46.228.177.254] has joined #ruby-lang
maxx- [maxx-!~maxx573@67.207.135.16] has joined #ruby-lang
magicbeef [magicbeef!~magicbeef@74-95-6-5-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@149.147.222.202] has joined #ruby-lang
heppy_ [heppy_!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has joined #ruby-lang
x0F [x0F!~x0F@unaffiliated/x0f] has joined #ruby-lang
<WillMarshall>
Is there any way I can get a list of Classes in a Module from that Module?
<banister_>
WillMarshall: Yeah
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has quit [#ruby-lang]
shevy [shevy!~shevy@178-191-255-205.adsl.highway.telekom.at] has joined #ruby-lang
Telmo [Telmo!~telmo@c-68-44-135-81.hsd1.pa.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@46.186.229.27] has joined #ruby-lang
<rue>
ryez: Firewall, maybe?
michael_mbp__ [michael_mbp__!~Marin@31.203.28.167] has joined #ruby-lang
jamiemill [jamiemill!~jamiemill@87-194-220-111.bethere.co.uk] has joined #ruby-lang
<ryez>
rue: thanks, but I'm not sure if it's a firewall issue
<ryez>
though I'm actually behind the so called GFW
<erikh>
anyone know of a standard array type with fixed boundaries?
<erikh>
basically like a C array
naquad [naquad!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
<rue>
A C array
<rue>
erikh: Elaborate. An array is, definitionwise, fixed-size
<erikh>
yes but ruby arrays are not
<rue>
Ruby's got dynamic arrays, if we're precise
<erikh>
ruby's array type is more of a list type
<erikh>
I need a fixed, random access array
<erikh>
fixed-width.
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
<erikh>
I'm using a SizedQueue atm for what it's worth -- which is not ideal as I'm basically recreating the queue every `size` iterations
<erikh>
I'd rather just keep an index
<erikh>
dunno. sizedqueue works
<rue>
I don't recall one
<rue>
If you're supplying/controlling the index, you can naturally just use an Array, but I suppose a proper bounds-checking one wouldn't be a bad idea
<rue>
But you really only *need* one if external code is accessing it based on its own calculations
<erikh>
basically converting SM to a more actor-y model (which I'm still learning so this might not be perfect) with a preallocated number of threads
<erikh>
so instead of filling a single queue and let god sort it out, i'm walking the event list, filling queues for individual threads with events to execute, and then letting the thread pull the proc/payload off and execute it
<rue>
Hm, doesn't push/pull work with M:N?
<erikh>
M:1 if I'm reading your terminology right
<erikh>
sorry, I am concurrency dumb, I hope that's not too much of an issue
<erikh>
happy to learn but it's a wide topic
<rue>
Hm, actually, I think it's either 1:N or M:1. Weird
<erikh>
the central idea to this is that there's a core that always maintains a certain known state
at5l [at5l!~at5l@unaffiliated/at5l] has joined #ruby-lang
<erikh>
and just spawns off async handling
<erikh>
it should make for a fast service management system
roha [roha!~phelot@84-75-49-50.dclient.hispeed.ch] has joined #ruby-lang
<erikh>
and the handlers are side-effect free because they can call back to the core just by messaging it
<rue>
Is it a stateful response, or self-contained?
<rue>
It looks like you could just use inproc PUSH and PULL from the threads
<roha>
Hey, I've made a ruby script which logs into a wegpage and checks for updates. I used Hpricot for HTML-parsing together with rubygems. Is there a way to "bundle" the script and the necessary libraries together so that i can send it to a friend and he doesn't have to worry about installing ruby/ruby gems etc. ?
<erikh>
yep, that's exactly what i'm doing
<erikh>
so PULL sits in the core and each event gets a fresh ::Payload object which contains the message, the client, and the dispatcher
<erikh>
the client being a PUSH connected to the dispatcher
<roha>
Something like an executable jar in Java
<rue>
roha: There used to be a rubyscript2exe, and I think there's a modern counterpart…
<rue>
Also, though, I think you could create an actual .jar with JRuby
<roha>
Oh and my friend is running OSX
<erikh>
the point of the dispatcher being that it's responsible for selecting and delegating based on the state at the time the message received
<roha>
Ill have a look ad rubyscript2exe then :) thanks
<rue>
erikh: So is the problem with responses, then?
<rue>
Wrt. the fixed-size Array?
<erikh>
well managing clients in a way that I can quickly isolate dead or unresponsive threads
<erikh>
e.g., Enumerable
<erikh>
I can dump and reload the queue but that seems ... inelegant I guess.
niklasb [niklasb!~codeslay0@p5B310BC1.dip0.t-ipconnect.de] has joined #ruby-lang
<erikh>
hrm
<erikh>
I'll just show you the patch when I'm done here
<erikh>
might be simplest.
<rue>
Okdoke. I'm probably missing some crucial detail
<erikh>
nah I'm communicating like shit because I'm new to all this
Mchl [Mchl!~Mchl@h1881165560.rev.rootvps.pl] has joined #ruby-lang
<erikh>
ruby -I lib lib/sm/core.rb 0.21s user 0.05s system 20% cpu 1.231 total
<erikh>
raggi: love you.
<erikh>
was taking ~15s for 5000 messages before
<erikh>
yeah, order of magnitude raised it by all of 0.05s
<erikh>
rue: i've committed, maybe that helps some
<roha>
Hmm no luck yet. Does somebody know of another way besides rubyscript2exe etc to just simply bundle a script and some non-standard-ruby-libraries, so that you don't have to "sudo gem install" every gem on the target machine?
<Muz>
Bundler'll do that for you
<roha>
and you wouldn't need to install bundler on the target machine?
<Muz>
Oh, you will, but it certainly simplifies the process.
<roha>
i'll have another look at it :) thanks
<roha>
i just wonder that there is no real standard way to do such things, if somebody programs a bigger ruby application and wants to distribute it with all the ruby-things being hidden from the user
<roha>
rubyscript2exe would do that, but it seems not that up to date
stanis [stanis!~akhil@115.111.177.122] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
<manveru>
roha: jruby?
<roha>
manveru, i've googled a bit about using jruby for the task but haven't found anything, i guess i'll do some more searching :)
kyrylo [kyrylo!~kyrylo@46.118.234.45] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@subtle/user/kyrylo] has joined #ruby-lang