havenwood changed the topic of #ruby to: Ruby 3.4.3, 3.3.8 https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
wbooze has joined #ruby
Pixi has joined #ruby
Pixi` has quit [Ping timeout: 248 seconds]
inline has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
fercell has quit [Quit: ZNC - https://znc.in]
fercell has joined #ruby
rvalue has quit [Ping timeout: 248 seconds]
rvalue has joined #ruby
cappy has quit [Quit: Leaving]
oznek has quit [Remote host closed the connection]
crespire has quit [Remote host closed the connection]
crespire has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 248 seconds]
ih8u2 is now known as ih8u
cleo has joined #ruby
jmcgnh has quit [Ping timeout: 244 seconds]
fantazo has joined #ruby
jmcgnh has joined #ruby
grenierm has joined #ruby
Linux_Kerio has joined #ruby
inline has quit [Read error: Connection reset by peer]
wbooze has quit [Remote host closed the connection]
gr33n7007h has quit [Ping timeout: 245 seconds]
gr33n7007h has joined #ruby
infinityfye has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
wnd has quit [Remote host closed the connection]
wnd has joined #ruby
jmcantrell has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
sarna has quit [Ping timeout: 248 seconds]
sarna has joined #ruby
R2robot has quit [Quit: Pull the lever, Kronk. Wrong leverrrrrrr!]
R2robot has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
TomyWork has joined #ruby
rvalue has joined #ruby
sarna has quit [Ping timeout: 260 seconds]
sarna has joined #ruby
Linux_Kerio has quit [Ping timeout: 260 seconds]
rvalue has quit [Ping timeout: 252 seconds]
rvalue has joined #ruby
mweckbecker has quit [Quit: leaving]
wbooze has joined #ruby
grenierm has quit [Quit: Client closed]
<nakilon> I always forget how to choose properly; if I'm returning something that's expensive to fetch (like API with pagination) and let's assume I won't even need the block call form, how do I implement such method? should I return Enumerator with a loop and << operator or should I just yield in a loop?
GreenResponse has joined #ruby
<nakilon> lame-camel: sometimes it's said the complexity is a square of the number of components; same with the number of participants; I never did any "web" but when I struggled to earn some I agreed to make a scraper service for some analytics company (AFAIK they didn't fully pay us so don't work in such sphere at all, I just had to), and
<nakilon> ... I made the service, it was a docker-compose with 7 containers and databases I've never used, the made up REST API, etc., most of it was new to me but I made it in just a few days, it was so fast to build; because I built it alone )
<nakilon> it had two layers of tests, docs, manual for my friend to manage it all, etc., and in a year they've never reported a bug in it
<lame-camel> nakilon, i see.
<havenwood> nakilon: I've done this before with a memoized Enumerator and Pagy. It does work with some backbending.
<lame-camel> havenwood, so, how do I register on libera chat an account?
<havenwood> lame-camel: I think they have good instruction site https://libera.chat/guides/account
<lame-camel> cheers
<havenwood> nakilon: An example of what a "memoized Enumerator" might look like: https://gist.github.com/havenwood/5e5c58a89235d0758db177a7c01a7fc6
<havenwood> (I just subclassed, for the API-based pagination I was doing. Pagy was flexible enough to make it work whether I knew number of pages up front. It's extremely annoying not to know the number of pages up front from the API and was the only reason I did the back bending with memoizing.)
<havenwood> Otherwise there are simpler ways. Also had to go to extra lengths to not run into issues of using Enumerators across thread lines, running afoul of using Fibers across Thread boundaries.
lame-camel is now known as The_Camel
<havenwood> The_Camel: Good to see you!
The_Camel has quit [Changing host]
The_Camel has joined #ruby
<The_Camel> havenwood, done :>
<The_Camel> let me just restart my client
<nakilon> havenwood: I feel like that was an implementation of paging
<nakilon> judging by the word "step", etc.
<nakilon> I don't need to implement it, I consume it; I need to implement a method that would make library user not think about that we used paging
The_Camel has quit [Quit: Leaving]
The_Camel has joined #ruby
<nakilon> yielding is less code but I don't need blocks, it's just REST API with data items
<The_Camel> test
<The_Camel> all good.
<nakilon> probably I should just agree to put more code in the method
<The_Camel> havenwood, does doing a WHOIS on me still show my IP address?
<kjetilho> The_Camel: you didn't need to restart to do that. 13:33Z The_Camel (~lame-came@79.97.133.89) has changed host to ~lame-came@user/The-Camel:40090
axsuul has quit [Read error: Connection reset by peer]
<The_Camel> well, I hope my IP and lame-camel no longer is associated/shown with The_Camel
<The_Camel> I don't want people port knocking my router :P
<nakilon> don't worry, it's now forever logged in https://libera.irclog.whitequark.org/ruby
<nakilon> thanks, kjetilho
<kjetilho> np
axsuul has joined #ruby
<The_Camel> logs are fine
<The_Camel> :P
<The_Camel> and at some point that IP will change. whenever my router sees fit
Psy-Q has joined #ruby
<The_Camel> *makes camel noises*
* The_Camel makes camel noises with /me
<Psy-Q> that's the way to do it
<The_Camel> havenwood, I wrote a cipher in ruby. not sure where I can find people to try to break it.
<havenwood> The_Camel: Sounds interesting. Share?
<The_Camel> havenwood, the source code?
<The_Camel> I'm afraid part of my design is black box obfuscation. so unlike most ciphers, part of the security comes from not being "open".
<havenwood> The_Camel: Ah, gotcha. Share an encrypted payload then?
<havenwood> Security through obscurity. ;)
<The_Camel> havenwood, https://files.catbox.moe/rmn1xo.odt - plaintext
<The_Camel> havenwood, https://files.catbox.moe/gke585.hakidasu - ciphertext
<The_Camel> havenwood, yeah I think it's very. very. very underestimated :P
<The_Camel> havenwood, being ruby though, the encryption is like, 7 minutes per 1GB
<The_Camel> which is fine tbh.
<nakilon> does it increase file size?
<The_Camel> it does. not by much though.
<The_Camel> 15%?
trillion_exabyte has quit [Ping timeout: 268 seconds]
trillion_exabyte has joined #ruby
<havenwood> The_Camel: If you encrypt plaintext twice do you get the same ciphertext each time?
<havenwood> Are the parens part of the payload from your plaintext example?
<The_Camel> havenwood, yes to the first question.
<The_Camel> havenwood, elaborate on the second please. not sure i get you.
<havenwood> The_Camel: Does the plaintext start with `"Lorem` or `Lorem`
<The_Camel> havenwood, as per the odt, with ""
<The_Camel> havenwood, the file you got, fully, as it is, is encrypted, so you'll have the opendocument format encrypted with <xml> and stuff
<The_Camel> so no, it's not the string inside the odt that is ciphered.
<The_Camel> it's the whole file.
<The_Camel> odt is plain text though.
<The_Camel> you will easily recognize it if you manage to crack it, as you'll see a lot of <xml>
<The_Camel> inside it, the Lorem string too
<The_Camel> havenwood, just open up the plaintext odt file and you'll see.
<The_Camel> with gedit or nano
oznek has joined #ruby
LainIwakura has joined #ruby
infinityfye has quit [Killed (NickServ (GHOST command used by infinityfye__))]
infinityfye__ has joined #ruby
denvermullets has joined #ruby
infinityfye__ is now known as infinityfye
<havenwood> The_Camel: Was looking wtih xxd. Most cryptography chats are going to want to see the source code.
<havenwood> The_Camel: Looking at the entropy, I can see most is highly random except for one block, a part of which is highly ordered.
<The_Camel> havenwood, that... shouldn't be the case as that's not what my algorithm does.
<The_Camel> havenwood, want me to describe the cipher?
<havenwood> The_Camel: The Shannon entropy seems lower than I'd expect for ciphertext.
<havenwood> The_Camel: Yeah, sure! Always fun to look at different tactics.
<The_Camel> havenwood, first layer, I inverse the file. then I take every 8192 bytes and base64 encode that. nothing major here, just plain confusion tactic
manveru has quit [Quit: Ping timeout (120 seconds)]
<The_Camel> havenwood, I then apply a hardcoded substitution box for every block
manveru has joined #ruby
<The_Camel> then for each block, i use XOR with portions of the key in random fashion
<The_Camel> havenwood, last layer, in case everything fails, I use blowfish.
<The_Camel> so "perhaps" the ordered portion you see might be from what blowfish is doing
LainIwakura has quit [Quit: Client closed]
___nick___ has quit [Ping timeout: 260 seconds]
wbooze has quit [Ping timeout: 260 seconds]
___nick___ has joined #ruby
<nakilon> anyone using Sublime with rbenv? looks like SublimeLinter-ruby uses default and does not see .ruby-version
inline has joined #ruby
<nakilon> not even sure how to know the exact version it uses; it just can't comprehend '...' from 2.7
LainIwakura has joined #ruby
wbooze has joined #ruby
<nakilon> nvm, paths: {"osx": ["~/.rbenv/shims"],...
<nakilon> I very dislike that I can't write "def get_items ..." and have to add "()"
user71 has joined #ruby
<nakilon> even more; "get(...)" allows empty args, "get ..." does not _<>
<The_Camel> nakilon, diamond cat's eye
<The_Camel> <>_<>
<The_Camel> <(<>_<>)>
<havenwood> The_Camel: I'd consider the obfuscation layers pretty weak, but BlowFish done properly with a totally random key works.
<The_Camel> havenwood, yeah, it's just an s-box and xor
<The_Camel> havenwood, most real world algorithms apply some sort of key diffusion, feistel network or sequential encryption.
<The_Camel> chain-link encryption or whatever they call it.
oznek has quit [Ping timeout: 260 seconds]
cappy has joined #ruby
denvermullets has quit [Ping timeout: 252 seconds]
denvermullets has joined #ruby
oznek has joined #ruby
oznek has quit [Ping timeout: 245 seconds]
oznek has joined #ruby
<The_Camel> You know. When things are slow development wise, one makes frameworks
<The_Camel> but I can't possibly see what kind of framework I'd make to speed up web development.
<The_Camel> the complexity comes from the underlying CSS existing and being messy with HTML.
<The_Camel> even with semantic-ui, while it's better, it's still slow.
wbooze has quit [Quit: Leaving]
<The_Camel> lemme be more specific
<The_Camel> the __front end__ of web development is the slow part.
<The_Camel> also I wish netbeans supported ruby.
cappy has left #ruby [Leaving]
wbooze has joined #ruby
denvermullets has quit [Remote host closed the connection]
ih8u2 has joined #ruby
ih8u has quit [Read error: Connection reset by peer]
ih8u2 is now known as ih8u
fantazo has quit [Quit: Lost terminal]
dionysus69 has quit [Ping timeout: 260 seconds]
<nakilon> if I use Enumerator I won't be able to implement the pages loop recursively
<nakilon> unless I describe iteration as a lambda
LainIwakura has quit [Ping timeout: 272 seconds]
jmcantrell has joined #ruby
schne1der has joined #ruby
jmcantrell has quit [Ping timeout: 260 seconds]
<havenwood> nakilon: My variant was to let you *not* load all the pages, and do it lazily only as needed to get to the requested page.
<havenwood> nakilon: If you're going to eagerly load them, just merge the pages and use Pagy or whatever paging tool to repage.
<havenwood> It's easiest to page from a flat enum, like a simple one-dimensional Array.
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
user71 has quit [Quit: Leaving]
<The_Camel> havenwood, don't you hate there's no official opensource IDE for ruby?
* The_Camel kicks pebbles and draws in the sand
pgib has joined #ruby
GreenResponse has quit [Quit: Leaving]
infinityfye has quit [Quit: Leaving]
schne1der has quit [Ping timeout: 260 seconds]
rvalue has quit [Ping timeout: 268 seconds]
<havenwood> The_Camel: Nope, that's not something I yearn for at all.
<The_Camel> havenwood, that's a pity.
<havenwood> I could see a Smalltalk-esque thing being amazing, it's just not something I think about.
<havenwood> The_Camel: I guess it depends on what you mean by "IDE" really.
<The_Camel> havenwood, jetbrains rubymine but free.
<havenwood> I'm happy writing Ruby on a stone tablet.
<havenwood> The_Camel: Yeah, I don't care much on that front.
<The_Camel> I can't set breakpoints visually in random text editors
<havenwood> The_Camel: Helix or Zed with ruby-lsp and solargraph is more auto than I want with Ruby but it works.
<The_Camel> or debug visually
<havenwood> Configured language servers:
<havenwood> ✓ ruby-lsp
<havenwood> Configured debug adapter: rdbg
<havenwood> ✓ solargraph
<havenwood> Configured formatter: rubocop
<The_Camel> yeah, i understand.
<havenwood> The_Camel: That's ^ my helix config. Similar for Zed.
<The_Camel> but that means only specific editors support extensions
<havenwood> I haven't found value on that front, personally.
<havenwood> At least not yet.
<havenwood> In Ruby.
<The_Camel> value of an IDE?
<havenwood> In Ruby, yeah.
<The_Camel> well ruby-slp, rdbg, rubocop are things that I want from an IDE which should come preconfigured
<The_Camel> l*
<havenwood> In Elm, Rust or Roc the feedback is clutch.
<The_Camel> if I'm to get those 3, I must abandon sublime-text and switch to something like visual studio code
<havenwood> I don't really value IDEs for Ruby.
<havenwood> I don't mind them, but don't depend on them either or miss them.
<havenwood> Feels like a text editor choice in terms of impact level.
<havenwood> Matters, but only to an extent.
<The_Camel> for me, the rdbg is kinda critical because it's nicer to work with than printing out text/logs.
<havenwood> The_Camel: Yeah, REPLs are quite nice.
<havenwood> When errors get good enough, it's like REPL-within-an-error land.
<havenwood> <3 REPL
<havenwood> Elm is the only language I know of that has _both_ nice errors and a REPL.
<The_Camel> java, c# and c/c++ for me.
<The_Camel> everything else doesn't have an IDE lol
<The_Camel> or it does but it's "pay for it"
<havenwood> The_Camel: Rust is mature at this point. Nearly 1.0. :P
<The_Camel> sigh
<havenwood> Zig and Rust are nice. I've gotten more purchase with Rust, personally.
<The_Camel> I wish I could skip the next 200 years
<havenwood> Srsly
<The_Camel> because being born in this era of unfinished stuff is annoying.
<havenwood> On the other hand, we can personally contribute to multiple top-20 langs.
<havenwood> Being early has advantages too.
<havenwood> Agree on the envy.
<The_Camel> the contributions i want to make, other people don't appreciate or consider low priority.
<The_Camel> like that time I reported a problem on linux IO scheduler
<The_Camel> use "DIRECT_IO" mode on "cp" they say.
<havenwood> Still, adds to the discourse.
<The_Camel> "I'm not here to ask for a solution. i'm here to report a problem. i want you to fix it!"
<havenwood> If you can have repeated impact, kinda cool
<The_Camel> yeah, no, i'd rather skip the next hundred years :P
<The_Camel> whole industry is half baked
<The_Camel> shove it back in the oven!
<havenwood> Together we're building a thing, but sure nicer to have it built
<havenwood> Fast forward plz, kthx
<o0x1eef> The coolest stuff is often not in the mainstream :)
<The_Camel> hard to build something together if someone else does the decisions.
<havenwood> o0x1eef: Tends so, from lisp and onward.
<The_Camel> o0x1eef, heeeey! it's John, remember me?
<o0x1eef> John Mair?
<The_Camel> Ivan
<o0x1eef> Aha, rings a bell :)
<havenwood> Pry days
<havenwood> What's banister up to?
<The_Camel> o0x1eef, we talked about web servers.
<The_Camel> and ruby/sinatra/rails
andy-turner has joined #ruby
<o0x1eef> Roger that
<o0x1eef> I don't think banister does much Ruby anymore. He's working a 9 to 5 with C++.
<The_Camel> i love ruby but I think at some point I'll move to java. or probably JRuby
<o0x1eef> If I was a Java person I'd definitely jump onto JRuby
<The_Camel> because unlike these pesky VHLLs like node, python, haskell, ruby, etc, java has opensource IDEs
<The_Camel> and I value an IDE
<o0x1eef> Historically with languages like Ruby you usually have an environment of different tools working together rather than a monolith IDE that tries to provide everything.
<The_Camel> i know. it's the same with the others
<The_Camel> but I don't want to suddenly drop my favourite text editor in favour of an extension based one JUST CAUSE
<o0x1eef> Not going to lie, with tools like copilot, the benefits of an IDE became much more obvious to me. A good autocomplete goes a long way.
<The_Camel> sure. it's a visual debugger I yearn.
graywolf has joined #ruby
<The_Camel> o0x1eef, right now, jetbrains' rubymine is the paid "defacto IDE" for ruby.
<The_Camel> nothing exists that comes close.
<o0x1eef> I think developer environments are very subjective and driven by different priorities. Personally I use emacs. Because I can use it over SSH (mainly). But the important thing is to keep an open mind and be open to change. Especially in this era.
andy-turner has quit [Quit: Leaving]
<The_Camel> yeah, that's why I wished to skip 200 years ahead :P
andy-turner has joined #ruby
<The_Camel> because I don't really like this era.
andy-turner has quit [Remote host closed the connection]
<The_Camel> too much incomplete, half baked, opinionated ways of doing 50 things instead of one, defacto, engineering based approach.
<The_Camel> all I can do is sigh.
<The_Camel> IF, I had other options, the mere fact ruby has no opensource IDE would have been reason enough for me to not even bother with ruby.
graywolf has quit [Client Quit]
<The_Camel> it's that sort of eliminative approach that I take but the industry is retarded so I have to rely on the good bits from everywhere instead of one centralized, primary language.
<The_Camel> everything has disadvantages
<The_Camel> lol
<The_Camel> no sweet spot
<The_Camel> and I hate that.
<The_Camel> oh thank god
<The_Camel> perl has an IDE
<The_Camel> i might make it a priority to learn perl soon.
<o0x1eef> Visual Studio Code + plugins?
rvalue has joined #ruby
<The_Camel> o0x1eef, I mentioned above that, while that's an option, I prefer a fully configured IDE
<o0x1eef> As things stand, I think that's probably the best you're going to get with Ruby. Not perfect but not terrible.
<The_Camel> o0x1eef, yeah sure. I'll learn perl as well.
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
jmcantrell has joined #ruby
dorian_ is now known as dorian
<The_Camel> o0x1eef, you don't happen to know of a "search" gem that can be used with a search textbox on the web do you?
<The_Camel> one that implements the handling of multiple boolean arguments
pgib has quit [Quit: 00 PC LOAD LETTER]
<o0x1eef> I haven't tried them but I would go with https://github.com/rubycdp/ferrum or https://github.com/sparklemotion/mechanize
<The_Camel> o0x1eef, :b