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
71,180,569
Could not get HttpClient cache - No ThreadContext available for thread id=1<p>I'm working on upgrading our service to use 3.63.0 (upgrading from 3.57.0) and I've noticed the following warning (with stack trace) shows up in the logs that wasn't there on the previous version:</p> <pre><code>2022-02-18 14:03:41.038 WARN ...
<p>Such an issue is often the result of missing Spring Boot annotations - especially in synchronous executions.</p> <p>Please refer to <a href="https://sap.github.io/cloud-sdk/docs/java/guides/cap-sdk-integration#enable-the-component-scan-for-sap-cloud-sdk-package" rel="nofollow noreferrer">our documentation</a> to lea...
Could not get HttpClient cache - No ThreadContext available for thread id=1
sap-cloud-sdk
0
301
1
71,202,394
71,202,394
1
true
2022-02-18T22:28:15.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Could not get HttpClient cache - No ThreadContext available for thread id=1<p>I'm working on upgrading our service to use 3.63.0 (upgrading from 3.57.0) and ...
71,284,185
Setting values in one column using another in pandas<p>I have YouTube video data in a JSON format.</p> <pre class="lang-json prettyprint-override"><code>{ &quot;KWWLwotNcTo&quot;: { &quot;id&quot;: &quot;KWWLwotNcTo&quot;, &quot;publishedAt&quot;: &quot;2022-02-23T03:30:15Z&quot;, &quot;tags&quot;: [ ...
<pre><code>import pandas as pd items = ['python', 'django', 'flask'] df['check'] = df['tags'].apply(lambda x: map(str, [int(item in x) for item in items])).apply(';'.join) pd.DataFrame(df[&quot;check&quot;].str.split(';', expand=True).values, columns=items) </code></pre> <p>or</p> <pre><code>for item in items: df[i...
Setting values in one column using another in pandas
python|pandas
0
23
2
71,284,229
71,284,229
1
true
2022-02-27T11:00:43.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting values in one column using another in pandas<p>I have YouTube video data in a JSON format.</p> <pre class="lang-json prettyprint-override"><code>{ ...
71,122,417
multiple condition inside SUMIF() in google sheets<p>I created my daily task log sheet which i log my tasks daily and I also provide the time which I start and the time of its completion. it looks like this</p> <p><a href="https://i.stack.imgur.com/u0z8x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co...
<p>I believe you are looking for something like this?</p> <pre><code>=SUMIFS('TASKS (Itemized)'!I3:I,'TASKS (Itemized)'!A3:A,A8,'TASKS (Itemized)'!H3:H,&quot;&lt;&gt;Multitasking&quot;) </code></pre> <p>Without seeing a sample sheet of everything going on including columns and rows this is the best I can offer.</p>
multiple condition inside SUMIF() in google sheets
google-sheets-formula|formula
0
20
1
71,128,247
71,128,247
1
true
2022-02-15T07:17:21.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: multiple condition inside SUMIF() in google sheets<p>I created my daily task log sheet which i log my tasks daily and I also provide the time which I start a...
71,338,760
finding object from array of objects in Mongodb<pre class="lang-js prettyprint-override"><code>const Schema = new Schema({ queueId: { type: String, required: true, index: { unique: true } }, players: { type: [ { ID: { ...
<pre><code>db.collection.find({ &quot;players.ID&quot;: &quot;1&quot; }, { &quot;players.$&quot;: 1 }) </code></pre> <p><a href="https://mongoplayground.net/p/PFdFl4vMSty" rel="nofollow noreferrer">mongoplayground</a></p> <hr /> <pre><code>db.collection.find({ &quot;players.ID&quot;: &quot;1&quot; }) </code></pre...
finding object from array of objects in Mongodb
javascript|mongodb|mongoose
0
44
1
71,338,867
71,338,867
1
true
2022-03-03T14:24:29.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: finding object from array of objects in Mongodb<pre class="lang-js prettyprint-override"><code>const Schema = new Schema({ queueId: { type: Strin...
71,390,019
Lodash `countBy` equivalent in MongoDB?<p>Let's say I have the input docs below:</p> <pre class="lang-json prettyprint-override"><code>[ { &quot;_id&quot;: &quot;6225ca4052e7c226e2dd836d&quot;, &quot;data&quot;: [ &quot;07&quot;, &quot;07&quot;, &quot;12&quot;, &quot;19&quot;, &q...
<pre><code>db.collection.aggregate([ { $match: {} }, { $unwind: &quot;$data&quot; }, { $group: { _id: &quot;$data&quot;, c: { $sum: 1 }, id: { $first: &quot;$_id&quot; } } }, { $group: { _id: &quot;$id&quot;, data: { $push: { k: &quot;$_id&quot;, v: &quot;...
Lodash `countBy` equivalent in MongoDB?
mongodb|aggregation-framework|lodash
0
38
1
71,390,330
71,390,330
1
true
2022-03-08T04:26:13.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lodash `countBy` equivalent in MongoDB?<p>Let's say I have the input docs below:</p> <pre class="lang-json prettyprint-override"><code>[ { &quot;_id&qu...
71,229,996
Group by then sum of multiple columns in Scala Spark<p>I have a DataFrame with hundreds of feature columns, like this:</p> <pre><code>Country | ID | Feature_1 | Feature_2 | Feature_3 |.... US 123 1 5 0 US 456 0 10 1 CA 789 0 6 ...
<p>you can try</p> <pre><code>import org.apache.spark.sql.functions._ val df = Seq( (&quot;a&quot;, 9, 1), (&quot;a&quot;, 4, 2), (&quot;b&quot;, 1, 3), (&quot;a&quot;, 1, 4), (&quot;b&quot;, 2, 5) ).toDF(&quot;name&quot;, &quot;x&quot;, &quot;y&quot;) df.groupBy(col(&quot;name&quot;)) .agg( sum(col(&q...
Group by then sum of multiple columns in Scala Spark
scala|apache-spark|apache-spark-sql
0
555
1
71,232,202
71,232,202
1
true
2022-02-23T00:30:38.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Group by then sum of multiple columns in Scala Spark<p>I have a DataFrame with hundreds of feature columns, like this:</p> <pre><code>Country | ID | Featur...
71,335,509
Traverse a recursive array and update<p>I'm trying traverse an array and update the item when I find it. I have searched through Google and SO but I guess I'm not using the right keywords to do it.</p> <h2>Problem</h2> <p>I have the following object:</p> <pre class="lang-js prettyprint-override"><code>const form = { ...
<p>If what you want is to change the original array you can just use <code>forEach</code> and replace the object at a given <code>index</code>:</p> <pre><code>const findFormItem = (arr, item) =&gt; { arr.forEach((element, index, arr) =&gt; { if (element.uuid === item.uuid) { arr[index] = item; } if ...
Traverse a recursive array and update
javascript|arrays
0
33
1
71,335,916
71,335,916
1
true
2022-03-03T10:21:32.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Traverse a recursive array and update<p>I'm trying traverse an array and update the item when I find it. I have searched through Google and SO but I guess I'...
71,132,324
fastest way to match data from two massive lists with differing data types?<p>I have data regarding a directory structure of unknown (and massive) size and data regarding the same structure from perforce. Using Python, I need to be able to match the local data with the perforce data and generate a list of files that re...
<blockquote> <p>Using Python, I need to be able to match the local data with the perforce data and find all of the local files missing from perforce and all of the perforce data that differs from the local data.</p> </blockquote> <p>(snip)</p> <blockquote> <p>I am confident this is not the most efficient way to handle ...
fastest way to match data from two massive lists with differing data types?
python-3.x|perforce
0
21
1
71,132,803
71,132,803
1
true
2022-02-15T19:32:05.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: fastest way to match data from two massive lists with differing data types?<p>I have data regarding a directory structure of unknown (and massive) size and d...
71,196,510
convert nested string element into list with one element in python<p>Hope this is a simple one.</p> <p>I have the following json:</p> <pre><code>{ 'listTitle': 'dsadasdsa', 'chapters': 'testchapter', 'sublist': [ { 'subListCreator': 'jan', 'item': [ { 'itemTit...
<p>Mutating the dict in place is the simplest way if that's an option:</p> <pre><code>if data['chapters']: data['chapters'] = [data['chapters']] else: data.pop('chapters') </code></pre> <p>Building a new dict via a comprehension might look like:</p> <pre><code>{k: [v] if k == 'chapters' else v for k, v in data....
convert nested string element into list with one element in python
python|string|list|nested
0
27
1
71,196,557
71,196,557
1
true
2022-02-20T16:42:17.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: convert nested string element into list with one element in python<p>Hope this is a simple one.</p> <p>I have the following json:</p> <pre><code>{ 'listTi...
71,416,854
Struts2 + jQuery, how to update style of checked items in a table<p>I have a table with a checkbox and a &lt;s:property&gt; on each row:</p> <pre><code>&lt;s:iterator value=&quot;myforms&quot; var=&quot;form&quot;&gt; &lt;tr&gt; &lt;td class=&quot;text-center&quot;&gt; &lt;input type=&quot;checkbox&quot; name...
<p>As it's structured now it'll be irritating as you'll have to rely on DOM ordering.</p> <p>Use the <code>&lt;s:iterator&gt;</code> value on the <code>&lt;td&gt;</code> the same way as the checkboxes.</p> <p>This way there's a reliable, consistent selector to use for the <code>&lt;td&gt;</code> containing the date str...
Struts2 + jQuery, how to update style of checked items in a table
jquery|struts2
0
36
1
71,417,215
71,417,215
1
true
2022-03-09T22:45:32.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Struts2 + jQuery, how to update style of checked items in a table<p>I have a table with a checkbox and a &lt;s:property&gt; on each row:</p> <pre><code>&lt;s...
71,372,959
MySQL Query over multiple tables in the given example<p>I'd like to receive a table from my database but I am unable to form the query.</p> <p>This is what I like to achieve: Think of a group of users who shall be invited to an event. To find a date A list of dates are provided by the host.</p> <p>So far we have these ...
<p>Ok, so lets take this one step at a time. You are interested in a SPECIFIC event, and all POSSIBLE dates FOR said event. Then, based on a specific user, if they had (or not) picked any of the possible dates. And by the user ID, get the name too.</p> <p>Sample data. Your version of data had the sample selections ...
MySQL Query over multiple tables in the given example
mysql|database
0
43
1
71,373,973
71,373,973
1
true
2022-03-06T18:05:38.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL Query over multiple tables in the given example<p>I'd like to receive a table from my database but I am unable to form the query.</p> <p>This is what I...
71,308,488
How do i modify my create function in Django model manager<p>So i have this model:</p> <pre><code>class Token(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=False) code = models.IntegerField(default=code) date_created = models.DateTimeField(auto_now_add=Tr...
<p>There is no need to use a ModelManger here. You can just set the <code>expiration_date</code> based on the field <code>date_created</code> by overwriting the <code>save</code> method.</p> <p>Edit: It is not possible to use self.date_created datetime within the save method. However it is possible to use <code>django....
How do i modify my create function in Django model manager
django|django-models|django-managers
0
43
1
71,308,679
71,308,679
1
true
2022-03-01T12:28:18.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i modify my create function in Django model manager<p>So i have this model:</p> <pre><code>class Token(models.Model): user = models.ForeignKey(s...
71,135,009
Awk: Formatting the order of table data in awk script<p>I have the following output file. Please note that this data is dynamic, so there could be more or less years and many more categories A,B,C,D...:</p> <pre><code> 2015 2016 2017 EX FE B 0.00 -2.00 -1.00 D 0.00 -1.00 0.00 sumFE 0.00 -3...
<p>This will probably be easier to modify the originating code to use <a href="https://www.gnu.org/software/gawk/manual/html_node/Controlling-Scanning.html" rel="nofollow noreferrer">GNU awk's predefined array scanning orders</a>. The key objective is to switch the scanning order (<code>PROCINFO[&quot;sorted_in&quot;]<...
Awk: Formatting the order of table data in awk script
awk
0
21
1
71,135,441
71,135,441
1
true
2022-02-16T00:19:56.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Awk: Formatting the order of table data in awk script<p>I have the following output file. Please note that this data is dynamic, so there could be more or le...
71,353,562
Regex: Replace certain part of the matched characters<p>I want to be able to match with a certain condition, and keep certain parts of it. For example:</p> <p><code>June 2021 9 Feature Article Three-Suiters Via Puppets Kai-Ching Lin</code></p> <p>should turn into:</p> <p><code>Jun 2021 Three-Suiters Via Puppets Kai-Chi...
<p>You could use positive lookbehinds:</p> <pre class="lang-js prettyprint-override"><code>(?&lt;=^[A-Z][a-z]{2})[a-z]*|(?&lt;=\d{4}).*Article </code></pre> <ul> <li><code>(?&lt;=^[A-Z][a-z]{2})</code> - behind me is the start of a line and 3 chars; presumably the first three chars of the month</li> <li><code>[a-z]*</c...
Regex: Replace certain part of the matched characters
regex
0
36
2
71,353,761
71,353,761
1
true
2022-03-04T15:26:02.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex: Replace certain part of the matched characters<p>I want to be able to match with a certain condition, and keep certain parts of it. For example:</p> <...
71,413,138
Javascript regex for matching valid characters without repetition of a particular character<pre><code>let rx = /(\/MxML\/[a-z0-9\[\]@/]*)/gi; let s = 'If (/MxML/trades[1]/value== 1 then /MxML/trades[type=2]/value must be /MxML/stream/pre/reference@href'; let m; let res = []; while ((m = rx.exec(s))) { res.pus...
<p>Here is a regex which should be compatible in all browsers:</p> <pre class="lang-js prettyprint-override"><code>/(\/MxML\/(?:[a-z0-9\[\]@/]|=(?!=))*)/gi </code></pre> <ul> <li><code>/(\/MxML\/</code> - your regex</li> <li><code>(?:</code> - start non-capture group; we need this to implement an &quot;or&quot; operato...
Javascript regex for matching valid characters without repetition of a particular character
javascript|regex
0
31
1
71,413,388
71,413,388
1
true
2022-03-09T16:56:12.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript regex for matching valid characters without repetition of a particular character<pre><code>let rx = /(\/MxML\/[a-z0-9\[\]@/]*)/gi; let s = 'If...
71,138,297
How to add two array key values and return as a new key in PHP<p>I have an array($data) like this.</p> <pre><code>Array ( [0] =&gt; Array ( [PID] =&gt; 1 [USER_NAME] =&gt; JOHN [JOINED_DATE] =&gt; 2022-01-31 [JOINED_VALUE] =&gt; 23233.80 [TOPUP_AMO...
<p>Do it like this:</p> <pre><code>$data = Array( 0 =&gt; Array( 'PID' =&gt; 1, 'USER_NAME' =&gt; 'JOHN', 'JOINED_DATE' =&gt; '2022-01-31', 'JOINED_VALUE' =&gt; 23233.80, 'TOPUP_AMOUNT' =&gt; 58000.00, 'TOTAL_EXPENSES' =&gt; 3114.41, ), 1 =&gt; Array( ...
How to add two array key values and return as a new key in PHP
php|arrays
0
13
1
71,138,415
71,138,415
1
true
2022-02-16T08:18:07.120Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add two array key values and return as a new key in PHP<p>I have an array($data) like this.</p> <pre><code>Array ( [0] =&gt; Array ( ...
71,324,553
How to resolve the content of this promise?<p>So i have the following filter component</p> <pre><code>&lt;SelectSearchFilter name=&quot;search&quot; labelKey=&quot;option&quot; width=&quot;small&quot; valueKey=&quot;value&quot; options={[ { optio...
<p>the error is happening because your <code>CustomValue</code> is not a function as it says, but the result of the function <code>getLegafyFhPubCode(null)</code> you should pass the function without call in it <code>getLegafyFhPubCode</code> or you can use an arrow function <code>() =&gt; getLegafyFhPubCode(null)</cod...
How to resolve the content of this promise?
javascript|reactjs
0
29
1
71,324,755
71,324,755
1
true
2022-03-02T14:41:38.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to resolve the content of this promise?<p>So i have the following filter component</p> <pre><code>&lt;SelectSearchFilter name=&quot;search&qu...
71,198,347
looping a list and skip from another list<p>is there a better way to do this, this code is working but i feel like there is a better way to do it</p> <pre><code>mainlist = ['a','b','c','d','e','f','i','j','k'] skiplist = [4,6] avilable=[j for j in range(len(mainlist)+len(skiplist)+1) if j not in skiplist] i=avilable[0...
<p>Without that extra list:</p> <pre><code>mainlist = ['a','b','c','d','e','f','i','j','k'] skiplist = [4,6] i = 0 for letter in mainlist: while i in skiplist: i += 1 print(letter, ' is ', i) i += 1 </code></pre> <p>Or a fancy <code>itertools</code> solution, also using a set instead of the list, w...
looping a list and skip from another list
python|list|loops|skip|onavailable
0
41
4
71,198,407
71,198,407
1
true
2022-02-20T20:13:52.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: looping a list and skip from another list<p>is there a better way to do this, this code is working but i feel like there is a better way to do it</p> <pre><c...
71,227,579
Order sorting of an ndarray by indexes in python?<p>want to sort np.ndarray indexes of an array such as</p> <pre><code>[[.5,.7, .9], [.6, .0, .8]] </code></pre> <p>result would look like this</p> <pre><code>[[1,1],[0,1],[1,0],[0,1],[1,2],[0,3]] </code></pre> <p>applying those indexes will get correct sorting order and ...
<p>You can use np.argsort on the flat array and then use np.divmod to get the indexes of your previous shape. Edit: np.unravel_index is the divmod alternative for higher dimensions, see <a href="https://numpy.org/doc/stable/reference/generated/numpy.unravel_index.html" rel="nofollow noreferrer">https://numpy.org/doc/st...
Order sorting of an ndarray by indexes in python?
python-3.x|numpy-ndarray
0
33
1
71,228,426
71,228,426
1
true
2022-02-22T19:59:02.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Order sorting of an ndarray by indexes in python?<p>want to sort np.ndarray indexes of an array such as</p> <pre><code>[[.5,.7, .9], [.6, .0, .8]] </code></p...
71,116,589
With sendgrid and python, how to send an email to multiple BCC at once?<p>Please, in python3 and sendgrid I need to send an email to multiple addresses in BCC way. I have these emails on a list. I'm trying like this with Personalization:</p> <pre><code>import os import json from sendgrid import SendGridAPIClient from s...
<p>Twilio SendGrid developer evangelist here.</p> <p>When adding multiple bccs to your personalization object, you need to loop through the email addresses and add them each individually.</p> <pre class="lang-py prettyprint-override"><code>import os import json from sendgrid import SendGridAPIClient from sendgrid.helpe...
With sendgrid and python, how to send an email to multiple BCC at once?
python|email|sendgrid|bcc|personalization
0
514
1
71,134,852
71,134,852
1
true
2022-02-14T18:26:53.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: With sendgrid and python, how to send an email to multiple BCC at once?<p>Please, in python3 and sendgrid I need to send an email to multiple addresses in BC...
71,250,511
recursive attribute calculation?<p>XML input:</p> <pre><code>&lt;a&gt; &lt;desc key=&quot;1&quot; attr1=&quot;# {@key}&quot; attr2=&quot;{@key} #&quot; attr3=&quot;&quot; title=&quot;{@attr2}&quot;&gt; &lt;b&gt; &lt;slot key=&quot;2&quot; attr4=&quot;{@key}&quot; title=&quot;{@attr4}+{@attr4}&quot; &gt; ...
<p>If it can be assumed that an attribute will never contain the <code>{}</code> characters other than to house a reference to another attribute of the same parent element, then you could do something like:</p> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http:...
recursive attribute calculation?
xml|xslt|xslt-1.0|transformation
0
39
1
71,251,324
71,251,324
1
true
2022-02-24T10:27:27.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: recursive attribute calculation?<p>XML input:</p> <pre><code>&lt;a&gt; &lt;desc key=&quot;1&quot; attr1=&quot;# {@key}&quot; attr2=&quot;{@key} #&quot; at...
71,252,141
XSLT 1.0: grouping positive and negative values with an xsl:key<p>I have this source XML and I have to group the <code>&lt;SpinRecord&gt;</code> elements by <code>&lt;IndirectCust&gt;</code> and <code>&lt;SalesVolume&gt;</code>:</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;SI_CSV_...
<p>Could you not do simply:</p> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt; &lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot;/&gt; &lt;xsl:key name=&qu...
XSLT 1.0: grouping positive and negative values with an xsl:key
xslt|xslt-grouping
0
24
1
71,252,404
71,252,404
1
true
2022-02-24T12:40:48.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XSLT 1.0: grouping positive and negative values with an xsl:key<p>I have this source XML and I have to group the <code>&lt;SpinRecord&gt;</code> elements by ...
71,098,341
The results of running `which $0` with bash and ./ are different, what causes this difference?<p>I have the following bash file (test_para.sh):</p> <pre class="lang-sh prettyprint-override"><code>#!/bin/bash echo $(dirname `which $0`) </code></pre> <p>When I run this file with <strong>bash test_para.sh</strong>, the te...
<p>When you're trying to understand what's happening in a shell script, it's often helpful to put the command <code>set -x</code> before the problem section to see what's actually happening as the script runs. If you add that to your script (right after the shebang), and run it both ways, you'll see something like this...
The results of running `which $0` with bash and ./ are different, what causes this difference?
bash
0
37
1
71,098,917
71,098,917
1
true
2022-02-13T06:10:43.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The results of running `which $0` with bash and ./ are different, what causes this difference?<p>I have the following bash file (test_para.sh):</p> <pre clas...
71,321,772
How to change a certain value in a column of a list into NA in R?<p>I would like to change -1 value of my V3 column into NA, but don't know how...</p> <pre><code>library(dplyr) set.seed(94756) mat1 &lt;- matrix(sample(seq(-1,100, 0.11),50,replace = TRUE),ncol = 5) mat1 &lt;- as.data.frame(mat1) mat1[8,3] &lt;- -1 m...
<p>You can use this code:</p> <pre><code>lapply(data, function(d) {d$V3[d$V3 == -1] &lt;- &quot;NA&quot;; d}) </code></pre>
How to change a certain value in a column of a list into NA in R?
r|list|rename|cell|na
0
28
1
71,321,999
71,321,999
1
true
2022-03-02T11:18:29.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change a certain value in a column of a list into NA in R?<p>I would like to change -1 value of my V3 column into NA, but don't know how...</p> <pre><...
71,257,946
How to set a value on a specific page template in Gatsby<p>New to Gatsby and can't get past this issue. I created a new page and on that page I want to change a value that is used in template file for the logo. On page 'my-mobile-app.js' I need to use the 'pulse' logo. Ive added it to the export default below but how d...
<p>It's preferrable to export a named component (can be default) like:</p> <pre><code> export default function Logo ({ white, dark, pulse, ...props }) =&gt; { const logo = useStaticQuery(graphql` query { white: file(relativePath: { eq: &quot;logo/Logo-whitebg.png&quot; }) { ...
How to set a value on a specific page template in Gatsby
javascript|reactjs|gatsby
0
35
1
71,269,545
71,269,545
1
true
2022-02-24T20:34:28.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set a value on a specific page template in Gatsby<p>New to Gatsby and can't get past this issue. I created a new page and on that page I want to chang...
71,418,975
typescript - Property 'inputValues' does not exist on type 'IntrinsicAttributes & InputValueType[]<p>There is an error I get</p> <pre><code>TypeError: inputValues.map is not a function </code></pre> <p>In <code>&lt;InputGroup/&gt;</code>, it shows warning</p> <pre><code>Type '{ inputValues: InputValueType[]; }' is not ...
<p>You are considering the single attribute <code>inputValues</code> to be the whole prop object. In reality it is just one on of the keys of the prop object being passed.</p> <p>Usually one defines an interface for props and adds custom keys inside it to pass them down to child components.</p> <pre><code>import React,...
typescript - Property 'inputValues' does not exist on type 'IntrinsicAttributes & InputValueType[]
reactjs|typescript|next.js
0
35
3
71,419,129
71,419,129
1
true
2022-03-10T04:49:04.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: typescript - Property 'inputValues' does not exist on type 'IntrinsicAttributes & InputValueType[]<p>There is an error I get</p> <pre><code>TypeError: inputV...
71,251,192
C++ interpreting/mapping getch() output<p>Consider this program:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;string&gt; int main(int argc, char* argv[]) { std::string input; std::cin &gt;&gt; input; } </code></pre> <p>The user can input any string (or single char...
<p>The following code works:</p> <pre><code>// Code 1 (option 1) while (true) { const int key = _getch(); // Get the user pressed key (int) //const char translated = VkKeyScanA(key); std::cout &lt;&lt; char(key); // Convert int to char and then print it } // Code 2 (option 2) while (true) { const cha...
C++ interpreting/mapping getch() output
c++|io
0
41
1
71,251,296
71,251,296
1
true
2022-02-24T11:23:32.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ interpreting/mapping getch() output<p>Consider this program:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;...
71,157,615
timechart is crating stats which are not part of the search in splunk<p>I was extracting some volume data for PE testing from prod systems, using following query</p> <p>I am expecting to get stats from 9AM to 6PM event counts with respect to proxy names. but following code creating stats for entire day please help me t...
<p>The best way to narrow the time window is by using the <code>earliest</code> and <code>latest</code> options in the search command.</p> <p>To find the events between 9am and 6pm today:</p> <pre><code>index= index_Name environmentName= Env_name clientAppName=&quot;App_Name&quot; earliest=@d+9h latest=@d+18h | timecha...
timechart is crating stats which are not part of the search in splunk
splunk
0
267
1
71,161,456
71,161,456
1
true
2022-02-17T11:49:50.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: timechart is crating stats which are not part of the search in splunk<p>I was extracting some volume data for PE testing from prod systems, using following q...
71,095,358
How to collect a specific value from a text that is always a few lines below another text value?<p>To retrieve the values from the JSON file, I use this code:</p> <pre><code>import json json_file = json.load(open('Bla_Bla_Bla.json')) master_data = json_file['messages'] for unique_message in master_data: print(un...
<p>For more complex cases, you may want to look into Regular Expressions (Regex), but for this simple case:</p> <pre class="lang-py prettyprint-override"><code>string = unique_message[&quot;text&quot;] # the json data string = string[string.find(&quot;Total&quot;):] # cut all the part before &quot;Total&quot; string...
How to collect a specific value from a text that is always a few lines below another text value?
python|json
0
26
2
71,095,414
71,095,414
1
true
2022-02-12T19:53:33.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to collect a specific value from a text that is always a few lines below another text value?<p>To retrieve the values from the JSON file, I use this code...
71,205,085
Tensorflow - keras - shapes and loss for multilabel classification<pre><code>X_np_new.shape, y.shape ((50876, 2304), (50876, 9)) </code></pre> <p>Code:</p> <pre><code>from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Activation from tensorflow.keras.optimizers import S...
<p>Replace</p> <pre><code>model.add(Dense(X_np_new.shape[1], activation='sigmoid')) </code></pre> <p>With</p> <pre><code>model.add(Dense(y.shape[1], activation='sigmoid')) </code></pre> <p><strong>Explanation:</strong></p> <p>Putting <code>X_np_new.shape[1]</code> in the last layer means you have <code>2304</code> clas...
Tensorflow - keras - shapes and loss for multilabel classification
numpy|tensorflow|keras|tensorflow2.0
0
32
1
71,205,148
71,205,148
1
true
2022-02-21T10:55:51.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tensorflow - keras - shapes and loss for multilabel classification<pre><code>X_np_new.shape, y.shape ((50876, 2304), (50876, 9)) </code></pre> <p>Code:</p>...
71,102,150
Tkinter : Window not opening when incrementing value,<p>I'm making a BSOD simulator with a randomly progressing percentage. What i'm trying to do is :</p> <ol> <li>Make a variable called percentage and initialise it with a value of <code>0</code></li> <li>Make a label with the text <code>f&quot;{percentage}% completed...
<p>The <code>percentage</code> in <code>steps()</code> is <em>local</em> to that function.</p> <p>If you want it to increase the value of the global percentage, you should mark it at such:</p> <pre><code>def steps(): global percentage percentage += random.randint(1, 20) win.after(1000, steps) percentage...
Tkinter : Window not opening when incrementing value,
python|tkinter
0
24
1
71,102,305
71,102,305
1
true
2022-02-13T15:31:33.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tkinter : Window not opening when incrementing value,<p>I'm making a BSOD simulator with a randomly progressing percentage. What i'm trying to do is :</p> <...
71,162,491
Is there any difference in using React component as a (HTML tag)/ (JS function call)<p>I have a component, something like,</p> <pre><code>const ComponentA = ({ heading })=&gt; { return (&lt;h1&gt;{ heading }&lt;/h&gt;); }; </code></pre> <p>Is there any difference in rendering this component using below two options,</p...
<p>Yes. There is a very important difference. In option 1, <code>ComponentA</code> is not actually a component as far as React is concerned. In option 2 it is.</p> <p>The best way to illustrate the difference is to put state or another hook inside of <code>ComponentA</code>. Option 1 will not work as expected. (<strong...
Is there any difference in using React component as a (HTML tag)/ (JS function call)
reactjs
0
19
1
71,162,658
71,162,658
1
true
2022-02-17T17:09:08.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any difference in using React component as a (HTML tag)/ (JS function call)<p>I have a component, something like,</p> <pre><code>const ComponentA = ...
71,258,432
Git Rebase for feature X on feature Z after merge on staging<p>How to Rebase right for the following problem, is rebase the right Solution? We use rebase for default branching strategies and the only merge happens in MR normaly.</p> <pre><code> A--B--C (staging) \ D--E--F (x-feature) \ ...
<p>As described, everything will work just fine. <strong>Branches are just pointers to commits</strong> (they don't point to other branches), so when the <code>x-feature</code> branch is merged into the <code>staging</code> branch, the <code>y-feature</code> branch will still point to commit <code>I</code>, and <code>...
Git Rebase for feature X on feature Z after merge on staging
git|rebase
0
22
1
71,258,773
71,258,773
1
true
2022-02-24T21:25:00.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git Rebase for feature X on feature Z after merge on staging<p>How to Rebase right for the following problem, is rebase the right Solution? We use rebase for...
71,416,609
Generic Method not implicitly constructing Parameter Class as Subclass when deserializing PostRequestBody<pre><code> @PostMapping(&quot;&quot;) &lt;T extends FormEntity&gt; ServiceResponse newService(@RequestHeader(&quot;form-class&quot;)Class&lt;T&gt; clazz, @RequestBody @NotNull T genericFormEntity) { Se...
<p>If the content type of the request bodies is <code>application/json</code>, the following can be a simple solution.</p> <pre><code> @Autowired private ObjectMapper objectMapper; @PostMapping(&quot;...&quot;) public ServiceResponse newService(@RequestHeader(&quot;form-class&quot;) String fullyQualifi...
Generic Method not implicitly constructing Parameter Class as Subclass when deserializing PostRequestBody
java|spring|spring-boot
0
43
1
71,417,357
71,417,357
1
true
2022-03-09T22:15:52.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generic Method not implicitly constructing Parameter Class as Subclass when deserializing PostRequestBody<pre><code> @PostMapping(&quot;&quot;) &lt;T ex...
71,098,625
How to check specifications of a base64 image before upload for secure uploading<p>I am posting a base64 image with ajax to PHP...But I wanna check specs before move to image to folder...</p> <ol> <li>how to check if image is base64 image or not...</li> <li>how to check if image is larger than 1Mbyte...</li> </ol> <p>o...
<p>You can simply use:</p> <pre><code>strlen($_POST[&quot;base64image_1&quot;]) &lt;= 1048576 </code></pre> <p>to check the size of the image (1 KiB = 1024 Bytes)</p> <pre><code>base64_decode($_POST[&quot;base64image_1&quot;]) !== false; </code></pre> <p>to check the encoding.</p>
How to check specifications of a base64 image before upload for secure uploading
php
0
21
1
71,099,117
71,099,117
1
true
2022-02-13T07:13:33.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check specifications of a base64 image before upload for secure uploading<p>I am posting a base64 image with ajax to PHP...But I wanna check specs bef...
71,287,956
Reset controlled value of single individual input in form upon button click<p>My app gets initialized with a json payload of 'original values' for attributes in a task form. There is a shared state between various components through a context manager <code>submissionState</code> that also gets imported to this form com...
<p>I would highly recommend using <a href="https://react-hook-form.com/" rel="nofollow noreferrer">react-hook-form</a> if it's an option. I've implemented it across several projects and it has never let me down. If it's just not possible to use a library, then keep in mind that React is <em>usually</em> unidirectional....
Reset controlled value of single individual input in form upon button click
javascript|reactjs|typescript
0
37
1
71,288,368
71,288,368
1
true
2022-02-27T19:43:46.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reset controlled value of single individual input in form upon button click<p>My app gets initialized with a json payload of 'original values' for attributes...
71,123,405
hello guys I'm new to react I was trying to display my header component but it's not show<pre><code>import React from &quot;react&quot;; import &quot;./App.css&quot;; import header from &quot;./header&quot;; function App() { return ( &lt;div className=&quot;App&quot;&gt; &lt;h1&gt;My First React App&lt;/h1...
<p>Your components must have an initial capital letter, since lower-case names are considered to be HTML tags by React (or JSX in particular) (<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header" rel="nofollow noreferrer">and <code>&lt;header&gt;</code> is one, anyway</a>).</p> <p>Rename <code>hea...
hello guys I'm new to react I was trying to display my header component but it's not show
reactjs
0
21
1
71,123,442
71,123,442
1
true
2022-02-15T08:44:20.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: hello guys I'm new to react I was trying to display my header component but it's not show<pre><code>import React from &quot;react&quot;; import &quot;./App.c...
71,151,254
jQuery each and index function<p>I am having trouble getting this jQuery script to function:</p> <pre><code>$(document).on('knack-scene-render.scene_126', function() { $('#view_498 &gt; div.kn-list-content.columns.is-multiline').each(function(index) { if ($(this).eq(index).find('.field_744 .kn-detail-body')....
<p>Within the <code>.each()</code> callback, <code>this</code> refers to the current iteration element. You don't need <code>.eq(index)</code>. After the first iteration, <code>.eq(index)</code> was returning an empty set</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false...
jQuery each and index function
javascript|jquery
0
25
1
71,151,323
71,151,323
1
true
2022-02-17T01:07:49.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery each and index function<p>I am having trouble getting this jQuery script to function:</p> <pre><code>$(document).on('knack-scene-render.scene_126', fu...
71,331,193
How can i render only first image from my array of objects?<p>I have an array of objects which contain products details. On the object, there is an images array of objects property where all the images with id are there. <strong>I am trying to render only the first image from that array of objects.</strong> I have trie...
<p>You don't need to map at all. Just directly refer to the <code>0</code> indexed element's <code>src</code> property</p> <pre class="lang-tsx prettyprint-override"><code>{products.map(product =&gt; ( &lt;tr&gt; &lt;td className=&quot;px-5 py-5 border-b border-gray-200 bg-white text-sm&quot;&gt; &lt;div cl...
How can i render only first image from my array of objects?
javascript|arrays|reactjs|javascript-objects|react-typescript
0
270
1
71,331,214
71,331,214
1
true
2022-03-03T01:46:01.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i render only first image from my array of objects?<p>I have an array of objects which contain products details. On the object, there is an images ar...
71,251,008
Passing current input value to parent compnent<p>I'm struggling with the search filter. Im trying to lift up my input state to app component. Navbar component with searchbar is rendered in App.</p> <p>so:</p> <pre><code> &lt;input placeholder=&quot;Search...&quot; type=&quot;text&quot; ...
<p>in searchHandler function, you call searchFilter before your state is set. you have two options:</p> <p>1)</p> <pre><code>const searchHandler = (e) =&gt; { searchFilter(e.target.value) } </code></pre> <ol start="2"> <li><p>use useEffect:</p> <pre><code> useEffect(() =&gt; { searchFilter(inputText) ...
Passing current input value to parent compnent
reactjs
0
16
1
71,251,205
71,251,205
1
true
2022-02-24T11:07:34.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing current input value to parent compnent<p>I'm struggling with the search filter. Im trying to lift up my input state to app component. Navbar compone...
71,149,566
How to convert RabbitMQ Messages into object list in c#<p>I am publishing json messages into a queue in rabbitmq and it is workin properly. But facing an issue that i want to consume all data in the issued queue (as a chat app) and i have to use all messages.</p> <p>For example I have 9 items in the queue as below</p> ...
<p>It seems to me that your function <code>GetMessageFromQueue</code> is going through the motions of setting everything up, but then <strong>exiting</strong> from the function straight away without waiting for your <code>Received</code> function to collect all the messages.</p> <p>So for example, this the the inline f...
How to convert RabbitMQ Messages into object list in c#
c#|rabbitmq|message-queue|amqp
0
772
1
71,197,362
71,197,362
1
true
2022-02-16T21:35:18.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert RabbitMQ Messages into object list in c#<p>I am publishing json messages into a queue in rabbitmq and it is workin properly. But facing an iss...
71,393,059
Iterate through divs, grab text and append to href as parameter<p>I have a number of repeating divs on a page and am trying to iterate through them, grab the text in 'contentBlock-heading', and finally append it to the existing href hyperlink. For each href, the end result should look as follows: 'community-chat/regist...
<pre class="lang-js prettyprint-override"><code>$( document ).ready(function() { $('.contentBlock-content').each(function() { var ccdatedesc = $(this).children(&quot;.contentBlock-heading&quot;).html(); $(this).find('a').attr('href', function(index, attr) { return attr + (attr.indexOf('?') &gt;=0 ? '&...
Iterate through divs, grab text and append to href as parameter
jquery
0
22
1
71,393,378
71,393,378
1
true
2022-03-08T09:58:07.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterate through divs, grab text and append to href as parameter<p>I have a number of repeating divs on a page and am trying to iterate through them, grab the...
71,246,948
Confusion on Memory Layout vs Memory Management Schemes<p>I was studying some operating system concepts, got a bit confused, and now have the following question...</p> <p>Does the memory layout of a program in execution (ie. text, data, stack, heap) only make sense in context of it's virtual address space? If a program...
<blockquote> <p>Does the memory layout of a program in execution (ie. text, data, stack, heap) only make sense in context of it's virtual address space? If a program is organized (&quot;laid&quot; out) into these logical sections in it's virtual address space, don't these sections just get messed up as soon as addresse...
Confusion on Memory Layout vs Memory Management Schemes
memory
0
30
1
71,247,047
71,247,047
1
true
2022-02-24T03:59:25.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confusion on Memory Layout vs Memory Management Schemes<p>I was studying some operating system concepts, got a bit confused, and now have the following quest...
71,146,628
oracle field combination<p>I am making a query to a table, where I am interested in bringing the contract numbers that are being repeated, and for this I use partition by, and so far everything is fine. However, I require that you only bring me those contract numbers that in the &quot;CAMPO&quot; field meet a combinati...
<p>You can use the DISTINCT keyword with the COUNT function to get the desired result -</p> <pre><code>with temp as (select gral.contrato, gral.campo, count(CAMPO) OVER (partition by gral.contrato, campo) as counter count(DISTINCT CAMPO) OVER (partition by...
oracle field combination
sql|database|oracle
0
30
1
71,154,895
71,154,895
1
true
2022-02-16T17:34:29.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: oracle field combination<p>I am making a query to a table, where I am interested in bringing the contract numbers that are being repeated, and for this I use...
71,367,719
How to find if a method belongs to super or - Extending Array and Testing with ES6<p>I'm new to OOP in ES6 and trying to understand how to extend Array so i can create pipelines. I'm starting with a simple case of extending <code>Array</code> ad overriding <code>Array.filter</code>, and expecting <code>result.hasOwnPro...
<p>The misunderstanding is about how <code>.hasOwnProperty()</code> works. This returns a boolean that indicates whether an object directly contains a specific property. In your case, you are defining a property for the class which puts the new <code>.filter()</code> property on the object's prototype which means tha...
How to find if a method belongs to super or - Extending Array and Testing with ES6
javascript|unit-testing|oop|ecmascript-6|es6-class
0
37
1
71,367,754
71,367,754
1
true
2022-03-06T04:39:03.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find if a method belongs to super or - Extending Array and Testing with ES6<p>I'm new to OOP in ES6 and trying to understand how to extend Array so i ...
71,402,730
NodeJS Running through file by steams<p>I'm trying to read through a file using a stream. The file is a custom file format that has some number of sections, each being 66 bytes. I have to check the value of the the first 32 bytes against a given 32 bytes, and if they match return the remaining 34 bytes. Currently I'm d...
<p>Streams are non-blocking and asynchronous. They call their event handlers some time in the future, after your <code>check()</code> function has returned. That is how they work.</p> <p>As such, you cannot directly return your result from the function because the function returns before the result is known. Instead...
NodeJS Running through file by steams
javascript|node.js
0
33
1
71,402,804
71,402,804
1
true
2022-03-08T23:39:36.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS Running through file by steams<p>I'm trying to read through a file using a stream. The file is a custom file format that has some number of sections, ...
71,230,126
How to trigger re-render in Parent Component from Child Component<p>, Using props I was able to effectively pass state upwards from my child component to its parent, but a change in the state does not cause a re-render of the page.</p> <pre><code>import React, { useState } from &quot;react&quot;; export default functi...
<h2>Updated Answer (Following Edits To Original Question)</h2> <p>In light of your edits, the problem is that you are mutating and passing the original array in state back into itself-- React sees that it is receiving a reference to the same object, and does not update. Instead, spread <code>text</code> into a new dup...
How to trigger re-render in Parent Component from Child Component
javascript|reactjs
0
39
1
71,230,238
71,230,238
1
true
2022-02-23T00:53:43.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trigger re-render in Parent Component from Child Component<p>, Using props I was able to effectively pass state upwards from my child component to its...
71,185,742
How to toggle the case of individual words in sentences displayed in HTML form input boxes by double clicking them?<p>Double clicking a word in a sentence in an HTML form input box will highlight that word. I want each double click to toggle the case of the highlighted word between lower and upper case.</p> <pre><code>...
<p>Here is a simple HTML + pure JS solution.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let content = document.getElementById("content"); content.addEventListener("dblclic...
How to toggle the case of individual words in sentences displayed in HTML form input boxes by double clicking them?
javascript|jquery|forms|field|coldfusion-11
0
22
1
71,186,306
71,186,306
1
true
2022-02-19T14:08:20.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to toggle the case of individual words in sentences displayed in HTML form input boxes by double clicking them?<p>Double clicking a word in a sentence in...
71,165,116
How do I exclude my break statement from this list?<p>Beginner coder here trying to get past a challenge. I'm trying to write a program that prompts the user for a list of numbers and then prints the maximum and minimum values from that list. I realize that there are built in functions to do this in Python but I have d...
<p>You want to move the line <code>nums.append(num)</code> so that it goes right after the line <code>value = int(num)</code> and then edit it so that it reads <code>nums.append(value)</code> instead.</p> <p>Currently, you are appending the input <code>num</code> to the list before checking to see if it is really the s...
How do I exclude my break statement from this list?
python|python-3.x
0
43
1
71,165,143
71,165,143
1
true
2022-02-17T20:42:07.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I exclude my break statement from this list?<p>Beginner coder here trying to get past a challenge. I'm trying to write a program that prompts the user...
71,310,175
How to assign state object to a different object when creating a reducer<p>In my <code>userSlice.js</code> file I've got the following:</p> <pre class="lang-js prettyprint-override"><code>import { createSlice } from &quot;@reduxjs/toolkit&quot;; const initialState = { Id: 0, FirstName: &quot;-&quot;, LastN...
<p>It seems you cannot do that this way because of internal implementation of slices in redux-toolkit. It uses Immer to track changes applied in reducers: (read more here <a href="https://redux-toolkit.js.org/usage/immer-reducers#immutable-updates-with-immer" rel="nofollow noreferrer">https://redux-toolkit.js.org/usag...
How to assign state object to a different object when creating a reducer
redux|react-redux
0
276
1
71,310,432
71,310,432
1
true
2022-03-01T14:39:02.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign state object to a different object when creating a reducer<p>In my <code>userSlice.js</code> file I've got the following:</p> <pre class="lang-...
71,365,613
Step to Next Branching Instruction in GDB<p>Is there a way to continue execution until a branching instruction is reached in GDB? Much like the WinDbg &quot;ph&quot; command. If not, can it be scripted in Python?</p>
<p>I finally came across this question: <br> <a href="https://stackoverflow.com/questions/34621532/does-gdb-have-a-step-to-next-call-instruction">Does GDB have a &quot;step-to-next-call&quot; instruction?</a></p> <p>I was able to modify the code there to create my own &quot;ph&quot; command:</p> <pre class="lang-py pre...
Step to Next Branching Instruction in GDB
gdb
0
39
1
71,372,846
71,372,846
1
true
2022-03-05T20:08:27.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Step to Next Branching Instruction in GDB<p>Is there a way to continue execution until a branching instruction is reached in GDB? Much like the WinDbg &quot;...
71,187,930
I created a small form but the if / else structure hangs on the second try<p>I have a form that calculate the age of a person. I written two function. the first do the calculation and the second returns some if/else statement. I have a problem with the if/else statement. Whatever the age of the person, JS always return...
<p>So one problem was the use of the same name for a variable and a function. The other problem was the fact that you didnt create conditions with &quot;limits&quot;.</p> <p>For example imagine that the age its 60, this number its bigger or equal to 29, so it will it true on this else if and will enter on it. So you ne...
I created a small form but the if / else structure hangs on the second try
javascript|forms|if-statement|calculator
0
14
1
71,188,027
71,188,027
1
true
2022-02-19T18:29:44.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I created a small form but the if / else structure hangs on the second try<p>I have a form that calculate the age of a person. I written two function. the fi...
71,129,464
Strange line connection using ggplot geom_line colours<p>A problem occurs when i add a colour(gradient) into the aesthetics of geom_line. It seems that the dots are no longer connected by a line but instead transformed into squares, which messes up the plot. Does anyone have an idea how to solve this problem or if this...
<p>Adjusting the <code>lineend</code> parameter should do it, which has a default of &quot;square&quot;. The reason the uncolored version looks okay is that in those cases the segments are treated as continuations of the same series, so they are governed then by the <code>linejoin</code> parameter, which has a default ...
Strange line connection using ggplot geom_line colours
r|ggplot2
0
45
1
71,129,708
71,129,708
1
true
2022-02-15T15:53:46.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Strange line connection using ggplot geom_line colours<p>A problem occurs when i add a colour(gradient) into the aesthetics of geom_line. It seems that the d...
71,237,714
If x Exceptions in Given Timeframe<p>I am currently using a counter to flag when 5 exceptions have been raised. Once the threshold is met the script notifies me by sending a Telegram message.</p> <p>This works ok but I want to introduce a timeframe criteria so that a message is only send if 5 exceptions have been raise...
<p>I suggest that you simply keep a list of time stamps of the last 5 exceptions. In that case you don't even need the variable <code>count</code>, unless you specifically want to know how many exceptions have occured in total. Instead, make sure that the list only ever contains the latest 5 exceptions and then compare...
If x Exceptions in Given Timeframe
python
0
41
3
71,238,232
71,238,232
1
true
2022-02-23T13:21:14.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If x Exceptions in Given Timeframe<p>I am currently using a counter to flag when 5 exceptions have been raised. Once the threshold is met the script notifies...
71,109,460
Creating and updating Model object using form<p>models.py <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>class PostModel(models.Model): user = models.ForeignKey(User, on_delete=m...
<p>The problem is the first 2 lines in the view</p> <pre><code>post = PostModel(user=request.user) post.save() </code></pre> <p>As they create a PostModel obj with user=currentuser</p> <p>To add the post to the user do the following rather than <code>form.save()</code></p> <pre><code>post = form.save(commit=False) post...
Creating and updating Model object using form
python|django|forms|django-models
0
32
1
71,109,516
71,109,516
1
true
2022-02-14T09:15:19.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating and updating Model object using form<p>models.py <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
71,394,940
Pushing Distinct Values to Array and Finding New Length<p>Trying to sort and push only the distinct values into a new array and then find the length of the resulting array. See code below. The UniqueTeams.length is coming out to be 1, when it should be 5 (I thought).</p> <pre><code> var teams = [[formSS.getRange(&quot;...
<h3>Get unique elements</h3> <pre><code>function remdup() { const ss = SpreadsheetApp.getActive(); const sh = ss.getActiveSheet(); const t = sh.getRange('F8:F16').getValues().flat(); let teams = [t[0], t[2], t[4], t[6], t[8]]; let s = new Set(teams) teams = [...s]; Logger.log(teams.join(',')) } </code></p...
Pushing Distinct Values to Array and Finding New Length
arrays|google-apps-script
0
31
2
71,399,471
71,399,471
1
true
2022-03-08T12:18:21.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pushing Distinct Values to Array and Finding New Length<p>Trying to sort and push only the distinct values into a new array and then find the length of the r...
71,159,094
alternately flatten values of nested list<p>Is there a way to flatten values of a nested list but alternately?</p> <p>example:</p> <pre><code>nested_list = [[1, 3, 5], [2, 4]] </code></pre> <p>my expected output would be:</p> <pre><code>[1, 2, 3, 4, 5] </code></pre>
<p>You can do it without numpy using iterators and keep track when the list stops growing:</p> <pre><code>nested_list = [[1, 3, 5], [2, 4]] # create a list of iterators per sublists k = [iter(sublist) for sublist in nested_list] # collect values res = [] # choose a value thats not inside your lists sentinel = None ...
alternately flatten values of nested list
python|python-3.x|list
0
33
2
71,159,548
71,159,548
1
true
2022-02-17T13:31:54.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: alternately flatten values of nested list<p>Is there a way to flatten values of a nested list but alternately?</p> <p>example:</p> <pre><code>nested_list = [...
71,212,889
Animate points with matplotlib<p>I want to have 10 moving points. I used the code below. I'm experimenting with <code>matplotlib</code> which I don't know very well.</p> <pre><code>from matplotlib import pyplot as plt import numpy as np from matplotlib import animation fig = plt.figure() ax = fig.add_subplot(projectio...
<p>For a start, you place your animation object <code>anim</code> into the loop, so not only the <code>point</code> data but also the animation object is repeatedly overwritten. For ease of use, let's put the data points into numpy arrays, where rows represent the time and columns the different points you want to anima...
Animate points with matplotlib
python|matplotlib|animation|3d
0
286
1
71,214,435
71,214,435
1
true
2022-02-21T20:52:11.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Animate points with matplotlib<p>I want to have 10 moving points. I used the code below. I'm experimenting with <code>matplotlib</code> which I don't know ve...
71,186,066
iterate throug array with removed elements by splice vs filter<p>Can somebody explain to me why the output is different? I remove one element in both cases so why does the for loop make a difference between splice and reasigning the value?</p> <p>filter:<br /> 1 2 3 4 5</p> <p>splice:<br /> 1 2 3 5</p> <p><div class="s...
<p>Please refer below piece of code.</p> <p>Here the arr is part of the iterator, and you are changing the array within the for loop, but the iterator will be referring to memory location of arr.</p> <p>But, you just assigned different location/memory to arr variable, but the iterator is still referring to old memory/l...
iterate throug array with removed elements by splice vs filter
javascript
0
33
1
71,187,251
71,187,251
1
true
2022-02-19T14:49:30.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iterate throug array with removed elements by splice vs filter<p>Can somebody explain to me why the output is different? I remove one element in both cases s...
71,385,363
How can I set a pandas dataframe with the first value is what stays?<p>I got the following table with repeated values per person:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Customer</th> <th>Jan</th> <th>Feb</th> <th>Mar</th> <th>Apr</th> <th>Jun</th> <th>Jul</th> </tr> </thead> <tbody...
<p>You could <code>mask</code> the duplicate values:</p> <pre><code>out = (df.mask(df.apply(lambda x: x.duplicated(), axis=1)).fillna('')) </code></pre> <p>Output:</p> <pre><code> Customer Jan Feb Mar Apr Jun Jul 0 Adam 345.0 1 Susan 645.0 2 Pau...
How can I set a pandas dataframe with the first value is what stays?
python|pandas|dataframe|data-wrangling
0
43
1
71,385,405
71,385,405
1
true
2022-03-07T17:57:33.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I set a pandas dataframe with the first value is what stays?<p>I got the following table with repeated values per person:</p> <div class="s-table-con...
71,318,764
Most Efficient way to organize database with data for seperate organizations<p>So this is more of a theoretical question. I am fairly new to databases, but here is my issue. I have a website which has users which will be divided up into different organizations. These organizations have nothing to do with each other, wo...
<p>You basically have two options.</p> <p>1#: Hold everthing in one database, add additional fields to your tables and some logic to deceide who has access to what. Cons: That will be a mess, Pros: you will have less issues when transferring data from one organization to another.</p> <p>2#: Create a fresh new database ...
Most Efficient way to organize database with data for seperate organizations
database|sqlite
0
39
1
71,318,841
71,318,841
1
true
2022-03-02T07:17:04.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most Efficient way to organize database with data for seperate organizations<p>So this is more of a theoretical question. I am fairly new to databases, but h...
71,141,914
Drop schemas based on pattern match in Snowflake<p>What is the best way to drop all schemas with a user-specified prefix from a database in Snowflake (ANSI SQL)?</p> <p>Suppose you have a database called <code>ANALYTICS</code> and within that database there are multiple schemas such as: <code>dev_bob_schema1</code>, <c...
<p>I would do the following:</p> <ol> <li><code>USE DATABASE ...</code></li> <li><code>show schemas like ...</code></li> <li><code>SELECT 'DROP SCHEMA ' || &quot;name&quot; || ';' FROM table(result_scan(last_query_id()));</code></li> </ol> <p>Paste the output back into a worksheet and run it.</p>
Drop schemas based on pattern match in Snowflake
sql|snowflake-cloud-data-platform
0
262
2
71,142,323
71,142,323
1
true
2022-02-16T12:30:40.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Drop schemas based on pattern match in Snowflake<p>What is the best way to drop all schemas with a user-specified prefix from a database in Snowflake (ANSI S...
71,275,715
Centos 7.2 php 7.3 - Unable to load dynamic library 'gd'<p>I installed php-gd and then check if is installed like this</p> <pre><code>[root@LP01-Dev ~]# php -v // checking before installing gd PHP 7.3.33 (cli) (built: Nov 16 2021 11:18:28) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.33, ...
<blockquote> <p>Centos 7.2 php 7.3</p> </blockquote> <p>The main issue here is that you are using an outdated CentOS version:</p> <ul> <li>7.2 was released in 2015... and is no more maintained</li> <li>7.9 is current, released in 2020</li> </ul> <p>So you need to update to current first (especially as you are missing <...
Centos 7.2 php 7.3 - Unable to load dynamic library 'gd'
php|centos7|php-gd
0
541
1
71,277,552
71,277,552
1
true
2022-02-26T10:04:32.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Centos 7.2 php 7.3 - Unable to load dynamic library 'gd'<p>I installed php-gd and then check if is installed like this</p> <pre><code>[root@LP01-Dev ~]# php ...
71,411,062
How to make Angular components and services more DRY?<p>I find myself running into the same problem in all of my Angular applications and I'm having the hardest time knowing what to Google for a solution.</p> <p>The problem: I feel like I write a lot of components and services that do VERY similar things but I can't qu...
<p>Looks like candidate and employee shares common factor, which is a &quot;beeing a person&quot; . You can extract common &quot;person&quot; component to display details of both of them. Also you could use <code>&lt;ng-content&gt;</code> or <code>&lt;ng-template&gt;</code> in some <code>app-person</code> component to ...
How to make Angular components and services more DRY?
angular|dry
0
43
1
71,411,135
71,411,135
1
true
2022-03-09T14:37:13.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make Angular components and services more DRY?<p>I find myself running into the same problem in all of my Angular applications and I'm having the hard...
71,394,979
Oracle SQL - Return modified records, problem with ordering when joining<p>I need to return rows for child <em>p_id</em> ( parent is <em>p_id</em> = 10 and child = 20) which were changed.</p> <p>I'm using something like below in link, but its ordering incorrectly so I'm getting wrong results. It would be easier to expl...
<p>I wasn't sure how to tell if a record was changed but looks like something like that?</p> <pre><code>select distinct c.* from child_gtt c, parent_gtt p where p.l_id = c.l_id and not exists ( select 1 from parent_gtt x where c.l_id = x.l_id and c.date_from = x.date_from and c.date_to = x.date_to); </co...
Oracle SQL - Return modified records, problem with ordering when joining
sql|oracle|join
0
39
1
71,395,223
71,395,223
1
true
2022-03-08T12:21:20.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle SQL - Return modified records, problem with ordering when joining<p>I need to return rows for child <em>p_id</em> ( parent is <em>p_id</em> = 10 and c...
71,323,983
how can I make a child of a div with display:flex, scroll down in small resolution?<p>I have a container with <code>display:flex</code>, and I have 3 children. I want that when the text of the first div does not occupy a single line:</p> <p><a href="https://i.stack.imgur.com/l3uuk.png" rel="nofollow noreferrer"><img s...
<p>this is achievable using <code>flex-wrap</code>, <code>flex-shrink</code> and <code>flex-grow</code>, you can read more about it <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="nofollow noreferrer">here</a> (recommended).</p> <p>here is an example; you should tweak it so it will fit your needs...
how can I make a child of a div with display:flex, scroll down in small resolution?
css
0
22
1
71,324,278
71,324,278
1
true
2022-03-02T13:59:33.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I make a child of a div with display:flex, scroll down in small resolution?<p>I have a container with <code>display:flex</code>, and I have 3 childre...
71,369,968
FlatList conditional rendering if {user === owner || gues}<p>In my Applikation I render a <a href="https://docs.expo.dev/versions/latest/react-native/flatlist/" rel="nofollow noreferrer">Expo FlatList</a> to show created Events.</p> <p><a href="https://i.stack.imgur.com/Q1gAn.jpg" rel="nofollow noreferrer"><img src="ht...
<p>You can filter the events data before setting it to the state</p> <p>I am assuming, events have a <code>owner</code> property which is the userId, it has an array of userIds in <code>guests</code> property</p> <pre><code>loadEventsFromFirebase() { let data = [] this.querySnapshot.then(querySnapshot =&gt; { ...
FlatList conditional rendering if {user === owner || gues}
javascript|firebase|react-native|expo|react-native-flatlist
0
40
1
71,370,037
71,370,037
1
true
2022-03-06T11:45:30.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FlatList conditional rendering if {user === owner || gues}<p>In my Applikation I render a <a href="https://docs.expo.dev/versions/latest/react-native/flatlis...
71,276,368
Python3: print respective x and y coordinate of a NumPy array<p>Let's say I have a Python script like that</p> <pre class="lang-py prettyprint-override"><code>import numpy as np positions = np.array([[2.5, 8], [3, 10], [0, 5], [1, 5]]) x = positions[:, 0] y = positions[:, 1] def isInside(circle_x, circle_y, rad, x, y)...
<p>If you are interested in getting the x,y coordinates as well as checking to be inside or outside of the area, you can change your function to return a tuple that contains 3 values: <code>x,y, boolean</code>. I have edited your code and come up with the code below:</p> <pre class="lang-py prettyprint-override"><code>...
Python3: print respective x and y coordinate of a NumPy array
python|python-3.x|numpy|numpy-ndarray
0
266
2
71,276,494
71,276,494
1
true
2022-02-26T11:46:47.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python3: print respective x and y coordinate of a NumPy array<p>Let's say I have a Python script like that</p> <pre class="lang-py prettyprint-override"><cod...
71,271,425
R Manipulating List of Lists With Conditions / Joining Data<p>I have the following data showing 5 possible kids to invite to a party and what neighborhoods they live in.</p> <p>I have a list of solutions as well (binary indicators of whether the kid is invited or not; e.g., the first solution invites Kelly, Gina, and P...
<p>I wrote a little function to check each solution and return <code>TRUE</code> or <code>FALSE</code> based on your requirements. Passing your <code>solutions</code> to this using <code>sapply()</code> will give you a logical vector, with which you can subset <code>solutions</code> to retain only those that met the re...
R Manipulating List of Lists With Conditions / Joining Data
r|join|binary|data-manipulation|linear-programming
0
42
1
71,271,661
71,271,661
1
true
2022-02-25T20:32:10.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Manipulating List of Lists With Conditions / Joining Data<p>I have the following data showing 5 possible kids to invite to a party and what neighborhoods t...
71,392,013
typesafe joins in spark for 3.x<p>In old versions of Spark 3.x</p> <pre><code>import org.apache.calcite.sql.JoinType </code></pre> <p>Calcite was exposed. That meant a JOIN could not only be executed in a strongly typed fashion for dataframes (notice I do not mean datasets) by feeding: <code>JoinType.LEFT.name</code>.<...
<pre><code>import org.apache.hadoop.hive.ql.parse.JoinType </code></pre> <p>seems to do the trick</p>
typesafe joins in spark for 3.x
apache-spark|apache-spark-sql|dependencies|apache-calcite
0
43
1
71,392,162
71,392,162
1
true
2022-03-08T08:29:31.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: typesafe joins in spark for 3.x<p>In old versions of Spark 3.x</p> <pre><code>import org.apache.calcite.sql.JoinType </code></pre> <p>Calcite was exposed. Th...
71,094,548
PostgreSQL - Delete last item of JSONB array<p>I have a field that holds JSONB arrays. How can I delete the last item?</p> <pre><code>[ { &quot;name&quot;: &quot;test1&quot;, }, { &quot;name&quot;: &quot;test2&quot;, }, ] </code></pre>
<p>You can use <code>jsonb_column - (-1)</code>. See <a href="https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE" rel="nofollow noreferrer">the documentation</a>.</p> <hr /> <pre><code>WITH data(j) AS ( VALUES ('[ { &quot;name&quot;: &quot;test1&quot; }, {...
PostgreSQL - Delete last item of JSONB array
sql|postgresql
0
44
1
71,095,023
71,095,023
2
true
2022-02-12T18:08:10.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgreSQL - Delete last item of JSONB array<p>I have a field that holds JSONB arrays. How can I delete the last item?</p> <pre><code>[ { &quot;name&qu...
71,097,546
What to set as the Provider's value using react typescript<p>I'm trying to learn how to use hooks and context in React, but need to work with TypeScript (new to that as well).</p> <p>I am confused about what to set provider value on my below code. I have created a hook useFirebase it will return some functions like Reg...
<p>The problem is in</p> <pre><code>export const AuthContext = createContext(null) </code></pre> <p>You need to pass a proper type to it, so it won't complain when trying to assign any value.</p> <p>Try something like</p> <pre><code> React.createContext&lt;IAuth&gt;(initialValue); </code></pre> <p>For a more detailed ...
What to set as the Provider's value using react typescript
javascript|typescript|react-typescript|react-context
0
517
1
71,097,646
71,097,646
2
true
2022-02-13T03:01:45.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What to set as the Provider's value using react typescript<p>I'm trying to learn how to use hooks and context in React, but need to work with TypeScript (new...
71,097,852
Combining pandas dataframes according to other dataframes<p>Right now, I have 3 pandas dfs that I want to combine. Below is a short version of what I'm working with. Basically, dfs 2 and 3 have the indices that correspond to df1. I want to create another column on the first df that has the labels I want according to th...
<p>Try:</p> <pre><code>m = pd.concat([df2, df3], axis=1).stack().reset_index().set_index(0)['level_1'] df1['Animal Type'] = df1['Animal Number'].map(m) print(df1) </code></pre> <p>Output:</p> <pre><code> Animal Number Animal Type 0 2 Lions 1 4 Tigers 2 6 Tigers 3...
Combining pandas dataframes according to other dataframes
python|arrays|pandas|dataframe
0
21
1
71,097,921
71,097,921
2
true
2022-02-13T04:10:28.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining pandas dataframes according to other dataframes<p>Right now, I have 3 pandas dfs that I want to combine. Below is a short version of what I'm worki...
71,101,624
I am trying to open custom chrome tab from nested recycler view but couldn't having error Calling startActivity() from outside of an Activity<p>Here is the code I am using to open the custom chrome tab</p> <pre><code>val builder = CustomTabsIntent.Builder() val customTabsIntent = builder.build() ...
<p>Earlier I didn't know how to <code>addFlags()</code> to this but now the code looks like this</p> <pre><code>val builder = CustomTabsIntent.Builder() val customTabsIntent = builder.build() customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) customTabsIntent...
I am trying to open custom chrome tab from nested recycler view but couldn't having error Calling startActivity() from outside of an Activity
java|android|kotlin|android-recyclerview|nestedrecyclerview
0
41
1
71,101,826
71,101,826
2
true
2022-02-13T14:33:07.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am trying to open custom chrome tab from nested recycler view but couldn't having error Calling startActivity() from outside of an Activity<p>Here is the c...
71,093,673
Pausing entire container when concurrency is greater than 1<p>When we are using a container with concurrency greater than 1, and wish to pause all the child containers, can we pause directly using:</p> <pre><code>MessageListenerContainer mlc= registry.getListenerContainer(&lt;id&gt;); mlc.pause(); </code></pre> <p>Or d...
<p>If you're using <code>@KafkaListener(id = &quot;your-id&quot;,...)</code> for your method, it will be registered as an instance of <code>ConcurrentMessageListenerContainer</code>. So when you call <code>mlc.pause()</code>, it actually is <code>ConcurrentMessageListenerContainer#pause</code>, you <strong>don't</stron...
Pausing entire container when concurrency is greater than 1
spring|apache-kafka|spring-kafka
0
36
1
71,102,287
71,102,287
2
true
2022-02-12T16:24:48.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pausing entire container when concurrency is greater than 1<p>When we are using a container with concurrency greater than 1, and wish to pause all the child ...
71,102,035
Is it required to define doNothing()/when() on Objects mocked using Mockito<p>I am writing unit tests using JUnit5 and Mockito for a class <code>Main.java</code>.</p> <p>The dependency class <code>ExternalApi.java</code> is injected in <code>Main.java</code>.</p> <p>Here is my <code>MainTest.java</code>:</p> <pre><code...
<p>Nothing happens.Mocking is enough since it's not the real class/method that is called but the mocked one.</p> <p>If you had spyed on the instance, that would have triggered the real method call. Only then, you'd think of using <code>doNothing</code> to silence the method behavior.</p> <pre class="lang-js prettyprint...
Is it required to define doNothing()/when() on Objects mocked using Mockito
java|mockito|junit5
0
527
1
71,102,529
71,102,529
2
true
2022-02-13T15:18:19.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it required to define doNothing()/when() on Objects mocked using Mockito<p>I am writing unit tests using JUnit5 and Mockito for a class <code>Main.java</c...
71,105,365
SwiftUI getby UUID<p>I'm pretty new to SwiftUI so I'm hoping someone can help me out here. I have a UUID and I am trying to save content into that specific object, but I do not know how to call the object, like with a getbyid or something.</p> <pre><code>struct Game: Identifiable, Codable { let id: UUID var tit...
<p>You can use the <code>firstIndex(of:)</code> method to get the position of the first element of the array that matches <code>playerID</code>.</p> <p>You can try this:</p> <pre><code>func saveScoreToPlayer(game: Game, playerID: Game.Player.ID, score: Int32) { if let index = game.players.firstIndex(where: { $0.id ...
SwiftUI getby UUID
ios|swiftui|uuid
0
279
2
71,105,560
71,105,560
2
true
2022-02-13T22:23:24.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI getby UUID<p>I'm pretty new to SwiftUI so I'm hoping someone can help me out here. I have a UUID and I am trying to save content into that specific o...
71,106,372
passing key and value from a list of values to a function in a loop<p>I have a dictionary:</p> <pre><code>my_dict = { &quot;port1&quot;:[&quot;red&quot;,&quot;chevy&quot;], &quot;port2&quot;:[&quot;orange&quot;,&quot;ford&quot;], &quot;port3&quot;:[&quot;black&quot;,&quot;thunderbird&qu...
<p>If you know which element in the list you want to pass as each argument to the function then you could do this:</p> <pre><code>my_func(port, color, model): do cool stuff for key, values in my_dict.items(): my_func(key, values[0], values[1]) </code></pre>
passing key and value from a list of values to a function in a loop
python|python-3.x
0
20
1
71,106,410
71,106,410
2
true
2022-02-14T01:45:32.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: passing key and value from a list of values to a function in a loop<p>I have a dictionary:</p> <pre><code>my_dict = { &quot;port1&quot;:[&quot;red...
71,106,806
SQL - Why am I getting an ORA-00918 Error? I defined a column that's duplicated<p>I'm trying to complete an exercise for an assignment for my Database Programming class using Oracle LiveSQL. I defined the column that appears in each of the 2 tables that are accessed. I do not understand why I'm getting the error. Where...
<p>In general, whatever columns appear in the <code>SELECT</code> clause must also appear in <code>GROUP BY</code>, unless those columns appear inside aggregate functions. Consider using this version:</p> <pre class="lang-sql prettyprint-override"><code>SELECT c.customer_id, c.cust_email, COUNT(o.order_id...
SQL - Why am I getting an ORA-00918 Error? I defined a column that's duplicated
sql|oracle|ora-00918
0
25
1
71,106,825
71,106,825
2
true
2022-02-14T03:17:43.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - Why am I getting an ORA-00918 Error? I defined a column that's duplicated<p>I'm trying to complete an exercise for an assignment for my Database Progra...
71,106,856
I have an string and i want to delete from a specific character to the end of the string in JavaScript<p>i have this string =&gt; <code>someRandomText&amp;ab_channel=thisPartCanChange</code> and i want to delete all from <code>&amp;</code> (inclusive) to the end [this part: <code>&amp;ab_channel=thisPartCanChange</code...
<p>You van try something like:</p> <pre class="lang-js prettyprint-override"><code>console.log(&quot;someRandomText&amp;ab_channel=thisPartCanChange&quot;.split(&quot;&amp;&quot;)[0]) </code></pre>
I have an string and i want to delete from a specific character to the end of the string in JavaScript
javascript|string
0
32
4
71,106,878
71,106,878
2
true
2022-02-14T03:26:13.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have an string and i want to delete from a specific character to the end of the string in JavaScript<p>i have this string =&gt; <code>someRandomText&amp;ab...
71,106,708
How to correctly pass IconData as and argument to a custom widget<p>I have a custom wrapper around the TextFormField widget, I want to be able to pass in a material Icon as an argument to the constructor. However, when trying to pass the IconData into the Icon constructor I get an error: <em><strong>Arguments of consta...
<p>You're passing icondata correctly. The error is telling you the that prefixicon can not be const.</p> <pre><code>prefixIcon: const Padding( padding: EdgeInsets.only(top: 15), // add padding to adjust icon child: Icon(icon) ), </code></pre> <p>Remove the const as icon is argument to your widget which is not const...
How to correctly pass IconData as and argument to a custom widget
flutter|dart
0
270
2
71,106,881
71,106,881
2
true
2022-02-14T02:59:06.810Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to correctly pass IconData as and argument to a custom widget<p>I have a custom wrapper around the TextFormField widget, I want to be able to pass in a m...
71,109,861
by changing the selection of radio button now working fine<p>if first time I want to select or changing the radio button I want to change the label color to red, but it not working perfectly, I use a on change function inside radio button</p> <pre><code>&lt;script&gt; function changecolor(){ document.getEleme...
<p>document.getElementsByClassName return an htmlcollection so you have two solutions to make work your code</p> <ul> <li>iterate on each element of the htmlcollection and apply the style</li> <li>or use an index for access one of the specific element</li> </ul> <p><div class="snippet" data-lang="js" data-hide="false" ...
by changing the selection of radio button now working fine
javascript|html|css
0
14
1
71,109,889
71,109,889
2
true
2022-02-14T09:51:01.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: by changing the selection of radio button now working fine<p>if first time I want to select or changing the radio button I want to change the label color to ...
71,096,129
Is there an alternative flutter camera package?<p>I've been using <a href="https://pub.dev/packages/camera" rel="nofollow noreferrer">this</a> flutter camera package for a while. I would like to use the package to simply take a picture. Recently, I've been unable to take any pictures because the plugin crashes. I found...
<p>look the image picker plugin you can find it under pub.dev &gt; search: image picker &gt; click on the first one.</p>
Is there an alternative flutter camera package?
flutter|flutter-dependencies
0
286
1
71,110,505
71,110,505
2
true
2022-02-12T21:45:52.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an alternative flutter camera package?<p>I've been using <a href="https://pub.dev/packages/camera" rel="nofollow noreferrer">this</a> flutter camera...
71,113,751
how to apply constraints on Django field within the instances associated with the user<p>I am making a todo app for practice, the functionality I want to achieve is that, when a user create a task,Only the time field should be unique about all of his tasks, I have done (unique=True) In the time field in model but that ...
<p>The problem is coming from here:</p> <pre><code>for task in tasks: time.append(task['time']) #&lt;-- </code></pre> <p>Here if you want to use access time, you need to use <code>task.time</code> because <code>task</code> is an object.</p> <p>Also need to fix another thing in your exisiting code to make it work, ...
how to apply constraints on Django field within the instances associated with the user
django|django-models
0
22
1
71,113,892
71,113,892
2
true
2022-02-14T14:49:29.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to apply constraints on Django field within the instances associated with the user<p>I am making a todo app for practice, the functionality I want to ach...
71,110,520
MongoDB Schema for multiple user types<p>There are three different user types in my application. 1.Creator 2.Company 3.Admin</p> <p>The fields will be almost same for all the three,except there wont be full name for company.But there will be company name field.</p> <pre><code> id: string; email: string; phone: string...
<p>In my experience, in situations like this it is usually better in the long term to stick with a single collection and then differentiate via queries. This allows you to easily add additional user types in the future (that you do not foresee now) without requiring adding more collections.</p>
MongoDB Schema for multiple user types
mongodb|database-design|nosql|schema
0
259
1
71,114,355
71,114,355
2
true
2022-02-14T10:40:23.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB Schema for multiple user types<p>There are three different user types in my application. 1.Creator 2.Company 3.Admin</p> <p>The fields will be almost...
71,115,852
Fields not queried in same order as Access table<p>I have two simple VBA functions in MS Access to copy and paste an entry. However, when I copy the entry, the fields are not in the same order. I have ten fields in the access table, ordered from 1-10, but when the data is copied is ends up 1-8,10,9. The field in positi...
<p>Not sure how to force Access to use a different field order, but if source and destination have the same columns, access the fields via name.</p> <pre><code>For i = 0 To .Fields.Count - 1 fieldName = RS.Fields(i).name .Fields(fieldName).Value = RS.Fields(fieldName).Value Next </code></pre>
Fields not queried in same order as Access table
vba|ms-access
0
36
2
71,116,327
71,116,327
2
true
2022-02-14T17:26:18.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fields not queried in same order as Access table<p>I have two simple VBA functions in MS Access to copy and paste an entry. However, when I copy the entry, t...
71,118,218
Appbundle crashes flutter<p>If you compile the Appbundle application and upload it to the test channel in google play, then when you open the application, it immediately crashes. If you compile apk and install it on your phone, then everything is ok. How can I find the error after compiling the Appbundle? Thank you</p>
<p>Have you included firebase? If yes make sure to add sha1 and sha256 from Google Play in firebase console and add the json file in your project and upload another bundle</p>
Appbundle crashes flutter
flutter|dart
0
24
1
71,118,266
71,118,266
2
true
2022-02-14T20:59:14.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Appbundle crashes flutter<p>If you compile the Appbundle application and upload it to the test channel in google play, then when you open the application, it...
71,119,386
How to specify a template for a Snippet in a StreamField when using SnippetChooserBlock<p>I want to use a snippet in a StreamField:</p> <pre><code>@register_snippet class Advert(models.Model): url = models.URLField(null=True, blank=True) text = models.CharField(max_length=255) def __str__(self): ret...
<p>Like all block types, <code>SnippetChooserBlock</code> <a href="https://docs.wagtail.org/en/stable/topics/streamfield.html#per-block-templates" rel="nofollow noreferrer">accepts a <code>template</code> argument</a> that specifies the path to a template to render for that block:</p> <pre><code>class MyPage(Page): ...
How to specify a template for a Snippet in a StreamField when using SnippetChooserBlock
python|django|wagtail
0
35
1
71,119,708
71,119,708
2
true
2022-02-14T23:18:39.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to specify a template for a Snippet in a StreamField when using SnippetChooserBlock<p>I want to use a snippet in a StreamField:</p> <pre><code>@register_...
71,111,252
Filling Non-linear Svg Path Stroke<p>I trying to do speedometer by filling stroke with linear gradient. When stop offset is 0%, white line appears at the beginning of the path. How can i get rid of it? In additional, i'm not sure that filling stroke with linear gradient is the best option to fill svg path. Do you have ...
<p>A common approach would be to render your current value/speed by setting/changing the <code>stroke-dasharray</code> attribute.</p> <p>Let's say your &quot;speed limit&quot; is 300 km/h.</p> <p>Apply the <code>pathLength</code> attribute to your path. This way you could easily display a current speed e.g 50 km/h like...
Filling Non-linear Svg Path Stroke
css|svg
0
43
1
71,119,735
71,119,735
2
true
2022-02-14T11:38:57.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filling Non-linear Svg Path Stroke<p>I trying to do speedometer by filling stroke with linear gradient. When stop offset is 0%, white line appears at the beg...
71,120,061
How do I replace an array item with a corresponding object in a different array JavaScript<p>I have an object and an array. The object looks like this.</p> <pre class="lang-js prettyprint-override"><code>const saleProducts = { category: &quot;Books&quot;, product_skus: [ &quot;14003696&quot;, &quot;14003915...
<p>You can use a map function to replace all <code>sku</code> with corresponding details data:</p> <pre class="lang-js prettyprint-override"><code>saleProducts.product_skus = saleProducts.product_skus.map(sku =&gt; productDetails.find(details =&gt; details.sku === sku) || sku ); </code></pre> <p><div class="snippet"...
How do I replace an array item with a corresponding object in a different array JavaScript
javascript|arrays
0
31
1
71,120,123
71,120,123
2
true
2022-02-15T01:07:17.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I replace an array item with a corresponding object in a different array JavaScript<p>I have an object and an array. The object looks like this.</p> <...
71,121,256
Ordering of MATLAB operator<p>I'm trying to understand a MATLAB code for reserach but seem to be stuck in a basic question regarding the order of the transpose operator and ml divide operator. (please see the code below)</p> <pre><code>C = randi([0 ,1], [3,3]) D = randi([0 ,1], [3,3]) disp(&quot;C-(D')*(C\D')&quot;) d...
<pre><code>C = [0,0,1;0,1,0;1,0,1]; D = [1,1,0;1,0,1;1,0,0]; %% rule % &quot;A \ B&quot; equal to &quot;inv(A) * B&quot; % &quot;B / A&quot; equal to &quot;B * inv(A)&quot; %% mine X = C / D'; % X = C * inv(D') C - X * D' % C - (C * inv(D')) * D' = C - C * (inv(D') * D') = 0 %% yours Y = C \ D'; % Y = inv(C) * D' C - ...
Ordering of MATLAB operator
matlab|matrix-multiplication|matrix-inverse
0
45
1
71,122,404
71,122,404
2
true
2022-02-15T04:53:37.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ordering of MATLAB operator<p>I'm trying to understand a MATLAB code for reserach but seem to be stuck in a basic question regarding the order of the transpo...
71,114,031
Why am I getting an "ExpressionSyntaxException: Malformed OGNL expression" when using Thymeleaf's safe navigation operator?<p>For some reason I'm getting an <code>ExpressionSyntaxException: Malformed OGNL expression</code> when using Thymeleaf's safe navigation operator (<code>${inter.someObj?.field}</code>). No issues...
<p>According to <a href="https://northcoder.com/post/thymeleaf-vs-spel-vs-ognl/" rel="nofollow noreferrer">https://northcoder.com/post/thymeleaf-vs-spel-vs-ognl/</a> the <a href="https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#expressions-operator-safe-navigation" rel="nofollow noreferrer"...
Why am I getting an "ExpressionSyntaxException: Malformed OGNL expression" when using Thymeleaf's safe navigation operator?
spring-boot|thymeleaf|ognl
0
286
1
71,122,826
71,122,826
2
true
2022-02-14T15:11:52.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why am I getting an "ExpressionSyntaxException: Malformed OGNL expression" when using Thymeleaf's safe navigation operator?<p>For some reason I'm getting an ...
71,123,552
how to create link in django for substring<p>I am struggling to understand how to create a link in django's templates.</p> <p>in my views.py file I have a list of lists (so a table). One of the fields may or may not contain links.</p> <p>Views.py</p> <pre class="lang-py prettyprint-override"><code>#tableToView is a pd....
<p>If you change it on the view, you need to print it with <code>|safe</code> on the template.</p> <p>So it would be <code>{{table.column|safe}}</code>, this way your link will be a link and not a string</p>
how to create link in django for substring
python|html|django
0
22
1
71,123,761
71,123,761
2
true
2022-02-15T08:54:37.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create link in django for substring<p>I am struggling to understand how to create a link in django's templates.</p> <p>in my views.py file I have a li...
71,124,765
Need to update duplicate with existing rows<p>I need to update(clean) my data by following conditions</p> <ol> <li><p>Check if <strong>PS-id</strong> has duplicate values.</p> </li> <li><p>Check which has the latest <strong>Date</strong></p> </li> <li><p>Update the old row which has the latest <strong>Date</strong> and...
<p>Convert values to datetimes in column <code>Date</code>, then sorting per both columns, so first row is old rows created by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop_duplicates.html" rel="nofollow noreferrer"><code>DataFrame.drop_duplicates</code></a> and converting to ...
Need to update duplicate with existing rows
python|pandas|duplicates
0
26
2
71,124,901
71,124,901
2
true
2022-02-15T10:22:44.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need to update duplicate with existing rows<p>I need to update(clean) my data by following conditions</p> <ol> <li><p>Check if <strong>PS-id</strong> has dup...
71,125,339
List range of nums divided by N<p>I want a list comprehension that list a range of numbers from 1 to 100, divided by N.</p> <p>I want to be able to swap out the N number</p> <p>So if divided by 10: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]</p> <p>Divided by 5: [2, 4, 6, 8, 10]</p> <p>Divided by 3: [3.33, 6.66, 9.99]</p> <p>Code:...
<p>This should do what you want !</p> <pre><code>import numpy as np N = 3 [i for i in np.linspace(10,10/N,N)[::-1]] </code></pre>
List range of nums divided by N
python-3.x|list
0
22
1
71,126,035
71,126,035
2
true
2022-02-15T11:04:27.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List range of nums divided by N<p>I want a list comprehension that list a range of numbers from 1 to 100, divided by N.</p> <p>I want to be able to swap out ...
71,125,992
Calculate grouped pairwise correlation between two dataframe in R<p>I have two data frames with the same structure:</p> <pre><code>df1 &lt;- data.frame(group1=c(&quot;A&quot;,&quot;A&quot;,&quot;A&quot;,&quot;B&quot;,&quot;B&quot;,&quot;C&quot;,&quot;C&quot;,&quot;C&quot;), group2 = c(1,1,2,1,1,2,2,1), col1 = c(1,2,3...
<p>You can row bind the two dataframes with an <code>id</code> variable to differentiate between them and calculate correlation for every <code>col</code> column.</p> <pre><code>library(dplyr) bind_rows(df1, df2, .id = 'id') %&gt;% group_by(group1, group2) %&gt;% summarise(across(starts_with('col'), ~cor(....
Calculate grouped pairwise correlation between two dataframe in R
r|dataframe|dplyr|correlation|purrr
0
294
1
71,126,082
71,126,082
2
true
2022-02-15T11:53:49.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate grouped pairwise correlation between two dataframe in R<p>I have two data frames with the same structure:</p> <pre><code>df1 &lt;- data.frame(group...
71,126,196
How to combine parts of pipe to a function?<p>To have a &quot;grep&quot;-like experience in Powershell, I use this (e.g. to find a process with &quot;foo&quot; in its name):</p> <p><code>Get-Process | Out-String -Stream | Select-String -SimpleMatch -Pattern &quot;foo&quot;</code></p> <p>I would like to write a function...
<p>Use <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables#input" rel="nofollow noreferrer">the <code>$input</code> automatic variable</a> to automatically enumerate any pipeline input provided, then grab the value of the first command line argument from...
How to combine parts of pipe to a function?
powershell
0
33
1
71,126,231
71,126,231
2
true
2022-02-15T12:09:04.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine parts of pipe to a function?<p>To have a &quot;grep&quot;-like experience in Powershell, I use this (e.g. to find a process with &quot;foo&quo...
71,126,774
Required item type of the context item for the child axis is node(); supplied value (.) has item type xs:anyAtomicType<p>Here is my code:</p> <pre><code>&lt;xsl:for-each select=&quot;distinct-values(m/@x)&quot;&gt; &lt;xsl:variable name=&quot;x&quot; select=&quot;.&quot;/&gt; &lt;xsl:value-of select=&quot;count(m[@...
<p>I think what you should use is e.g.</p> <pre><code>&lt;xsl:for-each-group select=&quot;m&quot; group-by=&quot;@x&quot;&gt; &lt;xsl:value-of select=&quot;count(current-group())&quot;/&gt; &lt;/xsl:for-each-group&gt; </code></pre> <p>If you want to go along with that distinct-values attempt then store e.g. <code>&lt...
Required item type of the context item for the child axis is node(); supplied value (.) has item type xs:anyAtomicType
xml|xslt|xslt-2.0|saxon
0
282
2
71,127,017
71,127,017
2
true
2022-02-15T12:53:15.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Required item type of the context item for the child axis is node(); supplied value (.) has item type xs:anyAtomicType<p>Here is my code:</p> <pre><code>&lt;...
71,126,940
Robot framework: create a keyword with optional argument. The argument's default value should come from a script<p>I am trying to make a keyword that takes as default argument a python script method, as seen below:</p> <pre><code>*** Settings *** Library SeleniumLibrary Library BuiltIn Library ./../python_scripts/fo...
<p>You can't run functions in Arguments section, folders.get_last_folder is considered to be a string. You need to use &quot;Run Keyword If&quot; to conditionally set variable, something like this:</p> <pre><code>*** Keywords *** Create subfolder inside mainfolder through right click [Arguments] ${PARENT_FOLDER}=f...
Robot framework: create a keyword with optional argument. The argument's default value should come from a script
python|robotframework
0
283
1
71,127,565
71,127,565
2
true
2022-02-15T13:04:30.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Robot framework: create a keyword with optional argument. The argument's default value should come from a script<p>I am trying to make a keyword that takes a...
71,128,494
Converting XML to Array, and then looping through some objects results in 'Illegal string offset' if there's only a single object<p>Before this gets marked as a duplicate, please know that my issue is slightly different to the normal <code>Illegal string offset</code> issue.</p> <p>I have some XML which is an order dis...
<blockquote> <p>I have some XML ... I convert to it to JSON and then to an array.</p> </blockquote> <p>Don't do that. XML, JSON, and PHP arrays all have different ideas about how data can and should be structured. Blindly converting between them is just a bad idea.</p> <p>Instead, look at the <a href="https://www.php.n...
Converting XML to Array, and then looping through some objects results in 'Illegal string offset' if there's only a single object
php|xml|simplexml
0
28
1
71,128,643
71,128,643
2
true
2022-02-15T14:49:14.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting XML to Array, and then looping through some objects results in 'Illegal string offset' if there's only a single object<p>Before this gets marked a...