October 22, 2024
Chicago 12, Melborne City, USA
java

Spring Data JPA, Hibernate: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “toy_paths_pkey”

I have two entities: Dog and Toy. A Toy is associated with a String path. toys_paths table: dog_id toy_path toy_id The (dog_id and toy_id) should be a unique pair. Inside Dog entities it’s stored as Map<Toy, String>: @Entity(name = "dogs") public class Dog { @Id @SequenceGenerator(name = "dog_sequence", sequenceName = "dog_sequence", allocationSize = 1) @GeneratedValue(strategy

Read More
python

How do I onehotencode a single column in a dataframe?

I have a dataframe called "vehicles" with 8 columns. 7 are numerical but the column named ‘Car_name’ which is index 1 in the dataframe and is categorical. i need to encode it i tried this code and wont work ohe = OneHotEncoding(categorical_features = [1]) vehicles_enc = ohe.fit_transform(vehicles).toarray() TypeError: OneHotEncoder.__init__() got an unexpected keyword argument 'categorical_features'

Read More
GPL

Free GPL Menu Management Enhancer for WordPress

Struggling to work with large menus? Try the Menu Management Enhancer for WordPress The WordPress 3 Menu Management System is excellent, but it can be a bit cumbersome if you’re managing many menu items. The Menu Management Enhancer for WordPress aims to improve the menu management user experience. Manage large numbers of menu items with

Read More
javascript

How to change the window.showSaveFilePicker() title

How to change the title in window.showSaveFilePicker() function. async function getNewFileHandle() { const opts = { types: [ { description: "Text file", accept: { "text/plain": [".txt"] }, }, ], }; return await window.showSaveFilePicker(opts); } getNewFileHandle(); You need to sign in to view this answers

Read More
SQL

How do I grant a role to CURRENT_USER in Snowflake?

I am creating a portable SQL script. The CURRENT_USER may vary but I want to always grant role X to them. I have tried the following which fail: GRANT ROLE X to CURRENT_USER; GRANT ROLE X to CURRENT_USER(); both with Syntax error: unexpected 'CURRENT_USER'. (line 1) Is there a way to do this? You need

Read More
CSS

how to make a selector by xpath

I have some data stored in the generatedName constant, and I need to locate a nearby HTML element (the options button) for my test so I can click it. However, my current approach doesn’t seem to work: javascript const rowElement2 = await browser.$(`//tr[td//text()[contains(., '${generatedName}')]]`); await rowElement2.waitForDisplayed(); const buttonElement2 = await rowElement2.$('title="Options"'); await buttonElement2.waitForDisplayed(); await buttonElement2.click();

Read More
jQuery

How to sum comlum values in datatable using where condition

I am using MySQL to sum data then display it in datatable but since database is bigger it became very slow I am trying a new approach where I use client side to do calculation, tried every code I could find but keep getting this error : $(...).DataTable(...).column(...).data(...).sum is not a function I need to

Read More
HTML

keeping the current element in view when page content re-flows

I have a set of details/summary elements, with a javascript autoclose to keep the page sort – see https://codepen.io/perllaghu/pen/BaXwQOQ as a demonstration. My problem is that when you have opened an early entry (try 1, 2, or 3) then open a later one (try anything after 4b), the top of the summary data [and thus

Read More
Android

FloatingActionButton, layout_anchor and layout_gravity not working API level 34

I am trying to create Bottom menu using BottomAppBar and BottomNavigationView and FloatingActionButton. I have checked below are the solution and also some other github project also. My Android Studio version is Android Studio Koala Feature Drop | 2024.1.2 Patch 1. Project configuration is compileSdk = 34 and targetSdk = 34 Question1, Question2, Tutorial, Tutorial,

Read More
PHP

Printing paper on the clients available printers within thier network Codeigniter PHP

the probllem in question is that there needs to be made a print job to an printer that is not on the local network of the site and the only thing you know of the printer is its ip address. therefore you cant use commands to fix the problem. i would love it if it

Read More