Lewix has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
Lewix has joined #ruby-lang
wallerdev_ has joined #ruby-lang
spuk_ has joined #ruby-lang
wmoxam_ has joined #ruby-lang
swemoney has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
<swemoney>
https://gist.github.com/swemoney/be4a85aad87aa708e3a8 <— Anyone know a good way of taking the 3 arrays here and merge them to end up with the last array as a result? Feel like there’s some really simple ruby magic I’m not thinking about.
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 245 seconds]
vlad_sta- has joined #ruby-lang
<womble>
swemoney: If you want to merge based on the value of some key, rather than merge based on position in the arrays, you can join the arrays all together and then do some fancy collect dance.
wallerdev has quit [*.net *.split]
spuk has quit [*.net *.split]
pepperbreath has quit [*.net *.split]
wmoxam has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
maloik has quit [*.net *.split]
vlad_starkov has quit [*.net *.split]
wallerdev_ is now known as wallerdev
maloik has joined #ruby-lang
<swemoney>
womble: that sounds simple enough.. let me see if I can’t get that to work.
donovan has quit [Quit: MOM! HANG UP THE PHO)(*&$^@!*#(... NO CARRIER]
vipaca has joined #ruby-lang
<weaksauce>
jdecuirm have you tried require_relative?
donovan has joined #ruby-lang
<vipaca>
I was trying to define a private instance operator method, but in order for the method to be invoke it cannot be private and I must self. the invokation. Can anyone tell me why the lookup on this method differs from non-operator defined methods.
roamingdog has quit [Remote host closed the connection]
Voker57 has quit [Ping timeout: 245 seconds]
<weaksauce>
vipaca can you gist some code?
swemoney has quit [Quit: Loading Quit Message...]
ocdmw has quit [Remote host closed the connection]
<vipaca>
was pastie caboo a thing?
<weaksauce>
vipaca gist.github.com is preferred
<weaksauce>
but pastie works
tkuchiki_ has joined #ruby-lang
tkuchiki has quit [Ping timeout: 256 seconds]
deol has joined #ruby-lang
chadwtaylor has joined #ruby-lang
deol has quit [Client Quit]
jefus_ has joined #ruby-lang
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<djellemah>
jdecuirm: use require 'project/ex48_convert.rb', and make sure that lib is in $: Don't use require './ex48_convert.rb' because that will tie you down to whatever path the requiring. Also, do you have a directory called EX48?
<djellemah>
s/the requiring/the requiring file is in/
tkuchiki has joined #ruby-lang
tkuchiki_ has quit [Ping timeout: 252 seconds]
ledestin has quit [Quit: ledestin]
bastilian has joined #ruby-lang
Lumio has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
Lumio has quit [Ping timeout: 245 seconds]
maso has quit [Remote host closed the connection]
zav has joined #ruby-lang
roamingdog has joined #ruby-lang
donovan has quit [Quit: MOM! HANG UP THE PHO)(*&$^@!*#(... NO CARRIER]
ocdmw has joined #ruby-lang
<djellemah>
vipaca: I think you can't pass more than one parameter to an operator. But when you call it using the . syntax, you can.
kerunaru has joined #ruby-lang
ocdmw has quit [Remote host closed the connection]
zav has quit [Ping timeout: 246 seconds]
<vipaca>
djellemah: I tested it by dropping splat and the operator mathod behaved the same with regard to scope
ghostpl has joined #ruby-lang
lytol has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
ghostpl has quit [Ping timeout: 252 seconds]
<djellemah>
vipaca: when I run the code from your gist, >> does call thread_first. So I'm not understanding what is going wrong?
micmus has joined #ruby-lang
<vipaca>
I'm looking for a way to both remove the self. and possibly make the >> method private.
<vipaca>
I would like the sytax for the operator to be the same as a named method, but there seems to be some rules I don't understand about operator methods.
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AKASkip has joined #ruby-lang
<djellemah>
vipaca: From Matz's book: "Private methods are implicitly invoked on self , and may not be explicitly invoked on an object. If m is a private method, then you must invoke it in functional style as m . You cannot write o.m or even self.m ."
<djellemah>
vipaca: so you can't use the multi-argument form of an operator (self.>>) when >> is declared private.
<vipaca>
That doesn't seem to follow for me.
<vipaca>
But, when you remove self. and move the method >> to private space the method is not found. Why is this different then a named method.
<vipaca>
That the comparison I'm trying to draw from my gist. And the above to me does not indicate anything about method arity.
<djellemah>
vipaca: so it looks like operators can
riotjones has joined #ruby-lang
<djellemah>
vipaca: can't be private. Yeah, it looks you can't even do self >> "", without the dot-syntax. So yeah the problem is that private requires no explicit receiver. The >1 arity is a consequence.
Averna has quit [Quit: Leaving.]
<djellemah>
djellemah: actually thinking about it I'll just go with the arity being a red herring ;-)
<vipaca>
djellemah: Yeah I'm just trying to get this code to next level, e.g. operator, but it seems that named method is the only way to get the style right. My hope was to replicate functional style here. -> (thread-frist) ->> (thread-last)
tunaCanBruh has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
<djellemah>
vipaca: defining operators in ruby is somewhat inflexible, compared to say scala or haskell (although I barely know those)
apeiros_ has joined #ruby-lang
hahuang62 has quit [Ping timeout: 250 seconds]
tunaCanBruh has quit [Ping timeout: 245 seconds]
apeiros_ has quit [Ping timeout: 250 seconds]
jo_ has quit [Quit: Connection closed for inactivity]
<bnagy>
vipaca: consider just writing idiomatic ruby
<bnagy>
especially for a private method, I mean jeez :/
<bnagy>
there's not even the 'makes the API pretty' excuse
dvorkbjel has quit [Remote host closed the connection]
jefus_ has quit [Quit: Leaving]
jefus_ has joined #ruby-lang
jefus_ is now known as jefus
arBmind has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 246 seconds]
lea_ has joined #ruby-lang
lea has quit [Quit: Page Closed]
lea_ has quit [Changing host]
lea_ has joined #ruby-lang
lea_ is now known as lea
symm- has joined #ruby-lang
lea has quit [Quit: Page Closed]
lea has joined #ruby-lang
kapil___ has joined #ruby-lang
<[spoiler]>
Morning, guys
symm- has quit [Quit: Leaving...]
ocdmw has joined #ruby-lang
gwendall_ has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
dvorkbjel has joined #ruby-lang
gwendall has quit [Ping timeout: 252 seconds]
ocdmw has quit [Ping timeout: 255 seconds]
lea_ has joined #ruby-lang
lea_ is now known as figment
simi has joined #ruby-lang
figment has quit [Changing host]
figment has joined #ruby-lang
kapil___ has quit [Changing host]
kapil___ has joined #ruby-lang
ur5us has joined #ruby-lang
bastilian68 has joined #ruby-lang
figment has left #ruby-lang ["cha"]
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
|jemc| has quit [Ping timeout: 264 seconds]
Lewix has quit [Remote host closed the connection]
bastilian68 is now known as bastilian
Mr0rris0 has joined #ruby-lang
figment has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
mattyohe has quit [Quit: Connection closed for inactivity]
amclain has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
fusillicode has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
skade has joined #ruby-lang
roamingdog has joined #ruby-lang
roamingdog has quit [Read error: No route to host]
roamingdog has joined #ruby-lang
rbowlby has joined #ruby-lang
strixd has joined #ruby-lang
ghostpl has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
ghostpl has quit [Ping timeout: 252 seconds]
arBmind has quit [Ping timeout: 245 seconds]
skade has quit [Quit: Computer has gone to sleep.]
symm- has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
micmus has quit [Ping timeout: 246 seconds]
kapil___ has quit []
gwendall has joined #ruby-lang
roamingdog has joined #ruby-lang
gwendall has quit [Ping timeout: 252 seconds]
ledestin has joined #ruby-lang
lytol has joined #ruby-lang
figment has quit [Remote host closed the connection]
Integralist has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
micmus has joined #ruby-lang
marr has joined #ruby-lang
elia has joined #ruby-lang
rbowlby has quit [Remote host closed the connection]
tunaCanBruh has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
skade has joined #ruby-lang
mikecmpbll has joined #ruby-lang
PhaseCode has joined #ruby-lang
fragamus has joined #ruby-lang
ghostpl has joined #ruby-lang
solars has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
Bwild has quit [Ping timeout: 240 seconds]
dagda1_ has quit [Remote host closed the connection]
dagda1 has joined #ruby-lang
michael_mbp has quit [Excess Flood]
dagda1 has quit [Read error: Connection reset by peer]
dagda1 has joined #ruby-lang
apeiros_ has joined #ruby-lang
michael_mbp has joined #ruby-lang
skarn has quit [Killed (orwell.freenode.net (Nickname regained by services))]
postmodern has joined #ruby-lang
skarn_ has joined #ruby-lang
solars has quit [Quit: WeeChat 0.4.2]
<yorickpeterse>
morning
gwendall has joined #ruby-lang
benlovell has joined #ruby-lang
ocdmw has joined #ruby-lang
vozcelik has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Forgetful_Lion has quit [Remote host closed the connection]
Guest61116 has joined #ruby-lang
<Guest61116>
I need assistance
<Guest61116>
I'm trying to build a compiler for the hack language in ruby
<Guest61116>
and I keep getting an "undefined method [] error" but I can't see why as I've used these same conventions before
ocdmw has quit [Remote host closed the connection]
JoshuaPaling has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
Guest61116: .match could return nil, do use `parts[...]` but parts might be nil
<Guest61116>
im literally banging my head against the wall
<Guest61116>
what the fuck does it MEAN?
<Guest61116>
I'm essentially trying to check if certain matches are there or not
<Guest61116>
because each match requires different assembly
<Guest61116>
so how can I do what I am trying to do
<ljarvis>
it means you thought something match, but it didn't so you need to check if parts is nil
<apeiros_>
use the backtrace
<Guest61116>
before I start checking the individual pieces of parts
<apeiros_>
it tells you where it happens
ghostpl has quit [Remote host closed the connection]
<apeiros_>
instead of reading all of your code over and over…
<ljarvis>
^
<apeiros_>
then work your way back
<Guest61116>
i mean i know where it happens
<ljarvis>
although that *is* the problem :)
<apeiros_>
you did not tell us
oleo has joined #ruby-lang
<Guest61116>
i was looking at line 106
ghostpl has joined #ruby-lang
<Guest61116>
i just did not think that it was treating parts as nil
<Guest61116>
i need to be better at that
<apeiros_>
and I for one am not going to even look at your code without a backtrace.
<Guest61116>
HackAssembler.rb:105:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError)
<Guest61116>
from HackAssembler.rb:88:in `each'
<Guest61116>
from HackAssembler.rb:88:in `<main>'
<ljarvis>
so in other news, i forgot adding a column with a default to postgres backfilled the table :( :( :(
<Guest61116>
how am I supposed to read that intuitively
<ljarvis>
Guest61116: it means you're using the method [] on a nil value, which mean parts is nil, which tracing back means instruction.lstrip.match(CCommand) returned nil
<apeiros_>
Guest61116: line for line. it tells you file, line and method
<ljarvis>
checking the documentation for match shows us that it returns nil if no match is found
<ljarvis>
success!
<apeiros_>
feel free to suggest a better format
<Guest61116>
im not :P
<Guest61116>
ruby is just not like c++ in the ways i am used to thinking
yfeldblum has quit [Ping timeout: 245 seconds]
oleo__ has quit [Ping timeout: 255 seconds]
<Guest61116>
thanks for the help
Guest61116 has quit [Quit: Leaving]
marr has quit [Ping timeout: 264 seconds]
<apeiros_>
I love it when people complain about stuff they don't understand because they didn't spend a second to figure it out…
<apeiros_>
"it doesn't implant the data directly into my head!!!"
hhatch has quit [Ping timeout: 264 seconds]
<yorickpeterse>
ljarvis: enjoy that table lock of yours
<ljarvis>
yorickpeterse: yarly :(
benlovell has quit [Ping timeout: 246 seconds]
<yorickpeterse>
better to add a null column, then add a default using UPDATE and then set the default
<yorickpeterse>
that way you only need 1283091283190238192 row locks
gwendall has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
Thecrazylumberja has quit [Read error: Connection reset by peer]
benlovell has joined #ruby-lang
gwendall has joined #ruby-lang
lytol has quit [Remote host closed the connection]
<ljarvis>
yeah i actually wanted a not-null constraint but i didn't add that because i knew it would lock. I thought adding the default wouldn't lock since it would only affect new columns. But that's only the case if the column exists already, adding it as a new column backfills
<ljarvis>
lesson learnt
roamingdog has joined #ruby-lang
Bwild has joined #ruby-lang
roamingdog has quit [Ping timeout: 252 seconds]
hendranata_ has quit [Ping timeout: 256 seconds]
<yorickpeterse>
oh hey half a million new reviews in our DB
stef204 has joined #ruby-lang
<yorickpeterse>
and pg doesn't even break a sweat
Bwild has quit [Remote host closed the connection]
<yorickpeterse>
I guess it was a wise decision to use a beefy pg instance instead of picking something smaller
Bwild has joined #ruby-lang
JoshuaPaling has joined #ruby-lang
<yorickpeterse>
12GB of data now, notbad.jpg
ledestin has quit [Quit: ledestin]
Integralist has quit [Ping timeout: 244 seconds]
Integralist has joined #ruby-lang
benlovell has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
<yorickpeterse>
ljarvis: do you happen to know if Pg has some way of telling how much it has loaded into RAM?
<yorickpeterse>
RDS only has that freeable memory crap but that's super confusing to read
<yorickpeterse>
and I don't think there's a guarantee that indexes are always in memory
ldnunes has joined #ruby-lang
ocdmw has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby-lang
ocdmw has quit [Remote host closed the connection]
ocdmw has joined #ruby-lang
Bwild has quit [Ping timeout: 252 seconds]
ocdmw has quit [Remote host closed the connection]
ghostpl has quit [Remote host closed the connection]
<havenwood>
I don't really mind having multiple Ruby channels. Though maybe it'd be better for new folk to consolidate.
ghostpl has quit [Remote host closed the connection]
<havenwood>
yorickpeterse: It's a better populated, more active channel.
benlovell has quit [Ping timeout: 245 seconds]
marr has quit [Ping timeout: 256 seconds]
<havenwood>
With the exact same topic subject.
<havenwood>
Just about three times as many people.
<yorickpeterse>
because the size matters right?
gwendall has joined #ruby-lang
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse>
tbh I couldn't care less, but I don't really see why one should redirect to the other. As far as I can tell the amount of troll is also higher in #ruby
<yorickpeterse>
but I could be mistaken
<workmad3>
yorickpeterse: #ruby doesn't require nick registration, while here it's needed for voice, I believe
<havenwood>
workmad3: I don't think that's still true though.
<yorickpeterse>
workmad3: nick reg was lifted a while ago by zenspider I believe
<workmad3>
ah, ok
<yorickpeterse>
and it was in place to combat heavy spam
<workmad3>
could be down to me limiting my trolling to #ruby then :P
<workmad3>
personally, I tend to notice that the types of conversation are different in #ruby and #ruby-lang
gwendall has quit [Ping timeout: 265 seconds]
mahmoudmahfouz has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
<havenwood>
yorickpeterse: But yeah, size matters. An empty channel isn't valuable to people looking for help or feedback. A well-populated, responsive channel is lovely.
<yorickpeterse>
332 people isn't exactly empty
<havenwood>
Not that his channel is dead. People get good help here. :)
<havenwood>
yorickpeterse: Indeed!
<yorickpeterse>
Plus, I could have 120938109238109 bots /join and based on that argument this channel would be better
<workmad3>
yorickpeterse: bot party!!!!
<yorickpeterse>
as far as I know this channel is responsive enough
<workmad3>
yorickpeterse: it would be awesome! especially if they talked to each other!!!
<havenwood>
yorickpeterse: less than if they were consolidated, but sufficient to not be a problem
<yorickpeterse>
workmad3: a few years ago I bumped into these two bots that would do some sort of dance or w/e with each other
ghostpl has joined #ruby-lang
<yorickpeterse>
it was pretty cool, though I Forgot the name
<havenwood>
(I'm actually a bot sent to bolster this channel's numbers. Shhhh.)
micmus has quit [Ping timeout: 252 seconds]
|jemc| has joined #ruby-lang
Integralist has quit [Ping timeout: 245 seconds]
tcopeland has joined #ruby-lang
bzalasky has joined #ruby-lang
thebastl has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
fujimura has joined #ruby-lang
djellemah_ has joined #ruby-lang
fujimura has quit [Ping timeout: 265 seconds]
djellemah has quit [Ping timeout: 256 seconds]
fusillicode has quit [Ping timeout: 246 seconds]
mskaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby-lang
arBmind has quit [Ping timeout: 245 seconds]
riotjones has joined #ruby-lang
dagda1 has quit [Read error: Connection reset by peer]
arBmind has joined #ruby-lang
mkaesz has quit [Ping timeout: 245 seconds]
chouhoul_ has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby-lang
__butch__ has joined #ruby-lang
dagda1 has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
davispuh has quit [Read error: Connection reset by peer]
roamingdog has quit [Remote host closed the connection]
davispuh has joined #ruby-lang
davispuh has quit [Read error: Connection reset by peer]
the_real_intinig has quit [Remote host closed the connection]
lusaisai has joined #ruby-lang
bb010g has quit [Quit: Connection closed for inactivity]
lusaisai has quit [Client Quit]
davispuh has joined #ruby-lang
strixd has quit [Quit: 500]
amsi has joined #ruby-lang
davispuh has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
roamingdog has joined #ruby-lang
skade has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 245 seconds]
thelastinuit has joined #ruby-lang
skade has quit [Remote host closed the connection]
fusillicode has joined #ruby-lang
skade has joined #ruby-lang
skade has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
micmus has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
jefus_ has joined #ruby-lang
skade has joined #ruby-lang
fusillicode1 has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 245 seconds]
deol has joined #ruby-lang
jefus has quit [Ping timeout: 256 seconds]
benlovell has joined #ruby-lang
Miphix has quit [Quit: Leaving]
fusillicode has quit [Ping timeout: 246 seconds]
solars has joined #ruby-lang
benlovell has quit [Ping timeout: 264 seconds]
tunaCanBruh has quit [Ping timeout: 252 seconds]
fusillicode has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
lytol has joined #ruby-lang
fusillicode1 has quit [Ping timeout: 250 seconds]
jkyle has quit [Disconnected by services]
jkyle1 has joined #ruby-lang
Grey__ has joined #ruby-lang
lytol has quit [Ping timeout: 252 seconds]
wallerdev has joined #ruby-lang
yfeldblum has joined #ruby-lang
Voker57 has joined #ruby-lang
Voker57|2 has joined #ruby-lang
jefus_ has quit [Quit: Leaving]
dereck has joined #ruby-lang
simi has quit [Ping timeout: 246 seconds]
dereck is now known as jefus
mikecmpbll has joined #ruby-lang
ghostpl has quit [Remote host closed the connection]