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,341,290 | How can I clear console to the right of the cursor in Windows NT command prompt with C++?<p>I need an output on the same line, like this:</p>
<pre><code>std::cout << "\rIt's " << leisure << " time!";
</code></pre>
<p>I want to make sure I do not see stuff like <code>time!e!</code> ... | <p>I wanted to avoid additional coding for a single line terminator, but since there is seemingly no other solution, I resorted to <a href="https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences" rel="nofollow noreferrer">Console Virtual Terminal Sequences</a> as suggested in the comments:<... | How can I clear console to the right of the cursor in Windows NT command prompt with C++? | c++ | 1 | 58 | 1 | 72,347,075 | 72,347,075 | 0 | true | 2022-05-22T21:03:19.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I clear console to the right of the cursor in Windows NT command prompt with C++?<p>I need an output on the same line, like this:</p>
<pre><code>std:... |
72,323,684 | How Django handling long request in another request?<p>Issue about django handling a long request(50sec) in another request(3sec).</p>
<p>I have a POST request will return some infomation for user, in this request will call another api in the same app and it will query database and generate pdf report then upload to s3... | <p>Yes, this is where you'd bring in a solution like <a href="https://docs.celeryq.dev/" rel="nofollow noreferrer">celery</a>, <a href="https://github.com/rq/rq" rel="nofollow noreferrer">rq</a>, or <a href="https://github.com/coleifer/huey" rel="nofollow noreferrer">huey</a>.</p>
<p>In the backend you will use a serve... | How Django handling long request in another request? | django|django-rest-framework|request|celery | 0 | 58 | 1 | 72,324,774 | 72,324,774 | 0 | true | 2022-05-20T18:58:41.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How Django handling long request in another request?<p>Issue about django handling a long request(50sec) in another request(3sec).</p>
<p>I have a POST reque... |
72,270,847 | In vue js with the help of loop i am showing all elements and i want to hide one element from that but all elements are getting hide<p><a href="https://i.stack.imgur.com/qAEqQ.png" rel="nofollow noreferrer">First Image without clicking on Edit</a></p>
<p><a href="https://i.stack.imgur.com/pmt6i.png" rel="nofollow noref... | <p>Instead of boolean use index for <code>isEditing</code>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>Vue.component('child', {
template: `
<section v-if="Task.l... | In vue js with the help of loop i am showing all elements and i want to hide one element from that but all elements are getting hide | javascript|html|vue.js|loops|if-statement | 0 | 58 | 2 | 72,271,435 | 72,271,435 | 0 | true | 2022-05-17T08:44:02.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In vue js with the help of loop i am showing all elements and i want to hide one element from that but all elements are getting hide<p><a href="https://i.sta... |
72,389,578 | React Native: Convert class components into functional components<p>Fortunately, I found a solution about React Native Google Maps with Autocomplete by <a href="https://mdmoin07.medium.com/react-native-google-maps-with-autocomplete-45a5617be2f5" rel="nofollow noreferrer">https://mdmoin07.medium.com/react-native-google-... | <p>I have resolved your issue for converting it class to functional component. Please check the code and try to re run it.</p>
<pre><code>import React, { useEffect, useRef, useState } from "react";
import { View, StyleSheet } from "react-native";
//mport RNMapView, { Circle, Marker, Polyline } from ... | React Native: Convert class components into functional components | react-native | -1 | 58 | 2 | 72,390,145 | 72,390,145 | 0 | true | 2022-05-26T09:23:16.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Native: Convert class components into functional components<p>Fortunately, I found a solution about React Native Google Maps with Autocomplete by <a hr... |
72,367,708 | Material UI textfield 'disable' prop won't update more than once<p>Trying to make a program where there are radio switches each equating to a different boolean value. Depending on the boolean value, it would either make the 'disable' prop on the textfield either true or false. My code allows for the button to be defaul... | <p>The issue is with <code>onChange</code> you have defined with <code>RadioGroup</code>. Usually, we define
<code>onChange={(e) => setRadioEdit(e.target.value)}</code>
to set the value of text input onEventChangeHandler. But here it's for the Radio button. I was using typescript to find the answer for this and as s... | Material UI textfield 'disable' prop won't update more than once | javascript|reactjs|material-ui|use-state | 0 | 58 | 1 | 72,371,429 | 72,371,429 | 0 | true | 2022-05-24T18:20:35.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Material UI textfield 'disable' prop won't update more than once<p>Trying to make a program where there are radio switches each equating to a different boole... |
72,370,292 | Reference type function argument does not retain changes after function try catch block<p>Code below.</p>
<p>I completely understand reference vs value types. [correction, I do not completely understand reference vs value types.]</p>
<p>Today I ran into something odd.<br />
I declare a datatable class var and initiali... | <p>You need to set it to the new DataTable rather than null outside the function. Remember a reference is a pointer to a memory object. But the reference itself is passed by value (on the stack/copied). So you've passed in a reference that doesn't point to a memory object (null) and the copy has been assigned to th... | Reference type function argument does not retain changes after function try catch block | c#|out | -4 | 58 | 1 | 72,370,433 | 72,370,433 | 0 | true | 2022-05-24T22:57:22.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reference type function argument does not retain changes after function try catch block<p>Code below.</p>
<p>I completely understand reference vs value types... |
72,387,409 | Python: Grouping of time-delta values<p>I'm working on a dataset which details emergency service shifts worked.
If the start time of the next shift is within 1 hours of the previous shift then we want to combine these shifts together to find the total length. This condition applies if there are multiple instances of cl... | <p>IIUC, shift 8 should also be included in group [5,6,7]. If so, the following should work:</p>
<pre><code>import numpy as np
import pandas as pd
df.assign(
Desired_Key = df['Time till next shift (hrs)'].gt(1).cumsum().shift(1, fill_value=0).values + 4505,
continuing = np.where(df['Time till next shift (hrs)'... | Python: Grouping of time-delta values | python|pandas|grouping|timedelta | 0 | 58 | 1 | 72,388,032 | 72,388,032 | 0 | true | 2022-05-26T06:07:06.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Grouping of time-delta values<p>I'm working on a dataset which details emergency service shifts worked.
If the start time of the next shift is within... |
72,386,303 | JQuery/Javascript: Build URL string from multiple selects<p>I have the following selects:</p>
<pre><code><select name="wpf2750_20">
<option value="200">AAA</option>
<option value="400">BBB</option>
</select>
<select name="wpf2750_27">... | <p>Collect all the names and values into an object. Construct your string by indexing into that object.</p>
<pre class="lang-js prettyprint-override"><code>const $selects = $('select');
$selects.on('change', event => {
const fragments = Object.fromEntries(
$selects.map((i,e) => ([e.name, e.value])).get()
... | JQuery/Javascript: Build URL string from multiple selects | javascript|jquery | 0 | 58 | 2 | 72,386,410 | 72,386,410 | 0 | true | 2022-05-26T03:18:10.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JQuery/Javascript: Build URL string from multiple selects<p>I have the following selects:</p>
<pre><code><select name="wpf2750_20">
<opt... |
72,237,925 | can i create android and ios applications with flutter without android emulator , with just flutter sdk and vscode and browser<p>I learned dart and I want to access flutter, but I was surprised by android studio because my computer is weak.so,can i create android and apple applications with flutter without android emul... | <p>If you only work with simple UI widgets yes you can use the embedded development tools within the browser to get the dimensions of the device you working on like so<a href="https://i.stack.imgur.com/pSr5f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pSr5f.png" alt="How to use devtools to open p... | can i create android and ios applications with flutter without android emulator , with just flutter sdk and vscode and browser | flutter | 0 | 58 | 3 | 72,238,328 | 72,238,328 | 1 | true | 2022-05-14T06:40:48.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
can i create android and ios applications with flutter without android emulator , with just flutter sdk and vscode and browser<p>I learned dart and I want to... |
72,246,180 | Can someone explain what each part of this regex means ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s)<p>I am trying to find out a regex pattern to check if a password contains at least:
one lowercase letter,
one uppercase letter,
one numeric digit,
and one special character(Symbol)</p>
<p>I came across this ... | <p>Your regex pattern contains a number of positive <em>lookahead</em> assertions, which are checking for the presence of various things in the input. Here is an explanation:</p>
<pre><code>^ from the start of the input
(?=.*\d) assert one or more digits are present
(?=.*[a-z]) ass... | Can someone explain what each part of this regex means ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s) | regex | 0 | 58 | 3 | 72,246,236 | 72,246,236 | 1 | true | 2022-05-15T07:03:46.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can someone explain what each part of this regex means ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s)<p>I am trying to find out a regex pattern to... |
72,247,873 | Pass list to google distance matrix, returning only single value<p>I want to use Googles <a href="https://developers.google.com/maps/documentation/javascript/distancematrix" rel="nofollow noreferrer">distance matrix</a> API to measure the road distance between multiple addresses and a single address. I have a list of o... | <p>I believe what you want to do is using:</p>
<pre><code>list_o
[(51.668369, -1.361043),
(51.668369, -1.361043),
(51.662992, -1.270635),
(51.610508, -1.314208),
(51.733251, -1.351402)]
</code></pre>
<p>and:</p>
<pre><code>list_d
[(52.423451, -1.462141)]
</code></pre>
<p>And then call:</p>
<pre><code>results = gm... | Pass list to google distance matrix, returning only single value | python|pandas|google-maps | 1 | 58 | 1 | 72,248,649 | 72,248,649 | 1 | true | 2022-05-15T11:34:50.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pass list to google distance matrix, returning only single value<p>I want to use Googles <a href="https://developers.google.com/maps/documentation/javascript... |
72,248,926 | C# - Get the first day and last day of the week knowing the week number, month number and year<p>so the problem is this: I managed to get the number of weeks that make up a month (for example: May 2022 is made up of 6 weeks counting from day 1 to day 31 without exception). So having <strong>the number of weeks that mak... | <p>If I understood correctly it should look something like this</p>
<pre><code>var week = 2;
var month = 5;
var year = 2022;
var firstDayOfMonth = new DateTime(year, month, 1);
var dayOfWeek = firstDayOfMonth.DayOfWeek;
var diffToMonday = (7 + (dayOfWeek - DayOfWeek.Monday)) % 7;
var firstMonday = firstDayOfMonth.AddD... | C# - Get the first day and last day of the week knowing the week number, month number and year | c#|datetime|calendar | 0 | 58 | 1 | 72,249,211 | 72,249,211 | 1 | true | 2022-05-15T13:55:48.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# - Get the first day and last day of the week knowing the week number, month number and year<p>so the problem is this: I managed to get the number of weeks... |
72,249,512 | NodeJS, Cheerio. How to find text without knowing selectors?<p>I'm trying to find a specific text. In my case, I have no idea of selectors, elements, parents, or anything else in the HTML code of the target. Just trying to find out if this page has robots.txt. Doing that by searching for 'User-agent:'.</p>
<p>Is someon... | <p>You can simply use a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions" rel="nofollow noreferrer">regular expression</a> to check whether "User-agent" is part of the returned HTML.</p>
<p>Be aware: If the scraped page doesn't have a robots.txt file and returns a 404... | NodeJS, Cheerio. How to find text without knowing selectors? | node.js|cheerio | 0 | 58 | 1 | 72,250,001 | 72,250,001 | 1 | true | 2022-05-15T15:07:10.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NodeJS, Cheerio. How to find text without knowing selectors?<p>I'm trying to find a specific text. In my case, I have no idea of selectors, elements, parents... |
72,254,791 | Disabled Azure Function Billing<p><strong>TLDR;</strong></p>
<p>Assuming my azure function (consumption plan) is disabled, would I still have to pay for request attempts sent to it (NotFound response)?</p>
<p><strong>In Depth:</strong></p>
<p>I have azure function created (consumption plan) with multiple HTTP triggers ... | <ul>
<li><p>Azure functions only pay for computing resources for the functions that are active. Its usage plan is based on resource consumption and executions per second.</p>
</li>
<li><p>The Consumption plan dynamically adds and removes instances of the Functions host based on the number of incoming events.</p>
</li>
... | Disabled Azure Function Billing | azure|azure-functions|azure-billing | 0 | 58 | 1 | 72,255,126 | 72,255,126 | 1 | true | 2022-05-16T06:13:32.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Disabled Azure Function Billing<p><strong>TLDR;</strong></p>
<p>Assuming my azure function (consumption plan) is disabled, would I still have to pay for requ... |
72,256,759 | Return an object from a class<p>Is it possible to return an object just by calling a class? Take for exemple, I am trying to connect to a client server and just by calling the class, I get the connection.</p>
<p>And if I want to start a new project on that server, I would only need to init the project and the connectio... | <p><code>createFromA</code> needs to be a <code>staticmethod</code> as it does not operate on instances of the class <code>Constructor</code></p>
<pre><code>class A:
def __init__(self):
pass
def create_project(self,argA):
newA = self.Constructor.createFromA(argA)
return... | Return an object from a class | python|class|oop | 0 | 58 | 1 | 72,256,818 | 72,256,818 | 1 | true | 2022-05-16T09:12:36.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return an object from a class<p>Is it possible to return an object just by calling a class? Take for exemple, I am trying to connect to a client server and j... |
72,251,161 | scipy.io.wavfile.read return explanation<p>I know I can read it at <code>https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.html</code>, but I'm too stupid to understand it.</p>
<pre><code>from scipy.io.wavfile import read
sample_rate, data = read("./drive/MyDrive/PSD.wav")
print(len(d... | <p>If you have a two columns arrays it means your wave file has two channels (stereo, left/right). The sample rate gives the number of samples per second, so the sampling period is <code>(1 / sample_rate)</code>.</p>
<p>You could plot it as well</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
# time f... | scipy.io.wavfile.read return explanation | python|scipy|wav | 0 | 58 | 1 | 72,256,895 | 72,256,895 | 1 | true | 2022-05-15T18:34:44.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
scipy.io.wavfile.read return explanation<p>I know I can read it at <code>https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.html</cod... |
72,256,855 | How can I convert a list of lists in a Dataframe in Pyspark?<p>I have a list of list of type:</p>
<pre><code>[[1, 'A', 'aa'], [2 'B', 'bb'], [3, 'C', 'cc']]
</code></pre>
<p>I want to get the next dataframe:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>id</th>
<th>col1</th>
<th>col2</th... | <p>Just use the list to create the dataframe directly.</p>
<pre><code>data = [[1, 'A', 'aa'], [2, 'B', 'bb'], [3, 'C', 'cc']]
df = spark.createDataFrame(data, ['id', 'col1', 'col2'])
df.show(truncate=False)
</code></pre> | How can I convert a list of lists in a Dataframe in Pyspark? | pyspark | 0 | 58 | 1 | 72,257,013 | 72,257,013 | 1 | true | 2022-05-16T09:19:58.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I convert a list of lists in a Dataframe in Pyspark?<p>I have a list of list of type:</p>
<pre><code>[[1, 'A', 'aa'], [2 'B', 'bb'], [3, 'C', 'cc']]
... |
72,264,327 | How to define function conditionally<p>I want to set a function to the result of a ternary operator (that is returning one of two functions) and then call the result. My code looks like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">... | <p>@m-s7's answer works. However, it's kind of messy.</p>
<p>IMHO better to commit something like this to production instead:</p>
<pre><code>const bar = (x: number) => {
// do something
}
const foo = (x: number) => {
// do something else
}
const my_function = (x: number) => condition ? bar(x) : foo(x)
</... | How to define function conditionally | javascript|reactjs|typescript | 0 | 58 | 1 | 72,264,617 | 72,264,617 | 1 | true | 2022-05-16T19:00:18.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define function conditionally<p>I want to set a function to the result of a ternary operator (that is returning one of two functions) and then call th... |
72,265,574 | Complete one promise array first, then complete another promise array JavaScript<p>I have a problem with promises and have no idea how resolve this:</p>
<p>My idea is to have two methods that are a "dispatcher". In <code>testFetchFaceCharacter()</code> call all promises that I need to resolved first. Need all... | <p>First of all, there is a mistake in your code. You need to understand that as soon as you called a function, you triggered a logic that does something, even if you don't listen to the promise right away, the logic is executing.</p>
<p>So what happened, is that you launched all actions in "parallel" when yo... | Complete one promise array first, then complete another promise array JavaScript | javascript|async-await|reduce | 0 | 58 | 1 | 72,265,710 | 72,265,710 | 1 | true | 2022-05-16T21:00:15.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Complete one promise array first, then complete another promise array JavaScript<p>I have a problem with promises and have no idea how resolve this:</p>
<p>M... |
72,267,431 | Javascript: how to compare two arrays of objects and remove equal values?<p>I have two arrays:<br />
This is the main array(im printing it in html but the user can remove objects):</p>
<pre><code>checkboxes = [
{name: "boxes", color: "red"},
{name: "boxes", color: "orange"},
{nam... | <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>let checkboxes = [
{name: "boxes", color: "red"},
{name: "boxes", color: "orange"},
{name: "tree", color: "green"},
{name: "... | Javascript: how to compare two arrays of objects and remove equal values? | javascript|arrays|sorting|object|filter | -3 | 58 | 2 | 72,267,551 | 72,267,551 | 1 | true | 2022-05-17T02:07:09.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript: how to compare two arrays of objects and remove equal values?<p>I have two arrays:<br />
This is the main array(im printing it in html but the us... |
72,291,585 | Make Twilio wait on hold for me and then call me when someone picks up<p>Does anyone know if the Twilio api allows for the following use case? I can't find a good example in any of the documentation.</p>
<ul>
<li>I call a number through Twilio where I expect to be placed on hold</li>
<li>Twilio recognizes that I am on ... | <p>The challenge with this is the definition of "hold". Basically, you have an established call and you are waiting for a human to connect (while you wait in queue).</p>
<p>You need some logic to listen to the media portion of this existing call to identify utterances that sound similar to when an agent conne... | Make Twilio wait on hold for me and then call me when someone picks up | c#|.net|twilio | 0 | 58 | 1 | 72,294,047 | 72,294,047 | 1 | true | 2022-05-18T15:01:27.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make Twilio wait on hold for me and then call me when someone picks up<p>Does anyone know if the Twilio api allows for the following use case? I can't find a... |
72,292,741 | Writing url in View in Django<p>I want to define a link for a character in the view.
I used the following code, but it has an error.
Error: Encountered unknown tag 'url'</p>
<p>code:</p>
<pre><code> html="""
<p>
<a href="{% url index2 %}"&g... | <p>You have template tags in your HTML, so you have to pass it through the Django template processor:</p>
<pre><code>from django.template import Template, Context
html = Template(
"""
<p>
<a href="{% url index2 %}">more information</a>
</p>
"&qu... | Writing url in View in Django | python|html|django|folium | 1 | 58 | 2 | 72,294,712 | 72,294,712 | 1 | true | 2022-05-18T16:20:37.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Writing url in View in Django<p>I want to define a link for a character in the view.
I used the following code, but it has an error.
Error: Encountered unkno... |
72,302,288 | Newbie question -- a list of tuples -> list (with workalendar)<pre><code>from workalendar.core import Calendar
from workalendar.registry import registry
CalendarClass = registry.get('US')
calendar = CalendarClass()
# Get the range of years
start_year = 2018
end_year = 2020
all_years = range(start_year, end_year + 1, ... | <p>I did it this way:</p>
<pre><code>final_list = []
for inner_list in your_list: final_list += [list(inner_tuple) for inner_tuple in inner_list]
</code></pre>
<p>Getting this output:</p>
<pre><code>[[datetime.date(2019, 1, 1), 'New year'],
[datetime.date(2019, 4, 19), 'Good Friday'],
[datetime.date(2019, 12, 26), '... | Newbie question -- a list of tuples -> list (with workalendar) | python | 1 | 58 | 2 | 72,302,440 | 72,302,440 | 1 | true | 2022-05-19T09:46:25.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Newbie question -- a list of tuples -> list (with workalendar)<pre><code>from workalendar.core import Calendar
from workalendar.registry import registry
Cal... |
72,311,062 | SubscriptionTransferFailed hook not working as expected in Eclipse Milo<p>I'm trying to manage reconnection to OPC server when it was down for some time and gets started again. My milo client is not able to automatically reconnect because server does not support Subscription transfer, so I added a SusbcriptionListener ... | <blockquote>
<p>I'm using milo 0.4.3</p>
</blockquote>
<p>Due to an implementation defect in this server combined with <a href="https://github.com/eclipse/milo/issues/722" rel="nofollow noreferrer">this issue</a> in Milo's Session FSM pre-0.5.3 you'll need to upgrade the version of Milo your client uses to at least 0.... | SubscriptionTransferFailed hook not working as expected in Eclipse Milo | java|opc-ua|milo | 1 | 58 | 1 | 72,311,357 | 72,311,357 | 1 | true | 2022-05-19T21:05:19.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SubscriptionTransferFailed hook not working as expected in Eclipse Milo<p>I'm trying to manage reconnection to OPC server when it was down for some time and ... |
72,298,934 | Organize files into folders then subfolders based on filenames<p>A set of files have "<strong>Main Folder Name</strong>" (<em>explicit</em>) and a <strong>SubFolderName</strong> (<em>hinted</em>) in their filenames.</p>
<p>The intention is to just have them organized in new folders by "<strong>Main Folde... | <pre><code>@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
rem The following setting for the source directoryis a name
rem that I use for testing and deliberately includes spaces to make sure
rem that the process works using such names. These will need to be changed to suit your situation.
SET "sourcedir=u:\your file... | Organize files into folders then subfolders based on filenames | batch-file|scripting|batch-processing | -1 | 58 | 2 | 72,311,549 | 72,311,549 | 1 | true | 2022-05-19T05:14:30.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Organize files into folders then subfolders based on filenames<p>A set of files have "<strong>Main Folder Name</strong>" (<em>explicit</em>) and a ... |
72,318,709 | How to split a row on ‘\n’ and add everything after the split to a new row?<p>I have a dataframe:</p>
<pre><code>id type value
1 inner Upload new model. \nUpdate data.
2 outer Create new task.
</code></pre>
<p>I want to split rows which have \n in column value by splitting text in it and placin... | <p>maybe this will help:</p>
<pre><code>>>> df.assign(value=df['value'].str.split('\n')).explode('value')
'''
id type value
0 1 inner Upload new model.
0 1 inner Update data.
1 2 outer Create new task.
</code></pre> | How to split a row on ‘\n’ and add everything after the split to a new row? | python|python-3.x|dataframe|function | 3 | 58 | 2 | 72,319,935 | 72,319,935 | 1 | true | 2022-05-20T12:11:25.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split a row on ‘\n’ and add everything after the split to a new row?<p>I have a dataframe:</p>
<pre><code>id type value
1 inner Upload... |
72,320,921 | How might I get the list of firms that do not pay dividends?<p>The following code is meant to narrow down the list of the tickers of public companies
that have Bitcoin on their balance sheet (stored in <code>list_of_tcks</code>) to those that do not pay dividends (stored in <code>leanCompanies</code>).</p>
<pre><code>#... | <ol>
<li>The cause of the two types is because some of the tickers are not found. If you read the output of your <code>[0]</code> print line, you will see that there is a <code>list</code> for those that return <code>- <ticker>: No data found, symbol may be delisted</code>, and a <code>pd.Series</code> where the... | How might I get the list of firms that do not pay dividends? | python|finance|yfinance | 0 | 58 | 1 | 72,329,153 | 72,329,153 | 1 | true | 2022-05-20T14:49:29.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How might I get the list of firms that do not pay dividends?<p>The following code is meant to narrow down the list of the tickers of public companies
that ha... |
72,331,399 | Is it ever better to use Node's filesystem sync methods over the same async methods?<p><strong>This is a question about performance more than anything else.</strong></p>
<p>Node exposes three different types of methods to accomplish various filesystem tasks:</p>
<ul>
<li>Promises API (async)</li>
<li>Callback API (asyn... | <p>It depends on the situation. The main benefit of the sync methods is that they allow for easier consumption of their results, and the main disadvantage is that they prevent all other code from executing while working.</p>
<p>If you find yourself in a situation where other code not being able to respond to events is ... | Is it ever better to use Node's filesystem sync methods over the same async methods? | javascript|node.js|performance|fs | -1 | 58 | 1 | 72,331,500 | 72,331,500 | 1 | true | 2022-05-21T16:30:51.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it ever better to use Node's filesystem sync methods over the same async methods?<p><strong>This is a question about performance more than anything else.<... |
72,333,176 | How to show text using Raycast?<p>Basically what I'm trying to do here is to show a text when the player goes near the door saying "door is locked!", I want the text to show only when the player is in front of the door and gone when he is not looking at the door or when he goes further from the door.
I tried ... | <h2>Use a 3D-Collider Trigger instead</h2>
<p>It is much efficient more than making ray-cast every single frame.</p>
<pre class="lang-cs prettyprint-override"><code>// This should be attached to your door
// with a trigger-collider
public class DoorDetector : MonoBehaviour {
// Player needs a collider and any phys... | How to show text using Raycast? | unity3d | 1 | 58 | 1 | 72,333,363 | 72,333,363 | 1 | true | 2022-05-21T20:59:49.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show text using Raycast?<p>Basically what I'm trying to do here is to show a text when the player goes near the door saying "door is locked!"... |
72,332,752 | Search a Sorted Array for First Occurrence of K<p>I'm trying to solve question 11.1 in Elements of Programming Interviews (EPI) in Java: Search a Sorted Array for First Occurrence of K.</p>
<p>The problem description from the book:</p>
<blockquote>
<p>Write a method that takes a sorted array and a key and returns the i... | <p>Assuming that passing arguments is <code>O(1)</code> instead of <code>O(n)</code>, performance is <code>O(log(n))</code>.</p>
<p>The usual theoretical approach for analyzing recursion is calling the <a href="https://brilliant.org/wiki/master-theorem/" rel="nofollow noreferrer">Master Theorem</a>. It is to say that ... | Search a Sorted Array for First Occurrence of K | algorithm|search|time-complexity|binary-search|sortedlist | 0 | 58 | 1 | 72,333,917 | 72,333,917 | 1 | true | 2022-05-21T19:45:58.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search a Sorted Array for First Occurrence of K<p>I'm trying to solve question 11.1 in Elements of Programming Interviews (EPI) in Java: Search a Sorted Arra... |
72,337,481 | How can I change the bottom color of my drawer?<p>I have created my drawer. I have put the list tiles in a container and set the color of my container to white but the bottom of drawer still shows black. The widget is put in a separate class. I want the whole drawer to white except the drawer header which is in yellow.... | <p>Use <code>backgroundColor: Colors.white</code> property in <code>Drawer</code> widget and you are all set to go.</p> | How can I change the bottom color of my drawer? | flutter|dart|navigation-drawer|slidingdrawer | 0 | 58 | 2 | 72,337,575 | 72,337,575 | 1 | true | 2022-05-22T12:15:05.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I change the bottom color of my drawer?<p>I have created my drawer. I have put the list tiles in a container and set the color of my container to whi... |
72,340,020 | Change boolean data when adding new registration<p>In this piece of code l want to change the boolean data of room when adding new registration
For example: when l add new registration in django admin
the boolean data of room should change to False</p>
<pre class="lang-py prettyprint-override"><code>from django.db impo... | <p>You should use Django's signals for that. Just create <code>signals.py</code> in your app's folder and do that:</p>
<pre><code>from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Registration
@receiver(post_save, sender=Registration)
def create_profile(sender, in... | Change boolean data when adding new registration | python|django|django-models | 0 | 58 | 2 | 72,340,497 | 72,340,497 | 1 | true | 2022-05-22T17:52:23.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change boolean data when adding new registration<p>In this piece of code l want to change the boolean data of room when adding new registration
For example: ... |
72,344,173 | How do reset a specific field in form?<p>How to reset not the whole form, but only one field? And so that when the field is reset, it gets the value <code>''</code>, not <code>null</code></p>
<pre><code> clear(): void {
this.form.value.search = '';
// this.form.reset();
this.applyFilter();
}
</code></pre> | <p>Extract the control from the form, and call <code>reset</code> on it with <code>''</code>.</p>
<pre><code>clear(): void {
this.form.get('value')?.reset('');
this.applyFitler();
}
</code></pre> | How do reset a specific field in form? | angular | 3 | 58 | 4 | 72,344,210 | 72,344,210 | 1 | true | 2022-05-23T06:39:25.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do reset a specific field in form?<p>How to reset not the whole form, but only one field? And so that when the field is reset, it gets the value <code>''... |
72,337,423 | How to center a table inside grid<p>I have a grid:</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>.container {
height: 100%;
display: grid;
grid-gap: 25px;
grid-temp... | <p>I have changed the <code>.td-100</code> :
<code>.td100 { display: grid; place-items: center; width: 100px; }</code>
And added a new line: <code>tr > * { width: 100%; }</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class... | How to center a table inside grid | html|css | 1 | 58 | 1 | 72,344,788 | 72,344,788 | 1 | true | 2022-05-22T12:05:16.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to center a table inside grid<p>I have a grid:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div ... |
72,343,171 | Duplicated data in excel using Openpyxl<p>I have created a python script that will append data in excel. However, data that are being transferred in excel is having multiple duplication. Can someone help me fix my script?</p>
<pre><code>tree = ET.parse('users.xml')
root = tree.getroot()
#create excel
wb = Workbook()
ws... | <p>Hi to @Redox and @taipei thank you for your quick responses and answers,
I have resolve my duplication issues in a different format :)</p>
<pre><code>def getUserDetail():
tree = ET.parse('users.xml')
root = tree.getroot()
#create excel
workbook = Workbook()
ws = workbook.active
ws.title = ("Active Users&quo... | Duplicated data in excel using Openpyxl | python|excel|openpyxl | 0 | 58 | 3 | 72,345,059 | 72,345,059 | 1 | true | 2022-05-23T04:07:22.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Duplicated data in excel using Openpyxl<p>I have created a python script that will append data in excel. However, data that are being transferred in excel is... |
72,340,425 | Doing elementary analytic geometry in pandas<p>We have two points in Cartesian space as origins and some other typical points. For typical points we are only interested in their distance from the origins: two numbers. so we want reach from df</p>
<pre><code>d = {'origin1': [(1,0,0), (0,0,0)],
'origin2': [(2,0,0), ... | <p>It's a solution for arbitrary <b>dimensions of points & number of origins</b> that we may have:</p>
<pre><code>d = {'origin1': [(1,0,0) , (0,0,0 )],
'origin2': [(2,0,0) , (0,0,1 )],
'point1' : [(40,0,0), (0,0,20)],
'point2' : [(50,0,0), (0,0,25)],
'point3' : [(60,0,0), (0,0,30)]}
df_pnt = pd... | Doing elementary analytic geometry in pandas | python|pandas | 1 | 58 | 1 | 72,346,113 | 72,346,113 | 1 | true | 2022-05-22T18:49:10.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Doing elementary analytic geometry in pandas<p>We have two points in Cartesian space as origins and some other typical points. For typical points we are only... |
72,347,702 | Image Grid formatting in HTML<p>I am a beginner in HTML and StackOverflow and was trying to create a web page. I learned how to create this grid through some research but I am not sure how I would align it to the center of the web page. I tried using justify-content: center; but had no luck. Help would be greatly appre... | <p>You meant this?
<code>.image-grid {place-items: center;}</code></p>
<p>By the way pay attention to your last line! Don't forget to close the tag!</p> | Image Grid formatting in HTML | html|css | 0 | 58 | 3 | 72,347,920 | 72,347,920 | 1 | true | 2022-05-23T11:22:54.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Image Grid formatting in HTML<p>I am a beginner in HTML and StackOverflow and was trying to create a web page. I learned how to create this grid through some... |
72,349,286 | Understanding css calc() function<p><a href="https://heydonworks.com/article/the-flexbox-holy-albatross/" rel="nofollow noreferrer">Heydon Pickering</a> wrote an article about mimicking container queries. He writes that the container's CSS should be as follows:</p>
<pre><code>.container {
display: flex;
flex-wrap: ... | <p>A <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/percentage" rel="nofollow noreferrer">Percentage</a> in CSS is relative to the parent.<br />
So in this case, the calc is as follow: <code>40rem - 100% [of the width of the parent]</code>.</p>
<p>The author explains it in their post:</p>
<blockquote>
<p>the... | Understanding css calc() function | css | 1 | 58 | 2 | 72,349,533 | 72,349,533 | 1 | true | 2022-05-23T13:19:50.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Understanding css calc() function<p><a href="https://heydonworks.com/article/the-flexbox-holy-albatross/" rel="nofollow noreferrer">Heydon Pickering</a> wrot... |
72,343,313 | How to test formatting in Bash 5 with Bats Core?<p>Trying to get into Shell testing with Bash (5.1.16), using <a href="https://github.com/bats-core/bats-core" rel="nofollow noreferrer">Bats Core</a>. I ran into an issue while trying to test formatting, and already spent 2 hours on it. </p>
<p>In this test I want to mak... | <p>You can use <code>printf "%q"</code> to get the value you want to test :</p>
<pre><code>#!/usr/bin/env bash
function _print_foreground_color() {
printf "%b" "$(tput setaf "${2:-}" 2>/dev/null)" "${1:-}" "$(tput sgr0 2>/dev/null)"
}
function ... | How to test formatting in Bash 5 with Bats Core? | bash|testing|bats-core | 0 | 58 | 1 | 72,349,677 | 72,349,677 | 1 | true | 2022-05-23T04:36:06.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test formatting in Bash 5 with Bats Core?<p>Trying to get into Shell testing with Bash (5.1.16), using <a href="https://github.com/bats-core/bats-core... |
72,348,831 | Problem solving overlapping vectors in terra using terra::union<p>I have several polygons of habitat types, and depending on the ones I select I need to get the percentage of a country. The issue is that many polygons intersect, so I need to solve the intersections so that I don’t add the area twice and assume that the... | <p>I think this was fixed a while ago, but not in the CRAN version yet. Can you try this with the development version please? You can install it with <code>install.packages('terra', repos='https://rspatial.r-universe.dev')</code></p>
<p>With that version, I get:</p>
<pre><code>library(terra)
hab1 <- vect("/vsi... | Problem solving overlapping vectors in terra using terra::union | r|gis|shapefile|r-raster | 1 | 58 | 1 | 72,354,201 | 72,354,201 | 1 | true | 2022-05-23T12:52:32.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem solving overlapping vectors in terra using terra::union<p>I have several polygons of habitat types, and depending on the ones I select I need to get ... |
72,354,325 | Add more than 1 timestamp on one Excel Worksheet<p>I have some issue...</p>
<p>I have a work sheet to track CRM pipeline activities and every status changed will be recorded by a time stamp... but, I don't know how to make more than one time stamp...</p>
<p>Here the condition:</p>
<ul>
<li><p>Cell "A" will be... | <h2>A Worksheet Change: Multiple Timestamp Columns</h2>
<ul>
<li>This will add a timestamp only if the 'timestamp cell' is blank.</li>
</ul>
<pre class="lang-vb prettyprint-override"><code>Private Sub Worksheet_Change(ByVal Target As Range)
Const FirstRow As Long = 6
Const ColumnsRangeAddress As String = &... | Add more than 1 timestamp on one Excel Worksheet | excel|vba|timestamp | 1 | 58 | 1 | 72,355,249 | 72,355,249 | 1 | true | 2022-05-23T20:11:24.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add more than 1 timestamp on one Excel Worksheet<p>I have some issue...</p>
<p>I have a work sheet to track CRM pipeline activities and every status changed ... |
72,360,339 | Adjusting crontab MAILTO for single user in Ansible<p>I'm currently editing the crontab entry of a specific user like this:</p>
<pre><code>---
- name: Create example cron entry
cron:
name: "Examplecrontab entry"
minute: "5"
hour: "5"
day: "5"
user:... | <p>It seems I've failed to read the docs properly. Seeing the <a href="https://docs.ansible.com/ansible/latest/collections/community/general/cronvar_module.html#parameter-user" rel="nofollow noreferrer">user</a> property, which defaults to root, I've added my specific user and my issue has been fixed. For anyone else, ... | Adjusting crontab MAILTO for single user in Ansible | ansible|cron | 0 | 58 | 2 | 72,360,532 | 72,360,532 | 1 | true | 2022-05-24T09:20:43.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adjusting crontab MAILTO for single user in Ansible<p>I'm currently editing the crontab entry of a specific user like this:</p>
<pre><code>---
- name: Create... |
72,361,778 | How can I get Java to read all text in file?<p>I am trying to get Java to read text from a file so that I can convert the text into a series of ascii values, but currently it only seems to be reading and retrieving the first line of the txt file. I know this because the output is much shorter than the text in the file.... | <p>To read the entire input stream:</p>
<pre><code>Scanner sc = new Scanner(x).useDelimiter("\\A");
</code></pre>
<p>then just:</p>
<pre><code>String entireInput = sc.next();
</code></pre>
<p>This works by setting the token delimiter to start of all input, which of course is never encountered after any byte r... | How can I get Java to read all text in file? | java|file|try-catch | 0 | 58 | 2 | 72,361,844 | 72,361,844 | 1 | true | 2022-05-24T11:06:08.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get Java to read all text in file?<p>I am trying to get Java to read text from a file so that I can convert the text into a series of ascii values,... |
72,364,169 | how to make a cross section of frontogenesis by metpy<p>I want to make a cross section of frontogenesis
my code is</p>
<pre><code> domain_1 = os.path.abspath(filenames_in)
info = os.path.join(domain_1, filename)
data = xr.open_dataset(info)
data = data.metpy.parse_cf().squeeze()
print(data)
p1 = data['level'].values[:... | <p>Given that <a href="https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.frontogenesis.html" rel="nofollow noreferrer">MetPy's <code>frontogensis</code> calculation</a> operates on a 2D horizontal grid, you will indeed need to calculate frontogensis <em>prior to</em> taking the cross section. Similarly, s... | how to make a cross section of frontogenesis by metpy | metpy | 1 | 58 | 1 | 72,366,881 | 72,366,881 | 1 | true | 2022-05-24T13:52:03.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to make a cross section of frontogenesis by metpy<p>I want to make a cross section of frontogenesis
my code is</p>
<pre><code> domain_1 = os.path.abspat... |
72,368,379 | How to use multiple values in SIMILAR TO without hardcoding<p>I have a column as follows (with imaginary values):</p>
<pre><code><table_name>.<column_name>
a_b
g_c
w_d
k_e
</code></pre>
<p>I would like to match this column with another column using <code>SIMILAR TO</code> operator. Something like:</p>
<pre>... | <p>I think what you're looking for is something like</p>
<pre><code>SELECT t2.*
FROM table2 t2
WHERE t2.column1 similar to '%('||(SELECT LISTAGG(t1.column1, '|') FROM table1 t1)||')%'
</code></pre>
<p>Note that I'm using <code>listagg</code> for Redshift, but in Postgre it would be <code>string_agg</code>.</p>
<p>The <... | How to use multiple values in SIMILAR TO without hardcoding | sql|postgresql | 0 | 58 | 1 | 72,368,795 | 72,368,795 | 1 | true | 2022-05-24T19:20:01.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use multiple values in SIMILAR TO without hardcoding<p>I have a column as follows (with imaginary values):</p>
<pre><code><table_name>.<colum... |
72,373,540 | How do I remove borders and the scrollbar on a looping video background?<p>wanted to find a way to have a looping video background. which always fully covers the screen. It works how I want it to rn, but when I increased the vh and vw to 100% it added scroll bars and still has padding and a margin around the video. Ho... | <p>As default you browser gives padding/margin. You can try to remove it by giving margin and padding 0: <code>* { box-sizing:border-box; margin: 0; padding: 0; }</code> as to hiding scroll bar you can use <code>overflow : hidden</code></p> | How do I remove borders and the scrollbar on a looping video background? | html|css | 2 | 58 | 2 | 72,373,658 | 72,373,658 | 1 | true | 2022-05-25T07:31:23.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I remove borders and the scrollbar on a looping video background?<p>wanted to find a way to have a looping video background. which always fully covers... |
72,375,757 | Web-Scraping using R (I want to extract some table like data from a website)<p>I'm having some problems scraping data from a website. I do have not a lot of experience with web-scraping. My intended plan is to scrape some data using R from the following website: <a href="https://www.myfxbook.com/forex-broker-swaps" rel... | <p>How about this:</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
library(rvest)
h <- read_html("https://www.myfxbook.com/forex-broker-swaps")
h %>% html_table() %>%
purrr::pluck(3) %>%
setNames(paste(names(.), .[1,], sep="_")) %>%
rename("Broker"... | Web-Scraping using R (I want to extract some table like data from a website) | html|r|xml|web-scraping|rvest | 0 | 58 | 1 | 72,375,943 | 72,375,943 | 1 | true | 2022-05-25T10:16:14.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Web-Scraping using R (I want to extract some table like data from a website)<p>I'm having some problems scraping data from a website. I do have not a lot of ... |
72,384,945 | Why added value en each loop hasn't been stored on next iteration?<p>Brief logic is the next: after clicking on 'li' element, request is sent, and based on response value of 'contacts', it should select if it's greater than 0, once such element is find, i need to break each loop. But currently, despite I set value, whi... | <p>You can't early-exit with <code>return false</code> in this scenario, but you can use <code>count</code> to prevent inner execution after <code>body.contacts.length > 0</code>.</p>
<pre class="lang-js prettyprint-override"><code>cy.intercept('GET', '**/company/view-json**').as('getCompanyProps') // this can be he... | Why added value en each loop hasn't been stored on next iteration? | cypress|cypress-testing-library | 2 | 58 | 2 | 72,386,364 | 72,386,364 | 1 | true | 2022-05-25T22:55:47.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why added value en each loop hasn't been stored on next iteration?<p>Brief logic is the next: after clicking on 'li' element, request is sent, and based on r... |
72,390,295 | rolling sum to calculate YTD for each month group by product and save to separate columns using SQL<p>I have a data like this:</p>
<pre><code>Order_No Product Month Qty
3001 r33 1 8
3002 r34 1 11
3003 r33 1 17
3004 r33 2 3
3005 r34 2 11
... | <p>To my understanding, there is no need to use window functions. The following query achieves your desired output:</p>
<pre class="lang-sql prettyprint-override"><code>select
product,
sum(case when month = 1 then qty else 0 end) as sum_qty_jan,
sum(case when month <= 2 then qty else 0 end) as sum_qty_fe... | rolling sum to calculate YTD for each month group by product and save to separate columns using SQL | sql|window-functions | 0 | 58 | 1 | 72,390,503 | 72,390,503 | 1 | true | 2022-05-26T10:22:25.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rolling sum to calculate YTD for each month group by product and save to separate columns using SQL<p>I have a data like this:</p>
<pre><code>Order_No Produ... |
72,393,202 | R mutate error while merging every two rows into one<p>I have a <code>CSV</code> data in which I want to merge every <code>two rows</code> in each of the columns. The code below works fine on other <code>CSVs</code>. However, it returns an <code>error</code> while <code>mutating</code> with this particular dataset.</p>... | <p>To assign the 'id', you can increase the count of rows by 1, replicate each number by twice and then select the first <code>n</code>.</p>
<pre><code>df%>% mutate(id = rep(1:((n()+1)/2), each = 2)[1:n()]) %>% group_by(id) %>%
summarize(across(date_received:permit,
~trimws(paste0(.x, col... | R mutate error while merging every two rows into one | r|dplyr | 1 | 58 | 2 | 72,393,324 | 72,393,324 | 1 | true | 2022-05-26T14:10:29.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R mutate error while merging every two rows into one<p>I have a <code>CSV</code> data in which I want to merge every <code>two rows</code> in each of the col... |
72,791,522 | Django auto increment fields<p>I have 2 columns named Serial and Bag I need them to be auto incremented but based on each other and also based on the user that will update the record, so every bag should have 100 serial and reset the number automatically after reaching 100, then start again with Bag number 2 and put 10... | <p>The way you explain your example is a bit confusing but I'll try to give you an answer.</p>
<p>I assume the "<em>2 columns named Serial and Bag</em>" are fields of the same model and as you replied in the comments "<em>the record is already existing but it has empty serial and bag</em>", which me... | Django auto increment fields | python|django|pandas | 0 | 58 | 2 | 72,793,181 | 72,793,181 | 1 | true | 2022-06-28T18:31:02.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django auto increment fields<p>I have 2 columns named Serial and Bag I need them to be auto incremented but based on each other and also based on the user th... |
72,798,367 | How to select column from string in efcore?<p>I am looking for a solution to select a single column based on the column name. The type of columns I want to select is always string. Like so:</p>
<pre><code>_dbContext.MyModel.Select("Name")...
</code></pre>
<p>I wanted to create a extension method:</p>
<pre><co... | <p>The following method projects any property to string and returns <code>IQueryable<string></code>. Nested properties also supported.</p>
<pre class="lang-cs prettyprint-override"><code>public static class QueryableExtensions
{
public static IQueryable<string> SelectFromString<T>(this IQueryable... | How to select column from string in efcore? | c#|linq|entity-framework-core | 0 | 58 | 1 | 72,802,743 | 72,802,743 | 1 | true | 2022-06-29T08:42:34.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select column from string in efcore?<p>I am looking for a solution to select a single column based on the column name. The type of columns I want to s... |
72,802,811 | Constraints for Direct Collocation method in pydrake<p>I am looking for a way to describe the constraints of the Direct Collocation method in pydrake.<br />
I got the robot model from my own URDF by using <code>FindResource</code> as <a href="https://github.com/RussTedrake/underactuated/blob/c3422ad4b624290688ef9e00b87... | <p>Right. In the compass gait notebook that you cited, there was an important line:</p>
<pre><code># overwrite MultibodyPlant with its autodiff copy
compass_gait = compass_gait.ToAutoDiffXd()
</code></pre>
<p>so that multibody plant that was being used in the constraint is actually an AutoDiffXd version of the plant.<... | Constraints for Direct Collocation method in pydrake | drake | 1 | 58 | 2 | 72,806,990 | 72,806,990 | 1 | true | 2022-06-29T14:08:51.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Constraints for Direct Collocation method in pydrake<p>I am looking for a way to describe the constraints of the Direct Collocation method in pydrake.<br />
... |
72,807,450 | SQLAlchemy filter_by not working with float column type<p>I am trying to filter by lat/long in a table of sites I have to prevent duplicate entries. However, I'm finding that filtering for these columns doesn't find a match that I would expect. Does anyone know why this filter might not be working? Thanks for any help<... | <p>I suspect this could be an issue in equal comparison to floating point number. It can be rather problematic to compare a python <code>float</code> value to a database floating point data type.</p>
<p>The safest way is likely to cast to decimal (<code>decimal(n,m)</code>) when performing the comparison</p>
<pre class... | SQLAlchemy filter_by not working with float column type | python|sqlalchemy | 1 | 58 | 2 | 72,807,580 | 72,807,580 | 1 | true | 2022-06-29T20:26:46.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQLAlchemy filter_by not working with float column type<p>I am trying to filter by lat/long in a table of sites I have to prevent duplicate entries. However,... |
72,816,781 | Avoid scan on attach partition with check constraint<p>I am recreating an existing table as a partitioned table in PostgreSQL 11.</p>
<p>After <a href="https://www.postgresql.org/docs/11/sql-altertable.html" rel="nofollow noreferrer">some research</a>, I am approaching it using the following procedure so this can be do... | <p>The problem is not the check constraint, it is the primary key.</p>
<p>If you make the original unique index include both columns:</p>
<pre><code>create unique index concurrently my_events_temp_id_index on my_events (id,inserted_at);
</code></pre>
<p>And if you make the new table have a unique index rather than a pr... | Avoid scan on attach partition with check constraint | postgresql | 0 | 58 | 1 | 72,821,592 | 72,821,592 | 1 | true | 2022-06-30T13:33:16.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoid scan on attach partition with check constraint<p>I am recreating an existing table as a partitioned table in PostgreSQL 11.</p>
<p>After <a href="https... |
72,828,434 | Naive approach to summarize array of objects?<p>I faced a challenge where I needed to summarize an array of objects by the object's keys. I found a solution, but I can't shake off the feeling, that my approach is pretty naive:</p>
<pre><code>const objArr = [
{ id: 1, val: "" },
{ id: 1, val: "&qu... | <p>you can use <code>Array.prototype.reduce</code> to make your code bit shorter:
<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 objArr = [
{ id: 1, val: "" },
{ id: 1,... | Naive approach to summarize array of objects? | javascript|arrays|sorting|object | 0 | 58 | 3 | 72,828,601 | 72,828,601 | 1 | true | 2022-07-01T11:16:02.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Naive approach to summarize array of objects?<p>I faced a challenge where I needed to summarize an array of objects by the object's keys. I found a solution,... |
72,832,062 | RMAN Backup Compression<p>SQL Server has built-in database backup compression. Is there an easy way to compress RMAN backups? Does it work well? Is restoring from a compressed backup straight forward? Is it even recommended? Thanks.</p> | <p>Compressing backups is straightforward, and restoring from compressed backups is transparent. There is a tradeoff in terms of performance, since compression requires additional CPU overhead; you'll have to decide what works best for you in your situation. Any compression option other than the basic/default (i.e. any... | RMAN Backup Compression | oracle|rman | -1 | 58 | 1 | 72,832,189 | 72,832,189 | 1 | true | 2022-07-01T16:14:23.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RMAN Backup Compression<p>SQL Server has built-in database backup compression. Is there an easy way to compress RMAN backups? Does it work well? Is restoring... |
72,836,357 | How to take one-hour rolling average from a Dataframe in Python with flexible number of readings in each hour?<p>I want to take a one-hour rolling average from a Dataframe in Python but the problem is the number of readings in each hour is not fixed and I cannot put a constant number in the rolling average function. Be... | <p>You can use <code>rolling</code> with an offset only <code>on='local_date_time'</code> column:</p>
<pre><code># Ensure local_date_time is a valid DatetimeIndex
df['local_date_time'] = pd.to_datetime(df['local_date_time'])
df1 = (df.rolling('H', on='local_date_time')['visits']
.agg({'past_1hr_readings': 'co... | How to take one-hour rolling average from a Dataframe in Python with flexible number of readings in each hour? | python|pandas|dataframe|rolling-average | 1 | 58 | 2 | 72,836,665 | 72,836,665 | 1 | true | 2022-07-02T04:02:19.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to take one-hour rolling average from a Dataframe in Python with flexible number of readings in each hour?<p>I want to take a one-hour rolling average fr... |
72,833,374 | Enable orphan words feature for NSMutableAttributedString<p>The default behavior for UILabel is that it prevents orphan words to appear solely on a separate line. ie: if word wrapping happen to keep 1 word alone at the last line. iOS will prevent that by sending a word from the line before it, having two words in the l... | <p>As per OP's comments...</p>
<p>The issue is not with Attributed Text, as the same thing happens with "normal" text.</p>
<p>With iOS 11 (may have been 10), Apple changed UIKit to prevent orphans when a <code>UILabel</code> wraps to <em><strong>two lines of text</strong></em>. Orphans are still allowed with ... | Enable orphan words feature for NSMutableAttributedString | ios|swift|xcode|nsmutableattributedstring | 0 | 58 | 2 | 72,839,957 | 72,839,957 | 1 | true | 2022-07-01T18:32:54.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Enable orphan words feature for NSMutableAttributedString<p>The default behavior for UILabel is that it prevents orphan words to appear solely on a separate ... |
72,835,929 | How to share an object between AppDelegate and SceneDelegate<p>I am already using <strong>AppDelegate</strong> for registering with APNs, but since it does not support the <em>applicationWillResignActive()</em> and <em>applicationWillEnterForeground()</em> functions which handled by the <strong>SceneDelegate</strong> a... | <blockquote>
<p>Just need
help with sharing the client between the two delegates - any
suggestions?</p>
</blockquote>
<p>If it is app-wide to be shared then the simplest is to make it global</p>
<pre><code>let client : Client = Client() // << create here
class AppDelegate: NSObject, UIApplicationDelegate {
... | How to share an object between AppDelegate and SceneDelegate | ios|swift|swiftui | 1 | 58 | 1 | 72,841,606 | 72,841,606 | 1 | true | 2022-07-02T01:53:32.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to share an object between AppDelegate and SceneDelegate<p>I am already using <strong>AppDelegate</strong> for registering with APNs, but since it does n... |
72,845,808 | `torch.gather` without unbroadcasting<p>I have some batched input <code>x</code> of shape <code>[batch, time, feature]</code>, and some batched indices <code>i</code> of shape <code>[batch, new_time]</code> which I want to gather into the time dim of <code>x</code>. As output of this operation I want a tensor <code>y</... | <p>This is actually the most frequent case: when input and index tensors don't perfectly match the number of dimensions. You can still utilize <a href="https://pytorch.org/docs/stable/generated/torch.gather.html" rel="nofollow noreferrer"><code>torch.gather</code></a> though since you can rewrite your expression:</p>
<... | `torch.gather` without unbroadcasting | python|tensorflow|pytorch|gather | 0 | 58 | 1 | 72,846,140 | 72,846,140 | 1 | true | 2022-07-03T10:43:28.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
`torch.gather` without unbroadcasting<p>I have some batched input <code>x</code> of shape <code>[batch, time, feature]</code>, and some batched indices <code... |
72,849,534 | How can I correctly traverse a binary tree in order to return the height of it?<p>I have started implementing this code but now I'm stuck. I'm trying to return the height of the tree from the root to the furthest leaf. I'm able to access the outside leaves but not the inner ones. How can I incorporate the inner leaves ... | <p>try this recursive algorithm:</p>
<pre><code>static int getHeight(Node root){
int left = 0;
int right = 0;
if(root==null) return 0
left = getHeight(root.left)+1;
right= getHeight(root.right)+1;
return Math.Max(left, right);
}
</code></pre> | How can I correctly traverse a binary tree in order to return the height of it? | c#|binary-tree | 0 | 58 | 2 | 72,849,606 | 72,849,606 | 1 | true | 2022-07-03T20:01:04.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I correctly traverse a binary tree in order to return the height of it?<p>I have started implementing this code but now I'm stuck. I'm trying to retu... |
72,863,092 | How to show My Labels and activate respective Shortcut in Pyqt5?<p>Here is my code, How to show My Labels and activate respective QShortcut?. Want to show my labels(both instances) and assign respective shortcut keys to labels and activate it.</p>
<pre><code>import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui imp... | <p>Shortcuts work based on the context (and visibility) of the parent widget: as long as the parent is visible and the <a href="https://doc.qt.io/qt-5/qshortcut.html#context-prop" rel="nofollow noreferrer">context</a> is compatible, they will be triggered, otherwise they will not even be considered.</p>
<p>Be aware tha... | How to show My Labels and activate respective Shortcut in Pyqt5? | python|pyqt|pyqt5 | 1 | 58 | 2 | 72,863,756 | 72,863,756 | 1 | true | 2022-07-05T00:56:16.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show My Labels and activate respective Shortcut in Pyqt5?<p>Here is my code, How to show My Labels and activate respective QShortcut?. Want to show my... |
72,855,278 | Rest Assured access last element in list using JsonPath<p>I want to use RestAssured to test an endpoint that returns a JSON list of objects. How can I verify the contents of the last object in the list using RestAssured JsonPath?</p>
<p>Example return value:</p>
<pre><code>[
{
"foo": "bar"
},
... | <p>Yes, you can use <code>last()</code> to get the last item.</p>
<pre><code>body("last().foo", equalTo("brazz"))
</code></pre> | Rest Assured access last element in list using JsonPath | rest-assured|rest-assured-jsonpath | 0 | 58 | 1 | 72,863,826 | 72,863,826 | 1 | true | 2022-07-04T10:26:40.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rest Assured access last element in list using JsonPath<p>I want to use RestAssured to test an endpoint that returns a JSON list of objects. How can I verify... |
72,865,404 | To find the next word of a particular word as often as possible from a string with python<p>I'm working with Python,I need to find next substring of all order-ids using python code.</p>
<pre class="lang-py prettyprint-override"><code>str = """Delivered-To: example@gmail.com\r\nReceived: by 2002:a05:7022:... | <p>You could use <a href="https://docs.python.org/3/library/re.html#re.findall" rel="nofollow noreferrer"><code>re.findall</code></a> to find the digits after every <code>order-id #</code>:</p>
<pre class="lang-py prettyprint-override"><code>import re
str = """order-id #123 order-id #234 order-id #345 o... | To find the next word of a particular word as often as possible from a string with python | python|string|find|multiple-occurrence | 0 | 58 | 2 | 72,865,439 | 72,865,439 | 1 | true | 2022-07-05T07:18:22.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
To find the next word of a particular word as often as possible from a string with python<p>I'm working with Python,I need to find next substring of all orde... |
72,853,252 | How to overwrite a running request in React<p>Say I have a request I want to make on a delay, like Google Docs waiting a moment before sending the "save" request, I'd implement it in browser JavaScript by doing something like this:</p>
<pre class="lang-js prettyprint-override"><code>// Overwrite this global w... | <p>It seems like you are trying to implement <a href="https://www.geeksforgeeks.org/debouncing-in-javascript/" rel="nofollow noreferrer">debouncing</a>. There are several ways you can do this. Check out this <a href="https://stackoverflow.com/questions/23123138/perform-debounce-in-react-js">SO question</a>. I have impl... | How to overwrite a running request in React | javascript|reactjs|next.js | 0 | 58 | 1 | 72,865,768 | 72,865,768 | 1 | true | 2022-07-04T07:39:55.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to overwrite a running request in React<p>Say I have a request I want to make on a delay, like Google Docs waiting a moment before sending the "save... |
72,867,924 | Flutter Change Colour Of Icon<p>I am trying to change the colour of an icon so black so that it matches the rest of the text.
I use the following statement to determine which icon to use based on the theme:</p>
<pre><code>class ChangeThemeButtonWidget extends StatelessWidget {
const ChangeThemeButtonWidget({Key? key}... | <p>You are applying color on wrong place. IconData is just widget that describes Icon based on font data. It has nothing to do with color. You have to put those IconData into Icon widget and change color there.</p>
<pre><code>class ChangeThemeButtonWidget extends StatelessWidget {
const ChangeThemeButtonWidget({Key? ... | Flutter Change Colour Of Icon | flutter|dart | 0 | 58 | 3 | 72,868,046 | 72,868,046 | 1 | true | 2022-07-05T10:31:33.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Change Colour Of Icon<p>I am trying to change the colour of an icon so black so that it matches the rest of the text.
I use the following statement t... |
72,867,593 | How can I return a C# Object instead of array JSON<p>I have this code</p>
<pre><code>return Ok(
new object[]
{
new { name = Dname, primaryLastName =DprimaryLastName, secondLastName= DsecondLastName,degrees= Ddegrees, roles= Droles, entityId = DentityId, enrollment = Denrollment, payrollNumber = DpayrollNumber, photo... | <p>Looks like you need to remove the outer array, and use a list for the dictionary value</p>
<pre class="lang-cs prettyprint-override"><code>var required = new List<string>>();
var optional = new List<string>>();
foreach (DataTable table in dsgroupsinfo.Tables)
{
foreach (DataRow dr in table.Rows... | How can I return a C# Object instead of array JSON | c#|arrays|json|rest|object | 2 | 58 | 2 | 72,868,303 | 72,868,303 | 1 | true | 2022-07-05T10:08:05.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I return a C# Object instead of array JSON<p>I have this code</p>
<pre><code>return Ok(
new object[]
{
new { name = Dname, primaryLastName =Dprima... |
72,870,451 | NavigatorPush is not working on my Flutter App<p>I try to build simple login with laravel but then got stuck. After login success I can't redirect to another page with Navigator.push. I think I've followed the tutorial right.</p>
<p>this is login.dart</p>
<pre><code>class LoginScreen extends StatefulWidget {
static c... | <p>@Damara Jati P Kindly make the following changes Step 1-3</p>
<pre><code>import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class LoginScreen extends StatefulWidget {
static const routeName = '/login-screen';
const LoginScreen({Key? key}) : super(key: key);
... | NavigatorPush is not working on my Flutter App | flutter|flutter-web | 1 | 58 | 3 | 72,871,950 | 72,871,950 | 1 | true | 2022-07-05T13:40:31.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NavigatorPush is not working on my Flutter App<p>I try to build simple login with laravel but then got stuck. After login success I can't redirect to another... |
72,877,582 | Discriminated type unions in typescript with lookup object<p>I have some event interface that might have different type signature, depending on what type of event it is. Let's say we have 'FizzChange' and 'BuzzChange', and they both extend 'EventTypeBase'</p>
<pre><code>interface EventTypeBase {
id: string;
timesta... | <p>Here's a somewhat involved approach that uses the <a href="https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#discriminated-unions" rel="nofollow noreferrer">discriminated union</a> <a href="https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#handbook-content" rel="nofollow n... | Discriminated type unions in typescript with lookup object | typescript|lookup-tables|discriminated-union | 1 | 58 | 2 | 72,881,272 | 72,881,272 | 1 | true | 2022-07-06T03:15:05.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Discriminated type unions in typescript with lookup object<p>I have some event interface that might have different type signature, depending on what type of ... |
72,871,432 | convert nanosecond value into datetime using pyspark in databricks<p>I'm trying to recreate some work I have already done in Python using Databricks. I have a dataframe and within it is a column called 'time', of data in nanoseconds. In Python, I use the following code to convert the field into the appropriate dateti... | <p>Pyspark does not provide any direct functions to work with time in nanoseconds. There is a function called <code>from_unixtime()</code> which takes time in <strong>seconds</strong> as argument and converts it to a timestamp of the format <code>yyyy-MM-dd hh:mm:ss</code> (your requirement). So, to use this function w... | convert nanosecond value into datetime using pyspark in databricks | python|azure-databricks|python-datetime|pyspark-pandas | 0 | 58 | 1 | 72,882,712 | 72,882,712 | 1 | true | 2022-07-05T14:50:13.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
convert nanosecond value into datetime using pyspark in databricks<p>I'm trying to recreate some work I have already done in Python using Databricks. I have... |
72,886,101 | Looping over an object to change values inside<p>I am trying to send an object to an api and my object contains arrays that I want to turn into strings. However I am having trouble returning the new object with the arrays turned to strings. My goal is to have a copy of the original object with all the arrays turned int... | <p>You are not assigning the new value to anything, so it is being lost with each loop. Try:</p>
<pre><code>object1[key] = object1[key].toString()
</code></pre>
<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... | Looping over an object to change values inside | javascript|arrays|object|tostring | 1 | 58 | 4 | 72,886,156 | 72,886,156 | 1 | true | 2022-07-06T15:19:42.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping over an object to change values inside<p>I am trying to send an object to an api and my object contains arrays that I want to turn into strings. Howe... |
72,893,916 | Split text By specific keyword<p>I have a list and I want to add the words that come after a certain word in this list into a new list.</p>
<p><strong>exp input</strong></p>
<pre><code>list =["split","foo","foo","foo","split","mama","mama","spli... | <p>You can simply iterate and keep a track of the current visisted set.</p>
<pre class="lang-py prettyprint-override"><code>l =["split","foo","foo","foo","split","mama","mama","split","orange","melon"]
ans = []
curr = []... | Split text By specific keyword | python|algorithm|split | 0 | 58 | 3 | 72,893,988 | 72,893,988 | 1 | true | 2022-07-07T07:34:39.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split text By specific keyword<p>I have a list and I want to add the words that come after a certain word in this list into a new list.</p>
<p><strong>exp in... |
72,895,739 | Exception java.lang.IllegalArgumentException: is not an interface when using dynamic proxies<p>I want to implement a generic functionality which would enable that our domain classes are being proxied for the case that its values to be xml compliant (escaping special characters in strings). The domain classes/objects ar... | <p>Your <code>createProxy</code> method does work, you just have to pass the class of the interface as second parameter:</p>
<pre><code>A orig = new A();
IA proxy1 = (IA) createProxy(orig, IA.class);
</code></pre>
<p>In addition I would recomment you to use the <code>createProxy</code> function as a generic function in... | Exception java.lang.IllegalArgumentException: is not an interface when using dynamic proxies | java | 0 | 58 | 1 | 72,896,194 | 72,896,194 | 1 | true | 2022-07-07T09:51:31.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exception java.lang.IllegalArgumentException: is not an interface when using dynamic proxies<p>I want to implement a generic functionality which would enable... |
72,903,064 | The first element of the string array isn't being found<p>I am trying to match queries with elements in the string array but when I try to search for the first element entered into the array before sorting, the result shows that the element was not found. What is wrong with the code?</p>
<pre><code>import java.util.*;
... | <p>Your while loop causes this problem. The first element has the index <code>0</code> and as long as <code>lp < up</code> 0 is not reachable. Change the smaller than to a smaler equals and you're good.</p>
<p>In addition I would add a check that <code>up</code> doesn't get smaller than <code>0</code> because you ar... | The first element of the string array isn't being found | java|arrays|string|binary-search | 1 | 58 | 1 | 72,903,254 | 72,903,254 | 1 | true | 2022-07-07T19:08:16.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The first element of the string array isn't being found<p>I am trying to match queries with elements in the string array but when I try to search for the fir... |
72,903,909 | In Power Query, when duplicating the source query should I duplicate the Transform File folder as well?<p>My apologies in advance if this question has already been asked, if so I cannot find it.</p>
<p>So, I have this huge data base divided by country where I need to import from each country data base individually and ... | <p>The <code>Transform Files Folder</code> group contains the code that is called to transform a list of files. It is re-usable code. You can see the <code>Sample File</code>, which serves as the template for the transform actions.</p>
<p>As long as the file that is arrived at for the <code>Sample File</code> has the s... | In Power Query, when duplicating the source query should I duplicate the Transform File folder as well? | import|analytics|powerquery | 0 | 58 | 2 | 72,904,361 | 72,904,361 | 1 | true | 2022-07-07T20:33:22.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Power Query, when duplicating the source query should I duplicate the Transform File folder as well?<p>My apologies in advance if this question has alread... |
72,876,309 | Using no flag options with Cobra Command?<p>I have a command with a default option - id. There may be other flags as well, so any of the following could be called.</p>
<pre><code>cmd 81313 # 81313 is the ID
cmd -i 81313
cmd -f foo.txt 81313
cmd -i 81313 -f foo.txt
cmd 81313 -f foo.txt
</code></pre>
<p>What is the corre... | <blockquote>
<p>i wish there was a more idiomatic way that this is done</p>
</blockquote>
<p>I think there is, and it's the idea I was trying to get across in the comments: don't provide multiple ways of specifying the same option on the command line.</p>
<p>When choosing between a positional argument vs. an option, th... | Using no flag options with Cobra Command? | go|command-line-interface|go-cobra | 0 | 58 | 1 | 72,905,873 | 72,905,873 | 1 | true | 2022-07-05T22:50:11.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using no flag options with Cobra Command?<p>I have a command with a default option - id. There may be other flags as well, so any of the following could be c... |
72,917,107 | Typescript: Property name collisions in types vs interfaces<p>Let's say I have 2 types with the same property name but different data types:</p>
<pre><code>type A = {
myProperty:string
}
type B = {
myProperty:number
}
</code></pre>
<p>If I extend both using an interface, I see an error as expected:</p>
<pre><code>... | <p>If you want to intersect two conflicting types but still want to instantiate the resulting type, there are multiple options to handle it. <strong>Note</strong> that both solutions will not resolve conflicts for properties nested deeper than the first level.</p>
<p>Let's say we have two interfaces <code>A</code> and ... | Typescript: Property name collisions in types vs interfaces | typescript|types|interface | 0 | 58 | 1 | 72,917,584 | 72,917,584 | 1 | true | 2022-07-08T21:20:52.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript: Property name collisions in types vs interfaces<p>Let's say I have 2 types with the same property name but different data types:</p>
<pre><code>t... |
72,919,869 | Show fields IF select option is selected<p>I'm trying to make my form somehow more user-friendly. So don't show at the first spot all the fields but only the necessary one, and if a user will meet certain criteria, then show the rest of the fields. It's based on newest bootstrap. My codes are like below:</p>
<p><div cl... | <p>Loop through <code>showHidden</code> since it's a <code>NodeList</code>, then use <code>setAttribute('style', 'display: block!important')</code> since you can't add important to an <code>HTMLElement</code>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div clas... | Show fields IF select option is selected | javascript|html|css|twitter-bootstrap|if-statement | 1 | 58 | 2 | 72,919,974 | 72,919,974 | 1 | true | 2022-07-09T08:00:02.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show fields IF select option is selected<p>I'm trying to make my form somehow more user-friendly. So don't show at the first spot all the fields but only the... |
72,920,698 | Regex Match splitting simple words and quotation words by comma<p>im new to regular expressions and i want to build an expression that finds the below pattern:</p>
<p>I have the string:</p>
<pre><code>"'Hello world',dude, 'Somethings, never, turn and go', bye"
</code></pre>
<p>I want a regular expression tha... | <p>I seen your <a href="https://stackoverflow.com/q/72911051/9758194">previous</a> question. Coincidentally it showed comma's right after or before the single quote. Hence the "wrong" answer back there. In this case, maybe look for balanced single quotes ahead:</p>
<p><div class="snippet" data-lang="js" data-... | Regex Match splitting simple words and quotation words by comma | javascript|regex | 1 | 58 | 2 | 72,920,987 | 72,920,987 | 1 | true | 2022-07-09T10:42:02.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex Match splitting simple words and quotation words by comma<p>im new to regular expressions and i want to build an expression that finds the below patter... |
72,920,903 | Flutter - How to make a stack of slidable card<p>How to make a stack of slidable cards like this in flutter.</p>
<p>There must be both right and left sliding possible.</p>
<p><a href="https://i.stack.imgur.com/PFjQH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFjQH.jpg" alt="enter image descript... | <p>For swiping a stack of cards you can use <a href="https://pub.dev/packages/swipable_stack" rel="nofollow noreferrer">swipable_stack</a> package. There is also <a href="https://github.com/flutter/samples/blob/master/animations/lib/src/misc/card_swipe.dart" rel="nofollow noreferrer">this GitHub code</a> to get some id... | Flutter - How to make a stack of slidable card | flutter|dart|flutter-layout | 2 | 58 | 1 | 72,921,070 | 72,921,070 | 1 | true | 2022-07-09T11:15:44.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter - How to make a stack of slidable card<p>How to make a stack of slidable cards like this in flutter.</p>
<p>There must be both right and left slidin... |
72,919,504 | Github workflow schedule wont run?<p>I have a workflow which I want to run as a schedule job. But its also run based on another workflow is success or not. As now its not running as schedule but it works if the other workflow is success.</p>
<p>My workflow:</p>
<pre><code>name: Security
on:
workflow_run:
workflo... | <p>Your assumption is correct. To check if your workflow is being triggered via a cron job (scheduled event), you may do:</p>
<pre class="lang-yaml prettyprint-override"><code>if: ${{ github.event_name == 'schedule' }}
</code></pre>
<p>In your case, your if condition should look:</p>
<pre class="lang-yaml prettyprint-o... | Github workflow schedule wont run? | github-actions | 1 | 58 | 1 | 72,923,244 | 72,923,244 | 1 | true | 2022-07-09T06:46:19.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Github workflow schedule wont run?<p>I have a workflow which I want to run as a schedule job. But its also run based on another workflow is success or not. A... |
72,923,198 | pandas - Convert timing data (motor racing) to seconds<p>I am trying to convert timing data (lap times and sector times in motor racing) given in the format [ss.000 or m:ss.000] (se below) to seconds or datetime, in order to be able to analyse it.</p>
<pre><code>df = pd.DataFrame([[48.004, 1:13.564], [38.965, 58.223], ... | <p>I would suggest converting the strings in proper time format(<code>hh:mm:ss.fff</code>), then use <code>pd.to_timedelta</code> to parse the strings to timedelta:</p>
<pre><code>d = {'^(\d+\.\d+)$': r'00:00:\1', '^(\d+:\d+\.\d+)$': r'00:\1'}
df.replace(d, regex=True).apply(pd.to_timedelta)
</code></pre>
<hr />
<pre><... | pandas - Convert timing data (motor racing) to seconds | python|pandas|time | 1 | 58 | 2 | 72,923,767 | 72,923,767 | 1 | true | 2022-07-09T16:53:48.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas - Convert timing data (motor racing) to seconds<p>I am trying to convert timing data (lap times and sector times in motor racing) given in the format ... |
72,926,188 | Functional way to find item in array from a previous index<p>I have an array of objects</p>
<p>Something like</p>
<pre><code>const items: item[] = [
{id: 1, type: 'parent'},
{id: 2, type: 'parent'},
{id: 3, type: 'child'},
{id: 4, type: 'child'},
]
</code></pre>
<p>Now I want to make a function that if ... | <p>First, ensure you don't recreate the elements of your array as you did in your example. Since you're changing the reference, the indexOf function will not be able to find it. A better approach is to use the <code>findIndex</code> index, which receives a matcher function. It'll return the index of the first element t... | Functional way to find item in array from a previous index | javascript|typescript | 0 | 58 | 4 | 72,926,276 | 72,926,276 | 1 | true | 2022-07-10T04:44:54.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Functional way to find item in array from a previous index<p>I have an array of objects</p>
<p>Something like</p>
<pre><code>const items: item[] = [
{id:... |
72,931,288 | How to change html href attribute variable value with jQuery?<p>I am trying to change html href attribute variable value ?post=55 to ?post=44 with button click while not changing other URL variable(thread=7) using jQuery, but don't know how.</p>
<p><strong>HTML</strong></p>
<pre><code><button class="button"... | <p>To do what you require you can provide a function to <code>prop()</code> (note: not <code>attr()</code>*) which accepts the current attribute value as an argument. From there you can use a regular expression to find the number within the current <code>href</code> and replace it.</p>
<p>The benefit of using this meth... | How to change html href attribute variable value with jQuery? | javascript|jquery | 1 | 58 | 2 | 72,931,547 | 72,931,547 | 1 | true | 2022-07-10T19:26:29.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change html href attribute variable value with jQuery?<p>I am trying to change html href attribute variable value ?post=55 to ?post=44 with button cli... |
72,932,577 | How to check if a cell of a Dataframe exists as a key in a dict, and if it does, check if another cell in same row exists in a list in a dict<p>I currently have a dataframe like this</p>
<pre><code> colA colB colC colD
1 1a Yes Yes
1 1b Yes Yes
2 2a Yes Yes
2 ... | <p>Flatten the <code>fitersDict</code> into list of tuples then create a multindex from it, the use <code>Multindex.isin</code> to test from the occurrence of multiindex in the columns <code>colA</code>, <code>colB</code> of given dataframe</p>
<pre><code>i1 = df.set_index(['colA', 'colB']).index
i2 = pd.MultiIndex.fro... | How to check if a cell of a Dataframe exists as a key in a dict, and if it does, check if another cell in same row exists in a list in a dict | python|python-3.x|pandas|dataframe | 1 | 58 | 3 | 72,933,776 | 72,933,776 | 1 | true | 2022-07-10T23:43:43.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if a cell of a Dataframe exists as a key in a dict, and if it does, check if another cell in same row exists in a list in a dict<p>I currently h... |
72,937,858 | Ansible - Concatinating variable give error `can only concatenate list (not \"NoneType\") to list"`<p>I have three variable files app1.yml, app2.yml and app3.yml having the same variable name viz dbconn</p>
<pre><code>cat app1-webapps-dev.yml
dbconn:
- host1 port1
cat app2-webapps-dev.yml
dbconn:
- host4 port4
-... | <p>you can add a condition, as a NoneType equals false</p>
<pre><code>- set_fact:
dbconn: "{{ dbconn|d([]) + (lookup('file', item ~ '-webapps-dev'~ '.yml' )|from_yaml).dbconn }}"
when: ((lookup('file', item ~ '-webapps-dev'~ '.yml' )|from_yaml).dbconn)
</code></pre> | Ansible - Concatinating variable give error `can only concatenate list (not \"NoneType\") to list"` | variables|error-handling|ansible|runtime-error|concatenation | 0 | 58 | 1 | 72,938,393 | 72,938,393 | 1 | true | 2022-07-11T11:29:56.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ansible - Concatinating variable give error `can only concatenate list (not \"NoneType\") to list"`<p>I have three variable files app1.yml, app2.yml and app3... |
72,939,856 | R adding columns and data<p>I have a table with two columns A and B. I want to create a new table with two new columns added: X and Y. These two new columns are to contain data from column A, but every second row from column A. Correspondingly for column X, starting from the first value in column A and from the second... | <p>It is not a super elegant solution, but it works:</p>
<pre><code>exampleDF <- structure(list(A = c(2L, 7L, 5L, 11L, 54L,
12L, 34L, 14L, 10L, 6L),
B = c(3L, 5L, 1L, 21L, 67L,
32L, 19L, 24L, 44L, 37L)),
... | R adding columns and data | r|multiple-columns|add | 1 | 58 | 3 | 72,939,999 | 72,939,999 | 1 | true | 2022-07-11T14:04:38.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R adding columns and data<p>I have a table with two columns A and B. I want to create a new table with two new columns added: X and Y. These two new columns ... |
72,939,843 | React / Nextjs: .map() output based on state array doesn't rerender because of keys don't change<p>I have a react component <code>Matches.js</code> that handles the output of tournament matches, sorted by their rounds. All the data is fetched from a parent component which fetches it via nextjs SSR and then gives the da... | <p>After looking at your code I would say that your problem lies inside <code>SingleMatchView</code>. As I can see you have multiple useStates that use <code>matchData</code> in order to fill state initial values. What is wrong here is the fact that you are not "resetting" those state values once you successf... | React / Nextjs: .map() output based on state array doesn't rerender because of keys don't change | javascript|reactjs|next.js | 0 | 58 | 1 | 72,940,669 | 72,940,669 | 1 | true | 2022-07-11T14:03:53.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React / Nextjs: .map() output based on state array doesn't rerender because of keys don't change<p>I have a react component <code>Matches.js</code> that hand... |
72,928,072 | Play/Pause/Stop Audio in Typewriter<p>I will start streaming soon. I'm using Streamelements. So I found an overlay and was making a few changes to it. Typewrite is used when making alert boxes and I like it. I just want to add keyboard sound to it. But I couldn't do it. The sound I added continues to play until the ale... | <p>The <code>play</code> method returns a Promise: <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play</a>. The library you are using offers a <code>callFunction</code> method that you can run b... | Play/Pause/Stop Audio in Typewriter | javascript | 1 | 58 | 1 | 72,942,160 | 72,942,160 | 1 | true | 2022-07-10T11:16:03.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Play/Pause/Stop Audio in Typewriter<p>I will start streaming soon. I'm using Streamelements. So I found an overlay and was making a few changes to it. Typewr... |
72,942,500 | How can call an api twice (with different parameters each time) with a callback, and return two different responses combined together in json?<p>The below code is currently working but only brining back the first parameters JSON response.</p>
<p>I would like to be able to call this external API a few times with differe... | <p>You can wait for multiple asynchronous jobs to complete using <code>Promise.all</code>. Let's say you have an array of request parameters:</p>
<pre class="lang-js prettyprint-override"><code>const reqs = [
{ q: 'request one', tbm: 'isch' },
{ q: 'request two', tbm: 'isch' },
{ q: 'request three', tbm: 'isch' }... | How can call an api twice (with different parameters each time) with a callback, and return two different responses combined together in json? | javascript|json|api|promise|asynccallback | 0 | 58 | 1 | 72,942,724 | 72,942,724 | 1 | true | 2022-07-11T17:30:45.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can call an api twice (with different parameters each time) with a callback, and return two different responses combined together in json?<p>The below co... |
72,946,873 | How to save in localStorage that refreshing browser do not change the value (JavaScript)?<p>I have a counter of clicks. Every click increase value. I'd like to save to in local storage, that <strong>refreshing page keeps the value</strong>. Now it saves the value in local storage, but not keep it if I refresh the brows... | <p>You should get data first otherwise it will always start with 0.</p>
<pre><code>let countedClicks = parseInt(localStorage.getItem("btnClicksSaved") ?? '0');
const countingClicks = () => {
countedClicks += 1;
localStorage.setItem("btnClicksSaved", countedClicks);
let savedClicks = lo... | How to save in localStorage that refreshing browser do not change the value (JavaScript)? | javascript|local-storage|page-refresh | -1 | 58 | 4 | 72,947,072 | 72,947,072 | 1 | true | 2022-07-12T03:59:00.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to save in localStorage that refreshing browser do not change the value (JavaScript)?<p>I have a counter of clicks. Every click increase value. I'd like ... |
72,955,934 | Linux - Get Substring from 1st occurence of character<p><strong>FILE1.TXT</strong></p>
<p>0020220101</p>
<p>or</p>
<p>01 20220101</p>
<p>Need to extra date part from file where text starts from 2</p>
<p>Options tried:</p>
<pre><code>t_FILE_DT1='awk -F"2" '{PRINT $NF}' FILE1.TXT'
t_FILE_DT2='cut -d'2' -f2- FIL... | <p>Use <code>grep</code> like so:</p>
<pre><code>echo "0020220101\n01 20220101" | grep -P -o '\d{8}\b'
20220101
20220101
</code></pre>
<p>Here, GNU <a href="https://www.gnu.org/software/grep/manual/grep.html" rel="nofollow noreferrer"><code>grep</code></a> uses the following options:<br />
<code>-P</code> : U... | Linux - Get Substring from 1st occurence of character | unix|awk | 1 | 58 | 5 | 72,955,987 | 72,955,987 | 1 | true | 2022-07-12T17:00:57.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linux - Get Substring from 1st occurence of character<p><strong>FILE1.TXT</strong></p>
<p>0020220101</p>
<p>or</p>
<p>01 20220101</p>
<p>Need to extra date p... |
72,956,369 | Unable to perform npm install after cloning a repo from github<p>I'm cloning a project that I'm working on from another computer on to my home computer and I'm unable to do <code>npm install</code>. I've cloned the repo successfully but when I try and write <code>npm install</code> to install all the packages I get thi... | <p>The version of installed npm on your machine differs substantially with the version used by the repository. Firstly try to remove(delete) package-lock.json file and run npm install again. This file is used to lock the configuration down to child and nested dependencies to exact versions!. That is often times not nee... | Unable to perform npm install after cloning a repo from github | npm|npm-install | 0 | 58 | 1 | 72,956,824 | 72,956,824 | 1 | true | 2022-07-12T17:40:40.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to perform npm install after cloning a repo from github<p>I'm cloning a project that I'm working on from another computer on to my home computer and I... |
72,957,956 | Are async useEffect Callbacks Actually Harmful, or Just a "Smell"?<p>I can find lots of articles on the web that will tell you to change:</p>
<pre><code> useEffect(async() => {
await doSomethingAsynchronous();
})
</code></pre>
<p>into:</p>
<pre><code> useEffect(() => {
const pointlessFunction = async () =&... | <p>While the other answers here are great and informative, none directly answered my original question, ie. "Is there any harm to providing <code>useEffect</code> with an <code>async</code> callback?</p>
<p>The answer is ... <strong>no, there is no harm</strong>.</p>
<p>However, there is an important limitation to... | Are async useEffect Callbacks Actually Harmful, or Just a "Smell"? | reactjs|async-await|use-effect | 1 | 58 | 3 | 72,959,501 | 72,959,501 | 1 | true | 2022-07-12T20:19:17.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are async useEffect Callbacks Actually Harmful, or Just a "Smell"?<p>I can find lots of articles on the web that will tell you to change:</p>
<pre><code> use... |
72,931,695 | Can't delete document in Firestore from React/Redux<p>I'm building a CRUD application using redux toolkit and firestore, and I cannot figure out how to delete an item from firestore, and I really don't know why the following code isn't working. I've tried this in several different ways, and the current error that I'm g... | <p>The <code>deleteDoc()</code> functions takes <a href="https://firebase.google.com/docs/reference/js/firestore_.documentreference" rel="nofollow noreferrer"><code>DocumentReference</code></a> of the document and not the snapshot. Also try using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Referenc... | Can't delete document in Firestore from React/Redux | javascript|google-cloud-firestore|redux|redux-toolkit | 0 | 58 | 1 | 72,962,481 | 72,962,481 | 1 | true | 2022-07-10T20:32:49.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't delete document in Firestore from React/Redux<p>I'm building a CRUD application using redux toolkit and firestore, and I cannot figure out how to delet... |
72,963,373 | Does any browser allow me to step through network requests one-by-one?<p>I'm hoping to find which of my page's many network requests are triggering a problem. (Or rather, I want to guide someone else through this process remotely.)</p>
<p>Is there any browser that offers a way to "step through" network reques... | <p>I'm not sure if you know but there is a tab inside browser's DevTools called <strong>Network</strong> where you can see all the requests, pause them or see their type.</p>
<p><a href="https://i.stack.imgur.com/xM8st.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xM8st.png" alt="Network tab inside... | Does any browser allow me to step through network requests one-by-one? | javascript|ajax|browser|frontend | -1 | 58 | 2 | 72,963,742 | 72,963,742 | 1 | true | 2022-07-13T08:47:46.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does any browser allow me to step through network requests one-by-one?<p>I'm hoping to find which of my page's many network requests are triggering a problem... |
72,954,568 | How can I single out which item in my map function should be affected by my function call in react?<p>I have a series of sliders in a page and I have a specific requirement that requires to add a padding to the slider when there are no items below its 0 index. I have this done already, but I can't figure out how to mak... | <p>I would say in order to control each slider individually, you need to break up your <code>App</code> component into smaller peaces.</p>
<p>My suggestion is to extract all custom logic for your slider to separate component, let's call it <code>CustomSliderComponent</code> and pass some data peaces from <code>App</cod... | How can I single out which item in my map function should be affected by my function call in react? | javascript|reactjs | 2 | 58 | 1 | 72,969,259 | 72,969,259 | 1 | true | 2022-07-12T15:10:51.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I single out which item in my map function should be affected by my function call in react?<p>I have a series of sliders in a page and I have a speci... |
72,966,268 | Paypal webhook when subscription ends/expires not fired<p>There are several webhooks for PayPal, I enabled the following:</p>
<ul>
<li>Billing subscription activated</li>
<li>Billing subscription cancelled</li>
<li>Billing subscription created</li>
<li>Billing subscription expired</li>
<li>Billing subscription payment ... | <p>If you are not using trial periods, the only event you need to listen for is PAYMENT.SALE.COMPLETED</p>
<p>None of the BILLING.SUBSCRIPTION.* events are of any particular utility</p>
<p>Cron or whichever scheduler you wish to use should handle profiles that do not receive new PAYMENT.SALE.COMPLETED events by a desir... | Paypal webhook when subscription ends/expires not fired | paypal-subscriptions|paypal-webhooks | 0 | 58 | 1 | 72,971,477 | 72,971,477 | 1 | true | 2022-07-13T12:26:25.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Paypal webhook when subscription ends/expires not fired<p>There are several webhooks for PayPal, I enabled the following:</p>
<ul>
<li>Billing subscription a... |
72,972,609 | difference between += and append in python nested list concatenating<p>for example:</p>
<pre><code>re=[]
for i in range(5):
#fill code here
</code></pre>
<ul>
<li>1.) if we do "<code>re.append(i)</code>", re will be <code>[0,1,2,3,4]</code></li>
<li>2.) if we do "<code>re.append([i])</code>", re... | <p><code>[i],</code> is equivalent to <code>([i],)</code>, which is a tuple with one element, and that element is the list <code>[i]</code>.</p>
<p>When you concatenate any sequence to a list with <code>+=</code>, it iterates over the sequence and appends each element to the list. So</p>
<pre><code>re += [i],
</code></... | difference between += and append in python nested list concatenating | python|list|tuples|concatenation | 1 | 58 | 1 | 72,972,672 | 72,972,672 | 1 | true | 2022-07-13T21:01:56.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
difference between += and append in python nested list concatenating<p>for example:</p>
<pre><code>re=[]
for i in range(5):
#fill code here
</code></pre>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.