October 24, 2024
Chicago 12, Melborne City, USA
PHP

ERROR 1452: Cannot add or update a child row: a foreign key constraint fails

Note: I am trying to learn database. So I don’t know anything about this Foreign Keys. Mass: Field Type Null Key Default Extra id int(11) NO PRI NULL auto_increment name varchar(20) NO mass_unique_id varchar(25) NO created_at date NO current_time() Mass_Conf: Field Type Null Key Default Extra mass_id int(11) NO FK meal_conf NO NULL Here is

Read More
C#

Canot Convert the “Table_0” value of type “System.Data.DataTable” to type “System.Threading.Tasks..Task’1[System.Data.IDataReader”

I am getting the convert error on return statement. if (Itask.IsFaulted) { var reader = task.Result; var dataTable = GetDataTable(reader); WriteObject(dataTable); return; } You need to sign in to view this answers

Read More
java

Get the java project root package in Neovim

I am using Neovim for Java development. I have nvim.jdtls and eclipse.jdt.ls configured. To add some extra commands, like creating a new class, I need to get the project root package path, which I believe is already detected by jdtls. Is there an API to query this infromation from programmatically. You need to sign in

Read More
python

Stop and resume process by semaphore

I wish to implement an API that utilize asyncio events in order to stop/resume a asyncio task. The API will support the following methods: /import (start) /stop /resume Main problem is happening when invoking the method /stop: File "/src/srv.py", line 131, in __stop loop.run_until_complete(self.__proc.stop()) RuntimeError: This event loop is already running /lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py:-1: RuntimeWarning: coroutine 'Application.stop'

Read More
GPL

Free GPL Ultimate Affiliate Pro – Affiliate Plugin for WordPress & WooCommerce

Ultimate Affiliate Pro is the newest and most complete WordPress Affiliate Plugin and WooCommerce that allow you provide a premium platform for your Affiliates with different rewards and amount based on Ranks or special Offers. You can turn on your Website into a REAL business and income machine where you just need to sit down

Read More
javascript

Download all of the files from Inspect Element's sources

I would like to download all of the .jpg images that I can see in Safari’s Inspect Element’s "sources" tab on one particular webpage. I’ve been running this in the console: (function () { function downloadFile(file) { const element = document.createElement('a'); element.setAttribute('href', file); element.setAttribute('target', '_blank'); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } (new PerformanceObserver((list) =>

Read More
SQL

MERGE RETURNING into temp

Is something like this possible without having to use WITH? Can CREATE TEMP TABLE temp AS be used instead of creating the temp table manully? CREATE TEMP TABLE temp ( action text, winery_id int, brand text ); MERGE INTO wines w USING wines_updates u ON u.winery_id = w.winery_id WHEN MATCHED THEN UPDATE SET stock =

Read More
CSS

Tailwind CSS “justify-center” works if used with “flex-row” but doesnt work with “flex-col”

I was recently building a website using NuxtJs and ran into a problem: I cant center components in a that are in a flex column. but when i removed the "flex-col" class everything seemed to work fine. Here’s my code: <script setup> </script> <template> <div class="bg-slate-800"> <div class="h-48"></div> <div class="flex flex-col justify-center"> <div class="h-40 w-20

Read More
C++

Why does a pointer to the first element of an array, after dereference, evaluates to the third element?

It dereferences to the third element when I’m trying to do it inside printf(), where I also try to dereference that pointer with post and pre-increment. Here’s my code: #include <stdio.h> int main() { int arr[4] = {1, 2, 3, 4}; int *ptr = &arr[0]; printf("ptr = %p, &arr[0] = %p\n", ptr, &arr); // same

Read More
HTML

Apache Tika: Converting Excel to HTML in Kotlin

I want to write an application that converts Excel spreadsheets to HTML and preserve styling. Apache Tika is the best free solution I have found so far. I tested some conversions in the command line such as: java -jar tika-app-2.9.2.jar --html spreadsheet.xlsx > output.html and the output looks great. I get an HTML file with

Read More