cagomez has quit [Remote host closed the connection]
brent__ has quit [Remote host closed the connection]
hays has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
<hays>
i have a hash and i want to iterate through it to create another hash. I've been doing this by just creating a new hash and then iterating through the old one and populating the hash as I go. Is there a more idiomatic way to do this?
<hays>
I see Hash[ ] as a possibility
<hays>
but it looks weird if there is a block in there
<adam12>
each_with_object or reduce maybe?
<adam12>
Show us what you've already done
<adam12>
err, inject not reduce.
<hays>
its on another computer.. let me see if i can reproduce it
cadillac_ has quit [Read error: Connection reset by peer]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
cadillac_ has joined #ruby
<hays>
adam12: this is a bit contrived... the hash is much bigger than this.. im basically pulling items out of each entry and making a new entry in the new hash. https://bpaste.net/show/e5260afe1dd6
kt has joined #ruby
<hays>
v+1 is a proxy for some sort of set of operations or function that would return the new value
<adam12>
hays_: Ah. It's a fancier version than using inject.
<adam12>
hays_: but yes, you'd call the variable a the "accumulator" usually. It persists through the loop.
<hays>
why is it being passed a []
bronson has joined #ruby
<adam12>
So we initialize with an empty hash as our accumulator, iterate through our hash like we normally do, but receive an extra arg as the accumulator, which we stick our new values in.
<adam12>
What do you mean [ ]?
<hays>
each_with_object in that example looks like its being passed an array
<adam12>
It's a hash. each_with_object( { } )
<adam12>
I'm using square-bracket notation to set the value of course.
Dimik has joined #ruby
<adam12>
Unless you mean the example you posted about evens = ?
<hays>
sorry, missed your link. I understand now
bronson has quit [Ping timeout: 276 seconds]
kt has joined #ruby
<hays>
im still a bit puzzled how something like that would work under the hood
goyox86 has joined #ruby
<hays>
i wonder if there are docs for rubinius like for mri ruby.. i could see the source code for it
jinie_ has quit [Ping timeout: 276 seconds]
<adam12>
Maybe?
<hays>
thanks
jinie_ has joined #ruby
gusrub has quit [Remote host closed the connection]
<baweaver>
>> [1,2,3].reduce(0) { |accumulator, x| accumulator + x } # reduce is a bit trippier. It uses a function to fold the elements into one element
<hanetzer>
interesting. how then is archlinux bypassing this...
kt has quit [Ping timeout: 240 seconds]
<havenwood>
hanetzer: Different distros choose different flags for the default location. The --user-install flag is one major setting that'll make the location vary.
<havenwood>
hanetzer: dev or prod?
<hanetzer>
havenwood: currently indev. its a new sort of windows runtime based on musl
cam27 has quit [Read error: Connection reset by peer]
kt has quit [Ping timeout: 276 seconds]
cam27 has joined #ruby
paradisaeidae_ has quit [Ping timeout: 248 seconds]
paradisaeidae has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
rahult has joined #ruby
rahult is now known as rahult_
rahult_ is now known as rahult
bronson has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
godd2 has quit [Ping timeout: 240 seconds]
kt has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
conta has joined #ruby
kt has quit [Ping timeout: 255 seconds]
cam27 has quit [Read error: Connection reset by peer]
cam27 has joined #ruby
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
rahult is now known as rahult_
minimalism has quit [Quit: minimalism]
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kt has joined #ruby
minimalism has joined #ruby
rahult has joined #ruby
tvw has joined #ruby
conta has quit [Ping timeout: 240 seconds]
rahult is now known as rahult_
rahult_ has quit [Client Quit]
rahult has joined #ruby
kt has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
paradisaeidae has quit [Ping timeout: 248 seconds]
paradisaeidae_ has quit [Ping timeout: 260 seconds]
ltem has joined #ruby
yabbes_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
cam27 has quit [Read error: Connection reset by peer]
anisha has joined #ruby
ana_ has joined #ruby
cam27 has joined #ruby
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
paradisaeidae_ has quit [Client Quit]
paradisaeidae has quit [Client Quit]
psmolen has quit [Ping timeout: 268 seconds]
code_zombie_ has joined #ruby
dcunit3d has joined #ruby
rahult is now known as rahult_
rahult_ is now known as rahult
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
bronson has joined #ruby
rahult has joined #ruby
kt has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
psmolen has joined #ruby
b0mbnet has joined #ruby
TomyLobo3 has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
kt has quit [Ping timeout: 240 seconds]
dlitvak has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
b0mbnet has quit [Client Quit]
vali has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
kt has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
FahmeF has joined #ruby
minimalism has quit [Quit: minimalism]
cam27 has quit [Read error: Connection reset by peer]
Beams has joined #ruby
ramfjord has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
digitalnomad has joined #ruby
rabajaj has joined #ruby
ltem has quit [Quit: Leaving]
cam27 has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
dar123 has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
Bhootrk_ has joined #ruby
Silthias1 has quit [Read error: Connection reset by peer]
Mgtuiw211 has joined #ruby
digitalnomad has quit [Ping timeout: 260 seconds]
Silthias has joined #ruby
vindvaki has joined #ruby
dennisvennink has joined #ruby
sysvalve has joined #ruby
Mgtuiw211 has quit [Client Quit]
dcunit3d has quit [Ping timeout: 260 seconds]
simmaniac has joined #ruby
djbkd has quit []
djbkd has joined #ruby
djbkd has quit [Client Quit]
sysvalve has quit [Ping timeout: 248 seconds]
pocketprotector has quit [Ping timeout: 240 seconds]
tirej has joined #ruby
pocketprotector has joined #ruby
FahmeF has quit [Remote host closed the connection]
MrSparkle has quit [Ping timeout: 240 seconds]
mark_66 has joined #ruby
tvl has joined #ruby
tvl is now known as tobiasvl
kt has quit [Ping timeout: 260 seconds]
kt has joined #ruby
tirej has quit [Quit: leaving]
hanetzer has quit [Remote host closed the connection]
hanetzer1 has joined #ruby
TomyWork has joined #ruby
MrSparkle has joined #ruby
hanetzer1 has quit [Client Quit]
hanetzer has joined #ruby
kt has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
http_GK1wmSU has joined #ruby
tvw has quit [Remote host closed the connection]
bronson has joined #ruby
http_GK1wmSU has left #ruby [#ruby]
ramfjord has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 240 seconds]
cam27 has quit [Read error: Connection reset by peer]
cam27 has joined #ruby
digitalnomad has joined #ruby
FahmeF has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
kt has joined #ruby
CrazyEddy has joined #ruby
leandrobighetti has joined #ruby
dennisvennink has quit [Excess Flood]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kt has quit [Ping timeout: 258 seconds]
benjen has quit [Ping timeout: 276 seconds]
MichaelBurge has quit [Ping timeout: 258 seconds]
MichaelBurge has joined #ruby
romankapitonov has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
pygospa has joined #ruby
pandaant has joined #ruby
pandaant has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<ineb>
mfw i bought a 144hz monitor and realized the hdmi output only supports 60hz
ur5us has quit [Remote host closed the connection]
InfinityFye has joined #ruby
marr has joined #ruby
dcunit3d has joined #ruby
<hanetzer>
ineb: that's the usual. I have one (linux can only push 120hz on amdgpu so far, though. still good)
<hanetzer>
gotta use dvi or maybe displayport
CrazyEddy has quit [Remote host closed the connection]
<hanetzer>
dual-link dvi, for that matter.
cam27 has quit [Read error: Connection reset by peer]
<ineb>
hanetzer: the monitor only has DP and HDMI :/
apparition has quit [Read error: Connection reset by peer]
<hanetzer>
then dp it will have to be, probably.
apparition has joined #ruby
cam27 has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
CrazyEddy has joined #ruby
kt has joined #ruby
yosafbridge` has quit [Quit: Leaving]
benjen has joined #ruby
cam27 has quit [Read error: Connection reset by peer]
kt has quit [Ping timeout: 240 seconds]
kt has joined #ruby
ltem has joined #ruby
yosafbridge has joined #ruby
mim1k has joined #ruby
anisha has quit [Read error: Connection reset by peer]
kt has quit [Ping timeout: 260 seconds]
anisha has joined #ruby
bronson has joined #ruby
Guest27414 is now known as jonds
kkiero has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
bronson has quit [Ping timeout: 240 seconds]
hanetzer has quit [Quit: WeeChat 1.9]
tomphp has joined #ruby
mikecmpbll has joined #ruby
dennisvennink has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MichaelBurge has quit [Ping timeout: 246 seconds]
MichaelBurge_ has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 248 seconds]
kt has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
konsolebox has joined #ruby
kt has quit [Ping timeout: 240 seconds]
grant has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
PaulCapestany has quit [Quit: .]
conta has quit [Ping timeout: 260 seconds]
Asher has quit [Quit: Leaving.]
dcunit3d has joined #ruby
PaulCapestany has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
dennisvennink has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has joined #ruby
charliesome has joined #ruby
rgtk has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
mtkd has quit [Ping timeout: 240 seconds]
anisha has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
ShekharReddy has joined #ruby
anisha has joined #ruby
ramfjord has joined #ruby
ayonkhan has joined #ruby
ayonkhan has quit [Client Quit]
mtkd has joined #ruby
bronson has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 260 seconds]
kt has joined #ruby
MarkBilk_ has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
cagomez has joined #ruby
mustaffa_ has joined #ruby
lookatme has joined #ruby
tvw has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
MarkBilk has joined #ruby
mustaffa has quit [Ping timeout: 248 seconds]
cagomez has quit [Ping timeout: 255 seconds]
MarkBilk has quit [Ping timeout: 255 seconds]
domgetter has joined #ruby
lookatme has quit [Quit: Leaving]
conta has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
Xiti has quit [Ping timeout: 268 seconds]
cagomez has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
yabbes_ has quit [Quit: lu]
dcunit3d has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
InfinityFye has quit [Ping timeout: 260 seconds]
dcunit3d has quit [Ping timeout: 240 seconds]
acalycine has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
Terens has joined #ruby
<Terens>
hello
kkiero has left #ruby [#ruby]
ur5us has joined #ruby
lancetw has quit [Quit: Connection closed for inactivity]
vali has quit [Changing host]
vali has joined #ruby
ur5us_ has joined #ruby
universal has quit [Ping timeout: 240 seconds]
ur5us has quit [Read error: No route to host]
InfinityFye has joined #ruby
cagomez has joined #ruby
universa1 has joined #ruby
bronson has joined #ruby
noe has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 246 seconds]
ams__ has joined #ruby
_sfiguser has joined #ruby
jaruga has joined #ruby
<dminuoso>
Hello.
cagomez has joined #ruby
Bhootrk_ has quit [Read error: Connection reset by peer]
cagomez has quit [Ping timeout: 268 seconds]
dlitvak has joined #ruby
_sfiguser has quit [Remote host closed the connection]
aupadhye has joined #ruby
code_zombie_ has quit [Ping timeout: 246 seconds]
InfinityFye has quit [Ping timeout: 240 seconds]
high_fiver has joined #ruby
Trynemjoel has quit [Ping timeout: 264 seconds]
Trynemjoel has joined #ruby
dcunit3d has joined #ruby
yabbes has joined #ruby
umaaji has quit [Quit: Leaving...]
ramfjord has joined #ruby
aupadhye is now known as aupadhye|busy
aupadhye|busy is now known as aupadhye
jinie_ has quit [Ping timeout: 255 seconds]
<dionysus69>
hey
<dminuoso>
o/
<dionysus69>
is there a ruby library that can take one photo/pdf and compare it to another and see if there's a difference?
<dionysus69>
i am trying to validate if user uploads a signed document, physically signed and scanned
high_fiver has quit [Ping timeout: 255 seconds]
kapil___ has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
jinie_ has joined #ruby
<dminuoso>
dionysus69: What algorithm are you looking for?
<dionysus69>
meaning?
ramfjord has quit [Ping timeout: 260 seconds]
<dionysus69>
I am looking for some library that can analyze png/jpg/pdf as a photo
<dionysus69>
and detect if changes have been made, like a signature for example
dennisvennink has joined #ruby
<dminuoso>
dionysus69: There's various metrics to go by.
<dminuoso>
dionysus69: RMSE, PSNR, SSIM
<dminuoso>
dionysus69: But if you want to look for specific things being changed you basically have no choice than to find a machine learning solution.
<dionysus69>
hmm that quickly became overly complicated :D
<dminuoso>
dionysus69: And those btw are more quality focused.
<dminuoso>
Then there's things like perceptually based metrics..
<dionysus69>
ahh
<dminuoso>
dionysus69: If it was just a digital image it would be simple. But because the image was re-digitized, you have to assume that the image was not aligned perfectly, slightly folded..
<dminuoso>
Different lightning
<dminuoso>
Bad printer
<dionysus69>
I have no idea what you are talking about to be honest :D I never delved into machine learning :)
<dminuoso>
dionysus69: I mean what you could do, is provide a box and give some graphical hints to find that box. That could simplify the process.
<dionysus69>
step one would be to crop a white rectangular shape, then compare to the original :S
<dminuoso>
dionysus69: And how do you find where to crop?
<dionysus69>
yep, I could do that, make a thick bordered rectangular box for example
<dionysus69>
I could crop by giving whole document a second thick rectangular box, perhaps dashed?
<dminuoso>
dionysus69: What if the paper was slightly folded so that the rectangular shape now appears as an octogon?
<dionysus69>
dashed border for doc and solid border for signature for example
<Terens>
Hello.
http_GK1wmSU has joined #ruby
<dionysus69>
what is octogon :D
<dionysus69>
looks like a angular circle :D
<dminuoso>
dionysus69: think irregular octagon :P
http_GK1wmSU has left #ruby [#ruby]
<dionysus69>
ok anyways
<Terens>
I want to have several devices controlled by a centralized cloud app. First issue I have was with data sync. However data sync can be solved somewhat easilly since changes would be applied only on the cloud and sent to each device. My other issue is with RPC or something like that.
<dionysus69>
i dont wanna become a AI professional just to find a signature :D I ll deal with that later :P
ramfjord has joined #ruby
<Terens>
If I use websockets then there is no easy way to tell if device is connected or whether message is delivered. I have to implement timeouts/retrying/ordering myself.
<Terens>
I looked at rabbitmq but I am not sure whether it solves my problems.
ramfjord has quit [Ping timeout: 255 seconds]
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
bronson has joined #ruby
bane_ has joined #ruby
dstrunk has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
dstrunk has quit [Client Quit]
Paraxial has quit [Remote host closed the connection]
Paraxial has joined #ruby
Paraxial has quit [Remote host closed the connection]
Pumukel has joined #ruby
Paraxial has joined #ruby
Paraxial has quit [Remote host closed the connection]
Paraxial has joined #ruby
tacoboy has joined #ruby
Paraxial has quit [Remote host closed the connection]
ldnunes has joined #ruby
Paraxial has joined #ruby
cagomez has joined #ruby
FahmeF has quit []
Norm has quit [Quit: Norm]
cagomez has quit [Ping timeout: 276 seconds]
nopolitica has quit [Ping timeout: 240 seconds]
sleepee has quit [Ping timeout: 248 seconds]
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
apparition47 has joined #ruby
bmurt has joined #ruby
dionysus69 has quit [Ping timeout: 258 seconds]
InfinityFye has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
anisha has quit [Ping timeout: 240 seconds]
quiller has quit [Ping timeout: 255 seconds]
quiller has joined #ruby
thecommongeek has joined #ruby
anisha has joined #ruby
GinoMan has joined #ruby
<darix>
terens: amqp can be a good transport medium for this. especially as it can have persistent queues (if that is important for you) other options might be zeromq, MQTT
<darix>
a lightweight MQTT implementation is mosquitto
<darix>
if i recall correctly newer rabbitmq supports it too?
cagomez has joined #ruby
dcunit3d has joined #ruby
konsolebox has quit [Ping timeout: 246 seconds]
GinoMan2440 has joined #ruby
sepp2k has joined #ruby
dn` has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
dcunit3d has quit [Ping timeout: 260 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
GinoMan has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
roshanavand has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
selim_ has joined #ruby
selim has quit [Ping timeout: 248 seconds]
Mon_Ouie has quit [Quit: WeeChat 1.9]
Guest30814 has joined #ruby
<Guest30814>
hi
<Guest30814>
have any idea how should looks like csv with assosiation??
GodFather has joined #ruby
nopolitica has joined #ruby
<Guest30814>
ok i have a array with [:name, :smth, :smt2, interests: [interest1:[:name, :id], interest2:[:name, :id] ]]
<Guest30814>
how should build csv from this
oleo has joined #ruby
Pumukel has quit []
ta_ has quit [Remote host closed the connection]
ldnunes has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
Drakevr has quit [Ping timeout: 255 seconds]
Drakevr has joined #ruby
Xiti has joined #ruby
thecommongeek has quit [Quit: leaving]
_aeris_ has quit [Excess Flood]
Tempesta has joined #ruby
_aeris_ has joined #ruby
ldnunes has joined #ruby
TheHodge has joined #ruby
milardovich has joined #ruby
thbar has joined #ruby
segy_ has joined #ruby
sneep_ is now known as sneep
milardovich has quit [Remote host closed the connection]
agimenez has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
simmaniac has quit [Ping timeout: 255 seconds]
sysvalve has joined #ruby
segy has quit [Ping timeout: 260 seconds]
segy_ is now known as segy
milardovich has joined #ruby
anisha has quit [Read error: Connection reset by peer]
agimenez has quit [Ping timeout: 276 seconds]
anisha has joined #ruby
thbar has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
<guardian>
hello, when using to_yaml on a hash, when keys are symbols they are serialized with a leading ':'
<guardian>
is there a way to avoid that?
vali has quit [Quit: vali]
dcunit3d has joined #ruby
rabajaj has quit [Quit: Leaving]
dcunit3d has quit [Ping timeout: 240 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us_ has quit [Remote host closed the connection]
imajes has joined #ruby
MarkBilk has joined #ruby
cdg has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
bruno- has joined #ruby
govg has quit [Ping timeout: 246 seconds]
mabus44 has joined #ruby
eip` has joined #ruby
<eip`>
hi guys, ruby noob here, I have a datamapper::collection, how can I print on screen a field of it ?
<eip`>
hope question is clear enough
<Mon_Ouie>
impermanence: Use group_by(&:category) to get a hash that maps each category to an array of objects of that category, then reduce to calculate the sums
<eip`>
lets say I do something like: data = blabla::bla.first(:name => name)
guacamole has quit [Client Quit]
<eip`>
with data.inspect I can see the fields, in this case "name"
<eip`>
but what if I had more fields, and I wanted to just print the "name" field?
guacamole has joined #ruby
guacamole has quit [Client Quit]
dar123 has joined #ruby
guacamole has joined #ruby
chouhoulis has quit [Remote host closed the connection]
guacamole has quit [Client Quit]
impermanence has joined #ruby
<impermanence>
Mon_Oui: can you paste your original response to me, please? I lost my session, but wanted to ask you a question.
guacamole has joined #ruby
<Mon_Ouie>
Sure
<Mon_Ouie>
impermanence: Use group_by(&:category) to get a hash that maps each category to an array of objects of that category, then reduce to calculate the sums
<impermanence>
Mon_Ouie: thank you
<impermanence>
Mon_Ouie: what do you mean when you say "reduce"?
<havenwood>
>> module Impermenence; module_function def - _; 42 end end; some_array = [[Impermenence, nil]]; some_array.map { |x, y| y - x }
<ruby[bot]>
havenwood: # => undefined method `-' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/841714)
clamstar has quit [Ping timeout: 240 seconds]
<havenwood>
impermanence: show the code!
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
Muz has quit [Ping timeout: 240 seconds]
moeabdol has quit [Quit: WeeChat 1.9]
Muz has joined #ruby
mtkd has joined #ruby
ramfjord has joined #ruby
<impermanence>
sorry :) I was writing other code
<impermanence>
one sec here
ivanskie has joined #ruby
<ivanskie>
hi all
<ivanskie>
any Savon / SOAP experts heaarrrr?
eightlimbed has quit [Ping timeout: 240 seconds]
<impermanence>
arr1 = [ bunch of ints ] ; arr2 = [ bunch of ints ] ; arr1.zip(arr2).map { |x, y| y - x }
<ivanskie>
first time trying out savon, or dealing with soap overall. and my request in soapui works. but in savon i keep getting errors. and i don't understand what im missing. or how to see where the problem is. rather what the request looks like in savon to compare it to soapui
ramfjord has quit [Ping timeout: 240 seconds]
<impermanence>
I guess zip is my problem probably?
<herwin>
are the arrays the same size?
jenrzzz has joined #ruby
<impermanence>
one sec
ramfjord has joined #ruby
<impermanence>
I believe not but hang on
<impermanence>
my repl was suggesting that didn't matter; that zip handled that nicely :)
<impermanence>
not necc same size
<baweaver>
what exactly are you trying to do?
<baweaver>
because that'll crash
<impermanence>
oh
<impermanence>
trying to do:
<baweaver>
>> [1,2,3].zip([1,2]) { |x,y| x - y }
<ruby[bot]>
baweaver: # => nil can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/841717)
<impermanence>
if two arrays have element at same index, subtract; if not, don't
<baweaver>
is one always longer than the other
<baweaver>
or is there any way to know that?
<impermanence>
no way to know
<impermanence>
from pry: [[1, 1], [2, 2], [3, nil]]
clamstar has joined #ruby
<impermanence>
nvm pry threw the error you listed above
<impermanence>
once I tried to map that is
milardovich has quit []
ramfjord has quit [Ping timeout: 248 seconds]
<impermanence>
if they're the same length that works great
<baweaver>
then you need to write a conditional that gives you x if no y, y if no x, and y - x if both
ramfjord has joined #ruby
moeabdol has joined #ruby
bronson has joined #ruby
<baweaver>
havenwood: what gives with zip's block arg?
<Mon_Ouie>
Wait, I'm just getting different results as I re-run it for some reason
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
cagomez has quit [Ping timeout: 248 seconds]
<Mon_Ouie>
I guess it just doesn't show any output if a permission error occurs during the execution
dstrunk has joined #ruby
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
acalycine has quit [Ping timeout: 276 seconds]
guacamole has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sspreitz has joined #ruby
ted_ has joined #ruby
ted_ has quit [Read error: Connection reset by peer]
howdoi has quit [Quit: Connection closed for inactivity]
phinxy has quit [Read error: Connection reset by peer]
phinxy has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
<kyle__>
Mon_Ouie: I think it's new behavior, even if it shouldn't be. A script I wrote in March of this year did in fact work using this. Before my most recent release-upgrade.
<kyle__>
I just had to search through for scripts I did that in, and the most recent is March 7th.
<cahoots>
i'm running into a case frequently where i have a method does same lifting, let's call it "params()", and then i want to store that to a local variable to reuse efficiently. but i can't name it "params" because that would be weird... so would you call it "get_params()"? "fetch_params()"?
<cahoots>
let's get pedantic
nowhere_man has joined #ruby
<yorickpeterse>
cahoots: you mean you'd end up with something like `params = self.params`?
<yorickpeterse>
the name you'd give both method and variable really depends on what the method does
<cahoots>
yorickpeterse, yes, that's what i'd end up with
<cahoots>
the method is just split out to keep each method smal
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
hutch34 has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
alveric3 has joined #ruby
<yorickpeterse>
if the result of the method is always the same you could store it in an instance variable
t-recx has quit [Read error: Connection reset by peer]
t-recx has joined #ruby
ramfjord has joined #ruby
nopolitica has quit [Ping timeout: 246 seconds]
dennisvennink has quit [Read error: Connection reset by peer]
dcunit3d has quit [Ping timeout: 240 seconds]
nopolitica has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
impermanence has joined #ruby
herbmillerjr has joined #ruby
<cahoots>
yorickpeterse, i guess one thing i'm wondering is, is it considered bad form to name a local var the same as a method? does the interpreter get confused sometimes?
mostlybadfly has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Read error: Connection reset by peer]
ragnar has joined #ruby
nowhere_man has joined #ruby
<ragnar>
I need to open several binary files in a directory. For each file I need to edit it by inserting 65 byes of metadata starting at the beginning of file. I can't seem to figure this out without overwriting the existing data. Any ideas?