StackOverflow.com

VN:F [1.9.22_1171]
Rating: 9.4/10 (10 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

When adding a datetime-local value to the db, a time other than the selected time is added to the db

7 May 2024 @ 5:18 am

Implement a form with input type datetime-local and Implemented to select date and time When I recorded the form data from console.log on the backend server as shown below, the date and time I selected were clearly included in the object. { startDay: '2024-05-07T19:00', endDay: '2024-05-07T20:00' } But when I check the data in db, why Is there data from the time below, 9 hours later? startDay is 2024-05-08 04:00:00 endDay is 2024-05-08 05:00:00 async a(data) { console.log("service", data) return await challenge_season.create(data) }, Do I need to change the format of data.startDay and data.endDay values before inserting data into the table?

Fluentd - AWS managed opensearch service logging issue

7 May 2024 @ 5:18 am

I need configure FluentD to send logs from my AWS-EKS nodes to AWS managed OpenSearch dashboard. FluentD as DaemonSet installed on each of my AWS-EKS node. What is a problem? Problem:- FluentD unable to communicate with Opensearch. Environment Fluentd version: 1.16.5 TD Agent version: Fluent Package version: Docker image (tag): fluent/fluentd-kubernetes-daemonset:v1-debian-opensearch Operating system: amazon Linux 2 (EKS-Node) Kernel version:6.1.79-99.164.amzn2023.x86_64 AWS EKS Kubernetes version: 1.29 Describe the configuration of Fluentd apiVersion: v1 kind: ServiceAccount metadata: name: fluentd namespace: kube-system apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fluentd rules: apiGroups: [""] resources: pods namespaces verbs: get

For count reverse pairs question why will this slightly modified logic from count inversion pairs won't work?

7 May 2024 @ 5:18 am

This is my code for counting inverrsion pair i have modified the logic from counting inversion pairs but it is not working could you please point out why? int cnt = 0; void merge(vector<int> &a, int low, int mid, int high) { vector<int> temp; int left = low; int right = mid + 1; while (left <= mid && right <= high) { if (a[left] <= a[right]) { temp.push_back(a[left]); left++; } else { if (a[left] > 2 * a[right] && left <right) { cnt += mid - left + 1; } temp.push_back(a[right]); right++; } } while (left <= mid) { temp.push_back(a[left]); left++; } while (right <= high) { temp.push_back(a[right]); right++; } for (int i = low; i <= high; i++) { a[i] = temp[i - low]; } for (int i = low; i <= high; i++) { cout << a[i] << " "; } cout << cnt << endl; } void mergesort(vecto

How to put text in a pdf using fpdf

7 May 2024 @ 5:18 am

I am trying to put text in a report I am trying to create. The text data is of type json object. I have a list of paths that iterates through and then I load the json object and then grab the text, and do some parsing. The problem is that the final result does not look good. Here is what the JSON object looks like: <s> <|im_start|> system You are Orca, an AI language model created by Microsoft. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior. <|im_end|> <|im_start|> user Please provide an real estate investment summary for Branch County, MI. Include the pros and cons of investing there assuming we are going to hold the property for at least 5 years or more. Lastly, include an overall investment thesis. <|im_end|> <|im_start|> assistant A possible real estate investment summary for Branch County, MI is: Branch Co

Docker driver "overlay2" failed to remove root filesystem: unlinkat read-only file system using windows powershell

7 May 2024 @ 5:16 am

I am using a Windows Powershell at Windows 11. I try to create an ubuntu 20.04 SDK manager image for a Qualcomm Roboplatform RB5 and failed. Now I want to delete the 2dc4364a218c container. > docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2dc4364a218c ubuntu:20.04-sdkmanager "/usr/sbin/sshd -D" 3 hours ago Up 3 hours 22/tcp sdkmanager_container > docker rm 2dc4364a218c Error response from daemon: container 2dc4364a218c20fb68a73adff03b28c3500245b7c0af70c3e8ab20e8d955dab0: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/c6df829aaef9cc90b7cc5076f958a5bcd3f9d8d864d4811a19532774dc1b1aec: read-only file system I try to use command: > docker image prune

What is MapEntry used for?

7 May 2024 @ 5:16 am

I am new to dart, and I came across the following code. This apparently updates the document in the firebase. Can someone explain in detail, what it really does? abstract class FirestoreDocumentUpdater { static Future<void> update( // ignore: use_function_type_syntax_for_parameters DocumentReference<Map<String, dynamic>> documentRef, Map<String, dynamic> map) { debugPrint('update function called'); return documentRef.update( Map.fromEntries( map.entries.map( (e) { return MapEntry( e.key, switch (e.value) { DateTime t => toJsonDateTime(t), Duration d => toJsonDuration(d), Enum t => t.name, _ => e.value, }); }, ), ), ); } } Timestamp? toJsonDateTime(DateTime? dateTime) { if (dateTime == null) re

I am trying to create a pipeline in ADF and my CSV file opened in Notepad looks like this ColA, ColB, ColC, ColD,,,,,,,,,,,,,,,,,

7 May 2024 @ 5:16 am

SO, I have a file that is in the storage container as CSV. When I open the file in notepad, it looks like this. ColumnA, ColumnB, ColumnC, ColumnD and so on,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,. I would like to load this data from CSV file to Azure SQL table, but while running the pipeline, it gives me the error "The name of Column Index 17 is empty" What settings need to be updated to load this? enter image description here I tried working with basic settings, but it not working at all.

a coloumn of my table is showing invalid identifier in toad

7 May 2024 @ 5:15 am

i am getting the following error on my trigger [Warning] ORA-24344: success with compilation error 3/62 PL/SQL: ORA-00904: "PEOPLE"."FLATNO": invalid identifier 3/9 PL/SQL: SQL Statement ignored 7/66 PL/SQL: ORA-00904: "PEOPLE"."FLATNO": invalid identifier 7/9 PL/SQL: SQL Statement ignored (2: 0): Warning: compiled but with compilation errors my trigger: SET SERVEROUTPUT ON; CREATE OR REPLACE TRIGGER TUTU BEFORE INSERT OR DELETE OR UPDATE ON PEOPLE FOR EACH ROW BEGIN IF INSERTING THEN UPDATE FLAT SET Status = 'Hired' WHERE FLAT.FLATNO = PEOPLE.FLATNO; END IF; IF DELETING THEN UPDATE FLAT SET Status = 'Not Hired' WHERE FLAT.FLATNO = PEOPLE.FLATNO; END IF; END; / my tables: CREATE TABLE FLAT( FlatNo NUMBER, Rent NUMBER, FlatSize VARCHAR(20), FlatType VARCHAR(20), Facing VARCHAR(15), RoomsNo NUMBER, BuildingNo NUMBER, Status VARCHAR(20), PRIMARY KEY(FlatNo),

DeploymentScriptOperationFailed when running Microsoft.Resources/deploymentScripts

7 May 2024 @ 5:15 am

We've been using Microsoft.Resources/deploymentScripts for about a year now and never had any issues. To run script, we are using User Managed Identity. No changes to the template were made from our side. Recently we started seeing this error {"code":"DeploymentScriptOperationFailed","message":"Resource '23fl75rmqngz2azscripts' was disallowed by policy. Reasons: 'Shared Storage Access Keys are not allowed'. See error details for policy resource IDs."} Looks like it tries to connect to storage account using Storage Access Keys but they are not allowed. The Storage Settings in Microsoft.Resources/deploymentScripts template consist only from name and key. https://learn.microsoft.com/en-us/azure/templates/microsoft.resources/depl

SQL SERVER Procedure or function has too many arguments specified

7 May 2024 @ 5:15 am

I'm still facing the problem that I was prompted that I'm passing too much parameters even though I defined it to both stored proc (sql server) and vb net: ERROR: System.Runtime.InteropServices.COMException: 'Procedure or function pro_SearchBySCQTY has too many arguments specified.' These are my current codes: vb net If rsfind.State = ConnectionState.Open Then rsfind.Close() End If rsfind.CursorLocation = ADODB.CursorLocationEnum.adUseClient rsfind.CursorType = ADODB.CursorTypeEnum.adOpenStatic rsfind.LockType = ADODB.LockTypeEnum.adLockOptimistic With cmd '''gonna hide the conn'' .ActiveConnection = [redacted] .CommandText = "pro_SearchBySCQTY" .CommandType = ADODB.CommandTypeEnum.adCmdStoredProc .Parameters.Append(.CreateParameter("@SearchTerm", ADODB.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput,