yatish27 has quit [Remote host closed the connection]
<frank_o>
centrx: #validations, #fetch, #parse and #format maybe?
<frank_o>
should probably create a new gist for this
<centrx>
frank_o, Sure, yes
<centrx>
frank_o, Note also, everywhere you define a local variable: response =, raw_hashes =, validated_hashes =
<centrx>
frank_o, You already have the names and all set, just reorganize them into methods, it's almost just a renaming/resyntaxing: response = turns into def response
<centrx>
frank_o, So there is the big-scale conceptual names, and then there are actually names you are already using, but are often clearer as separated methods
aleatorik has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesfordummies has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
yatish27 has joined #ruby-lang
jamesfordummies has quit [Client Quit]
<frank_o>
centrx: Very cool
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cakey has joined #ruby-lang
qba73 has joined #ruby-lang
hellangel7 has joined #ruby-lang
sMecKs has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby-lang
hellangel7 has quit [Max SendQ exceeded]
arBmind has quit [Quit: Leaving.]
hellangel7 has joined #ruby-lang
fullybaked has joined #ruby-lang
|jemc| has quit [Ping timeout: 250 seconds]
r0bby_ has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 244 seconds]
InfraRuby has joined #ruby-lang
arBmind has joined #ruby-lang
michd is now known as MichD
toastynerd has joined #ruby-lang
koderok has quit [Quit: koderok]
koderok has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
toastynerd has quit [Remote host closed the connection]
AKASkip has joined #ruby-lang
davispuh has joined #ruby-lang
dm78 has joined #ruby-lang
<yorickpeterse>
morning fleshlings
dm78 has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
<maloik>
morning master
* yorickpeterse
cracks whip
S1kx has joined #ruby-lang
Atttwww has quit [Ping timeout: 245 seconds]
ari-_-e has joined #ruby-lang
banister has joined #ruby-lang
zarubin has quit []
benlovell has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
<yorickpeterse>
So every Monday morning we have a sort of standup about what people's goals are for the week
<yorickpeterse>
Usually people have like 1-2 things they want to do
koderok has quit [Quit: koderok]
<yorickpeterse>
I had 5 that I could remember, in total taking probably around 3 weeks of time
<yorickpeterse>
(I knew I had more but I couldn't remember during the meeting)
<yorickpeterse>
I sense something is a bit off here
vikasyaligar has joined #ruby-lang
marr has joined #ruby-lang
<maloik>
:D
wojtekmach has joined #ruby-lang
stamina has joined #ruby-lang
frank_o has quit [Ping timeout: 260 seconds]
r0bby_ is now known as robbyoconnor
workmad3 has joined #ruby-lang
Cakey has quit [Ping timeout: 260 seconds]
elia has quit [Quit: Computer has gone to sleep.]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby-lang
<maloik>
anyone here used ruby-progressbar with multiple processes? I used a global variable for the progressbar object, but it looks like it's tracking the progress in X different duplicates of the object causing it to flicker on screen and completing in "estimated time / X"
<maloik>
if that makes sense
<existensil>
multiple processes? do you mean multiple threads maybe?
<maloik>
processes
<existensil>
a global in one process would still not be visible to others
<maloik>
in threads it does seem to work
<maloik>
hmm... is there any way around it?
<existensil>
how are you sharing state? or are both processes just trying to own STDOUT?
<existensil>
how are you even sharing STDOUT?
dm78 has joined #ruby-lang
<workmad3>
maloik: with processes, you'd need a master process to handle tracking the progress bar and then you'd need to use signals or some other form of IPC to communicate updates back to the master process to update the state on the screen
<existensil>
right. only one process should own the progressbar
<maloik>
makes sense, I'll look up IPC
<workmad3>
('master' process in this case just meaning a process that is handling integrating the state of all the other processes)
<workmad3>
maloik: inter-process communication
<workmad3>
maloik: a.k.a. a defined interface to talk over
dm78 has quit [Read error: No route to host]
banister has joined #ruby-lang
dm78 has joined #ruby-lang
<yorickpeterse>
maloik: you muppet
<yorickpeterse>
maloik: you have multiple processes fighting over your terminal output, each one resetting it every time you increment the progress
<yorickpeterse>
it's like 10 people constantly trying to turn off/on the lights
<maloik>
yea I realized what was causing it, or had a good idea anyway... just wasn't sure of how to work around it
<yorickpeterse>
either you have to synchronize it (= have 1 process handle all the progress info), or just write "." to the console
<yorickpeterse>
also use threads bra
<maloik>
processes is faster apparently
<maloik>
even tried 4 processes and 4 threads in combination but that didn't make any difference, in fact it was slower than 4 processes
<yorickpeterse>
What Ruby, MRI?
<maloik>
(just realized I should check what their default is)
<maloik>
yep
<maloik>
using the parallel gem
<yorickpeterse>
....yeahhhh
<yorickpeterse>
use a real Ruby
<yorickpeterse>
The GIL will slap you in the face with a trout otherwise
<yorickpeterse>
"NO CONCURRENCY FOR YOU"
elia has joined #ruby-lang
<yorickpeterse>
Also make sure that if your DB driver uses a connection pool you have enough pool workers available
<yorickpeterse>
Typically I'd go with pool_size = N-threads + 5
<yorickpeterse>
5 is totally arbitrary btw
<yorickpeterse>
But it's just a backup in case one pool worker gets stuck for some reason
<DefV>
that's the best way to do pool size
<DefV>
totally arbitrary
dm78 has quit [Ping timeout: 272 seconds]
<DefV>
"Hmm, 9 doesn't seem enough. Let's make it 14"
<yorickpeterse>
well yeah
<yorickpeterse>
I'll have none of that science/research stuff
<yorickpeterse>
get off ma lawn
<DefV>
labcoat-wearing hippies!
<maloik>
nah I just need to speed this up the easy way, not going to go use "real rubies"
<yorickpeterse>
the worst kind of hippies
<yorickpeterse>
maloik: enjoy shooting yourself in the foot then
<yorickpeterse>
unless your code is super tied into MRI, it's just a matter of `chruby rbx / chruby jruby`
<maloik>
it's an import script that will only get run a couple times at most, there's no point in going jruby
<maloik>
if it takes an hour then that's completely fine too, but I don't mind a little effort to perhaps speed things up a bit
<yorickpeterse>
well, you're already going down the route of shooting yourself with processes
<DefV>
how's jruby with c exts?
<yorickpeterse>
DefV: non existing
<yorickpeterse>
They dropped it
<yorickpeterse>
I think you can still enable it with some flag but it will scream at you
<DefV>
that kills my possibility to use jruby
<yorickpeterse>
and it will be fully removed in JRuby 9000 if I'm not mistaken
<DefV>
and I've always thought of rubunius as an experiment, not really an environment ready for production
<benlovell>
oh dear
<yorickpeterse>
DefV: apparently you thought wrong
<existensil>
you can do lots of concurrency in MRI... assuming your threads aren't doing their heavy lifting and ruby and are spending most of their time blocking on external resources (db, http, other IO, external processes, etc)
<yorickpeterse>
Unless you're using Nokogiri it's quite suitable
<DefV>
well..
<yorickpeterse>
existensil: ugh, this is almost becoming a mantra everybody preaches
<DefV>
# XML Parsing
<DefV>
gem 'nokogiri'
<yorickpeterse>
"BUT IT'S FINE IF IT'S BLOCKING IO!!!!"
<DefV>
:-(
<yorickpeterse>
It still has a GIL, anything else is going to suck
<yorickpeterse>
DefV: lemme dig up this issue
<existensil>
for a surprising number of use cases where people use threads in a language like ruby, you are blocking
<yorickpeterse>
existensil: and for a surprising number of cases this is not the case
<existensil>
i'd question that
<yorickpeterse>
existensil: start digging numbers then
<yorickpeterse>
Threads certainly are really useful for IO, but there are plenty of cases where you want concurrency without doing IO stuff
ur5us has quit [Remote host closed the connection]
<yorickpeterse>
e.g. think of a multi-threaded grep: IO is only a small part, the heavy stuff is searching a file's contents
<existensil>
its true. just not ready to throw out the concept of threads just because I'm using MRI
<yorickpeterse>
In case of MRI the actual reading could happen in parallel, the searching would not
<yorickpeterse>
existensil: I'm not saying you should throw it out
<existensil>
you did say "NO CONCURRENCY"
<yorickpeterse>
I'm saying that if you want *proper* concurrency and you've actually noticed MRI doesn't gain you anything (as I can gather from maloik), look elsewhere
<maloik>
what do you mean doesnt gain anything, I just told you it does speed it up
<yorickpeterse>
maloik: "even tried 4 processes and 4 threads in combination but that didn't make any difference, in fact it was slower than 4 processes"
<yorickpeterse>
^ from that I gather that apparently the 4 threads are useless
<DefV>
or you're doing it wrong
<DefV>
:-D
<maloik>
as compared to 4 processes, yes
<existensil>
4 threads slower than 4 processes isn't surprising if MRI, but faster than 1 thread/process
<maloik>
^
<yorickpeterse>
which means either: 1) GIL 2) you're doing it wrong
<maloik>
possibly GIL, but it's still faster than 1 process
<existensil>
Add in the massive memory savings of threads and in many cases MRI threads look attractive
<existensil>
(vs processes)
<workmad3>
existensil: CoW
<maloik>
this thing doesn't need to be zomg webscale
<yorickpeterse>
workmad3: still leaves you with overhead you don't need
<DefV>
EVERYTHING needs to be zomg webscale
<yorickpeterse>
also CoW isn't a guarantee
<DefV>
or at least, everything needs to consider that, 1 day, some idiot wants to scale it to 1M users
<DefV>
and they won't take "That's a stupid idea" for an anwser
<existensil>
CoW ?
<yorickpeterse>
copy-on-write
<existensil>
ah
<existensil>
yeah, ideally you don't pay the full price to fork a process, but the overhead is above that of a thread
<yorickpeterse>
e.g. I'm not sure if JRuby has CoW
<yorickpeterse>
Since you can't fork() I doubt it
<yorickpeterse>
well technically you *can* fork(), sort of
jhass is now known as jhass|off
<existensil>
also easier to share data between threads than processes
<workmad3>
existensil: yeah, I take that as a bad thing personally ;)
<yorickpeterse>
but threads are scary!
<existensil>
doesn't matter I guess above a certain scale since you'll need IPC regardless
<existensil>
I gave a talk on threads at a local meetup recently so kind of jazzed about them
<existensil>
they are under-utilized by ruby developers I feel like
<yorickpeterse>
You can blame that on the lack of proper primitives for that in MRI
<yorickpeterse>
and the GIL
<yorickpeterse>
Same applies to for example Python
Miphix has quit [Quit: Leaving]
<existensil>
seems like threading is pretty common in Python despite the GIL
<existensil>
in CPython. of course pypy has real threads.
<workmad3>
real threads doesn't prohibit a GIL
<workmad3>
e.g. ruby 1.9+
<existensil>
right, they are real OS level threads in MRI
<yorickpeterse>
workmad3: The GIL still prohibits them from running in parallel
<existensil>
just all but one are put to sleep by MRI
<yorickpeterse>
except for the cases where MRI decides to *do* run them in parallel
<yorickpeterse>
Either way, if MRI had at least proper primitives (actors, channels, all that stuff) I'm pretty sure it would be a lot more heavily used
<yorickpeterse>
It also requires people to pull their heads out of their arses and stop thinking threads are super scary and difficult to use
<workmad3>
yeah, I'd love it if ruby had decent higher-level concurrency primitives
<existensil>
what you looking for?
<workmad3>
existensil: actors would be a nice start
<yorickpeterse>
I got this random syntax error at some point, and I was like "wtf that's impossible the tests shouldn't even run in that ca....oh...shit"
<ericwood>
oooh some intern code: User.find(@current_user.id)
<whitequark>
please stop
<ericwood>
well, it had a few more things around it so it was 3 queries for an object they already had
<yorickpeterse>
ericwood: actually, I think that would be cached by AR
<yorickpeterse>
not 100% sure though
<ericwood>
yorickpeterse: yeah if you're using the latest
<ericwood>
still a slappable-offense, because they have no idea that AR will do that
<yorickpeterse>
ericwood: good point
<ericwood>
anyone know any ruby shops in portland?
<ericwood>
looking for a change later this year
<yorickpeterse>
that escalated quickly
<ericwood>
like I said, you all owe me
ta has joined #ruby-lang
<yorickpeterse>
Know quite a few over here, but that's a long way from Portland
mistym has joined #ruby-lang
tbuehlmann has quit [Quit: Leaving]
<yorickpeterse>
including ourselves *cough* *cough*
saarinen has joined #ruby-lang
tectonic has quit []
gjaldon has joined #ruby-lang
emmesswhy has joined #ruby-lang
vikasyaligar has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
<ericwood>
haha
omosoj has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has quit [Changing host]
cmhobbs has quit [Client Quit]
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has quit [Changing host]
yfeldblum has joined #ruby-lang
skade has joined #ruby-lang
saarinen has quit [Quit: saarinen]
hachiya_ has quit [Remote host closed the connection]
<yorickpeterse>
The biggest lie in programming:
<yorickpeterse>
# Time to add your specs!
<yorickpeterse>
Last changes: 2012
<yorickpeterse>
the specs test like, 2%
gianlucadv has quit [Ping timeout: 250 seconds]
<yorickpeterse>
Good thing this particular project will be refactored somewhere by the end of this week
<yorickpeterse>
s/refactored/rewritten
yfeldblum has quit [Ping timeout: 272 seconds]
<ericwood>
we recently got our test suite down from 2 hours to 20 minutes
<centrx>
s/rewritten/scrapped
<ericwood>
apparently people do things like 60.times { FactoryGirl.build(:user) }
<centrx>
...by deleting 90% of the tests
<yorickpeterse>
Give a man a codebase and he'll write weird code
<yorickpeterse>
Give Yorick a codebase and he'll refactor all your things non stop
<ericwood>
and we had bcrypt using 10 as its whatever parameter so it was really fucking computationally intensive
<yorickpeterse>
ericwood: I think my slowest rails test suite is 2 minutes
<yorickpeterse>
That's on REE 1.8 something
<ericwood>
making bcrypt shut up in the tests all of a sudden cut off an hour :P
<yorickpeterse>
Granted it has like 10 tests
<ericwood>
we have thousands
<ericwood>
this thing is huge
<yorickpeterse>
Entire build process took 2 minutes and 18 seconds
<ericwood>
I would actually commit crimes to have that
sharpmachine has joined #ruby-lang
<ericwood>
9507 tests
<yorickpeterse>
One of our best tested projects has....
<ericwood>
lots of functional + integration ones that test some hairy stuff
<yorickpeterse>
Finished in 24.77 seconds (files took 1.41 seconds to load)
<yorickpeterse>
1113 examples, 0 failures
<yorickpeterse>
That thing has 0 tests 10 months ago
<ericwood>
I think the largest bottleneck is reloading the rails env...we have a shitton of stuff
<yorickpeterse>
also happened to be one of our most crucial applications
<ericwood>
we recently hired a guy whose sole job is to unfuck all of that tho
rippa has joined #ruby-lang
<yorickpeterse>
haha, poor soul
<yorickpeterse>
Did they get a company sponsored insurance policy?
<ericwood>
they're on suicide watch
<ericwood>
he sends me these code chunks every day that are especially bad
<ericwood>
it's entertaining and depressing
<ericwood>
honestly though we do have tons of badass codew
<centrx>
That sounds like a fun job actually
<yorickpeterse>
Do they end up on the Daily WTF too?
<ericwood>
hahaha we have some material for it, that's for sure
<ericwood>
ooooh my fave from recently!~!!!!
<ericwood>
someone was putting the object.to_s in the memcached key
<ericwood>
so you get the memory location as part of it
<ericwood>
we have 6 application nodes and a shared memcached instance
<ericwood>
so it's guaranteed to miss 99% of the time
<ericwood>
so...I fixed it
<ericwood>
then it broke EVERYTHING related to mailers
<ericwood>
they were designed with the idea that it would miss
<yorickpeterse>
wat
<ericwood>
so...we just said fuck it we do NOT have time for this and took out the cache block entirely...which actually makes it run faster anyways :D
<ericwood>
it was like Rails.cache.fetch("something/#{image_id}") but image_id was the fucking AR model for the image
<ericwood>
made me realize what I miss about strict typing
<yorickpeterse>
We had a similar problem
<yorickpeterse>
we had this DateRange object thing
<yorickpeterse>
which was used for the key
<ericwood>
lol
<yorickpeterse>
But nobody ever bothered to explicitly call the right method to convert it to a String that didn't contain the object ID
nertzy has joined #ruby-lang
<yorickpeterse>
So every day we'd create new cache keys and then just forget them
<yorickpeterse>
all the while wondering why some parts of the app were slow as heck
<ericwood>
:D
karamazov has joined #ruby-lang
michaeldeol has joined #ruby-lang
hellangel7 has quit [Read error: Connection reset by peer]
toastynerd has joined #ruby-lang
enebo has joined #ruby-lang
<yorickpeterse>
We've systematically cleaned up a *lot* of code in the almost 2 years since I joined
<yorickpeterse>
I suppose my constant complaining actually helps
<ericwood>
we instituted "fix it fridays" every two weeks
<ericwood>
you just drop what you're doing and refactor that stuff you meant to but are too busy to now
<ericwood>
helped a ton
sepp2k has quit [Quit: Konversation terminated!]
<yorickpeterse>
I'd love that, except were only with the 3 of us, soon to be 2
<ericwood>
oof.
<yorickpeterse>
with around 30 or so apps to maintain
banister has joined #ruby-lang
<ericwood>
I take it you do consulting then?
<ericwood>
I want to do something along those lines...something new all the time
<yorickpeterse>
haha no
<yorickpeterse>
consulting, pffft
<ericwood>
just something where it's not the same appp all day
<yorickpeterse>
we just break stuff up into a lot of different apps
<yorickpeterse>
lots and lots of background processes
<ericwood>
aaah nice
<yorickpeterse>
we only have 5 Rails apps from the top of my head
<ericwood>
we're *trying* to do that but a monorail is a tough thing to comparmentalize :(
<ericwood>
we did just deploy a scala app and something part rails and part Go
<yorickpeterse>
we're 100% Ruby
<yorickpeterse>
95% MRI 2.1.2, one app still stuck on REE 1.8
<ericwood>
oof
<ericwood>
JRuby here
<yorickpeterse>
I'd be running Rbx if it wasn't for bloody Nokogiri
<centrx>
PHP/Node/MongoDB
<yorickpeterse>
or aws-sdk not being thread-safe
<yorickpeterse>
grrrr
<ericwood>
centrx: I think that's actually my least favorite stack imaginable
<headius>
yorickpeterse: CoW would be a VM-level feature...given the right memory subsystem any JVM *could* do it, but only a couple actually do right now
amerine has quit [Quit: Computer has gone to sleep.]
<ericwood>
I say this as a JS programmer
<headius>
e.g. Dalvik (which isn't really a JVM, but yeah)
<centrx>
yorickpeterse, Nokogiri doesn't work on Rubinius?
<yorickpeterse>
It does if you only run a single thread
<ericwood>
nope, it requires crazy compiled stuff with libxml2
<yorickpeterse>
But even then it might crash
<ericwood>
the JRuby one ties into the java equivalent
<yorickpeterse>
headius: hmm
<yorickpeterse>
ericwood: correct, making it harder to debug
<yorickpeterse>
since there's no similar environment to compare to
<ericwood>
yah :D
<yorickpeterse>
That is, an environment that also does multi-threading properly
<emmesswhy>
anyone have recs for a good ruby IRC bot framework? been reading the Cinch documentation - looks pretty solid, would like some second opinions first though
<headius>
yorickpeterse: one thing I find strange is that we had people running jruby + nokogiri-ffi for a couple years before we got a JVM-native version
<headius>
with concurrency and all that
<whitequark>
emmesswhy: cinch is great
<ericwood>
emmesswhy: I'm sure Cinch will be just fine unless you want to do something insane
<ericwood>
a friend of mine has an obscenely parallel one written using eventmachine
<ericwood>
you can use that
<ericwood>
it has no docs tho :D
<emmesswhy>
no docs @_@
<emmesswhy>
yeah, i'll stick with cinch :p
skade_ has joined #ruby-lang
<ericwood>
good idea
<ericwood>
ugh what's a good way to find jobs at smaller companies if I'm not networked in an area?
<ericwood>
github jobs is solid, as is stackoverflow careers but the options are more limited
<ericwood>
I have so many connections in Austin but 0 in portland, it's driving me mad
skade has quit [Ping timeout: 260 seconds]
<yorickpeterse>
headius: I suspect the problem might've been introduced recently
<yorickpeterse>
or something else triggers it
<yorickpeterse>
But either way, it's really annoying
ta has quit [Remote host closed the connection]
<yorickpeterse>
But soon I'll liberate the world of XML parsing by introducing my own crappy parsing library
kyledreger has quit [Quit: kyledreger]
<headius>
yorickpeterse: yeah, it's too bad the FFI nokogiri died...that might have been a path to get your apps working on rbx
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kyledreger has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
loincloth has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
loincloth has joined #ruby-lang
qba73 has quit [Remote host closed the connection]
kek_ has joined #ruby-lang
skade_ has quit [Quit: Computer has gone to sleep.]
qba73 has joined #ruby-lang
|jemc| has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
gjaldon has quit []
karamazo_ has joined #ruby-lang
gianlucadv has joined #ruby-lang
qba73 has quit [Ping timeout: 272 seconds]
ironhide_604 has quit [Ping timeout: 260 seconds]
karamaz__ has joined #ruby-lang
karamazov has quit [Ping timeout: 272 seconds]
karamazo_ has quit [Ping timeout: 264 seconds]
<ericwood>
forgetting to restart memcached will be the death of me
vikasyaligar has quit []
saarinen has joined #ruby-lang
shinnya has quit [Ping timeout: 240 seconds]
momomomomo has joined #ruby-lang
Maitiu has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby-lang
stamina has quit [Ping timeout: 255 seconds]
michaeldeol has joined #ruby-lang
koderok has joined #ruby-lang
mistym has joined #ruby-lang
karamaz__ has quit [Remote host closed the connection]
gianlucadv has quit [Ping timeout: 260 seconds]
hellangel7 has joined #ruby-lang
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
frank_o has joined #ruby-lang
amclain has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 260 seconds]
hellangel7 has quit [Remote host closed the connection]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jds has quit [Quit: Connection closed for inactivity]
loincloth has quit []
benlovell has quit [Ping timeout: 260 seconds]
saarinen has quit [Quit: saarinen]
koderok has quit [Ping timeout: 250 seconds]
mjboselowitz has joined #ruby-lang
jds has joined #ruby-lang
loincloth has joined #ruby-lang
skade has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
fullybaked has quit [Ping timeout: 260 seconds]
sharpmachine has quit [Remote host closed the connection]
nehaljwani has joined #ruby-lang
priodev has quit [Ping timeout: 260 seconds]
<nehaljwani>
Hi! Where can I get a list of CVEs affecting any version of ruby?
<frank_o>
Hello! If I do `class SomeClass; def yolo; something; end; end`, is there a way to do `yolo.something` from inside other classes instead of `SomeClass.yolo.something`?
yfeldblum has joined #ruby-lang
mjboselowitz has quit [Remote host closed the connection]
mjboselowitz has joined #ruby-lang
<jhass>
frank_o: sounds suspicious. Got non pseudo code?
<jhass>
it makes no sense to make a new instance of your class
mistym has quit [Ping timeout: 240 seconds]
<frank_o>
jhass: as per that gist comment above the idea is to have one instance per new affiliate. my first paste only has one affiliate but i plan to add others.
charliesome has joined #ruby-lang
<jhass>
it rather looks like the idea is to have a new class per affiliate?
momomomomo has quit [Quit: momomomomo]
<frank_o>
sorry i thought ::foo was an instance. my bad
* frank_o
dusts himself off
<frank_o>
jhass: so module it is then?
<jhass>
I'd do that
amerine has joined #ruby-lang
<havenwood>
yup
amerine_ has joined #ruby-lang
<frank_o>
great.. so `module ThirdPartyProducts; end` and `module ThirdPartyProducts::Tradedoubler; end`?
<frank_o>
module virgin here
<jhass>
yeah
<frank_o>
awesome
amerine has quit [Ping timeout: 272 seconds]
amerine_ has quit [Ping timeout: 260 seconds]
loincloth has quit [Remote host closed the connection]
<jhass>
your cherrypick does a each where it wants a map
<frank_o>
cool
<frank_o>
should all my methods be selfies btw?
<frank_o>
i should probably google that
saarinen has joined #ruby-lang
<jhass>
I don't see shared state or anything that justifies instances, so probably
<jhass>
oh and I'm sure you'll find a better name for "get_it_all_dude"
<frank_o>
:D
elia has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby-lang
karamazov has joined #ruby-lang
<frank_o>
i will consider it. so last but not the least - any suggestions on how to design the validate function?
<frank_o>
like it says in the comments, tradedoubler wont let me search for genders or categories (i've submitted a feature request to them though), but luckily there are `gender` and `product_group` fields in the json response.
<jhass>
so it doesn't validate, rather it filters?
<frank_o>
good point, yeah true.
<jhass>
so first thing, call it filter
<frank_o>
consider it done :)
<jhass>
how dynamic need those to be?
<frank_o>
what do you mean?
<jhass>
where do you define the filters?
<frank_o>
no idea tbh
dingus_khan has joined #ruby-lang
<frank_o>
probably not the answer you were looking for.
relix has joined #ruby-lang
<jhass>
I mean are they always the same, do they depend on the request or what?
momomomomo has joined #ruby-lang
koderok has quit [Quit: koderok]
<frank_o>
oh yeah, they're always the same.
michaeldeol has joined #ruby-lang
<jhass>
exactly? because your comment references random_category
mjboselowitz has joined #ruby-lang
nehaljwani has left #ruby-lang ["Leaving"]
<frank_o>
oh like that. sorry, yeah categories will change on request. gender will always stay the same.
<frank_o>
ideally these filters shouldnt be too interwoven with the rest of the code so its easy to "disconnect" it whenever tradedoubler fixes their api
adphillips has joined #ruby-lang
<jhass>
I still don't quite get how you call all this stuff
dingus_khan has quit [Ping timeout: 255 seconds]
<jhass>
you have fetch.hashes.mashes.cherrypick.shuffle
<jhass>
but that can't work
<jhass>
since your methods don't return stuff you can call your methods on
emmesswhy has quit [Quit: This computer has gone to sleep]
<jhass>
let me tinker a bit
<frank_o>
true. was about to ask about that as well. never connected methods in this sense before
gianlucadv has joined #ruby-lang
pixelhandler has joined #ruby-lang
emmesswhy has joined #ruby-lang
loincloth has joined #ruby-lang
saarinen has quit [Quit: saarinen]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
sarkyniin has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby-lang
RobertBirnie has joined #ruby-lang
pr0ton__ has joined #ruby-lang
amerine has joined #ruby-lang
yfeldblum has quit [Ping timeout: 250 seconds]
stamina has joined #ruby-lang
Rylee has quit [Excess Flood]
<jhass>
frank_o: are those and filters or or filters?
<jhass>
I mean should it match all or any?
Rylee has joined #ruby-lang
kek_ has joined #ruby-lang
stevednd has quit [Remote host closed the connection]
<frank_o>
jhass: and filters i believe
pr0ton__ has quit [Quit: pr0ton__]
amerine has quit [Quit: Computer has gone to sleep.]
djbkd has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
ta has joined #ruby-lang
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
toastynerd has quit [Remote host closed the connection]
stamina has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amerine has quit [Quit: Computer has gone to sleep.]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
charliesome has joined #ruby-lang
yubrew has joined #ruby-lang
alexju has quit [Remote host closed the connection]
alexju has joined #ruby-lang
saarinen has quit [Quit: saarinen]
alexju has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
benlovell has joined #ruby-lang
alexju has quit [Remote host closed the connection]
surrounder1 has joined #ruby-lang
alexju has joined #ruby-lang
dik_dak has joined #ruby-lang
surrounder has quit [Ping timeout: 260 seconds]
JohnFord has joined #ruby-lang
adphillips has quit []
codeZeilen has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
momomomomo has joined #ruby-lang
benlovell has quit [Ping timeout: 260 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexju has quit [Ping timeout: 255 seconds]
arBmind has joined #ruby-lang
<codeZeilen>
hi everyone. I've got a question on behavior of Ruby regarding the beloved printing of Floats. I've noticed the following behavior: When normally printing a very large Float (> 2^70) i get a string which has a lot of zeroes right before the period and which is actually not representable with double precision numbers of this size.
<codeZeilen>
however if I print it by putting it through string format using %.1f I get the correct representation. This is as string_format uses snprintf while float_to_str uses a custom algorithm. Is that intended?
momomomomo has quit [Client Quit]
jbardin has quit [Quit: jbardin]
momomomomo has joined #ruby-lang
yfeldblum has joined #ruby-lang
momomomomo has quit [Client Quit]
<centrx>
codeZeilen, Unable to reproduce
emmesswhy has quit [Quit: This computer has gone to sleep]
momomomomo has joined #ruby-lang
<codeZeilen>
centrx: let me see if i can get you the data. one moment :)