GoSub has quit [Quit: Good mourning, good after nun, g'nite, and goober evenings.]
Al2O3 has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
gr33n7007h has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
dstein64- has joined #ruby
FullMetalStacker has quit [Ping timeout: 260 seconds]
FullMetalStacker has joined #ruby
dstein64 has quit [Ping timeout: 264 seconds]
dstein64- is now known as dstein64
micro has quit [Remote host closed the connection]
ua_ has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
fercell_ has joined #ruby
fercell has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
ua_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
Vonter has quit [Quit: WeeChat 4.1.2]
Vonter has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Al2O3 has quit [Quit: Good mourning, good after nun, g'nite, and goober evenings.]
Al2O3 has joined #ruby
Al2O3 has quit [Client Quit]
Al2O3 has joined #ruby
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
Al2O3 has quit [Client Quit]
Al2O3 has joined #ruby
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
jenrzzz has joined #ruby
Paris has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
TomyLobo has quit [Ping timeout: 276 seconds]
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Al2O3_ has joined #ruby
xHire has joined #ruby
jenrzzz has joined #ruby
Al2O3 has quit [Ping timeout: 245 seconds]
Al2O3_ has quit [Client Quit]
Al2O3 has joined #ruby
Al2O3 has quit [Client Quit]
jenrzzz has quit [Ping timeout: 245 seconds]
<xHire>
hello! :·) I’m pondering upon bundler’s classic error “You have already activated base64 0.1.1, but your Gemfile requires base64 0.2.0. Since base64 is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports base64 as a default gem.” I looked around a lot, but I’m not sure what to do. The message is kinda misleading, since bundler itself doesn’t “support” certain gems as default
<xHire>
gems (or I misunderstood bundler’s code, also possible). Anyway, since rails list base64 as their dependency and I want to support multiple versions of Ruby (so I can’t just pin certain version of base64 in my Gemfile), I thought that perhaps bundler-ecology plugin would do what I need (i.e., exclude base64 from Gemfile.lock). However, it just causes a failure, because rails list base64. Is there something I can do in my application to solve the 0.1.1 vs.
<xHire>
0.2.0 problem?
jenrzzz has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
grenierm has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Paris has quit [Ping timeout: 245 seconds]
Vonter has quit [Ping timeout: 268 seconds]
Linux_Kerio has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
Munto has quit [Quit: Leaving]
xdminsy has joined #ruby
jenrzzz has joined #ruby
grenierm has quit [Quit: Client closed]
jenrzzz has quit [Ping timeout: 264 seconds]
grenierm has joined #ruby
Vonter has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
Vonter has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
jenrzzz has joined #ruby
FullMetalStacker has quit [Read error: Connection reset by peer]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
_ht has joined #ruby
eoli3n has joined #ruby
<eoli3n>
Hi
<eoli3n>
i use jekyll and a plugin which is jekyll-gallery-generator. I used it with 2.7.5 locked version, i build the site locally and push to github and gitlab pages. Gitlab doesn't support ruby2.X anymore, then i'm trying to upgrade to ruby 3.X
<eoli3n>
using latest ruby 3.3.2 (voidlinux), i get an error when building the site because of the removal of exists alias
<eoli3n>
i opened an issue to the maintainer to fix the code. But now i'm trying to get my site build with ruby 3.1.3 (latest BEFORE 3.2 that i can install with rbenv)
<eoli3n>
when i "rbenv install 3.1.3 --verbose" i get some errors at the end
<eoli3n>
so then, back to my main problem : how do I fix my rbenv install of ruby 3.1.3 ?
c10l has quit [Ping timeout: 276 seconds]
c10l has joined #ruby
<eoli3n>
i just rm -Rf ~/.gem/ruby/, rebuilding
CrazyEddy has joined #ruby
<eoli3n>
changed nothing
<eoli3n>
now i don't knwo what to try
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
grenierm has quit [Ping timeout: 250 seconds]
infinityfye has joined #ruby
Paris has joined #ruby
alip is now known as syd
syd is now known as sydbot
sydbot is now known as alip
Paris has quit [Quit: quit]
<rapha>
did you try to uninstall _all_ versions of _all_ gems (gem uninstall -aIx), eoli3n? i had to do that once. the second thing i can think of is to migrate away from rbenv and try asdf with its ruby plugin. trying rvm might also work where the other two won't, but if i have a choice, i'm asdf all the way these days.
<rapha>
(a lot of things can go wrong when building a package from scratch, especially if a lot of dependencies are involved, so swapping out the scripts that do the building is a good shot)
Al2O3 has joined #ruby
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
TomyLobo has joined #ruby
fcser has quit [Quit: zzzzz]
fcser has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
fcser has quit [Quit: zzzzz]
fcser has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
<adam12>
xHire: Make sure you're on the latest bundler, since there have been improvements in how it handles default gems.
<adam12>
eoli3n: whats your current situation with ruby/rbenv?
<eoli3n>
rapha: lets try
<eoli3n>
adam12: same as i explained
<adam12>
eoli3n: You could just monkeyptch back `exists?` if it's easier for you.
<eoli3n>
what does that mean ? monkeypatch ?
<adam12>
eoli3n: re-open the class that removed the alias and put it back in, as if it never even happened.
<eoli3n>
rapha: i want only to remove gems installed as user, what's the way to ?
<eoli3n>
because i don't want to remove something a distro package use
<eoli3n>
adam12: i don't want to patch ruby, seems the hard way
<adam12>
eoli3n: It's 3 lines, but we'd need to figure out where to insert it.
<adam12>
eoli3n: have you tried deleting .rbenv/versions/3.1.3 AND .gems/ruby ?
<eoli3n>
i tried deleting only .gems/ruby
<adam12>
You're also missing libyaml, according to one of the build logs you posted.
<eoli3n>
libyaml-devel is installed, i checked that
<eoli3n>
i don't know why it still complains
<adam12>
eoli3n: if you switch back to using ruby from your distro, what's the error exactly, and what command do you run?
<Vetheon>
Hey guys, out of curiosity, what are your preferred data-structures for getting, modifying, then replacing a series of objects in a collection quickly? I'm dealing with a pretty large dataset, and hashes aren't really doing the trick. Any ideas?
jenrzzz has joined #ruby
Vetheon has quit [Read error: Connection reset by peer]
jenrzzz_ has joined #ruby
Vetheon has joined #ruby
<ox1eef_>
Ruby builtins include Array, Hash, and Set. I can't think of any others. Can you provide more details ? Your question is a bit vague to provide an answer.
<ox1eef_>
You could always drop down to C as well.
<Vetheon>
So, I have a group of objects with a series of parameters. Currently, I'm converting each one to a hash so I can modify the parameters with some math, but when the amount of objects surpasses like... 15k the whole things falls apart because of the sheer amount of math.
<Vetheon>
I've optimized calls as best I can, but there's still a lot of math going on. So I'm trying to find other ways to optimize
<ox1eef_>
Have you thought about distributing the workload across multiple processes ?
jenrzzz has quit [Ping timeout: 245 seconds]
<Vetheon>
I have indeed, but I've been bumping against Rubys GIL. I need the main thread to remain running while the math is ongoing.
<ox1eef_>
Processes are run in parallel. Only threads have the GIL.
jenrzzz_ has quit [Ping timeout: 252 seconds]
<Vetheon>
Ruby has such a system in the stdlib, or do I need a Gem?
<Vetheon>
Because I've never even heard of Processes in parallel in Ruby. Only threads and fibers
<ox1eef_>
It is builtin. Kernel#fork. You will likely need a mechanism for IPC. I happen to have written a gem for that: https://github.com/0x1eef/xchan.rb#readme but there's other options - for example, that gem just uses an unbound UNIXSocket.
<ox1eef_>
fork should work so long as you're not on Windows, or JRuby.
<Vetheon>
I guess I could also just drop down to C. The problem is I've never used a C Extension in Ruby before. So I'd have to learn how it all works, which means wiki reading lol
<ox1eef_>
C extension API is pretty nice and easy, as long as you're not doing anything too complex.
<ox1eef_>
Those are the bookmarks I keep for C stuff in Ruby.
<Vetheon>
Oooh you can extend the interpreter too. That's some handy info. Thanks oxleef_
<ox1eef_>
I think distributing the workload with fork could work as well, communicating the result with the main process would be the hardest part (for me at least).
<ox1eef_>
No worries.
<Vetheon>
See, I thought about forking into many child processes, but I couldn't come up with a nice way to communicate
<Vetheon>
I need the system to be as portable as possible, so I'm trying to limit what Gems I'm depending on. I think right now it's basically just one, for SQL
<ox1eef_>
xchan makes that easy, but there's only so much data you can write before the next write blocks, and you *must* read before another write can happen.
<ox1eef_>
Right, and fork is incompatiable with Windows, JVM (jruby).
<Vetheon>
Well, while it'd be great to run on Windows, I think targeting WSL/Mingw is a better idea, so that's my plan
<ox1eef_>
Roger
<Vetheon>
Then at least I don't need to deal with windows jank security policies and stuff
<Vetheon>
But also the final version of this won't be written in Ruby. Ruby is just the lang I chose for prototyping
<ox1eef_>
Ah okay. I believe Ruby can bind to Rust these days too. Might be useful to know.
<Vetheon>
That is indeed good to know. Afaik FFI can be used to interface with just about anything no?
<Vetheon>
Really what would be great would be some bindings for CUDA that aren't either old af or not up-to-date with CUDA
<ox1eef_>
Tradtionally I think dlopen is used, and so the interface has been C, but there's a special create that binds to Ruby.
<adam12>
Depending on what it is, you can use druby + rinda to share a workload as well. Set up a druby service, fork, reconnect back to the service, pop off entries from the rinda service. Beware some operations can be O(n)
<ox1eef_>
Yep. And both of those are builtin / stdlib.
<ih8u>
happy new year everyone
<ox1eef_>
Same to you.
<ih8u>
is it true that Sequel's `where` statement doesn't work with pg_array?
<ih8u>
or am i missing something?
<ox1eef_>
My journey with Sequel was short-lived. adam12 might know :)
<ih8u>
i can do `DB[:accounts].where(id: [1, 2, 3])` and i get accounts with ids 1, 2, and 3
<ih8u>
but if i try that with a pg_array it doesn't work
<ox1eef_>
This will generate 'accounts.id IN (1,2,3)' AFAIK, and I think pg array extension has its own syntax, which should always be accessible via string syntax.
<adam12>
ih8u: You probably need the postgres operator? Doesn't it use -> or similar?
<ox1eef_>
IN won't work AFAIK, you need to use a syntax described in that link.
<ox1eef_>
But I'd be surprised if the extension didn't handle it in a nicer way.
<ih8u>
that's what `Artist.where(id: [1, 2])` (and which i know works and am trying to replicate with a pg_array)` yields, according to the link i stole it from
<ox1eef_>
Right, but IN is a different syntax that's used on regular columns, not an array column.
<adam12>
(need `DB.extension(:pg_array)` and `Sequel.extension(:pg_array_ops)`)
<adam12>
SQL output looks right...
<adam12>
SELECT * FROM "table" WHERE ("id" = ANY("other_table"."other_column"))
<adam12>
I rarely use array[] for things like this, unless postgres acquires fk support for arrays (then I might consider it)
<ih8u>
i was wondering about that exact thing, actually
<ih8u>
it's unlikely to become an issue for this particular use case, but it nags at me on principle
<ih8u>
how would you model this?
<ih8u>
i guess it's a one-to-many relationship?
<ih8u>
say there's a list of albums
<ih8u>
and a list of people
<ih8u>
people can have many different favorite albums
<ih8u>
so right now i'm using an integer[] column in the person table that contains the primary keys of all that person's favorite albums
<ih8u>
but, like, if an album got deleted or moved or something, there would be no way to know that with this model, right?
<ox1eef_>
In the traditional model, you'd probably have a join table, where there is a person_id & album_id. That way you can associate many people with the same album.
Vetheon has quit [Quit: Leaving.]
constxqt_ has quit [Ping timeout: 245 seconds]
<ih8u>
my search keeps giving me results for merging two tables together
<ih8u>
could you point me at some relevant literature?
<ox1eef_>
I don't know how it works in Sequel, only ActiveRecord, but essentially there are three tables: persons, albums, and a join table, let's call it persons_albums for lack of a better term.
<ih8u>
and/or give me a glimpse of what that would look like?
<ox1eef_>
The join table has two FKs, one for an album, another for a person.
<ox1eef_>
It sounds like what you are looking for, but your approach is different.
<ih8u>
so the strategy is to have an intermediate table that, for each favorite album of each person, contains the foreign keys of both of those tables
<weaksauc_>
yeah
jenrzzz has joined #ruby
<ih8u>
in that example, what happens to a "favorites" row when the album it references gets deleted?
<ih8u>
or, i don't know, moved to another table or has its id changed?
<weaksauc_>
that's on you to figure out
<ih8u>
i'm not really sure the extent of foreign keys' power
<ih8u>
i think i'm confused as to what a foreign key actually does
<ox1eef_>
You can add a constraint that would not allow the album be deleted while there is a FK reference to it, or you could delete all those favorites when the album is destroyed. It is really up to you how you want to handle it.
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<ih8u>
thank you, i will give that a read
<ih8u>
but the short of it is that this intermediate-table approach would be more efficient than my current approach?
<ox1eef_>
You can also add a unique index, so the same person can't favorite the same album twice. I think that'd be tricky to do with a pg array.
<ox1eef_>
I would say, more solid.
<weaksauc_>
yeah way more solid
<ih8u>
what's a unique index
<weaksauc_>
more examples out there too
Pixi` has quit [Ping timeout: 264 seconds]
<weaksauc_>
you can stipulate that there exists only one pair of (user id, album id) in the join table
<weaksauc_>
which is enforced at the db level
<ih8u>
i see
<ih8u>
seems some very smart people have spent a lot of time and effort solving for a lot of use cases
<ih8u>
like it or not, i guess i'm in db admin now, so i'd better read up on this
<weaksauc_>
indexes are also things that you can use to make the searches faster
<ih8u>
how so?
<weaksauc_>
yeah tons of really, really smart people have devoted their lives to making dbs efficient
xlymian has joined #ruby
<weaksauc_>
it basically creates a sorted list based on some columns that it can efficiently look up
<weaksauc_>
(really 10k foot view)
<ih8u>
i should probably just read through the psql docs page by page (they seem pretty well-written)
<ih8u>
what's the use of array columns, broadly?
<ih8u>
what if an album has tags that you can search for?
jenrzzz has quit [Ping timeout: 256 seconds]
constxqt_ has joined #ruby
<weaksauc_>
not 100% sure on the why of array but it gives you an option
<ih8u>
right now i have the varchar "tags" column, which is a space-seperated list of tags, and full-text search through that
<ih8u>
would an array be a better use for that?
<ih8u>
or something else?
<weaksauc_>
the pgsql docs assume you have a fairly strong working knowledge of dbs
jenrzzz has joined #ruby
<ih8u>
oh, well, i obviously don't lol
<ox1eef_>
Tags are often implemented with the same model we discussed in regards to persons / albums. There's a join table that joins a tag to an album.
<ih8u>
so you have a "tags" table?
<ih8u>
hm
<weaksauc_>
yup
<ox1eef_>
Tags table, Tagging table (tag_id, album_id), albums table.
<ih8u>
i guess i'm just hesitant to create new tables
jenrzzz_ has joined #ruby
<ih8u>
because i feel like i'm creating a bunch of overhead
<weaksauc_>
it's the way sql was meant to work
<ih8u>
i guess i need to abandon that thought
<adam12>
_could_ use the array type here, if tag remains super primitive (list of strings). I've done it in past, since lots of tags aren't super generic and people tag things all sorts of random, so I don't think 3NF could apply here.
<ih8u>
stop thinking of tables as spreadsheets
<adam12>
I find most projects work better with _more_ tables and models.
<adam12>
An easy giveaway is a prefixed table.
<adam12>
s/table/column
<adam12>
Once you start prefixing columns, it probably should have been another table/model.
<weaksauc_>
db philosophy makes it so that repeated data is a sin
<ih8u>
i'm a fan of dry
<ih8u>
but it occurs to me that more tables = more implementation requirements
jenrzzz_ has quit [Ping timeout: 264 seconds]
constxqt_ has quit [Ping timeout: 245 seconds]
Paris has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
<ih8u>
going back to the tags example, if i used the intermediary approach, i'd have to implement some means of abstracting and handling all the necessary insertions, otherwise tagging my albums would get *really* tedious
jenrzzz has joined #ruby
<ih8u>
i guess it's one of those things you have to consider at scale