<ruby[bot]>
mitki: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<mitki>
I mean I'm expecting ==> 1 a 2 b 3 c 4 d ....
GodFather has joined #ruby
<elomatreb>
mitki: Not like that, but you can construct an array of pairs that does what you need using Array#zip
jameser has joined #ruby
jphase has quit [Read error: Connection reset by peer]
jphase has joined #ruby
jak has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mitki>
it works thank you
ecuanaso has joined #ruby
GinoMan2440 has joined #ruby
Coldblackice has joined #ruby
Coldblackice is now known as Guest77146
Guest77146 has quit [Client Quit]
jak_ has joined #ruby
<Fenhl>
hello, I recently updated my server to Debian jessie and now one of the web apps I'm running on it won't work anymore. It's the only one that uses Ruby and I'm a bit lost since I don't really work with the language at all
jak has quit [Read error: Connection reset by peer]
<Fenhl>
this is the error message I get when I follow the instructions: rack-2.0.3 requires ruby version >= 2.2.2, which is incompatible with the current version, ruby 2.1.5p273
<sunrunner20>
I'm always stunned by some of the mistakes our sr developers make
<sunrunner20>
"sr"
<comet23>
so it's a total of 55 methods right?
<elomatreb>
It's not space sensitive like Python if that's what you mean, indentation is purely visual
<comet23>
when you memorize things you can start actually being creative and not trip up on the docs every 12 seconds
<comet23>
and memorization is good for your brain
bmurt_ has joined #ruby
<sunrunner20>
uselessly memorizing every function is time wasted where you could be doing better stuff
<comet23>
it's not useless, think of it as knowing what tools to use when you need to get the job done
<elomatreb>
Enumerable is really useful in Ruby, but just going in and memorizing the methods is not going to be very helpful
bmurt_ is now known as bmurt-
<Radar>
comet23: hi I've been doing this for 11 years almost and I still look up stuff in the docs
<Radar>
No one person can remember all the useful methods
bmurt- is now known as bmurts
<Radar>
AND I also get flatten + compact mixed up near weekly
bmurts is now known as bmurt--
<comet23>
you don't just memorize every method, you just memorize all the useful methods by using them
<Radar>
sunrunner20: your code seems fine
<sunrunner20>
I've been doing various languages for 17yrs
genpaku has quit [Remote host closed the connection]
__Yiota has joined #ruby
<sunrunner20>
Radar, and yet it didn't work :|
<matthewd>
comet23: Being able to recall more things is useful, but there isn't a "now you're senior" checklist
<Radar>
?didntwork
<ruby[bot]>
What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
<Radar>
comet23: yes, you get good at recalling things the more times you recall it. NEXT TIME ON PSYCHOLOGY 101.
jak__ has quit [Read error: Connection reset by peer]
jak has joined #ruby
<comet23>
lol
<sunrunner20>
Radar, chef didn't see it and so the rspec tests failed
charliesome has joined #ruby
<Radar>
sunrunner20: "didn't see it"
<Radar>
:thinking_face:
<comet23>
like detect and find are the same method, so you use the one that reads more like american
<Radar>
comet23: everyone knows detect is the right method to use
<Radar>
especially seniors
<Radar>
after the Great Detect / Find War of '08
genpaku has joined #ruby
<sunrunner20>
as in string.find()?
<Radar>
and "collection.each do |thing|" is preferred over "for thing in collection"
<sunrunner20>
returns -1 if it doesn't find it?
<Radar>
sunrunner20: there is no String#find
<Radar>
sunrunner20: Waiting for you to provide something useful wrt to debugging your problem.
dcluna has quit [Ping timeout: 276 seconds]
<Radar>
just fyi ps btw
<comet23>
i'll be a junior dev with senior dev skills i should be able to get a promotion quickly or leave and go to a company that will pay me more eventually and let me grow
<Radar>
comet23: sigh
<Radar>
This long term thinking is doing nobody good.
hahuang65 has quit [Read error: Connection reset by peer]
<Radar>
"OMG I WANT TO KNOW WHAT I NEED TO KNOW 10 YEARS FROM NOW"
<Radar>
Yeah, so does everyone.
<Radar>
how about you just focus on things that you want to learn now? as you need them?
<comet23>
long term thinking is important
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<comet23>
that's a paradox
<comet23>
you don't know what you need until you need it and you won't know what you need unless you know what is available
<sunrunner20>
long term goals are important
<comet23>
so off to memorizing every method i go
<Radar>
great glhf]
<sunrunner20>
you need to evaluate yearly what will get you to that 10yr goal
nobitanobi has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sunrunner20>
if your early in your career
<matthewd>
comet23: Noone is measured by which methods they have memorized. If you do that, you will not have "senior dev skills", any more than memorizing a dictionary gives you "published author skills".
<sunrunner20>
5yrs/6mo
<elomatreb>
Learn to predict the future, that's a great long term goal
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
Rodya_ has joined #ruby
<comet23>
matthewd you're missing the point about memorizing every method
<Radar>
comet23: what exactly is the point, pray tell?
JoshS has joined #ruby
<comet23>
so you can be creative and not trip up on the docs every 10 seconds
<sunrunner20>
are you brand new to programming?
<Radar>
Hey so I've got this app open in my dash and it's _fixed_ there, it's called Dash
<Radar>
It contains the documentation for every programming language I use
<Radar>
if there is a day where I do not open that app, I will let you know
<sunrunner20>
you sound like it tbh
wilbert has joined #ruby
<elomatreb>
I never sat down to memorize the Enumerable docs yet I use them without looking them up daily
<elomatreb>
It's a matter of practice
<sunrunner20>
^
<Radar>
If you're opening the docs every couple of seconds then at least you're reading the docs. That'll get less frequent the more you practice coding.
__Yiota has joined #ruby
<Radar>
comet23: asl btw
<Radar>
out of curiosity more than anything
jnollette has joined #ruby
<comet23>
or you could have spent an hour memorizing 55 methods, that's a little over a minute on each method twice a day for 5 days and keep practicing them on a daily basis and you would have gotten to where you are now faster
<arahael>
elomatreb: I always check the api, frequently.
<sunrunner20>
your time is much better spent finding a $languageofchoice project on github that has more open issues that developers
<matthewd>
I still open the Enumerable docs frequently
* arahael
is a polyglot dev, and the number of times languages are subtly different is infuriating.
<elomatreb>
I'm thinking of the simpler things, but of course
<sunrunner20>
find an easy issue and fix it
<Radar>
arahael: tell me about it ;) I keep putting "do" after method defs in Ruby.
<comet23>
i'm not saying memorize all the methods of a language, jus the most important ones that won't change and the ones that are idiomatic
<sunrunner20>
I keep typing do{
<arahael>
Radar: I wasted hours on a .NET project, because stupid sockets were auto-closing. I miss RAII. :(
<sunrunner20>
idk if it'll work
nobitanobi has quit [Ping timeout: 240 seconds]
<Radar>
comet23: how is Delray Beach this time of year?
<elomatreb>
select/map/inject, maybe some others like group_by and zip and you're good to go most of the time. Most of these also transfer readily into other languages
<sunrunner20>
arahael, I wasted 50hrs trying to get PHP to set a cookie on my local dev box
<sunrunner20>
gave up and uploaded the page to prod and it worked
<Radar>
map vs collect was explained elegantly to me: collect when you want to _collect_ a value from all elements of an array, map when you want to perform an operation on each element.
<sunrunner20>
I stopped programming at all for about a year
<Radar>
(I still use map for both tbh)
railswebdev has joined #ruby
<elomatreb>
sunrunner20: secure cookies can behave weirdly with some softwares for local domains
<sunrunner20>
was a plain old regular cookie
<sunrunner20>
before secure cookies existed iirc
<sunrunner20>
this was like 2003
<sunrunner20>
started programming as a literal kid
<sunrunner20>
like 10yrs old
<arahael>
Those were the days.
<arahael>
I wrote a drawing app, in QBasic.
<sunrunner20>
restarting college for a formal SE degree this fall
Andrevan has joined #ruby
amclain has quit [Quit: Leaving]
bmurt-- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sunrunner20>
I should have had a CS degree from a prestegious college and was like "I don't want computers to stop being fun so I'll do something else as a job"
<sunrunner20>
lost a full ride to that decision
<arahael>
It's really no big deal.
<arahael>
Most of your learnings are on the job/hobby, anyway.
<arahael>
(On the hobby, really - so to speak)
<sunrunner20>
the SE degree should be a breeze
<sunrunner20>
except for calculus
<elomatreb>
Software Engineering or "actual" computer science?
<sunrunner20>
software engineering
<elomatreb>
Good, because CS is mostly maths, certainly not what you want if you have fun programming. Still interesting though
jak has quit [Remote host closed the connection]
<sunrunner20>
I'm doing it for the paper
snowcrshd has joined #ruby
<arahael>
I hate the title "software engineering", particularly when said degree isn't an engineering degree. :(
jak has joined #ruby
<sunrunner20>
my 6mo goal in 5yr plan is new job
<comet23>
Radar why do you care
<Radar>
comet23: just making conversation
<sunrunner20>
just told a recruiter i'd take a 5k/yr hit to be on an established team
<elomatreb>
People actively asking for things to memorize certainly is not the usual
<comet23>
oh usually people say that when they're upset at something or trolling or about to dox or something but not to make conversation lol
gil_- has quit [Ping timeout: 240 seconds]
<comet23>
it's humid
zacts has joined #ruby
<sunrunner20>
I don't think I've ever memorized something intentionally for programming in my life
<Radar>
yeah of course it's florida
<sunrunner20>
comet23, dfw
<Radar>
and p.s. the only place where you're expected to be able to recall any method / api / algo is a really shitty interview.
<sunrunner20>
and my AC unit is oversized :(
<comet23>
what is dfw?
<Radar>
One of the first things I tell anyone we interview here is that they can look up things in the docs if they want.
<sunrunner20>
dallas fort worth metroplex
Pepu has quit [Ping timeout: 276 seconds]
grymmjack has quit [Ping timeout: 240 seconds]
<sunrunner20>
I read through some programmer review questions once
<arahael>
Radar: To be fair, it's a good proxy to for familiarity, particularly if you want someone for a specific language and project.
<sunrunner20>
only ones I failed were math heavy
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
<Radar>
arahael: Sure, I can quiz you on things but I'm not going to prevent you from looking it up in docs or trying it on a console
<sunrunner20>
I will admit
<Radar>
arahael: If you spend all your time going back to the console / docs then I'll probably judge based on that.
<Radar>
bbl, lunch
<arahael>
Radar: That's fair.
snowcrshd has quit [Ping timeout: 276 seconds]
<sunrunner20>
I pickup a book or two on any new language I need to know and throughly skim it
ResidentBiscuit has quit []
<arahael>
Well, I spend all my time going to the docs...
<arahael>
Which is why I have dual screens!!!
<sunrunner20>
I won't remember exactly the answer, but I'll remember what to google.
<arahael>
Good enough.
<bazzy>
Docs are everything <3
<arahael>
I also have an O'Reilly "cookbook" on my left.
<arahael>
Today I had to figure out how to wait for 2 seconds, in .NET :(
<comet23>
what you need to do is get a subscription to safari books
<matthewd>
This would've been trivial if you had a method that just checked a given 'position value', instead of needing the index, for example
<comet23>
it's too long
ascarter has quit [Ping timeout: 240 seconds]
jak has joined #ruby
<comet23>
the other problem is that i am following a course from flatiron school and i feel like a lot of this stuff is easy and straightforward, it also helps that their tutorial is well-written
<matthewd>
e.g. board.all? { |pos| occupied?(pos) }
<comet23>
it's at a very easy level for me usually and when it's hard or something new comes up i have to think about it for a moment because the answer is in the page, they give you pseudocode, but it's still up to me to figure out the implementation which i like
<matthewd>
In time this would be much better with a class to represent the board etc, but I assume you're not up to that yet
<comet23>
classes are in the next part
<comet23>
right after this
<comet23>
intro to OO
<comet23>
Classes and Methods
<comet23>
Instance Methods
<matthewd>
Cool, so I wouldn't get too hung up on less-than-ideal looking code at this stage
<comet23>
it's also not workign
<matthewd>
Recognising things that don't feel good is useful, but your toolkit to improve it will expand a lot soon
<matthewd>
Your last gist contained any? instead of all?
<comet23>
i'm tired
<comet23>
thank you so much
<comet23>
it's 12:57 and i was supposed to be in bed at 10
<matthewd>
I mean, there are plenty of other solutions, because computers.. but they're the ones I'd consider to be adjacent to where we are now
<elomatreb>
Now it's getting ugly
<comet23>
but you said that all doesn't yield an index
nofxxx has quit [Ping timeout: 260 seconds]
<matthewd>
I'm not calling all? on the board, though -- I'm calling it on .times, which will yield 0 to n-1, which matches the indexes of the array
perniciouscaffei has joined #ruby
<comet23>
oh
<comet23>
i see how that works
<comet23>
how does the second one work?
<matthewd>
Extracting the "is this cell blank?" check from position_taken? does look increasingly appealing, though
<matthewd>
That one just forces an Enumerator of all?
<comet23>
that one is way too advanced for me
<matthewd>
Some methods, like map and each, automatically return an Enumerator when called without a block; all? doesn't, but we can explicitly ask for one
Hobbyboy has quit [Ping timeout: 255 seconds]
<matthewd>
Yeah.. I mentioned it because it's the closest to what we were already trying to do, but I'd hesitate to actually write it that way
<comet23>
but you'd write the first one?
<matthewd>
No, I'd create a method that takes a cell value and returns whether it's occupied
<comet23>
okay great, you probably won't believe me, but that was my instinct
<comet23>
wait a minute
<comet23>
i'm tired
<comet23>
don
<comet23>
i already have a method that takes a cell value and returns whether it's occupied
FastJack has quit [Ping timeout: 258 seconds]
<matthewd>
No, you have a method that takes a cell *index* (and a board)
<matthewd>
comet23: It's taking a board and a cell index, then going and finding the value for itself
<comet23>
what is the difference between that and what you're talking about
<matthewd>
comet23: And our whole problem is that it's much easier to get the value directly. We're having to work harder to get the index, just to pass it to that method.
Eiam has quit [Ping timeout: 268 seconds]
Xiti has quit [Ping timeout: 268 seconds]
Hobbyboy has joined #ruby
<comet23>
i'm still getting the same error even after calling all? on board.size.times
<comet23>
def full?(board)
anisha_ has quit [Read error: Connection reset by peer]
Hobbyboy has quit [Ping timeout: 240 seconds]
domgetter has joined #ruby
kies has quit [Ping timeout: 240 seconds]
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hobbyboy has joined #ruby
oleo has quit [Quit: irc client terminated!]
enterprisey has quit [Remote host closed the connection]
FastJack has joined #ruby
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
enterprisey has joined #ruby
conta has joined #ruby
comet23 has quit [Ping timeout: 276 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
jottr has joined #ruby
Ishido has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 246 seconds]
jottr has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
conta has quit [Ping timeout: 255 seconds]
cschneid_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
aupadhye has joined #ruby
jak_ has quit [Remote host closed the connection]
ascarter has quit [Ping timeout: 240 seconds]
jak_ has joined #ruby
andikr has joined #ruby
Silthias has joined #ruby
xall has quit [Ping timeout: 246 seconds]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
bdevel has joined #ruby
Ishido has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
johnny56_ has joined #ruby
V1s1ble has joined #ruby
V1s1ble has joined #ruby
V1s1ble has quit [Changing host]
dfoolz has quit [Ping timeout: 240 seconds]
nahra has quit [Read error: Connection reset by peer]
nahra has joined #ruby
nahra has quit [Changing host]
nahra has joined #ruby
_br__ has quit [Ping timeout: 240 seconds]
piotrj has quit [Ping timeout: 240 seconds]
piotrj has joined #ruby
timmow has quit [Ping timeout: 240 seconds]
_br__ has joined #ruby
balazs has quit [Remote host closed the connection]
dfoolz has joined #ruby
timmow has joined #ruby
nobitanobi has joined #ruby
jak has joined #ruby
Rodya__ has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
conta has joined #ruby
nobitanobi has quit [Ping timeout: 268 seconds]
Rodya__ has quit [Ping timeout: 246 seconds]
ta_ has quit [Remote host closed the connection]
de9nie has joined #ruby
birdyondrugs has quit [Ping timeout: 240 seconds]
birdyondrugs has joined #ruby
rgr has joined #ruby
marr has joined #ruby
Ishido has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
djbkd has joined #ruby
Ishido has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
dionysus69 has joined #ruby
xall has joined #ruby
ascarter has joined #ruby
bdevel has quit [Remote host closed the connection]
bdevel has joined #ruby
bdevel has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
bkxd_ has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
Vingador has joined #ruby
Vingador has quit [Client Quit]
Vingador has joined #ruby
wilbert has quit [Ping timeout: 276 seconds]
hs366 has joined #ruby
kies has joined #ruby
vondruch has joined #ruby
joevandyk has joined #ruby
aufi has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
bkxd_ has quit [Ping timeout: 276 seconds]
agent_white has quit [Ping timeout: 246 seconds]
Mia has joined #ruby
dviola has quit [Quit: WeeChat 1.9]
Vingador has quit [Remote host closed the connection]
yaewa has joined #ruby
moei has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
snowcrshd has joined #ruby
anisha has joined #ruby
vondruch has quit [Quit: vondruch]
DoubleMalt has joined #ruby
biberu has joined #ruby
agent_white has joined #ruby
snowcrshd has quit [Ping timeout: 255 seconds]
nobitanobi has joined #ruby
Rodya_ has joined #ruby
yaewa has quit [Quit: Leaving...]
ddddddd has joined #ruby
fugue has joined #ruby
moei has joined #ruby
djbkd has quit [Remote host closed the connection]
enterprisey has quit [Remote host closed the connection]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rodya_ has quit [Ping timeout: 246 seconds]
Dimik has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
djbkd has joined #ruby
jenrzzz has joined #ruby
DoubleMalt has quit [Ping timeout: 260 seconds]
patarr has quit [Ping timeout: 260 seconds]
mathys has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
nanoz has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
uZiel has joined #ruby
montanonic has joined #ruby
djbkd has quit [Remote host closed the connection]
morfin has joined #ruby
<morfin>
hello
<morfin>
this is not fine: /tmp/ruby-build.20170630122900.3163/ruby-2.3.0/lib/fileutils.rb:1747: [BUG] Segmentation fault at 0xfffffffffffffff9
<comet23>
i did not code the helper method that's on the first line so please disregard
mrconfused_ has quit [Read error: Connection reset by peer]
__Yiota has joined #ruby
AnoHito_ has joined #ruby
mrconfused has joined #ruby
AnoHito has quit [Ping timeout: 255 seconds]
imperator has joined #ruby
<imperator>
good morning
snowcrshd has quit [Remote host closed the connection]
<cseder>
good evening
<imperator>
does mime-types just check the extension when determing a file type?
patarr has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Quit: WeeChat 1.8]
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
patarr has quit [Ping timeout: 276 seconds]
<morfin>
there is also magic bytes
mrconfused_ has joined #ruby
Ishido has quit [Read error: Connection reset by peer]
jak_ has quit [Remote host closed the connection]
anjen has joined #ruby
jak_ has joined #ruby
mwlang has joined #ruby
mrconfused has quit [Ping timeout: 258 seconds]
snowcrshd has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
<anjen>
Hi, I might be in the wrong group here, but I'll ask anyway. I'm in rails 3.2, debuggin using Aptana Studio. When I hit a respond_to block, instead of stopping on the specified line, mime_respons.rb pops up, so I have no diea what's gong on inside the block. Is there a way around this behavior?
<mwlang>
hmmm….I’m a little bit shocked Ruby’s Float leads to rounding errors on even simple numbers. 1045.85 * 100 => 104584.99999999999 I can understand rounding errors when you have, say 4 or 5 digits, but 2? :-o
<anjen>
*mime_responds.rb
bdevel has joined #ruby
urux has joined #ruby
urux has quit [Client Quit]
snowcrshd has quit [Ping timeout: 258 seconds]
AnoHito_ has quit [Read error: Connection reset by peer]
<comet23>
umm.... i disagree with this:
<comet23>
If you've been following along with the progression of Tic Tac Toe labs you've probably already built lots of the methods required to solve this lab. As you solve this lab, when you encounter a requirement you have previously solved, like defining the WIN_COMBINATIONS constant, or the #display_board method, you should take a second and find your old code. The ability to recognize previously solved problems and integrate a known soluti
urux has joined #ruby
AnoHito_ has joined #ruby
aufi has quit [Remote host closed the connection]
Doc_ has quit [Quit: Page closed]
conta has quit [Ping timeout: 258 seconds]
jottr has quit [Ping timeout: 240 seconds]
<anjen>
mwlang: that is pretty bad. Even 1045.85 *100.0 produces the same result.
<mwlang>
So, experimenting with combinations of math operations…is this the best way to convert dollars and cents to just cents? (1045.85 * 100.0).round.to_i => 104585
<mwlang>
anjen: yeah. I thought Ruby must be horribly broken, but even python 2.7 produces same answer!
bdevel has quit [Ping timeout: 260 seconds]
<anjen>
mwlang: (1045.85*100.0).round produces the correct result
ascarter has joined #ruby
patarr has joined #ruby
jottr has joined #ruby
synthroid has joined #ruby
nahra has quit [Remote host closed the connection]
joelwallis has joined #ruby
mrconfused_ has quit [Read error: Connection reset by peer]
<mwlang>
anjen: right you are! I thought the additional #to_i was needed, but rounding gives a Fixnum. (1045.85 * 100).round.class.to_s => Fixnum
mrconfused has joined #ruby
<anjen>
mwlang, as a workaround, we operate in pennies and convert later. fwiw...
<anjen>
(using the money gem)
<mwlang>
that’s essentially what I’m moving this solution towards.
<mwlang>
I just need the correct pennies from the Float
* mwlang
goes to find money gem...
<anjen>
lol, I hear ya. I'm struggling with a version update m'self.
<anjen>
fwiw, we're using collectiveidea-money. Notr sur eif it'll work with your verison but ...
<anjen>
cripes..typing skills are down today ...*Not sure if it'll...*
<mwlang>
It has all the facilities I need at least…representing amounts in specific currencies and converting them.
<anjen>
whichever works for you...good luck!
patarr has quit [Ping timeout: 268 seconds]
urux has quit [Remote host closed the connection]
cdg_ has joined #ruby
anjen has quit [Quit: anjen]
enterprisey has joined #ruby
antgel has joined #ruby
<_2easy>
Has anyone read blue or red book for DDD?
<_2easy>
I wonder which of them to read first.
mim1k has quit [Ping timeout: 260 seconds]
kruppm has quit [Ping timeout: 258 seconds]
patarr has joined #ruby
romank has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
patarr has quit [Ping timeout: 276 seconds]
byte512 has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
imperator has left #ruby ["Leaving"]
conta has joined #ruby
minimalism has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
mrconfused has quit [Ping timeout: 268 seconds]
mim1k has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 248 seconds]
enterprisey has joined #ruby
<mwlang>
_2easy: "You take the blue pill, the story ends. You wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes." :-D
uZiel has joined #ruby
<mwlang>
but seriously, no idea what the blue and red book for DDD is. got a link for them?
Guest12566 has quit []
patarr has joined #ruby
Triskelion5 has quit [Ping timeout: 260 seconds]
snowcrshd has joined #ruby
Ishido has joined #ruby
snowcrsh_ has joined #ruby
snowcrshd has quit [Remote host closed the connection]
patarr has quit [Ping timeout: 268 seconds]
JoshS has quit [Ping timeout: 260 seconds]
tau has left #ruby [#ruby]
planigan has joined #ruby
bahamas has quit [Quit: leaving]
skinnymg1 has quit [Remote host closed the connection]
pwnd_nsfw` is now known as pwnd_nsfw
lxsameer has quit [Quit: WeeChat 1.7]
alex`` has joined #ruby
im0nde has quit [Quit: im0nde]
im0nde has joined #ruby
amclain has joined #ruby
zacts has joined #ruby
Renich has joined #ruby
brent__ has quit [Remote host closed the connection]
svara has joined #ruby
enterprisey has quit [Ping timeout: 240 seconds]
weaksauce has joined #ruby
zacts has quit [Ping timeout: 255 seconds]
ascarter has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<_2easy>
apeiros: i don't understand what you mean. Could you elaborate more on this?
brent__ has quit [Remote host closed the connection]
<apeiros>
_2easy: your code produced a result which for *one specific* case was correct. you concluded from that, that your code "works". you were mistaken.
devster31 has quit [Read error: Connection reset by peer]
[Butch] has joined #ruby
<apeiros>
not possible either. optional positional arguments must come after required positional arguments.
<apeiros>
you can fake it using something like `RequiredArg=Object.new; def foo(a,b=1,c=RequiredArg); raise ArgumentError, "…" if c.equal?(::RequiredArg); … end
<apeiros>
for "does X work" type of questions, I suggest you use those.
R11 has quit [Ping timeout: 260 seconds]
<apeiros>
and then when you need help in either interpreting what you see or finding a way to make it possible, ask here.
<xco>
this is more like “how do i do it?”
<apeiros>
that's not reflected by your questions atm.
<apeiros>
anyway, refinement of what I said above re arg order: required positional args, optional positional args, keyword args (required/optional can be in any order here), block arg
gusrub has quit [Remote host closed the connection]
synthroid has quit []
zacts has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
cdg_ has quit [Read error: Connection reset by peer]
cdg_ has joined #ruby
Eiam has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
patarr has joined #ruby
electrostat has quit [Ping timeout: 240 seconds]
electrostat has joined #ruby
skweek has joined #ruby
<xco>
what’ll be the simplest way to get “params: {money: "dollar”}” out of a variable like a = {params: {money: "dollar"}}?
<apeiros>
a[:params]
<apeiros>
oh, wait…
patarr has quit [Ping timeout: 276 seconds]
comet23 has quit [Quit: Download IceChat at www.icechat.net]
jak_ has quit [Remote host closed the connection]
<apeiros>
`params: {money: "dollar”}` as a standalone is not valid. so elaborate on what exactly you mean.
jak_ has joined #ruby
<xco>
a is a hash
<xco>
i want it to return its’ first value
<xco>
i mean item
<xco>
which happens to be a hash too
<Zarthus>
a[a.keys.first]
<Zarthus>
?
<apeiros>
so you want `{money: "dollar"}`, not `params: {money: "dollar"}`=
<apeiros>
*?
<xco>
no
<xco>
i want
<xco>
`params: {money: "dollar"}`
<apeiros>
again, that makes no sense.
Beams has quit [Quit: .]
<xco>
:D
<apeiros>
you can either have :params plus {money: "dollar"}, or {params: {money: "dollar"}}, but not params: {money: "dollar"},
<xco>
ok i thought it made sense and there was a way to do it
<apeiros>
so again, what do you want? you can't have something that's not valid.
<Zarthus>
you could have `params = a[:params]` at best
<apeiros>
that's mean they'd have {money: "dollar"} (in params), which they refuted…
<apeiros>
but I think they don't really understand what they want anyway… so…
<Zarthus>
:D
<Zarthus>
maybe he wants a string
<apeiros>
xco: maybe provide us the full picture? your questions make little sense and seem out of context. context might help overcome your weakness to specify what you want.
<catphish>
i want to implement "cp --reflink" in ruby, this requires calling an ioctl BTRFS_IOC_CLONE, what would be the correct way to get this linux system constant into ruby?
<apeiros>
xco: just invoke it as `meth(country, capital, currency, one: 1, two: 2)`
<catphish>
i actually don't know what it's value is, it's established by a macro in C: #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
<apeiros>
or `meth(country, capital, currency, {one: 1, two: 2})` if you prefer the explicit braces
<xco>
not that easy
patarr has joined #ruby
<xco>
params:
<xco>
HAS to be in the invocation
<apeiros>
you seem to still leave away lots of required context.
<apeiros>
*why* does it have to be the invocation?
<xco>
because the frameworks (Rails) i’m using wants it present
Cyrus has joined #ruby
seggy has joined #ruby
mikecmpbll has quit [Ping timeout: 276 seconds]
ascarter has joined #ruby
tvon has quit [Remote host closed the connection]
minimalism has joined #ruby
<apeiros>
xco: ok, who implements what in your scenario?
FastJack has quit [Read error: Connection reset by peer]
<apeiros>
do you implement meth or rails?
<apeiros>
do you implement the invocation of meth or rails?
patarr has quit [Ping timeout: 268 seconds]
<xco>
i do
<apeiros>
for both?
<xco>
yes
<apeiros>
then where does rails come into play? how can it be that rails has a requirement on a method which you both implement and call?
callahanrts has quit [Quit: WeeChat 1.2]
<catphish>
so, is there a way to get the value of a constant from /usr/include, or do i need a C extension here?
conta has quit [Ping timeout: 255 seconds]
FastJack has joined #ruby
cdg_ has quit [Remote host closed the connection]
<apeiros>
catphish: I'm not proficient in the matter, but I'd bet it means you need an extension one way or the other (fiddle, ffi or native ext)
montanonic has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
Triskelion5 has joined #ruby
perniciouscaffei has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
ddddddd has joined #ruby
cdg has joined #ruby
hogetaro has joined #ruby
electrostat has quit [Ping timeout: 246 seconds]
masterasia has quit [Quit: Leaving]
__Yiota has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
<catphish>
i think FFI:ConstGenerator is what i want, just trying to work out how to use it :)
<apeiros>
good luck :)
jaruga________ has quit [Quit: jaruga________]
kies has joined #ruby
patarr has joined #ruby
al2o3-cr has joined #ruby
Ishido has quit [Remote host closed the connection]
Rodya_ has quit [Remote host closed the connection]
Ishido has joined #ruby
shinnya has quit [Ping timeout: 268 seconds]
gusrub has joined #ruby
vondruch has joined #ruby
ta_ has joined #ruby
patarr has joined #ruby
dcunit3d has joined #ruby
enterprisey has quit [Ping timeout: 240 seconds]
JoshS has joined #ruby
bed7 has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
tvon has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
<haylon>
has anyone worked with Ruby's OpenSSL Gem? I'm tryign to add an extension_factory item to a CSR, but I'm getting unexpected type, but the example shows nil, and the csr object.
<haylon>
You know what, I'm probably doing this wrong.
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
patarr has joined #ruby
stryek has joined #ruby
Bock has quit [Ping timeout: 240 seconds]
andikr has quit [Remote host closed the connection]
stryek_ has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
snowdt has quit [Quit: Page closed]
ltem has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
ascarter has quit [Ping timeout: 260 seconds]
Cohedrin_ has joined #ruby
Ishido has quit [Ping timeout: 260 seconds]
vondruch has quit [Remote host closed the connection]
jak_ has quit [Remote host closed the connection]
vondruch has joined #ruby
jak_ has joined #ruby
tycoon177 has left #ruby [#ruby]
patarr has joined #ruby
Mudstart has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Meeh has left #ruby ["Screw u guys, I'm going home!"]
electrostat has quit [Quit: uwotm8]
muelleme_ has joined #ruby
electrostat has joined #ruby
mikecmpbll has joined #ruby
justizin has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
vondruch_ has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
elsevero has joined #ruby
Gasher has joined #ruby
Gasher is now known as Guest33777
<haylon>
maybe. Looking at how to generate a key/csr using the openssl command line tool, I can generate a key and csr using a config file, but I'm not sure how that would translate into using the OpenSSL gem to set the different attributes such as Extended Key Usage
bdevel has joined #ruby
<cseder>
anybody else having trouble installing the pg gem on the latest os x?
<apeiros>
cseder: worked fine for me
<apeiros>
installed pg from brew
<apeiros>
that's the server, not the gem.
<cseder>
apeiros yes, I had to install postgres via brew first to get it working
Ishido has joined #ruby
Guest73958 has quit [Ping timeout: 276 seconds]
<cseder>
But I usually just install Postgres.app and never had any trouble installing pg gem until now
patarr has quit [Ping timeout: 240 seconds]
skweek has joined #ruby
patarr has joined #ruby
vondruch_ has quit [Remote host closed the connection]
vondruch_ has joined #ruby
bdevel has quit [Ping timeout: 247 seconds]
knight33 has joined #ruby
Ishido has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
________ has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<haylon>
This is close to what I'm doing, but I'm not sure hwo to set the ExtensionFactory settigns at CSR creation instead of signing
vondruch_ has quit [Remote host closed the connection]
vondruch_ has joined #ruby
Ishido has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Rodya_ has quit [Ping timeout: 246 seconds]
choke has joined #ruby
d10n-work has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
aglorei has quit [Ping timeout: 248 seconds]
jottr_ has joined #ruby
vondruch_ has quit [Remote host closed the connection]
vondruch_ has joined #ruby
wnd_ has joined #ruby
theRoUS is now known as theRoUS|afk
m4rCsi has joined #ruby
caw_ has joined #ruby
KnownSyntax has quit [Ping timeout: 255 seconds]
caw has quit [Ping timeout: 255 seconds]
wnd has quit [Excess Flood]
voker57 has joined #ruby
hays has quit [Quit: No Ping reply in 180 seconds.]
Phage has quit [Ping timeout: 255 seconds]
rideh- has quit [Ping timeout: 255 seconds]
voker57 has quit [Quit: No Ping reply in 180 seconds.]
lupine has quit [Quit: No Ping reply in 180 seconds.]
m4rCsi_ has quit [Quit: No Ping reply in 180 seconds.]
hays has joined #ruby
jottr has quit [Ping timeout: 255 seconds]
voker57 has joined #ruby
voker57 has quit [Changing host]
hays has joined #ruby
hays has quit [Changing host]
KnownSyntax has joined #ruby
caw_ is now known as caw
vondruch_ has quit [Remote host closed the connection]
Phage has joined #ruby
Phage has joined #ruby
Phage has quit [Changing host]
vondruch_ has joined #ruby
rideh has joined #ruby
lupine has joined #ruby
patarr has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
sarbs has quit [Ping timeout: 240 seconds]
mgorbach has quit [Ping timeout: 240 seconds]
csaunders has quit [Ping timeout: 240 seconds]
tvon has quit [Remote host closed the connection]
ujjain has quit [Ping timeout: 260 seconds]
Dark_Arc has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
bokayio has quit [Ping timeout: 240 seconds]
jnollette has quit [Ping timeout: 240 seconds]
ChickeNES has quit [Ping timeout: 240 seconds]
tvon has joined #ruby
ChickeNES has joined #ruby
Dark_Arc has joined #ruby
sarbs has joined #ruby
bokayio has joined #ruby
mgorbach has joined #ruby
csaunders has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
gothicsouth has joined #ruby
mikecmpb_ has joined #ruby
tvon has quit [Ping timeout: 276 seconds]
mikecmpbll has quit [Ping timeout: 240 seconds]
wnd_ is now known as wnd
jnollette has joined #ruby
aglorei has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Renich has quit [Quit: Renich]
bed7 has quit [Quit: Leaving]
marr has quit [Ping timeout: 240 seconds]
joelwallis has quit [Remote host closed the connection]
ascarter has joined #ruby
ModusPwnens has joined #ruby
<ModusPwnens>
Is it bad practice to refactor a large class by extending some related behaviour into a module that you just include back into that class?
<ModusPwnens>
i'm having trouble finding best practices for modules to answer this question.
<bougyman>
what do you mean by related behavior?
<bougyman>
Will it be used by any other class?
<ModusPwnens>
No, it won't be used by any other class.
<bougyman>
if it's solely to make a class smaller, seems like just complicating things for religious reasons.
soLucien has joined #ruby
<ModusPwnens>
it's also because the methods I'm encapsulating out are often changed but the rest of the code is not.
Ishido has quit [Ping timeout: 240 seconds]
<bougyman>
you should certainly look at if all of the behavior belongs on one class.
<ModusPwnens>
so the idea was to extract all the commonly changed code that are all related so that engineers can just use that class for changes instead of peppering methods all over the other class.
choke has joined #ruby
<ModusPwnens>
but i'm not sure if that's bad ruby as I'm not that experienced with ruby guidelines and best practices.
patarr has joined #ruby
<ModusPwnens>
in java, it would certainly be wierd, but in java you can't really do mixins like you can in ruby
vondruch_ has quit [Remote host closed the connection]
konsolebox has joined #ruby
vondruch_ has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
marr has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
meshsmith has joined #ruby
oleo has quit [Read error: Connection reset by peer]
<Yxhuvud>
ModusPwnens: In general, I'd say 'Favor composition over inheritance' (and using modules is in this case more or less a variant of inheritance.
patarr has quit [Ping timeout: 255 seconds]
montanonic has quit [Ping timeout: 260 seconds]
oleo has joined #ruby
tvon has joined #ruby
ixti has joined #ruby
<ixti>
Hi all! Is it normal practice to manually call `GC.start`?
jak_ has quit [Remote host closed the connection]
<ixti>
I'm processing a lot of CSV files (around 11K files). Each contains different amount of rows, 10 rows smallest one, 300-500K big ones...
jak_ has joined #ruby
<ixti>
Seems like without calling GC.start after each 10K rows - RSS jsut keeps growing until process OOM killed ;((
yaewa has joined #ruby
tgragnato has joined #ruby
joelwallis has joined #ruby
moei has quit [Ping timeout: 246 seconds]
shinnya has joined #ruby
Ishido has joined #ruby
<soLucien>
hi guys ! Is it possible to store credentials in the gemrc file ?
brent___ has joined #ruby
<soLucien>
i have my own rubygems repo , and i'm trying to connect to it and install stuff from it
<soLucien>
(it's actually a Vagrant plugin, but I expect it to be very similar to the Ruby way of installing plugins)
learningRuby has joined #ruby
truenito has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
vondruch_ has quit [Remote host closed the connection]
vondruch_ has joined #ruby
<learningRuby>
QUESTION: This is from The Ruby Programming Language (Matz and others) → “Every object has a well-defined class in Ruby, and that class never changes during the lifetime of the object. An object's type, on the other hand, is more fluid. The type of an object is related to its class, but the class is only part of an object's type. When we talk about
<learningRuby>
the type of an object, we mean the set of behaviors that characterize the object.” My question is: why is the type of an object more fluid? Can we change the type of an object?
Rodya_ has joined #ruby
<Papierkorb>
learningRuby: In fact you can change the behaviour of a specific object through Object#singleton_class
brent___ has quit [Remote host closed the connection]
<Yxhuvud>
ixti: what version of ruby do you use? If you use a horribly old version then you might have reason to call GC.start manually in some regressive cases, but that should not be the case for modern Rubys.
patarr has quit [Ping timeout: 240 seconds]
vondruch_ has quit [Remote host closed the connection]
<ixti>
Yxhuvud: not horribly old. 2.3.0
vondruch_ has joined #ruby
<Yxhuvud>
Then there shouldn't be an issue..
<ixti>
Yeah. But, by some reason withou GC.start RSS grows like crazy :((
Rodya_ has quit [Ping timeout: 276 seconds]
__Yiota has joined #ruby
KeyJoo has joined #ruby
<havenwood>
ixti: Can you try to reproduce on 2.3.4 or better yet 2.4.1?
xfbs has quit []
<ixti>
havenwood: trying to find the way of doing that now ;D
<havenwood>
ixti: what os/distro?
<soLucien>
guys ? Is there a way to store credentials in gemrc files ?
vondruch_ has quit [Remote host closed the connection]
vondruch_ has joined #ruby
domgetter has joined #ruby
lxsameer has joined #ruby
<ixti>
havenwood: the problem is not installing new ruby (i'm on gentoo linux with chruby - and have all latest rubies) - it's just data is on production server ;))
<havenwood>
soLucien: Why don't you want to use?: ~/.gem/credentials
<havenwood>
ixti: ah, gotcha
<learningRuby>
Papierkorb: oh, so I could for example take a String object and change its behaviors (override) so it would behave exactly like a Numeric object? Is that what the text mean?
<soLucien>
heavenwood i had no idea it existed. I'm looking into it right away
<havenwood>
ixti: It makes me wonder if you could tune the GC to be more aggressive so you don't need the manual GC.start.
<learningRuby>
Papierkorb: (but it would still be a String object, although it wouldn't behave anymore like one)
<ixti>
Hm. Good point. I guess, if I'll figure out that latest ruby behaves the same for me as 2.3.0 - then I'll think on tuning default behavior.
<Papierkorb>
learningRuby: "behave like" is the key. Ruby does 'duck typing': if it walks like a duck, and quacks like a duck, it's a duck. Exactly like a Numeric? Nah, but Numeric is kinda special. But you could totally create a Object (Yes, you can do `Object.new`), and then through its singleton_class, modify its behaviour to mimic an object of a specific class. This is actually done in tests ("mocking").
<Papierkorb>
learningRuby: E.g., you could teach your Object #[] and #[]= and pass it to something expecting a Hash or Array, as long that something only uses #[] and #[]= ;)
bdevel has joined #ruby
jottr_ has quit [Read error: Connection reset by peer]
vondruch_ has quit [Remote host closed the connection]
jak has joined #ruby
plujon has joined #ruby
vondruch_ has joined #ruby
jottr_ has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
patarr has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rodya_ has joined #ruby
vondruch_ has quit [Remote host closed the connection]
<learningRuby>
Papierkorb: mmm alright, I think now I get well why a “type is fluid”, but not a class. It means you can freely modify an object's behaviors, so class and type are not 100% tied to one another. But since Numeric for example is “special” as you say, than I would say that in Ruby type is fluid, yet not 100% fluid because there are certain classes wit
<learningRuby>
h special behaviors.
vondruch_ has joined #ruby
<learningRuby>
*then
quobo has quit [Quit: Connection closed for inactivity]
patarr has quit [Ping timeout: 260 seconds]
bdevel has quit [Remote host closed the connection]
bdevel has joined #ruby
bdevel has quit [Remote host closed the connection]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
bdevel has joined #ruby
<xco>
so i’m wondering, we can find find the parent of a child object by doing child.class, can we find which class a method comes from?
bdevel has quit [Remote host closed the connection]
bdevel has joined #ruby
bdevel has quit [Remote host closed the connection]
<Papierkorb>
xco: A class is an object itself. If you know how to find where an instance method comes from, you can find where a class method was defined too
bdevel has joined #ruby
<apeiros>
xco: the class of an object is not its parent
mwlang_ has joined #ruby
<apeiros>
classes have parents, but not all objects are classes (but all classes are objects)
bdevel has quit [Remote host closed the connection]
<xco>
apeiros: i know it’s not its parent but you get the picture
<apeiros>
xco: no I don't. that's the point. learn to express yourself. stop relying on others to figure out what you might mean.
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<xco>
Papierkorb understood me
<xco>
:)
<apeiros>
maybe. he might have understood something you didn't mean, though.