StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

In Polars, is there a way to replace or modify the lazyframe at the origin of a computation graph?

14 April 2026 @ 8:40 pm

I am really enjoying the capabilities that the Polars LazyFrame brings to the table. Recently though, I've been trying to develop a method of defining a lazy plan so that it can be serialized and applied to data after deserialization. The motivation for this is primarily to prevent having to deploy a new pipeline for processing lab data to deal with edge cases, format changes, or changes in assumptions, but also has the advantage of cleaner configuration management of the data processing. A toy example would look something like this; import polars as pl # pipeline definition empty_lf = pl.LazyFrame() step1_lf = base_lf.with_columns(pl.col('a') + 1) step2_lf = step1_lf.filter(pl.col('a') > 2) serialized_pipeline = step2_lf.serialize() # pipeline execution (not necessarily performed in the same environment as definition) actual_data = pl.LazyFrame({'a':[1,2,3]}) # this next line of code is fanciful. It is valid code, but i

Estoy intentando devolver algo mediante un metodo de un interface pero me hago un lio

14 April 2026 @ 8:39 pm

estoy cursando 1º de DAW y quería saber si alguien puede ayudarme. Aún estoy aprendiendo de interfaces y reforzando conocimientos en colecciones. En uno de mis ejercicios de java me piden mostrar al finalizar cuanto se ha recaudado por el préstamo de cada tipo de producto, sabiendo que los juegos cuestan 0,5 por hora estimada y las series 2 euros por temporada. Creo que mi mayor problema es no controlar del todo clases y colecciones :), si alguien pudiese darme alguna idea es de mucha ayuda TT. Utilizo eclipse Crea una clase Serie que tenga como datos: título, número de temporadas, prestado y género. Por defecto el número de temporadas es 3. Crea una clase Videojuego con datos: título, horas estimadas, prestado, género y compañía. Por defecto el número de horas es 10. Hacer una interfaz Prestable que implementen las clases anteriores con al menos los siguientes métodos: ▪ prestar(): cambia el atributo pres

How do I use CSS selectors to select the child of a parent's sibling when a child is hovered?

14 April 2026 @ 8:20 pm

Let's say I have this simplified example. These two content divs aren't the same thing because I need to style them differently. "style1" and "style2" text is hidden by default. Whenever I hover over "hover1" text, then "style1" text shows up, and whenever "hover2" is hovered, "style2" shows up. This works perfectly well for the first content div (using these selectors: .hover1:hover ~ .style1, .style1:has(~ .hover1:hover), .hover2:hover ~ .style2, .style2:has(~ .hover2:hover) ), but I cannot figure out how to make it work for the second content div. I need everything in the first content div to show up on hover in the second div, too. I know I have to use some combination of selectors to go through #main somehow to reach style1 and style2 text in order to reveal them, but... how? How do I select style1 from hover1:hover in the second div? Thank you! (Please no JavaScript answers unless it's truly necessary, I

Load additional columns to in-memory collection

14 April 2026 @ 7:00 pm

I have a list of objects with some, but not all, properties filled in from the database: class Example { public int Id { get; set; } public int A { get; set; } public int B { get; set; } public int C { get; set; } } // ... var context = contextFactory.CreateDbContext(); var objects = context.Examples .Select(e => new Example { Id = e.Id, A = e.A }).ToList(); Now, I want to load more properties on that list. What is the most efficient way to get EF Core to populate the data I want? Currently, my best idea goes something like this: var objectsDict = objects.ToDictionary(e => e.Id); var context = contextFactory.CreateDbContext(); var newObjects = context.Examples .Select(e => new Example { Id = e.Id, A = objectsDict[e.Id].A, B = e.B }).ToList(); but I feel like there must be a better way.

Delete multiple rows based off of cell value in VBA

14 April 2026 @ 6:34 pm

