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,364,816 | Attributes of complex numbers in Weka<p>I created a dataset includes complex numbers (samples of complex signals). The dataset has 80 instances and 1024 attributes, and I need to classify these signals into two classes via Weka. However, the Weka does not deal with complex numbers.
I am just wondering how this can be d... | <p>Weka has no notion of imaginary numbers, just real-valued ones. You will have to treat the imaginary/real part (or amplitude/phase) as separate attributes. And hope that algorithms will learn a relationship between them.</p>
<p>Of course, you can always engineer additional features to help the learning process, e.g.... | Attributes of complex numbers in Weka | weka | 0 | 41 | 1 | 72,369,420 | 72,369,420 | 0 | true | 2022-05-24T14:35:41Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Attributes of complex numbers in Weka<p>I created a dataset includes complex numbers (samples of complex signals). The dataset has 80 instances and 1024 attr... |
72,369,503 | How do I make Visual Studio copy JS files from compiled TypeScript with Microsoft.TypeScript.MSBuild?<p>I have a non-web project (WPF) in <strong>Visual Studio 2022</strong> and the UI uses HTML/CSS/Javascript. I want to compile TypeScript on built as well and copy the compiled JS files into built folder.</p>
<p>This i... | <p>I found out the target I create should have <code>AfterTargets</code> with <code>CompileTypeScriptWithTSConfig</code> value. I got the value thanks to running <code>dotnet build -verbosity:normal</code> to get all the name of actual targets.</p>
<pre class="lang-xml prettyprint-override"><code> <Target Name=&q... | How do I make Visual Studio copy JS files from compiled TypeScript with Microsoft.TypeScript.MSBuild? | typescript|visual-studio|compilation|msbuild|visual-studio-2022 | 0 | 41 | 1 | 72,369,843 | 72,369,843 | 0 | true | 2022-05-24T21:10:04.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make Visual Studio copy JS files from compiled TypeScript with Microsoft.TypeScript.MSBuild?<p>I have a non-web project (WPF) in <strong>Visual Stud... |
72,359,824 | How to search users from firestore database using reactjs<p>I can get and display usernames.i just want to filter using search .Im using reactjs and firebase.</p> | <p>i figured it out</p>
<pre><code>{athletes
.filter((athlete) => {
if (search === "") {
return athlete;
} else if (
athlete.fullName.toLowerCase().includes(search.toLowerCase())
) {
return athlete;
}
})
.m... | How to search users from firestore database using reactjs | javascript|firebase|google-cloud-firestore | -1 | 41 | 1 | 72,375,987 | 72,375,987 | 0 | true | 2022-05-24T08:45:50.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to search users from firestore database using reactjs<p>I can get and display usernames.i just want to filter using search .Im using reactjs and firebase... |
72,378,156 | Count all occurrences in a dataframe with multiple elements per cell<p>I am trying to count all occurences in a dataframe that has multiple elements in each cell.</p>
<p>I have an original dataframe made of 2 colums and each row has multiple elements:</p>
<pre><code>index x1 x2
0 "foo;bar;baz" "baz;qux;q... | <p>You should iterate over the columns of the DataFrame:</p>
<pre><code>df_counts = (
pd.DataFrame([Counter(chain.from_iterable(df3[column]))
for column in df3.columns],
index=['love', 'hate', 'want'])
.fillna(0)
.T
... | Count all occurrences in a dataframe with multiple elements per cell | python|pandas|dataframe|set | 0 | 41 | 1 | 72,378,617 | 72,378,617 | 0 | true | 2022-05-25T13:00:53.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Count all occurrences in a dataframe with multiple elements per cell<p>I am trying to count all occurences in a dataframe that has multiple elements in each ... |
72,381,069 | How to most efficiently calculate daily enrollment from an entry and exit date in R?<p>The following code works, but it seems highly inefficient. Is there a more straight forward way to calculate a daily enrollment by site from an entry and exit date.</p>
<p>Data:</p>
<pre><code>df <- data.frame(
id <- seq_along(... | <p>Does this give you what you're looking for? I expect this should be more performant since the calculation here is vectorized once we get the stream of entries and exits into a longer form.</p>
<pre><code>library(tidyverse)
df %>%
pivot_longer(entry_date:exit_date) %>%
filter(!is.na(value)) %>%
mutate(... | How to most efficiently calculate daily enrollment from an entry and exit date in R? | r|purrr|intervals|lubridate | 0 | 41 | 2 | 72,381,339 | 72,381,339 | 0 | true | 2022-05-25T16:11:53.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to most efficiently calculate daily enrollment from an entry and exit date in R?<p>The following code works, but it seems highly inefficient. Is there a ... |
72,313,808 | cannot convert 'ListNode*' to 'ListNode**' C++<pre><code>#include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
void ... | <p>Like Armin pointed out in the comments, you are referencing the array beyond the range.</p>
<p>if you replace</p>
<pre><code>node = head[5];
</code></pre>
<p>with</p>
<pre><code>node = head[4]; //this is the 5th element of the array.
</code></pre>
<p>you would probably get the output you were expecting.</p> | cannot convert 'ListNode*' to 'ListNode**' C++ | c++|pointers | 0 | 41 | 1 | 72,381,654 | 72,381,654 | 0 | true | 2022-05-20T05:06:57.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cannot convert 'ListNode*' to 'ListNode**' C++<pre><code>#include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *n... |
72,386,359 | How to apply regex to multiple inputs at the same time<p>I' new to programming, trying to apply a regex that replaces every space (' ') with a dash ('-') but the querySelectorAll() returns a NodeList, after some struggle trying to get an Array from so i could use forEach(), now i step in this error.</p>
<p>If possible,... | <p>Just use e.target to access the actual HTML element.</p>
<p>Here's the updated code:</p>
<pre><code>Array.from(inputs).forEach(() => {
addEventListener("keyup", (e) => {
//console.log("evaluacion",e.target)
e.target.value = e.target.value.replace(/ /g, "-");
});
});
//e... | How to apply regex to multiple inputs at the same time | javascript|arrays|validation|input|nodelist | 0 | 41 | 1 | 72,386,444 | 72,386,444 | 0 | true | 2022-05-26T03:27:34.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to apply regex to multiple inputs at the same time<p>I' new to programming, trying to apply a regex that replaces every space (' ') with a dash ('-') but... |
72,387,677 | What single line query can be used in SQL to display usernames from transaction history?<p>I have two tables :Users and transactions</p>
<p>Table structure:</p>
<p>Users:
USERID
USERNAME
PASSWORD
EMAILID</p>
<p>Transactions:</p>
<pre><code> TRANSACTIONID
AMOUNT
EXPENSEID
USERID_1 (refers to user who owes... | <ol>
<li>Simply join transaction table with users table twice to get names for the userid_1 and userid_2</li>
<li>Include a <code>WHERE</code> clause to match the user you want to look at (say user 7)</li>
</ol>
<p><a href="https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=e7ebeddf315fb237245b4ccc96391907" rel="nofollow ... | What single line query can be used in SQL to display usernames from transaction history? | mysql | 0 | 41 | 1 | 72,389,605 | 72,389,605 | 0 | true | 2022-05-26T06:33:20.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What single line query can be used in SQL to display usernames from transaction history?<p>I have two tables :Users and transactions</p>
<p>Table structure:<... |
72,382,636 | Vertically center/align image div with adjacent text div in css grid<p>Probably missing sth here but I've tried to align this for two days now and browsed through + tried pretty much everything I could find on stackoverlow etc. about it.</p>
<p>I have a CSS grid on a website that contains (per grid item) a text div and... | <p>The key bits you are missing:</p>
<ul>
<li>.grid__item {display: flex;}</li>
<li>.grid__item {align-items: center;}</li>
<li>.text-left {flex-direction: row;}</li>
<li>.text-right {flex-direction: row-reverse;}</li>
</ul>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... | Vertically center/align image div with adjacent text div in css grid | html|css|image|css-grid|centering | 0 | 41 | 1 | 72,391,196 | 72,391,196 | 0 | true | 2022-05-25T18:33:20.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vertically center/align image div with adjacent text div in css grid<p>Probably missing sth here but I've tried to align this for two days now and browsed th... |
72,389,386 | Select colums in pandas multi index dataframe<p>I probably have a rather simple pandas question, but despite having tried multiple solutions posted on stackoverflow, I can't figure out how to do it properly.</p>
<p>I have pandas multi-index Dataframe with the following structure:</p>
<p><a href="https://i.stack.imgur.c... | <p>Hello and thank you for the warm welcome. I will take care of theese guidelines in the future.</p>
<p>I finally was able to solve my problem by the help of this post:</p>
<p><a href="https://stackoverflow.com/questions/36521388/multi-column-selection-with-pandas-xs-function-is-failed">multi column selection with pan... | Select colums in pandas multi index dataframe | python|pandas|multi-index | 0 | 41 | 1 | 72,392,557 | 72,392,557 | 0 | true | 2022-05-26T09:08:24.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select colums in pandas multi index dataframe<p>I probably have a rather simple pandas question, but despite having tried multiple solutions posted on stacko... |
72,392,375 | ImportJson() print the data only when I return the function in Google App script<p>I want to implement a Loop on <code>ImportJson()</code> but it doesn't work without return</p>
<p>The Code from this github link :<a href="https://gist.github.com/paulgambill/cacd19da95a1421d3164" rel="nofollow noreferrer">ImportJson Int... | <p>I assume you want to join results from several urls in one big list.
You can use Array.concat, like this</p>
<pre><code>function ImportData1() {
veunueid_arr = ["KovZpZA7AAEA", "KovZpa2gne"];
var results = [];
for (var Veunue_id1 = 0; Veunue_id1 < 2; Veunue_id1++) {
v... | ImportJson() print the data only when I return the function in Google App script | javascript|google-apps-script|google-sheets | 0 | 41 | 1 | 72,393,081 | 72,393,081 | 0 | true | 2022-05-26T13:10:36.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ImportJson() print the data only when I return the function in Google App script<p>I want to implement a Loop on <code>ImportJson()</code> but it doesn't wor... |
72,393,595 | TextField In Tab View will show space upon keyboard<p>I'm using text field in Tab view, but when keyboard shows out. There has a space upon keyboard.</p>
<p><a href="https://i.stack.imgur.com/fTC60.png" rel="nofollow noreferrer">enter image description here</a></p>
<pre><code>var body: some View {
TabView {
... | <p>Modifier should be applied in correct place:</p>
<pre><code> HStack {
Image(systemName: "paperplane")
TextField("test field", text: $test)
.textFieldStyle(RoundedBorderTextFieldStyle())
}
.ignoresSafeArea(.keyboard, edges: .bottom) // << here !!
</code></pre>
<p>... | TextField In Tab View will show space upon keyboard | ios|swiftui|keyboard|ios15|swiftui-tabview | 1 | 41 | 1 | 72,393,804 | 72,393,804 | 0 | true | 2022-05-26T14:39:20.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TextField In Tab View will show space upon keyboard<p>I'm using text field in Tab view, but when keyboard shows out. There has a space upon keyboard.</p>
<p>... |
72,397,541 | Extracting a string with regular expressions that contains a certain word anywhere in the string<p>I am having difficulty understanding regex syntax for this specific issue I am facing. I am using Python.</p>
<p>Here is a sample output (with random values) of sensors I am using that is in a txt file:</p>
<pre><code>Sen... | <p>You can use</p>
<pre class="lang-none prettyprint-override"><code>{[^{}]*'[xyz]_acc'[^{}]*}
</code></pre>
<p>See the <a href="https://regex101.com/r/1U4FeT/2" rel="nofollow noreferrer">regex demo</a>.</p>
<p><em>Details</em>:</p>
<ul>
<li><code>{</code> - a <code>{</code> char</li>
<li><code>[^{}]*</code> - zero or ... | Extracting a string with regular expressions that contains a certain word anywhere in the string | python|regex|extract|brackets|curly-braces | 1 | 41 | 1 | 72,397,588 | 72,397,588 | 0 | true | 2022-05-26T20:11:59.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extracting a string with regular expressions that contains a certain word anywhere in the string<p>I am having difficulty understanding regex syntax for this... |
72,399,272 | [Heap]- after removing a node, should you run siftDown for all nodes or just the root?<p>I have seen implementations of binary heap where after removal of a node, heapifyDown/siftDown (whatever the author names it) is run only on the root to re-heapify the tree, and some where siftDown is run iteratively on all items f... | <p>There’s no need to run heapifyDown / siftDown on all elements after removing the minimum. That will indeed fix the heap, but it takes time O(n) to do this, which is pretty slow and defeats the purpose of having a binary heap. Instead, the traditional algorithm is to swap the last element of the heap to the top, then... | [Heap]- after removing a node, should you run siftDown for all nodes or just the root? | data-structures|heap|binary-heap | 1 | 41 | 1 | 72,400,847 | 72,400,847 | 0 | true | 2022-05-27T00:22:24.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
[Heap]- after removing a node, should you run siftDown for all nodes or just the root?<p>I have seen implementations of binary heap where after removal of a ... |
72,300,846 | Use of protocol_id in SMPP<p>I am working on an SMPP based application and trying to send SubmitSM using SMPP protocol.Currently a bit counfused about some of the PDU params that are available in SubmitSM. Anybody have some idea or any reference how the <strong>protocolId</strong> is used in SMPP or in SMSC. Done some ... | <p>Check <strong>1.2.13 protocol_id TP-PID (Protocol identifier)</strong> here : <a href="https://www.sysop.fr/index-smpp/" rel="nofollow noreferrer">https://www.sysop.fr/index-smpp/</a></p> | Use of protocol_id in SMPP | java|sms|smpp | 0 | 41 | 1 | 72,445,394 | 72,445,394 | 0 | true | 2022-05-19T08:06:35.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use of protocol_id in SMPP<p>I am working on an SMPP based application and trying to send SubmitSM using SMPP protocol.Currently a bit counfused about some o... |
72,249,597 | QCustomPlot vertical line at axis<p>I am working QCustomPlot with Qt and need to change the color of a particular vertical grid line within the graph please let us know how we can change that I attached the image of my requirement.</p>
<p><a href="https://i.stack.imgur.com/QXhrX.png" rel="nofollow noreferrer"><img src=... | <p>The bleo code solve the issue</p>
<pre><code>GraphTesting(QCustomPlot * customPlot)
{
// generate some data:
QVector<double> x(101), y(101); // initialize with entries 0..100
for (int i = 0; i < 101; ++i)
{
x[i] = i; //i / 50.0 - 1; // x goes from -1 to 1
y[i] = x[i]/2; // le... | QCustomPlot vertical line at axis | qt|qt5|qcustomplot | 0 | 41 | 1 | 72,496,699 | 72,496,699 | 0 | true | 2022-05-15T15:20:20.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
QCustomPlot vertical line at axis<p>I am working QCustomPlot with Qt and need to change the color of a particular vertical grid line within the graph please ... |
72,239,524 | Why is the second background image not displaying after rotating my device?<p>I have two background images to create a layered effect and to keep the file sizes small. There's a repeating star pattern in the back, and a white "cutout" on top (there are two versions of the latter: for desktop and mobile). Stri... | <p>The issue was not in the code, but in the background image itself, which turned out to be too large for Chrome on Android. It seems images 4000 pixels in width or larger are not supported.</p>
<p>Even though the original file was relatively small (35 kb), the dimensions were quite large – 8050 x 768 pixels. I origin... | Why is the second background image not displaying after rotating my device? | android|css|background|background-image|samsung-galaxy | 0 | 41 | 1 | 72,498,348 | 72,498,348 | 0 | true | 2022-05-14T10:53:47.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the second background image not displaying after rotating my device?<p>I have two background images to create a layered effect and to keep the file si... |
72,384,567 | Function returning an object type if the object is an instance of x?<p>I need a TypeScript function to test if an object is of a specific type. If so, the method should return this type. If not the method should return undefined. I want to use this function in the following way:</p>
<pre class="lang-js prettyprint-over... | <p>You want a type predicate function to make this thing safer!</p>
<pre><code>export function isSpecialObject(element: SomeBaseObject): element is SpecialObject {
return element instanceof SpecialObject;
}
if (isSpecialObject(element)) {
// element is safe to use as SpecialObject
}
</code></pre>
<p>It's also ... | Function returning an object type if the object is an instance of x? | javascript|typescript | 1 | 41 | 2 | 72,384,615 | 72,384,615 | 0 | true | 2022-05-25T21:55:47.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function returning an object type if the object is an instance of x?<p>I need a TypeScript function to test if an object is of a specific type. If so, the me... |
72,357,854 | Present VC programmatically<p>How to present UIViewController() inside of UINavigationController ? My controller presenting not fullscreen. <strong>I want my app to look like this</strong> <a href="https://i.stack.imgur.com/sslaV.png" rel="nofollow noreferrer">enter image description here</a>, <strong>but it is end up ... | <pre><code> let customVC = DestinationController()
let navVC = UINavigationController(rootViewController: customVC)
// this line overFullScreen
navVC.modalPresentationStyle = .overFullScreen
// for more style
navVC.modalTransitionStyle = .crossDissolve
self.present(navVC, animated: true, completion: ... | Present VC programmatically | ios|swift|uikit|programmatically | -2 | 41 | 1 | 72,357,938 | 72,357,938 | 0 | true | 2022-05-24T06:00:59.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Present VC programmatically<p>How to present UIViewController() inside of UINavigationController ? My controller presenting not fullscreen. <strong>I want my... |
72,308,301 | ASP.NET Core dual routes for web and api<p>This is for an ASP.NET Core application. A json Web API needs to be added alongside a normal website.</p>
<p>So in <code>program.cs</code>, a second route was added:</p>
<pre><code>app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllerRoute(name:... | <p>You have to remove the second option from your config</p>
<pre><code>app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
</code></pre>
<p>and make a controller route id optional, since your test for example does... | ASP.NET Core dual routes for web and api | asp.net-core|asp.net-core-webapi | 0 | 41 | 1 | 72,312,230 | 72,312,230 | 0 | true | 2022-05-19T16:48:15.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ASP.NET Core dual routes for web and api<p>This is for an ASP.NET Core application. A json Web API needs to be added alongside a normal website.</p>
<p>So in... |
72,375,290 | Generate a dictionary composed of random strings with random lengths from random characters of the supported character set<p>I need to write a python script that:</p>
<ol>
<li>Get a random length for the string to generate</li>
<li>Generate a string of this length, using random characters from [the supported/valid char... | <p>Here is your solution</p>
<pre><code>import random
valid = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'ä', 'ö', 'ü', 'ß', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', '... | Generate a dictionary composed of random strings with random lengths from random characters of the supported character set | python|string|dictionary|for-loop|if-statement | -1 | 41 | 1 | 72,375,968 | 72,375,968 | 0 | true | 2022-05-25T09:43:26.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generate a dictionary composed of random strings with random lengths from random characters of the supported character set<p>I need to write a python script ... |
72,338,296 | cython to speed up a 3d list manipulation<p>Someone could help me to create a cython code for this example?</p>
<p>I create this example because I would like to create a faster version of it, as a solution I was thinking about <a href="/questions/tagged/cython" class="post-tag" title="show questions tagged 'cython&... | <p>Numpy can be used for this problem but the <code>transform2</code> can hardly be efficiently vectorized. However, Cython and Numba can do that efficiently (Numba is a bit like Cython, but it is a just in time compiler and it is simpler to use here).</p>
<p>Using Cython or Numba alone is not enough since lists cannot... | cython to speed up a 3d list manipulation | python|performance|optimization | 0 | 41 | 1 | 72,338,655 | 72,338,655 | 0 | true | 2022-05-22T14:04:17.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cython to speed up a 3d list manipulation<p>Someone could help me to create a cython code for this example?</p>
<p>I create this example because I would like... |
72,369,492 | Why is my text going vertical at a certain width?<p>So I have an issue with my code where when my JavaScript types of a word (eg. Gamer) it limits to a certain width and ends up going vertical instead of horizontal.</p>
<p>Here are all the classes and code for the text:</p>
<p><div class="snippet" data-lang="js" data-h... | <p>Change max-width to width : 100%; into the .textbody and to put it in center add display: flex;</p>
<pre><code>.textbody {
margin-top: 10vh;
font-family: "Source Sans Pro", sans-serif;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
... | Why is my text going vertical at a certain width? | javascript|html|css | 0 | 41 | 1 | 72,369,683 | 72,369,683 | 0 | true | 2022-05-24T21:08:22.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my text going vertical at a certain width?<p>So I have an issue with my code where when my JavaScript types of a word (eg. Gamer) it limits to a certa... |
72,351,751 | Should MongoDbContext Static?<p>I've a ASP.NET Core ntier ecommerce application with Mongo Db. I am new on MongoDb by the way. And this application will works on heavy load.</p>
<p>I've created a db context to connect Mongo Db but i am confused that should i use a static class for the context?</p>
<p>Mongo document say... | <p>Yes, you should keep only one instance of <code>MongoClient</code> per cluster per application</p>
<blockquote>
<p>Use one MongoClient instance per application unless the application is
connecting to many separate clusters.</p>
<p>MongoClient objects are thread-safe in most drivers.</p>
</blockquote>
<p><a href="htt... | Should MongoDbContext Static? | asp.net-mvc|mongodb|asp.net-core | 0 | 41 | 1 | 72,351,880 | 72,351,880 | 0 | true | 2022-05-23T16:16:27.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should MongoDbContext Static?<p>I've a ASP.NET Core ntier ecommerce application with Mongo Db. I am new on MongoDb by the way. And this application will work... |
72,250,520 | I want to create a function that observes a property then calls a function once the property reaches 100<p>My goal is to refresh the view once the percentageChages() reaches 100:</p>
<p>The value:</p>
<pre><code> this.uploadPercent = task.percentageChanges();
</code></pre>
<p>The function I want to create :</p>
<pre>... | <p>You could make use of rxjs and Observables (comes built in with angular).</p>
<p>For instance instantiate uploadPecent to be:</p>
<pre><code>uploadPercent = new BehaviorSubject<number>(0);
</code></pre>
<p>Then you can set the value of this similarly to before with:</p>
<pre><code>uploadPercent.next(task.perce... | I want to create a function that observes a property then calls a function once the property reaches 100 | angular|typescript|angularfire | 0 | 41 | 1 | 72,250,724 | 72,250,724 | 0 | true | 2022-05-15T17:14:40.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to create a function that observes a property then calls a function once the property reaches 100<p>My goal is to refresh the view once the percentage... |
72,396,189 | how to specify data on pearson correlation heatmap?<p>I have a pearson correlation heat map coded, but its showing data from my dataframe which i dont need.</p>
<p>is there a way to specify which columns i'd like to include?</p>
<p>thanks in advance</p>
<p><a href="https://i.stack.imgur.com/vOhLi.png" rel="nofollow nor... | <p>You can filter the dataframe before calculating correlation</p>
<pre><code>sns.heatmap(df[['POPDEN', 'RoadsArea', 'MedianIncome', 'MedianPrice', 'PropertyCount', 'AvPTAI2015', 'PTAL']].corr(), annot=True, fmt='.2f')
</code></pre> | how to specify data on pearson correlation heatmap? | python|pearson-correlation | 0 | 41 | 2 | 72,396,211 | 72,396,211 | 0 | true | 2022-05-26T18:04:07.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to specify data on pearson correlation heatmap?<p>I have a pearson correlation heat map coded, but its showing data from my dataframe which i dont need.<... |
72,355,659 | Execute python code indefinetly when key is pressed<p>I'm a bit new to python so I don't know exactly how to do this. I was trying to create a script that would help me automate doing tasks in a game. When I created this script, I got stuck on how to execute code whenever the key was pressed (I.e. when f is pressed, th... | <p>What you're looking for is a structure found in every game and operating system: a control loop. Normally, programming guides will tell you not to do this, but in this specific case, it's an absolute necessity:</p>
<pre><code>while True:
if input == 't':
right()
elif input == 'r':
left()... | Execute python code indefinetly when key is pressed | python | 0 | 41 | 1 | 72,355,686 | 72,355,686 | 0 | true | 2022-05-23T23:13:05.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute python code indefinetly when key is pressed<p>I'm a bit new to python so I don't know exactly how to do this. I was trying to create a script that wo... |
72,400,018 | How to get the name of each array as you loop through an array of arrays php<p>I have an array of arrays as so:</p>
<pre><code>$bookPages = array(
"page-1-name" => array(
"page_title" => "Search results",
"page_name" => "search"
) ,
&quo... | <p>Use the foreach statement as shown below to display the name of the key.
You can then use <code>$val[key_name]</code> to loop through value of the keys in the inner array</p>
<pre><code>foreach ( $bookPages as $bookPage => $val ) {
echo $bookPage . "<br>";
}
</code></pre> | How to get the name of each array as you loop through an array of arrays php | php|multidimensional-array | -1 | 41 | 1 | 72,400,091 | 72,400,091 | 0 | true | 2022-05-27T03:03:01.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the name of each array as you loop through an array of arrays php<p>I have an array of arrays as so:</p>
<pre><code>$bookPages = array(
"... |
72,350,471 | How to get another field of same object in JSON with vanilla JS?<p>I have a JSON like this:</p>
<pre><code>[
{
"title": "film1",
"actor": ["jack", "fred"]
},
{
"title": "film2",
"actor": ["jack", "tom"]
},
... | <p><strong>Using JavaScript array methods</strong></p>
<p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow noreferrer">Array.filter</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="n... | How to get another field of same object in JSON with vanilla JS? | javascript|arrays|json|object|search | -1 | 41 | 2 | 72,350,577 | 72,350,577 | 0 | true | 2022-05-23T14:44:33.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get another field of same object in JSON with vanilla JS?<p>I have a JSON like this:</p>
<pre><code>[
{
"title": "film1",
&qu... |
72,347,461 | JavaScript to Open Excel<p>Is there a way of opening an excel file using JavaScript.</p>
<p>The file should open in a <em><strong>native</strong></em> application (eg Excel) or Excel online</p> | <p>Browsers do not allow you to open a local file on a person's computer unless the user specifically selects which file to open.</p>
<p>Thus if the file is hosted on your webserver, the user would have to download the file.</p>
<p>If the user already has the file on their system, you could provide the functionality to... | JavaScript to Open Excel | javascript|excel|csv | 0 | 41 | 2 | 72,347,758 | 72,347,758 | 0 | true | 2022-05-23T11:01:26.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript to Open Excel<p>Is there a way of opening an excel file using JavaScript.</p>
<p>The file should open in a <em><strong>native</strong></em> applic... |
72,320,112 | comparing two meta data and their variables and options<p>I am validating two data frames if they are consistent, its working on small dataframes perfectly but when records of data frame increases then it shows error</p>
<pre><code>
library(tidyverse)
df1 <- data.frame(MAN=c(6,6,4,6,8,6,8,4,4,6,6,8,8),MANi=c("O... | <p>Worth considering <code>waldo::compare</code>?</p>
<pre class="lang-r prettyprint-override"><code>df1 <- data.frame(MAN=c(6,6,4,6,8,6,8,4,4,6,6,8,8),MANi=c("OD","NY","CA","CA","OD","CA","OD","NY","OL","NY","OD... | comparing two meta data and their variables and options | r | 0 | 41 | 1 | 72,331,555 | 72,331,555 | 0 | true | 2022-05-20T13:54:12.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
comparing two meta data and their variables and options<p>I am validating two data frames if they are consistent, its working on small dataframes perfectly b... |
72,365,682 | Regex pattern immediately followed by another String<p>In the following input string</p>
<blockquote>
<p>abcd, of regex is not my cup of tea and coffee , but abcd - and efgh of JS are my whisky</p>
</blockquote>
<p>I want to match <code>abcd - and</code> only.</p>
<p>More generally <code>ab.*?</code> followed by any nu... | <p>The pattern <code>abc.*?(?!(\w))\sand</code> matches too much, as <code>.*?</code> can backtrack (it matches any character) till this assertion <code>(?!(\w))</code> it true and it can match <code>\sand</code></p>
<p>But it is the same as writing <code>abc.*?\sand</code> because this part is always true <code>(?!(\w... | Regex pattern immediately followed by another String | regex | 0 | 41 | 2 | 72,365,772 | 72,365,772 | 0 | true | 2022-05-24T15:35:14.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex pattern immediately followed by another String<p>In the following input string</p>
<blockquote>
<p>abcd, of regex is not my cup of tea and coffee , but... |
72,376,527 | Unable to record for file path 'C:\....\MyProject.CAB' on every setup project in VS<p>I'm trying to build my setup project in VS but, suddendly, it doesn't work anymore.</p>
<p>I don't know what I have done, or what I do (except adding a new file), but i get this error :</p>
<p><em><strong>ERROR: Unable to create recor... | <p>The project is too heavy for .CAB file.
File format limitation (cannot be bigger than 2GB) create an error while building the setup.</p>
<p>Solution is don't use <strong>Package As : In Setup File</strong> but <strong>Package As : As loose uncompressed files</strong></p> | Unable to record for file path 'C:\....\MyProject.CAB' on every setup project in VS | visual-studio|setup-project | 0 | 41 | 1 | 72,429,840 | 72,429,840 | 0 | true | 2022-05-25T11:09:13.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to record for file path 'C:\....\MyProject.CAB' on every setup project in VS<p>I'm trying to build my setup project in VS but, suddendly, it doesn't w... |
72,308,160 | How to understand global and local scopes in Python?<p>I am a novice in Python and wondering the situation below.</p>
<pre><code>x = 1
def func():
print(x)
x = 2
return x
</code></pre>
<p>So I got the UnboundLocalError: local variable 'x' referenced before assignment.
But if I right understand - Python read... | <p>I think your problem was explained as well in the FAQ of <a href="https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value" rel="nofollow noreferrer">python docs</a></p>
<blockquote>
<p>This is because when you make an assignment to a variable in a scope,
tha... | How to understand global and local scopes in Python? | python|function|variables|scope|global-variables | 0 | 41 | 1 | 72,308,332 | 72,308,332 | 0 | true | 2022-05-19T16:36:10.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to understand global and local scopes in Python?<p>I am a novice in Python and wondering the situation below.</p>
<pre><code>x = 1
def func():
print(... |
72,253,993 | How to added hover to a div style<p>How can I use a:hover in inline CSS inside the HTML style attribute
<strong>like this but doesn't work</strong></p>
<pre><code> <div
style={{
"&:hover": {
background: "#efefef"
},
}} >
</div>
</code></pre> | <p>You can do this way.</p>
<pre><code>a:hover {
background-color: yellow;
}
</code></pre>
<p>See the full answer here. <a href="https://codepen.io/charp95/pen/LYQxZrm" rel="nofollow noreferrer">https://codepen.io/charp95/pen/LYQxZrm</a></p> | How to added hover to a div style | javascript|css | -1 | 41 | 2 | 72,254,078 | 72,254,078 | 0 | true | 2022-05-16T03:51:58.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to added hover to a div style<p>How can I use a:hover in inline CSS inside the HTML style attribute
<strong>like this but doesn't work</strong></p>
<pre>... |
72,345,198 | C++20 Unable to Satisfy Constraint for ranges::remove_if()<p>I have the following class:</p>
<pre><code>template<typename T>
class Node {
private:
T item_;
public:
T Item() const {return item_;}
Node(T item) : item_(item) {}
Node<T>& operator=(T item) { item_ = item; return *this;}
N... | <p>It works after adding the following <code>=</code> operator overload:</p>
<pre><code>Node<T>& operator=(Node<T> rhs) { item_ = rhs.Item(); return *this; }
</code></pre>
<p>I wonder why the original <code>=</code> operator overload with <code>rhs</code> reference doesn't work?</p> | C++20 Unable to Satisfy Constraint for ranges::remove_if() | compiler-errors|c++17|std-ranges|remove-if | 0 | 41 | 1 | 72,345,316 | 72,345,316 | 0 | true | 2022-05-23T08:08:44.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++20 Unable to Satisfy Constraint for ranges::remove_if()<p>I have the following class:</p>
<pre><code>template<typename T>
class Node {
private:
... |
72,276,126 | How to make this code go back the start of the problemstate?<p>I am trying to create a program where you can choose 3 options. Review, cheat sheet and math equations but don't worry about that. Is there any way to loop "def r()" to "problemstate()" to the start WHILE saving the stuff the user wrote ... | <p>You only have to add a infinite loop, there are many different ways of do that (in my example I use <code>while True</code>) an use <code>continue</code> to repeat the process.</p>
<pre><code>def problemstate():
while True:
# HERE: It is possible add a function to clean the console if you want
print(&qu... | How to make this code go back the start of the problemstate? | python|function|loops|while-loop|save | -1 | 41 | 2 | 72,276,545 | 72,276,545 | 0 | true | 2022-05-17T14:46:44.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make this code go back the start of the problemstate?<p>I am trying to create a program where you can choose 3 options. Review, cheat sheet and math e... |
72,303,431 | Filter field of manytomany field by a list<p>I would like to do the following with Django REST Framework:</p>
<p>Filter results based on a field of a manytomany field.</p>
<p>The query would look like this:
<a href="https://endpoint.com/api/artwork/?having_style=Modern,Contemporary" rel="nofollow noreferrer">https://en... | <p>Try adding <code>method</code> param in Filter declaration. Something like:</p>
<pre><code>class ArtWorkFilter(filters_rest.FilterSet):
having_style = django_filters.Filter(field_name="styles__name", lookup_expr='in')
class Meta:
model = ArtWork
fields = ['having_style']
def f... | Filter field of manytomany field by a list | python|django|filter|django-rest-framework | 0 | 41 | 2 | 72,304,012 | 72,304,012 | 0 | true | 2022-05-19T11:04:51.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter field of manytomany field by a list<p>I would like to do the following with Django REST Framework:</p>
<p>Filter results based on a field of a manytom... |
72,311,998 | Move Logo Without Changing Design<p>I have a logo I created using a div and two letters which I want to move inside the coral colored div. However every time I change left/right properties or margin/padding I end up changing the letter placement in the design.</p>
<p>I tried playing around with the CSS using developer ... | <p>Make the following changes to <code>.logo-container {...}</code>:</p>
<ul>
<li><p>Inside <code>.logo-container {...}</code>, include <code>position: relative</code> (to make absolute postioning of <code>.box</code> with respect to it, work). Then remove the <code>margin</code>, <code>left</code> and <code>right</cod... | Move Logo Without Changing Design | html|css|responsive | 0 | 41 | 1 | 72,313,165 | 72,313,165 | 0 | true | 2022-05-19T23:14:33.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Move Logo Without Changing Design<p>I have a logo I created using a div and two letters which I want to move inside the coral colored div. However every time... |
72,363,859 | how to direct python to fetch string in a different file<p>how do i change the "keyword" in parameter ('pegasus') to redirect to a separate txt file.
so later I just write whatever items I want to scrape in the file txt. Example of Pegasus, Phoenix, Lucid
then the keyword parameter is directed to a different ... | <blockquote>
<p>how do i change the "keyword" in parameter ('pegasus')</p>
</blockquote>
<p>If you mean changing "value" of key "keyword" inside parameter, then simply replace the value:</p>
<pre><code>parameter['keyword'] = "Pheonix"
</code></pre>
<hr />
<p>To read data from a .... | how to direct python to fetch string in a different file | python|api|scrape | 0 | 41 | 1 | 72,364,095 | 72,364,095 | 0 | true | 2022-05-24T13:33:15.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to direct python to fetch string in a different file<p>how do i change the "keyword" in parameter ('pegasus') to redirect to a separate txt fil... |
72,294,420 | Email Classifier to classify emails according to the time<p>I have to design a program that can classify emails as spam or nonspam using Python and Pandas.</p>
<p>I have done to classify the email as spam or nonspam according to the email's subject. For my second task, I have to classify the emails as spam or nonspam a... | <p>There are a million ways you could do this, but this is how I would do it. I provided comments and some naming conventions simply for clarity which should allow you to take and modify as necessary to fit your specific needs</p>
<pre><code>#All necessary imports
import pandas as pd
import numpy as np
import datetime
... | Email Classifier to classify emails according to the time | python|pandas | 0 | 41 | 1 | 72,294,761 | 72,294,761 | 0 | true | 2022-05-18T18:40:29.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Email Classifier to classify emails according to the time<p>I have to design a program that can classify emails as spam or nonspam using Python and Pandas.</... |
72,250,917 | Add information from adjacent rows pandas<p>I have a table</p>
<p><strong>Input table</strong></p>
<pre><code> id day info
0 1 1 i1
1 1 1 i2
2 1 1 i3
3 1 1 i4
4 1 1 i5
5 1 1 i6
6 1 2 j1
7 1 2 j2
</code></pre>
<p>I would like to attach the information from adjacent row... | <p>As you want only 5 elements, if should be efficient enough to use <code>shift</code> with the wanted strides:</p>
<pre><code>g = df.groupby(['id', 'day'])['info']
df['info'] = (pd
.concat([g.shift(i)
for i in [4,2,0,-2,-4]],
axis=1)
.agg(list, axis=1)
)
</c... | Add information from adjacent rows pandas | python|pandas | 1 | 41 | 1 | 72,251,380 | 72,251,380 | 0 | true | 2022-05-15T18:01:35.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add information from adjacent rows pandas<p>I have a table</p>
<p><strong>Input table</strong></p>
<pre><code> id day info
0 1 1 i1
1 1 1 i2
... |
72,371,514 | Removing an element from a dynamic array<p>I am trying to remove an object from an array of characters that i have dynamically allocated for. But when i check my output for this code I am segfaulting and i dont know why. I am quite new to memory allocation in C. This is just some test code I am writing before I put it ... | <p>You've made two major mistakes. The first is using this:</p>
<pre><code>char** test = malloc(count * sizeof(char*));
</code></pre>
<p>instead of this:</p>
<pre><code>char* test = malloc(count * sizeof(char));
</code></pre>
<p>There's no reason to use double-indirection here, and it leads to a lot of loose ends and b... | Removing an element from a dynamic array | arrays|c|segmentation-fault|dynamic-memory-allocation | 0 | 41 | 1 | 72,371,688 | 72,371,688 | 0 | true | 2022-05-25T02:59:06.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing an element from a dynamic array<p>I am trying to remove an object from an array of characters that i have dynamically allocated for. But when i chec... |
72,272,202 | ORACLE SQL DEV | Select only one duplicate row having the highest value<p>quick question about something i'm not able to find the answer.</p>
<p>The objective of my SQL request is to find the last holder from a cemetery emplacement by emplacement.</p>
<p>For example:</p>
<div class="s-table-container">
<table class="s-... | <p>Generally speaking, one option is to partition rows by <em>something</em> (that seems to be <code>id_carto_empl</code> in your case) and sort them in <em>some order</em> (in your case, <code>id_ext</code> in descending order).</p>
<p>Then, as a final result, return rows that ranked as the "highest" (i.e. h... | ORACLE SQL DEV | Select only one duplicate row having the highest value | duplicates|max|oracle-sqldeveloper | 0 | 41 | 2 | 72,272,321 | 72,272,321 | 0 | true | 2022-05-17T10:17:45.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ORACLE SQL DEV | Select only one duplicate row having the highest value<p>quick question about something i'm not able to find the answer.</p>
<p>The objectiv... |
72,313,605 | How to reorder the results of a for statement<pre><code>monthly_kwargs = {}
for i in range(1, 13):
gte = datetime(today.year, i, 1)
mo = f'{gte:%b}'.lower()
monthly_kwargs[mo] = Count('id', filter=Q(...))
monthly_kwargs['SPECIAL_' + mo] = Count('id', filter=Q(...))
monthly_kwargs['total'] = Count('i... | <p>Track the month names:</p>
<pre><code>months = []
monthly_kwargs = {}
for i in range(12):
gte = datetime(today.year, i+1, 1)
mo = f'{gte:%b}'.lower()
months.append( mo )
monthly_kwargs[mo] = Count('id', filter=Q(...))
monthly_kwargs['SPECIAL_' + mo] = Count('id', filter=Q(...))
monthly_kwargs... | How to reorder the results of a for statement | python | -3 | 41 | 1 | 72,313,725 | 72,313,725 | 0 | true | 2022-05-20T04:28:25.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reorder the results of a for statement<pre><code>monthly_kwargs = {}
for i in range(1, 13):
gte = datetime(today.year, i, 1)
mo = f'{gte:%b}'.... |
72,368,790 | Reinitialise a class when its method has been called N times<p>I'm working on a web scraper, built on Selenium, that looks something like this:</p>
<pre><code>class Scraper:
def __init__(self):
pass
def __enter__(self):
self.driver = webdriver.Chrome(
service=Service(ChromeDrive... | <p>The most straightforward solution to this would be to do something like:</p>
<pre><code>N = 100 # or however many times you want
while True:
with Scraper() as scraper:
for _ in range(N):
scraper.elt()
</code></pre>
<p>Or, re-organize your class, something like:</p>
<pre><code>class Scraper:
... | Reinitialise a class when its method has been called N times | python | 0 | 41 | 1 | 72,368,969 | 72,368,969 | 0 | true | 2022-05-24T19:56:42.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reinitialise a class when its method has been called N times<p>I'm working on a web scraper, built on Selenium, that looks something like this:</p>
<pre><cod... |
72,370,277 | Automate string input to a input<p>I know this question has been asked a hundred times.
But once again, the solutions no longer work.</p>
<p>I need to simulate key presses to automate a form.</p>
<p>If I do it like this</p>
<pre><code>document.getElementById("input_id").value = "testinput"
</code></... | <p>I have now found the following code that works for me:</p>
<pre><code>function set_value(doc, input_value) {
doc.value === undefined ? doc.innerHTML = input_value : doc.value = input_value;
events = ["keydown", "keypress", "input", "keyup", "change"]
for (var i... | Automate string input to a input | javascript|input | 1 | 41 | 2 | 72,500,130 | 72,500,130 | 0 | true | 2022-05-24T22:55:13.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Automate string input to a input<p>I know this question has been asked a hundred times.
But once again, the solutions no longer work.</p>
<p>I need to simula... |
72,327,645 | Comparing two variables in JSON File Python<p>Quick question - I have a Python Application that retrieves data from an API and implements it within a json file, and I programmed that functionality well. Now, I need to read the data, and if two variables in the .json file are greater than or less than, I need to recall ... | <pre><code>import json
with open("file.json", "r") as f:
json_obj = json.loads(f.read())
# compare values in 'json_obj' here
</code></pre>
<p>Example 1:</p>
<pre><code>if json_obj["key"] > 3.14:
do_something()
</code></pre>
<p>Example 2:</p>
<pre><code>if json_obj["key&qu... | Comparing two variables in JSON File Python | python|api | 0 | 41 | 1 | 72,327,686 | 72,327,686 | 0 | true | 2022-05-21T07:45:28.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparing two variables in JSON File Python<p>Quick question - I have a Python Application that retrieves data from an API and implements it within a json fi... |
72,271,262 | How to make a customizable color menu for flutter app?<p>I'd like to make an external dart file (let's call it color_palette.dart), that have some classes of colors. These classes would be able to be changed by a menu on another page of the app. These colors would be used in all the pages to define the colors of Appbar... | <p>very easy to do</p>
<pre><code> void main() {
//change color A from red to purple
MyColors.colorA = Colors.purple;
}
class MyColors {
static Color colorA = Colors.red;
static Color colorB = Colors.green;
static Color colorC = Colors.blue;
}
</code><... | How to make a customizable color menu for flutter app? | flutter|android-studio|class|colors|customization | 0 | 41 | 2 | 72,271,483 | 72,271,483 | 0 | true | 2022-05-17T09:11:16.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a customizable color menu for flutter app?<p>I'd like to make an external dart file (let's call it color_palette.dart), that have some classes of... |
72,255,696 | Select columns in pyrhon based on a condition<p>I am new to Python!</p>
<p>I have an input vector of p. I am trying to select columns of p such that p(i)>2 and put them into a new vector y. e.g. something like below which by the way, gives error:</p>
<pre><code>y=(p[i]>2)
</code></pre> | <p>If I understand correctly, your question is not about Pandas Dataframe, rather about regular Python List. If so, you can use list comprehension.</p>
<p>A list comprehension is a short syntax for iterating through a list and picking the elements that satisfy a certain condition.</p>
<p>Let's see first how you can acc... | Select columns in pyrhon based on a condition | python|python-3.x | 0 | 41 | 2 | 72,256,105 | 72,256,105 | 0 | true | 2022-05-16T07:42:38.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select columns in pyrhon based on a condition<p>I am new to Python!</p>
<p>I have an input vector of p. I am trying to select columns of p such that p(i)>... |
72,341,024 | Access to child of<p>am using API which allows me to collect data about countries. If i want get data about languages and currencies from different countries there is a problem because for example currencies in Poland has</p>
<p>currencies:
PLN: {name: 'Polish złoty', symbol: 'zł'}</p>
<p>and for Portuguesa has</p>
<p>... | <p>You have to do pretty hacky things to achieve this. I've come with this way, if you want to extract it directly from the API response:</p>
<pre><code>const currencyName = data[0].currencies[Object.keys(data[0].currencies)[0]].name;
</code></pre>
<p>A bit more readable:</p>
<pre><code>const currencies = data[0].curr... | Access to child of | javascript | 0 | 41 | 1 | 72,341,138 | 72,341,138 | 0 | true | 2022-05-22T20:17:42.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access to child of<p>am using API which allows me to collect data about countries. If i want get data about languages and currencies from different countries... |
72,239,787 | Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks?<p>Here is my code:</p>
<pre><code>import React, {useState, useRef, useEffect} from 'react';
import { getAuth, onAuthStateChanged } from 'firebase/auth';
import { useNavigate } from 'react-router-dom';
... | <p>What you're doing should be OK. Though it's perfectly OK to set up a single listener for your entire app at the global level (without a hook). That listener doesn't really "leak" anything. It just keeps getting called whenever the user's state changes, so you can decide what you want to do for your enti... | Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks? | javascript|reactjs|firebase|firebase-authentication | 0 | 41 | 1 | 72,240,521 | 72,240,521 | 1 | true | 2022-05-14T11:31:57.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks?<p>Here is my code:</p>
<pre><code>impo... |
72,241,876 | add-symbol-file for MCU app with offset on flash not showing any function names<p>I have an app running on a imx-rt-1024 nxp chip. I have a bootloader and the actual firmware app. My bootloader sits at 0x60000000 and my firmware app typically sits at 0x60020000.</p>
<p>But the app is compiled with -fPIC (position indep... | <blockquote>
<p>Am I misunderstanding the offset?</p>
</blockquote>
<p>Likely. The offset should be the address of <code>.text</code> <em>at runtime</em>, which <code>90000 == 0x15f90</code> isn't.</p>
<p>Use <code>readelf -WS Debug/iobox-imx-rt-1020.axf | grep .text</code> to find out where <code>.text</code> starts (... | add-symbol-file for MCU app with offset on flash not showing any function names | c|gdb | 0 | 41 | 1 | 72,245,273 | 72,245,273 | 1 | true | 2022-05-14T15:56:12.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
add-symbol-file for MCU app with offset on flash not showing any function names<p>I have an app running on a imx-rt-1024 nxp chip. I have a bootloader and th... |
72,246,091 | How to get value of the HTML element?<p>I have a question, how can i get value of the element using javaScript with Jquery? I have tried this and error sad .val() is not a function and i could not find any solution. Everithink i found told me it is not a function. Thanks for reply.</p>
<p><div class="snippet" data-lang... | <p>you can use <code>$(this).attr</code> for this</p>
<p><code>val()</code> works only on input or buttons</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 btn = $('.btn')... | How to get value of the HTML element? | javascript|html|jquery | 0 | 41 | 1 | 72,246,119 | 72,246,119 | 1 | true | 2022-05-15T06:45:02.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get value of the HTML element?<p>I have a question, how can i get value of the element using javaScript with Jquery? I have tried this and error sad .... |
72,247,630 | Get all threads of a process using win32api (Python)<p>Let's say I have the following code that gets a handle to a process:</p>
<pre><code>pid = 1234
procHandle = win32api.OpenProcess(win32con.MAXIMUM_ALLOWED,pywintypes.FALSE,pid)
</code></pre>
<p>How would I list and get handles on it's threads?</p> | <p>as far i know not exist public api which enumerated threads in process. but exist <code>NtQuerySystemInformation</code> and <code>SystemProcessInformation</code> or <code>SystemExtendedProcessInformation</code> - it return list of all processes and threads in system. by using this you can found all threads in proces... | Get all threads of a process using win32api (Python) | python|windows|winapi|token | 1 | 41 | 1 | 72,248,105 | 72,248,105 | 1 | true | 2022-05-15T11:00:46.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get all threads of a process using win32api (Python)<p>Let's say I have the following code that gets a handle to a process:</p>
<pre><code>pid = 1234
procHan... |
72,250,073 | How to loop and select from database<p>I am using Laravel and MySQL. I need to get the next question to display from the database.</p>
<p>The user can be signed up to multiple forms. Each question can be shared between forms or be unique to one form.</p>
<p><strong>Get the next question (by question order) in any form ... | <p>Here's a solution that should match what you described, returning the first question (by question_id) for any form that is not answered by a specific user (the user is a parameter you'd supply to a parameterized query):</p>
<pre><code>SELECT f.form_id, f.question_id
FROM questions AS q
INNER JOIN forms AS f
ON f.q... | How to loop and select from database | mysql|sql|laravel|forms|eloquent | 1 | 41 | 1 | 72,250,128 | 72,250,128 | 1 | true | 2022-05-15T16:18:02.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to loop and select from database<p>I am using Laravel and MySQL. I need to get the next question to display from the database.</p>
<p>The user can be sig... |
72,249,653 | When I print all the variables of a list it gives me an unexpected value that is inconsistent in c. Can you tell me what went wrong?<p>Here is the code</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
struct rule {
int id;
int allow[3];
};
char ... | <p>The initialization loop for <code>map</code> is incorrect: you never initialize the last element. You should use:</p>
<pre><code> int map[map_w * map_h];
for (int i = 0; i < map_w * map_h; i++) {
map[i] = 0;
}
</code></pre> | When I print all the variables of a list it gives me an unexpected value that is inconsistent in c. Can you tell me what went wrong? | c | 0 | 41 | 1 | 72,251,102 | 72,251,102 | 1 | true | 2022-05-15T15:26:54.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When I print all the variables of a list it gives me an unexpected value that is inconsistent in c. Can you tell me what went wrong?<p>Here is the code</p>
<... |
72,251,408 | Need to clear all textboxes inside several group in C#(Control.control not being recognised in my version)<p>I am working on a website where I have created a form page and added a button "Clear All" to allow clearing all textboxes in one go. I tried the contol.controls solution as given in <a href="https://st... | <p>This is a common problem. In fact, I ALSO have a routine to fill the text boxes from the database. So, now I don't have to write my binding code.</p>
<p>so, I tend to have two routines:</p>
<p>floader()
This routine takes ONE data row, and push out to a set of controls (I place them in a div with a "id").<... | Need to clear all textboxes inside several group in C#(Control.control not being recognised in my version) | html|css|asp.net|frontend|backend | 0 | 41 | 1 | 72,252,371 | 72,252,371 | 1 | true | 2022-05-15T19:06:49.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to clear all textboxes inside several group in C#(Control.control not being recognised in my version)<p>I am working on a website where I have created a... |
72,251,144 | Join tables in google sheet<p>I need to join these two tables into one</p>
<p>however, I'm having difficulty due to having duplicate registrations</p>
<p><em>table 1</em></p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">cpf</th>
<th style="text-align: left;">name</t... | <p>use:</p>
<pre><code>=INDEX({IFNA(VLOOKUP(F1:F10, {C1:C10, A1:D10}, {2, 3}, 0)), F1:J10})
</code></pre>
<p><a href="https://i.stack.imgur.com/6X6Rt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6X6Rt.png" alt="enter image description here" /></a></p> | Join tables in google sheet | google-sheets|google-sheets-formula|vlookup|transpose|flatten | 1 | 41 | 1 | 72,252,442 | 72,252,442 | 1 | true | 2022-05-15T18:32:04.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Join tables in google sheet<p>I need to join these two tables into one</p>
<p>however, I'm having difficulty due to having duplicate registrations</p>
<p><em... |
72,251,683 | Search values in a Pandas DataFrame with values from another DataFrame<p>I have 2 dataframes.</p>
<p><strong>df_dora</strong></p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th></th>
<th>content</th>
<th>feature</th>
<th>id</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>cyber hygien</td>
<td>... | <pre><code>unique_vals = '|'.join(df_dora.content.unique())
df_corpus.groupby('meta.name').apply(lambda x: x.content.str.findall(unique_vals).explode().value_counts())
</code></pre>
<p>Output given your four lines of each:</p>
<pre><code>17_La_Banque_2021 intellig share 1
Name: content, dtype: int64
</code></pre> | Search values in a Pandas DataFrame with values from another DataFrame | pandas|dataframe | 0 | 41 | 1 | 72,252,905 | 72,252,905 | 1 | true | 2022-05-15T19:44:54.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search values in a Pandas DataFrame with values from another DataFrame<p>I have 2 dataframes.</p>
<p><strong>df_dora</strong></p>
<div class="s-table-contain... |
72,252,733 | How to make table cells that contain images to resize without braking?<p>I have an image that I divided into several small images, each contained in a cell.
I'm trying to get the image centered and resized to fit a screen.</p>
<p>I looked at different solutions and tried to resize the table or the images for hours but ... | <p>Like I already said within the comments it would be the easiest way to wrap all the images in a single <code>div</code> and use <code>CSS-Grid</code> on the container. You have a total width of 1001px to cover as such create a 1001-column grid with <code>grid-template-columns: repeat(1001, 1fr);</code></p>
<p>Then d... | How to make table cells that contain images to resize without braking? | html|css|html-table | 0 | 41 | 1 | 72,253,387 | 72,253,387 | 1 | true | 2022-05-15T22:56:35.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make table cells that contain images to resize without braking?<p>I have an image that I divided into several small images, each contained in a cell.
... |
72,257,267 | How can I count subfolders in a Batch file<p>I need the count of the longest path in my folder and put it in a variable. Because when I remove recursively subfolders I have to do it multiple times to check if there is other empty folders.</p>
<pre><code>FOR /l %%y IN (0, 1, 3) DO (
FOR /r "%MyPath%" /d %%F IN... | <pre><code>for /f "delims=" %%s in ('dir /s /b /ad "%sourcedir%"^|sort /r') do dir /b "%%s"|findstr "^" > NUL|| RD "%%s"
</code></pre>
<p>should delete your empty directories.</p>
<p>The <code>dir</code> command lists the directories in the tree rooted at <code>sourc... | How can I count subfolders in a Batch file | batch-file|directory|subdirectory|working-directory | 0 | 41 | 1 | 72,260,053 | 72,260,053 | 1 | true | 2022-05-16T09:50:15.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I count subfolders in a Batch file<p>I need the count of the longest path in my folder and put it in a variable. Because when I remove recursively su... |
72,247,990 | Remove some, but not all overloaded functions inherited from base class<p>I am writing a vector class that takes ownership of member pointers. As far as possible, I want to reuse std:vector. I have been trying private and public inheritance; in both cases I am running into difficulties.</p>
<p>For private inheritance, ... | <p><em>From the comments:</em></p>
<p>Using <code>v[0]->m</code> will call the const-version of the operator if <code>v</code> is const. Otherwise it calls the non-const operator.</p>
<p>The fact that you don't write to <code>v</code> doesn't affect this.</p> | Remove some, but not all overloaded functions inherited from base class | c++|inheritance|overloading | 0 | 41 | 2 | 72,261,555 | 72,261,555 | 1 | true | 2022-05-15T11:50:41.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove some, but not all overloaded functions inherited from base class<p>I am writing a vector class that takes ownership of member pointers. As far as poss... |
72,262,798 | CSS Transition - why does my code not work?<p>Quite a simple one but I'm sure I'm doing something wrong; the following code doesn't work in either Chrome or Firefox (ie, it displays as would be expected without the transition property, with the element immediately switching from blue to red):</p>
<p><div class="snippet... | <p><code>transition</code> properties should not be separated with commas</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-css lang-css prettyprint-override"><code>.button {
background-color: blue;
transition: ba... | CSS Transition - why does my code not work? | css|css-transitions | 0 | 41 | 2 | 72,262,880 | 72,262,880 | 1 | true | 2022-05-16T16:48:48.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS Transition - why does my code not work?<p>Quite a simple one but I'm sure I'm doing something wrong; the following code doesn't work in either Chrome or ... |
72,259,805 | How to group by time-interval from bottom to top using Pandas resample functionality?<p>I am working with historic data of some stocks. I want to group data by certain time intervals (like 1hr, 3days, etc). Pandas gives amazing functionality of doing this with very less efforts using <code>resampling</code>. But it hap... | <p>Maybe you can use the <code>iloc</code> to reverse after resample? I'm not sure if that hinders your further calculations, but it can resample and reverse the set.</p>
<p>Since I do not have access to your exact sample data</p>
<p><strong>Here's how I am testing it:</strong></p>
<pre><code>import yfinance as yf
impo... | How to group by time-interval from bottom to top using Pandas resample functionality? | python|pandas|date | 0 | 41 | 1 | 72,264,831 | 72,264,831 | 1 | true | 2022-05-16T13:13:09.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to group by time-interval from bottom to top using Pandas resample functionality?<p>I am working with historic data of some stocks. I want to group data ... |
72,264,933 | appendChild onclick will only add div once<p>I'm doing a timetable and to do list website. So, I basically add divs for each timetable block. I've used this tutorial on yt (<a href="https://youtu.be/MkESyVB4oUw" rel="nofollow noreferrer">https://youtu.be/MkESyVB4oUw</a>) for the timetable blocks. (At 24:03) So in HTML ... | <p>I figured this out mid-writing it. Because when the addEventListener starts for the form, that's when I did all the appending. So the simple solution to this was simply adding the createElement inside the function.</p>
<pre><code> todoAdd.onclick = function(){
const todoDiv = document.createElement('div');
... | appendChild onclick will only add div once | javascript|onclick|addeventlistener|appendchild|createelement | 0 | 41 | 1 | 72,264,934 | 72,264,934 | 1 | true | 2022-05-16T19:59:35.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
appendChild onclick will only add div once<p>I'm doing a timetable and to do list website. So, I basically add divs for each timetable block. I've used this ... |
72,266,059 | Jooq Multiset - SQL shows the word multiset thorwing syntax error - Postgres<p>I am using Jooq version 3.16.6 with Java 11 and Spring Boot 2.6.6 and (PostgreSQL) 14.1</p>
<p>The issue i am having is with multiset , the non multiset query using the old join method works fine . However when using multiset and examining t... | <p>You probably haven't configured your <a href="https://www.jooq.org/javadoc/latest/org.jooq/org/jooq/SQLDialect.html" rel="nofollow noreferrer"><code>SQLDialect</code></a> correctly, e.g.</p>
<pre><code>spring.jooq.sql-dialect=Postgres
</code></pre>
<p>See also: <a href="https://stackoverflow.com/q/43102316/521799">S... | Jooq Multiset - SQL shows the word multiset thorwing syntax error - Postgres | java|spring|postgresql|jooq | 1 | 41 | 1 | 72,269,429 | 72,269,429 | 1 | true | 2022-05-16T21:57:13.333Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jooq Multiset - SQL shows the word multiset thorwing syntax error - Postgres<p>I am using Jooq version 3.16.6 with Java 11 and Spring Boot 2.6.6 and (Postgre... |
72,270,502 | Django convert model objects to dictionary in large volumes results in server timeout<p>I have been having a problem where a Django server takes forever to return a response. When running with gunicorn in Heroku I get a timeout, so can't receive the response. If I run locally, it takes a while, but after some time it c... | <p>At first glance, your main problem is most likely you're hitting the database twice for each EntryState instance.</p>
<p><code>convertToDict</code> method makes use of FK <code>entry</code> and for each entry, you also fetch the M2M <code>tags</code>. Solution is to optimize the query.</p>
<p>First, let's identify t... | Django convert model objects to dictionary in large volumes results in server timeout | python|django|django-models|django-queryset | 1 | 41 | 2 | 72,271,902 | 72,271,902 | 1 | true | 2022-05-17T08:20:10.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django convert model objects to dictionary in large volumes results in server timeout<p>I have been having a problem where a Django server takes forever to r... |
72,271,331 | how to add greek letters to nomnoml diagram in R<p>I am using the <code>nomnoml</code> package to create diagrams in combination with <code>rmarkdown</code>. How can I add greek letters to my arrows?</p>
<p>I have naively tried the following</p>
<pre><code>---
title: "Nomnoml Diagram"
output: html_document
--... | <p>I think if you want to use Unicode escapes in the source, you will have to use an R code chunk instead of a nomnoml code chunk. For example,</p>
<pre><code>---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(nomnoml)
```
```{r echo=FALSE... | how to add greek letters to nomnoml diagram in R | javascript|r|nomnoml | 1 | 41 | 2 | 72,274,355 | 72,274,355 | 1 | true | 2022-05-17T09:16:39.120Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to add greek letters to nomnoml diagram in R<p>I am using the <code>nomnoml</code> package to create diagrams in combination with <code>rmarkdown</code>.... |
72,278,073 | How to use live reload in an express server<p>So i'm using express to make a server:</p>
<pre><code>const express = require('express');
const app = express();
const PORT = 3000;
app.use(express.static("public"));
app.get('/', (req, res) => {
res.sendFile('index.html');
});
app.listen(PORT, () => ... | <pre><code>npm install -g nodemon
</code></pre>
<p>next add a script line to your package.json</p>
<pre><code>"live": "nodemon server.js"
</code></pre>
<p>now when you npm live it'll live reload</p>
<p>for more details see <a href="https://github.com/remy/nodemon" rel="nofollow noreferrer">https://... | How to use live reload in an express server | javascript|node.js|express | 0 | 41 | 1 | 72,278,114 | 72,278,114 | 1 | true | 2022-05-17T17:05:26.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use live reload in an express server<p>So i'm using express to make a server:</p>
<pre><code>const express = require('express');
const app = express()... |
72,280,264 | Issues with comparing magnitude symbolic expressions in Pydrake<p>I'm writing some code based on the potential iLQR template from the underactuated robotics course (google colab), and for my trajectory optimization problem in particular, I added collision avoidance costs as a part of the trajectory cost (because I have... | <p>I haven't looked carefully, but would <a href="https://drake.mit.edu/pydrake/pydrake.symbolic.html#pydrake.symbolic.if_then_else" rel="nofollow noreferrer">if_then_else</a> expression resolve your problem?</p>
<pre class="lang-py prettyprint-override"><code>d_12_cost = if_then_else(d_12 < threshold, 10*d_12, 0)
<... | Issues with comparing magnitude symbolic expressions in Pydrake | python|drake | 1 | 41 | 1 | 72,281,004 | 72,281,004 | 1 | true | 2022-05-17T20:24:44.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issues with comparing magnitude symbolic expressions in Pydrake<p>I'm writing some code based on the potential iLQR template from the underactuated robotics ... |
72,289,289 | Arima and Regression to predict Sales in R<p>In the below sample data, there are five columns.</p>
<pre><code>Column 1 is the name of the group
Column 2 is the date
Columns 3 and 4 are independent variables.
Column 5 is the dependent variable (to be predicted) - last value in this column is NA, which is to be predicte... | <p>You can use fable. Full explanation you can find in <a href="https://otexts.com/fpp3/" rel="nofollow noreferrer">Forecasting: Principles and practice</a></p>
<p>Example based on your data, with the key set to the group so forecasts are done for each group.</p>
<pre><code># fpp3 installs fable and a bunch of other ne... | Arima and Regression to predict Sales in R | r|time-series|regression|arima | 0 | 41 | 1 | 72,290,213 | 72,290,213 | 1 | true | 2022-05-18T12:35:15.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arima and Regression to predict Sales in R<p>In the below sample data, there are five columns.</p>
<pre><code>Column 1 is the name of the group
Column 2 is t... |
72,291,311 | Linear regression and variability from this line<p>I have a set of data, and am using a linear regression line to measure the "best fit" line for the whole sample set.</p>
<p>What is the statistical function called that measures the amount of variability from this line?</p>
<p>For the examples below, I'd pref... | <p>If I clearly understood your question, you are looking for a Coefficient of determination. It is the proportion of the variation in the dependent variable that is predictable from the independent variable(s).</p> | Linear regression and variability from this line | python|linear-regression|curve-fitting | -1 | 41 | 1 | 72,293,177 | 72,293,177 | 1 | true | 2022-05-18T14:42:58.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linear regression and variability from this line<p>I have a set of data, and am using a linear regression line to measure the "best fit" line for t... |
72,293,309 | Boost post request continuously CPP<pre><code>#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hpp>
#include <boost/asio/strand.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/beast/http/basic_dynamic_body.hpp>
#include <b... | <p>So, your code was incomplete, contains a boatload of unneeded dependencies, and doesn't show what you're trying to do.</p>
<p>Here's the code made self-contained, please start from this and <strong>keep it self-contained</strong> to illustrate the question you're having.</p>
<p><strong><a href="http://coliru.stacked... | Boost post request continuously CPP | c++|json|http|boost | 0 | 41 | 1 | 72,294,700 | 72,294,700 | 1 | true | 2022-05-18T17:07:26.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Boost post request continuously CPP<pre><code>#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hp... |
72,295,218 | Query to count the number of documents for each user<p>I have a collection named 'captures' and the documents within it have the field 'username'</p>
<p>a document looks something like this</p>
<pre><code>/* 1 */
{
"_id" : ObjectId("622b951a026ca3a73f5a2a1c"),
"username" : "an... | <p>This is pretty simple to do with the aggregation framework:</p>
<pre class="lang-json prettyprint-override"><code>[
{
$project: {
_id: 0,
user: '$username',
start: {
$toDate: '$data.metadata.start'
}
}
},
{
$match: {
start: {
$gt: Date('2022-02-24T09:32... | Query to count the number of documents for each user | mongodb|mongodb-query | 0 | 41 | 1 | 72,295,560 | 72,295,560 | 1 | true | 2022-05-18T19:53:30.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query to count the number of documents for each user<p>I have a collection named 'captures' and the documents within it have the field 'username'</p>
<p>a do... |
72,295,486 | How to use Foreach in JavaScript to do multiplication of 2 multiline textboxes<p>I am learning some new concept in JavaScript.
Can some body help me to achieve the following results.</p>
<p><a href="https://i.stack.imgur.com/jnm2Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jnm2Q.png" alt="enter ... | <p><code>getField</code> is not a native JavaScript function. I'll just define it in the snippet below.</p>
<p>Some remarks:</p>
<ul>
<li><code>split('\r')</code> may not be the best way to get the lines, as there might be <code>\n</code> characters in there too. I would instead match numbers with a regular expression ... | How to use Foreach in JavaScript to do multiplication of 2 multiline textboxes | javascript | 0 | 41 | 2 | 72,295,738 | 72,295,738 | 1 | true | 2022-05-18T20:21:00.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Foreach in JavaScript to do multiplication of 2 multiline textboxes<p>I am learning some new concept in JavaScript.
Can some body help me to achie... |
72,296,214 | Python binding variables<p>I am completely lost here:</p>
<pre class="lang-py prettyprint-override"><code>v_sql = "SELECT widget_name, widget_url FROM widget_calls WHERE widget_name = :widget"
cursor.execute(v_sql, widget=widget_name)
df_wid = pd.read_sql(v_sql, con=connection)
</code></pre>
<p>Result:</p>
<p... | <p>The <code>cursor.execute</code> call and the <code>pd.read_sql</code> call are completely unrelated. You're doing the query twice, and throwing away the first result. I would delete the useless <code>cursor.execute</code>.</p>
<p>And for read_sql, you need:</p>
<pre><code>df_wid = pd.read_sql( v_sql, con=connectio... | Python binding variables | python|oracle|variables|bind | 0 | 41 | 1 | 72,296,282 | 72,296,282 | 1 | true | 2022-05-18T21:29:28.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python binding variables<p>I am completely lost here:</p>
<pre class="lang-py prettyprint-override"><code>v_sql = "SELECT widget_name, widget_url FROM w... |
72,299,471 | python selenium, cant retrieve text of xpath<p>Im struggling with scraping a few pages ... it happens when the structure of the page implies a lot of nested divs...
Here is the code page:</p>
<pre><code><div>
<section class="ui-accordion-header ui-state-default ui-corner-all ui-accordion-icons... | <p>The method <code>.text</code> works only when the webelement containing the text is visible in the webpage. If otherwise the webelement is hidden, you have to use <code>.get_attribute('innerText')</code> or <code>.get_attribute('textContent')</code> or <code>.get_attribute('innerHTML')</code> (see <a href="https://w... | python selenium, cant retrieve text of xpath | python|html|selenium|nested | 1 | 41 | 1 | 72,299,825 | 72,299,825 | 1 | true | 2022-05-19T06:16:54.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python selenium, cant retrieve text of xpath<p>Im struggling with scraping a few pages ... it happens when the structure of the page implies a lot of nested ... |
72,278,538 | Having a Max Items per page on JHipster even when i ask for more<p>this is my first project doing jhipster <strong>(microservice : Spring boot - Angular)</strong> and we have implemented the pagination for most of our <code>findRequests</code>.<br />
We have set the <code>MAX_ITEMS_PER_PAGE</code> to <strong>20</strong... | <p>The problem lies in the fact that in <code>JavaScript</code> the <code>Number.MAX_SAFE_INTEGER</code> equals to <code>9007199254740991</code> while in <code>java</code> the max value that an <code>int</code> can get is <code>2 billion minus 1</code> (i.e. <code>1 999 999 999</code>) and it was giving me the <code>de... | Having a Max Items per page on JHipster even when i ask for more | angular|spring-boot|pagination|jhipster | 1 | 41 | 1 | 72,303,546 | 72,303,546 | 1 | true | 2022-05-17T17:47:47.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Having a Max Items per page on JHipster even when i ask for more<p>this is my first project doing jhipster <strong>(microservice : Spring boot - Angular)</st... |
72,300,861 | screen.update returning an error (Python Turtle module)<p>In my snake code project, I need to set the tracer to 0 and then use the update method to render a snake game like animation for my turtles. Here is my code:</p>
<pre><code># setup screen
screen = Screen()
screen.setup(width=600, height=600)
screen.bgcolor(&quo... | <p>Your immediate problem is these two lines:</p>
<pre><code>new_x = segments[seg_num - 1].xcor
new_y = segments[seg_num - 1].ycor
</code></pre>
<p><code>xcor</code> and <code>ycor</code> are methods, not properties and so should be invoked:</p>
<pre><code>new_x = segments[seg_num - 1].xcor()
new_y = segments[seg_num -... | screen.update returning an error (Python Turtle module) | python|turtle-graphics|python-turtle | 1 | 41 | 1 | 72,307,350 | 72,307,350 | 1 | true | 2022-05-19T08:08:30.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
screen.update returning an error (Python Turtle module)<p>In my snake code project, I need to set the tracer to 0 and then use the update method to render a ... |
72,300,376 | restful api get not work,but scan can work<p>anybody know why restful api scan has data</p>
<p><a href="http://127.0.0.1:8080/ignite?cmd=qryscanexe&pageSize=5&cacheName=contact" rel="nofollow noreferrer">http://127.0.0.1:8080/ignite?cmd=qryscanexe&pageSize=5&cacheName=contact</a></p>
<p>result
{
"s... | <p>By default Ignite REST <a href="https://www.gridgain.com/docs/latest/developers-guide/restapi#data-types" rel="nofollow noreferrer">supports</a> Java built-in types for get/put operations. But it should be possible to implement a custom <a href="https://www.gridgain.com/sdk/ee/latest/javadoc/org/apache/ignite/config... | restful api get not work,but scan can work | ignite | 0 | 41 | 1 | 72,307,841 | 72,307,841 | 1 | true | 2022-05-19T07:30:02.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
restful api get not work,but scan can work<p>anybody know why restful api scan has data</p>
<p><a href="http://127.0.0.1:8080/ignite?cmd=qryscanexe&pageS... |
72,315,814 | REGEX : accept only alphanumeric characters and spaces except the spaces at the begining or ending of expression<p>I need to implement regular expression that accept only alphanumeric characters and spaces except the spaces at the begining or ending of expression.</p>
<pre><code>' aaaa978aa' ===> fail
'aaaaaa ... | <p>I would write the regex as the following in case insensitive mode:</p>
<pre><code>^[a-z0-9](?:[a-z0-9 ]*[a-z0-9])?$
</code></pre>
<p>This requires a leading alphanumeric character, along with optional alphas or spaces in the middle, ending also with an alphanumeric character, at least for the case where the length b... | REGEX : accept only alphanumeric characters and spaces except the spaces at the begining or ending of expression | javascript|regex | -1 | 41 | 2 | 72,315,924 | 72,315,924 | 1 | true | 2022-05-20T08:30:04.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
REGEX : accept only alphanumeric characters and spaces except the spaces at the begining or ending of expression<p>I need to implement regular expression tha... |
72,315,739 | Getting all projects that the user has access tol<p>I'm trying to get a list of all projects that a user has access to. To get all projects I would need all hubs, but I'm only getting the hub of the user's organisation so I only can get projects hosted by that organisation.
Is there a way to get all projects that the u... | <p>With your <strong>Forge app</strong> you can get a list of <strong>all the hubs</strong> that<br />
(1) the user has access to <strong>AND</strong> (2) your <strong>Forge app</strong> has been <strong>provisioned</strong> for</p>
<p>In the reply from the <code>GET /hubs</code> <a href="https://forge.autodesk.com/en/... | Getting all projects that the user has access tol | autodesk-forge | 0 | 41 | 1 | 72,316,722 | 72,316,722 | 1 | true | 2022-05-20T08:23:30.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting all projects that the user has access tol<p>I'm trying to get a list of all projects that a user has access to. To get all projects I would need all ... |
72,316,621 | EMPTY? expected input to be a string or list but got the TRUE/FALSE false instead<p>I used "empty?" in many parts of the code and I don't understand the error in which part it refers exactly. I write here a part of code where I used 'empty?'. I don't understand what is wrong.</p>
<pre><code>""ask sh... | <p>The order om which Netlogo tries to execute the different procedures is the problem here. If I would write it down using brackets, Netlogo is trying to:
<code>(ifelse (empty? (onlyNodes = TRUE)))</code></p>
<p>You can introduce brackets of yourself into your code when you are not sure in which order Netlogo would ex... | EMPTY? expected input to be a string or list but got the TRUE/FALSE false instead | netlogo | 0 | 41 | 1 | 72,317,060 | 72,317,060 | 1 | true | 2022-05-20T09:30:04.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EMPTY? expected input to be a string or list but got the TRUE/FALSE false instead<p>I used "empty?" in many parts of the code and I don't understan... |
72,318,091 | Array slice does not return the remaining items<p>As per the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice" rel="nofollow noreferrer">MDN docs</a>, if the <code>end</code> parameter in <code>Array.slice(start, end)</code> is greater than the length of the sequence... | <p>The <code>begin</code> and <code>end</code> symbolise indexes of the array in the documentation. <code>start</code> is inclusive, but <code>end</code> is exclusive, so you are trying to retrieve slice for the following range: <code>[25, 25)</code> that is an empty set from the mathematical point of view.</p>
<p>Your... | Array slice does not return the remaining items | javascript | 2 | 41 | 2 | 72,318,204 | 72,318,204 | 1 | true | 2022-05-20T11:19:32.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array slice does not return the remaining items<p>As per the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/... |
72,319,702 | How to embed matplotlib plot PyQt5 QGroupBox<p>I need to embed a plot into the PyQt widget. I can open the txt file with QFileDialog and plot the data separately, but I need to embed the figure into the initial solution group box. Here is the UI image.
<a href="https://i.stack.imgur.com/Qee1q.png" rel="nofollow norefer... | <p>You need to create a <code>FigureCanvas</code> from the axis figure, then add that to the layout.</p>
<p>The following assumes that the "Initial Solution" group box is called <code>initialSolution</code>. Since you didn't provide the UI, I don't know if that box already has a layout or not, so I check for ... | How to embed matplotlib plot PyQt5 QGroupBox | matplotlib|plot|pyqt5 | 0 | 41 | 1 | 72,321,848 | 72,321,848 | 1 | true | 2022-05-20T13:24:54.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to embed matplotlib plot PyQt5 QGroupBox<p>I need to embed a plot into the PyQt widget. I can open the txt file with QFileDialog and plot the data separa... |
72,325,388 | Fillna() not imputing values with respect to groupby()<p>I'm trying to use fillna() and transform() to impute some missing values in a column with respect to the 'release_year' and 'brand_name' of the phone, but after running my code I still have the same missing value counts.</p>
<p>Here are my missing value counts &a... | <p>I guess your imputation method is not suited for your data, in that when <code>main_camera_mp</code> is missing, it is missing for all entries in that <code>release_year</code>-<code>brand_name</code> group. Thus the series derived from the groupby object that you pass as the fill value will itself have missing valu... | Fillna() not imputing values with respect to groupby() | python|data-science|imputation|fillna | 0 | 41 | 1 | 72,326,405 | 72,326,405 | 1 | true | 2022-05-20T22:45:02.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fillna() not imputing values with respect to groupby()<p>I'm trying to use fillna() and transform() to impute some missing values in a column with respect to... |
72,329,160 | How to insert items from list of list into excel cells using nested for loops?<p>I have saved the days in the current month in a list using the calendar module. I want the days (aka items) to be displayed in a excel file I've created.</p>
<p><a href="https://i.stack.imgur.com/NxMaL.png" rel="nofollow noreferrer"><img s... | <p>As <code>cell</code> is not an integer, this is not a valid statement as you are trying to access indices in a list.</p>
<p>I think that something like:</p>
<pre class="lang-py prettyprint-override"><code>for rows in cell_range:
for cell in rows:
if cell.row % 2 == 0:
cell.value = days_in_the... | How to insert items from list of list into excel cells using nested for loops? | python|excel|calendar|openpyxl|nested-loops | 0 | 41 | 1 | 72,329,337 | 72,329,337 | 1 | true | 2022-05-21T11:33:24.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to insert items from list of list into excel cells using nested for loops?<p>I have saved the days in the current month in a list using the calendar modu... |
72,329,536 | Sorting alphanumeric text as alphabetically in Google Sheet<p>I have a Google Sheel Which Have alphanumeric text, as Can be seen in Picture
![Text]
(<a href="https://i.stack.imgur.com/lUs91.png" rel="nofollow noreferrer">https://i.stack.imgur.com/lUs91.png</a>)</p>
<p>I Want To sort All Rows with Custom Sort List as (&... | <p>Put this formula in a free range in <code>Sheet2</code>, such as cell <code>Sheet2!AA2</code>:</p>
<pre><code>=transpose(
sort(
transpose(L2:V2),
9 * regexmatch(transpose(trim(L2:V2)), "(?i)wireless"), false,
7 * regexmatch(transpose(trim(L2:V2)), "(?i)landline"), false,
5 ... | Sorting alphanumeric text as alphabetically in Google Sheet | sorting|google-sheets | 0 | 41 | 1 | 72,330,049 | 72,330,049 | 1 | true | 2022-05-21T12:25:46.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting alphanumeric text as alphabetically in Google Sheet<p>I have a Google Sheel Which Have alphanumeric text, as Can be seen in Picture
![Text]
(<a href=... |
72,331,143 | Adding array of objects to object<p>I am trying to return some data as JSON.</p>
<p>I have an array of values:</p>
<pre><code>[
{ FieldValue: '102969', count: 1 },
{ FieldValue: 'DBFL', count: 26 },
{ FieldValue: 'Daniel', count: 1 },
{ FieldValue: 'KNI', count: 9 },
{ FieldValue: 'ON', count: 895 },
{ Fiel... | <p>You need to write something like this,</p>
<pre><code>const objectToReturn = {
FieldName: row.FieldName,
FieldValues: [...values]
};
objectToReturn.FieldValues.push(values);
returnArr.push(objectToReturn);
console.log(returnArr);
</code></pre>
<p>I don't agree with other answers as they will have th... | Adding array of objects to object | javascript|arrays | 1 | 41 | 3 | 72,331,210 | 72,331,210 | 1 | true | 2022-05-21T15:55:17.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding array of objects to object<p>I am trying to return some data as JSON.</p>
<p>I have an array of values:</p>
<pre><code>[
{ FieldValue: '102969', cou... |
72,330,697 | Opengl only binds buffers from function that created them<p>I'm trying to write a very barebones game engine to learn how they work internally and I've gotten to the point where I have a "client" app sending work to the engine. This works so far but the problem I am having is that my test triangle only render... | <p>You seem to not bind the vertex buffer to the <code>GL_ARRAY_BUFFER</code> buffer binding point before calling <code>glVertexAttribPointer</code>.</p>
<p><code>glVertexAttribPointer</code> uses the buffer bound to <code>GL_ARRAY_BUFFER</code> in order to know which buffer is the vertex attribute source for that gene... | Opengl only binds buffers from function that created them | c++|opengl | 0 | 41 | 1 | 72,331,392 | 72,331,392 | 1 | true | 2022-05-21T15:01:41.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Opengl only binds buffers from function that created them<p>I'm trying to write a very barebones game engine to learn how they work internally and I've gotte... |
72,336,570 | vue-router : the page remains the same<p>I want to show 'Welcome.vue' when i move to localhost:8080/main</p>
<p>[main.js]</p>
<pre><code>import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vuetify from './plugins/vuetify'
import Vuelidate from 'vuelidate'
... | <p>I added < router-view /> in App.vue. It's working well now.</p>
<p>[App.vue]</p>
<pre><code><template>
<router-view/>
</template>
</code></pre> | vue-router : the page remains the same | vue.js|vue-router | 1 | 41 | 1 | 72,342,286 | 72,342,286 | 1 | true | 2022-05-22T10:08:54.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
vue-router : the page remains the same<p>I want to show 'Welcome.vue' when i move to localhost:8080/main</p>
<p>[main.js]</p>
<pre><code>import Vue from 'vue... |
72,342,401 | Return two design elements in builder<pre><code> Widget build(BuildContext context) {
super.build(context);
return Scaffold(
...
...
...
builder: (BuildContext context) { //BuildContext context
final innerScrollController = PrimaryScrollController.of(context);
return TabMedium... | <p>Did you try <code>Column</code> ??</p>
<pre><code>Widget build(BuildContext context) {
super.build(context);
return Scaffold(
...
...
...
builder: (BuildContext context) { //BuildContext context
final innerScrollController = PrimaryScrollController.of(context);
return Column(
... | Return two design elements in builder | flutter|dart|flutter-layout|scaffold | 0 | 41 | 3 | 72,342,446 | 72,342,446 | 1 | true | 2022-05-23T01:22:14.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return two design elements in builder<pre><code> Widget build(BuildContext context) {
super.build(context);
return Scaffold(
...
...
...
build... |
72,346,663 | How do I use a variable name as an argument in a manually created function?<p>I have 2 data frame:</p>
<pre><code>df <- data.frame (model = c("A","A","A","B","B","B"),
category = c("z3","f4","c5","d3&quo... | <p>A couple of changes,</p>
<pre><code>converte <- function(x,y,z) {
#summerise by category and model
df.agg <-x %>%
group_by(across(c({{z}}, model))) %>%
summarise(sale = sum(sale))
#Drop duplicated rows
df.clean <- y[!duplicated(y[[z]]), ]
#merge 2 dataframe
df.merge <- merge(x... | How do I use a variable name as an argument in a manually created function? | r|function|loops|dplyr|tidyverse | 0 | 41 | 1 | 72,347,423 | 72,347,423 | 1 | true | 2022-05-23T10:01:48.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I use a variable name as an argument in a manually created function?<p>I have 2 data frame:</p>
<pre><code>df <- data.frame (model = c("A"... |
72,354,986 | Mean by groups by multiple columns in r<p>I have the next dataframe</p>
<pre><code>obs1 obs2 obs3 zone
1 0 1 Rural
1 1 1 Rural
0 1 1 Urban
1 0 0 Urban
0 1 0 Rural
</code></pre>
<p>I am trying to get something like this</p>
<pre><code>Mean ... | <p>To add an {dplyr} approach:</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
dat %>%
group_by(zone) %>%
summarise(values = mean(c_across(obs1:obs3)))
#> # A tibble: 2 x 2
#> zone values
#> <chr> <dbl>
#> 1 Rural 0.667
#> 2 Urban 0.5
# data
dat <-... | Mean by groups by multiple columns in r | r|row|multiple-columns|mean|group | 1 | 41 | 2 | 72,357,292 | 72,357,292 | 1 | true | 2022-05-23T21:30:47.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mean by groups by multiple columns in r<p>I have the next dataframe</p>
<pre><code>obs1 obs2 obs3 zone
1 0 1 Rural
1 1 1 ... |
72,357,615 | I need to select same column name twice having deferent values based on another table<p>I created 2 tables
1st table "Storages"
noting that Id is PK</p>
<p>2nd table "Transactions" where fields names are (Id, Source, Qty, Destination)
Also noting that Id is PK</p>
<p>My SQL statement gave me nothing... | <p>You can get your expected result using two <code>JOIN</code>, one on the source of the transaction and one on the destination:</p>
<pre><code>SELECT s1.name AS source, s2.name AS destination
FROM transactions t
JOIN storages s1 ON s1.id = t.source
JOIN storages s2 ON s2.id = t.destination;
</code></pre>
<p>In case ... | I need to select same column name twice having deferent values based on another table | sql|join|select | -2 | 41 | 1 | 72,357,835 | 72,357,835 | 1 | true | 2022-05-24T05:31:04.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I need to select same column name twice having deferent values based on another table<p>I created 2 tables
1st table "Storages"
noting that Id is P... |
72,312,721 | R phytools add color to branches in 3D phylogenetic tree<p>I am using R "phytools" library for the 3D phylogenetic tree.</p>
<p>And I have made 3D tree successfully with the script below</p>
<pre><code>library(phytools)
library(rgl)
tree<-read.tree(text="((un6:3,(un2:2,(un7:1,un5:1):1):1):1,((un1:1,u... | <p>Exploring the function <code>fancyTree</code> at <a href="https://github.com/liamrevell/phytools/blob/master/R/fancyTree.R" rel="nofollow noreferrer">github</a>, we can see that the argument <code>type="traitgram3d"</code> internally calls a function <code>traitgram3d</code>, which in turn is a wrapper for... | R phytools add color to branches in 3D phylogenetic tree | r|3d|phylogeny | 0 | 41 | 1 | 72,360,738 | 72,360,738 | 1 | true | 2022-05-20T01:42:25.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R phytools add color to branches in 3D phylogenetic tree<p>I am using R "phytools" library for the 3D phylogenetic tree.</p>
<p>And I have made 3D ... |
72,360,697 | Convert string data to dictionary inside list<p>From a script, I am getting data like that is given below.</p>
<pre><code>Neha, 30,A
Monika ,22,B
Anni,33,C
</code></pre>
<p>I want to convert this data in a given way that is given below.</p>
<pre><code>[{'name':Neha,'age':30,'grade':A},{'name':Monika,'age':22,'grade':B}... | <p>This is your solution</p>
<pre><code>s = """Neha,30,A
Monika,22,B
Anni,33,C"""
# print(s.split('\n'))
l = []
s = s.split('\n')
for i in s:
# print(i)
temp = i.split(',')
# print(temp)
d = {}
d['name'] = temp[0]
d['age'] = temp[1]
d['grade'] = temp[2]
... | Convert string data to dictionary inside list | python|list|dictionary | -1 | 41 | 1 | 72,361,298 | 72,361,298 | 1 | true | 2022-05-24T09:45:24.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert string data to dictionary inside list<p>From a script, I am getting data like that is given below.</p>
<pre><code>Neha, 30,A
Monika ,22,B
Anni,33,C
<... |
72,362,627 | Caret rfe() error "there should be the same number of samples in x and y"<p>I am having difficulties solving the error "there should be the same number of samples in x and y". I notice that others have posted on this site regarding this error, but their solutions have not worked for me. I am attaching an abbr... | <p>I see your output is two classes of limit intervals. Maybe if you try them as factors <code>y = as.factor(unlist(y_train))</code>? It worked for me</p>
<pre><code>control <- rfeControl(functions = rfFuncs, # random forest
method = "repeatedcv", # repeated cv
r... | Caret rfe() error "there should be the same number of samples in x and y" | r|numbers|sample|caret|rfe | 1 | 41 | 1 | 72,362,795 | 72,362,795 | 1 | true | 2022-05-24T12:08:13.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Caret rfe() error "there should be the same number of samples in x and y"<p>I am having difficulties solving the error "there should be the same number ... |
72,365,176 | Interval show negative values<p>I want to get the distribution of a column. The ranges are prices and the int is the number of sales within that range.</p>
<pre><code>df1=df['column'].value_counts(bins=15, sort=False)
(-2,000.0000, 42,000.0000]
103
(42,000.0000, 83,000.0000]
880
(83,000.0000, 125,000.0000]
649
(125,00... | <p>It's a good question, I don't know why the starting bin is smaller than the min value in your column. I've been able to repeat your observation.</p>
<p>You can get more control over where the bins start and stop by passing a list of bin positions created by np.arange like this example</p>
<pre><code>import pandas as... | Interval show negative values | python|pandas | 2 | 41 | 1 | 72,365,377 | 72,365,377 | 1 | true | 2022-05-24T14:58:59.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interval show negative values<p>I want to get the distribution of a column. The ranges are prices and the int is the number of sales within that range.</p>
<... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.