question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,986,880
how to replace data frame rows containing column names with column labels in R<p>consider my labelled df1 below</p> <p><a href="https://i.stack.imgur.com/4Ndp7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Ndp7.png" alt="enter image description here" /></a></p> <p>This is my second dataframe df2</...
<p>Extract the <code>label</code> from the 'df1' and create a named <code>vector</code> (<code>unlist</code>), then use the named vector in <code>str_replace_all</code> for modifying the 'item' column by matching the <code>key</code> value with the substring in 'item' column</p> <pre><code>library(dplyr) library(string...
how to replace data frame rows containing column names with column labels in R
r|string|dplyr
1
49
1
72,998,134
72,998,134
1
true
2022-07-14T21:35:12.647Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to replace data frame rows containing column names with column labels in R<p>consider my labelled df1 below</p> <p><a href="https://i.stack.imgur.com/4Nd...
72,993,695
add a dot at 3rd position of the string with the help of regex in pandas<p>here is a sample table of the output I got while running this code</p> <pre><code>df['formatted_codes']=df['dx_code'].str.replace(r'(^\w{3}(?!$))',r'\1.',regex=True) </code></pre> <hr /> <div class="s-table-container"> <table class="s-table"> <t...
<p>You need to use</p> <pre class="lang-py prettyprint-override"><code>df['formatted_codes']=df['dx_code'].str.replace(r'\w{3}(?!$)', r'\g&lt;0&gt;.', regex=True) </code></pre> <p>See the <a href="https://regex101.com/r/IRjESY/1" rel="nofollow noreferrer">regex demo</a>.</p> <p>The <code>\w{3}(?!$)</code> regex finds t...
add a dot at 3rd position of the string with the help of regex in pandas
pandas|regex|string|dataframe
1
49
2
72,998,274
72,998,274
1
true
2022-07-15T12:03:25.647Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: add a dot at 3rd position of the string with the help of regex in pandas<p>here is a sample table of the output I got while running this code</p> <pre><code>...
72,996,773
Azure release pipeline, passing variable to power-shell script is not giving desired output<p>In Azure release pipeline (using GUI) I am using an inline PS script task which checks for Folder names and File extensions. The script works if I provide the folders and extensions values directly into <strong>Where-Object</s...
<p>When you pass a pipeline variable into the script the syntax is $(variable_name).</p> <p>Instead of $env:variable_name</p> <p>Here is an example I use to pass pipeline variables into my scripts: <a href="https://i.stack.imgur.com/Ic7bx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ic7bx.png" alt...
Azure release pipeline, passing variable to power-shell script is not giving desired output
powershell|azure-devops|azure-pipelines|powershell-2.0|azure-powershell
1
49
1
72,998,740
72,998,740
1
true
2022-07-15T16:02:45.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure release pipeline, passing variable to power-shell script is not giving desired output<p>In Azure release pipeline (using GUI) I am using an inline PS s...
72,998,231
How are object properties accessed internally?<p>In reference to this question: <a href="https://stackoverflow.com/questions/14612314/how-are-variable-names-stored-in-memory-in-c">How are variable names stored in memory in C?</a></p> <p>It is explained that in C, the compiler replaces variable names from code with actu...
<p>For simple cases and hiding the language lawyer hat:</p> <p><code>obj.prop</code> is <code>*(&amp;obj + &amp;Obj::prop)</code>. The the second part is a member pointer, which is basically the offset of the property inside the object.</p> <p>The compiler can replace that with an absolute address if it knows the addre...
How are object properties accessed internally?
c++|object|oop
0
49
1
73,000,113
73,000,113
1
true
2022-07-15T18:22:38.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How are object properties accessed internally?<p>In reference to this question: <a href="https://stackoverflow.com/questions/14612314/how-are-variable-names-...
73,003,859
Why doesn't my CSS style sheet link to my HTML template?<p>One of my HTML templates that extends the <code>layout.html</code> template has a CSS file linked to it but when I try to style the HTML content through the CSS file, nothing happens even after reloading. There is already a CSS file linked to the <code>layout.h...
<p>some time css file linked properly but it can't update, just try to update your css file using <code>?{% now &quot;U&quot; %}</code> at the end of <code>href</code> like</p> <pre><code>&lt;link href=&quot;{% static 'encyclopedia/new.css' %}?{% now &quot;U&quot; %}&quot; rel=&quot;stylesheet&quot;&gt; </code></pre> <...
Why doesn't my CSS style sheet link to my HTML template?
html|css|django|html-templates
0
49
1
73,004,925
73,004,925
1
true
2022-07-16T11:34:49.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't my CSS style sheet link to my HTML template?<p>One of my HTML templates that extends the <code>layout.html</code> template has a CSS file linked ...
73,005,888
Any idea how this scrolling over scrolling is scripted/made?<p>yesterday I saw the website <a href="https://flare.xyz" rel="nofollow noreferrer">https://flare.xyz</a></p> <p>When scrolling, you can see their transparent logo scrolls above an image, and the image itself is scrolling also, a bit slower. I have no idea ho...
<p>It's simple - just move background on scroll</p> <p>If you want parallax effect - try scrolling by factor 0.9 or smth, it makes background move slowly</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js pr...
Any idea how this scrolling over scrolling is scripted/made?
javascript|php|web|scroll|script
0
49
2
73,007,701
73,007,701
1
true
2022-07-16T16:27:01.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any idea how this scrolling over scrolling is scripted/made?<p>yesterday I saw the website <a href="https://flare.xyz" rel="nofollow noreferrer">https://flar...
73,017,123
Using JSON Element for Relative Path File Load in Python<p>First software job and l inherited a codebase with heavy JSON usage. I'm trying to use Python to load a text file from accessing a JSON element. My relative path understanding is limited but l'm able to load python modules in the same sub directory (not using J...
<p>There are too many errors in your code</p> <p>I assumed your project directory like this</p> <pre><code>. ├── DataPipeLine │   └── example_data.txt ├── cfg.json └── main.py </code></pre> <p>There is the right code example</p> <pre class="lang-py prettyprint-override"><code>import json from pathlib import Path # Get...
Using JSON Element for Relative Path File Load in Python
python|json|file
0
49
1
73,017,323
73,017,323
1
true
2022-07-18T03:50:17.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using JSON Element for Relative Path File Load in Python<p>First software job and l inherited a codebase with heavy JSON usage. I'm trying to use Python to l...
73,013,477
IPFS is a good alternative to save pdf to hyperledger fabric?<p>I am creating a hyperledger network that is already working, it has a chaincode in typescript and an api client written in nodejs, so far the data that I am uploading has a field/value. But at the moment I have the requirement to upload PDF files, doing so...
<p>IPFS is a <a href="https://docs.ipfs.io/concepts/usage-ideas-examples/#blockchain-use-cases" rel="nofollow noreferrer">good fit</a> for storing large data offchain. IPFS files addressed using its hash and thus are immutable. One thing to note is that the data added to IPFS are not encrypted by default. You have to i...
IPFS is a good alternative to save pdf to hyperledger fabric?
hyperledger-fabric|blockchain|hyperledger|ipfs
0
49
1
73,020,285
73,020,285
1
true
2022-07-17T16:23:31.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IPFS is a good alternative to save pdf to hyperledger fabric?<p>I am creating a hyperledger network that is already working, it has a chaincode in typescript...
73,020,756
Escaping strings with readr::read_csv<p>I have a CSV file where numbers are escaped in strings and the decimal mark is a comma. I am reasonably sure that I have used <code>readr::read_cvs</code> to parse such files before, although it is a few years back, but I am running into trouble now. And it mostly looks like &quo...
<p>The problem seems to be the spaces between the commands and the start of the quotes. Does your actual data have those spaces or did you just but them there to try to make things look pretty for the example? This works fine:</p> <pre><code>library(readr) read_csv( 'A,B,C,D,E $1,a,a,&quot; 1,2%&quot;,&quot;1...
Escaping strings with readr::read_csv
r|readr
0
49
1
73,023,678
73,023,678
1
true
2022-07-18T10:21:39.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Escaping strings with readr::read_csv<p>I have a CSV file where numbers are escaped in strings and the decimal mark is a comma. I am reasonably sure that I h...
73,023,636
Correct reading of datetime with AM/PM format<p>I'm trying to read some csv files that contain a column called 'timestamp' with this format: 7/6/2022 7:30:00 PM which should translate to (mm/dd/YYYY hh:mm:ss). What I tried was after reading the csv file using:</p> <pre><code>df['timestamp']= pd.to_datetime(df['timesta...
<p>The <code>format='%m/%d/%Y %I:%M:%S %p'</code> should work, make sure you read your data as string.</p> <p>That said, pandas is advanced enough to figure out the format semi-automatically, the only ambiguity to resolve is to specify that the first digits are not days:</p> <pre><code>df['new_timestamp'] = pd.to_datet...
Correct reading of datetime with AM/PM format
python|pandas|csv
1
49
1
73,023,697
73,023,697
1
true
2022-07-18T14:03:45.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correct reading of datetime with AM/PM format<p>I'm trying to read some csv files that contain a column called 'timestamp' with this format: 7/6/2022 7:30:0...
73,025,513
RETURN 1-7 iso day NUMBER of week in a function<p>I could use a bit of help. I'm trying to CREATE a function that returns 1-7 where 1=Monday, 2=Tuesday… 7=Sunday.</p> <p>I know that 18-JUL-2022 is a Monday and I expect the NUMBER 1 to be returned. Yet I'm getting back 29?</p> <p>How can I CREATE a function that will RE...
<p><code>'iw'</code> in <code>to_char(&lt;date&gt;)</code> is the ISO week number (in the year), not the day number within the ISO week.</p> <p>Unfortunately, for reasons known only to Oracle, they don't offer a simple date function to return the ISO day of the week.</p> <p>As a workaround, the same <code>'iw'</code> o...
RETURN 1-7 iso day NUMBER of week in a function
oracle|function|date
0
49
2
73,025,666
73,025,666
1
true
2022-07-18T16:17:30.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RETURN 1-7 iso day NUMBER of week in a function<p>I could use a bit of help. I'm trying to CREATE a function that returns 1-7 where 1=Monday, 2=Tuesday… 7=Su...
73,006,979
NuxtChild not showing child component<p><a href="https://i.stack.imgur.com/7skBL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7skBL.png" alt="enter image description here" /></a></p> <p>On _collection.vue I have something like</p> <pre class="lang-html prettyprint-override"><code>&lt;div&gt; Th...
<p>Here <code>_category</code> and <code>_collection</code> are at the same level, so it's basically one of them.</p> <p>You cannot have 2 variables at the same time, it's like asking: &quot;what is my variable: X or Y?&quot;.</p> <p>You can have only 1 dynamic page, especially at the same level. If you want to have <c...
NuxtChild not showing child component
vue.js|nuxt.js
1
49
3
73,027,324
73,027,324
1
true
2022-07-16T19:09:19.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NuxtChild not showing child component<p><a href="https://i.stack.imgur.com/7skBL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7skBL.png...
73,028,043
Git equivalent of multiple Perforce work areas<p>I've used Perforce for about 10 years, and now having to switch to Git for a new job.</p> <p>Say I have a recent test regression. The way I would go about debugging it in P4 is create two work areas: one sync'ed to an older CL (with passing test), and one to ToT (top of ...
<ol> <li>Yes, you can have <em>as many</em> clones of single repo, as you want</li> <li>From my POV also, for up-to-date Git using <a href="https://git-scm.com/docs/git-worktree" rel="nofollow noreferrer">worktrees</a> is more efficient and brain-powered way, as @jthill noted</li> <li><a href="https://git-scm.com/docs/...
Git equivalent of multiple Perforce work areas
git|perforce|workspace|p4v
0
49
1
73,028,335
73,028,335
1
true
2022-07-18T20:09:01.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git equivalent of multiple Perforce work areas<p>I've used Perforce for about 10 years, and now having to switch to Git for a new job.</p> <p>Say I have a re...
73,029,752
make useEffect run before render is completed OR an alternative to use Effect<p>I have functions that I want to execute when state changes. But I don't want them to wait until render is completed, since it doesn't depend on the rendered DOM.</p> <p>Is there a way to execute a function when certain dependencies change j...
<p>If the code that you want to execute may call state setters itself, which results in undesirable flickering, you can switch out <code>useEffect</code> for <a href="https://reactjs.org/docs/hooks-reference.html#uselayouteffect" rel="nofollow noreferrer"><code>useLayoutEffect</code></a>, which runs after the DOM mutat...
make useEffect run before render is completed OR an alternative to use Effect
javascript|reactjs|react-native
0
49
1
73,029,803
73,029,803
1
true
2022-07-18T23:58:51.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: make useEffect run before render is completed OR an alternative to use Effect<p>I have functions that I want to execute when state changes. But I don't want ...
72,982,391
How to authenticate both PC and application installed in it with Azure AD<p>I have a desktop where there is an application installed and few applications can be accessed via browser as well. I would like to authenticate one time user login ( that is 1st login to PC) using Azure AD so that same authentication can work f...
<p>You can achieve SSO to cloud resources with <a href="https://docs.microsoft.com/en-us/azure/active-directory/devices/concept-azure-ad-register" rel="nofollow noreferrer">Azure AD registered devices</a> and SSO to both cloud and on-premises resources with <a href="https://docs.microsoft.com/en-us/azure/active-directo...
How to authenticate both PC and application installed in it with Azure AD
azure|azure-active-directory|azure-authentication
0
49
1
73,031,570
73,031,570
1
true
2022-07-14T14:42:28.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to authenticate both PC and application installed in it with Azure AD<p>I have a desktop where there is an application installed and few applications can...
73,017,386
How to construct pymongo query string from dictionary<p>My MongoDB documents looks like <code>{'k1': 'v1', 'k2': 'v2', 'k3': 'v3' . . .}</code></p> <p>Would like to construct a pymongo query string where Keys and Values in maDict are Match, gtDict are greater than and ltDict are less than and display only the fields sp...
<p>Thats how you can create your query:</p> <pre class="lang-py prettyprint-override"><code>query_match = [{k: v} for k, v in maDict.items()] query_gt = [{k: {'$gt': v}} for k, v in gtDict.items()] query_lt = [{k: {'$lt': v}} for k, v in ltDict.items()] query = {&quot;$and&quot;: query_match + query_gt + query_lt} prin...
How to construct pymongo query string from dictionary
python|mongodb|pymongo
0
49
1
73,035,904
73,035,904
1
true
2022-07-18T04:37:06.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to construct pymongo query string from dictionary<p>My MongoDB documents looks like <code>{'k1': 'v1', 'k2': 'v2', 'k3': 'v3' . . .}</code></p> <p>Would ...
72,975,189
How to build a simple spark-test-app.jar to test AWS SageMaker SparkJarProcessing<p>Does anyone know a repo that shows what a simple HelloWorld java or scala code would look like to build the jar that could be executed using the AWS SageMaker <strong>SparkJarProcessing</strong> class?</p> <p>Readthedocs (<a href="https...
<p>To answer your question, the source code of that class looks like:</p> <pre><code>package com.amazonaws.sagemaker.spark.test; import java.lang.invoke.SerializedLambda; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.HelpFormatter; import o...
How to build a simple spark-test-app.jar to test AWS SageMaker SparkJarProcessing
java|amazon-web-services|scala|jar|amazon-sagemaker
0
49
1
73,038,116
73,038,116
1
true
2022-07-14T04:25:45.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to build a simple spark-test-app.jar to test AWS SageMaker SparkJarProcessing<p>Does anyone know a repo that shows what a simple HelloWorld java or scala...
73,028,113
How can I fetch data points belonging to a map bounding box?<p>I am plotting thousands of data points on a map, and at any point I want to fetch the data points falling in a particular map bounding box. <em>For example</em>, attached below is the complete view of the available data points, <a href="https://i.stack.imgu...
<p>You can try using <code>bbox-polygon</code> and <code>boolean-intersects</code> from <code>turf</code>:</p> <ul> <li>Use <code>onViewStateChange</code> from deck instance within a <code>debounce</code> function so it won't be executed too often</li> <li>Create a polygon from the deck <code>viewState</code> using <co...
How can I fetch data points belonging to a map bounding box?
javascript|google-maps|deck.gl
-1
49
1
73,054,714
73,054,714
1
true
2022-07-18T20:14:22.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I fetch data points belonging to a map bounding box?<p>I am plotting thousands of data points on a map, and at any point I want to fetch the data poi...
73,027,890
Change css className of a div with animated transition<p>I am replacing the className of a div with button. But while doing this, I want to do it with animated transition while className change. In the code below, the className is changing, but without animated transition. How can I add the animated transition while cl...
<p>This can be done just by writing some <code>CSS transition</code> in your code. You may do something like this :</p> <pre><code>.containerMore { background-color: #05040f; color: white; height: 220px; width: 220px; border-style: solid; text-align: center; transition-property: background-color, width,...
Change css className of a div with animated transition
css|reactjs|react-hooks
0
49
1
73,065,731
73,065,731
1
true
2022-07-18T19:54:22.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change css className of a div with animated transition<p>I am replacing the className of a div with button. But while doing this, I want to do it with animat...
73,010,849
CreateJS chained animations not reaching target position<p>I am working on a project using Three.js and CreateJS. I have a problem with the animations, moving the same object multiple times. The first animation never reaches the target position, and so the next animations never start.</p> <p>This is the js the code of ...
<p>It looks like you are creating a new tween every single frame. Tweens run their own requestAnimationFrame -- so you should be kicking off the tween one time, and not every frame.</p>
CreateJS chained animations not reaching target position
javascript|three.js|tween|create.js
1
49
1
73,070,304
73,070,304
1
true
2022-07-17T10:00:17.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CreateJS chained animations not reaching target position<p>I am working on a project using Three.js and CreateJS. I have a problem with the animations, movin...
72,979,157
How can I test my openai fine-tuned model against question answering benchmarks?<p>I think the documentation only explains how to use the model through an API but that does not allow much flexibility nor automation.</p>
<p>The general flow of fine tuning Open AI models consists of creating an account, having a valid API key and then uploading the data for fine tuning using the CLI tool, as described here: <a href="https://beta.openai.com/docs/guides/fine-tuning" rel="nofollow noreferrer">https://beta.openai.com/docs/guides/fine-tuning...
How can I test my openai fine-tuned model against question answering benchmarks?
openai
1
49
1
73,083,718
73,083,718
1
true
2022-07-14T10:38:05.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I test my openai fine-tuned model against question answering benchmarks?<p>I think the documentation only explains how to use the model through an AP...
72,806,617
How can I use async in C# to get the result I need from a python script called as a process?<p>I have built a GUI using C# .NET and I need to incorporate a Python script to be called if a checkbox is selected on the panel when the &quot;PROCEED&quot; button is clicked. The python script should run in the background and...
<p>Apart from the issue around returning the result, you should not use blocking functions in async code. Instead use async all the way:</p> <pre class="lang-cs prettyprint-override"><code>async private void proceedClicked() { if (checkBox.Checked) { string cmd = &quot;&quot;; // some python command...
How can I use async in C# to get the result I need from a python script called as a process?
python|c#|asynchronous|async-await
0
49
2
72,808,284
72,808,284
1
true
2022-06-29T19:06:33.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use async in C# to get the result I need from a python script called as a process?<p>I have built a GUI using C# .NET and I need to incorporate a P...
72,984,708
Numpy Delete not deleting rows<p>I've been trying to write some code to delete rows from my 2d array according to the following criteria:</p> <ol> <li>every lone entry, so that no patient only has one entry (the mriindex ticks up by 1 for every entry of the same patient in the array)</li> <li>every entry above the 4th ...
<p>Have a look at your code and check what is happening to <code>new_arr</code> when the next loop itteration starts.</p> <p>The approach you chose however is not very efficient, because you will copy the array every time you call delete. It is better do do it in one shot, something like this:</p> <pre><code># creating...
Numpy Delete not deleting rows
python|arrays|numpy
1
49
1
72,985,322
72,985,322
1
true
2022-07-14T17:48:29.707Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy Delete not deleting rows<p>I've been trying to write some code to delete rows from my 2d array according to the following criteria:</p> <ol> <li>every ...
72,993,789
What memory adress are we referencing to when we use a const reference to an rvalue<p>Consider the follwoing code:</p> <pre><code>int main() { const int&amp; number=10; cout &lt;&lt; number &lt;&lt; endl &lt;&lt; &amp;number &lt;&lt; endl; return 0; } </code></pre> <p>As output I get:</p> <pre><code>10 0x6...
<p>When you wrote:</p> <pre><code>//------------------vv----&gt;10 is a prvalue and temporary materialization will result in an xvalue const int&amp; number = 10; </code></pre> <p><strong>temporary materialization</strong> happens as can be seen from <a href="https://en.cppreference.com/w/cpp/language/implicit_conversi...
What memory adress are we referencing to when we use a const reference to an rvalue
c++|reference|rvalue
0
49
1
72,993,850
72,993,850
1
true
2022-07-15T12:10:05.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What memory adress are we referencing to when we use a const reference to an rvalue<p>Consider the follwoing code:</p> <pre><code>int main() { const int...
72,896,100
Combining one column values in another<p>I have the following dataframe:</p> <pre><code>import pandas as pd array = {'test_ID': [10, 13, 10, 13, 16], 'test_date': ['2010-09-05', '2010-10-23', '2011-09-12', '2010-05-05', '2010-06-01'], 'Value1': [40, 56, 23, 78, 67], 'Value2': [25, 0, 68, 0, 0...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.set_index.html" rel="nofollow noreferrer"><code>DataFrame.set_index</code></a> with <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.stack.html" rel="nofollow noreferrer"><code>DataFrame.stack</...
Combining one column values in another
python|pandas|dataframe
1
49
2
72,896,118
72,896,118
1
true
2022-07-07T10:17:27.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining one column values in another<p>I have the following dataframe:</p> <pre><code>import pandas as pd array = {'test_ID': [10, 13, 10, 13, 16], ...
73,001,655
Canvas ctx.rotate() with very small angles (less than 0.014) not working on Chrome, Edge<p>I just realized that Chrome (Edge too) does not perform canvas rotations <code>ctx.rotate()</code> if the angle is under <code>0.014</code> degrees. It works fine on Firefox (Windows 10).</p> <p>Any ideas for a workaround? I am u...
<p>That's a very weird bug that <a href="https://crbug.com/1345038" rel="nofollow noreferrer">I did report</a> thanks to you, and that Skia's team fixed in the latest Chrome Canary (106.0.5225.0).<br /> Before this patch makes its way to the stable version, or for the ones willing to handle the previous versions of Chr...
Canvas ctx.rotate() with very small angles (less than 0.014) not working on Chrome, Edge
javascript|canvas|rotation
0
49
1
73,002,041
73,002,041
1
true
2022-07-16T05:01:29.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Canvas ctx.rotate() with very small angles (less than 0.014) not working on Chrome, Edge<p>I just realized that Chrome (Edge too) does not perform canvas rot...
72,936,981
Kafka Binder doesn't apply serializer configuration<p>I'm using stream bridge in my app since the topic to send is decided at runtime based on URL path params; I build a message from the Request Body, Path Elements and call stream bridge send to a function for publishing to Kafka</p> <pre><code>@Bean public RouterFunct...
<p>Here's what works for me now.</p> <pre><code>spring: embedded: kafka: brokers: localhost:9092 cloud: stream: kafka: default: producer: useTopicHeader: true binder: autoCreateTopics: false producerProperties: key.serializer:...
Kafka Binder doesn't apply serializer configuration
spring-boot|apache-kafka|spring-cloud|spring-cloud-function
0
49
1
72,939,496
72,939,496
1
true
2022-07-11T10:16:43.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kafka Binder doesn't apply serializer configuration<p>I'm using stream bridge in my app since the topic to send is decided at runtime based on URL path param...
72,883,500
I am trying to give path to the variable so that I can scrape the information contained in that path. But, I m getting empty list<p>I am trying to make web scraper using Python and the basic concept I am using here is,</p> <p>create empty list --&gt; use 'for loop' to loop through the element on the web page. --&gt; ap...
<p>This example will parse <code>name</code>, <code>year</code>, <code>rating</code> from the table and creates a dataframe from it:</p> <pre class="lang-py prettyprint-override"><code>import requests import pandas as pd from bs4 import BeautifulSoup url = &quot;https://www.imdb.com/chart/top/&quot; headers = {&quot;A...
I am trying to give path to the variable so that I can scrape the information contained in that path. But, I m getting empty list
python|html|pandas|web-scraping
0
49
1
72,883,686
72,883,686
1
true
2022-07-06T12:23:17.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am trying to give path to the variable so that I can scrape the information contained in that path. But, I m getting empty list<p>I am trying to make web s...
72,959,098
Is it possible to have an input from a form in a html template be added to the url in a django project?<p>In the sidebar of my homepage, there is a search box where a user is meant to be able to type in the name of an entry and be taken to that page. So for example, if they type in <code>css</code> they would be taken ...
<p>Have your input form post to a new view that retrieves the field value and then redirects to a your wiki entry based on that value</p> <p>html</p> <pre><code>&lt;h2&gt;Wiki&lt;/h2&gt; &lt;form action=&quot;{% url 'wiki-lookup' %}&quot; method=&quot;post&quot;&gt; </code></pre> <p>views.py</p> <pre><code>def wiki-loo...
Is it possible to have an input from a form in a html template be added to the url in a django project?
python|html|django|forms|django-forms
0
49
1
72,959,450
72,959,450
1
true
2022-07-12T22:41:34.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to have an input from a form in a html template be added to the url in a django project?<p>In the sidebar of my homepage, there is a search bo...
72,804,769
How to extract data from complex JSON object?<p>I am trying to extract data from the json file I got from a get request.</p> <pre><code> { &quot;data&quot;: [ { &quot;type&quot;: &quot;Projects&quot;, &quot;id&quot;: &quot;102777c7-50a7-592d-1b65-621d5850a5bb&quot;, &quo...
<p>You can try this, assuming <code>data</code> is your variable for the response from the GET request</p> <pre><code># this solution will populate for all project ids projectids = {} for item in data['data']: projectids[item['attributes']['projectid']] = item['id'] </code></pre> <p>Output:</p> <pre><code>{ '001...
How to extract data from complex JSON object?
python|json
0
49
3
72,804,827
72,804,827
1
true
2022-06-29T16:20:47.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract data from complex JSON object?<p>I am trying to extract data from the json file I got from a get request.</p> <pre><code> { &quot;data&qu...
72,949,240
How to sort matching colums<p>I have a huge database to sort. Basically I have datas from 2 periods. Over the years let's say people joined the database while others leaved.</p> <p>Here is a screenshot :</p> <p><a href="https://i.stack.imgur.com/sAf21.png" rel="nofollow noreferrer">Problem</a></p> <p>How can I come to ...
<p>I think to solve this problem you should use google-script.</p> <p>This is an option using pure google-sheet formula, hopefully can help you somewhat</p> <p><strong>Method 1:</strong></p> <pre><code>=ArrayFormula({INDEX(SPLIT(FILTER(INDEX(QUERY({SPLIT(&quot;2005&quot;&amp;&quot;#&quot;&amp;FILTER(A2:A&amp;&quot;/&qu...
How to sort matching colums
database|sorting|google-sheets|multiple-columns|columnsorting
0
49
1
72,951,223
72,951,223
1
true
2022-07-12T08:29:03.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort matching colums<p>I have a huge database to sort. Basically I have datas from 2 periods. Over the years let's say people joined the database whil...
72,864,282
Rolling quantile over multiple columns<p>Have the following dataframe. How do i perform a rolling 3 window quantile(0.4) which combines values from 2 columns?</p> <pre><code>### Sample Dataframe np.random.seed(0) # Freeze randomness a = pd.DataFrame(np.random.randint(1,10,size=(20, 1)), columns=list('A')) b = pd.DataFr...
<p>Use <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.stack.html" rel="nofollow noreferrer">stack</a> and with rolling quantile</p> <pre><code>df.stack(dropna=False).rolling(window=3*len(df.columns)).\ quantile(0.4)[cols-1::cols].reset_index(-1, drop=True) </code></pre> <p><strong>Dataframe</...
Rolling quantile over multiple columns
python|pandas|dataframe
0
49
2
72,864,959
72,864,959
1
true
2022-07-05T05:12:15.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rolling quantile over multiple columns<p>Have the following dataframe. How do i perform a rolling 3 window quantile(0.4) which combines values from 2 columns...
72,792,980
How to Improve the Performance of this Powershell Code<p>I have a Powershell script which reads a 4000 KB text file (88,500 lines approx) This is the first time I have had my code do this much work. The script below took over 2 minutes to run and consumed around 20% CPU (see Task Manager screenshot below) <a href="http...
<p>If I understand correctly your code, this should do the same but faster and more efficient.</p> <p>Reference documentations:</p> <ul> <li><a href="https://docs.microsoft.com/en-us/dotnet/api/system.io.streamreader?view=net-6.0" rel="nofollow noreferrer"><code>StreamReader</code> Class</a></li> <li><a href="https://d...
How to Improve the Performance of this Powershell Code
powershell|performance
1
49
1
72,793,220
72,793,220
1
true
2022-06-28T20:47:18.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Improve the Performance of this Powershell Code<p>I have a Powershell script which reads a 4000 KB text file (88,500 lines approx) This is the first t...
73,029,684
How to search for a string in multiple text files in an active running log<p>I am trying to search for a string in multiple text files to trigger an event. The log file is being actively added to by a program. The following script successfully achieves that goal, but it only works for one text file at a time:</p> <pre>...
<p>This is how you can apply the <strong>same logic</strong> you already have for one file but for <strong>multiple logs at the same time</strong>, the concept is to spawn as many <a href="https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.powershell.create?view=powershellsdk-7.0.0#system-manageme...
How to search for a string in multiple text files in an active running log
multithreading|powershell|runspace
1
49
1
73,030,069
73,030,069
1
true
2022-07-18T23:43:38.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to search for a string in multiple text files in an active running log<p>I am trying to search for a string in multiple text files to trigger an event. T...
72,955,101
R ggplot2 Add text to label geom_text<p>Based on the function below, how can I add <code>Formula =</code> <code>label = get_formula(model)</code> and <code>R^2(superscript) = </code> <code> label = r_squared</code>?</p> <p>Because when I do:</p> <pre><code>.... label = c(&quot;Formula = &quot;, get_formula(model)) </co...
<p>You need to use <code>paste</code> instead of <code>c</code> to concatenate into a string for the label. For getting the superscript you'll need a bit of unicode (as far as I am aware!):</p> <pre class="lang-r prettyprint-override"><code>p + geom_text(x = 20, y = 300, label = paste0(&quot;Formula = &q...
R ggplot2 Add text to label geom_text
r|ggplot2
0
49
1
72,955,502
72,955,502
1
true
2022-07-12T15:51:14.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R ggplot2 Add text to label geom_text<p>Based on the function below, how can I add <code>Formula =</code> <code>label = get_formula(model)</code> and <code>R...
72,785,888
Preserving formatting (\t) in scraped text - Python Selenium<p>I have a program that takes the text from a website using this following code:</p> <pre><code>import selenium driver = selenium.webdriver.Chrome(executable_path=r&quot;\chromedriver.exe&quot;) def get_raw_input(link_input, website_input, driver): d...
<p>Selenium returns element text in the way how browser renders it. So it typically &quot;normalizes&quot; whitespaces (all inner space symbols turn into a single space).</p> <p>You can see some discussion <a href="https://github.com/SeleniumHQ/selenium/issues/2608" rel="nofollow noreferrer">here</a>. The solution to g...
Preserving formatting (\t) in scraped text - Python Selenium
python|selenium
0
49
1
72,787,948
72,787,948
1
true
2022-06-28T11:50:16.300Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Preserving formatting (\t) in scraped text - Python Selenium<p>I have a program that takes the text from a website using this following code:</p> <pre><code>...
72,834,690
how to create all pairs in a more pythonic way?<p>I have a json like the following:</p> <pre><code>[ [&quot;s5&quot;], [&quot;s7&quot;], [&quot;s9&quot;,&quot;s773&quot;], [&quot;s4&quot;,&quot;s17&quot;] ] </code></pre> <p>I have to create a dictionary like:</p> <pre><code>{ s5_s7 = False s5_s9 = False...
<p>Comparing Zach Flanders solution to a more standard approach which is about 2x time faster. Also his solution (solution b in my exemple) include &quot;duplicate&quot; such as <em>s4_s4</em> and solution a do not.</p> <pre><code>import timeit def solution_a(): items = [ [&quot;s5&quot;], [&quot;s7&quot;], ...
how to create all pairs in a more pythonic way?
python|python-3.x|refactoring|code-cleanup
-1
49
2
72,834,914
72,834,914
1
true
2022-07-01T21:16:46.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create all pairs in a more pythonic way?<p>I have a json like the following:</p> <pre><code>[ [&quot;s5&quot;], [&quot;s7&quot;], [&quot;s9&quot...
73,019,622
Draw a circle behind BadgeBox to make it more visible, circle getting too small<p><strong>My code:</strong></p> <pre><code>IconButton(onClick = { /*TODO*/ }) { BadgedBox( modifier = Modifier.drawBehind { drawCircle( color = Color.LightGray, center = Offset...
<p>You can use something like:</p> <pre><code> BadgedBox( badge = { Badge(modifier = Modifier.size(12.dp)) {} }, ) { val radius = 16.dp val shape = RoundedCornerShape(radius) Box( contentAlignment= Alignment.Center, modifier = Modifier .def...
Draw a circle behind BadgeBox to make it more visible, circle getting too small
kotlin|android-jetpack-compose
0
49
2
73,019,916
73,019,916
1
true
2022-07-18T08:50:43.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Draw a circle behind BadgeBox to make it more visible, circle getting too small<p><strong>My code:</strong></p> <pre><code>IconButton(onClick = { /*TODO*/ })...
73,005,228
Vuex toggle array item boolean value<p>For some reason I can not find a working solution to toggle checkbox of an item from Vuex state array. I got it working to a point where I am able to display todo items, but whenever I try to commit and call a toggle mutation, it doesn't work as expected, nothing changes. If I set...
<p>Try updating the memory reference of the todos array by cloning the <code>state.todos</code> array and deconstructing the todo object.</p> <pre><code>state.todos = state.todos.map((todo) =&gt; ({...todo, done: todoId === todo.id ? !todo.done : todo.done })); </code></pre>
Vuex toggle array item boolean value
vue.js|vuex
1
49
1
73,005,355
73,005,355
1
true
2022-07-16T14:57:45.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vuex toggle array item boolean value<p>For some reason I can not find a working solution to toggle checkbox of an item from Vuex state array. I got it workin...
72,896,382
How to create a dictionnary whose key:value pairs are the values of two different lists of dictionnaries?<p>I have 2 lists of dictionnaries that result from a pymongo extraction.</p> <p>A list of dicts containing id's (string) and lemmas (strings):</p> <p><code>lemmas = [{'id': 'id1', 'lemma': 'lemma1'}, {'id': 'id2', ...
<p>Here's an option with comprehensions:</p> <pre><code>lemmas = [{&quot;id&quot;: &quot;id1&quot;, &quot;lemma&quot;:&quot;lemma1&quot;}, {&quot;id&quot;: &quot;id2&quot;, &quot;lemma&quot;:&quot;lemma2&quot;}, {&quot;id&quot;: &quot;id3&quot;, &quot;lemma&quot;: &quot;lemma3&quot;}] words = [{&quot;id&quot;: &quot;id...
How to create a dictionnary whose key:value pairs are the values of two different lists of dictionnaries?
python|list|dictionary|key-value|lemmatization
-1
49
1
72,896,768
72,896,768
1
true
2022-07-07T10:42:29.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a dictionnary whose key:value pairs are the values of two different lists of dictionnaries?<p>I have 2 lists of dictionnaries that result from ...
72,935,072
Select a group of elements and text using css selectors<p>I have an HTML page like:-</p> <pre class="lang-html prettyprint-override"><code>&lt;div&gt; &lt;a href='link'&gt; &lt;u class&gt;name&lt;/u&gt; &lt;/a&gt; text &lt;br&gt; &lt;a href='link'&gt; &lt;u class&gt;name&lt;/u&gt; &lt;/a&gt; text &lt;br&gt; &lt;a href=...
<p>Scrapy provides a mechanism to <code>yield</code> multiple values on the html page using <code>Items</code>- as items, Python objects that define key-value pairs.</p> <p>You can extract individually and but yield them together as key-value pairs.</p> <ul> <li>to extract value of an attribute of an element, use attr(...
Select a group of elements and text using css selectors
css|scrapy|css-selectors
0
49
2
72,935,828
72,935,828
1
true
2022-07-11T07:29:58.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select a group of elements and text using css selectors<p>I have an HTML page like:-</p> <pre class="lang-html prettyprint-override"><code>&lt;div&gt; &lt;a ...
72,946,583
Converting Pandas column data with np.where() not working as it should<p>I am using np.where() in combination with a Pandas DataFrame to keep the column as-is if it contains the phrase &quot;no restriction&quot;, and make it a float if not. Here is my code:</p> <pre><code>main_df[col] = np.where(main_df[col].str.contai...
<p>The problem is that <code>main_df[col].apply(lambda x: float(x))</code> still converts the whole series, including <code>'no restriction'</code>, which obviously fails and throws that error. You can use <code>pd.to_numeric</code> with <code>errors='coerce'</code> option:</p> <pre><code>main_df[col] = pd.to_numeric(m...
Converting Pandas column data with np.where() not working as it should
python|pandas|numpy
0
49
1
72,946,606
72,946,606
1
true
2022-07-12T03:00:11.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting Pandas column data with np.where() not working as it should<p>I am using np.where() in combination with a Pandas DataFrame to keep the column as-i...
73,005,897
implementing a linked list and it doesn't produce output<p>I am implementing a linked list but it doesn't display any output.</p> <p>implementing a linked list with 4 elements and making fuction insert and insertathead and display.</p> <pre><code>#include &lt;bits/stdc++.h&gt; using namespace std; // class node to mak...
<p>First you want to move <code>insert</code>, <code>insertAtHead</code> and <code>display</code> out of the <code>Node</code> class. These are list functions have have no need of special access to <code>Node</code>.</p> <p>Also you should initialise <code>head</code> to NULL (representing the empty list).</p> <p>This ...
implementing a linked list and it doesn't produce output
c++|linked-list
0
49
1
73,005,920
73,005,920
1
true
2022-07-16T16:27:54.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: implementing a linked list and it doesn't produce output<p>I am implementing a linked list but it doesn't display any output.</p> <p>implementing a linked li...
72,840,594
how to download pdf with nodejs and expressjs<p>I'm using <a href="https://github.com/baptistejamin/node-microinvoice" rel="nofollow noreferrer">this</a> GitHub repo to generate pdf invoices. code looks something like this :</p> <pre><code>let myInvoice = new MicroInvoice({ ... pdf content obj goes here }); const ...
<p>Looking at the code of the library, the <code>.generate()</code> method doesn't return anything, so your <code>file</code> variable will be <code>undefined</code> (I also have no idea what the <code>Buffer.from()</code> is doing…).</p> <p>Instead, you can use <a href="https://expressjs.com/en/4x/api.html#res.attachm...
how to download pdf with nodejs and expressjs
node.js|express|pdfkit
0
49
1
72,840,660
72,840,660
1
true
2022-07-02T16:13:17.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to download pdf with nodejs and expressjs<p>I'm using <a href="https://github.com/baptistejamin/node-microinvoice" rel="nofollow noreferrer">this</a> Git...
73,021,124
Jasmine Unit Test for to check activate route has two parameters and call service function<p>I have a function in my component to get current route parameters and call a function in a service if two parameters are present.</p> <p>Component.ts:</p> <pre><code>listenToRouteParameters(): void { const state = this.rout...
<p>You can do something like this, follow the comments with !!:</p> <pre><code>// !! change the declaration to this !! let cookieService: jasmine.SpyObj&lt;CookieService&gt;; beforeEach(async () =&gt; { // !! add this !! // !! the 2nd argument accepts an array of strings that will // mock the public methods...
Jasmine Unit Test for to check activate route has two parameters and call service function
angular|unit-testing|jasmine
0
49
1
73,022,648
73,022,648
1
true
2022-07-18T10:49:25.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jasmine Unit Test for to check activate route has two parameters and call service function<p>I have a function in my component to get current route parameter...
72,774,587
java - class attribute type change with inheritance<p>I have a MyClass which has an attribute of type MyAttribute. This class is inherited by MySubClass which has an attribute of type MySubAttribute. MySubAttribute is a subclass of MyAttribute :</p> <pre class="lang-java prettyprint-override"><code>class MyClass { ...
<p>You should take a look at <a href="https://docs.oracle.com/javase/tutorial/java/generics/" rel="nofollow noreferrer">Java Generics</a>.</p> <p>Also, you no longer need to define MySubClass unless you wanna add extra methods or properties to it.</p> <pre class="lang-java prettyprint-override"><code>class MyClass&lt;T...
java - class attribute type change with inheritance
java|inheritance|subclass
0
49
4
72,774,667
72,774,667
1
true
2022-06-27T15:22:59.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java - class attribute type change with inheritance<p>I have a MyClass which has an attribute of type MyAttribute. This class is inherited by MySubClass whic...
72,959,982
vue 3 axios cannot add params gives TS2345: Argument of type<p>I am trying to make an axios call but getting an error shown below. Using vue 3/ vite/ typescript for my project. In my IDE params is underlined and highlighted red. The code does work but wont build.</p> <p>My Axios call</p> <pre><code>import axios fro...
<p>The types error you're getting is weird (I can't repro it, using axios <code>0.27.2</code>).</p> <p>You might want to create a <em>runnable</em> mcve on codesandbox.io or similar.</p> <hr /> <p>However, <code>withCredentials</code> is an AxiosRequestConfig member, it doesn't go inside <code>params</code>:</p> <pre c...
vue 3 axios cannot add params gives TS2345: Argument of type
reactjs|typescript|vue.js|axios|vuejs3
0
49
1
72,960,077
72,960,077
1
true
2022-07-13T01:31:27.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vue 3 axios cannot add params gives TS2345: Argument of type<p>I am trying to make an axios call but getting an error shown below. Using vue 3/ vite/ typesc...
72,938,922
I am new to .batch file and I am trying to Develop a time converter<p>So I have come up with this one. What do I have to change?</p> <pre><code>@echo off :U echo ****************** Time Converter! ****************** set /p HOUR= Please Enter the Hours: set /p MIN= Plese Enter the Minutes: if %hr% geq 12 (Set time...
<p>As a courtesy, here's a more robustly coded example of your task, to cater for the many issues your code could have caused. I will leave it for you to review, research, and try to learn from.</p> <pre class="lang-bash prettyprint-override"><code>@Echo Off SetLocal EnableExtensions DisableDelayedExpansion Echo *****...
I am new to .batch file and I am trying to Develop a time converter
batch-file
-1
49
2
72,940,522
72,940,522
1
true
2022-07-11T12:52:52.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am new to .batch file and I am trying to Develop a time converter<p>So I have come up with this one. What do I have to change?</p> <pre><code>@echo off :U...
72,929,658
Not receiving the response of 400 using axios<p>This code is from my controller,</p> <pre><code>public function login(Request $request) { $credentials = [ 'email' =&gt; $request-&gt;email, 'password' =&gt; $request-&gt;password ]; if (Auth::attempt($credentials)) { $user = Auth::use...
<p>you need a <code>.catch()</code> here like this:</p> <pre><code>const login = async () =&gt; { await axios.post(&quot;/api/login&quot;, form) .then((response) =&gt; { // Handle API success logic here if (response.data.success) { console.log(response.data.message); ...
Not receiving the response of 400 using axios
laravel|axios
1
49
1
72,929,757
72,929,757
1
true
2022-07-10T15:28:10.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not receiving the response of 400 using axios<p>This code is from my controller,</p> <pre><code>public function login(Request $request) { $credentials = ...
72,956,451
I want to spend more time on splash images<p><strong>I want to spend more time on splash images I want to set the time of the splash image Splash image only appears for 1 second and then white screen. I want the first loading screen to appear only as splash image</strong> This is my app,js file. Please add the code her...
<p>I have fixed this code for you!</p> <pre><code>import React, { useRef, useState, useCallback, useEffect } from 'react'; import { View, BackHandler, Platform, StyleSheet, ActivityIndicator, } from 'react-native'; import { WebView } from 'react-native-webview'; const DELAY_BEFORE_WEBVIEW = 10; // &lt;--- se...
I want to spend more time on splash images
react-native|webview
0
49
1
72,957,202
72,957,202
1
true
2022-07-12T17:48:10.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to spend more time on splash images<p><strong>I want to spend more time on splash images I want to set the time of the splash image Splash image only ...
72,942,375
How do I make a responsive margin which grows larger for larger screen sizes?<p>I want a margin which will be close to 0% on small screen sizes and around 20% on large ones without using @media queries to force specific numbers for all specific screen sizes.</p> <p>What I am imagining is some math equation that will tu...
<p>I would use the CSS <code>clamp()</code> function. Set the minimum to 0 and the max to 20vw (equals 20% width of the viewport). Then calculate the average value with the max value - a certain pixel value (play around with it):</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babe...
How do I make a responsive margin which grows larger for larger screen sizes?
html|css|responsive-design|margin
0
49
1
72,942,581
72,942,581
1
true
2022-07-11T17:21:41.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make a responsive margin which grows larger for larger screen sizes?<p>I want a margin which will be close to 0% on small screen sizes and around 20...
72,803,090
Argparse: How to create the equivalent of const with nargs='*'<p>Is there a way to produce the equivalent of <code>const</code> (that we can use with <code>nargs='?'</code>, see <a href="https://stackoverflow.com/questions/15301147/python-argparse-default-value-or-specified-value">reference question here</a> for an exa...
<p>You can use a custom <a href="https://docs.python.org/3/library/argparse.html#action" rel="nofollow noreferrer"><code>action</code></a> to achieve this outcome:</p> <pre class="lang-py prettyprint-override"><code>import argparse p = argparse.ArgumentParser() class customAction(argparse.Action): &quot;&quot;&qu...
Argparse: How to create the equivalent of const with nargs='*'
python|argparse
2
49
1
72,803,343
72,803,343
1
true
2022-06-29T14:26:33.603Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Argparse: How to create the equivalent of const with nargs='*'<p>Is there a way to produce the equivalent of <code>const</code> (that we can use with <code>n...
72,928,712
Simple PHP code is not working. Whats the reason?<p>Just to understand how PHP works in some situations: Why this code is not working?</p> <pre><code>&lt;?php class MyCustomClass { ?&gt; &lt;?php function hello_world() { return &quot;Hello World&quot;; } } ?&gt; </code></pre> <p>Error: <code>syntax error, unexp...
<p>You can NOT break up a class definition into multiple files. You also can NOT break a class definition into multiple PHP blocks, unless the break is within a method declaration. The following will not work:</p> <pre><code>&lt;?php class MyCustomClass { ?&gt; &lt;?php function hello_world() { return &quot;Hello...
Simple PHP code is not working. Whats the reason?
php
-1
49
1
72,929,432
72,929,432
1
true
2022-07-10T13:09:03.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple PHP code is not working. Whats the reason?<p>Just to understand how PHP works in some situations: Why this code is not working?</p> <pre><code>&lt;?ph...
72,920,426
Combine boolean and integer logic in linear arithmetic using the Z3 Solver?<p>I would like to solve problems combining <strong>boolean</strong> and <strong>integer</strong> logic in linear arithmetic with a SAT/SMT solver. At first glance, Z3 seems promising.</p> <p>First of all, <strong>is it at all possible to solve ...
<p>Yes, SMT solvers are quite good at solving problems of this sort. Your problem can be expressed using z3's Python interface like this:</p> <pre class="lang-py prettyprint-override"><code>from z3 import * x, y, z = Ints('x y z') A, B, C = Bools('A B C') solve (Or(3*x + y - 2*z &gt;= 10 , And(A, Or(Not(B), C)...
Combine boolean and integer logic in linear arithmetic using the Z3 Solver?
logic|z3|smt|sat
0
49
1
72,924,226
72,924,226
1
true
2022-07-09T09:54:50.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine boolean and integer logic in linear arithmetic using the Z3 Solver?<p>I would like to solve problems combining <strong>boolean</strong> and <strong>i...
72,938,525
How to unite rows by same date?<p>I have this table <a href="https://i.stack.imgur.com/MhN8M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MhN8M.png" alt="Table 1" /></a></p> <p>I want to create a query that will return data in the following format: date (just a day), sms_number, etc...</p> <p>So I...
<p>Try the following:</p> <pre><code>select DATE_FORMAT(date_,'%Y-%m-%d') AS date_, count(date_) as sms_number from sms_logs group by DATE_FORMAT(date_,'%Y-%m-%d') order by date_ DESC </code></pre> <p>See a <code>MySQL</code> demo from <a href="https://www.db-fiddle.com/f/eDAQv7AhWkpm7Na3HkUq2P/1" rel="nofollow nor...
How to unite rows by same date?
sql
0
49
1
72,939,214
72,939,214
1
true
2022-07-11T12:22:24.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to unite rows by same date?<p>I have this table <a href="https://i.stack.imgur.com/MhN8M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.c...
72,973,072
How to use PIVOT to separate values into different columns without duplication or NULL values<p>I currently have the three tables below:</p> <p>Table <strong>#Name</strong></p> <pre><code>Name_id NameValue ========== ============= 50 Hannah 51 Jeremy 52 Luna </code></pre> <p>Table <stro...
<p>Assuming <code>Name_id, AttributeValue_id</code> is a key (e.g. you don't have cases where a person might have two values for <code>PhoneNumber</code> - or those cases exist but you don't care which one you get), the simplest way is to just wrap your <code>CASE</code> expressions with conditional aggregation:</p> <p...
How to use PIVOT to separate values into different columns without duplication or NULL values
sql|sql-server|pivot
0
49
2
72,973,331
72,973,331
1
true
2022-07-13T21:59:32.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use PIVOT to separate values into different columns without duplication or NULL values<p>I currently have the three tables below:</p> <p>Table <strong...
72,832,054
Quiver plot arrows using Matplotlib<p>I am trying to make a quiver plot using the list <code>I4</code>. In <code>I4[0]</code>, <code>(0,0)</code> and <code>(1,0)</code> represent the starting position and the direction of the arrow respectively. However, the current output doesn't match the expected one. I attach both ...
<p>Alternatively, you could use <code>plt.arrow</code> (doc <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.arrow.html" rel="nofollow noreferrer">here</a>):</p> <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt I4 = [(0, 0),(1, 1),(0, 1), (0, 1)] dI4=[(1,0),(0,-1),(1,0...
Quiver plot arrows using Matplotlib
python|matplotlib
0
49
2
72,832,377
72,832,377
1
true
2022-07-01T16:13:54.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Quiver plot arrows using Matplotlib<p>I am trying to make a quiver plot using the list <code>I4</code>. In <code>I4[0]</code>, <code>(0,0)</code> and <code>(...
72,885,702
How can I split a string on integer-comma substrings?<p>I want to split a string by commas but only with a number before comma. The number must be present in result groups.</p> <p>It works fine until input string contains a comma without a number before, this comma should be a part of value group.</p> <p>What should i ...
<p>You could do this with just one regex, and <code>matchAll</code>:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const regex = /\s*,?\s*(?&lt;value&gt;.+?)\s+(?&lt;key&gt;\...
How can I split a string on integer-comma substrings?
javascript|regex|string|split
1
49
1
72,885,840
72,885,840
1
true
2022-07-06T14:52:28.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I split a string on integer-comma substrings?<p>I want to split a string by commas but only with a number before comma. The number must be present in...
72,800,568
Compute mean on data frame columns for specific rows selected from list elements in R<p>I would like to obtain the mean of a data frame column considering only the rows selected by a list with different elements. My data looks like this:</p> <p>I have a list of genesets with gene names (<code>A</code>,<code>B</code>,<c...
<p>Try this using base R</p> <pre><code>l &lt;- lapply(mylist , \(x) lapply(subset(mydataframe , mydataframe$name %in% x)[2:3] , mean)) df &lt;- do.call(rbind , l) </code></pre> <ul> <li>output</li> </ul> <pre><code> first_value second_value first_set 0.5958386 0.307204 second_set 0.4836385 0.57227...
Compute mean on data frame columns for specific rows selected from list elements in R
r|list|dataframe
2
49
4
72,800,843
72,800,843
1
true
2022-06-29T11:23:36.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compute mean on data frame columns for specific rows selected from list elements in R<p>I would like to obtain the mean of a data frame column considering on...
72,834,172
API Integration across multiple accounts within same organization<p>I have had my API Integration promoted to my Production environment for a few weeks now and all is well but I ran into a new issue that I need help understanding. The process is setting up impersonation. The hierarchy of the organization is relatively ...
<p>You have two choices for accessing data in Company B (Account B):</p> <ol> <li>Add the user in Company A (Account A) to also be a user in Account B. (Users can have <code>memberships</code> in more than one account.)</li> <li>To access the data in Account B (Company B), impersonate a (different) user who is in accou...
API Integration across multiple accounts within same organization
docusignapi
1
49
1
72,861,544
72,861,544
1
true
2022-07-01T20:05:31.527Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: API Integration across multiple accounts within same organization<p>I have had my API Integration promoted to my Production environment for a few weeks now a...
72,969,473
Redux with redux toolkit: UI is not changing<p>I'm new to redux and redux toolkit in React.js. Trying my best to make my PET project to apply for a future job, but faced a problem. I'll try to describe it.</p> <p>Firstly, the code. <strong>removeInvoice</strong> function in invoice-slice.js file:</p> <pre><code>import ...
<p>The problem is that you're using the constant INVOICE_LIST to map your elements instead of the current state of the store.</p> <p>You used INVOICE_LIST to initialize your slice, that's good. But then you did not use what you initialized, you simply used the constant, and that's why the UI remained constant.</p> <p>Y...
Redux with redux toolkit: UI is not changing
javascript|reactjs|redux|redux-toolkit
2
49
2
72,969,652
72,969,652
1
true
2022-07-13T16:15:36.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redux with redux toolkit: UI is not changing<p>I'm new to redux and redux toolkit in React.js. Trying my best to make my PET project to apply for a future jo...
72,825,132
How to properly indent (align) overflown row`s label ? - (Ant Design Table, Tree Data)<p>I am building a custom component where I am using the table component provided by Ant Design. For most of the parts, everything works as expected, however, there is a &quot;tiny&quot; issue.</p> <p>I am using the &quot;tree-data&qu...
<p>You can apply display 'flex' to the column</p> <pre><code>// index.css .name-column { display: flex; } // demo.js // column ... ... ... { title: &quot;Name&quot;, dataIndex: &quot;name&quot;, key: &quot;name&quot;, className: 'name-column' }, ... ... ... </code></pre>
How to properly indent (align) overflown row`s label ? - (Ant Design Table, Tree Data)
css|reactjs|web|frontend|antd
0
49
1
72,834,300
72,834,300
1
true
2022-07-01T06:22:14.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly indent (align) overflown row`s label ? - (Ant Design Table, Tree Data)<p>I am building a custom component where I am using the table componen...
72,771,768
DynamoDB Model Chronological Shipment Update Data<p>I recently just started learning about DynamoDB single table design. Now, I am trying to model Shipment Update data that has the following properties:</p> <ul> <li>an account has multiple users</li> <li>an account has multiple shipments</li> <li>a shipment can change ...
<p>A single-table design is a good fit for these access patterns. Use overloadable, <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-modeling-nosql-B.html" rel="nofollow noreferrer">generic key names</a> like PK and SK. Here is one approach<sup>*</sup>:</p> <p>Shipments have a &quot;curren...
DynamoDB Model Chronological Shipment Update Data
nosql|amazon-dynamodb|amazon-dynamodb-data-modeling
0
49
1
72,782,022
72,782,022
1
true
2022-06-27T12:02:41.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DynamoDB Model Chronological Shipment Update Data<p>I recently just started learning about DynamoDB single table design. Now, I am trying to model Shipment U...
72,894,553
How to get only necessary <div> with BeautifulSoup<p>I need to parse some information about writers with <code>BeautifulSoup</code> from wikidata.</p> <p>Page: <a href="https://www.wikidata.org/wiki/Q39829" rel="nofollow noreferrer">https://www.wikidata.org/wiki/Q39829</a></p> <p><strong>Problem</strong></p> <p>I need ...
<p>You are so close to your goal - simply change the class to <code>wikibase-statementview-mainsnak</code> that is more specific:</p> <pre><code>soup.find('div', id='P40').find_all('div', class_='wikibase-statementview-mainsnak') </code></pre> <p>As alternative you could use <code>css selectors</code> for short hand:</...
How to get only necessary <div> with BeautifulSoup
python|web-scraping|beautifulsoup
2
49
1
72,895,735
72,895,735
1
true
2022-07-07T08:25:35.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get only necessary <div> with BeautifulSoup<p>I need to parse some information about writers with <code>BeautifulSoup</code> from wikidata.</p> <p>Pag...
72,898,625
Is there a way to call Macro-Precision in Hugging Face Trainer?<p>I'm currently making tests on the DEFT-2015 dataset using Hugging Face models. I would like to compare my results to what has been done.</p> <p>I checked in the <code>list_metrics</code> method from the <code>datasets</code> library, but I did not see Ma...
<p>The <code>huggingface</code> library (version <code>4.20.0</code>) seems to depend behind the curtains calls to scikit-learn library.</p> <p>If you just use (without using <code>scikit-learn</code>):</p> <pre><code>from datasets import load_metric metric = load_metric(&quot;precision&quot;) precision = metric.comput...
Is there a way to call Macro-Precision in Hugging Face Trainer?
nlp|huggingface-transformers|huggingface-datasets
2
49
1
72,919,716
72,919,716
1
true
2022-07-07T13:22:00.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to call Macro-Precision in Hugging Face Trainer?<p>I'm currently making tests on the DEFT-2015 dataset using Hugging Face models. I would like...
72,770,780
Extract Rows from different df`s<p>So I'm trying to extract the number of rows from two datasets that are between -20 to -15 and between -15 to -5 and between -5 and 5.</p> <p>eg. the dfne dataframe</p> <pre><code> Latitude Longitude Altitude Value O18nd 0 30.0 -30.0 0.0 -3.776897 ...
<p>The first strategy i thought of is just to perform filtering using <code>pandas.query</code> method.</p> <pre><code>dfn = dfne.query('O18nd &gt;= -20').query('O18nd &lt;= -10') ['O18nd'].count() </code></pre> <p>In this example, you get count values for the interval [-20 , -10].</p> <p>You can automatize the procedu...
Extract Rows from different df`s
python|pandas|numpy
0
49
1
72,771,630
72,771,630
1
true
2022-06-27T10:42:43.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract Rows from different df`s<p>So I'm trying to extract the number of rows from two datasets that are between -20 to -15 and between -15 to -5 and betwee...
72,955,622
how should i use Emmet abbreviation in July update of VS code for windows 11<p>Emmet abbreviation for shift + 1 ! not providing boilerplate code for HTML for windows 11 for July update (June 2022 (version 1.69)) of vs code .for previous May update (May 2022 (version 1.68))its working fine .</p>
<p><a href="https://stackoverflow.com/a/72955877/19530650">Gustavo</a> has linked to Github issue currently affecting all users.</p> <p>Open VS Code Settings. Type 'Emmet' in the searchbox. Among the settings listed below, ensure <code>Emmet: Trigger Expansion On Tab</code> checkbox is ticked. Create any html file. Pre...
how should i use Emmet abbreviation in July update of VS code for windows 11
emmet
1
49
1
72,958,539
72,958,539
1
true
2022-07-12T16:35:19.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how should i use Emmet abbreviation in July update of VS code for windows 11<p>Emmet abbreviation for shift + 1 ! not providing boilerplate code for HTML f...
72,830,641
Table header is being deleted when deleting row from table<p>When I am deleting row from my table, also the table header is being deleted, how I can fix this?</p> <pre><code>$('#clubs tbody').on('click', '.deleteBtn', function() { $(this).closest('tr').remove(); }); </code></pre> <p>Button tag</p> <pre class="lang...
<pre><code>$(document).ready(function() { $('#select2-3').change(function() { var cc = $('#select2-3').val(); var ids = []; for (let i = 0; i &lt; cc.length;i++){ ids.push(cc[i]); } $.ajax({ type: &quot;POST&quot;, ...
Table header is being deleted when deleting row from table
javascript|jquery|dom|jquery-select2
0
49
1
72,830,856
72,830,856
1
true
2022-07-01T14:17:48.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Table header is being deleted when deleting row from table<p>When I am deleting row from my table, also the table header is being deleted, how I can fix this...
72,872,677
Is it possible to automatically get a list of parameters defined in a query string using SqlClient<p>I am working on a C# project that takes parameterized queries and saves them - then executes them on a schedule and emails out results (if any records are returned).</p> <p>I am using the <code>System.Data.SqlClient</co...
<p>Not in SqlClient, as it has no data type information about the parameters. But SQL Server can infer parameter types from the column comparison expressions they are used in.</p> <p>So check out the system stored procedure <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-...
Is it possible to automatically get a list of parameters defined in a query string using SqlClient
.net|sql-server|sqlclient
0
49
2
72,872,763
72,872,763
1
true
2022-07-05T16:22:02.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to automatically get a list of parameters defined in a query string using SqlClient<p>I am working on a C# project that takes parameterized qu...
72,781,085
Do javascript/react have double arrow operator inside array?<p>I have array like this:</p> <pre><code>const arr2 = [ one =&gt; { 'Hello'; }, two =&gt; { 'Answer'; }, three =&gt; { 'LOREM IPSUM'; }, ]; </code></pre> <p>If javascript have arrow operator inside array then how ca...
<pre><code>const arr2 = [ one =&gt; { 'Hello'; }, two =&gt; { 'Answer'; }, three =&gt; { 'LOREM IPSUM'; }, ]; </code></pre> <p>The one above is basically an array of arrow functions.</p> <p>so if you do <code>arr2[0]</code> it will print</p> <pre><code>one =&gt; { 'Hell...
Do javascript/react have double arrow operator inside array?
javascript|arrays|react-native
1
49
1
72,781,155
72,781,155
1
true
2022-06-28T05:22:11.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do javascript/react have double arrow operator inside array?<p>I have array like this:</p> <pre><code>const arr2 = [ one =&gt; { 'Hello'; }, ...
72,922,675
Google S2 Geometry: polygon contains check does not work as expected<p>I'm using the <a href="https://github.com/google/s2geometry" rel="nofollow noreferrer">Google S2 Geometry library</a> to check whether a given geo point is within a polygon.</p> <p>The following assertion should pass, but is failing and I'm unable t...
<p>S2 uses geodesic edges, so the loop is not just a rectangle on a flat map, but the &quot;horizontal&quot; edges are curved towards the poles following the shortest path on spherical Earth. For small distances, the difference from planar maps are negligible, but for huge distances like here the shortest path is quite...
Google S2 Geometry: polygon contains check does not work as expected
c++|geometry|s2
0
49
1
72,946,528
72,946,528
1
true
2022-07-09T15:34:21.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google S2 Geometry: polygon contains check does not work as expected<p>I'm using the <a href="https://github.com/google/s2geometry" rel="nofollow noreferrer"...
72,771,544
Pandas unusual groupby<p>I need an unusual group by in a huge dataframe. I simplified the df for the purpose of clarity. Is it possible to group by years including the last visible december date of previous year as part of the next year, but also including this date as part of the actual year?</p> <pre><code>data = {'d...
<p>IIUC, you can use a <code>pivot</code> after duplicating the last date of each year:</p> <pre><code>d = pd.to_datetime(df['date']) out = (pd .concat([df.assign(year=d.dt.year), df[df.groupby(d.dt.year, as_index=False).cumcount(ascending=False).eq(0) &amp; d.dt.month.eq(12) ].assig...
Pandas unusual groupby
python|pandas|pandas-groupby
0
49
1
72,771,625
72,771,625
1
true
2022-06-27T11:45:15.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas unusual groupby<p>I need an unusual group by in a huge dataframe. I simplified the df for the purpose of clarity. Is it possible to group by years inc...
72,807,103
Function is not called when button is clicked but works fine in console<p>I am trying to call a function with a specific parameter when button is clicked but it just won't work. Functions playRock and playRound work when tested in console but not with event listener. Please let me know what the problem is, I spent 8h t...
<p>In functions, when you <strong>return</strong> something, that is just passing that data to the caller of that function. It doesn't show it to the user.</p> <p>In the below example, the user will not have any clue that aa was returned as it isn't being shown or alerted in anyway.</p> <pre><code>function test(){ r...
Function is not called when button is clicked but works fine in console
javascript
0
49
1
72,807,202
72,807,202
1
true
2022-06-29T19:52:28.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function is not called when button is clicked but works fine in console<p>I am trying to call a function with a specific parameter when button is clicked but...
72,811,162
How can I send the output of an AWK script to a file?<p>Within an AWK script, I'm needing to send the output of the script to a file while also printing it to the terminal. Is there a nice and tidy way I can do this without having a copy of every print redirect to the file?</p> <p>I'm not particularly good at making SS...
<p>The command to duplicate streams is <code>tee</code>, and we can use it inside awk:</p> <pre><code>awk ' BEGIN {tee = &quot;tee out.txt&quot;} {print | tee}' in.txt </code></pre> <ul> <li><p>This invokes <code>tee</code> with the file argument <code>out.txt</code>, and opens a stream to this command.</p> </l...
How can I send the output of an AWK script to a file?
awk
0
49
3
72,811,416
72,811,416
1
true
2022-06-30T06:26:31.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I send the output of an AWK script to a file?<p>Within an AWK script, I'm needing to send the output of the script to a file while also printing it t...
72,393,547
Django "NoReverseMatch: Reverse for 'ads.views.AdListView' not found" while doing Test<p>I implemented some tests to check the status code of some pages, but this one with the reverse function throws me the error: <strong>django.urls.exceptions.NoReverseMatch: Reverse for 'ads.views.AdListView' not found. 'ads.views.Ad...
<p>Since you use an <code>app_name=…</code> in your <code>urls.py</code>, you need to specify this as a namespace in the name of the view, so <code><b>ads:</b>ad_detail</code>, and specify a primary key:</p> <pre><code>resp = self.client.get(reverse('<strong>ads:</strong>ad_detail'<strong>, kwargs={'pk': 42}</strong>))...
Django "NoReverseMatch: Reverse for 'ads.views.AdListView' not found" while doing Test
python|django|django-urls|django-testing|django-url-reverse
1
49
1
72,393,576
72,393,576
1
true
2022-05-26T14:36:22.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django "NoReverseMatch: Reverse for 'ads.views.AdListView' not found" while doing Test<p>I implemented some tests to check the status code of some pages, but...
72,326,217
Reason for Solace CLIENT_CLIENT_DISCONNECT<p>Recently some of the microservice AMQP applications are disconnected based on the solace event logs. However, the microservice AMQP applications did not detect any &quot;CONNECTION_CLOSE&quot; event. And, the applications did not trigger DISCONNECT action.</p> <p>Is there an...
<p>See the discussion on this in the Solace Developer Community at <a href="https://solace.community/discussion/1342/reason-for-solace-client-client-disconnect" rel="nofollow noreferrer">https://solace.community/discussion/1342/reason-for-solace-client-client-disconnect</a></p>
Reason for Solace CLIENT_CLIENT_DISCONNECT
kubernetes|amqp|solace
1
49
1
72,393,928
72,393,928
1
true
2022-05-21T02:20:35.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reason for Solace CLIENT_CLIENT_DISCONNECT<p>Recently some of the microservice AMQP applications are disconnected based on the solace event logs. However, th...
72,398,333
difference between this.$root.$on and this.$root.$emit<p>I don't understand when should this be used <code>this.$root.$on('text', this.method);},</code> and what is meant by <code>$root</code> and <code>$on</code></p> <p>also its difference with <code>this.$root.$emit</code> isn't clear for me</p>
<p><code>$root</code> is your vue app. <code>$on</code> are your event listeners. <code>$emit</code> is the event emitter method</p> <p>so if you define <code>this.$root.$on('foo' (arg)=&gt;console.log(arg))</code> and then emit <code>this.$root.$emit('foo', 'emitted event foo')</code></p> <p>console will print <code>e...
difference between this.$root.$on and this.$root.$emit
javascript|vue.js
0
49
1
72,398,453
72,398,453
1
true
2022-05-26T21:43:39.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: difference between this.$root.$on and this.$root.$emit<p>I don't understand when should this be used <code>this.$root.$on('text', this.method);},</code> and ...
72,331,418
Facing relation "base_post" does not exist LINE 1: ..., "base_post"."featured", "base_post"."slug" FROM "base_post... issue. Can anybody help me?<p>Recently, I'm working with my Django Portfolio and after successfully deploying on Heroku I faced this error</p> <pre><code>LINE 1: ..., &quot;base_post&quot;.&quot;feature...
<p>I guess it works on your computer,but not in heroku. It may be problem with data base. Try to <code>makemigrations</code> and <code>migrate</code>. Check that this base post is exist in data base in development. You could try to add some exception in html, like:</p> <pre><code>{% if posts %} {% for post in posts...
Facing relation "base_post" does not exist LINE 1: ..., "base_post"."featured", "base_post"."slug" FROM "base_post... issue. Can anybody help me?
python|django|heroku|deployment
1
49
1
72,331,498
72,331,498
1
true
2022-05-21T16:32:15.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Facing relation "base_post" does not exist LINE 1: ..., "base_post"."featured", "base_post"."slug" FROM "base_post... issue. Can anybody help me?<p>Recently,...
72,256,729
MSVC - expression must have pointer-to-object type but it has type "float" on generic array?<p>MSVC on Visual Studio 2019 says &quot;expression must have pointer-to-object type but it has type &quot;float&quot; on generic array&quot; here:</p> <pre><code>void _stdcall sample::Eff_Render(PWAV32FS SourceBuffer, PWAV32FS ...
<p>Change this:</p> <pre><code> (*DestBuffer)[ii][0] = (*SourceBuffer)[ii][0] * gain; (*DestBuffer)[ii][1] = (*SourceBuffer)[ii][1] * gain; </code></pre> <p>To this:</p> <pre><code> DestBuffer[ii][0] = (SourceBuffer[ii][0]) * gain; DestBuffer[ii][1] = (SourceBuffer[ii][1]) * gain; </code></pre> <p>Explana...
MSVC - expression must have pointer-to-object type but it has type "float" on generic array?
c++|pointers|multidimensional-array|typedef|implicit-conversion
-1
49
2
72,256,803
72,256,803
1
true
2022-05-16T09:10:01.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MSVC - expression must have pointer-to-object type but it has type "float" on generic array?<p>MSVC on Visual Studio 2019 says &quot;expression must have poi...
72,239,615
Do basic block parameters mean code locality?<p>Most modern compilers use some form of SSA for internal representation, which needs some notation for variables whose values can come from more than one source. The classic version uses phi nodes. Basic block parameters are also an option. As I understand it, they are log...
<p>The Cranelift doc that’s the source of your source is a dead link.</p> <p>However, you seem to be asking about something orthogonal to a representation as phi functions or basic-block parameters: how to handle definitions in an outer scope. These could be passed either directly or indirectly as extra parameters of ...
Do basic block parameters mean code locality?
parameters|compilation|compiler-construction|intermediate-language|ssa
0
49
1
72,243,411
72,243,411
1
true
2022-05-14T11:06:01.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do basic block parameters mean code locality?<p>Most modern compilers use some form of SSA for internal representation, which needs some notation for variabl...
72,377,755
clearInterval not working in React functional component<p>I am using <code>setInterval</code> and <code>clearInterval</code> in a React functional component. I am incrementing the count inside the <code>setInterval</code> and want to <code>clearInterval</code> once it has reached certain value.but it is not clearing ou...
<p>The problem is that you've made <code>chartsCount</code> a dependency on the <code>useEffect</code>, so every time it changes one interval is canceled and another is started. That <em>includes</em> when the count has gone above the limit, since you're still adding to the count in that case.</p> <p>Instead:</p> <ol> ...
clearInterval not working in React functional component
javascript|reactjs
2
49
2
72,377,879
72,377,879
1
true
2022-05-25T12:35:29.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: clearInterval not working in React functional component<p>I am using <code>setInterval</code> and <code>clearInterval</code> in a React functional component....
72,329,090
DRF add computed field based on requesting user<p>I have a model which has specific many to many fields to the user model. Now, to prevent information leaking, I do not want to return the whole related field though the rest framework. But, I want to create some kind of computed field, such that it return True if the re...
<p>What you can do is add your custom fields to the serializer with <a href="https://www.django-rest-framework.org/api-guide/fields/#serializermethodfield" rel="nofollow noreferrer"><code>SerializerMethodField</code></a> and pass the <code>request.user</code> via <code>get_serializer_context</code> in your view. For ex...
DRF add computed field based on requesting user
python|django|django-rest-framework
0
49
1
72,329,274
72,329,274
1
true
2022-05-21T11:22:53.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DRF add computed field based on requesting user<p>I have a model which has specific many to many fields to the user model. Now, to prevent information leakin...
72,315,689
How to give a error message when one or more fields are not given a value in ASP.Net 6.0 Core MVC<p>The user is able to post an outfit (a image/picture) to the website. If the user wants to post an outfit, he needs to give the outfit some values. The outfit needs to have a : <strong>Price</strong>, <strong>title</stron...
<p><strong>&quot;So inside the HttpPost method there should be some code wich tells the program to give an error if one or more of the attributes i mentioned earlier is not given a value?&quot;</strong></p> <blockquote> <p>There are lot of way to do that. One is <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc...
How to give a error message when one or more fields are not given a value in ASP.Net 6.0 Core MVC
asp.net-mvc|asp.net-core|asp.net-core-webapi|.net-6.0
1
49
1
72,316,286
72,316,286
1
true
2022-05-20T08:19:21.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to give a error message when one or more fields are not given a value in ASP.Net 6.0 Core MVC<p>The user is able to post an outfit (a image/picture) to t...
72,293,666
Problems with extracting information from a `.zip` file<p>I'm having problems with extracting information from a <code>.zip</code> file. I'm doing it as follows:</p> <pre><code>from zipfile import ZipFile with ZipFile('https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio...
<p>Bruh, just use <code>geopandas.read_file()</code> it's smart. <a href="https://geopandas.org/en/stable/docs/reference/api/geopandas.read_file.html#geopandas.read_file" rel="nofollow noreferrer">Documentation</a> <a href="https://geopandas.org/en/stable/docs/user_guide/io.html#:%7E:text=If%20there%20are%20multiple%20...
Problems with extracting information from a `.zip` file
python|python-zipfile
0
49
2
72,293,851
72,293,851
1
true
2022-05-18T17:36:56.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems with extracting information from a `.zip` file<p>I'm having problems with extracting information from a <code>.zip</code> file. I'm doing it as foll...
72,355,800
C# How to know which elements of a list are substrings of a string?<p>If I have a list of string like</p> <pre><code>var MyList = new List&lt;string&gt; { &quot;substring1&quot;, &quot;substring2&quot;, &quot;substring3&quot;, &quot;substring4&quot;, &quot;substring5&quot; }; </code></pre> <p>is there any efficient...
<p>We can use LINQ <code>Where</code> to query, for every substring, whether the large string <code>Contains</code> the substring:</p> <pre><code>var MyList = new List&lt;string&gt; { &quot;substring1&quot;, &quot;substring2&quot;, &quot;substring3&quot;, &quot;substring4&quot;, &quot;substring5&quot; }; var Text ...
C# How to know which elements of a list are substrings of a string?
c#|string|list|substring
0
49
2
72,355,817
72,355,817
1
true
2022-05-23T23:36:37.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# How to know which elements of a list are substrings of a string?<p>If I have a list of string like</p> <pre><code>var MyList = new List&lt;string&gt; { ...
72,252,089
How to apply an arbitrary filter on a specific chained prefetch_related() within Django?<p>I'm trying to optimize the fired queries of an API. I have four models namely User, Content, Rating, and UserRating with some relations to each other. I want the respective API returns all of the existing contents alongside their...
<p>I think you are looking for Prefetch object: <a href="https://docs.djangoproject.com/en/4.0/ref/models/querysets/#prefetch-objects" rel="nofollow noreferrer">https://docs.djangoproject.com/en/4.0/ref/models/querysets/#prefetch-objects</a></p> <p>Try this:</p> <pre class="lang-py prettyprint-override"><code>from djan...
How to apply an arbitrary filter on a specific chained prefetch_related() within Django?
django|django-models|django-queryset|django-orm|prefetch
0
49
1
72,252,152
72,252,152
1
true
2022-05-15T20:49:42.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply an arbitrary filter on a specific chained prefetch_related() within Django?<p>I'm trying to optimize the fired queries of an API. I have four mo...
72,343,959
Shiny - updateTabsetPanel - Change the selected tab on the client<p>On home page of the app we have 2 valueBox. What I need is to make them clickable(work as button) and on click event jump to tabpanel.</p> <p>What I need is to click on &quot;Title1&quot; valueBox on Home tab and it should redirect(navigate) the screen...
<p><em>EDIT: I did not properly read your question. I've modified the code to fit your request about updating the inner tab of tab 1 to summary.</em></p> <p>In the <code>ui</code> object, you can wrap an output in a <code>actionLink</code> and then attach a observer to the link that updates the tab using <code>updateTa...
Shiny - updateTabsetPanel - Change the selected tab on the client
r|shiny|tabs|shinydashboard
0
49
1
72,345,244
72,345,244
1
true
2022-05-23T06:11:32.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shiny - updateTabsetPanel - Change the selected tab on the client<p>On home page of the app we have 2 valueBox. What I need is to make them clickable(work as...
72,241,569
Converting Graph weights to Matrix in python<p>I have data in the form of:</p> <pre><code>A=B=11 A=C=6 A=D=5 B=C=19 B=D=17 C=D=6 </code></pre> <p>But I'd like to convert this into this format:</p> <pre><code>graph= [[ 0, 10, 15, 20 ], [ 10, 0, 35, 25 ], [ 15, 35, 0, 30 ], [ 20, 25, 3...
<p>You can use a dictionary to make an adjacency list. Then enumerate the keys of that dictionary to define an index for each key. Then finally copy the weights into the final matrix structure:</p> <pre><code>nodes = {} for line in open(&quot;input.txt&quot;).read().splitlines(): a, b, weight = line.split(&quot;=&q...
Converting Graph weights to Matrix in python
python|algorithm|matrix|multidimensional-array|graph
0
49
2
72,241,892
72,241,892
1
true
2022-05-14T15:19:40.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting Graph weights to Matrix in python<p>I have data in the form of:</p> <pre><code>A=B=11 A=C=6 A=D=5 B=C=19 B=D=17 C=D=6 </code></pre> <p>But I'd lik...
72,309,825
How to filter everything under NAME for certain strings?<p>Here is an example test.txt file that I am currently using:</p> <pre><code>NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION app-educat...
<p>You can do something like this to filter the lines</p> <pre class="lang-sh prettyprint-override"><code> awk -v pattern=&quot;preview&quot; -v today=&quot;$today&quot; -v expiryTime=&quot;$secondsUntilStale&quot; ' $1 ~ pattern { ... this is exactly the same as your code ... } ' </code></pre> <p><cod...
How to filter everything under NAME for certain strings?
bash|awk
0
49
1
72,310,068
72,310,068
1
true
2022-05-19T18:59:55.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter everything under NAME for certain strings?<p>Here is an example test.txt file that I am currently using:</p> <pre><code>NAME ...
72,360,382
React state doesn't update immediately with useState<p>Apologies if you feel like this is a repeated question, but I couldn't find the solution for my problem in any of similar questions and couldn't understand why this problem was occurring.</p> <p>I have a component called <code>Selector.tsx</code> which basically ha...
<p>the reason is you are doing variable(object) copy with reference and when reference is not changing your state is not updating</p> <p>insted of</p> <pre><code> const handleAdd = (val: string) =&gt; { if (!inputVal) return; const _saved = saved; _saved.push({ type: val, text: inputVal }); setSaved(_sa...
React state doesn't update immediately with useState
reactjs|react-hooks
1
49
2
72,360,550
72,360,550
1
true
2022-05-24T09:23:39.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React state doesn't update immediately with useState<p>Apologies if you feel like this is a repeated question, but I couldn't find the solution for my proble...
72,396,518
Python Optimize multiple if-else based on truthy value<p>I have following code in Python where based on a boolean flag I need to check a list count, wondering if there is a better way to code this in Python?</p> <pre><code>If var_true: if len(something) &gt; 0: logger.console (“Something found”) else: ...
<p>Replace the <code>else: raise AssertionError</code> code with the actual <code>assert</code> statement (which lets it get skipped when run in <code>-O</code> mode, but behaves identically to your current code in normal [debug] mode):</p> <pre><code>if var_true: assert something, &quot;something was not found&quo...
Python Optimize multiple if-else based on truthy value
python|python-3.x
-1
49
1
72,396,584
72,396,584
1
true
2022-05-26T18:36:18.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Optimize multiple if-else based on truthy value<p>I have following code in Python where based on a boolean flag I need to check a list count, wonderin...
72,283,263
DRF How to display only not blank value of serializing nested object<p>I've created serializing nested be using serializers as document</p> <p><strong>models.py</strong></p> <pre><code>class Category(models.Model): name = models.CharField(&quot;Name&quot;, &quot;name&quot;, max_length=255) iconname = models.Cha...
<p>I think you need to add a filter like the following.</p> <pre><code>queryset = Category.objects.prefetch_related( Prefetch('dailyexpense_category', queryset=DailyExpense.objects.filter(tran_date__range=[fromDate, toDate]).order_by('tran_date')) ).annotate(num_daily=Count('dailyexpense_category', filter = Q(...
DRF How to display only not blank value of serializing nested object
django|django-rest-framework|django-views
0
49
1
72,283,778
72,283,778
1
true
2022-05-18T04:34:25.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DRF How to display only not blank value of serializing nested object<p>I've created serializing nested be using serializers as document</p> <p><strong>models...
72,307,496
Compute row distance matrix using only for loops<p>I am stuck in trying to calculate a distance matrix from different binary arrays and I can only use for loops to resolve this...</p> <p>The problem consists of the following; Imagine I have a binary matrix built with different rows as follows, with dimension n=3,m=3 in...
<p>If I understood correctly, you could do:</p> <pre><code>import numpy as np mat = np.matrix([[0,0,0], [1,0,1], [1,1,1]]) result = np.zeros(np.shape(mat)) nrows, ncols = np.shape(mat) for r in range(nrows): # We only need to compare the upper triangular part of the matrix. ...
Compute row distance matrix using only for loops
python|for-loop|matrix
0
49
1
72,308,889
72,308,889
1
true
2022-05-19T15:45:00.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compute row distance matrix using only for loops<p>I am stuck in trying to calculate a distance matrix from different binary arrays and I can only use for lo...
72,398,925
error: use of deleted function 'Hund4::Hund4()'<p>I am a newbie in C++. I wrote this code to understand the difference between <code>public</code>, <code>protected</code> and <code>private</code>. The problem is, when I create an object of <code>Hund4</code>, I get this error:</p> <blockquote> <p>use of deleted functio...
<p>The <code>Hund</code> class that <code>Hund4</code> derives from has no default constructor, so <code>Hund4</code> has no default constructor. You can construct a <code>Hund4</code> from a <code>std::string</code> or a <code>Hund</code>, though:</p> <pre><code>Hund4 ace4(std::string{&quot;ace4&quot;}); Hund4 ace4(Hu...
error: use of deleted function 'Hund4::Hund4()'
c++|inheritance|multiple-inheritance
1
49
2
72,398,935
72,398,935
1
true
2022-05-26T23:12:02.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error: use of deleted function 'Hund4::Hund4()'<p>I am a newbie in C++. I wrote this code to understand the difference between <code>public</code>, <code>pro...
72,397,098
Definition of spearmanr<p>To test my understanding on spearmanr and pearsonr, I compared two ways to compute spearmanr, which should give the same result. Surprisingly, the results are different.</p> <pre><code>import torch from scipy.stats import pearsonr, spearmanr x = torch.normal(1, 1, (10,)) y = torch.normal(1, 1...
<p><em>Firstly,</em> just for clarification, <a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient" rel="nofollow noreferrer">Pearson</a> and <a href="https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient" rel="nofollow noreferrer">Spearman</a> correlations are not the same, however t...
Definition of spearmanr
python|statistics
1
49
1
72,399,141
72,399,141
1
true
2022-05-26T19:31:29.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Definition of spearmanr<p>To test my understanding on spearmanr and pearsonr, I compared two ways to compute spearmanr, which should give the same result. Su...
72,243,051
Accessing specific elements in Arraylist of Objects<p>Really confused on how to access just the age of a specific student where all the information of students have been stored in a textfile. I am reading the textfile and storing that info into a student object, just need help on accessing this.</p> <pre class="lang-ja...
<p>You can chain methods together like this.</p> <pre><code> for(int i = 0; i &lt; users.size(); i++){ if(idNum == users.get(i).getIdNum()){ final Student temp = users.get(i); System.out.println(&quot;Student with an ID of &quot; + temp.getIdNum() + &quot; has an age of &quot; + te...
Accessing specific elements in Arraylist of Objects
java|object|arraylist
2
49
2
72,243,680
72,243,680
2
true
2022-05-14T18:45:47.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing specific elements in Arraylist of Objects<p>Really confused on how to access just the age of a specific student where all the information of studen...
72,251,553
Replace white space with a dash using javascript inside a hyperlink?<p>I'm trying to format a bunch of auto generated links containing white spaces, into versions where the white spaces have been replaced by &quot;-&quot; (dash) like this:</p> <pre><code>&lt;a id=&quot;replacewhitespace&quot; href=&quot;/properties-for...
<ul> <li>You don't need to modify the innerHTML, just use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute" rel="nofollow noreferrer">Element.getAttribute</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute" rel="nofollow noreferrer">Element.setAttribute<...
Replace white space with a dash using javascript inside a hyperlink?
javascript|html
1
49
4
72,251,626
72,251,626
2
true
2022-05-15T19:27:23.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace white space with a dash using javascript inside a hyperlink?<p>I'm trying to format a bunch of auto generated links containing white spaces, into ver...
72,252,908
How to determine which class is instantiated and access it through a variable in Java<p>I have an Interface <code>IGeneralEvents</code> and I have implemented three classes based on it <code>Social</code>, <code>Sport</code> and <code>Traditional</code>. All three of them are using singletons to make sure they are only...
<p>There's <code>instanceof</code> which checks if any given reference is an instance of the stated class, and there's the cast operator which does many completely unrelated things - one of them is to treat a given object as some more specific type - if it is of that type, then you can treat it as that type. If it is n...
How to determine which class is instantiated and access it through a variable in Java
java
-2
49
1
72,252,928
72,252,928
2
true
2022-05-15T23:34:48.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to determine which class is instantiated and access it through a variable in Java<p>I have an Interface <code>IGeneralEvents</code> and I have implemente...
72,253,230
Summarizing within Conditions Repeated over Time<p>I am trying to summarize data within time intervals using a data set with conditions repeated over time at varying intervals. I would like to get means and standard deviations within time intervals for each of the conditions.</p> <p>However, in my real data I don't kno...
<p>We can use <code>rle</code> to define &quot;groups&quot; of your Condition.</p> <pre><code>library(dplyr) df %&gt;% ungroup() %&gt;% mutate(group = rep(1:length(rle(Condition)$lengths), rle(Condition)$lengths)) %&gt;% group_by(group) %&gt;% summarize(Condition = unique(Condition), interval =...
Summarizing within Conditions Repeated over Time
r|tidyverse|intervals
2
49
3
72,254,092
72,254,092
2
true
2022-05-16T00:56:21.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Summarizing within Conditions Repeated over Time<p>I am trying to summarize data within time intervals using a data set with conditions repeated over time at...
72,278,963
Mean function always returns NULL in R<p>The mean function is always returning NULL, no matter what I input. For example, <code>mean(1)</code> and <code>mean(c(1, 2, 3))</code> both return NULL. I tried this on another computer and it gave me the correct values. I am using RStudio Version 2022.02.2 Build 485, &quot;Pra...
<p>You probably have redefined the <code>mean</code> function and this new definition as been saved as part of the <a href="https://support.rstudio.com/hc/en-us/articles/200711843-Working-Directories-and-Workspaces-in-the-RStudio-IDE" rel="nofollow noreferrer">workspace</a>. This workspace is loaded again when you star...
Mean function always returns NULL in R
r
-1
49
1
72,279,083
72,279,083
2
true
2022-05-17T18:23:04.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mean function always returns NULL in R<p>The mean function is always returning NULL, no matter what I input. For example, <code>mean(1)</code> and <code>mean...