java – Post mapping doesn’t work (message): “could not execute statement)

I am trying to create simple Rest project. When Post request is generated there is an error: HTTP/1.1 500 Content-Type: application/json Transfer-Encoding: chunked Date: Sun, 19 Jun 2022 14:33:09 GMT Connection: close { “timestamp”: “2022-06-19T14:33:09.368+00:00”, “status”: 500, “error”: “Internal Server Error”, “trace”: “org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: … Read more

Dealing With Slow SQL Queries? Let the “EXPLAIN” Statement Handle It | by Max | Jun, 2022

Understand EXPLAIN query plans (part 1 of 2) Photo by Markus Winkler on Unsplash Have you ever had a slow-running SQL query but you weren’t sure where to even start looking for optimizations? If only there was some way to pinpoint exactly which parts of your query were causing the whole thing to run slow, … Read more

javascript – How to change color on click in TypeScript – Boolean – if else statement

I have a complex codereview exercise where I don’t really understand what should I do. There is a website with cards of a shelter home. I should get a button between green OR red , and vaccinated OR not vaccinated on vaccinated section everytime when I click on it. I don’t know how sould i … Read more

dataframe – conditional if statement and loop over in R

Here’s the dataset (only a small portion of it): data <- tibble::tribble( ~id, ~num_per_section, ~unit, ~section, ~incr, ~growth_factor, ~correlation, 4, 1L, 271367.963168022, 271367.963168022, 271367.963168022, 1, 1, 4, 2L, 256992.443966664, 513984.887933328, 242616.924765306, 0.944062483007389, 1, 4, 3L, 206939.767316042, 620819.301948127, 106834.414014798, 0.516258500724217, 0.975748579880399, 4, 4L, 158582.427610004, 634329.710440016, 13510.4084918897, 0.0851948648756681, 0.9186985364243, 4, 5L, 127126.510780628, 635632.55390314, 1302.84346312366, 0.0102484010229139, 0.860564652448833, 4, … Read more

c++ – It seems jump to case label in switch statement from case 6 to 9 and I don’t know why

#include<iostream> #include<string> using namespace std; #define SIZE 1000 struct Reservation { string time; string day; string month; string year; string hairstylists; }; struct BeautySalon { string phone; string name; string address; string favhair; Reservation reservation; string nationality; string specality; }; custList[SIZE], hairList[SIZE] ,rev[SIZE]; void readinC(int ctr) { cout<<“Enter the name of the Customer: “; cin>>custList[ctr].name; … Read more

sql – I need to optimize the following pgsql select statement – its currently taking 34 avg seconds to execute

I have a view that shows all relations. I use the following select for the view: CREATE VIEW relationships AS SELECT DISTINCT relations.name, sch_tco.id AS table_id, relations.related_table AS related_table, scd_tco.id AS related_id, relations.foreign_column AS foreign_column_name, relations.local_column AS local_column_name, count(DISTINCT relations.name) AS relationships, count(DISTINCT relations.referenced_tables) AS foreign_keys_count, count(DISTINCT relations.referencing_tables) AS references_count, count(DISTINCT related_table) AS related_tables_count, count(DISTINCT … Read more