jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
lalitmee has quit [Remote host closed the connection]
xco has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
schne1der has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
dellavg has joined #ruby
go|dfish has quit [Ping timeout: 250 seconds]
andikr has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Axy has quit [Ping timeout: 268 seconds]
go|dfish has joined #ruby
dionysus69 has joined #ruby
andikr has quit [Ping timeout: 276 seconds]
andikr has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
gix has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
sandstrom has joined #ruby
gix has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
DTZUZO has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
Mia has quit [Ping timeout: 264 seconds]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Axy has quit [Ping timeout: 276 seconds]
sphex has quit [Quit: leaving]
sphex has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
_mak_ has quit [Ping timeout: 250 seconds]
hagebake has quit [Ping timeout: 268 seconds]
ellcs has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
DTZUZO has joined #ruby
akemhp has joined #ruby
cgfbee has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
Intelo has joined #ruby
cgfbee has joined #ruby
DTZUZO has quit [Remote host closed the connection]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
schne1der has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
DTZUZO has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
mikecmpbll has joined #ruby
sandstrom has joined #ruby
phaul_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hagabaka has joined #ruby
_mak has joined #ruby
phaul_ has quit [Ping timeout: 268 seconds]
jacksop has joined #ruby
bitwinery has quit [Quit: Leaving]
ellcs has joined #ruby
phaul_ has joined #ruby
bsdbandit-01 has quit [Ping timeout: 240 seconds]
KeyJoo has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 276 seconds]
guardian has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
cisco has joined #ruby
cisco is now known as Guest38534
phaul_ has quit [Ping timeout: 240 seconds]
KeyJoo has quit [Quit: KeyJoo]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest38534 has quit [Ping timeout: 240 seconds]
LaChiave has joined #ruby
xco has joined #ruby
cisco_ has joined #ruby
jacksop has quit [Remote host closed the connection]
phaul_ has joined #ruby
sevvie has quit [Ping timeout: 268 seconds]
sevvie has joined #ruby
Mia has joined #ruby
guardian has joined #ruby
Axy has quit [Ping timeout: 252 seconds]
jacksop has joined #ruby
cisco_ has quit [Ping timeout: 240 seconds]
fanta1 has joined #ruby
jacksop has quit [Remote host closed the connection]
dbugger has joined #ruby
dr_mdma_md has quit []
jacksop has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tpanarch1st has joined #ruby
jacksoow has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
jacksoow has joined #ruby
Swyper has quit [Ping timeout: 268 seconds]
jacksop has quit [Remote host closed the connection]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
jacksop has joined #ruby
cisco has joined #ruby
cisco is now known as Guest72987
loveablelobster has joined #ruby
spacesuitdiver has joined #ruby
hagabaka has quit [Ping timeout: 265 seconds]
_mak has quit [Ping timeout: 276 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
LaChiave has quit [Quit: Bye Bye]
hagabaka has joined #ruby
_mak has joined #ruby
AJA4350 has joined #ruby
stryek has joined #ruby
xco has joined #ruby
Swyper has quit [Ping timeout: 264 seconds]
teclator has quit [Ping timeout: 265 seconds]
phaul_ has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
drincruz has joined #ruby
Swyper has joined #ruby
howdoi has joined #ruby
jacksoow has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
RiPuk_ has quit [Remote host closed the connection]
RiPuk has joined #ruby
tsrt^ has quit []
cd has joined #ruby
phaul_ has joined #ruby
drincruz has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jacksop has quit []
phaul_ has quit [Ping timeout: 240 seconds]
schne1der has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
rapha has joined #ruby
<rapha>
hi
<rapha>
is it possible that it's a *really* bad idea to nest begin-rescue-end blocks?
schne1der has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
kyrylo has joined #ruby
drincruz_ has joined #ruby
xco has joined #ruby
sandstrom has quit [Ping timeout: 246 seconds]
drincruz_ has quit [Ping timeout: 268 seconds]
teclator has quit [Ping timeout: 250 seconds]
teclator has joined #ruby
sandstrom has joined #ruby
phaul_ has joined #ruby
phaul_ has quit [Ping timeout: 265 seconds]
suukim has joined #ruby
<adam12>
rapha: What's your use case? or rather, what are you trying to do at a higher level? can you show some code?
<adam12>
rapha: Nested begin/rescue blocks aren't inheritently bad. Almost every Rails app is likely doing it without even knowing it. But you can specify multiple exceptions and rescue multiple times, and blocks (in 2.6) and method definitions (2.4?) are implicit begin/end blocks so you can rescue in there and drop a nesting.
<rapha>
adam12: i already rewrote it, so this is just me wanting to talk about best practices. the problem seems to have been that the inner block's rescue branches were never reached, only the outer block's rescue branches.
<adam12>
rapha: Hard to say without code.
schne1der has quit [Ping timeout: 252 seconds]
AJA4351 has joined #ruby
<rapha>
hmm okay. it's good to know that it's not necessarily bad. that means i just did something wrong. next time around i'll try to be more mindful of it.
<animo8>
Obviously it's a useless gimmick but it's nice for functional programming
chalkmonster has joined #ruby
LaChiave has joined #ruby
phaul_ has quit [Ping timeout: 268 seconds]
Intelo has quit [Remote host closed the connection]
Swyper has joined #ruby
mgraf__ has joined #ruby
robotcars has left #ruby [#ruby]
chalkmonster has quit [Ping timeout: 240 seconds]
ElFerna has joined #ruby
chalkmonster has joined #ruby
AJA4351 has joined #ruby
phaul_ has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
<havenwood>
animo8: Nice. In modern Ruby you ca replace `caller[0][/`.*'/][1..-2]` with `caller_locations.first.label`.
Rapture has joined #ruby
<havenwood>
animo8: You'll notice with a big enough number you'll get a: SystemStackError: stack level too deep
<havenwood>
animo8: You can disable stack trace and enable tail call optimization to prevent that, if you want.
RiPuk_ has joined #ruby
RiPuk has quit [Ping timeout: 252 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
mikecmpbll has quit [Quit: inabit. zz.]
<animo8>
havenwood: Huh, thanks for the tip
kabads has quit [Read error: Connection reset by peer]
Esa_ has joined #ruby
<animo8>
I wasn't sure if this was the so-called "tail recursive style" (or whatever it's called) I kept hearing about since I'm not that good at functional programming but from what you're saying I'm going to assume that it is
mikecmpbll has joined #ruby
<havenwood>
animo8: Any time! Yeah, Ruby isn't really made to work properly with recursion out of the box. Languages have to choose between TCO and stack traces as far as I know. Ruby defaults to stack trace but you can enable TCO either when you compile Ruby or with RubyVM::InstructionSequence.
<animo8>
Do other implementations support TCO?
<havenwood>
animo8: Then again... I think the caller info won't work if you disable `trace_instruction` in favor of `tailcall_optimization`.
<animo8>
havenwood: Huh, that's kind of funny
<havenwood>
animo8: Nope, not by default at least. JRuby and TruffleRuby will both blow up as well with SystemStackError. Stack overflow!
phaul_ has quit [Ping timeout: 268 seconds]
<animo8>
It seemed to me that the JVM ones could be made to run pretty fast, but I guess it's always going to have to be a tradeoff between dynamicness and performance
<havenwood>
animo8: JVM has super small stack iir. JRuby is really quite nice.
<animo8>
I was going to check on google if Clojure allows you to get the caller at runtime but then I remembered my `recurse` hack could be implemented as a macro there
<animo8>
I wish Crystal was mature enough so I could have my compile-time macros AND my Ruby
* baweaver
wanders in
<havenwood>
animo8: Matz is considering adding macros to Ruby. He was pondering deprecating back ticks for shelling out so they could be used for the new macro syntax - but decided that would break too much.
<havenwood>
baweaver: o/
phaul_ has joined #ruby
<animo8>
havenwood: That's a really interesting idea. Maybe a new string interpolation syntax could work for macros? Like backticks in Lisp
<animo8>
Although macros need to operate on symbols and strings aren't symbols
<havenwood>
animo8: Clojure implements a explicit recur since JVM doesn't support TCO.
<havenwood>
an**
Yxhuvud has quit [Read error: Connection reset by peer]
<havenwood>
my "n" key is borked
Yxhuvud has joined #ruby
<havenwood>
animo8: It's a fun experiment to interop between Clojure and Ruby with JRuby and red bridge.
<havenwood>
animo8: Or even fancier with TruffleRuby interop.
dbugger has quit [Remote host closed the connection]
<consti>
I tried numerous variations (with padding not set, padding set to 1, with hex encoded $encrypted, upcased hex encoded $encrypted, non-hex $encrypted, with no IV, with 16*0 IV…). The page I mention in the comment (and others) just seem to work - unfortunately there's no insight on their implementation.
SeepingN has joined #ruby
<adam12>
consti: So the return value of line 7 should be that long string of 0's plus a few other numbers?
JBmc has left #ruby [#ruby]
<consti>
Reading the Ruby doc on OpenSSL unfortunately doesn't help.. the key etc. is given and I have no influence over IV (I read that 0 is a bad choice);
<consti>
yes, correct
<adam12>
consti: Does the return value have any significance? Was that the original value that you encoded?
<adam12>
consti: Trying to follow but it's not clear.
<consti>
yes, the return value is a MSISDN, padded with zeros
<consti>
Here's another tool that just seems to work (and doesn't need anything else key and input text): http://aes.online-domain-tools.com (not affiliated with that page, it looks crappy)
<havenwood>
consti: You're saying 48 sixteen times when 0 sixteen times is expected.
<Cork>
is it possible to run the content (word by word) of a block through something like a method_missing (without falling back to normal ruby parsing)
<Cork>
i'm trying to find a way to do something like writing powershell code in a do block and converting it to a correct string
<havenwood>
consti: Multitasking, but I'll look at the screenshots when I get a chance.
dinfuehr has quit [Ping timeout: 268 seconds]
<havenwood>
consti: Once you know the 16 numbers each for key and iv, it's easy.
<consti>
Unfortunately the person I'm dealing with here, won't be able to provide any more information. They literally sent me the info I posted in the gist and said that it works on those websites, so we should be able to make it work.
<havenwood>
Give us a copy/pasteable version of what they said the key and iv would be?
Esa_ has quit []
<consti>
The new encryption/decryption will be AES-128 (CBC with IV = 0). AES key: E8FC8D71058E21DE (hex 45384643384437313035384532314445)
<consti>
(these are values for a test environment btw)
dinfuehr has joined #ruby
<consti>
so nothing important/secret; I expect to have the IV value as "0" in production etc. as well; the key will change though
renich has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<havenwood>
consti: how is E8FC8D71058E21DE equivalent to 45384643384437313035384532314445? I'd have expected the hex representation to be twice as long and those ^ aren't the same number.
<leftylink>
from what I can see from my cryptopals code: argument to cipher.update needs to be the exact bytes to be decrypted, not hex representation of it
Guest49283 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
<adam12>
leftylink: That's correct. Getting close with hex_string.pack("H*"), but it looks like the hex string in the Gist is only partial of what I see.
<adam12>
I wonder if padding has anything to do with it.
<adam12>
The tool that consti is using says it pads with 0's. But it doesn't say to what length.
<leftylink>
I see that cipher.key_len and cipher.iv_len are both 16, so they do need to both be strings with 16 bytes in them. so I think `cipher.key = "E8FC8D71058E21DE"` is correct.
<leftylink>
bute note the difference between `cipher.iv = "0000000000000000"` and `cipher.iv = "\0" * 16`.
<havenwood>
al2o3-cr: Nasty trick to make the hex have no letters. :P Threw me.
<al2o3-cr>
yup ;)
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
<havenwood>
consti: Is the payload?: 967596918
<havenwood>
adam12: Padding takes an int, so looks like 0 is right. I think the payload was just represented as hex when it should be bytes.
<consti>
No, it should be 0000000000000000000000000000000039363735393639313800000000000000
<leftylink>
with those advices, I was able to get the expected decrypt, which is "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00967596918\x00\x00\x00\x00\x00\x00\x00" when printed out
<leftylink>
good luck.
<consti>
but it's a value that shows up on the second tool I posted
<havenwood>
leftylink: yup, cool
<consti>
so I think that's the correct value, but the wrong format?
andikr has quit [Remote host closed the connection]
<leftylink>
if there is any doubt at all about whether the parameters being passed in are the correct types, I can recommend trying https://cryptopals.com/sets/1/challenges/7 . I know it's in ECB mode so there won't be an IV, but should give a close enough idea.
<havenwood>
\o/
<consti>
Wohoo!
<consti>
Thank you al2o3-cr !
<havenwood>
consti: They gave you very confusing examples for key, payload and iv...
<al2o3-cr>
consti: yw
<adam12>
Yeah. Unpacking the string to bytes worked (with padding 0). I had padding as 1 :O oh well.
<adam12>
Mystery solved.
LaChiave has joined #ruby
<consti>
Thank you, all of you!
<consti>
I was trying to solve this all day… Thanks!
Rapture has quit [Ping timeout: 240 seconds]
Intelo has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Quit: renich]
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
renich has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
LaChiave has quit [Quit: Bye Bye]
howdoi has joined #ruby
consti has quit [Quit: consti]
Intelo has joined #ruby
brendan- has quit [Ping timeout: 250 seconds]
ellcs has quit [Ping timeout: 250 seconds]
brendan- has joined #ruby
phaul_ has quit [Ping timeout: 265 seconds]
poontangmessiah has joined #ruby
phaul_ has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
lucasb has quit [Quit: Connection closed for inactivity]
phaul_ has quit [Ping timeout: 240 seconds]
xco has joined #ruby
jaequery has joined #ruby
Inline has quit [Quit: Leaving]
jaequery has quit [Client Quit]
dionysus69 has quit [Ping timeout: 250 seconds]
jaequery has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Ping timeout: 240 seconds]
yasumi2136 has joined #ruby
phaul_ has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
dellavg has quit [Ping timeout: 265 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
renich has joined #ruby
renich_ has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
phaul_ has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
xco has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
fuzzface has joined #ruby
Swyper has quit [Remote host closed the connection]
renich_ has joined #ruby
Swyper has joined #ruby
renich has quit [Ping timeout: 250 seconds]
bacchist has quit [Ping timeout: 265 seconds]
sandstrom has joined #ruby
Swyper has quit [Remote host closed the connection]
bacchist has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
jbeaudoin_sher has joined #ruby
wildtrees has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
dr_mdma_md has quit [Quit: Connection closed for inactivity]
Swyper has quit [Ping timeout: 265 seconds]
ElFerna has quit [Quit: WeeChat 1.9.1]
cisco has joined #ruby
cisco is now known as Guest93657
akemhp has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Read error: Connection reset by peer]
phaul_ has joined #ruby
klaas has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Axy has quit [Ping timeout: 265 seconds]
ravenousmoose has joined #ruby
Swyper has quit [Remote host closed the connection]
phaul_ has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
ravenousmoose has quit [Ping timeout: 252 seconds]
shirak has joined #ruby
Swyper has quit [Remote host closed the connection]
bvdw has quit [Quit: bvdw]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
john2496 has joined #ruby
phaul_ has joined #ruby
bvdw has joined #ruby
bvdw has quit [Client Quit]
tpanarch1st has quit [Ping timeout: 240 seconds]
bvdw has joined #ruby
quazimodo has quit [Ping timeout: 276 seconds]
teardown has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
quazimodo has joined #ruby
shirak has quit [Ping timeout: 268 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
phaul_ has quit [Ping timeout: 265 seconds]
<Net>
ruby enumerators don't hold references to values before the current iteration position, do they?
<baweaver>
unless you're explicitly using an index, not really
<baweaver>
Though it depends on what you're trying to do.
jenrzzz has joined #ruby
<phaul>
you can rewind ... and starrt from the begining
<Net>
I'm asking because I'm iterating over a very long and memory intensive list that can be represented as a lazy enum (the values are fetched in chunks from an api) and I'm wondering if that's a potential performance benefit
<phaul>
btw - Enumerators are not indexable, are they?
<Net>
the immediate method I'd want to call on the enum is #flat_map, though I presume that has the same underlying behavior as #next
<baweaver>
`each_slice(2)` potentially
<Net>
each_slice(2)?
woodruffw has quit [Quit: And then he took off.]
dionysus69 has quit [Quit: dionysus69]
<phaul>
I would be careful if that forces the whole thing to be allocated though, one has to test.. Otherwise just implement caching the last element yourself
<phaul>
I think this was the gist of the suggestion
<Intelo>
I added domain as .site.com and now its setting cookie with different value on every request. _wa_session=3f8935b9488d20ecfbba118a4ffcbb14; domain=.site.com; path=/; HttpOnly
<Net>
was this a suggestion to me or someone else?
<Net>
I am incredibly confused :D
<phaul>
sorry probably I added more confusion than help. I thought it was for you.
akemhp_ has quit [Ping timeout: 240 seconds]
<Net>
I did too, I just don't understand how it's related
akemhp has joined #ruby
<Net>
anyways, I wasn't aware enumerable methods called on lazy enumerators returned a lazy enumerators, and that's good to know
<Net>
I suppose that's partially the point of lazy enumerators
quazimodo has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 276 seconds]
AJA4350 has joined #ruby
akemhp_ has joined #ruby
_dbugger has joined #ruby
_dbugger has quit [Remote host closed the connection]
akemhp has quit [Ping timeout: 245 seconds]
<phaul>
doing it with local variables, that surely keeps it lazy: Enumerator.new { |y| prev = nil; 5.times {|i| y << [prev, i]; prev = i } }
_dbugger has joined #ruby
markov_twain has joined #ruby
go|dfish has quit [Ping timeout: 250 seconds]
john2496 has quit []
eljimmy has quit [Quit: This computer has gone to sleep]
jaequery has joined #ruby
vrih has joined #ruby
markov_twain has quit [Remote host closed the connection]
go|dfish has joined #ruby
Swyper has quit [Remote host closed the connection]
akemhp has joined #ruby
akemhp_ has quit [Ping timeout: 268 seconds]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
akemhp_ has quit [Ping timeout: 268 seconds]
_dbugger has quit [Remote host closed the connection]
_dbugger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_dbugger has quit [Remote host closed the connection]
_dbugger has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]