instruction
stringlengths
0
30k
|php|html|sql|database|
I'm trying to implement basic socket program in C which parses HTTP GET requests for now, in `parse_http_req` function I've declared `char* line;` and after `strncpy` call `line` contains 1st line of HTTP request data. My doubt is I didn't allocate any memory for `line` before I called `strncpy`, how is this code worki...
Select all lines after last occurence of a certain character
Remove the `bin` from MAVEN_HOME. When the path is building you add `bin` again, then the path the machine is looking for is ```none C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%MAVEN_HOME%\bin\bin; ``` which is wrong.
This is more a hint than a question: The goal is to parse a command line **AND** create a useful *usage* message code: for arg ; do case "$arg" in --edit) # edit file cd "$(dirname $0)" && vim "$0" ;; --noN) # do NOT create 'NHI1/../tags' ...
I have started using Jenkins. I am totally new to this. I am executing my Seleium automation script using Jenkins but encountered into the below error. I am using Java 17 in my system as well as in my project. I tried many times but it is getting failed. Even I tried to change java version in pom.xml file. That also di...
I have an array of points formatted like this: `[point(0,0), point(0,0), point(0,0)]`, where `0,0` is replaced with the location of the point. I would like to interconnect them all by distance, for example: [connecting.png](https://i.stack.imgur.com/CWs57.png). This would be done by looping over each point (loop 1)...
I have modal dialog window in images block on OPENCART site that has folder-looking elements with elements, and clicking one folder-element, I go inside this folder-element and there is another folder-element in it, which I need to click too. I'm trying to write code in selenium/python to go through all those folder-e...
I am building a face-id detection program on my raspberry pi, for which I need to use OpenCV along with my RaspberryPi camera. However, when I run my code, I keep on getting an error which I am guessing is because the cv2.VideoCapture() function is not able to take input from my RaspberryPi camera. Whenever I run th...
How to use a RaspberryPi camera with the cv2.videoCapture() function?
|opencv|raspberry-pi3|
null
If you're trying to get a fixed top section, and then, a scrollable one, you could simply use a Column() into your Scaffold, and wrap a Container() followed by an Expanded() into it. For example : Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text(widg...
{"OriginalQuestionIds":[72238175,60618844],"Voters":[{"Id":9504406,"DisplayName":"emeraldsanto"},{"Id":8690857,"DisplayName":"Drew Reese","BindingReason":{"GoldTagBadge":"react-hooks"}}]}
I have 2 lists that I wanted to merge together (witch contained 'class' objects), so I tried using the \__str_\_() method but it didn't work I made this class that would give each card a color and number and then tried to use the \__str_\_() function ``` #create class class card: def __init__(self, color, nu...
How do I print a list with the __str__() method
|python|
null
I am working with a school project where I need to obtain the analyst price targets estimates of certain stocks from the Yahoo Finance Website (this is mandatory). When I tried to use it by beatiful soup I couldn't scrape it (I believe JS is adjusting the page as it laods), so I turned to selenium to obtain such da...
{"Voters":[{"Id":2943403,"DisplayName":"mickmackusa"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}]}
{"Voters":[{"Id":14853083,"DisplayName":"Tangentially Perpendicular"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[18]}
{"Voters":[{"Id":14732669,"DisplayName":"ray"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[18]}
I'm programming a simple 'game' that is just a block that can jump around. I placed a wall, but now the character phases through when moving to the right, but the collision works when going to the right. simple working code for this example: ``` <!DOCTYPE html> <html> <head><title>Simple Game</title>...
{"Voters":[{"Id":794749,"DisplayName":"gre_gor"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[18]}
{"Voters":[{"Id":2943403,"DisplayName":"mickmackusa"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}]}
{"Voters":[{"Id":9473764,"DisplayName":"Nick"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":16217248,"DisplayName":"CPlus"}]}
**Promise resolution** The technical explanation is that pairs of `resolve`/`reject` functions are "one shots" in that once you call one of them, further calls to either function of the pair are ignored without error. If you resolve a promise with a promise or thenable object, Promise code internally creates a ne...
That error seems odd, because imports should be allowed, but it's possible that it's just an inaccurate message. What you're looking for in this case isn't an import, it's a directive that Tailwind itself supplies: ```css @tailwind base; @tailwind components; @tailwind utilities; ```
`while` is a looping construct. It is not that the thread revisits the code before - it just loops again: while (mode.get() != 1) { lock.wait(); } After the `wait()` call finishes the loop condition is evaluated again in the same way that while (counter.get() < n) { // some c...
I am currently experimenting a bit with the Qt DataVisualization. The goal is that I have a `QLineEdit` and when I exit it, I use the `QLineEdit::editingFinished` signal. And then I set the value that was entered to the selected `Bar`. I get an error on line 46 when I start the second `for` loop when I try to acc...
Read Access Violation when accessing a QBarDataItem in a loop in QLineEdit::editingFinished
I have a DJI Mavic 3M drone where I shoot images of the ground. For further processing, I need to obtain the world-to-camera transformation matrix. The drone saves the yaw, pitch and roll angles for both the drone and the gimbal. Since the camera is attached to the gimbal, I only use the euler angles of the gimbal. ...
Incorrect world-to-camera matrix with euler angles (yaw, pitch, roll)
|scipy|computer-vision|coordinate-systems|coordinate-transformation|photogrammetry|
null
|sql|sqlite|group-by|ranking|group-concat|
I need to create a Query that will re-organize a table. It has been over 5 years since I was heavily using Query and Arrayformula's in Google Sheets and am not getting the results needed. Google Sheet example Data: https://docs.google.com/spreadsheets/d/1YI1mPJqL8x0GfxMSE9K2xCNzwiUvo0RLhd5DQ0O1mC4/edit?usp=sharing ...
Google Sheet - Transpose with Query or ArrayFormula?
In modern JavaScript (ES5+), evaluating a RegExp literal is specified to return a new instance each time a regular expression literal is evaluated. In ES3, a JavaScript literal creates a distinct `RegExp` object for each literal (including literals with the same content) **at parse time** and each “physical” literal al...
I have written a SQL query to find prev year sales one using `lag` and with nested CTE, and another just without nested CTE. I am seeing difference in output in SQL Server environment. Without nested CTE (correct output): WITH cte AS ( SELECT * FROM (SELECT ...
Writing query in CTE returning the wrong output
In your vs code press keys `ctrl`+`shift`+`p` then search `settings.json` and write the following code { "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" ...
I have written a SQL query to find prev year sales one using `lag` and with nested CTE, and another just without nested CTE. I am seeing difference in output in SQL Server environment. Without nested CTE (correct output): WITH cte AS ( SELECT * FROM (SELECT ...
Selected answer didn't work for me in 2024. But such POST request did the thing: curl --location --request POST 'https://***' `--request` defines 'POST' method. `--location` follows redirect if 3XX HTTP status and "location" header are returned in response.
I want to upload a large file (public accessable over the internet) to an Azure blob using the PUT REST API with the x-ms-copy-source header. The PUT uri includes a SAS token and I use these headers: ``` x-ms-version: 2023-11-03 x-ms-blob-type: BlockBlob x-ms-copy-source: https://mypublicfile/filename.csv ``` Th...
Azure Storage Copy Blob From Url (REST API) error on x-ms-requires-sync header
|azure|azure-blob-storage|
|c++|qt|qt-creator|
I have recently migrated to vmware geode 9.15.9 from Gemfire 8.2.0. After this migration, our application became terribly slow. The small queries are taking almost twice of more time than the previous version. Also, when a big data is queried to the geode cache, it fails with socket timeout. Any clue on what could hav...
VMWare Geode (Gemfire) is terribly slow after migrating to 9.15.9
|gemfire|geode|geode9.15.9|
How to model such that a drill through for Order suppliers having M:1 relation with Order fact table can be configured?
|powerbi|data-modeling|star-schema|
When fetching a users stats for a game from the steam API using: ``` url = f"http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/" params = { 'appid': self.appid, 'key': apikey, 'steamid': steamid } response = requests.get(url, params=params) ``` If the game isn't owned it return...
Steam API - Available stats when I don't own a game?
|python-requests|steam|steam-web-api|
After following instructions for installing MacOS on VirtualBox, I kept running into errors. This is the one that stumped me. The exact error message is as follows: ```VM Name: BigSur Failed to query SMC value from the host (VERR_INVALID_HANDLE). Result Code: E_FAIL (0X80004005) Component: ConsoleWrap Interf...
I'm a noob to shopware 6 and I have been struggling for a week to add a field to product entity just like admin can add a address in customer overview dynamically. [Customer address detail page] [Modal popup to save address data](https://i.stack.imgur.com/F2iw6.png)][(https://i.stack.imgur.com/2OW4Q.png)] I have...
Creating a modal window in product edit page in Shopware6 and saving data to custom table(repository) from a form within the modal window
|vue.js|plugins|shopware6|administration|
null
My experience trying to make this kind of complicated types is that it rarely ends well, it almost always ends up with types that are pretty difficult to use, so I would instead try to simplify things. It seems like you have two different problems you want to solve: - at least one of text and icon should be present...
# Im trying to instance an object depending the role to set the data, here is my code: ``` <?php // Incluye la definición de las clases CUsuario y CDocente include_once('modelo/CUsuario.php'); include_once('modelo/CDocente.php'); // Verifica si el usuario está autenticado (aquí debes tener tu lógica de autent...
In my App PHP im trying to instance an object depending if the role is teacher or student but i have an error with the object or getting the role. Idk
|php|class|object|get|roles|
null
You are using a modal and the outer `setState` doesn't affect the modal after it's created. (It doesn't trigger a rebuild of a modal.) One solution is to wrap your widget with a `StatefulBuilder` like this: ```dart showModalBottomSheet( context: context, builder: (BuildContext context) { return Statef...
I am automating web scraping using python
|python|selenium-webdriver|web|automation|screen-scraping|
null
I would go for a **lookup array** instead of making edge-cases: So, create a lookup array which contains the **valid** indices. This way you can easily do a normal random on a consecutive array. The selected value is the index you should use on the original array. public class Program { private static Rando...
i created java ee appliation that uses glassfish server 4.1.2, it created just fine, then i created entity classes from database (i'm connecting to a database that has only one table called student) and it also went just fine, the problem appears when i got to the step that says i will create session bean for those ent...
entity classes are not showing when trying to create new session beans for entity classes in netbeans 9.0 (i'm using java 8)
|netbeans|java-8|ejb|java-ee-7|
null
I am wanting to create a status badge for my unit tests, using the following yaml I see examples where its individual steps but not when its layerd out like mine. You will see I have a step named Test below # This workflow will build a .NET project # For more information see: https://docs.github.co...
How do I create a test passing badge for my yaml below
`x` is a pointer to a single `vector`. You need to deference the `x` pointer before you can apply `operator[]` to that `vector`, eg: ``` vector<int> *ans = new vector<int>(); vector<int> *x = new vector<int>(); // put some elements in *x, then... ans->push_back((*x)[i]); ```
I am using this query to randomly select a row in the **user** table that has not already been inserted into the **task_pool** table, laterally done per id in **task_dispersal** table. ____ PostgreSQL 16.2 INSERT into task_pool(user_id, order_id) select u.user_id, task_dispersal.id from task_dispersa...
I am trying to write a personal project in JavaScript. So I started with an empty folder with two files: card.js constants.js and in `card.js`, I used on the first line: import { SUIT } from "./constants.js"; and run it using `node card.js`. It doesn't work, giving the error: > (node:9157...
**You are trying to add a class to an element based on the value of a range slider. there are a couple of issues in your code.** 1. The mousemove event is not suitable for detecting changes in the value of a range slider. you should use the input event. 2. The condition if (this.value == "1", "2", "3", "4", "5") ...
I need to make a separator for new events in my ListView. ListView: return Expanded( child: ListView( physics: const AlwaysScrollableScrollPhysics(), key: ValueKey(selectedProject?.id), controller: _scrollController, children: [ ......
Can this query be optimized? (Choosing a random row to insert, that excludes previously inserted Rows)
|postgresql|
I'm attempting to retrieve data from the database that falls between `$booking_start_formatted` and `$booking_end` based on the `session_start` column. However, it only selects data earlier than `$booking_start_formatted`. ```php public function store(Request $request, Utils $utils) { $request->validate([ ...
Laravel's whereBetween method not working with two timestamps
|php|laravel|timestamp|php-carbon|
In order to assign a Static IP address on your AWS Fargate task, you will have to create a static IP address (AWS calls this elastic IP address) that will serve as the origin address of traffic originating your VPC from network outsiders point of view. To implement this: You need the following - A VPC - 1x Private...
Is there any mechanism to enable/disable "conversation view" programatically in Outlook? I see only four documented conversation-related properties: AlwaysExpandConversation, ShowConversationByDate, ShowConversationSendersAboveSubject, and ShowFullConversations. These all assume that "conversation view" is already a...
I have a trivial application which is using version 3.6.1 of the Quarkus framework. ``` package net.example.dashboard.dbcli; import org.slf4j.*; import io.quarkus.runtime.Startup; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; @Startup @ApplicationScoped public ...
I'm using react-native-maps to create circles on a map. When a user applies a long press and then drags up or down, I dynamically adjust the radius of the circle. However, this approach is causing lagging issues. To mitigate this, I've implemented an animated view circle on the map. Now, the problem I'm facing is th...
# Im trying to instance an object depending the role to set the data, here is my code: ``` <?php // Incluye la definición de las clases CUsuario y CDocente include_once('modelo/CUsuario.php'); include_once('modelo/CDocente.php'); // Verifica si el usuario está autenticado (aquí debes tener tu lógica de autent...
I solved it by cleaning the npm cache ``` npm cache clean --force ``` then delete `node_modules` and `package-lock.json` file and run ``` npm install ```
Using Malvin Lok's answer as a lead, I located `io.netty.handler.codec.http.HttpHeaders` and put a breakpoint for each `set*(..)` and `add*(..)` method. Here's what I found Default headers are added one by one in different places of Netty code. It's hard-coded, there are no injected strategies or configs. There's ap...
Basically, I am trying to remove special character from xml file. I have tried the below code. I have tested with regex tester. It's working fine. In the production machine, it is replacing string.Empty for = character which is valid. ``` using System; using System.Text.RegularExpressions; class Program { s...
i am integrating tailwind with flowbite react but this error occured ``` npm ERR! code 1 npm ERR! path C:\\Users\\ASUS\\OneDrive\\Desktop\\Sankalp\\Frontend\\node_modules\\flowbite-react npm ERR! command failed npm ERR! command C:\\WINDOWS\\system32\\cmd.exe /d /s /c bun run build npm ERR! 'bun' is not re...
I have product dimension, date dimension, Order fact. There is 1:M relation between dimension and fact. This is a simple star schema. In Order fact the OrderNumber column is unique. I want to introduce a new table into the model called Order suppliers. This table has OrderNumber, Supplier name Supplier loca...
Want descending order of data in hive: Requirement: Our requirement is we want to get pnote column in a way that data for particular invoice number should be in descending order. As we want to get the most recent date record from the top of the array (zeroth element) from pnote column. Currect outputs: 1. sel...
Apps script documentation appears to suggest it is possible to copy a table from one slide to another - but I can't seem to get it to work. This is the script I've used - any thoughbts on what I'm doing wrong? Here's a [link][1] to an example of it in "use". ``` /** * @OnlyCurrentDoc */ /* Instructions copied ...
Problem interpreting how to copy / paste tables within a presentation using apps script