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,263,204 | Why are certain file names not allowed for local Python source code files?<p>There seem to be file names that are not allowed to exist in the same directory in which I'm running my Python source code because they probably conflict with a file of the same name within a module in which I've imported.</p>
<p><strong>Is th... | <blockquote>
<p>This seems bizarre being how long Python has been around and is not fixed or the default install of Python doesn't avoid this, despite what modules are imported</p>
</blockquote>
<p>It is not fixed or avoided because it is considered to be working as intended. In the default configuration, any time Pyth... | Why are certain file names not allowed for local Python source code files? | python|exception | -1 | 71 | 2 | 72,263,526 | 72,263,526 | 1 | true | 2022-05-16T17:21:30.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why are certain file names not allowed for local Python source code files?<p>There seem to be file names that are not allowed to exist in the same directory ... |
72,266,973 | Fatal error when trying to Parse a XML file to CSV in PHP<p>I am stuck on a bit of code for my program, where I am attempting to convert a XML document to CSV using a function in PHP. The code for the function is:</p>
<pre><code>function createCsv($xml, $f)
{
foreach ($xml->children() as $item)
... | <p>You are considering <code>$_FILES</code> as the <code>xml</code> file, which is incorrect.
<code>$_FILES</code> is an associative array of uploaded files. You need to open the file and read the data. To do so you can use <code>simplexml_load_file</code>:</p>
<pre><code>$xml = simplexml_load_file($_FILES["fileTo... | Fatal error when trying to Parse a XML file to CSV in PHP | php|xampp | 1 | 71 | 1 | 72,267,110 | 72,267,110 | 1 | true | 2022-05-17T00:28:38.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fatal error when trying to Parse a XML file to CSV in PHP<p>I am stuck on a bit of code for my program, where I am attempting to convert a XML document to CS... |
72,273,784 | PHP "XML Parsing Error: XML or text declaration not at start of entity"<p>My API processor returns data in one of several formats designated by the "type' keyword in the request. I am able to invoke, for instance, a JSON header using the following method, but this does not work for XML. Is there a way of invoking ... | <p><code>"XML Parsing Error: XML or text declaration not at start of entity"</code> means that somewhere at the start of your XML output, there is a space or other character that's not supposed to be there. There are a few places to check:</p>
<ul>
<li>The beginning of every PHP file. Make sure there are no s... | PHP "XML Parsing Error: XML or text declaration not at start of entity" | php|xml|api | -2 | 71 | 1 | 72,277,164 | 72,277,164 | 1 | true | 2022-05-17T12:07:00.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP "XML Parsing Error: XML or text declaration not at start of entity"<p>My API processor returns data in one of several formats designated by the "typ... |
72,278,570 | How to use excel file data in an ios app?<p>I'm new to Rad Studio so I may be missing something, but I am trying to create an iOS app that just displays a list of data. I currently have an iOS app with a tListView that gets populated by a ClientDataSet, which is populated with data that I hard-coded into an xml file t... | <p>I strongly recommend against using Excel files for this purpose.
There are several reasons for that:</p>
<ol>
<li>Excel files are not designed to be sources of data for automated processing. These are electronic spreadsheets designed to be used by humans. Formats like XML, CSV and JSON work much, much better as data... | How to use excel file data in an ios app? | ios|c++builder|rad-studio|tlistview | 0 | 71 | 1 | 72,281,446 | 72,281,446 | 1 | true | 2022-05-17T17:50:06.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use excel file data in an ios app?<p>I'm new to Rad Studio so I may be missing something, but I am trying to create an iOS app that just displays a li... |
72,275,736 | Not able to enter card details in RazorPay Checkout UI<p>I am using razorpay checkout.js in two react application with same strcuture</p>
<p><code> 'https://checkout.razorpay.com/v1/checkout.js'</code></p>
<p>in one project I am able to enter card details in another I am not able to enter the card details (input field... | <p>I figured out the issue, another popup modal was open in the page, when I close the other popup it worked</p> | Not able to enter card details in RazorPay Checkout UI | javascript|reactjs|razorpay | 0 | 71 | 1 | 72,282,368 | 72,282,368 | 1 | true | 2022-05-17T14:21:07.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to enter card details in RazorPay Checkout UI<p>I am using razorpay checkout.js in two react application with same strcuture</p>
<p><code> 'https:/... |
72,285,267 | python how to convert <type 'str'> to <type 'dict'><p>I have a below dictionary defined with IP address of the application for the respective region. Region is user input variable, based on the input i need to procees the IP in rest of my script.</p>
<pre><code>app_list=["puppet","dns","ntp&quo... | <p>problem 1: your loop implies that app_list is a nested dict, which it isn't</p>
<p>problem 2: appl is a key to a dict, not the value of the dict.</p>
<p>this works:</p>
<pre class="lang-py prettyprint-override"><code>app_list={
"puppet": {'asia':["172.118.162.2251","1932.1625.254.2493"]... | python how to convert <type 'str'> to <type 'dict'> | python|dictionary | -3 | 71 | 2 | 72,285,552 | 72,285,552 | 1 | true | 2022-05-18T07:58:19.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python how to convert <type 'str'> to <type 'dict'><p>I have a below dictionary defined with IP address of the application for the respective region. Region ... |
72,286,149 | Set or add margin to left under each summary tag in html<p>Could someone help me to add a margin to left of "Second Summary" maybe 12px and to the "Third Summary" x2 or 24px?</p>
<p>I am thinking if it possible to use CSS selector.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-co... | <pre><code>details details{
margin-left: 12px;
}
</code></pre> | Set or add margin to left under each summary tag in html | css | 0 | 71 | 4 | 72,286,253 | 72,286,253 | 1 | true | 2022-05-18T09:01:26.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set or add margin to left under each summary tag in html<p>Could someone help me to add a margin to left of "Second Summary" maybe 12px and to the ... |
72,286,780 | Is there any solution for calculate checksum?<p>I'm writing a SerialPort tool, And I got a problem that I don't know how to calculate the checksum...</p>
<p>For example:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;">Flag</th>
<th style="text-align: center;">COM... | <p>You seem to have already answered your own question, more or less, though your calculation method mentions both "data" and "subcommand", even though "subcommand" is <em>part</em> of "data".</p>
<pre class="lang-cs prettyprint-override"><code>int commId = 0x00000003;
int length... | Is there any solution for calculate checksum? | c#|hex|checksum | 0 | 71 | 1 | 72,286,936 | 72,286,936 | 1 | true | 2022-05-18T09:44:37.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any solution for calculate checksum?<p>I'm writing a SerialPort tool, And I got a problem that I don't know how to calculate the checksum...</p>
<p>... |
72,290,805 | Get item as soon as it inserted in dynamodb in python<p>Looking for example
We insert single record in dynamodb
We need to retrieve that item as soon as it inserted in dynamodb database using python</p>
<p>Just like get record seeking continuously for latest item in db once it inserted it will retrieved from db</p> | <p>You typically want an event-based solution without having to poll the database which means using <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html" rel="nofollow noreferrer">DynamoDB Streams</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams... | Get item as soon as it inserted in dynamodb in python | python|amazon-web-services|amazon-dynamodb|boto3 | -1 | 71 | 1 | 72,292,150 | 72,292,150 | 1 | true | 2022-05-18T14:13:04.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get item as soon as it inserted in dynamodb in python<p>Looking for example
We insert single record in dynamodb
We need to retrieve that item as soon as it i... |
72,286,700 | SPARQL how to make DAY/MONTH always return 2 digits<p>I have a datetime in my SPARQL-query that I want to transform to a date.
Therefore I do:</p>
<pre><code> BIND(CONCAT(YEAR(?dateTime), "-",MONTH(?dateTime), "-", DAY(?dateTime)) as ?date)
</code></pre>
<p>This part of code works but returns for ... | <p>You can take the integers you get back from the <code>YEAR</code>, <code>MONTH</code>, and <code>DAY</code> functions and pad them with the appropriate number of zeros (after turning them into strings):</p>
<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT * WHERE {
BIND(2022 AS ?yearInt) #... | SPARQL how to make DAY/MONTH always return 2 digits | date|datetime|sparql|rdf | 0 | 71 | 2 | 72,295,398 | 72,295,398 | 1 | true | 2022-05-18T09:38:59.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SPARQL how to make DAY/MONTH always return 2 digits<p>I have a datetime in my SPARQL-query that I want to transform to a date.
Therefore I do:</p>
<pre><code... |
72,298,834 | List comprehension with Set comprehension in Python<p>I have a list of list which contains set in them, what I want is list of list with a single set item.</p>
<p>i.e. <code>["item1", "item2", {1,2,3,4}, "item4"]</code> --> <code>[["item1", "item2", 1, "item4&qu... | <p>Assuming you only have a single set you need to expand in this way and it always sits at index 2 in the original list:</p>
<pre><code>data = ["item1", "item2", {1, 2, 3, 4}, "item4"]
result = [data[:2] + [x] + data[3:] for x in data[2]]
print(result)
</code></pre>
<p>Output:</p>
<pre><... | List comprehension with Set comprehension in Python | python|python-3.x|python-2.7 | -1 | 71 | 3 | 72,298,861 | 72,298,861 | 1 | true | 2022-05-19T04:58:48.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
List comprehension with Set comprehension in Python<p>I have a list of list which contains set in them, what I want is list of list with a single set item.</... |
72,269,133 | How can I draw Highcharts horizontal stacked bar with date-time duration<p>Working with Angular8 and Highcharts</p>
<p><strong>Actual input data</strong></p>
<pre><code>[
{
name: 'Bar 1',
open: [{from: 1649307600000, to: 1649307600000}],
inprogress: [],
done: [{fr... | <p>I would suggest to instead of a stacked bar series, use xrange (<a href="https://www.highcharts.com/demo/x-range" rel="nofollow noreferrer">https://www.highcharts.com/demo/x-range</a>) series type.</p>
<p>As you can see in this example: <a href="http://jsfiddle.net/BlackLabel/x67rbnoh" rel="nofollow noreferrer">http... | How can I draw Highcharts horizontal stacked bar with date-time duration | angular|highcharts|angular2-highcharts|angular-highcharts | 0 | 71 | 1 | 72,301,226 | 72,301,226 | 1 | true | 2022-05-17T06:31:24.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I draw Highcharts horizontal stacked bar with date-time duration<p>Working with Angular8 and Highcharts</p>
<p><strong>Actual input data</strong></p>... |
72,308,098 | Change Object Value using forEach<p>I am trying to change the value of object from the array but, it's not work as expected. I tried following.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-... | <p>Using <code>map</code> and assigning the result is probably a better way of doing this, but if you want to use <code>forEach</code>, you need to assign to the original array inside the loop:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code"... | Change Object Value using forEach | javascript|foreach | -1 | 71 | 2 | 72,312,219 | 72,312,219 | 1 | true | 2022-05-19T16:31:27.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change Object Value using forEach<p>I am trying to change the value of object from the array but, it's not work as expected. I tried following.</p>
<p><div c... |
72,319,482 | How os.File Read method modifies the bytes of slice in golang?<p>For example in below, <code>Data</code> is not going to change in <code>main</code> block -</p>
<pre><code>import "fmt"
func main(){
Data := make([]byte,3)
Modify(Data)
fmt.Println(Data) //output is [0,0,0]
}
func Modify(data []byt... | <p><code>Read</code> can modify <code>b</code> because you pass a slice with nonzero length. <code>Read</code> sets the bytes into <code>b</code> up to length... <strong>it does not set <code>b</code> slice</strong>. Your own function <code>Modify</code> sets the slice that is a local copy. If you assign by index up to... | How os.File Read method modifies the bytes of slice in golang? | go | 0 | 71 | 1 | 72,319,618 | 72,319,618 | 1 | true | 2022-05-20T13:10:01.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How os.File Read method modifies the bytes of slice in golang?<p>For example in below, <code>Data</code> is not going to change in <code>main</code> block -<... |
72,321,230 | Overwriting an existing txt file with new data using Python OS module<p>I am following the code mentioned by SO User "qmorgan" <a href="https://stackoverflow.com/questions/20432912/writing-to-a-new-file-if-it-doesnt-exist-and-appending-to-a-file-if-it-does">here</a>, basically I am trying to create new text f... | <p>Just open the file once at the beginning, not separately for each query. Then you can simply use <code>w</code> mode to overwrite it.</p>
<p>There's also no need for the <code>for row in result:</code> loop, since you never use <code>row</code> anywhere. <code>result</code> is a tuple with just a single element, the... | Overwriting an existing txt file with new data using Python OS module | python|python-3.x|operating-system|txt | 0 | 71 | 1 | 72,321,559 | 72,321,559 | 1 | true | 2022-05-20T15:12:43.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overwriting an existing txt file with new data using Python OS module<p>I am following the code mentioned by SO User "qmorgan" <a href="https://sta... |
72,321,479 | Nothing showing when plotting vector tile layer from Arcgis server on MapBox GL JS map<p>I'm trying to plot a supplied vector tile layer onto a map using MapBox GL JS. I've followed the <a href="https://developers.arcgis.com/mapbox-gl-js/layers/add-a-vector-tile-layer/#add-a-fill-layer" rel="nofollow noreferrer">docume... | <p>It looks like the value for <code>source-layer</code> is not correct - it should be <code>NCN_2020</code>. Here's a demo showing it working: <a href="https://jsbin.com/xunuhibuki/1/edit?html,output" rel="nofollow noreferrer">https://jsbin.com/xunuhibuki/1/edit?html,output</a></p>
<p>How do you get that value? I'm no... | Nothing showing when plotting vector tile layer from Arcgis server on MapBox GL JS map | mapbox|arcgis|mapbox-gl-js | 1 | 71 | 1 | 72,334,335 | 72,334,335 | 1 | true | 2022-05-20T15:35:19.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nothing showing when plotting vector tile layer from Arcgis server on MapBox GL JS map<p>I'm trying to plot a supplied vector tile layer onto a map using Map... |
72,346,238 | How to hide Shell Item on Flyout<p>I have a Xamarin Forms project in which I have a ShellItem <code>login</code> and then it shows me a FlyoutItem <code>main</code> with different tabs.</p>
<p>Here is the code on my <code>AppShell</code></p>
<pre><code><ShellItem Route="login" x:Name="loginItem"&... | <p>You can try this.</p>
<pre><code><ShellItem Route="login" x:Name="loginItem" FlyoutItemIsVisible="False" >
<ShellContent ContentTemplate="{DataTemplate local:LoginPage}"/>
</ShellItem>
</code></pre>
<p>Docs :</p>
<p><a href="https://docs.microsoft.com/nl-... | How to hide Shell Item on Flyout | c#|android|asp.net-core|xamarin|xamarin.forms | 0 | 71 | 1 | 72,346,990 | 72,346,990 | 1 | true | 2022-05-23T09:30:36.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide Shell Item on Flyout<p>I have a Xamarin Forms project in which I have a ShellItem <code>login</code> and then it shows me a FlyoutItem <code>main... |
72,339,677 | aiohttp check request headers after receiving response<p>here's the problem:
I have a list of authorization headers to check.
For that, I use aiohhtp</p>
<pre><code>def make_tasks(session, proxies, unchecked_headers):
tasks = list()
for unchecked_header in unchecked_headers:
current_proxy = proxies.pop(... | <p>You can use <code>asyncio.as_completed</code> + wrapper around <code>session.get</code> to return response and any additional data you want. For example:</p>
<pre class="lang-py prettyprint-override"><code>import aiohttp
import asyncio
url = "https://httpbin.org/get"
unchecked_headers = [
"A&qu... | aiohttp check request headers after receiving response | python|python-requests|header|aiohttp | 1 | 71 | 1 | 72,356,461 | 72,356,461 | 1 | true | 2022-05-22T17:06:29.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
aiohttp check request headers after receiving response<p>here's the problem:
I have a list of authorization headers to check.
For that, I use aiohhtp</p>
<pr... |
72,348,897 | Chai expect() fails in forEach() on 2nd object<p>I am implementing a testcase in cypress where I want to match a list of dateTime values with a RegEx pattern.
All of this gets done in a forEach loop. It works for the first Item and fails on the 2nd item, even though they are the same.
<a href="https://i.stack.imgur.com... | <p>You can make the example simpler to help eliminate factors,</p>
<pre class="lang-js prettyprint-override"><code>it('tests with regex', function() {
expect("2022-05-23 14:39:43.145").to.match(dateTime) // passes
expect("2022-05-23 14:39:43.120").to.match(dateTime) // fails
})
</code></pre>
<... | Chai expect() fails in forEach() on 2nd object | regex|typescript|cypress|chai|assertion | 1 | 71 | 1 | 72,356,674 | 72,356,674 | 1 | true | 2022-05-23T12:56:56.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Chai expect() fails in forEach() on 2nd object<p>I am implementing a testcase in cypress where I want to match a list of dateTime values with a RegEx pattern... |
72,357,220 | Why is this query not able to execute?<p>The query goes on without executing, any ideas on how I can help it resolve?</p>
<p>Using the <code>Economy Data Atlas</code> dataset from <code>Knoema</code> within Snowflake.</p>
<pre class="lang-sql prettyprint-override"><code>with payment as (
select *
from DATA_WAREHOUS... | <p>This might be a case where temporary tables will help your what I assume is a massive table be pruned (aka one of the reasons to avoid complex CTE's)</p>
<p>I would re-write your SQL like:</p>
<pre><code>with payment as (
select *
,date(payment.processed_at) as _payment_date
from DATA_WAREHOUSE.ANALY... | Why is this query not able to execute? | sql|snowflake-cloud-data-platform|dbt | 0 | 71 | 1 | 72,357,310 | 72,357,310 | 1 | true | 2022-05-24T04:28:48.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is this query not able to execute?<p>The query goes on without executing, any ideas on how I can help it resolve?</p>
<p>Using the <code>Economy Data Atl... |
72,367,010 | How to select rows with max values in categories?<p>I would like to use the aggregation for each ID key to select rows with max(day).</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ID</th>
<th>col1</th>
<th>col2</th>
<th>month</th>
<th>Day</th>
</tr>
</thead>
<tbody>
<tr>
<td>AI1</td>
<td>... | <p>The only solution that comes to my mind is to :</p>
<ul>
<li>Get the highest day for each ID (using <em>groupBy</em>)</li>
<li>Append the value of the highest day to each line (with matching ID) using <em>join</em></li>
<li>Then a simple <em>filter</em> where the value of the two lines match</li>
</ul>
<pre class="l... | How to select rows with max values in categories? | dataframe|apache-spark|pyspark|apache-spark-sql|max | 0 | 71 | 3 | 72,367,193 | 72,367,193 | 1 | true | 2022-05-24T17:21:42.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select rows with max values in categories?<p>I would like to use the aggregation for each ID key to select rows with max(day).</p>
<div class="s-table... |
72,370,044 | how to remove a directory entry in LD_LIBRARY_PATH variable? (in bash, when the entry is in the middle)<p>Suppose my LD_LIBRARY_PATH is now <code>dir_a:dir_b:dir_c:prj/foo/build:dir_d</code> or <code>dir_a:dir_b:dir_c:prj/foo1/build:dir_d</code>. By using bash script, I want to examin this LD_LIBRARY_PATH and if there ... | <pre><code>LD_LIBRARY_PATH=$( tr : $'\n' <<<$LD_LIBRARY_PATH | grep -v YOURPATTERN | paste -s -d : )
</code></pre>
<p>where YOURPATTERN would be a simple regex describing the component you want to be remove. Depending on its complexity, you may consider the options <code>-E</code>, <code>-F</code> or <code>-P<... | how to remove a directory entry in LD_LIBRARY_PATH variable? (in bash, when the entry is in the middle) | bash | 0 | 71 | 2 | 72,372,740 | 72,372,740 | 1 | true | 2022-05-24T22:19:05.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to remove a directory entry in LD_LIBRARY_PATH variable? (in bash, when the entry is in the middle)<p>Suppose my LD_LIBRARY_PATH is now <code>dir_a:dir_b... |
72,346,351 | Dynamically parse sub-templates based on those actually required by the main template<p>Suppose I have a large number of templates with sub-templates, then how do I parse <a href="https://stackoverflow.com/questions/11467731/is-it-possible-to-have-nested-templates-in-go-using-the-standard-library">sub-templates</a> bas... | <p>You can find all the keywords in the template in this way.</p>
<pre class="lang-golang prettyprint-override"><code>regexp.MustCompile(`{{-? ?(template|partial) \"([^() ]*)\" ?.* ?-?}}`)
</code></pre>
<p><a href="https://regex101.com/r/WHJORa/1" rel="nofollow noreferrer">regex101</a></p>
<p>where <code>part... | Dynamically parse sub-templates based on those actually required by the main template | go|go-templates | 1 | 71 | 1 | 72,375,448 | 72,375,448 | 1 | true | 2022-05-23T09:38:41.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically parse sub-templates based on those actually required by the main template<p>Suppose I have a large number of templates with sub-templates, then h... |
72,365,638 | regex convert to object<p>I'm trying to get the value as regex as follow:</p>
<pre><code>from textx import metamodel_from_str
def test_get_hosts2():
grammar = r"""
config: ( /(?!host)./ | hosts+=host | 'host' )* ;
host: 'host' host2name=/[0-9a-zA-Z.-]+/ '{'
(
'fixed-add... | <p>The easiest way is to use textX's <a href="http://textx.github.io/textX/latest/grammar/#repetition-modifiers" rel="nofollow noreferrer">repetition modifiers</a> for matching a sequence of comma-separated values. Basically, whenever you match zero-or-more or one-or-more etc. you can add modifier in the square bracket... | regex convert to object | python|python-3.x|regex | 0 | 71 | 1 | 72,375,946 | 72,375,946 | 1 | true | 2022-05-24T15:32:40.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
regex convert to object<p>I'm trying to get the value as regex as follow:</p>
<pre><code>from textx import metamodel_from_str
def test_get_hosts2():
gr... |
72,367,571 | Seg fault while calling glfwSwapBuffers<p>It seems that I am having a seg fault while using GLFW and OpenGL on ArchLinux, DWM (fully updated and patched).</p>
<p>I retraced the code and it is having the segFault in the <code>glfwSwapBuffers(window)</code>.</p>
<p>Here is my code :</p>
<p>main.cpp</p>
<pre class="lang-c... | <p>Your problem occurs in Window.cpp, at this line:</p>
<pre><code>//...
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
GLFWwindow* window = glfwCreateWindow(width, height, title.c_str(), nullptr, nullptr); //<---
if (!window)
{
//...
</code></pre>
<p>You've redeclared <code>window</code> as a local variabl... | Seg fault while calling glfwSwapBuffers | c++|opengl|segmentation-fault|glfw | 0 | 71 | 1 | 72,379,812 | 72,379,812 | 1 | true | 2022-05-24T18:09:12.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Seg fault while calling glfwSwapBuffers<p>It seems that I am having a seg fault while using GLFW and OpenGL on ArchLinux, DWM (fully updated and patched).</p... |
72,378,483 | How to solve Error at lidR::delineate_crowns?<p>Processing a script I wrote a couple of month ago with an older version old lidR causes an error with current version.
name of functions changed from <code>lidR::tree_hulls</code> to <code>lidR::delineate_crowns</code></p>
<p>It worked with the old version but doesn't wit... | <p>I tested both with <code>delineate_crown()</code> (deprecated) and <code>crown_metrics()</code>. Both work. <code>delineate_crown()</code> produces warnings but they can be ignored.</p>
<pre class="lang-r prettyprint-override"><code>library(lidR)
so_sample_las <- readLAS("so_sample_las.laz")
tree.hulls.... | How to solve Error at lidR::delineate_crowns? | r|lidr | 0 | 71 | 1 | 72,380,005 | 72,380,005 | 1 | true | 2022-05-25T13:23:43.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to solve Error at lidR::delineate_crowns?<p>Processing a script I wrote a couple of month ago with an older version old lidR causes an error with current... |
72,380,259 | Reshape tensors in pytorch?<p>I'm struggling with the result of a matrix multiplication in pytorch and I don't know how to solve it, in particular:
I'm multiplying these two matrices</p>
<pre><code>tensor([[[[209.5000, 222.7500],
[276.5000, 289.7500]],
[[208.5000, 221.7500],
[275.5000, 288... | <p>This is a common but interesting problem because it involves a combination of <a href="https://pytorch.org/docs/stable/generated/torch.reshape.html" rel="nofollow noreferrer"><code>torch.reshape</code></a>s and <a href="https://pytorch.org/docs/stable/generated/torch.transpose.html" rel="nofollow noreferrer"><code>t... | Reshape tensors in pytorch? | python|pytorch|tensor | 1 | 71 | 1 | 72,380,655 | 72,380,655 | 1 | true | 2022-05-25T15:16:25.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reshape tensors in pytorch?<p>I'm struggling with the result of a matrix multiplication in pytorch and I don't know how to solve it, in particular:
I'm multi... |
72,381,723 | Python pivot-table with array value<p>For a project with table features, I try to create a new table with pivot_table.
Small problem however, one of my columns contains an array. Here an ex</p>
<pre><code>| House | Job |
| ----- | --- |
| Gryffindor | ["Head of Auror Office", " Minister for Magic"... | <p>suppose your table is <code>df</code> with two columns:</p>
<pre><code>(df.explode('Job')
.groupby(['House', 'Job']).size().reset_index()
.pivot(index = 'House', columns = 'Job').fillna(0))
</code></pre>
<p>the code first expand the list into rows, then do the count, and finally do the pivot table</p> | Python pivot-table with array value | python|arrays|pivot-table | 0 | 71 | 1 | 72,382,279 | 72,382,279 | 1 | true | 2022-05-25T17:06:46.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python pivot-table with array value<p>For a project with table features, I try to create a new table with pivot_table.
Small problem however, one of my colum... |
72,382,929 | Typescript: Form an Object from String Array<p>i want to ask is there any way to form a function in typescript that can enable autocomplete when using array.reduce?</p>
<p>ex:</p>
<pre><code>function formObject<T>(arr: T[]): ?? {
return arr.reduce((memo, val) => {
memo[val] = 'test'
return memo
}, ... | <p>This is certainly possible. The question is if you really need this...</p>
<p>We can create a generic type <code>StringArrToObject</code> which takes a tuple <code>T</code> and creates an object with every element of <code>T</code> as a key.</p>
<pre><code>type Expand<T> = T extends infer O ? { [K in keyof O]:... | Typescript: Form an Object from String Array | typescript | 1 | 71 | 1 | 72,384,241 | 72,384,241 | 1 | true | 2022-05-25T19:01:59.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript: Form an Object from String Array<p>i want to ask is there any way to form a function in typescript that can enable autocomplete when using array.... |
72,355,656 | React test - error when component accesses window object<p>For a specific reason I use a script in the <code>index.html</code> file in the <code>public</code> folder, this script creates a property on the <code>window</code> object. The property is an asynchronous function. here is the script i created in public/index.... | <p>You can mock the <code>window.waitText()</code> method and its resolve/rejected value before rendering the component in the test case.</p>
<p>E.g.</p>
<p><code>App.jsx</code>:</p>
<pre><code>import { useEffect, useState } from 'react';
import React from 'react';
function App() {
const [txt, setTxt] = useState('Lo... | React test - error when component accesses window object | javascript|reactjs|react-hooks|jestjs|react-testing-library | 0 | 71 | 1 | 72,386,634 | 72,386,634 | 1 | true | 2022-05-23T23:12:27.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React test - error when component accesses window object<p>For a specific reason I use a script in the <code>index.html</code> file in the <code>public</code... |
72,308,569 | Format logs for PyFlink application with different pattern for the Python part<p>I have a Python application running in PyFlink.</p>
<p>Is there a way of saying <em>"Apply this pattern to the logs produced by the python code, and this other pattern to every other log?"</em></p>
<p>I'd like to format the log m... | <p>You could try to set the root logger's pattern as <code>%m%n</code> and Java logger's pattern as <code>%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n</code>, e.g.</p>
<pre><code>appenders=borrajax_console,console
# This affects logging for both user code and Flink
rootLogger.level = INFO
rootLogger.appenderRef.co... | Format logs for PyFlink application with different pattern for the Python part | logging|log4j|apache-flink|pyflink|pattern-layout | 0 | 71 | 1 | 72,387,082 | 72,387,082 | 1 | true | 2022-05-19T17:10:42.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Format logs for PyFlink application with different pattern for the Python part<p>I have a Python application running in PyFlink.</p>
<p>Is there a way of say... |
72,388,427 | nginx image behaves differently in kubectl deployment and pods<p>I am using nginx image to create pods as follows -</p>
<pre><code>$ kubectl run nginx --image=nginx --port=80 -- /bin/sh -c 'sleep 20000'
$ kubectl create deployment nginx-deploy --image=nginx --port=80 --replicas=1
</code></pre>
<p>These results two pod... | <pre><code># Here command = /bin/sh -c 'sleep 20000'
kubectl run nginx --image=nginx --port=80 -- command
</code></pre>
<p>When you create a pod using the command, it will overwrite command in Dockerfile. So that nginx server will not be started in the pod. Please refer to the Dockerfile of nginx.</p>
<blockquote>
<ol>... | nginx image behaves differently in kubectl deployment and pods | nginx|kubernetes | -1 | 71 | 2 | 72,389,509 | 72,389,509 | 1 | true | 2022-05-26T07:44:33.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
nginx image behaves differently in kubectl deployment and pods<p>I am using nginx image to create pods as follows -</p>
<pre><code>$ kubectl run nginx --imag... |
72,392,772 | pd.read_csv() keep number of decimals<p>I want to read a csv but it culls the number of decimals:</p>
<pre class="lang-py prettyprint-override"><code>fname = './sol/Pret-SB_A00DLR0_202205240635.pos'
skiprow = 0
with open(fname) as search:
for i, line in enumerate(search):
if "% GPST" in line:
... | <blockquote>
<p>How do I read a csv and retain the precision of the original data?</p>
</blockquote>
<p>You do have it, <code>pandas</code> simply limit number of digits for presentation purposes, consider following example</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'x':[28.282633712]})
print(df)
print(df.x[... | pd.read_csv() keep number of decimals | python|pandas|csv|decimal|precision | 0 | 71 | 3 | 72,393,063 | 72,393,063 | 1 | true | 2022-05-26T13:38:59.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pd.read_csv() keep number of decimals<p>I want to read a csv but it culls the number of decimals:</p>
<pre class="lang-py prettyprint-override"><code>fname =... |
72,797,782 | How to make an SQL injection<p>I am trying to do a sql injection on a site set up by me on php to go to demonstrate the vulnerabilities of the site. The goal is to pass the form without entering the password, it would be even better to pass the form without even having to enter the username. this is the code that manag... | <p>If the goal is to reach the <code>h1</code> line in your code you need to post the following username:</p>
<pre><code>' union all select username, '' from utenti where '' = '
</code></pre>
<p>This will produce the following sql (after formatting):</p>
<pre><code>select username, password from utenti where username =... | How to make an SQL injection | php|sql|sql-injection|code-injection | -5 | 71 | 1 | 72,800,035 | 72,800,035 | 1 | true | 2022-06-29T07:59:50.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make an SQL injection<p>I am trying to do a sql injection on a site set up by me on php to go to demonstrate the vulnerabilities of the site. The goal... |
72,806,366 | Exposed port of kubernetes service not working<p>Following is my application deployment yaml file</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: sharemarket-crud-deployment
spec:
selector:
matchLabels:
app: sharemarket-k8s-sb-service
replicas: 2
template:
metadata:
label... | <p>You need to expose the NodePort PORT as well, so you can reach this service from outside the cluster. Your GET request tries to reach port 30119, but you only exposed 8080, make sure to expose 30119</p>
<pre><code>type: NodePort
ports:
port: 8080
TargetPort: 8080
nodePort: 30119
</code></pre>
<p>Another way for y... | Exposed port of kubernetes service not working | kubernetes|kubectl|minikube | 0 | 71 | 1 | 72,806,447 | 72,806,447 | 1 | true | 2022-06-29T18:44:45.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exposed port of kubernetes service not working<p>Following is my application deployment yaml file</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadat... |
72,804,792 | Import entities with country as string in Shopware 6<p>I would like to import a customer list with countries as string.</p>
<p>I have imported entities with the countries ISO code before, but I am struggling with just the translated names as the identifier for the country.</p>
<p>The field which I use in my import prof... | <p>This is not possible. When you pass in an association just some fields, it will create that entity and assign it. You need to resolve the ID beforehand and reference only the ID.</p>
<p>There is an issue open to allow referencing using unique fields, to solve issues like this. But I guess this will be not solved in ... | Import entities with country as string in Shopware 6 | shopware|shopware6 | 1 | 71 | 2 | 72,811,641 | 72,811,641 | 1 | true | 2022-06-29T16:22:39.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Import entities with country as string in Shopware 6<p>I would like to import a customer list with countries as string.</p>
<p>I have imported entities with ... |
72,829,101 | Constant "division by zero" error in pine script<p>I have a code that is returning me a "division by zero" error and I can't understand why.
I've looked online but there are little information about it for pine script.</p>
<p>This was the original code</p>
<pre><code>z = (x / x + y) * 100
</code></pre>
<p>tha... | <p>You have hardcoded value of x as 0 and are not modifying it using x as divisor
So pinescript is assuming that x will be 0 if division happens anytime the condition is true</p>
<p>So just add a dummy x:=x after declaring it and issue will go away</p>
<pre><code>float x = 0.0
float y = 0.0
x:=x
float z = if x > 0 a... | Constant "division by zero" error in pine script | pine-script | 0 | 71 | 2 | 72,830,060 | 72,830,060 | 1 | true | 2022-07-01T12:14:10.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Constant "division by zero" error in pine script<p>I have a code that is returning me a "division by zero" error and I can't understand why.
I've l... |
72,835,563 | How do I check if a string starts with two numbers in Python?<p>I want to take in a str via usr_input = input("Input here: ") and then check if that string starts with two digits.</p>
<p>Thanks in advance for any help.</p> | <p>try this:</p>
<pre><code>usr_input = input("Input here: ")
if(len(usr_input) >= 2 and usr_input[:2].isdigit()):
print('yes') # write your code here
</code></pre> | How do I check if a string starts with two numbers in Python? | python|python-3.x | -3 | 71 | 3 | 72,835,619 | 72,835,619 | 1 | true | 2022-07-02T00:01:31.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I check if a string starts with two numbers in Python?<p>I want to take in a str via usr_input = input("Input here: ") and then check if tha... |
72,836,348 | Retrieve Postgres TSTZRANGE to PgRange<Datetime<Utc>> with Rust sqlx<p>I have the following SQL table scheme</p>
<pre class="lang-sql prettyprint-override"><code>CREATE TABLE reservation (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
timespan TSTZRANGE
);
INSERT INTO reservation(timespan) VALUES
... | <p>Newbie mistake! I just had to add chrono flag for sqlx in Cargo.toml</p>
<pre class="lang-ini prettyprint-override"><code>sqlx = { version = "0.5", features = [ "runtime-tokio-native-tls" , "postgres" , "chrono" ] }
</code></pre> | Retrieve Postgres TSTZRANGE to PgRange<Datetime<Utc>> with Rust sqlx | postgresql|rust|rust-sqlx | 1 | 71 | 1 | 72,836,372 | 72,836,372 | 1 | true | 2022-07-02T04:01:05.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieve Postgres TSTZRANGE to PgRange<Datetime<Utc>> with Rust sqlx<p>I have the following SQL table scheme</p>
<pre class="lang-sql prettyprint-override"><... |
72,818,378 | Pod getting restarted many times when using sidecar container<p>I'm deploying a sidecar container in a kubernetes deployment.</p>
<p>The issue is that the pod sometimes is getting restarted many times because the main container (container1) is not ready at all.</p>
<p>The deployment is similar to this one but the sidec... | <p>In my case, to resolve it faster I have just included a sleep before executing the code so I can give enought time to the main container to be ready.</p>
<pre><code>time.Sleep(8 * time.Second)
</code></pre>
<p>That's not the best solution but resolves the issue.</p> | Pod getting restarted many times when using sidecar container | kubernetes|containers|kubernetes-helm | 0 | 71 | 1 | 72,837,762 | 72,837,762 | 1 | true | 2022-06-30T15:26:54.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pod getting restarted many times when using sidecar container<p>I'm deploying a sidecar container in a kubernetes deployment.</p>
<p>The issue is that the po... |
72,868,151 | only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices, when trying to drop columns<p>I am trying to drop some columns but I wanted to set a variable which numbers the columns I would like to drop instead of hard-coding it.</p>
<p>My Code is:</p>
<pre><code... | <p>try this instead</p>
<pre><code>df.drop(df.columns[[57, 125]], axis=1)
</code></pre>
<p>or this if you want it to look more like what you already have</p>
<pre><code>ColumnsToDrop = df.iloc[:, [57, 125]].columns
df2 = df.drop(ColumnsToDrop, axis=1)
</code></pre> | only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices, when trying to drop columns | python|pandas | 0 | 71 | 1 | 72,869,024 | 72,869,024 | 1 | true | 2022-07-05T10:49:02.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices, when trying to drop columns<p>I am try... |
72,873,454 | React button disabled property not updating<p>I have trouble using the disabled property on a button with react. The property works if I hard code a value in the input but the button is not re-rendered automatically when the state is updated through an input change.</p>
<pre><code>export default function App() {
cons... | <p>Just use:</p>
<pre><code>(e) => setUser((previous) => ({...previous, email: e.target.value}))
</code></pre>
<p>You trying to mutate the previous state manually is what prevents React from detecting a change (because the reference stays the same)</p>
<p>Also, to use control forms properly, you need to add this ... | React button disabled property not updating | reactjs|react-hooks | -1 | 71 | 2 | 72,873,571 | 72,873,571 | 1 | true | 2022-07-05T17:33:12.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React button disabled property not updating<p>I have trouble using the disabled property on a button with react. The property works if I hard code a value in... |
72,781,654 | How access info from Azure AD after user is authenticated prior to any action in ASP.Net MVC when using MS Identity platform (Azure AD Authentication)<p>I have created an app which is using Azure AD authentication. After user is authenticated, I want to get the user's unique Id and get the group information which I wan... | <p>Please Include below in application manifest in azure portal
<code>"groupMembershipClaims": "All"</code>,</p>
<p>Change this to "SecurityGroup" to get security groups and Azure AD roles
Or change to "ApplicationGroup". This includes only groups that are assigned to the ap... | How access info from Azure AD after user is authenticated prior to any action in ASP.Net MVC when using MS Identity platform (Azure AD Authentication) | asp.net-mvc|msal|azure-identity | 0 | 71 | 1 | 72,878,969 | 72,878,969 | 1 | true | 2022-06-28T06:29:20.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How access info from Azure AD after user is authenticated prior to any action in ASP.Net MVC when using MS Identity platform (Azure AD Authentication)<p>I ha... |
72,905,132 | How to build a recursive function<p>Having a bit of an issue regarding recursive functions that I can not wrap my head around and was wondering if I can get some help.</p>
<p>I have a json object like so below</p>
<pre><code>const data = {
"navItems": [
{
"type": "direct... | <p>Seems when you are calling your recursive function you aren't calling it for each of the children. Changing it to this may help:</p>
<pre><code>const buildNavBlock = (navItem) => {
if (navItem.hasOwnProperty("children") && navItem.children.length > 0 && navItem.type == "d... | How to build a recursive function | javascript|reactjs|ecmascript-6 | 0 | 71 | 2 | 72,905,467 | 72,905,467 | 1 | true | 2022-07-07T23:14:26.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to build a recursive function<p>Having a bit of an issue regarding recursive functions that I can not wrap my head around and was wondering if I can get ... |
72,898,373 | proxies do not work with aiohttp requests?<p>So I've been experimenting with web scraping with aiohttp, and I ran into this issue where whenever I use a proxy, the code within the session.get doesn't run. I've looked all over the internet and couldn't find a solution.</p>
<pre><code>import asyncio
import time
import a... | <p>So after some more testing and researching I found the issue, I needed to add <code>ssl = False</code></p>
<p>So the correct way to make the request would be:</p>
<pre><code>async with session.get(url, proxy=proxy, ssl = False) as response:
</code></pre>
<p>That worked for me.</p> | proxies do not work with aiohttp requests? | python|python-asyncio|aiohttp | 1 | 71 | 1 | 72,908,440 | 72,908,440 | 1 | true | 2022-07-07T13:07:30.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
proxies do not work with aiohttp requests?<p>So I've been experimenting with web scraping with aiohttp, and I ran into this issue where whenever I use a prox... |
72,906,833 | C# Converting mixed data type in nested JSON into an object<p>I have a problem while developing a project, and I really need your helps !</p>
<p>I got a POST response using <code>var resp = webClient.UploadString(url, header)</code>. The result looks like</p>
<pre><code>
{ "dataList": [{ "status":1,... | <p>Based on the shape of your example JSON on the question this change in the serialization class will work:</p>
<pre><code>public class dataSourceOptions
{
private JToken propertyValue
{
get
{
return partitions.Value<JToken>();
}
}
private JArray proper... | C# Converting mixed data type in nested JSON into an object | c#|json|json.net|jsonconvert | -1 | 71 | 1 | 72,909,721 | 72,909,721 | 1 | true | 2022-07-08T05:00:13.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Converting mixed data type in nested JSON into an object<p>I have a problem while developing a project, and I really need your helps !</p>
<p>I got a POST... |
72,900,124 | What library does contain basic jenkins workflow groovy functions?<p>I am writing a junit test for my Jenkins groovy scripts. My Jenkins script that I am testing contains a method call like this:</p>
<pre><code>error "Foo"
</code></pre>
<p>When I try to run the test from my IDE (Intellij IDEA) I get an error ... | <p>The solution is to use <a href="https://github.com/jenkinsci/JenkinsPipelineUnit" rel="nofollow noreferrer">Jenkins Pipeline Unit</a> library that makes all those functions/methods like <code>echo</code> or <code>error</code> <a href="https://github.com/jenkinsci/JenkinsPipelineUnit/blob/master/src/main/groovy/com/l... | What library does contain basic jenkins workflow groovy functions? | java|maven|jenkins|intellij-idea|groovy | 2 | 71 | 2 | 72,911,167 | 72,911,167 | 1 | true | 2022-07-07T15:00:49.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What library does contain basic jenkins workflow groovy functions?<p>I am writing a junit test for my Jenkins groovy scripts. My Jenkins script that I am tes... |
72,887,862 | How to switch between three items in array?<p>I am making a language switcher in Next.js. Basically there are three languages and clicked language should setToActive should be placed to previous active language and previous language should be placed the place of new active. I am setting active language but moving previ... | <p>I'd suggest you track the current locale index in a state variable rather than tracking the actual locale itself. You can then create a helper function that always returns a value between <code>0</code> and <code>2</code> (see <code>getLangIndex</code>), and increase the index when selecting a new value.</p>
<pre cl... | How to switch between three items in array? | javascript|reactjs|next.js | 1 | 71 | 2 | 72,914,453 | 72,914,453 | 1 | true | 2022-07-06T17:45:00.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to switch between three items in array?<p>I am making a language switcher in Next.js. Basically there are three languages and clicked language should set... |
72,917,231 | ReferenceError: member is not defined in Discord bot<pre><code>const { MessageEmbed} = require('discord.js')
module.exports = {
name: 'guildMemberAdd',
execute(message, Discord, client, guild) {
const channelId = '918746332435468288' // welcome channel
const embed = new MessageEmbed()
... | <p>When creating an event listener for the <code>guildMemberAdd</code> event, you would get a parameter which is the member who joined the server by default. So if you had an event listener like this, you could just use the <code>member</code> without defining it anywhere:</p>
<pre class="lang-js prettyprint-override">... | ReferenceError: member is not defined in Discord bot | javascript|discord.js | -2 | 71 | 2 | 72,918,843 | 72,918,843 | 1 | true | 2022-07-08T21:36:08.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ReferenceError: member is not defined in Discord bot<pre><code>const { MessageEmbed} = require('discord.js')
module.exports = {
name: 'guildMemberA... |
72,927,678 | PriorityQueue containing array C#<p>I would like to create a PriorityQueue to store int[]. The first element in the array is gonna be the criteria for the comparisons.</p>
<p>I could do that easily in Java, though I could not convert it to C#. Could you please guide me?</p>
<p><a href="https://i.stack.imgur.com/EIol3.... | <p>Priority queues don't work the same way in both languages. What you're trying to do is the Java way of giving PQ a lambda (function) to compare any two elements. In C#, you give each element a priority when adding it to the queue, and then make a comparer to compare different priorities.</p>
<pre class="lang-cs pret... | PriorityQueue containing array C# | c#|priority-queue | -2 | 71 | 1 | 72,927,780 | 72,927,780 | 1 | true | 2022-07-10T10:06:20.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PriorityQueue containing array C#<p>I would like to create a PriorityQueue to store int[]. The first element in the array is gonna be the criteria for the c... |
72,926,916 | Generate class and get type<p>I want to create a new class at runtime, get the type, and create a List of that type.
For example:</p>
<pre><code> void CreateNewClass(string name)
{
File file = CreateFile(name);
Type type = GetTypeOfFile(file);
List<type> someList = new List<type... | <p>You can create type from string using:</p>
<pre><code>Type.GetType(string typeAssemblyQualifiedName);
</code></pre>
<p>But you need to use Type.assemblyQualifiedName for that so "Idle" may not work if you use namespaces or assemblies, other option would be to get all types in current domains</p>
<pre><code... | Generate class and get type | c#|unity3d|unity3d-editor|scriptable-object | 0 | 71 | 1 | 72,930,233 | 72,930,233 | 1 | true | 2022-07-10T07:46:00.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generate class and get type<p>I want to create a new class at runtime, get the type, and create a List of that type.
For example:</p>
<pre><code> void Cre... |
72,935,861 | Mismatching Tweets with User Information using Tweepy Paginator<p>I am trying to match Tweet data with User information using the Paginator, but am encountering problems with missing User information.</p>
<p>This is my code for matching the tweet strings with user metadata:</p>
<pre><code>client = tweepy.Client(bearer_... | <p>The advantage of the <code>includes</code> dictionnary is precisely to avoid redundancy: even if several tweets have the same author, the corresponding <code>User</code> object will be sent only once.</p>
<p>You can find the <code>User</code> object thanks to the <code>author_id</code> field in each tweet:</p>
<pre ... | Mismatching Tweets with User Information using Tweepy Paginator | python|twitter|tweepy | 1 | 71 | 1 | 72,939,183 | 72,939,183 | 1 | true | 2022-07-11T08:47:21.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mismatching Tweets with User Information using Tweepy Paginator<p>I am trying to match Tweet data with User information using the Paginator, but am encounter... |
72,944,846 | Widget appears wrong using Mac OS Safari and suddenly changes<p>A Flutter WebApp behaves using MacOS Chrome just fine. Using Safari on MacOS, the UI changes at certain points randomly. MacOS and Safari are the most recent releases with any applicable patch installed.</p>
<p>As far as I understand, MacOS Safari is a fir... | <p>Try rendering with canvas kit using this command</p>
<pre class="lang-dart prettyprint-override"><code>flutter build web --web-renderer canvaskit
</code></pre> | Widget appears wrong using Mac OS Safari and suddenly changes | flutter|dart|flutter-layout|flutter-web | 0 | 71 | 1 | 72,944,969 | 72,944,969 | 1 | true | 2022-07-11T21:27:26.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Widget appears wrong using Mac OS Safari and suddenly changes<p>A Flutter WebApp behaves using MacOS Chrome just fine. Using Safari on MacOS, the UI changes ... |
72,936,452 | Symfony Entites vs CollectionType<p>I have the following problem with Symfony. I made 3 entities: Customer, Cart, and CartItem. And what I want, is to display all the Products that are inside Cart (These are inside Cart Item), and to be able to change quantity on ever single one with some kind of form. The best way is ... | <p>From what I can see you have two errors in your code:</p>
<p>In CartType you have used cartitem instead of cartitems. Symfony tried to use getCartItem, which is no method at all.</p>
<p>The CartType should look like following:</p>
<pre><code>class CartType extends AbstractType
{
public function buildForm(FormBui... | Symfony Entites vs CollectionType | php|symfony | 0 | 71 | 2 | 72,945,227 | 72,945,227 | 1 | true | 2022-07-11T09:37:06.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symfony Entites vs CollectionType<p>I have the following problem with Symfony. I made 3 entities: Customer, Cart, and CartItem. And what I want, is to displa... |
72,950,590 | Why does my Swift get build error: No exact matches in call to instance method 'append'<p>Can't figure out what's wrong.</p>
<pre><code>struct Ring_Sensors_Input_struct
{
var ts: Double
var temp: UInt16
var hr: UInt8
var spO2: UInt8
var rr: UInt8
var steps: UI... | <p>Just replace your code by:</p>
<pre><code>func my_func() {
var ring_sensors_input: [Ring_Sensors_Input_struct] = []
ring_sensors_input.append(Ring_Sensors_Input_struct(ts:1657150485.0, temp: 235, hr: 95, spO2: 97, rr: 16, steps: 235))
ring_sensors_input.append(Ring_Sensors_Input_struct(ts: 1657150486.0, tem... | Why does my Swift get build error: No exact matches in call to instance method 'append' | swift|xcode | -2 | 71 | 1 | 72,950,867 | 72,950,867 | 1 | true | 2022-07-12T10:10:20.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my Swift get build error: No exact matches in call to instance method 'append'<p>Can't figure out what's wrong.</p>
<pre><code>struct Ring_Sensors_I... |
72,887,553 | Algorithm converting lotto ticket number to integer value and back again<p>I'm looking for the algorithm to convert a lotto ticket number to an integer value an back again.</p>
<p>Let's say the lotto number can be between 1 and 45 and a tickets contains 6 unique numbers. This means there are a maximum of 8145060 unique... | <p>For enumerating integer combinations, you need to use the <a href="https://en.wikipedia.org/wiki/Combinatorial_number_system" rel="nofollow noreferrer">combinatorial number system</a>. Here's a basic implementation in C#:</p>
<pre><code>using System;
using System.Numerics;
using System.Collections.Generic;
public c... | Algorithm converting lotto ticket number to integer value and back again | c#|algorithm|math | 0 | 71 | 2 | 72,965,467 | 72,965,467 | 1 | true | 2022-07-06T17:15:32.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Algorithm converting lotto ticket number to integer value and back again<p>I'm looking for the algorithm to convert a lotto ticket number to an integer value... |
72,968,064 | Use dplyr mutate when the values of a column are the names of a vector<p>I have a dataframe with two columns, which are the initials of a name (col1) and an assigned value to it (col2)</p>
<pre><code>dat <- data.frame(col1 = c("A","B","C"), col2 = c(4,5,6)) %>% as_tibble()
</code></... | <p>You can use the following code:</p>
<pre class="lang-r prettyprint-override"><code>library(tibble)
dat <- data.frame(col1 = c("A","B","C"), col2 = c(4,5,6)) %>% as_tibble()
nam <- c("A" = "Andrew", "B" = "Bob", "C" = "Char... | Use dplyr mutate when the values of a column are the names of a vector | r|dplyr | 2 | 71 | 3 | 72,968,232 | 72,968,232 | 1 | true | 2022-07-13T14:33:19.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use dplyr mutate when the values of a column are the names of a vector<p>I have a dataframe with two columns, which are the initials of a name (col1) and an ... |
72,968,190 | Could not build url for endpoint 'user_page'. Did you forget to specify values ['name']?<p>I have small code written in Flask and When I try to run my server and enter login and password, it gives me error named: <em>werkzeug.routing.BuildError: Could not build url for endpoint 'user_page'. Did you forget to specify va... | <p>The problem is not the redirect or url_for function, the problem is the value you pass into the argument 'name'. If you print the username right before trying to use the url_for function, you will see that the value for username is 'None'.</p>
<p>So to solve your problem, make sure that the value for 'username' is n... | Could not build url for endpoint 'user_page'. Did you forget to specify values ['name']? | python|flask | 0 | 71 | 1 | 72,968,986 | 72,968,986 | 1 | true | 2022-07-13T14:42:43.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Could not build url for endpoint 'user_page'. Did you forget to specify values ['name']?<p>I have small code written in Flask and When I try to run my server... |
72,967,540 | Pyomo glpk solver doesn't give me the optimum<p>I hope someone can help me. I am practicing with optimization modelling and I am solving the following LP problem using pyomo glpk:</p>
<p>max z = 4x1 + 3x2</p>
<p>Subject to:</p>
<ul>
<li>x1 + x2 <= 40</li>
<li>2x1 + x2 <= 60</li>
<li>x1, x2 >= 0</li>
</ul>
<p>T... | <p>Welcome to the site.</p>
<p>You are on the right track. You have an unfortunate typo that is biting you. You declared the domain of <code>x2</code> to be non-<em>positive</em> where you clearly intended <code>pyo.NonNegativeReals</code></p>
<p>If you are having odd behavior, always <code>pprint</code> and/or <code... | Pyomo glpk solver doesn't give me the optimum | python|global|local|pyomo|glpk | 0 | 71 | 1 | 72,970,630 | 72,970,630 | 1 | true | 2022-07-13T13:55:40.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pyomo glpk solver doesn't give me the optimum<p>I hope someone can help me. I am practicing with optimization modelling and I am solving the following LP pro... |
72,970,730 | Why is the signature verification not working when the signature is constructed by node-forge?<p>I have a Nuxt application that needs to retrieve some information from a Spring Boot-based auth service.</p>
<p>Right now I sign a text message on the Nuxt app (the auth server is aware of that text message), using <strong>... | <p>There are several issues:</p>
<ul>
<li><p>First, the bug that was already mentioned in the comment: While the NodeJS code does not hash implicitly, the Java side does. Therefore, hashing must not be done explicitly on the Java side:</p>
<pre class="lang-java prettyprint-override"><code>byte[] messageBytes = "12... | Why is the signature verification not working when the signature is constructed by node-forge? | spring-boot|rsa|signature|sha256|node-forge | 1 | 71 | 1 | 72,977,766 | 72,977,766 | 1 | true | 2022-07-13T18:02:37.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the signature verification not working when the signature is constructed by node-forge?<p>I have a Nuxt application that needs to retrieve some inform... |
72,978,264 | MySQL issue on INSERT ... SELECT ON DUPLICATE KEY UPDATE and LAST_INSERT_ID()<p>In MySQL, I have <code>INSERT ... SELECT ON DUPLICATE KEY UPDATE</code> query as below:</p>
<pre><code>$sql = "INSERT INTO user ( name
, mobile
, email
, sex
... | <p>DEMO:</p>
<blockquote>
<pre><code>CREATE TABLE test (id INT AUTO_INCREMENT PRIMARY KEY,
category INT,
value INT,
UNIQUE (category, value) );
</code></pre>
</blockquote>
<blockquote>
<pre><code>CREATE TRIGGER tr_ai
AFTER INSERT ON test
FOR EACH ROW
SET @id... | MySQL issue on INSERT ... SELECT ON DUPLICATE KEY UPDATE and LAST_INSERT_ID() | php|mysql|sql|pdo|last-insert-id | 0 | 71 | 1 | 72,979,382 | 72,979,382 | 1 | true | 2022-07-14T09:28:55.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL issue on INSERT ... SELECT ON DUPLICATE KEY UPDATE and LAST_INSERT_ID()<p>In MySQL, I have <code>INSERT ... SELECT ON DUPLICATE KEY UPDATE</code> query... |
72,986,499 | Unable to recursively multiply BigInt beyond a certain number of iterations at compile-time in D<p>I need to get the product of an arbitrary number of variables. The actual number of variables and their values will be known at compile-time, however I cannot hardcode these because they come from reflection done on types... | <p>The error happens on the last line of this function:</p>
<p><a href="https://github.com/dlang/phobos/blob/e0af01c8adf75b164b43832dd7544e297347cf6f/std/internal/math/biguintcore.d#L1824-L1844" rel="nofollow noreferrer">https://github.com/dlang/phobos/blob/e0af01c8adf75b164b43832dd7544e297347cf6f/std/internal/math/big... | Unable to recursively multiply BigInt beyond a certain number of iterations at compile-time in D | d|compile-time|bigint|phobos|recursive-templates | 3 | 71 | 1 | 72,987,024 | 72,987,024 | 1 | true | 2022-07-14T20:48:13.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to recursively multiply BigInt beyond a certain number of iterations at compile-time in D<p>I need to get the product of an arbitrary number of variab... |
72,990,357 | Why getSymbols from quantmod keeps fail to connect in R?<p>I am using getSymbols from quantmod package in R quite a long now but the last several days when i try to download some data i get the same error:</p>
<pre><code> library(quantmod)
> getSymbols("TSLA", from = "2011-01-01", to = "2022... | <p>If you are not able to fix <code>quantmod</code>, theres also <code>tidyquant</code></p>
<pre><code>library(tidyquant)
tq_get("TSLA",
from = "2011-01-01",
to = "2022-01-31")
# A tibble: 2,788 x 8
symbol date open high low close volume
<chr> <... | Why getSymbols from quantmod keeps fail to connect in R? | r|yahoo-finance|quantmod | 0 | 71 | 1 | 72,990,682 | 72,990,682 | 1 | true | 2022-07-15T07:19:58.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why getSymbols from quantmod keeps fail to connect in R?<p>I am using getSymbols from quantmod package in R quite a long now but the last several days when i... |
72,993,450 | Rust - downloading files via handmade tcp/http server<p>I'm trying to implement simple tcp/http server on Rust. Main feature is possibility to download files from server via url. As exapmple: localhost:port/root_storage/someFile.fileExt</p>
<p>Main function:</p>
<pre><code>fn main() {
let tcp_listener = TcpListener... | <p>I think there is a problem with the multiline text literal.</p>
<p>Every line contains an implicit <code>\n</code> after your explicit <code>\r\n</code> and the next line starts with many spaces before the option name.</p>
<p>When the browser receives this reply header, it does not understand it and probably tries t... | Rust - downloading files via handmade tcp/http server | file|http|rust|tcp|download | 0 | 71 | 1 | 72,994,185 | 72,994,185 | 1 | true | 2022-07-15T11:42:54.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rust - downloading files via handmade tcp/http server<p>I'm trying to implement simple tcp/http server on Rust. Main feature is possibility to download files... |
72,998,117 | Aws batch jobs scheduled in a sequence . If any job is failed, invoke the job and sequence from failed job<p>I have a lambda to invoke AWS batch jobs in sequence (dependent jobs). If one batch job in the sequence fails, all jobs thereafter get failed.</p>
<p>Is it possible to invoke that batch job from the last failed ... | <p>No, Batch jobs are immutable. If job 2 depends on job 1, then when job 1 fails, you cannot change job 2 to depend on a new job 3 that you create to replace job 1.</p>
<p>Instead you'll need to create a new sequence of jobs that are identical to the original set of jobs starting from the point that failed.</p>
<p>Bat... | Aws batch jobs scheduled in a sequence . If any job is failed, invoke the job and sequence from failed job | amazon-web-services|aws-lambda|aws-batch | 1 | 71 | 1 | 72,998,632 | 72,998,632 | 1 | true | 2022-07-15T18:08:55.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Aws batch jobs scheduled in a sequence . If any job is failed, invoke the job and sequence from failed job<p>I have a lambda to invoke AWS batch jobs in sequ... |
73,006,119 | NavigationLink is not working in fullScreenCover when I click item in list<p>I want to show a list in fullscreenCover and navigate another View from there but unfortunately when I click Items in list nothing happens. If anyone can help, I would be happy...
here is example code</p>
<pre><code> Button("New Message&q... | <p>The <code>.sheet</code> and <code>.fullScreenCover</code> introduce new presentations, so we need new <code>NavigationView</code> inside</p>
<pre><code>Button("New Message"){
shownFCover.toggle()
}.fullScreenCover(isPresented: $shownFCover) {
VStack {
Button("Close"... | NavigationLink is not working in fullScreenCover when I click item in list | swiftui|swiftui-navigationlink | 2 | 71 | 1 | 73,006,147 | 73,006,147 | 1 | true | 2022-07-16T16:57:34.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NavigationLink is not working in fullScreenCover when I click item in list<p>I want to show a list in fullscreenCover and navigate another View from there bu... |
73,000,638 | How to programmatically detect the use of text menu in iOS [Swift 5]<p>I want to record the user's behavior on a <code>UITextViewer</code>. Specifically, I want to programmatically capture when the user tapped text menu functions such as <code>copy</code>, <code>cut</code>, <code>translate</code>, <code>select all</cod... | <p>Here some code to not have <strong>paste</strong> in menu when selected text contains a certain String ("<strong>XXX</strong>") :</p>
<pre><code>override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
let canPerformAction = super.canPerformAction(action, withSender: sen... | How to programmatically detect the use of text menu in iOS [Swift 5] | swift | 1 | 71 | 1 | 73,008,255 | 73,008,255 | 1 | true | 2022-07-16T00:10:01.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to programmatically detect the use of text menu in iOS [Swift 5]<p>I want to record the user's behavior on a <code>UITextViewer</code>. Specifically, I w... |
73,010,898 | Accepting & Inputing values in a non rectangular 2D array in java<p>I am trying to write a program to search the index of a number in a two-dimensional array. While running the code I keep getting into this exception:</p>
<blockquote>
<p>Exception in thread "main" java.lang.NullPointerException: Cannot store ... | <p>There are several issues in the code.</p>
<ol>
<li>nos[i] is null. So you may initialize it as nos[i] = new int[k]; when you get the value of k</li>
<li>you have j-- in the for loop with j starting with 0. have to be j++.</li>
<li>You're inserting to nos[i][k] which cause ArrayIndexOutOfBounds exception. Should be ... | Accepting & Inputing values in a non rectangular 2D array in java | java|arrays|exception|multidimensional-array|nullpointerexception | -2 | 71 | 3 | 73,010,971 | 73,010,971 | 1 | true | 2022-07-17T10:09:13.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accepting & Inputing values in a non rectangular 2D array in java<p>I am trying to write a program to search the index of a number in a two-dimensional array... |
73,012,002 | How to clean survey data in pandas<p><strong>Input:</strong></p>
<p><a href="https://i.stack.imgur.com/mK2Yh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mK2Yh.png" alt="enter image description here" /></a>
<strong>Output:</strong></p>
<p><a href="https://i.stack.imgur.com/KjbRs.png" rel="nofollow... | <p>You can use:</p>
<pre><code>df["ToD"] = (df.replace("Didn't answer", np.nan).stack().groupby(level=0)
.apply(lambda x: [i for i in x] if len(x) > 1 else x.iloc[0])
.reindex(df.index, fill_value="Didn't answer"))
</code></pre>
<p>Output:</p>
<pre><code>&g... | How to clean survey data in pandas | python|pandas|dataframe|numpy|data-cleaning | 1 | 71 | 4 | 73,012,341 | 73,012,341 | 1 | true | 2022-07-17T12:58:59.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to clean survey data in pandas<p><strong>Input:</strong></p>
<p><a href="https://i.stack.imgur.com/mK2Yh.png" rel="nofollow noreferrer"><img src="https:/... |
73,018,211 | Null check operator used on a null value while using variable from provider into another screen<p>I am using provider for statemanagement. when i call nullable (int? tipIndex) variable using provider in another class i must have to put ! operator... when i put ! opertaor i get error that null check opertaor used on nul... | <p>You should build the UI conditionally by checking if <code>cart.tipIndex</code> is <code>null</code> or not before actually using it. It's going to be something as below:</p>
<pre class="lang-dart prettyprint-override"><code>ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: cart.tipList.length,
sh... | Null check operator used on a null value while using variable from provider into another screen | flutter | 2 | 71 | 1 | 73,018,559 | 73,018,559 | 1 | true | 2022-07-18T06:42:24.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Null check operator used on a null value while using variable from provider into another screen<p>I am using provider for statemanagement. when i call nullab... |
73,001,670 | How can I get a certain record’s system notes from SuiteScript?<p>I need to get the system notes of a transaction from a button on the transaction record form.</p>
<p>I tried to create a saved search of type <code>SYSTEM_NOTE</code>, however, SuiteScript returns the following error when the <code>record</code> filter i... | <p>You will receive an error using the filter shown in your question, because <code>'record'</code> is not a valid filter for a <code>SYSTEM_NOTE</code> saved search. You can use <code>'recordid'</code> instead. Note you should also use the <code>EQUALTO</code> operator, not <code>ANYOF</code>.</p>
<pre><code>filters... | How can I get a certain record’s system notes from SuiteScript? | netsuite|suitescript|saved-searches | 1 | 71 | 1 | 73,024,241 | 73,024,241 | 1 | true | 2022-07-16T05:07:28.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get a certain record’s system notes from SuiteScript?<p>I need to get the system notes of a transaction from a button on the transaction record for... |
72,844,880 | How to implement a recursive Scala 3 function that returns a recursive match type?<p>I fail to implement a function that returns a recursive match type. As an example, I took the tuple <code>Append</code> type from the std lib and tried to implement a simple <code>append</code> function.</p>
<pre class="lang-scala pret... | <p>The compiler is very fussy when it comes to returning match types. Your second case needs a small modification to get it to work without the cast (<a href="https://scastie.scala-lang.org/wq5R63dOSam95z7LuHiyZQ" rel="nofollow noreferrer">Scastie</a>):</p>
<pre class="lang-scala prettyprint-override"><code>def append[... | How to implement a recursive Scala 3 function that returns a recursive match type? | scala|tuples|scala-3|match-types | 1 | 71 | 2 | 73,214,148 | 73,214,148 | 1 | true | 2022-07-03T08:09:42.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement a recursive Scala 3 function that returns a recursive match type?<p>I fail to implement a function that returns a recursive match type. As a... |
73,008,433 | Element Out Of The ScreenShot error while taking screenshot from whatsapp using selenium and VBA<p>I need somebody to help with selenium classes to bring the information about message read/receipt to the excel sheet. From the help in my previous question, I have got somewhere. But I need more help for going further.</p... | <p>As you are seeing <em><code>Element Out Of The ScreenShot</code></em> error presumably you may need to scroll the element within the <a href="https://stackoverflow.com/a/59130869/7429447">Viewport</a> before taking the screenshot as follows:</p>
<pre><code>Set element = bot.FindElementByXPath("//span[@data-test... | Element Out Of The ScreenShot error while taking screenshot from whatsapp using selenium and VBA | vba|selenium|selenium-webdriver|whatsapp|js-scrollintoview | 2 | 71 | 1 | 73,008,474 | 73,008,474 | 1 | true | 2022-07-17T00:05:21.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Element Out Of The ScreenShot error while taking screenshot from whatsapp using selenium and VBA<p>I need somebody to help with selenium classes to bring the... |
72,973,530 | Is it possible to make SwiftUI TextField ignore space-bar / space entry?<p>Is it possible to make a SwiftUI Textfield simply ignore space-bar key-strokes?</p>
<p>I want to make it so that when a user enters their sign-up / login details that the space bar is ignored since that data does not need spaces.</p>
<p>Other so... | <p>Try this custom TextField:</p>
<pre><code>import SwiftUI
struct ContentView: View {
@State private var test = ""
var body: some View {
//completely ignore space
CustomTextField("enter", text: $test)
}
}
//custom textfield
struct CustomTextField: View {
let label: LocalizedStringKey
@B... | Is it possible to make SwiftUI TextField ignore space-bar / space entry? | ios|xcode|swiftui | 1 | 71 | 1 | 72,973,724 | 72,973,724 | 1 | true | 2022-07-13T23:01:31.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to make SwiftUI TextField ignore space-bar / space entry?<p>Is it possible to make a SwiftUI Textfield simply ignore space-bar key-strokes?</p... |
72,852,794 | How to separate 2 column in dataframe and save to .csv file<p>First of all I have multiple txt files (1000 files) and I will make dataframe from 2 columns.
first column is filename of txt file. and 2nd is data if each text files.</p>
<p>I try to write code as below.</p>
<pre><code>import os
import shutil
import pandas ... | <p>IIUC use:</p>
<pre><code>df = df.assign(filename = df['filename'].str[:11], bbox= df['filename'].str[11:])
</code></pre>
<p>EDIT: For extract second column use:</p>
<pre><code>import os
myFiles = glob.glob('C:\\Users\\xxx\\Sub_Folder\\*.txt')
dfs= ([pd.read_csv(fp, sep='\s+').iloc[:, [1]]
.assign(f=os.path... | How to separate 2 column in dataframe and save to .csv file | python|pandas | 2 | 71 | 1 | 72,852,844 | 72,852,844 | 1 | true | 2022-07-04T06:55:48.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to separate 2 column in dataframe and save to .csv file<p>First of all I have multiple txt files (1000 files) and I will make dataframe from 2 columns.
f... |
72,924,597 | React, problem with my Todo list app, my search engine only finds notes on the page I'm on<p>Hello I am making an application to practice React, my notes app has a pagination which works perfectly, the problem is in the search engine, which only looks for notes from the page I'm on, for example, if I'm on page 2 and I ... | <p>As I suggested to you, search all the notes with <code>searchText</code> in your App.js and pass the results into the Pagination component and it will solve your problem.</p>
<p>Codesandbox: <a href="https://codesandbox.io/s/youthful-thompson-xugs0c" rel="nofollow noreferrer">https://codesandbox.io/s/youthful-thomps... | React, problem with my Todo list app, my search engine only finds notes on the page I'm on | javascript|reactjs|pagination | 1 | 71 | 2 | 72,928,165 | 72,928,165 | 1 | true | 2022-07-09T20:58:39.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React, problem with my Todo list app, my search engine only finds notes on the page I'm on<p>Hello I am making an application to practice React, my notes app... |
72,798,589 | In bootstrap want table to be same width when displaying with/without collapsible elements<p>In bootstrap 5 I would like table to be displayed same width when displaying with/without collapsible elements. Currently it display shorter when not displaying the collapsible elements, which is irritating for user. Seems want... | <p>Similar to the answer by @Cervus, you are having this issue as uncollapsing changes the width of the element which has no constraints reshifting things around, to fix this you'd want to set a forced width to the column to do this with bootstrap you can use rows and cols as shown:</p>
<p><a href="https://codepen.io/r... | In bootstrap want table to be same width when displaying with/without collapsible elements | bootstrap-5 | 0 | 71 | 2 | 72,965,229 | 72,965,229 | 1 | true | 2022-06-29T08:59:14.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In bootstrap want table to be same width when displaying with/without collapsible elements<p>In bootstrap 5 I would like table to be displayed same width whe... |
73,016,241 | Almost working way to grab a borderless window in Kivy<p>I am looking to <strong>replace the windows title bar for a borderless app</strong>, I found some solutions on the internet that didn't quite work for me so <strong>I tried to do it myself</strong>.</p>
<p><strong>Although the grabbing the screen and moving part ... | <p>I've finally come up with a solution but this may not be the best one.</p>
<p>( Some places where I made changes are marked with comment <code>[Modified]</code> )</p>
<pre><code>from kivy.app import App
from win32api import GetSystemMetrics # for getting screen size
from kivy.lang.builder import Builder
from kivy.c... | Almost working way to grab a borderless window in Kivy | python|python-3.x|user-interface|kivy|kivy-language | 1 | 71 | 1 | 73,151,556 | 73,151,556 | 1 | true | 2022-07-18T00:20:44.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Almost working way to grab a borderless window in Kivy<p>I am looking to <strong>replace the windows title bar for a borderless app</strong>, I found some so... |
72,834,086 | Can a coroutine suspend and then resume on a different thread? Are the memory effects of the first thread carried to the second thread?<p>Consider</p>
<pre><code>fun main(args: Array<String>) {
runBlocking {
launch(Dispatchers.Default) {
var a = 0
a++
delay(100)
... | <p>After execution of the <code>suspend delay()</code> function there is a possibility that the coroutine will continue execution on another thread from the <code>Dispatchers.Default</code> thread pool.</p>
<p>There is no need in additional synchronization for <code>a</code> variable, because it is being used only with... | Can a coroutine suspend and then resume on a different thread? Are the memory effects of the first thread carried to the second thread? | multithreading|kotlin|kotlin-coroutines | 1 | 71 | 1 | 72,834,177 | 72,834,177 | 1 | true | 2022-07-01T19:54:46.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can a coroutine suspend and then resume on a different thread? Are the memory effects of the first thread carried to the second thread?<p>Consider</p>
<pre><... |
72,888,498 | fetching each item inside an array and collect all results in one object<p>I want to get for each bird an own response from the API but unfortunately b2 replaces the cards of the first run with b1 / first bird after.
I want to be able to see the response of b1 and b2 both on the website. As it is now, b2 replaces all c... | <pre><code>const getanimalData = async () => {
if (!a) return;
const allResponse = await Promise.all(birds.map(item => fetch(`https://api.testapicleared`)))
const allResponseJson = await Promise.all(allResponse.map(response => response.json()))
setAnimals(lastAnimals => [...lastAnimals,..... | fetching each item inside an array and collect all results in one object | javascript|reactjs|fetch-api | 0 | 71 | 1 | 72,889,008 | 72,889,008 | 1 | true | 2022-07-06T18:43:57.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
fetching each item inside an array and collect all results in one object<p>I want to get for each bird an own response from the API but unfortunately b2 repl... |
72,898,843 | Adding new constructors to a specialised template class<p>I have a class defining an array of fixed length <code>n</code>, with some methods.</p>
<pre><code>template<int n>
struct array_container{
/* some code here */
int array[n];
};
</code></pre>
<p>Let's say I want to add a constructor to <code>array_co... | <blockquote>
<p>Is there any approach that avoids both pitfalls? Ie. doesn't need to copy-paste the entire generic base code for the specialization, and doesn't add unnecessary constructors to the generic base?</p>
</blockquote>
<p>Ignoring the fact that, as @Goswin von Brederlow mentions, you seem to be reinventing th... | Adding new constructors to a specialised template class | c++|templates|specialization|partial-specialization | 2 | 71 | 4 | 72,899,719 | 72,899,719 | 1 | true | 2022-07-07T13:37:51.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding new constructors to a specialised template class<p>I have a class defining an array of fixed length <code>n</code>, with some methods.</p>
<pre><code>... |
72,900,045 | 429 Unknown Status from scrapy shell's fetch<p>I am trying to scrape some real estate data on <a href="https://www.realestate.com.au/sold/in-brisbane+-+greater+region,+qld/list-1" rel="nofollow noreferrer">https://www.realestate.com.au/sold/in-brisbane+-+greater+region,+qld/list-1</a>.
Calling <code>fetch('https://www.... | <p>In such cases, most probably website is blocking your requests because it is unable to identify you.</p>
<p>Using Request Headers and Cookies- This is one of the anti-ban method to scrape the website, which is called <code>Reverse Engineering the request</code>. So You open browser tools, and copy paste the - Reques... | 429 Unknown Status from scrapy shell's fetch | python|scrapy | 0 | 71 | 2 | 72,909,854 | 72,909,854 | 1 | true | 2022-07-07T14:56:08.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
429 Unknown Status from scrapy shell's fetch<p>I am trying to scrape some real estate data on <a href="https://www.realestate.com.au/sold/in-brisbane+-+great... |
72,861,537 | How to use data from postgresql in django?<p>I have switched from <code>sqlite</code> to <code>postgresql</code> following <a href="https://stackoverflow.com/questions/3476606/django-what-are-the-best-practices-to-migrate-a-project-from-sqlite-to-postgres">Django: What are the best practices to migrate a project from s... | <p>i can not find the question, but i can say:</p>
<ol>
<li><p>dump all data from your_app_name</p>
<p>./manage.py dumpdata your_app_name > your_model_data_filename.json</p>
</li>
</ol>
<p>2.dump all data from your_model_name model in your_app_name app</p>
<pre><code>./manage.py dumpdata your_app_name.your_model_nam... | How to use data from postgresql in django? | python|django|postgresql | 0 | 71 | 2 | 72,862,117 | 72,862,117 | 1 | true | 2022-07-04T20:05:01.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use data from postgresql in django?<p>I have switched from <code>sqlite</code> to <code>postgresql</code> following <a href="https://stackoverflow.com... |
72,985,812 | Get bounding box dimensions of Vector Graphics (bitmap graphics) PDFBOX Java<p>I have some PDF documents in which their main content is Vector Graphics (bitmap graphics). Like the following.</p>
<p><strong>IMPORTANT NOTE:</strong> These are the only type of operators in the PDF. It does not contain text, images or othe... | <p>Following the same approach that is posted here:</p>
<p><a href="https://stackoverflow.com/questions/38931422/pdfbox-2-0-2-calling-of-pagedrawer-processpage-method-caught-exceptions">pdfbox 2.0.2 > Calling of PageDrawer.processPage method caught exceptions</a></p>
<p>They mentioned that the logic should be placed... | Get bounding box dimensions of Vector Graphics (bitmap graphics) PDFBOX Java | java|pdf|pdfbox | 0 | 71 | 1 | 73,084,223 | 73,084,223 | 1 | true | 2022-07-14T19:36:25.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get bounding box dimensions of Vector Graphics (bitmap graphics) PDFBOX Java<p>I have some PDF documents in which their main content is Vector Graphics (bitm... |
72,878,450 | Can I define nested component without creating new file?<p>What I want:</p>
<p><strong>Parent.vue</strong></p>
<pre><code><template>
<div>
<span>{{foo}}</span>
<Child/>
</div>
</template>
<script setup>
import { ref, defineComponent } from 'vue';
... | <p>Your code does not work because the template of the <code>Child</code> component is provided as a string.</p>
<p><a href="https://vuejs.org/guide/scaling-up/tooling.html#note-on-in-browser-template-compilation" rel="nofollow noreferrer">Note on In-Browser Template Compilation</a></p>
<blockquote>
<p>When using Vue w... | Can I define nested component without creating new file? | javascript|vue.js|vue-component|vuejs3 | 0 | 71 | 1 | 72,879,693 | 72,879,693 | 1 | true | 2022-07-06T05:44:27.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I define nested component without creating new file?<p>What I want:</p>
<p><strong>Parent.vue</strong></p>
<pre><code><template>
<div>
... |
73,014,606 | Get markdown heading level in awk<p>Given a string with a markdown heading, what would be the best way to return the level of the heading in <code>awk</code>?</p>
<p>Assumptions:</p>
<ul>
<li>For this scenario, to be considered a heading the only requisite is that the line must start with a <code>#</code></li>
<li>The ... | <p>What you're asking for is:</p>
<pre><code>awk 'match($0,/^#+/){print RLENGTH}'
</code></pre>
<p>e.g.:</p>
<pre><code>$ cat file
# Heading
## Heading
## This is level #2
Example without a leading #s in the provided string
This a normal paragraph with a # in the middle
# Heading
\# Heading
##Heading
</code></pre>
<p>... | Get markdown heading level in awk | shell|parsing|awk|markdown|text-processing | -1 | 71 | 1 | 73,038,320 | 73,038,320 | 1 | true | 2022-07-17T19:07:20.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get markdown heading level in awk<p>Given a string with a markdown heading, what would be the best way to return the level of the heading in <code>awk</code>... |
72,848,257 | Parsing json string and json obj in same json obj in Python<p>there's a json obj:</p>
<pre class="lang-py prettyprint-override"><code>{'key1': 'val1', 'key2': "{"key3": ["val3"]}"}
</code></pre>
<p>how to parse json string and json obj in the same json obj</p>
<p>json.load() =>
Attribut... | <p>Pretty sure you want to use JSON library as Himanshu suggested.</p>
<p>I think this will answer your questions: <a href="https://bogotobogo.com/python/python-json-dumps-loads-file-read-write.php" rel="nofollow noreferrer">https://bogotobogo.com/python/python-json-dumps-loads-file-read-write.php</a></p>
<p>the json d... | Parsing json string and json obj in same json obj in Python | python|json|python-3.x|string | -1 | 71 | 2 | 72,848,332 | 72,848,332 | 1 | true | 2022-07-03T16:40:22.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing json string and json obj in same json obj in Python<p>there's a json obj:</p>
<pre class="lang-py prettyprint-override"><code>{'key1': 'val1', 'key2'... |
72,901,339 | Is it possible to use a literal double if a given template type doesn't have a method that returns a double<p>Here's my problem, I have a class Foo() which holds two doubles, its value and an extra one:</p>
<pre><code>class Foo {
public:
Foo(double value, double extra) :
value_(value), extra_(extra) {
... | <p>To me it sounds like you could do several things. Either Testing should not be a template and only have Foo members, so that you can use a converting constructor for Foo,</p>
<pre><code>Foo(double value, double extra = 1);
</code></pre>
<p>to allow implicit conversion from a single double. Or, as you say, another Fo... | Is it possible to use a literal double if a given template type doesn't have a method that returns a double | c++|templates|c++17 | 1 | 71 | 1 | 72,904,766 | 72,904,766 | 1 | true | 2022-07-07T16:29:25.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to use a literal double if a given template type doesn't have a method that returns a double<p>Here's my problem, I have a class Foo() which h... |
72,816,443 | Grouping list by object except one field<p>I have to group list items if the items fields are the same. Above in my code, it works what I want if every id is the same. But product ids are unique. For that reason, I cant make the right grouping.</p>
<p>Here I wrote an example product model but original product model has... | <p>You must replace the id with a meaningless id (like -1 in my example):</p>
<pre><code>data class Product(
val id: Int,
val name: String,
val price: Int,
val quantity: Int
)
data class GroupedProduct(
val product: Product,
val count: Int,
val totalQuantity: Int,
val isGroup: Boolean
)
var products =... | Grouping list by object except one field | java|android|kotlin|grouping | 0 | 71 | 2 | 72,816,915 | 72,816,915 | 1 | true | 2022-06-30T13:11:40.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grouping list by object except one field<p>I have to group list items if the items fields are the same. Above in my code, it works what I want if every id is... |
72,915,147 | KeyError Json in Python fix<pre class="lang-py prettyprint-override"><code>with open("data/tickets.json", "r") as f:
data = json.load(f)
data[str(ticket.id)]["author"] = ctx.author.id
with open("data/tickets.json", "w") as f:
json.dump(data, f, indent=4)
</cod... | <p>From my testing and knowledge, the issue is that you are trying to create the <code>author</code> key in a nested dictionary that does not exist, which is not possible.</p>
<pre class="lang-py prettyprint-override"><code>>>> x = {}
>>> x[123]['author'] = 456
Traceback (most recent call last):
Fil... | KeyError Json in Python fix | python|json|discord.py|keyerror | 0 | 71 | 1 | 72,925,501 | 72,925,501 | 1 | true | 2022-07-08T17:46:25.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
KeyError Json in Python fix<pre class="lang-py prettyprint-override"><code>with open("data/tickets.json", "r") as f:
data = json.load... |
72,875,157 | JSONSerializer deserialize to c# Object missing values<p>I have JSON string containing many values and sub-values that I am trying to deserialize to a <code>ServiceTicketRAF</code> object. Thing is I don't know why it is setting <code>null</code> for three properties in the <code>RafSpecialAccount</code> class:</p>
<ol... | <p>I reproduced your issue and it would seem that the json string as posted has trailing white space in the property names for the three cases you point out.</p>
<p>Two occurrences of:</p>
<pre><code>""specialAccountFinancialInstitutionAddress "" // Should be
""specialAccountFinancialInsti... | JSONSerializer deserialize to c# Object missing values | c#|json|string|deserialization | -1 | 71 | 1 | 72,876,142 | 72,876,142 | 1 | true | 2022-07-05T20:25:08.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSONSerializer deserialize to c# Object missing values<p>I have JSON string containing many values and sub-values that I am trying to deserialize to a <code>... |
72,775,665 | How do I pass response values from extension to custom response type in IBM Watson Assistant chat?<p>The below JSON defines custom response for the client to allow custom UI. As per the documentation <a href="https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-response-types-reference#user_defined" rel="... | <p>So after some trial and error it seems that it works with the expression lang as described here <a href="https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-call-extension#extension-check-status" rel="nofollow noreferrer">https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-call-extensio... | How do I pass response values from extension to custom response type in IBM Watson Assistant chat? | ibm-cloud|chatbot|ibm-watson|watson-assistant | 2 | 71 | 1 | 72,796,020 | 72,796,020 | 1 | true | 2022-06-27T16:48:00.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I pass response values from extension to custom response type in IBM Watson Assistant chat?<p>The below JSON defines custom response for the client to... |
72,393,668 | Remote GPIO (Pigpio) with input from laptop and output from Raspberry Pi<p>I'm working on an object detection project for IoT using a webcam and servo. In short, when the object detected by the webcam matches the data in the system, the servo will move. Can the webcam be connected to the laptop, and the servo on the Ra... | <p>This <a href="https://gpiozero.readthedocs.io/en/stable/recipes_remote_gpio.html" rel="nofollow noreferrer">link</a> shows the GPIO Zero library being used with pigpio to allow remote control of the GPIO pins, from either another raspberry pi - or a PC. Once you configure GPIO Zero to use the pigpio library and conn... | Remote GPIO (Pigpio) with input from laptop and output from Raspberry Pi | python|raspberry-pi|iot|gpiozero|pigpio | 0 | 71 | 2 | 72,394,308 | 72,394,308 | 1 | true | 2022-05-26T14:44:00.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remote GPIO (Pigpio) with input from laptop and output from Raspberry Pi<p>I'm working on an object detection project for IoT using a webcam and servo. In sh... |
72,399,050 | Parallelize three nested loops<p><strong>Context:</strong></p>
<p>I have 3 3D arrays ("<code>precursor</code> arrays") that I am upsampling with an Inverse Distance Weighting method. To do that, I calculate a 3D <code>weights</code> array that I use in a for loop on each point of my <code>precursor</code> arr... | <p>The problem with multiprocessing is that it creates many new processes taht <strong>execute the code before the main</strong> (ie. before <code>if __name__ == '__main__'</code>). This causes a very slow initialization (since all process does it) and a huge amount of RAM being used for nothing. You certainly should m... | Parallelize three nested loops | python|for-loop|parallel-processing|multiprocessing | 1 | 71 | 1 | 72,399,494 | 72,399,494 | 1 | true | 2022-05-26T23:33:05.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parallelize three nested loops<p><strong>Context:</strong></p>
<p>I have 3 3D arrays ("<code>precursor</code> arrays") that I am upsampling with an... |
72,355,461 | R filter a variable by the count of another variable, but only counted within a day interval max<p>Here is the dataframe that I am working with:</p>
<pre><code>df <- tribble(
~Patient, ~date, ~Doctor
"A", "2020-01-01", "A",
"A", "2020-03-01", "A",
&... | <p>Use the <code>runner</code> package for rolling window computations like this. It's wonderful.</p>
<pre><code>library(tidyverse)
library(lubridate)
library(runner)
df <- tribble(
~Patient, ~date, ~Doctor,
"A", "2020-01-01", "A",
"A", "2020-03-01", &... | R filter a variable by the count of another variable, but only counted within a day interval max | r|dplyr | 0 | 71 | 3 | 72,400,746 | 72,400,746 | 1 | true | 2022-05-23T22:36:15.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R filter a variable by the count of another variable, but only counted within a day interval max<p>Here is the dataframe that I am working with:</p>
<pre><co... |
72,356,308 | How do html, body and window interact while scrolling programmatically?<p>I have been trying to implement a scroll-to-top button. Searching online I found this piece of code:</p>
<pre><code>$('html, body').animate({scrollTop:0}, 'slow');
</code></pre>
<p>I am confused, why would they try to scroll both <code>html</co... | <p><code>window.scroll()</code> effectively scrolls the <a href="https://drafts.csswg.org/cssom-view/#ref-for-dom-document-scrollingelement" rel="nofollow noreferrer"><code>document.scrollingElement</code></a>* which is now defined as being the <code><html></code> element, but used to be the <code><body></c... | How do html, body and window interact while scrolling programmatically? | javascript|html|jquery|css | 0 | 71 | 2 | 72,356,394 | 72,356,394 | 1 | true | 2022-05-24T01:25:24.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do html, body and window interact while scrolling programmatically?<p>I have been trying to implement a scroll-to-top button. Searching online I found th... |
72,360,248 | How to define extension for SectionedFetchResults with Key (String) and Result (NSFetchRequestResult)<p>I have <strong>SectionedFetchResults</strong> defined like this:</p>
<pre><code>private var consumption: SectionedFetchResults<String?, MedicationConsumption>
</code></pre>
<p>MedicationConsumption have variabl... | <p>I assume it can be like</p>
<ol>
<li>for Grand Total for response:</li>
</ol>
<pre><code>extension SectionedFetchResults where Result == MedicationConsumption {
var totalQuantity: Double {
self.reduce(0) { sum, section in
section.reduce(into: sum) { $0 += $1.quantity }
}
}
}
</cod... | How to define extension for SectionedFetchResults with Key (String) and Result (NSFetchRequestResult) | swift|core-data|swiftui | 1 | 71 | 1 | 72,361,574 | 72,361,574 | 1 | true | 2022-05-24T09:14:59.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define extension for SectionedFetchResults with Key (String) and Result (NSFetchRequestResult)<p>I have <strong>SectionedFetchResults</strong> defined... |
72,334,795 | Swift date formatter off by one day<p>It's pretty bizarre. If I look at the Data object it correctly has 01/01/1990, but when converting it to a string it returns 12/31/1989. This seems to have only recently started happening as the code in question is very old/well used at this point.</p>
<pre><code>let dateFormatter ... | <p>try setting the TimeZone that you want, for example:</p>
<pre><code> dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
</code></pre>
<p>or</p>
<pre><code>dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
</code></pre> | Swift date formatter off by one day | swift|date|timestamp|nsdateformatter | 0 | 71 | 1 | 72,334,948 | 72,334,948 | 1 | true | 2022-05-22T04:23:36.150Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift date formatter off by one day<p>It's pretty bizarre. If I look at the Data object it correctly has 01/01/1990, but when converting it to a string it re... |
72,262,085 | Akka Cluster basic clarifications about creating actors dynamically<p>In Akka remote we crate actor by defining in actor system configuration,or programmatically saying the other actor system location.<br />
We send messages to the actor by the references we created or we can get a actor reference by getting actorselec... | <p><em>Edited answer for responding to missed points.</em></p>
<p><strong>A General Approach</strong></p>
<p>This approach is suggested for a more general usecase.</p>
<blockquote>
<p>Q1: How we create actors out side of cluster dynamically?</p>
</blockquote>
<p>You cannot directly create actors in other members in the... | Akka Cluster basic clarifications about creating actors dynamically | akka|akka.net|akka-cluster|akka-remote-actor|akka-remoting | -1 | 71 | 1 | 72,442,219 | 72,442,219 | 1 | true | 2022-05-16T15:55:37.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Akka Cluster basic clarifications about creating actors dynamically<p>In Akka remote we crate actor by defining in actor system configuration,or programmatic... |
72,365,829 | UWP create new window for each file opened<p>I'm trying to make an app open a window for each file.</p>
<p>-- Code ---</p>
<p>App.cs:</p>
<pre><code> protected async override void OnFileActivated(FileActivatedEventArgs Args)
{
//Opens Main Page
base.OnFileActivated(Args);
var RF = new Fra... | <p>I'm not sure what is the file type that you are using so I didn't check the text part. But I have to say that the way you are creating a new window is not correct. If you want to open a new window every time when you open a new file, you don't have to call <code>Window.Current.Activate();</code> every time. I've ma... | UWP create new window for each file opened | c#|visual-studio|uwp|file-association | 0 | 71 | 1 | 72,371,466 | 72,371,466 | 1 | true | 2022-05-24T15:46:17.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UWP create new window for each file opened<p>I'm trying to make an app open a window for each file.</p>
<p>-- Code ---</p>
<p>App.cs:</p>
<pre><code> prot... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.