instruction
stringlengths
0
30k
Thread-safe lock-free min where both operands can change c++
|c++|thread-safety|atomic|compare-and-swap|bellman-ford|
``` <template> <div class="flex"> <SidebarComponent /> <slot /> </div> </template> <style></style> <script setup lang="ts"> </script> ```
Not sure how your real data looks like, but in the case shown, you could `sub` 19-01 to 19-23, then `-` to `:` and `eval`uate the sequences to `cbind`, i.e. sth like > with(df1, + Map(cbind, + lapply(lapply(sub('-', ':', sub('-01', '-23', time)), str2lang), eval), + t...
Since I updated 2FA in order to put trusted device, I get this error after the login and security code entered: >Key provided is shorter than 256 bits, only 64 bits provided I updated my `User` entity to add: /** * @ORM\Column(type="integer") */ private int $trustedVersion; ... ...
I have a simple android application that I created using xamarin. I want to retrieve information from a specific location in my data base whenever a user press a certain button. I'm using the real time database. Is this possible? I searched online for a few hours but I only found information about how to retrieve d...
My two cents on the issue: Don't know why this happens but I ran the `docker compose up --build` command from my IDE (WebStorm) terminal. Tried: upgrade the docker desktop (to 4.28), add big folders to the `.dockerignore` file. Strangely: It doesn't happen when WebStorm is not running (And I run it from c...
null
for kali linux or oher debian `sudo apt purge code-oss` remove the existing VSCode: ```bash sudo apt-get install wget gpg wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg - dearmor > packages.microsoft.gpg sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/package...
null
> how my default constructor should look like for a char*. You can make a null-terminated array of length one. Also note that you should use *member initializer list* as shown below: ``` //use member iniializer list String():name( new char[1]()) //------------------------^^---->note these parentheses to null t...
I only know that when I add the numbers for a square or rectangle it shows that my shape is a parallellogram
|javascript|if-statement|shapes|
null
**Disclaimer**: This is my first question so any helpful critiques on how to make future ones better is welcome. **My Problem**: I have an expressjs application with a `/CreateShipment` endpoint that takes in json data to create a specific shipment for a clients order. The issue I am running into is the clients have...
Deploying to Heroku: Dynamic Env variables are undefined
|node.js|express|heroku|environment-variables|
Key provided is shorter than 256 bits, only 64 bits provided
|php|symfony|symfony5|
In Ada, it is perfectly possible and reasonable to declare variables in the middle of your function. Just like in all other programming languages (at least Java, C, C++, C#, python) you can make a scope explicitly anywhere: ```pascal declare A : My_Type := Val; begin Use(A); end; ``` which means your ...
My server which is invoked when a user finishes the OAuth consent flow does not contain the full url that the callback is invoked with. Everything after the `#` is removed Callback full url seen in the browser: ```html https://<domain>/google-drive/callback #access_token=<token> &token_type=Bearer&expires_...
I want Nokogiri to return all the divs with the following class: `styled__PostItemWrapper-sc-e4ns84-7` however on my webpage i can see so many divs with this class, here is a sample: [Webpage with divs containing the class](https://i.stack.imgur.com/ekYD2.png) yet when I do this: ` Nokogiri.HTML(res.body).cs...
Nokogiri only returning 5 results
|css|ruby|xpath|nokogiri|
null
The QuestDB implementation of the InfluxDB Line Protocol client supports two different transports: TCP and HTTP. What are the differences between these transports? Is there any guidance available on selecting the appropriate protocol for my use case?
What transports should I use for QuestDB ingestion over the ILP protocol?
|questdb|influx-line-protocol|
Please add a for loop in the JavaScript code. Generate the array only to the current row. ~~~SQL CREATE TEMP FUNCTION conditional_sum(X ARRAY<FLOAT64>) RETURNS FLOAT64 LANGUAGE js as r""" var cur=0; var out=[]; for(let x of X){ cur+=x*1; if(cur<0) cur=0; //out.push(cur) } return cur; ...
As mentioned in the comments of the question, now this issue has been resolved already by `Clang 16` with both `libc++` and `libstdc++` [[LIVE](https://compiler-explorer.com/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAMzwBtMA7AQwFtMQByARg9KtQYEAysib0QXACx8BBAKoBnTAAUAHpwAMvAFYTStJg1DIApACYAQuYukl9ZATwDKjdAGFUtAK4sGe1...
When attempting to convert data obtained from an XML file, stored in a list, into a byte array, I encounter an error. Could someone provide guidance on how to successfully convert this data without encountering errors? ``` private fun convertFileToByteArray(file: File): ByteArray { val inputStream = Bu...
Pandas: Create dtype string (not object) column from single string value without having to cast it
|pandas|dataframe|
|typescript|riot.js|tsd|
Here's what you are missing: String newStr = str.substring(0, i) + str.substring(i + 1); This will skip the character in newStr at index i. The full string (which you sometimes want if you want to insert something at a point in a String) would be String newStr = str.substring(0, i) + st...
By [default][1] Kestrel will listen on a random port between 5000-5300 (7000-7300 for HTTPS). In addition to adding the hostname to the hosts file you need to instruct Kestrel to listen on port 80. Something like this: { // Kestrel "AllowedHosts": "*", "Kestrel": { "Endpoints": {...
I have a function and if statement as below. How I can lower the cognitive complexity? const renderInput = (element, a) => { return ( <Input key={a} name={element.label ? element.label : ''}// Cognitive Complexity type={element.type ? element.type : ''}// Cognitive Complexity ...
How to reduce Cognitive Complexity in a Input field and if condition in reactjs
|cognitive-complexity|
null
I don't have admin rights on my computer, and want to download a extension like vibrancy on my computer. I think there is another extension like it, but I can't find it. I tried downloading it, but you need admin rights for it. SO What should I do? Thank in advance. Faizan
How do you get vibrancy extension on VS code without admin rights?
|vscode-extensions|
null
|active-directory|sas|office365|power-automate|
This works ... =IF(A2="","",IF(AND(B2="IN",C2<=D2),"NORMAL",IF(AND(B2="OUT",E2<=C2),"NORMAL","LATE"))) ... or this ... =IF(A2="","",IF(OR(AND(B2="IN",C2<=D2),AND(B2="OUT",E2<=C2)),"NORMAL","LATE"))
|java|android|
I'm currently training a RNNModel using python darts. For comparing different trained models I want to extract the train_loss and val_loss from the fit method. How would I do this? I've read something about a metric collection but can't figure out how to use it. This is my current code ``` from darts.models im...
This may be an old question but it might be useful for others, so here's a way to achieve this is to use a debouncer. Make the delay to be like 1 second, so if the user is tapping on the button multiple times before 1 second, it will cancel the previous action. So, you only need to locally update the button like/dislik...
use [$match][1] to filter the records you want then use [$group][2] to group by date test it here: [playground][3] ``` db.collection.aggregate([ { "$match": { "source": "here" } }, { "$group": { "_id": "$date", "count": { "$sum": 1 } } }, { ...
I extracted a table from a pdf using pdf_file <- "UBI Kenya paper.pdf" for(i in 59:68) { table_i <- extract_tables(pdf_file, pages = i) tname <- paste0("table_E.", i-58, "_full") assign(tname,table_i) } I didn't use as.data.frame because it returned an error message. Instead I...
Lambda endpoint for the Google OAuth callback does not recieve the access_token
|aws-lambda|oauth|google-oauth|aws-api-gateway|
The callback url that's being received contains a `#` fragment. [These are not sent to the server](https://stackoverflow.com/questions/14462218/is-the-url-fragment-identifier-sent-to-the-server) The reason google is containing the fragment in the URL is because the OAuth Start URL's `response_type` is set to `access...
I was following a tutorial on Web API and I saw the creator creating his service method as nullable `( Task<Comment?> Update(CommentUpdateDto comment) )` and he later used it like following which made sense: ``` [HttpPut("{id:int}")] public async Task<IActionResult> Update([FromRoute] int id, [FromBody] CommentUpd...
You can get list of path of whole device photos/videos by using [photo_manager][1]. For example final List<AssetPathEntity> paths = await PhotoManager.getAssetPathList(); paths.forEach((e){ // Here you can get Path of files }); [1]: https://pub.dev/packages/photo_manager
null
Step 1: Open "CMD"(Administrator) Step 2: `npm install -g json-server@0.17.4` Step 3: `json-server --watch db.json` Sorce: [https://github.com/typicode/json-server/tree/v0][1] [1]: https://github.com/typicode/json-server/tree/v0
|window|nsis|repair|updaters|
I am using Bootstrap responsive table. The problem I am facing here is the text in the table column is overflowing. As per my knowledge the table adjusts the column width automatically if it is responsive. But the problem here is I have a input field inside td and I have a placeholder for that input field. The placehol...
Text overflow in Bootstrap responsive table
|html|css|bootstrap-4|
null
I have this sample dataset of product reviews. I'm trying to get users who rated certain products positively. Ratings are numbers 1-5, 5 being the best and 1 being the worst. [![dataset][1]][1] I tried the following queries: ``` SELECT user, product, rating FROM reviews WHERE user != 1 (product = 173 AND rati...
Which approach is right while creating a service for your update method?
|c#|asp.net|asp.net-mvc|asp.net-core|
null
I found the code below on microsoft that sorts in-text citations into alphabetical order. For example, (Gamma 2019; Beta 2011; Alpha 2009) --> (Alpha 2009; Beta 2011; Gamma 2019). When I run the code I get a "Compile error: Wrong number of arguments or invalid property assignment". ``` Sub AlphaCites() Appl...
VBA query - sort text in alphabetical order in Word
|vba|ms-word|
null
I can't seem to get Log4j2 logging to work. I've read many articles and posts about configuring the log4j2.properties file, yet nothing I've tried works. Here is my `log4j2.properties` file: appender.file.type = File appender.file.name = fileLogger appender.file.fileName=ExampleClass.log appen...
Very simple application of Log4j2 appears to ignore log4j2.properties file
|java|log4j2|apache-commons-logging|
How to dynamically update a selectizeInput?
Here is one possible option using [`cKDTree.query`][1] from [tag:scipy]: ```py from scipy.spatial import cKDTree def knearest(gdf, **kwargs): notna = gdf["PPM_P"].notnull() coordinates = gdf.get_coordinates().to_numpy() dist, idx = cKDTree(coordinates[notna]).query(coordinates[~notna], **kwa...
Although other answers offer great answers as how to include the current directory, I think the *actual* answer to the original question may be in this: Automatically adding current directory to sys.path is the "safepath" concept. But look: > int safepath<br> > ...<br> > Default: 0 in Python config, 1 in isolate...
<link rel="icon" href="https://example.com/wp-content/uploads/2017/11/cropped-smiling-sun-1.png" sizes="32x32" /> <link rel="icon" href="https://example.com/wp-content/uploads/2017/11/cropped-smiling-sun-1.png" sizes="192x192" /> <link rel="apple-touch-icon" href="example.com/wp-content/uploads/2017/11/cropped-smil...
I know this is old but in case it helps someone. Just a clean solution and Rebuild solution fixed this for me
Try it here: https://github.com/Mantano/iridium?tab=readme-ov-file. Currently, there is no implementation for "Highlights/annotations", but it is listed in the to-do list.
I have strings that contain scalars, vectors, and matrices, e.g. "[0,1],[[1,2],[3,4]],42" And following the same example, that input in R should give me this: ``` [[1]] [1] 0 1 [[2]] [,1] [,2] [1,] 1 3 [2,] 2 4 [[3]] [1] 42 ``` So the notation is similar to that of Python where m...
How to read scalar, vector and matrix information in string format resembling Python syntax in R?
|python|r|parsing|matrix|
I'm trying to get information from the **ECU**. The connection works, and I see that the request has been sent but I don't receive any information. Because the application (which is burned in the unit and I work in front of it) checks that the **FD** **flag** exists and therefore I need it. I added the flag but it come...
null
Iam new here for postgresql..I want to know exactly inside how the pages is looks in postgresql- have gone through some of articles like 8KB page but internally to understand quite difficulty but as a newer can some one provide how the page looks like and if anything can simulation exists let Me know I can use it fo...
Data page internal pull information
|postgresql|
null
# Idea In your `for` loop, when you start iterating from index `i`, you actually don't need to fetch all occurrence of high/low hits, but just stop the iteration once the **first hit** (either for high or low) happens at `j` for `j >= i`. Then you refresh your starting point with `i+1` and repeat the process above. ...
[image showing output from below code][1] homes_by_state = df_south.groupby(["state"])["property_type"].value_counts() I want to output only "state" and total number of "property_type" [1]: https://i.stack.imgur.com/DwhmA.png
For Swagger in .NET 6 (possibly earlier), use standard HTML list tags: ``` /// <summary> /// ... /// </summary> /// <param name="...">_some_text_like_"Available Values:" /// <ul> /// <li>item 1</li> /// <li>item 2</li> /// <li>item 3</li> /// <li>...</li> /// </ul> /// </param>...
I have a java Discord bot running JDA Version 5.0.0-beta.20 and lavaplayer version 1.3.77. This bot worked very well, but I decided to update the command system. I created a new branch on my GitHub project to update the system without changing the working bot. After updating the command system (I implemented slash comm...
JDA Lavaplayer bot doesn't work without changing .jar file
|java|discord|bots|lavaplayer|
I need to batch delete from a table filtering from another related table. there can be millions of rows so I use .Take() in a loop - so as not to fill transaction log. I'm getting SqlException: The column 'InvoiceId' was specified multiple times for 't1'. var x = ctx.Invoices.Where(p => p.InvoiceDate <= new Date...
Linq2db batch delete not working for 2 tables
|batch-file|entity-framework-core|linq2db|
null
{"Voters":[{"Id":446594,"DisplayName":"DarkBee"},{"Id":4535200,"DisplayName":"Qirel"},{"Id":272109,"DisplayName":"David Makogon"}],"SiteSpecificCloseReasonIds":[13]}