titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
titanbiscuit has joined #ruby
jmcgnh has quit [Ping timeout: 265 seconds]
<d3bug>
oh ok
<d3bug>
gotta use the ampersand thingy
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
wildtrees has quit [Quit: Leaving]
pupsikov has joined #ruby
LinuxKnight has quit [Ping timeout: 255 seconds]
pwnd_nsfw has quit [Read error: Connection reset by peer]
Doow has quit [Read error: Connection reset by peer]
Doow has joined #ruby
shokohsc has quit [Quit: Ping timeout (120 seconds)]
AndroidKitKat has quit [Remote host closed the connection]
shokohsc has joined #ruby
AndroidKitKat has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
titanbiscuit has joined #ruby
bambanx has joined #ruby
sagax has joined #ruby
<havenwood>
We develop new principles for Ruby out of Ruby’s own principles. We do not say to Ruby: Cease your struggles, they are foolish; we will give you the true slogan of struggle. We merely show Ruby what it is really fighting for, and consciousness is something that it has to acquire, even if it does not want to.
titanbiscuit has quit [Ping timeout: 258 seconds]
orbyt_ has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pupsikov has joined #ruby
titanbiscuit has joined #ruby
Frobozz has joined #ruby
titanbiscuit has quit [Ping timeout: 256 seconds]
titanbiscuit has joined #ruby
titanbiscuit has quit [Ping timeout: 265 seconds]
titanbiscuit has joined #ruby
ewanchic has quit [Ping timeout: 258 seconds]
soulisson has joined #ruby
tbisker8 has joined #ruby
Bounga has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
soulisson has quit [Quit: Leaving]
tbisker8 has quit [Read error: Connection reset by peer]
Bounga has quit [Ping timeout: 272 seconds]
titanbiscuit has joined #ruby
kapil_ has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
titanbiscuit has joined #ruby
caterfxo has quit [Quit: leaving]
caterfxo has joined #ruby
ewanchic has joined #ruby
brool has joined #ruby
bambanx has quit [Quit: Leaving]
chalkmonster has quit [Quit: WeeChat 2.7.1]
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pupsikov has joined #ruby
schne1der has joined #ruby
pinpox has quit [Ping timeout: 268 seconds]
gix has quit [Ping timeout: 255 seconds]
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
braincrash has quit [Quit: bye bye]
brool has quit [Ping timeout: 272 seconds]
d3bug has quit [Quit: Connection closed for inactivity]
braincrash has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
brool has joined #ruby
schne1der has quit [Quit: schne1der]
howdoi has quit [Quit: Connection closed for inactivity]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TzilTzal>
I have a file that gets loaded several times during the auto-load sequence of Padrino... does anyone know why, or how to prevent that?
alfiemax has joined #ruby
johnny56 has joined #ruby
donofrio has quit [Remote host closed the connection]
yokel has joined #ruby
ewanchic has joined #ruby
glytchbinary has joined #ruby
chalkmonster has joined #ruby
bukkitgerman8 has quit [Quit: Ping timeout (120 seconds)]
yokel has quit [Ping timeout: 265 seconds]
cnsvc has joined #ruby
yokel has joined #ruby
trif has joined #ruby
swistak35 has quit [Ping timeout: 260 seconds]
kenichi has quit [Ping timeout: 260 seconds]
trif_ has quit [Ping timeout: 260 seconds]
tekk has quit [Ping timeout: 260 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
sauvin has joined #ruby
tekk has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
dionysus69 has joined #ruby
roadie has joined #ruby
glytchbinary has quit [Quit: glytchbinary]
i9zO5AP has quit [Quit: WeeChat 2.7.1]
titanbiscuit has quit [Ping timeout: 256 seconds]
titanbiscuit has joined #ruby
Bounga has joined #ruby
Bounga has quit [Ping timeout: 240 seconds]
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
bhaak has quit [Ping timeout: 255 seconds]
uplime- has quit [Ping timeout: 255 seconds]
uplime has joined #ruby
cd has quit [Quit: cd]
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
titanbiscuit has quit [Ping timeout: 256 seconds]
titanbiscuit has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tosaraja has quit [Remote host closed the connection]
brool has quit [Ping timeout: 272 seconds]
titanbiscuit has quit [Ping timeout: 268 seconds]
chalkmonster has joined #ruby
titanbiscuit has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
tbisker8 has joined #ruby
sdu has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
Bounga has joined #ruby
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
tbisker8 has quit [Ping timeout: 258 seconds]
sdu has quit [Ping timeout: 260 seconds]
sdu has joined #ruby
MrCrackPot has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
titanbiscuit has joined #ruby
sergioro has quit [Quit: leaving]
titanbiscuit has quit [Ping timeout: 258 seconds]
bruce_lee has joined #ruby
<al2o3-cr>
thank crunchy it's friday!
xco has joined #ruby
stdedos has joined #ruby
iamdevnul has quit [Ping timeout: 260 seconds]
titanbiscuit has joined #ruby
iamdevnul has joined #ruby
tbisker8 has joined #ruby
titanbiscuit has quit [Ping timeout: 255 seconds]
donofrio has joined #ruby
TomyWork has joined #ruby
Bounga has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
alexherbo2 has joined #ruby
fbandov has joined #ruby
fbandov has quit [Client Quit]
tbisker8 has quit [Ping timeout: 258 seconds]
titanbiscuit has joined #ruby
bhaak has joined #ruby
titanbiscuit has quit [Excess Flood]
cnsvc has quit [Ping timeout: 240 seconds]
titanbiscuit has joined #ruby
cnsvc has joined #ruby
tsujp has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
titanbiscuit has quit [Ping timeout: 256 seconds]
markopasha has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
titanbiscuit has joined #ruby
cnsvc has joined #ruby
titanbiscuit has quit [Ping timeout: 265 seconds]
titanbiscuit has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
titanbiscuit has quit [Excess Flood]
titanbiscuit has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
titanbiscuit has joined #ruby
titanbiscuit has quit [Ping timeout: 240 seconds]
LinuxKnight has joined #ruby
ellcs has quit [Remote host closed the connection]
ellcs has joined #ruby
sh7d has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
sh7d has joined #ruby
DTZUZU2 has quit [Ping timeout: 256 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
markong has joined #ruby
ellcs has quit [Remote host closed the connection]
edwardly has quit [Quit: ??????????]
ellcs has joined #ruby
MasterNayru has quit [Remote host closed the connection]
bvdw has quit [Read error: Connection reset by peer]
c0san0stra has quit [Ping timeout: 265 seconds]
bvdw has joined #ruby
woodruffw has quit [Ping timeout: 265 seconds]
olspookishmagus has quit [Ping timeout: 265 seconds]
kempo has quit [Ping timeout: 265 seconds]
pavelz has quit [Ping timeout: 265 seconds]
xpitr has quit [Ping timeout: 265 seconds]
thebetra1 has quit [Ping timeout: 265 seconds]
reaVer has quit [Ping timeout: 265 seconds]
umjisus has quit [Ping timeout: 265 seconds]
dorian has quit [Ping timeout: 265 seconds]
thebetra1 has joined #ruby
umjisus has joined #ruby
margeas has joined #ruby
c0san0stra has joined #ruby
edwardly has joined #ruby
markopasha has joined #ruby
markong has quit [Ping timeout: 265 seconds]
royal_screwup21 has joined #ruby
titanbiscuit has joined #ruby
alfiemax has quit [Remote host closed the connection]
DTZUZU2 has joined #ruby
markoong has joined #ruby
margeas has quit [Ping timeout: 260 seconds]
titanbiscuit has quit [Ping timeout: 268 seconds]
cnsvc has joined #ruby
crst has joined #ruby
<crst>
Hi! Why do I get an undefinded_method error when calling a normal or private method in a "def self" method. (all within the same class)?
cnsvc has quit [Ping timeout: 240 seconds]
titanbiscuit has joined #ruby
<leftylink>
the way you phrased it makes it sound like you're calling an instance method from a class method. but without code, I honestly cannot be sure
<leftylink>
well there you go. now we can see that you are calling an instance method (pad_and_validate) from a class method (import)
_phaul has quit [Ping timeout: 258 seconds]
stryek has joined #ruby
bruce_lee has quit [Ping timeout: 255 seconds]
<crst>
All right thanks for clarifying. The code works when I move the pad_and_validate method outside the class but I'm not sure if I want to do that. What's the ruby way to handle a situation like this?
TCZ has joined #ruby
drincruz_ has joined #ruby
burningserenity has joined #ruby
tbisker8 has joined #ruby
titanbiscuit has quit [Ping timeout: 272 seconds]
tbisker8 has quit [Excess Flood]
titanbiscuit has joined #ruby
lucasb has joined #ruby
_phaul has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
phaul has quit [Ping timeout: 265 seconds]
titanbiscuit has joined #ruby
TCZ has quit [Quit: Leaving]
drincruz_ has quit [Ping timeout: 265 seconds]
olddogbarks has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
TCZ has joined #ruby
drincruz_ has joined #ruby
titanbiscuit has quit [Ping timeout: 240 seconds]
titanbiscuit has joined #ruby
cnsvc has joined #ruby
alfiemax has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
burningserenity has quit [Ping timeout: 256 seconds]
<havenwood>
xco: This is an easy problem to solve in Ruby with #Float. I'd suggest switching to challenges that have tests. :)
<havenwood>
xco: Instead of trying to make easy things hard, solve harder things.
<xco>
havenwood thanks :). so I failed a job interview. It's easy, the interviewer said I can't use Float or #to_f
<havenwood>
xco: That's just a very bad interview question for Ruby. ¯\_(ツ)_/¯ I'd fail it too, I suppose?
<havenwood>
xco: I mean, you can backbend to technically meet that requirement.
<xco>
:( that's why i'm jobless. the instructions don't mention anywhhere that you can use float etc
<xco>
havenwood makes me feel a bit better thanks :)
<havenwood>
xco: Technical interviews are a coin toss. You may have to do several to get a sane one.
<xco>
i'm still trying
<_phaul>
I am really curious to see their solution. The question doesn't make sense.. They say you should parse. But into what? I guess techniqually you could split on '.' parse the two integers on left and right and put them together into a single float
<havenwood>
xco: Have you done some exercism challenges in Ruby yet? https://exercism.io/
<xco>
_phaul i did all those, he said "no" :/
<_phaul>
xco you are lucky not working for them ;)
ellcs has quit [Ping timeout: 256 seconds]
<al2o3-cr>
"455".to_i * 1.0 is the simplest solution.
leitz has joined #ruby
<xco>
this is for a Ruby on Rails position btw :D, once I had another interview for a Rails position where the interview spent like 35min squeezing me to spit out how blockchain works
<_phaul>
al2o3-cr: I guess you fail to "parse" "3.14"
<xco>
al2o3-cr he said you can't use #to_i on a group of numbers, just one digit like so "3".to_i
<leitz>
al2o3-cr, in response to your "how is everyone doing" question, the answer is "not bad, but mildly stressed." I keep seeing the need to prepare for a job change.
<al2o3-cr>
oh, i should skim
roadie has quit [Read error: Connection reset by peer]
<al2o3-cr>
leitz: why?
<al2o3-cr>
xco: ask them how long is a peice of string.
cnsvc has joined #ruby
<al2o3-cr>
xco: that's a stupid question you'll never need, and just testing *your* logic.
<xco>
havenwood i did a few tests on exercism, most are not hard i'd say
<xco>
what i don't get is why don't they test my knowledge of Rails? :P i'd pass easily :D :D
sdu has quit [Remote host closed the connection]
<al2o3-cr>
xco: not necessarily.
<xco>
al2o3-cr but i'm on codewars a lot, it's similar to exercism i guess or not? most questions require you to write algos
<al2o3-cr>
havenwood: that's a good one though ;)
<al2o3-cr>
xco: what kata you on?
cnsvc has quit [Ping timeout: 240 seconds]
<xco>
i'd have to check
<xco>
7?
<xco>
or 6
<al2o3-cr>
so, you've only just started really.
<xco>
just checked 6kyu
<xco>
al2o3-cr which one are you one?
<al2o3-cr>
xco: i can't remember off hand but some get crazy hard.
<leitz>
al2o3-cr, the contract end is coming, the new hasn't been awarded, and mgmt is making goo-goo eyes at a competing set of products.
<al2o3-cr>
it's years ago a toyed with codewars ;)
<xco>
yeah those get hard sometimes hahaha, it's not hard if you have time to think, and time is expensive
<_phaul>
oh. now we have produce :) it was born pre-produce times
<havenwood>
I like katas. \o/
s2013 has joined #ruby
<al2o3-cr>
havenwood: very nice solution! now pass the kata ;)
<xco>
havenwood that's cool! :D
<xco>
** runs to google what Enumerator.produce does **
<TzilTzal>
Should config/database.rb include an establish_connection call? It seems as though rake db:create goes through that file...
<xco>
TzilTzal maybe this should be in Rails IRC? just saying :P
<TzilTzal>
oh, sorry. true )
<al2o3-cr>
TzilTzal: but if someone knows in here they'll probably answer too. :)
<dreamreal>
I've got an rspec return value that looks like ... .to_return(body: { data: { id: 'foo' } }.to_json) but .. what type is that? A hash uses arrows, not that faux json syntax...
<_phaul>
it's a syntactic sugar for symbol keys
<_phaul>
{ :a => 1 } is equivalent to { a: 1 }
cnsvc has joined #ruby
<dreamreal>
I'm not sure I understand (by which I mean: "I don't understand")
<_phaul>
{ :a => 1 } is a hash that maps symbol :a to 1. { a: 1 } is an other way of writing the same.
<_phaul>
dreamreal: symbols have nothing to do with variables. it's just a type like string or integer. Think of it as constant string
<dreamreal>
okay, so I'm still lost as to what that rspec is doing, because there's no "body" in scope
<havenwood>
dreamreal: Symbols are like a number wearing a name tag. They don't store text, they just happen to use a bit of it in their name tag.
<havenwood>
"Symbols in Ruby are for identifiers. They are kind of like Enums in other languages such as Swift or C# (although Symbols are more primitive)." -Matz
<dreamreal>
What I'm trying to do, apart from master ruby in 30 seconds or less (obviously!) is extract that data structure into an external JSON file so I can just load it instead of having a line 5k chars wide
<havenwood>
"Symbols are a simple way to get a unique named identifier, and Strings represent arbitrary data/text." -Jeremy Evans
<havenwood>
dreamreal: Symbols are popular for keys in Ruby, but they can't be straightforwardly represented in JSON. There are a couple patterns you can use to deserialize to Symbols keys rather than String keys.
<dreamreal>
*nod* I'm trying to generate JSON from this ruby structure, though, and I'm not sure where the keys are coming from if they're using the colon operator
<dreamreal>
I may just leave it; it works, it's just gross and it's going to have to be repeated
<ytti>
i've thought symbols as immutable strings
<ytti>
but perhaps name for a number is better way to think them
<_phaul>
ytti: it's a close enough estimation imho, at least from what the language user can observe. Internally they are special
<havenwood>
Jeremy Evans and Matz argue they're different than frozen strings, so Symbol and String can't be unified. There are a couple bugs.ruby-lang.org issues where attempts to unify are refused.
d3bug has quit [Quit: Connection closed for inactivity]
<dreamreal>
it's got a line: .to_return(body: {data: {id: '1568'} }.to_json) ... yet if I copy that argument to a new ruby file (so I can generate JSON from it) I get syntax errors
<al2o3-cr>
dreamreal: well, there is something else a miss.
<dreamreal>
oh wait... WTF, maybe it is
<_phaul>
btw. if I gave the wroong impression I am ful heartedly against symbol / string unification :D I thought that was a way to explain it without going into too much detail. But maybe it over simplifies too much
<old_relik>
there's no actual problem written anywhere, I just want it to behave this way
kinduff has joined #ruby
<old_relik>
the comments show what I want as intended output
<old_relik>
not what it is doing right now
<old_relik>
I can solve it, there's no problem, I'm just trying to find a succint way to do it
kinduff7 has joined #ruby
<leftylink>
so if you say the only problem is that it doesn't add the next-largest multiple of 10000, we can run with that. note that Enumerable#find is able to find the first element of an enumerable that meets a predicate
hutch has quit [Ping timeout: 272 seconds]
<leftylink>
or there's the more direct way with division and ceil
rippa has joined #ruby
TzilTzal has quit [Quit: Leaving.]
kinduff has quit [Ping timeout: 260 seconds]
kinduff7 is now known as kinduff
<old_relik>
that's right that the only problem currently
<old_relik>
I can just stick a 10_000 at the end
<old_relik>
if n > 5000
<old_relik>
wait, no
<old_relik>
ugh
<old_relik>
that only solves one case
kinduff8 has joined #ruby
<old_relik>
I need to stick an additional +10_000 to the last element if the number is greater than 5000, if it's exactly between 5000..10_000, then only stick a 10_000
<havenwood>
old_relik: It doesn't handle edge cases like an empty array, but I don't really understand what you're solving so no clue which edge cases matter.
<old_relik>
empty array is fine, that can be handled separately
<old_relik>
trying your solution
<leftylink>
I don't see 5000..10_000 as a special case
<leftylink>
all cases are handled by "first multiple of 10000 that is larger"
kinduff has quit [Ping timeout: 260 seconds]
kinduff8 is now known as kinduff
<havenwood>
leftylink: I'm distracted and I think I ignored the criteria. >.>
<leftylink>
strictly larger, clarifying
<havenwood>
I just riffed off the first example.
<leftylink>
I have not determined whether you ignored the criteria or not
<leftylink>
I'll allow the concerned parties to make that determination
<leftylink>
yes, that's a euphemism
<old_relik>
Tried to write a problem statement: If the input is within the bounds of the max of the SEED array, then return the original array. If the input is more than the max of the SEED array, then incrementally assign +10_000 such that the input is sandwich'd between the last two values of the sorted SEED array.
<old_relik>
Not sure if that makes sense
<old_relik>
So, if it's 4000, the SEED array will be returned as is. If it's 5000 or 6k, then last two values will be [5000, 1000], if it's 11000, the last 2 values will be [10000, 20000] and so on
<smccarthy>
I am trying to run rspec programmatically (in AWS). My lambda function is in /var/task , but it downloads the tests to /tmp. Is there a way to run rspec programmatically from a different directory ?
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 258 seconds]
<adam12>
smccarthy: Maybe you could manipulate your load path? cd /tmp; rspec -I /var/task
hiroaki has quit [Ping timeout: 272 seconds]
priodev has quit [Ping timeout: 260 seconds]
cnsvc has joined #ruby
glytchbinary has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
glytchbinary has quit [Ping timeout: 255 seconds]
LenPayne has joined #ruby
Xiti has quit [Quit: Leaving]
alexherbo2 has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
e21 has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
royal_screwup21 has joined #ruby
Dirak has joined #ruby
roadie has quit [Read error: Connection reset by peer]
<leftylink>
so we can clearly see it must be an instance method of Class
<_phaul>
I think you are going deeper than it needs to be here....
<leftylink>
I see.
<_phaul>
new is "like" a static methods in c++, and it would call alllocate the object + initialize instance method in sequence. but to gain a full understanding you would need to understand leftylink's points
<soulisson>
I really thought new was a class method :(
xpitr has joined #ruby
<_phaul>
it is.
<_phaul>
class A; end; A.new; you send the new to the class, no question about that. It allocates a new instance of A and calls initialize on that object
<soulisson>
_phaul, ok, that's what I understood. But I think I misunderstood leftylink point
<_phaul>
it's going deeper a bit more involved, and I think leftylink was getting into that..
<soulisson>
_phaul, I have a stupid question (I don't have theorical basis in CS). Is a dictionary object is it self a dictionary data structure or is it an object that represents a dictionary data structure?
ur5us has quit [Quit: Leaving]
markopasha has quit [Remote host closed the connection]
alexherbo2 has quit [Remote host closed the connection]
ur5us has joined #ruby
e2 has joined #ruby
caterfxo has quit [Quit: leaving]
<_phaul>
I don'tunderstand the question, sorry
<leftylink>
I wonder what is the difference between those two
* baweaver
stares
<soulisson>
I'm going to try to rephrase it but it's not easy.
<soulisson>
The definition I have of a data structure is the following: an organized set of data/item. Is the object {'soulisson' => 'soulisson@irc.org'} is what is called a dictionary data structure?
<soulisson>
(Sorry for my english)
noboruma has joined #ruby
<_phaul>
in CS there are many different approaches to dscribe the world. One is OO (object oriented) and in OO we think of objects as data and behaviour. what you are showing is purely data, when stored in a hash or map or as you call it a dictionary it's data. The dictionary has a map to things to things, but it's not what we think as objects, having said that - confusingly these dictionaries are objetcs
caterfxo has joined #ruby
<soulisson>
ok, thanks
<_phaul>
I really wasn't sure if i made sense :D
<soulisson>
I suck at programming despite my numerous years in the IT world :(