I am trying to remove certain, but not all zero cost entries from our sales export file. If our regular items are included in a "Bundle", the items comprising the bundle (dependents) are also included in the reports as zero cost item below the Bundle. I need to remove each entry for the dependents only when they are in bundles. We have other zero cost items that need to be included, and the dependents themselves are sold separately and need to stay. We have lots of named "Bundles", so I am setting up a dummy example to illustrate my needs, there are two bundles - Spaghetti has two dependents and Omelette has three: Item Cost Orange 4 Spaghetti 12 Pasta 0 Sauce 0 Omelette 5 Eggs 0

Removing items from a players inventory

14 April 2026 @ 6:29 pm

The game has a repair task. There is a List of required items, and when the method is called, it iterates over the inventory and if a match is found, it adds the item to the list "toRemove" and after the loop it removes those items from the players inventory as well as from required items. If I checked correctly, this works if there is only one item. Now I don't know how to handle the case of duplicates. In this implementation, it removes all items from requiredItems (and probably also from the players inventory) of the same name. public boolean tryRepair(List<Item> inventory) { List<Item> toRemove = new ArrayList<>(); for (Item item : inventory) { for (RepairItem required : requiredItems) { if (item.getName().equals(required.getName())) { toRemove.add(item); repairedItems.add(required); break; } } } inventory.removeAll(toRemove); requiredItems

How is cube.js choosing the root (left) table for the join?

14 April 2026 @ 6:26 pm

Consider this schema: account: joins: - account_list - person - company person: joins: - account - contact company: joins: - account - contact This query { "query": { "measures": ["contact.count"], "filters": [ { "member": "contact.id", "operator": "set" }, { "member": "account.list_id", "operator": "equals", "values": ["34475"] }, { "member": "person.id", "operator": "notSet" } ] } } joins account -> account_list, person -> contact instead of the obvious contact -> person -> account -> account_list That is weird (because I am counting contacts). If I add

How to get column-level lineage from complex Oracle SQL (CTE, subqueries) locally without database or upload?

14 April 2026 @ 2:36 pm

How can I parse Oracle SQL and get column-level lineage locally in VS Code (without uploading SQL)? I’m working with large and complex Oracle SQL queries (CTEs, nested subqueries, window functions, etc.), and I’m facing a few problems: It’s hard to understand where each column comes from Refactoring SQL is risky because I can’t clearly see dependencies Most SQL lineage tools require: database connections, or uploading SQL to external services (security concern) I’m looking for a solution that: Works locally (offline) Supports Oracle SQL Provides column-level lineage (not just table-level) Ideally integrates with VS Code Is there a tool or approach that can handle this?

Expo-widgets pod error during development build

13 April 2026 @ 4:37 pm

Problem solved: I had to upgrade to the latest expo version 55.0.0 because this is where expo-widgets was actually introduced I've tried to create an expo widget by following the documentation here: https://docs.expo.dev/versions/latest/sdk/widgets/ However I am getting an error while trying to create a development build. [!] Invalid `Podfile` file: private method `resolve' called for.... # from /Users/expo/workingdir/build/ios/Podfile:70 # ------------------------------------------- # target "ExpoWidgetsTarget" do > use_expo_modules_widgets! # # ------------------------------------------- pod install exited with non-zero code: 1 Environment: System: OS: Windows 11 10.0.26200 Binaries: Node: 22.19.0 - C:\Program Files\nodejs\node.EXE npm: 10.9.3 - C:\Program

Render-looping when child and parent components both store state simultaneously

13 April 2026 @ 11:40 am

What is the best practice in React + TypeScript to prevent component render looping in the following scenario: There is a standalone component (like an independent component from a library) IBaseComponent that takes a list of records as input: { id: string, label: string[] }[] and an identifier of the selected record recordID: string Inside the component, both the selected record and the list of records can change, so they are stored inside the IBaseComponent as state: [recordID, setRecordID] = useState<string>(props.recordID); [records, setRecords] = useState<string[]>(props.records); If these records change inside the component (for example, due to user actions like mouse selection, button clicks, etc.), then: The