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.

When iterating javascript object retrieves different values than shown when console.logged complete object

3 February 2026 @ 11:12 pm

I'm working with and object than has several keys of payways for a sales invoice, when I do console.log before starting to iterate I receive: [ { "importe": 20000, "idformapago": "45", "ajuste": -2000, "precio": 18000, "cargo": "-10", "dolar": 0 }, { "importe": 20, "idformapago": "74", "ajuste": 29000, "precio": 29000, "cargo": "0", "dolar": 1 } ] But when iterating each key the second sends 0 in some keys: First every key identical: { "importe": 20000, "idformapago": "45", "ajuste": -2000, "precio": 18000, "cargo": "-10", "dolar": 0 } Second gets "ajuste" and "precio" with zero: { "i

Sorting y axis of a graph based on frequencies of three discrete criteria in ggplot

3 February 2026 @ 11:11 pm

In the graph below the authors have graphed the days that every participant in a longitudinal trial (1) used heroin (red dots) (2) did not use heroin (green dots) (3) had dropped out of trial (grey dots) enter image description here It looks to me as if the authors sorted the order of the rows on the y axis based on the three criteria with greatest number of missing (grey dots) on the bottom row ascending to fewest days, then greatest number of heroin use days ascending to fewest. To me this seems like they sorted it based on three criteria. I have looked around for ways to rank based on three discrete criteria here and here but could not find a way to apply it to my problem. I tried to do it in ggplot

Offline facial recognition with react native

3 February 2026 @ 11:08 pm

I want to create an app that does facial recognition on facial features like forehead wrinkles for example. I know that may not be the most secured way, but just for practicing’s and for fun sake. What I’d like is to have the user register their wrinkles when enabling the function. Read the user’s face and authenticate when the user asks to. All being done offline, if possible, like apple’s faceId. I have vision camera implemented to recognizing face already. But the authentication part is lacking. What library should I be using, or any recommendations to proceed? Thanks in advance

Can't use Preview in Intellij

3 February 2026 @ 10:57 pm

I cannot get previews to show up for me with Intellij IDEA 2025.3.2 Is there something I'm doing wrong? I've downloaded all the necessary plugins and restarted and reopened Intellij several times. I've got Compose Multiplatform and Kotlin Multiplatform installed as plugins. I downloaded a new project using the kmp online wizard targeting server, android, and iOS. I'm not sure what to do now. No matter what I can't get that preview play button to appear. screenshot

Horizontal Bar Charts D3 not stacking or filtering properly

3 February 2026 @ 10:41 pm

I am attempting to modify a template of D3 code to make a horizontal bar chart that is filtered to show the first 5 rows. When I inspect my 5 data seem grouped together into their own bar rather than into 5 separate bars and they are next to each other horizontally rather than vertically. Additionally, other data that was filtered out seem to start in another bar. I've included the script below for everything except the axis. I've resolved other issues related to this but I haven't been able to resolve this. I've double checked that I haven't mixed my x and ys along the way, I've tried removing the filter or using just slice, and I've tried adjusting the margins but none of them resolved this. I've left out code related to the axis since this problem has been occurring since before they were added. Bad Chart Image

Selenium ChromeDriver not working in JavaFX application packaged as an exe

3 February 2026 @ 9:48 pm

I have a JavaFX application that uses Selenium to scrape some websites. Everything works great when I run the application through IntelliJ. However, I am packaging the final product into an exe file using jpackage. The rest of the application works when I execute the exe, except for the part that performs the ChromeDriver() part. I have done lots and lots of digging before asking this question and all I can find is that the typical problem is because once the application is packaged in an exe, the program cannot find the path to the chromedriver.exe. I am currently including Selenium 4.40.0. Gradle: implementation("org.seleniumhq.selenium:selenium-java:4.40.0") Things I've tried: Explicitly setting the path to the chromedriver.exe using the following: System.setProperty("webdriver.chrome.driver", "C:\\dev\\chromedriver.exe"); Upgrading to Selenium 4.6.0, which s

How to Easily migrate a laravel 7 blade/vue2 App to Laravel12 Vite keeping blade views and Vue3 components

3 February 2026 @ 9:41 pm

I have an older Laravel7 App which I made with blade templates including vue2, thus using Vue2 & Webpack (laravel Mix) to make the app work. The client has asked me now to upgrade to the newest Laravel 12 Version which now uses Vite Laravel 12 starter packs come with Vue, React & Livewire templates, so apparently the old blade/vue Mixin is not supported anymore (at least not obviously) As I just recently wrote a full Vue3 SPA I went to The Vue approach. But I stumble upon the fact that I have to rewrite all existing blade templates into Vue3 components, which is pretty time-consuming. I was though wondering if there is an approach which makes the migration easier by being able to still use the blade templates but with Vue instead of Livewire because otherwise that would force me again to rewrite all Vue into Livewire components. So is it possible to use the old blade views with vue components approach? Or is the Vue3 SPA impossible to

Trying to write a Python plug-in for Gimp version 3.0.8 that selects a polygon

3 February 2026 @ 9:30 pm

After a lot of digging and trying to sort out the older interface API from the gimp 3 version. I find I'm stuck. I'm using the code below to try to select a triangular area. The code runs in the console window without error but the selection doesn't happen. I also notice that the return value in result is not of the right type (boolean) but is instead a Gimp.ValueArray object. Anyone have an idea how to do this or what is wrong with the code below? import gi gi.require_version('Gimp', '3.0') from gi.repository import Gimp gi.require_version('GimpUi', '3.0') from gi.repository import GimpUi from gi.repository import GObject from gi.repository import GLib from gi.repository import Gtk image = Gimp.get_images()[0] mypdb = Gimp.get_pdb() myproc = mypdb.lookup_procedure('gimp-image-select-polygon') pts = [100.1, 50.0, 800.1, 50.0, 800.1, 1000.0] array = Gimp.Array() darray = Gimp.DoubleArray.set_values(array, pts, False) config = myproc.create_config() config.set_property

Step By Step Guide for ASP.NET Core WebAPi 4Monkeys

3 February 2026 @ 9:07 pm

Microsoft SQL Server Management Studio: Start it! Authentication: Windows Authentication -> Connect Packets download in Visual Studio: Tools -> NuGet Package Manager -> Manage NuGet Packages for Solutions FluentValidation(Versions 8 -> 8.22; 8.0.2, 8.0.22) FluentValidation.DependencyInjectionExtensions Microsoft.AspNetCore.Authentication.JwtBearer Microsoft.EntityFrameworkCore Microsoft.EntityFrameworkCore.Design Microsoft.EntityFrameworkCore.InMemory Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools Swashbuckle.AspNetCore Visual Studio Steps: Create folder Data Create class AppDbContext.cs Type: public class AppDbContext : DbContext{ public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) {} public DbSet<Us

How to access elements of a derived container class

3 February 2026 @ 8:38 pm

I am having trouble understanding/fixing a problem I am encountering in my first attempt to create a derived container from an abstract superclass. It seems that I cannot access the derived class's data from a member function. Each time I attempt it, I get an incorrect value. tuple.h class container { public : virtual int get_element ( std::size_t index ) = 0 ; } ; class tuple : public container { private : int* arr_ptr { } ; std::size_t arr_size{ } ; public : tuple ( ) : arr_ptr { nullptr }, arr_size{ 0 } { } tuple ( std::initializer_list<int> setter_list ) : arr_ptr{ new int [ setter_list.size() ] }, arr_size{ setter_list.size() } { } int get_element ( std::size_t index ) override { return arr_ptr[index] ; } } ; The call to tuple's member function get_element() in main() is displayed below: ma