instruction
stringlengths
0
30k
βŒ€
null
I am using an asp.net core web api with entity framework core (pomelo). I have a MariaDB database. I use Swagger UI to explore my api, as per the template. When I try to use it to delete a row, I get the following error: ``` Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity ...
I need help with this exercise: Half Sum Element: Write a program that inputs n integers and checks whether there is a number among them, which is equal to the sum of all the rest. If there is such an element, print "Yes" + its value, otherwise print - "No" + the difference between the largest element and the su...
I have 2 tables in my database: Table `dbo.Customers`: Id | Name :---:|-------------- 1 | Customer1 2 | Customer2 Table `dbo.Images` Id | OwnerId |ImageUrl | OwnerType :--:|:-----:|--------|------------- 1 | 1 | abc.jpg | Info 2 | 10| xyx.jpg | Products 3 | 1 | customer1....
I'm struggling to find a logical approach to validate the TextField. I have successffuly managed to decode JSON and display however i want to let users type in an answer and then compare that to all of the possible "answers" from the JSON for that particular question and maybe add a green chevron if it’s validated. ...
If you want to fix your for-loop, you need to pass `!!sym(temp.name)` to `dplyr::filter()`: ``` library(dplyr) df.mirna.pv <- structure(list("let-7a-5p" = c("no", "yes", "yes", "no"), "let-7a-1-3p" = c("yes", "yes", "yes", "yes"), "let-7b-5p" = c("no", "no", "yes...
This seems to be working and is pretty close to example I made recently except the additional where clause to get the chatrooms of a single user. This might be able to be consolidated more but I think this is the most flexible version. For example, you could get the whole chatroom object as well if needed in the same...
I would like to make an `istream` object result in `failbit` or `badbit` after at least five characters are successfully read. This is needed for writing a unit test to check that our code handles `failbit` and `badbit` correctly. Here's a test function: ```c++ bool test(std::istream &in) { int numchars = 0; ...
How To Debug Python Code Running Shell Being Called in VBA?
|python|excel|vba|shell|debugging|
null
Thanks for the link, loic. This is an area where I have only a basic understanding that needs to improve. Going to dig down bit by bit and pick up some understanding along the way. :)
null
It actually works with the [Kickstart][1] setup, but stops working as soon as I change the `coloscheme` to anything else. None of the color schemes that came with the AppImage distribution seem to highlight neither simple Markdown, nor the Hugo-style Markdown with YAML "front matter". When I set `additional_vim_rege...
Neovim: no syntax highlighting with treesitter for markdown
|markdown|neovim|treesitter|
**TL;DR:** It's not hard to get annoyingly close, but it is not practical to use WPF here. The best practice is to use WinForms for the MDI Child window, and to use an `ElementHost` to [host the WPF content](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/walkthrough-creating-new-wpf-content-on-wind...
null
I"m trying to get a set of html files (with images with links) to randomly show on the sidebar of a site. I can get the name of the file to randomly show using this code: function displayRandomMessage() { var contentArea = [ '/includes/side2.htm', '/includes/side3.htm', '/includes/side4...
How to randomly load html file inside a html page on page load using javascript?
|javascript|random|
How can I execute list of commands from a file in Bash
|bash|
Usually using a variable is an additional overhead, but in your case Chrome was able to provide the same performance. But if a variable is reused, that could actually boost performance. So the rule could be - don't create unnecessary variables ``` ` Chrome/123 --------------------------------------------------------...
I have a commit with a tag, but when I amend any changes to it, it loses the tag. I am not new to git, but still can't understand how it works I've tried: `git commit --amend --no-edit` `git commit --amend --no-post-rewrite` `git commit --reuse-message=HEAD -C HEAD`
|python|tkinter|turtle-graphics|python-turtle|
How can I display order item details in the Admin Orders list when High Performance Orders Storage (HPOS) is enabled? The classic legacy method code no longer works: ```php add_action( 'manage_shop_order_posts_custom_column' , 'custom_orders_list_column_content', 20, 2 ); function custom_orders_list_column_content...
I have a data frame - each individual has multiple visits. I want to filter out patients who had disease 2 after disease 1. In this case, I would pick out ID 2 & 4. ID <- c(1,1,2,2,2,3,3,3,4,4,4,4,5,5) Visit <- c(1,2,1,2,3,1,2,3,1,2,3,4,1,2) Disease <- c(2,2,1,2,1,1,1,1,1,1,1,2,2,1) df <- data.f...
Filter out individuals who developed diseases in a certain sequence
|r|
See example. Recursive assembling expression formula from expression_tree table. ``` with -- recursive -- for PostgreSql cte as( select expression_id,oid ,concat( case when lv in('*','+','-') then concat('[',lid,']') else cast(lv as varchar) end ,ov ,case when rv in('*','+','-') ...
I don't understand why the second and the third observation in C2 only have one blank between the copied string and the repeated string (Shown as 'XXX XXX' and 'Y Y') while there are 5 trailing blanks in 'XXX' and 7 trailing blanks in 'Y'? Does it conflict the results in LC2? ``` DATA EXAMPLE1; INPUT GR...
I'm trying to implement a slider with a tooltip showing current value. The idea is to make something like a HTML + JS **<input class=range>** with a value bubble (https://css-tricks.com/value-bubbles-for-range-inputs/). Both ideas I've come with so far are not ideal. XAML ``` <Slider ...
Create an std::istream that simulates std::failbit or std::badbit after reading a few characters
|c++|
I'm facing a challenge while working on the student automation system. After selecting the department field in the form, I want to display only the departments associated with the selected unit in the department field. Currently, I can see that the units are listed correctly in the unit selection dropdown, but all depa...
How to display only department fields associated with a selected department in student automation system? in .net mvc
|c#|asp.net-mvc|
|excel|vba|excel-tables|listobject|
|excel|vba|autofilter|excel-tables|listobject|
|excel|vba|powerquery|excel-tables|listobject|
|excel|vba|sorting|excel-tables|listobject|
|excel|vba|excel-tables|listobject|
Ive tried to disable GPS and try it on virtual device but also in a real device to see if im eable to make some location updates . I still dont get any location updates with closed GPS , any idea why ? In android docs wifi or cellular data must give me the position updates right ? Here is my code : ``` impo...
I was trying to use this logic to parse a `CString` into a set of 5 tokens: bool Split(CString strText, UINT uNumSegments, CStringArray &rAryStrSegments, TCHAR zChar) { int iTokenCount = 0; while (AfxExtractSubString(strSegment, strText, iTokenCount, zChar)) { iTokenCount++; ...
How can I use CsvHelper to parse a string into a list of tokens?
|c#|csv|visual-c++|csvhelper|
[{ "service": "abc", "capability": "s" }, { "service": "def", "capability": "s" }, { "service": "abc", "capability": "v" }, { "service": "def", "capability": "v" } ] The api data is returned with capability ke...
You may try: You create an additional table "idsequences" in which you will store the pairs (id, cur_val) where id will be the primary key and contains the fk_id's of your table, cur_val will be the sequence value to use in autoId, then a FUNCTION to be executed in its own transaction and with ISOLATION LEVEL S...
Azure Queue Functions | Trigger when multiple queue functions executions with a specific message property ends
null
Bit reluctant to post this as an answer as it is fairly basic, but I do appreciate that there may be people who don't recognise its importance. Make sure this line is in your head element. <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> See [https://develop...
I have a table with the following fields: `id, name, surname, score` There can be multiple rows with the same name & surname combination. How can I extract data so that the scores are added when the name & surname are the same? Sample data: 1, john, smith, 15 2, john, black, 10 3, albert, blac...
MySQL: mergin rows
|sql|mysql|
Using DBeaver as regular SQL-tool. Working with SQL stored procedures, which are ETL legacy code. Due to this regularly is required to search some text "from bottom to top" of SQL code. Every time on <kbd>Ctrl</kbd>+<kbd>F</kbd>(Find dialog) in DBeaver I need to change search direction: from Forward(default settin...
|python|authentication|export|chatbot|gradio|
We've been running a video application in a web browser and we are facing quite a lot complaints about the performance of the video calls. 90% of the complaints are when the user uses a virtual background and we use a library for that and it uses WebGL2 for the rendering. We've performed the following options to ...
You can call `add_job()` during runtime as long as the application is running on loop. For example, you are running Flask which should be on loop already. If you are using Flask and expose API application, you can let users queue task on frontend/POST event. Then on Flask just simple collect and run `add_job()` wit...
As title. I just learned that the `in` binary-operator can be used in mapped types specifically for looping through a union type from `keyof`, for example: ```ts type Mappings = { ... }; type Mapped = { [Key in keyof Mappings]: Key } ``` I wonder whether there is any other usage of the `in` keyword as a bi...
In TypeScript, the `in` binary-operator for usage besides mapped types?
|c++|spdlog|
I'm trying to use a TextValidationBuilder to validate input on a Google Form. I'm doing some tests and I have no idea why the regex isn't working. When I test the regex [here](https://regex101.com/) it works fine. I want to use regex to validate that an input is a time or a number and I am doing this by checking if ...
Context is a object on the owner of the current reactive scope. It keeps the key-value pairs set by providers. ``` owner.context = { [id]: value }; ``` When a component runs, it creates a reactive scope, hence a new owner. We will elaborate on this later on. Context API is made up of three components: 1. ...
TL;DR: `sudo` with the correct password failed repeatedly in my home server but it suddenly started to success after a few minutes. Can this behavior be explained without assuming the existence of an attacker who has the root privilege? --- This morning, I read [*The xz package has been backdoored - Arch Linux Ne...
How to ammend last commit without loosing commit tag
|git|git-commit|git-amend|
null
I have a little chatbox on my website and it has a simple php code I've put together to check for any undesired tags, and also a sort of psuedo bbcode for basic color and bold and stuff. It saves the chat to a datatable on my server. My problem is that any time a user has an apostrophe it won't go through. Even when co...
Website build with nextjs is not loading preview
|html|node.js|web|next.js|meta-tags|
null
Use handle_parsing_errors=True during agent initialization. The output parsing error occurs when the LLM's generated response doesn't match the expected format. This can happen no matter what callback you choose. By setting handle_parsing_errors=True, you're telling the agent to keep regenerating the response until ...
``` Create PROCEDURE [dbo].[identify] AS BEGIN SET NOCOUNT ON; DECLARE @UpdatedRows TABLE ( action NVARCHAR(10), first_name NVARCHAR(50), old_last_name NVARCHAR(50), new_last_name NVARCHAR(50) ); MERGE INTO [dbo].[warehouse] AS dim USING [dbo].[st...
In my case, I had a bad config entry in `/etc/nsswitch.conf` that prevented docker from resolving container registries. In `/etc/nsswitch.conf`, my hosts line looked like this: ``` hosts: files myhostname ``` After changing the hosts property to default value, everything worked. ``` # default value for h...
public class Subject { String name; Integer marks; public Subject(String name, Integer marks) { this.name = name; this.marks = marks; } public String getName() { return name; } public void setName...
I'm working on an integration with the DocuSign API in Nest.js project. My service must meet 3 requirements: * Implementing the Code Grant oAuth 2.0 identification process and saving the credentials to Mongo DB record. * Performing API operations based on the saved credentials, for example createEnvelope. * Imple...
Fused Location does not work when i turn GPS off , it does not work with Wifi or cellular data?
|android|flutter|flutter-dependencies|android-gps|android-fusedlocation|
The situation is as follows: I have a websocket for communication between app and server. If the websocket were to break I would like to enable backup long polling until the websocket becomes active again. I thought of creating a Signal boolean that changes state based on the connection/disconnection of the WS. If ...
Angular 17 - Trigger recurrent polling whenever a boolean variable becomes true and as long as it remains so
|javascript|angular|rxjs|polling|
Here is a short-circuiting solution that uses a custom gatherer, using the [JEP 461: Stream Gatherers](https://openjdk.org/jeps/461) Java 22 preview language feature: ```lang-java List<Integer> list = List.of(1, 2, 4, 1, 3, 4, 4, 1); // A parallel stream must be used until JDK-8328316 is fixed boolean hasDuplic...
|excel|vba|autofilter|excel-tables|listobject|
here you can try this to get you started, you'll need the internet to load three.js in this model **use the file button to select a file from your local harddrive** <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> function url_change(e){ ...
Check the **Trackpad** settings on the Mac: ![Screenshot](https://i.stack.imgur.com/yyaWP.png) With the settings shown here, a `LongPressGesture` works for me when I hold using three fingers. I haven't tried it wuth Flutter though.
[{ "service": "abc", "capability": "s" }, { "service": "def", "capability": "s" }, { "service": "abc", "capability": "v" }, { "service": "def", "capability": "v" } ] The api data is returned with capability ke...
Today when I using this demo to upload image file to Minio : import React from 'react'; import logo from './logo.svg'; import './App.css'; import { Button, message, Upload } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; import type { UploadProps } from 'antd'; ...
Why the antd upload file to Minio could not preview
I have problems trying to convert BMP-Images into DICOM. My Python Script list all the BMP Files in the Directory and convert them into a Dicom Dataset. I can run the code but I get a strange result. I don't know what the problem could be, this is my first time working with image processing. Please help me i am lerning...
Convert Images into Dicom with python
|dicom|bmp|pydicom|
Can you please help me to resolve next problem? I have setup Bind9 and added RPZs with blocking rules. Here is version of Bind9: BIND 9.18.25 (Extended Support Version) <id:6dc676c> running on Linux x86_64 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) built by make with '--with...
How do I include apostrophes in my chat (using php and mysqli for the database)
|php|html|mysql|mysqli|
I am trying to use CLIPS with swift and, a priori, the communication between Swift and C is natural or, at least, quite direct. The thing is that I don't know very well how to convert to the necessary type of theCV parameter of the Eval function. Does anyone has experience with these scams and help me? I put the cod...
How to type a parameter pointed to a C structure of a C function in Swift code?
|c|swift|
null