<FullMetalStacker>
but this does not do what I was hoping for since the increase of row_len is done only once and then all slices are that size
<FullMetalStacker>
can anyone give me a hint on how i can place some iterator increase inside my slicing block, or give me another direction that works?
<cxl>
Hi all, I'm trying to do a full text search in my Rails app using PgSearch. The problem is that documents are in different languages and stemming in psql requires the language to be set properly. PgSearch.multisearch_options is a class method so I don't really know the document's language at that point. What's the way to set the language dynamically per record?
some14u has joined #ruby
grokify has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
c10l has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Remote host closed the connection]
c10l has joined #ruby
D_A_N_ has joined #ruby
c10l has quit [Quit: See ya! o/]
supay has joined #ruby
c10l has joined #ruby
<FullMetalStacker>
Hey depesz! Thanks for the solution!! Much appreciated! I do not really understand what it does, can you explain?
moldorcoder7 has joined #ruby
<depesz>
FullMetalStacker: which part is not clear?
<depesz>
FullMetalStacker: in irb, try what arr=[....] arr.shift(3) does
<FullMetalStacker>
I understood the shift part but not the push and then the combination of both
<FullMetalStacker>
now i got it
<FullMetalStacker>
this is fucking brilliant :-)
<FullMetalStacker>
learned a ton of things by this!!!!!
<FullMetalStacker>
thank you so much. It humiliates me in showing me how much there is still for me to learn out there!
<FullMetalStacker>
not humiliates but humbles i meant
<FullMetalStacker>
thank you very much depesz!!
<FullMetalStacker>
This IRC channel is more worth than gold. Hope that one day I will be able to pay it forward here
<depesz>
FullMetalStacker: :) sorry, i suck at explaining, glad you got it :)
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
otisolsen70_ has joined #ruby
otisolsen70 has quit [Ping timeout: 260 seconds]
croberts has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
<FullMetalStacker>
depesz speaking about humbling and humiliation... here is my result https://dpaste.org/HWEc5
<FullMetalStacker>
and here is what the top student submitted to solve this exercise that I was solving:
<FullMetalStacker>
n**3
<FullMetalStacker>
def row_sum_odd_numbers(n)
<FullMetalStacker>
end
<adam12>
LOL
<FullMetalStacker>
LOL I got still a lot to learn ahead of me! But I am happy I could solve it anyway, thanks again for your great help!!
<adam12>
how does n**3 even work. What's the input?
<FullMetalStacker>
For anyone interested, this was the assignment:
<FullMetalStacker>
So there I went and built that entire pyramid in my solution and solved it with 11 lines of code step by step in the way I saw the pyramid of numbers...
<FullMetalStacker>
And then came along the mathematical mind who actually understood mathematically what this is all about and solved it with 4 characters only *ROFLCOPTER* :-D
<adam12>
FullMetalStacker: Gotta start somewhere.
<adam12>
FullMetalStacker: I think your solution is fine.
<adam12>
I probably would have done something similar. I'm not intimately familiar with Pascal's triangle, and in some ways, you're not really learning anything with the 1 liner.
<FullMetalStacker>
thanks adam12, you are too kind. I appreciate your kindness with noobs like me :-D
<adam12>
If anything, I'd take the opportunity to build on that. Add a simple unit test, use some Enumerable methods, look to reduce loops, etc.
<adam12>
Could use Enumerator#produce too, maybe. Lots of fun.
<FullMetalStacker>
thanks adam12 I will add that to my notes and train it!
some14u has joined #ruby
hightower2 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
alexherbo2 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mikaela has joined #ruby
Aminda has quit [Ping timeout: 255 seconds]
hightower2 has quit [Read error: Connection reset by peer]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
Averna has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]