01:07
hightower3 has joined #ruby
01:10
hightower2 has quit [Ping timeout: 268 seconds]
02:03
fercell has joined #ruby
02:04
fercell_ has quit [Ping timeout: 272 seconds]
02:04
HappyPassover is now known as Al2O3
02:13
pascal_blaze has joined #ruby
02:29
donofrio__ has joined #ruby
02:32
donofrio_ has quit [Ping timeout: 245 seconds]
02:33
TomyLobo has quit [Ping timeout: 260 seconds]
02:33
gaussianblue has joined #ruby
02:40
<
zayd >
How would I correctly pass a instance variable to a method in that same class?
https://bpa.st/BOAA This is what I'm trying, and it prints out "VALUE: " instead of printing it out with the value. When I set L28 to be round_ram(1) or something like that, it works, it just breaks when I try to give it a instance variable.
03:00
jenrzzz has quit [Ping timeout: 268 seconds]
03:00
jenrzzz_ has joined #ruby
03:06
<
weaksauce >
zayd you need to put all that in initialize
03:06
<
weaksauce >
class RAM is in the scope of the class itself
03:07
<
weaksauce >
anything under def is in the scope of an instance of ram which can be many
03:07
<
weaksauce >
only one RAM but many RAM.new instances
03:07
<
zayd >
weaksauce: everything? lsp starts yelling at me if i do that, should i just ignore it?
03:08
<
weaksauce >
you can ignore for now yeah
03:09
<
weaksauce >
make it right
03:09
<
weaksauce >
make it pretty
03:09
<
weaksauce >
make it fast
03:09
<
weaksauce >
in that order
03:15
<
zayd >
weaksauce: seems to work, thanks
03:38
jenrzzz_ has quit [Ping timeout: 260 seconds]
03:53
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:57
konsolebox has joined #ruby
04:06
_ht has joined #ruby
04:11
jenrzzz has joined #ruby
04:14
grenierm has joined #ruby
04:21
pascal_blaze has joined #ruby
05:43
gaussianblue has quit [Quit: leaving]
06:17
havenwood has joined #ruby
06:17
jenrzzz has quit [Ping timeout: 256 seconds]
06:22
jenrzzz has joined #ruby
06:26
rvalue has quit [Read error: Connection reset by peer]
06:27
rvalue has joined #ruby
06:39
jenrzzz has quit [Ping timeout: 272 seconds]
07:00
lucerne has quit [Ping timeout: 260 seconds]
07:03
ih8u has quit [Remote host closed the connection]
07:08
jenrzzz has joined #ruby
07:25
BSaboia has joined #ruby
07:28
BSaboia has quit [Remote host closed the connection]
07:29
BSaboia has joined #ruby
07:36
lucerne has joined #ruby
08:08
jenrzzz has quit [Ping timeout: 268 seconds]
08:10
TomyLobo has joined #ruby
08:46
jenrzzz has joined #ruby
08:50
grenierm has quit [Ping timeout: 250 seconds]
08:51
jenrzzz has quit [Ping timeout: 268 seconds]
09:09
osc4rpt has quit [Ping timeout: 260 seconds]
09:10
osc4rpt has joined #ruby
09:14
jenrzzz has joined #ruby
09:14
gaussianblue has joined #ruby
09:20
jenrzzz has quit [Ping timeout: 264 seconds]
10:30
deadmarshal_ has quit [Ping timeout: 268 seconds]
10:32
osc4rpt has quit [Ping timeout: 252 seconds]
10:33
osc4rpt has joined #ruby
10:37
donofrio__ has quit [Remote host closed the connection]
10:40
emilknievel has joined #ruby
10:53
donofrio has joined #ruby
10:57
jenrzzz has joined #ruby
11:02
jenrzzz has quit [Ping timeout: 264 seconds]
11:17
jenrzzz has joined #ruby
11:23
jenrzzz has quit [Ping timeout: 268 seconds]
11:26
osc4rpt has quit [Ping timeout: 245 seconds]
11:28
<
mooff >
zayd: the backticks thing from the other day.. you can def `(cmd) do_something_with(cmd) end to override what `some command` does
11:28
osc4rpt has joined #ruby
11:29
Trivial has joined #ruby
11:36
ken_barber has joined #ruby
11:37
deadmarshal_ has joined #ruby
11:40
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:42
<
mooff >
n.b. the MemFree value doesn't seem to match /bin/free, and MemCached doesn't match /bin/free's "buff/cache"
11:43
gaussianblue has quit [Quit: leaving]
11:43
<
mooff >
meaning the "used" value is different.. it seems to include cache too, for greater error ;P
11:50
ken_barber has quit [Quit: Client closed]
13:03
gaussianblue has joined #ruby
13:19
jenrzzz has joined #ruby
13:23
jenrzzz has quit [Ping timeout: 264 seconds]
13:48
donofrio_ has joined #ruby
13:49
donofrio__ has joined #ruby
13:52
donofrio has quit [Ping timeout: 255 seconds]
13:52
donofrio has joined #ruby
13:53
donofrio_ has quit [Ping timeout: 245 seconds]
13:53
donofrio_ has joined #ruby
13:54
donofrio__ has quit [Ping timeout: 245 seconds]
13:57
donofrio has quit [Ping timeout: 260 seconds]
14:07
otisolsen70 has joined #ruby
14:10
donofrio__ has joined #ruby
14:14
donofrio_ has quit [Ping timeout: 268 seconds]
15:03
polishdub has joined #ruby
15:04
gaussianblue has quit [Quit: leaving]
15:14
user71 has joined #ruby
15:21
jenrzzz has joined #ruby
15:28
jenrzzz has quit [Ping timeout: 252 seconds]
15:41
jenrzzz has joined #ruby
15:45
jenrzzz has quit [Ping timeout: 256 seconds]
15:51
factor2 has joined #ruby
15:52
factor2 has quit [Read error: Connection reset by peer]
15:56
factor2 has joined #ruby
16:01
konsolebox_ has joined #ruby
16:02
konsolebox has quit [Ping timeout: 256 seconds]
16:20
jenrzzz has joined #ruby
16:26
jenrzzz has quit [Ping timeout: 252 seconds]
16:33
donofrio_ has joined #ruby
16:35
jenrzzz has joined #ruby
16:36
donofrio_ has quit [Remote host closed the connection]
16:36
donofrio__ has quit [Ping timeout: 245 seconds]
16:36
donofrio_ has joined #ruby
16:40
jenrzzz has quit [Ping timeout: 268 seconds]
16:43
factor2 has joined #ruby
16:53
factor2 has joined #ruby
16:54
factor2 has quit [Client Quit]
16:54
factor2 has joined #ruby
16:56
otisolsen70 has quit [Quit: Leaving]
17:15
<
rapha >
hmm, so i had really long integers that i accidentally saved to sqlite as varchar and now they look like '1.14838269885531e+74' ... is an integer recoverable from that?
17:22
<
adam12 >
>> 1.14838269885531e+74.to_i
17:22
<
ruby-eval >
=> 114838269885530998508474828970629887146632918726700079172199233071016312832
17:34
CanuteTheGreat has joined #ruby
17:43
<
zayd >
is it suggested to put .rb files in /project/lib/file.rb or /project/lib/project/file.rb when they aren't the main project file?
17:50
<
Al2O3 >
best practice?
17:53
<
zayd >
yeah i guess. some stack overflow answer i found suggests putting them in lib/project/file.rb
18:04
<
Al2O3 >
sounds like what is suggested.
18:05
<
Al2O3 >
interestingly its not project or architecture specific, and each installation requirement for a job or contract may be quite different.
18:06
<
Al2O3 >
with anything contract, or work for hire, suck on that nipple that makes the checks clear.
18:08
<
Al2O3 >
when you figure out the conditionally correct location, inform us what you discovered.
18:08
<
adam12 >
zayd: There's a reason behind lib/project/file, and that is when Rubygem installs your package, it basically puts `lib` into $LOAD_PATH (where files are required from). So if you don't namespace under `lib/project`, you run the risk of collision with other libraries.
18:09
<
rapha >
oooh, so it's .to_f.to_i, thank you adam12
18:09
<
rapha >
>> '1.14838269885531e+74'.to_f.to_i
18:09
<
ruby-eval >
=> 114838269885530998508474828970629887146632918726700079172199233071016312832
18:09
<
adam12 >
ie. For your example, if you went to `require "file"`, you'd get the wrong `File`, I bet (maybe one from stdlib).
18:09
<
adam12 >
But if you required "myproject/file" you'd get the right one.
18:09
<
rapha >
(which is not to say that you are god, but thank both of you i guess :P )
18:10
<
adam12 >
rapha: You might want BigDecimal then....
18:11
<
adam12 >
>> require "bigdecimal"; BigDecimal("1.14838269885531e+74").to_i
18:11
<
ruby-eval >
=> 114838269885531000000000000000000000000000000000000000000000000000000000000
18:11
<
adam12 >
Err. maybe? Hmm.
18:11
<
rapha >
that doesn't look as correct as the above one did
18:11
<
adam12 >
I'm guessing the BigDecimal example is correct tho.
18:11
<
rapha >
these used to be hashes consisting of digits
18:11
<
adam12 >
You tell me? e+74 is basically moving the decimal place 74 places.
18:11
<
adam12 >
But how does it backfill those digits?
18:12
<
rapha >
why does .to_f.to_i result in the number it does, then?
18:12
<
adam12 >
Floating-point math maybe?
18:12
<
rapha >
because those hashes do not have lots of zeros in them
18:12
<
weaksauce >
because of ieee
18:12
<
weaksauce >
floating point spec
18:12
<
rapha >
but then i guess the info did get lost and god did forsake me :(
18:13
<
weaksauce >
once you get that big the accuracy goes to shit
18:13
<
rapha >
i should have INSERT'd them with quotation marks around the question marks :(
18:14
<
adam12 >
rapha: Maybe :( I guess you'd have to have a comparable number to determine if you've lost any accuracy.
18:14
<
weaksauce >
why is the number so big in the first place?
18:14
<
rapha >
there is no accuracy as such adam12. they weren't numbers to begin with, just hashes that happened to be written as strings of digits.
18:15
<
adam12 >
Can you reproduce one?
18:15
<
weaksauce >
so like a bad serialization thing?
18:16
<
adam12 >
If you generated them on the machine you're on, they might be right? (to_f, to_i)
18:17
<
adam12 >
I am not super familiar with IEEE 754 but maybe someone else is.
18:17
<
adam12 >
Assuming the co-processor or whatever on your machine would generate the same floating point value twice with the same input (pure)... ?
18:19
<
adam12 >
>> '1.14838269885531e+74'.to_f.to_i
18:19
<
ruby-eval >
=> 114838269885530998508474828970629887146632918726700079172199233071016312832
18:19
<
adam12 >
Hmm. Same number that I get locally.
18:21
<
rapha >
it is indeed the same machine
18:22
<
rapha >
and since they're fingerprint hashes, i should be able to reproduce
18:22
<
rapha >
would beat waiting a week again
18:22
<
rapha >
ah, no, they're not correct at all. the distance function find thousands of duplicates for each photo i try it on.
18:23
<
rapha >
oh well. you live, you learn.
18:23
<
adam12 >
Yeah :( store as a hexdigest next time I guess.
18:24
<
adam12 >
That's a shame.
18:27
<
rapha >
well, sorting one's photos is a big task either way 😂
18:27
<
rapha >
but i appreciate your compassion, adam 🤗
18:32
jenrzzz has joined #ruby
18:36
jenrzzz has quit [Ping timeout: 245 seconds]
18:54
Linux_Kerio has joined #ruby
19:04
Trivial has quit [Ping timeout: 268 seconds]
19:27
goldfish has joined #ruby
19:35
konsolebox_ has quit [Quit: .]
20:07
jenrzzz has joined #ruby
20:09
_ht has quit [Remote host closed the connection]
20:11
jenrzzz has quit [Ping timeout: 260 seconds]
20:13
pascal_blaze has joined #ruby
20:33
goldfish has quit [Remote host closed the connection]
20:37
user71 has quit [Quit: Leaving]
20:46
xdminsy has quit [Read error: Connection reset by peer]
21:00
goldfish has joined #ruby
21:00
jenrzzz has joined #ruby
21:05
jenrzzz has quit [Ping timeout: 268 seconds]
21:07
xdminsy has joined #ruby
21:47
goldfish has quit [Quit: Leaving]
21:52
johnjaye has quit [Ping timeout: 245 seconds]
21:55
pascal_blaze has quit [Ping timeout: 245 seconds]
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
22:00
johnjaye has joined #ruby
22:14
leah2 has quit [Ping timeout: 268 seconds]
22:22
leah2 has joined #ruby
22:33
jenrzzz has joined #ruby
22:40
jenrzzz has quit [Ping timeout: 245 seconds]
22:58
jenrzzz has joined #ruby
23:06
Al2O3 is now known as DocturdSquonky
23:14
desnudopenguino has quit [Read error: Connection reset by peer]
23:16
desnudopenguino has joined #ruby
23:55
TomyLobo has quit [Read error: Connection reset by peer]