question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,398,443
Query 2 COUNTS with a GROUP BY statement trouble<p>I am trying to query a count from registered users and enrolled users for each group in the table.</p> <p>However, I keep getting duplicates of the Group names, registered, and enrolled. I need it to be just the unique group name with the count in its respective column...
<p>I believe you need a &quot;<strong>conditional aggregate</strong>&quot; in a single query:</p> <pre><code>SELECT [group] , count(*) AS registered , count(CASE WHEN AUTH_PAGE = 'X' THEN 1 END) AS enrolled FROM table1 WHERE CreationDate &gt;= '20220401' AND CreationDate &lt; '20220501' AND EMAIL ...
Query 2 COUNTS with a GROUP BY statement trouble
sql|sql-server
0
44
2
72,398,652
72,398,652
2
true
2022-05-26T21:58:22.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query 2 COUNTS with a GROUP BY statement trouble<p>I am trying to query a count from registered users and enrolled users for each group in the table.</p> <p>...
72,277,272
Removing Single Character Substring and Not in List<p>I can effectively remove single characters from <code>source_string</code>, however how do I include the condition to not remove single characters that are in the list <code>compass</code>?</p> <pre><code>compass = ['N', 'E', 'S', 'W'] source_string = 'Florida W Cam...
<p>Try:</p> <pre><code>&gt;&gt;&gt; ' '.join([x for x in source_string.split() if (len(x)&gt;1) or x in compass]) 'Florida W Campus CD' </code></pre>
Removing Single Character Substring and Not in List
python|pandas|string
0
44
3
72,277,318
72,277,318
2
true
2022-05-17T16:01:17.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing Single Character Substring and Not in List<p>I can effectively remove single characters from <code>source_string</code>, however how do I include th...
72,307,517
Match function seems to be returning from within a formula?<p>I am using this formula to find the relative position of the <strong>furthest right</strong> word &quot;Move&quot; in my cells.</p> <pre><code>=MATCH(&quot;Move&quot;,AG5:LM5,1) </code></pre> <p>The only problem is the cells in AG5:LM5 are using this formula...
<p>you should be using:</p> <pre><code>=MATCH(&quot;Move&quot;, AG5:LM5, 0) </code></pre> <hr /> <h2>update</h2> <p>delete everything in range C3:C and use this in C3:</p> <pre><code>=ARRAYFORMULA(IFNA(VLOOKUP(ROW(D3:D1000), QUERY(SORT(SPLIT( FLATTEN(ROW(D3:D1000)&amp;&quot;×&quot;&amp;COLUMN(D3:3)&amp;&quot;×&quot;&a...
Match function seems to be returning from within a formula?
google-sheets|google-sheets-formula|vlookup|spreadsheet|flatten
1
44
1
72,308,418
72,308,418
2
true
2022-05-19T15:46:57.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Match function seems to be returning from within a formula?<p>I am using this formula to find the relative position of the <strong>furthest right</strong> wo...
72,358,768
How can I group by and summarize while keeping unique values by group and count their occurence?<p>I have a data frame that looks something like:</p> <pre><code>df &lt;- data.frame(resource = c(&quot;gold&quot;, &quot;bronze&quot;, &quot;gold&quot;, &quot;silver&quot;, &quot;silver&quot;, &quot;gold&quot;, &quot;gold&q...
<p>You can do:</p> <pre><code>library(tidyverse) df |&gt; group_by(resource) |&gt; add_count(price) |&gt; mutate(extraction = sum(extraction)) |&gt; distinct() |&gt; mutate(id = 1:n()) |&gt; ungroup() |&gt; pivot_wider(names_from = id, values_from = c(price, n), names_va...
How can I group by and summarize while keeping unique values by group and count their occurence?
r|count|unique|collapse
1
44
1
72,359,041
72,359,041
2
true
2022-05-24T07:24:28.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I group by and summarize while keeping unique values by group and count their occurence?<p>I have a data frame that looks something like:</p> <pre><c...
72,380,666
How exclusively scrape content of <ol> in dependency to preceding <b>?<p>I want to attract the journal information on the website <a href="https://www.fed.cuhk.edu.hk/cri/faculty/prof-bai-barry/" rel="nofollow noreferrer">https://www.fed.cuhk.edu.hk/cri/faculty/prof-bai-barry/</a>.</p> <p>However, when I tried to use t...
<p>Use <code>css selectors</code> in example to find the element by its text and use <code>adjacent sibling combinator</code> to pick the <code>ol</code> with its <code>li</code>:</p> <pre><code>for e in soup.select('b:-soup-contains(&quot;Refereed Journal articles&quot;) + ol li'): print(e.text) </code></pre> <h5>...
How exclusively scrape content of <ol> in dependency to preceding <b>?
python|web-scraping|beautifulsoup|css-selectors
1
44
1
72,380,833
72,380,833
2
true
2022-05-25T15:45:24.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How exclusively scrape content of <ol> in dependency to preceding <b>?<p>I want to attract the journal information on the website <a href="https://www.fed.cu...
72,258,331
Extracting RegEx pattern across list excluding other html code<p>I've written a script to pull a list of available report url extensions page available for text extraction.</p> <p>I've used parsing and BeautifulSoup to extract the reference area for the latest report using this method.</p> <pre><code>home = BeautifulSo...
<p>Why don't you just try this:</p> <pre><code>report_url_locations = [x[&quot;href&quot;] for x in container.findAll('a')] </code></pre> <p>And then just print the <code>report_url_locations</code></p> <p>By the way, <a href="https://stackoverflow.com/questions/590747/using-regular-expressions-to-parse-html-why-not">h...
Extracting RegEx pattern across list excluding other html code
python|regex|web-scraping|beautifulsoup
1
44
2
72,258,544
72,258,544
2
true
2022-05-16T11:16:52.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting RegEx pattern across list excluding other html code<p>I've written a script to pull a list of available report url extensions page available for t...
72,350,961
Unlist a list of dataframes in R<p>I have a list of dataframes that I have created using</p> <pre><code>list_dataframes = list(dataframe_1, dataframe_2...) </code></pre> <p>And now I wonder how to unlist this list.</p> <p>I have searched for it and found this solution:</p> <pre><code>list2env(list_dataframes ,.GlobalEn...
<p>The error is a result of passing a list without names</p> <pre><code>list2env(list(1, 2, 3), .GlobalEnv) </code></pre> <blockquote> <p>Error in list2env(list(1, 2, 3), .GlobalEnv) : names(x) must be a character vector of the same length as x</p> </blockquote> <pre><code>list2env(list(a= 1, b = 2, c = 3), .GlobalE...
Unlist a list of dataframes in R
r|list
2
44
1
72,351,139
72,351,139
2
true
2022-05-23T15:17:41.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unlist a list of dataframes in R<p>I have a list of dataframes that I have created using</p> <pre><code>list_dataframes = list(dataframe_1, dataframe_2...) <...
72,321,662
Get count of all types of values in a column obtained in the same SELECT SQL query<p>MySQL Version: 5.7.36</p> <p>I'm attempting to minimize the amount of queries I have to execute.</p> <p>Right now, I'm executing a query similar to this:</p> <pre><code>SELECT TABLE 1.column1 as &quot;A&quot;, TABLE 1.column2 a...
<p>You have to join with the subquery that gets the counts.</p> <pre><code>SELECT t1.column1 AS A, t1.column2 AS B, t2.count FROM Table1 AS t1 JOIN ( SELECT column1 AS A, COUNT(*) AS count FROM Table1 GROUP BY column1 ) AS t2 ON t1.A = t2.A </code></pre>
Get count of all types of values in a column obtained in the same SELECT SQL query
mysql|sql|mariadb
0
44
2
72,321,907
72,321,907
2
true
2022-05-20T15:51:35.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get count of all types of values in a column obtained in the same SELECT SQL query<p>MySQL Version: 5.7.36</p> <p>I'm attempting to minimize the amount of qu...
72,394,287
Python - Specify parent or interface as return type<p>I am new to Python, and trying to understand how we can achieve something like below in python like we do in Java.</p> <pre><code>public interface IParent { } public Class Parent1 implements IParent{ } public Class Parent2 implements IParent{ } Now, I can use li...
<p>In Python there is no such thing as interfaces. Instead, use inheritance and so-called abstract base classes (ABC), which, to put it simply, are classes that cannot be instantiated. Your code would translate to:</p> <pre><code>from abc import ABC class IParent(ABC): pass class Parent1(IParent): pass class...
Python - Specify parent or interface as return type
python|return-type
0
44
1
72,394,399
72,394,399
2
true
2022-05-26T15:28:43.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - Specify parent or interface as return type<p>I am new to Python, and trying to understand how we can achieve something like below in python like we...
72,288,037
Combining similar elements of an Array<p>I would like to create a function which loops through an array and combines the third element of each if they have the same first two elements, however only ways I could think of have a very high complexity, any recommended algorithm [python preferred, but any pseudo-code or alg...
<p>You could sort the lists and then use a loop:</p> <pre><code>from typing import List, Union def merge_lists(lists: List[List[Union[int, str]]]) -&gt; List[List[Union[int, str]]]: &quot;&quot;&quot;Merges lists based on first two elements.&quot;&quot;&quot; if not lists: return lists sorted_list...
Combining similar elements of an Array
python|arrays|algorithm|function
2
44
3
72,288,233
72,288,233
2
true
2022-05-18T11:06:46.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining similar elements of an Array<p>I would like to create a function which loops through an array and combines the third element of each if they have t...
72,291,404
From completable to observable RxJava<p>I have the method which return completable</p> <pre><code>interface MyClass{ fun getSomething(): Completable } </code></pre> <p>I would like to map it to <code>Observable.just(true)</code> if it is complete or <code>Observable.just(false)</code> if it is not complete/error.</p>...
<p>Convert it to Single, then to Observable:</p> <pre class="lang-java prettyprint-override"><code>getSomething() .toSingleDefault(true) .onErrorReturnItem(false) .toObservable() </code></pre> <p>or convert to <code>Observable</code> and flatMap the signals</p> <pre class="lang-java prettyprint-override"><code>getSomet...
From completable to observable RxJava
java|android|kotlin|rx-java2
0
44
1
72,299,867
72,299,867
2
true
2022-05-18T14:49:51.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: From completable to observable RxJava<p>I have the method which return completable</p> <pre><code>interface MyClass{ fun getSomething(): Completable } </co...
72,320,976
How to remove a specific key from JSON response coming from MongoDB in ExpressJS<p>I'm creating a simple application using <code>MEAN</code> stack. My code is working fine but i want to remove one key from the response. Please look at my ocde.</p> <p><strong>models/user.js</strong></p> <pre><code>const mongoose = requi...
<p>You can use the mongoose <code>select</code> method to exclude certain fields. <a href="https://mongoosejs.com/docs/api.html#query_Query-select" rel="nofollow noreferrer">https://mongoosejs.com/docs/api.html#query_Query-select</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-...
How to remove a specific key from JSON response coming from MongoDB in ExpressJS
node.js|mongodb|express|mongoose
-1
44
3
72,321,106
72,321,106
3
true
2022-05-20T14:53:12.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove a specific key from JSON response coming from MongoDB in ExpressJS<p>I'm creating a simple application using <code>MEAN</code> stack. My code i...
72,332,339
Count number of unique items in a pandas dataframe column<p>Assume I have a data frame such as</p> <pre><code>import pandas as pd df = pd.DataFrame({'ProductList':[[&quot;ABC&quot;, &quot;ABC&quot;, &quot;CDE&quot;, &quot;CDF&quot;], [&quot;CDE&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;]...
<p>A quick option would be: <code>explode</code> + <code>nunique</code>:</p> <pre><code>df.ProductList.explode().nunique() # 5 </code></pre>
Count number of unique items in a pandas dataframe column
python|pandas|numpy
0
44
2
72,332,350
72,332,350
3
true
2022-05-21T18:42:41.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count number of unique items in a pandas dataframe column<p>Assume I have a data frame such as</p> <pre><code>import pandas as pd df = pd.DataFrame({'Produc...
72,377,786
CoreBluetooth - get BLE Genertic Attribute Profile raw bytes<p>I have a view controller that scans for BLE beacons that are advertising <strong>only</strong> and do now allow incoming connections. I can see the bytes that I want by inspecting the service data section (<code>CBAdvertisementDataServiceDataKey</code>) of ...
<p>According to the doc of <a href="https://developer.apple.com/documentation/corebluetooth/cbadvertisementdataservicedatakey" rel="nofollow noreferrer"><code>CBAdvertisementDataServiceDataKey</code></a>, the value is <code>[CBUUID: Data]</code>.</p> <p>So it should be:</p> <pre><code>if let dictionary = advertisementD...
CoreBluetooth - get BLE Genertic Attribute Profile raw bytes
ios|swift|bluetooth-lowenergy|core-bluetooth
0
44
1
72,379,698
72,379,698
3
true
2022-05-25T12:37:42.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CoreBluetooth - get BLE Genertic Attribute Profile raw bytes<p>I have a view controller that scans for BLE beacons that are advertising <strong>only</strong>...
72,345,677
Retrieve all occurrencies from selected attributes to separate column in pandas<p>want to extract color from the product descriptions. I tried to use NER but it was nt successful. Now I am trying to define a list and match it with description.</p> <p>I have data in dataframe column like this:</p> <pre><code>Description...
<p>Jezreel's first answer is very good! however when using</p> <pre class="lang-py prettyprint-override"><code>df['Colours'] = df['Description pre-work'].str.findall('|'.join(attributes), flags=re.I) </code></pre> <p>it will always find red when words such as &quot;Tampered &quot; and such I suggest an easy quick fix (...
Retrieve all occurrencies from selected attributes to separate column in pandas
python|pandas
0
44
3
72,345,978
72,345,978
3
true
2022-05-23T08:47:20.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve all occurrencies from selected attributes to separate column in pandas<p>want to extract color from the product descriptions. I tried to use NER but...
72,395,192
Powershell Random selection and count<p>I'm trying to write a powershell script that picks up from an array 10 random items, list them and then writes which one was picked the most and how many times.</p> <p>I have this:</p> <pre><code>for ($num = 1 ; $num -le 10 ; $num++){ $namelist = @( &quot;Item 1&quot;, &q...
<p>You can combine <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/group-object?view=powershell-7.2" rel="nofollow noreferrer"><code>Group-Object</code></a> with <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/sort-object?view=powershell-...
Powershell Random selection and count
powershell
1
44
1
72,395,333
72,395,333
3
true
2022-05-26T16:39:44.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell Random selection and count<p>I'm trying to write a powershell script that picks up from an array 10 random items, list them and then writes which ...
72,281,508
setState updates asynchronously<p>I am refering to the comment below from: <a href="https://reactjs.org/docs/state-and-lifecycle.html" rel="nofollow noreferrer">https://reactjs.org/docs/state-and-lifecycle.html</a></p> <hr /> <p><strong>State Updates May Be Asynchronous</strong></p> <p>React may batch multiple setState...
<p>It is correct, but there are some cases where it might not work as you expect.</p> <p>For example, if you use it twice</p> <pre><code>const [var, set_var] = useState(false); set_var(!var); set_var(!var); </code></pre> <p>would you expect it to go <code>false</code>-&gt;<code>true</code>-&gt;<code>false</code> ? Bec...
setState updates asynchronously
reactjs|react-hooks|use-state
0
44
1
72,281,579
72,281,579
3
true
2022-05-17T22:53:46.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: setState updates asynchronously<p>I am refering to the comment below from: <a href="https://reactjs.org/docs/state-and-lifecycle.html" rel="nofollow noreferr...
72,383,111
Python variable loses value when passed to a if statement<p>I am trying to retrieve a password hash that i stored in my database. The problem is how i handle when the query is null.</p> <p>In the case that I search for a <strong>user that exists</strong> the <strong>first print</strong> will print <strong>something</st...
<p>Each time you call <code>db_password.fetchone()</code> it fetches the next row of results. But your query only returns one row.</p> <p>The call in the <code>if</code> statement fetches that row. Then the call in the <code>print()</code> call tries to fetch the next row, but there isn't another row, so it prints <cod...
Python variable loses value when passed to a if statement
python|sqlite|if-statement|variables|scope
0
44
2
72,383,176
72,383,176
3
true
2022-05-25T19:20:45.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python variable loses value when passed to a if statement<p>I am trying to retrieve a password hash that i stored in my database. The problem is how i handle...
72,258,024
Combining content of two columns in R<p>Good day</p> <p>I have the following data set that basically serves as a key to another data set.</p> <p><a href="https://i.stack.imgur.com/ASGKR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ASGKR.png" alt="enter image description here" /></a></p> <p>A short...
<p>An idea is to convert empty strings to NA, <code>fill</code> and paste with the single character strings, i.e.</p> <pre><code>library(dplyr) Data %&gt;% mutate(Code1 = replace(Code, Code == ' ', NA)) %&gt;% tidyr::fill(Code1) %&gt;% mutate(Code1 = ifelse(nchar(Description) == 1, paste0(Code1, Description), ''...
Combining content of two columns in R
r|dataframe|dplyr|data-cleaning
1
44
1
72,258,325
72,258,325
3
true
2022-05-16T10:50:02.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining content of two columns in R<p>Good day</p> <p>I have the following data set that basically serves as a key to another data set.</p> <p><a href="htt...
72,360,388
Kotlin - Can the minimum distance between a location and a list of locations be found with a one liner?<p>I would like the following &quot;pseudocode&quot; to be valid syntax (but clearly it's not) :</p> <pre><code>minDistance = minOf(myLocations.forEach{return location.distanceTo(it)}) </code></pre> <p>To clarify, I a...
<p>I believe this is what you're looking for</p> <pre><code>minDistance = myLocations.minOf { location.distanceTo(it) } </code></pre> <p>Additional info: If you want the location with the shortest distance instead, then you can use</p> <pre><code>myLocations.minByOrNull { location.distanceTo(it) } </code></pre>
Kotlin - Can the minimum distance between a location and a list of locations be found with a one liner?
kotlin
1
44
1
72,360,456
72,360,456
4
true
2022-05-24T09:24:01.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin - Can the minimum distance between a location and a list of locations be found with a one liner?<p>I would like the following &quot;pseudocode&quot; t...
72,362,282
R: rehape from "wide" to "long", keeping some variables "wide"<p>I have data file in wide format, with a set of recurring variables (var1 var2, below)</p> <p><strong>data have:</strong></p> <pre><code>| ID | background vars| var1.A | var2.A | var1.B | var2.B | var1.C | var2.C | | -: | :------------- |:------:|:------:|...
<p>Use the keyword <code>'.value'</code> in the <code>names_to</code> argument to keep that part of the column name in wide format:</p> <pre class="lang-r prettyprint-override"><code>tidyr::pivot_longer(df, c(-ID, -`background vars`), names_sep = '\\.', names_to = c('.value', 'r...
R: rehape from "wide" to "long", keeping some variables "wide"
r
1
44
2
72,362,362
72,362,362
7
true
2022-05-24T11:42:01.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: rehape from "wide" to "long", keeping some variables "wide"<p>I have data file in wide format, with a set of recurring variables (var1 var2, below)</p> <p...
72,326,273
How to push an element to the left of a div and another element to the right of that same div?<p>Basically I have this long bar div and 2 pieces of text inside the innerHTML of that div.</p> <p>How would I make one of the elements hug the left side of the div and one hug the right side?</p> <p>I thought <code>float:lef...
<p>You haven't shared any code, so it's hard to know what you've attempted so far..</p> <p>You mention you've set the text via innerHTML, but if you're instead able to actually edit the markup itself, then this left/right text split can easily be achieved by using flexbox. Here, I've sepearted the items with the <a hre...
How to push an element to the left of a div and another element to the right of that same div?
html|css
-2
44
2
72,326,285
72,326,285
-1
true
2022-05-21T02:36:48.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to push an element to the left of a div and another element to the right of that same div?<p>Basically I have this long bar div and 2 pieces of text insi...
72,244,746
How can I define custom operators to deal with Range of String.Index in Swift?<p>I find using <code>String.Index</code> really needs a lot of code in Swift, especially when it comes to methods of <code>Range</code> Swift doesn't have. Like in above code where I don't want an open range (both bounds exclusive). So I won...
<p>Edit: See the <strong>second</strong> code example instead! Please disregard the first block; I didn't read the question as carefully as I should have, so it is not a relevant solution.</p> <p>Edit 2: Also look at the first comment below this answer for an example of a major caveat of the first example. It does ...
How can I define custom operators to deal with Range of String.Index in Swift?
swift|string|range
0
44
1
72,245,073
72,245,073
-1
true
2022-05-15T00:30:16.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I define custom operators to deal with Range of String.Index in Swift?<p>I find using <code>String.Index</code> really needs a lot of code in Swift, ...
72,783,139
classes interaction methods php<p>Lets say we have class B which extends class A. When creating new instance of class B and providing value into it that value is used in constructor of class A. Please check sample below. I'm little bit confused about such behavior. If method &quot;display&quot; do not pass value into c...
<p>First of all the topic you are talking about is called <code>Inheritance</code> in Object-Oriented Programming (OOP).</p> <p>If class <code>B</code> has no construct (<code>__construct</code>) then PHP will call the construct of class <code>A</code>.</p> <p>And about <code>display</code> function, think of it as an ...
classes interaction methods php
php|class|oop
1
44
1
72,783,197
72,783,197
1
true
2022-06-28T08:28:21.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: classes interaction methods php<p>Lets say we have class B which extends class A. When creating new instance of class B and providing value into it that valu...
72,826,478
Is it possible to pass associative arguments in Jenkins?<p>Current Jenkins setup deploys single version of different services, if they are selected via Boolean parameter option.</p> <p>Say, there are four services in total - <code>A, B, C, D</code> and the version to be deployed will remain same(1.0), for all services....
<h1>Non-Pipeline Solution with Active choice plugin.</h1> <p>You can get this done using the <a href="https://plugins.jenkins.io/uno-choice/" rel="nofollow noreferrer">Active Choice Plugin</a>. This supports HTML rendering. So in your case. First, let's get the Service name, and based on this we will render a text box....
Is it possible to pass associative arguments in Jenkins?
jenkins
1
44
1
72,828,583
72,828,583
1
true
2022-07-01T08:29:53.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to pass associative arguments in Jenkins?<p>Current Jenkins setup deploys single version of different services, if they are selected via Boole...
72,775,302
i want to convert json to a compatible dart format help me i'm beginner in flutter<p>i'm learning flutter &amp; dart and i was trying to implement state management and REST API data in the exercice but i got the same error since 2 days. My process is the same with the tutorail <a href="https://youtu.be/x4DydJKVvQk" rel...
<p><strong>DataModel</strong> class contains price field which is <strong>int</strong> but api gives you in the form of <strong>String</strong> so either you parse it into int or Change the type to <strong>String</strong></p> <pre><code>String price; </code></pre> <p><strong>--------OR--------</strong></p> <p>change fr...
i want to convert json to a compatible dart format help me i'm beginner in flutter
flutter|dart
0
44
1
72,776,002
72,776,002
1
true
2022-06-27T16:18:10.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i want to convert json to a compatible dart format help me i'm beginner in flutter<p>i'm learning flutter &amp; dart and i was trying to implement state mana...
72,813,526
enable/disable logging from Object creation level<p>I am stuck in this problem for a while :</p> <p>I have a class and it has some functions and also has some logging statements written inside of it. I want to enable/disable logging while creation an object of that particular class by passing some arguments in construc...
<p>You can use <code>SimpleLogger</code> for this:</p> <pre><code> public class Test { private static final Logger LOGGER = LoggerFactory.getLogger(Test.class); public Test(String logLevel) { // System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, logLevel); } } </code></...
enable/disable logging from Object creation level
java|logging|slf4j
1
44
1
72,814,224
72,814,224
1
true
2022-06-30T09:39:21.120Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: enable/disable logging from Object creation level<p>I am stuck in this problem for a while :</p> <p>I have a class and it has some functions and also has som...
72,876,617
Conditionally animating markers<p>I have successfully built a map.</p> <p>But I'd like to be able to choose whether or not any given Marker bounces or drops as it is placed on the map… typically to draw attention to one of two or three dozen Markers that are all visible simultaneously.</p> <p>Defining the Marker's prop...
<p>You can use the <a href="https://stackoverflow.com/questions/6259982/how-do-you-use-the-conditional-operator-in-javascript">ternary operator</a>: <code>? :</code> (to stop BOUNCE or avoid animation, use <code>animation: null</code>, [per the documentation]:</p> <blockquote> <p><strong>BOUNCE</strong> - Marker bounce...
Conditionally animating markers
javascript|google-maps
-1
44
1
72,877,692
72,877,692
1
true
2022-07-05T23:55:54.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditionally animating markers<p>I have successfully built a map.</p> <p>But I'd like to be able to choose whether or not any given Marker bounces or drops ...
73,006,694
VBA to place formula based on cell value<p>i need help, here I am facing an issue with my code first issue is it give me compile error also it is selecting the source sheet but when i define cell reference along with sheet reference it is not selecting the respective cell</p> <p>all i want to do is check if cell H5 of...
<p>Please, try the next updated code. I think no need of any selection. <code>Select</code>, <code>Activate</code> only consume Excel resources, not bringing any benefit:</p> <pre><code> Sub placeETA() Dim formula1 As String, formula2 As String, formula3 As String, ws1 As Worksheet, ws2 As Worksheet, specCell As Range...
VBA to place formula based on cell value
excel|vba|if-statement|conditional-statements|formula
0
44
1
73,006,895
73,006,895
1
true
2022-07-16T18:23:17.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VBA to place formula based on cell value<p>i need help, here I am facing an issue with my code first issue is it give me compile error also it is selecting t...
72,921,040
Find div with same text and click on it by click on div<p>How can i trigger a click on the <code>div</code> (from time-table html block) with the exact same text of the <code>div</code> (from list-events html block) which i click on? (<code>jQuery</code>prefered )</p> <p><strong>Note: IDs are unique.</strong></p> <p><s...
<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>function matchedBy(elem) { //$(elem).data('id'); //Way 1, If you set the data to the element //$(elem).text().split('One Way...
Find div with same text and click on it by click on div
javascript|html|jquery
0
44
1
72,921,363
72,921,363
1
true
2022-07-09T11:37:55.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find div with same text and click on it by click on div<p>How can i trigger a click on the <code>div</code> (from time-table html block) with the exact same ...
72,879,895
How to Store the Data in Database from dropdown in Djngo<p>I am working on student management project and I am unable to get the branch for student as it is foreignkey of Course model to Student model and I want to get the selected option into student model in branch row</p> <p><strong>models.py:</strong></p> <pre><cod...
<p>You haven't named that <code>&lt;select&gt;</code> (<code>&lt;select name=&quot;branch&quot;&gt;</code>) so any choice you make in it will not be transmitted to the server, and that's why you get a key error.</p> <p>In addition, the <code>&lt;option&gt;</code>'s value must be the course's id:</p> <pre><code>&lt;opti...
How to Store the Data in Database from dropdown in Djngo
python|django|django-models|django-views|django-templates
1
44
2
72,879,947
72,879,947
1
true
2022-07-06T08:06:05.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Store the Data in Database from dropdown in Djngo<p>I am working on student management project and I am unable to get the branch for student as it is ...
72,847,124
How to trigger Operation.lineSegment with a button instead of a metronome in AudioKit?<p>In the <a href="https://github.com/AudioKit/Cookbook" rel="nofollow noreferrer">AudioKit Cookbook</a> Example &quot;SegmentOperation&quot; there is an &quot;Operation.lineSegment&quot; that creates a linear ramp. It is triggered wi...
<p>Solved: Actually we don't need it to be exactly an impulse – any non-zero to zero transition will work. So I've just made a button to toggle the first parameter in the parameters array. This is how I've modified the operation conductor:</p> <pre><code>let frequency = Operation.lineSegment(trigger: parameters[0], ...
How to trigger Operation.lineSegment with a button instead of a metronome in AudioKit?
swift|audiokit
1
44
1
72,872,248
72,872,248
1
true
2022-07-03T14:05:02.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trigger Operation.lineSegment with a button instead of a metronome in AudioKit?<p>In the <a href="https://github.com/AudioKit/Cookbook" rel="nofollow ...
72,961,360
Why am I getting an invalid pointer error when I try to free malloced pointers?<p>I'm trying to learn about how arrays of strings can be created in C using malloc (i.e. dynamically sized arrays of strings).</p> <p>I can get everything working but I'm getting an &quot;invalid pointer&quot; error when I try to free the c...
<pre><code>(*myList)-&gt;data[0] = (string)malloc(sizeof(&quot;Raymond&quot;)+1); (*myList)-&gt;data[0] = &quot;Raymond&quot;; </code></pre> <p>The second assignment overwrites the <code>malloc</code> pointer. Which means you can't <code>free</code> the original pointer anymore as it is lost. Since you don't need to ac...
Why am I getting an invalid pointer error when I try to free malloced pointers?
c|pointers|malloc|free
0
44
1
72,961,435
72,961,435
1
true
2022-07-13T05:33:36.130Z
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 invalid pointer error when I try to free malloced pointers?<p>I'm trying to learn about how arrays of strings can be created in C using m...
72,863,864
Issue with `` within .replace() tags<p>How can I edit my current code to work with <code>``</code> within replace. As of current because it's inside a loop <code>.each</code> it will find the correct word but then add <code>&lt;span&gt;&lt;/span&gt;</code> around that word like 6 times. I want it to only add it <em>onc...
<p>I'm guessing that your HTML looks something like this...</p> <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;pstad-descrptn-mirror&quot;&gt; &lt;div&gt; &lt;div&gt; &lt;div&gt; Take-away located in Brisbane, and comes with free chips &lt;/div&gt; &lt;/div&gt; &lt;/d...
Issue with `` within .replace() tags
javascript|jquery|replace
0
44
1
72,864,998
72,864,998
1
true
2022-07-05T04:01:09.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with `` within .replace() tags<p>How can I edit my current code to work with <code>``</code> within replace. As of current because it's inside a loop <...
72,800,229
Procedure to import excel file to access is erroring out after loop - MS Access Error 91: Object variable or With block variable not set<p>I'm getting an error message after the last loop runs in this procedure.The error is received after it cycles through the last worksheet in the excel workbook, and the line is &quot...
<p>As I tried suggesting in my above comment, it looks that the way you designed the code (probably, mostly based on macro recorder...), using an unjustified number of selecting, makes the code erroring on the respective line because of the fact that a <code>Next</code> sheet does not exist after the last one...</p> <p...
Procedure to import excel file to access is erroring out after loop - MS Access Error 91: Object variable or With block variable not set
excel|vba|ms-access
0
44
1
72,801,377
72,801,377
1
true
2022-06-29T10:57:51.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Procedure to import excel file to access is erroring out after loop - MS Access Error 91: Object variable or With block variable not set<p>I'm getting an err...
72,773,005
geom_text() is not labeling geom_col correctly<p>I am trying to label columns with geom_text() on a geom_col() however, the labels (numbers) are not printing out correctly, nor positioning the way I would like them to. vjust does not seem to be working as I wanted the labels to be at the top of the columns (inside them...
<p>Without your data, it is difficult to be sure, but it seems that your problem is that you are creating your columns by stacking thousands of different distances on top of each other to get the total distance ridden on the y axis. This would be fine, except that you are then trying to plot a label for each individual...
geom_text() is not labeling geom_col correctly
r|ggplot2|geom-text|geom-col
0
44
1
72,773,336
72,773,336
2
true
2022-06-27T13:33:34.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: geom_text() is not labeling geom_col correctly<p>I am trying to label columns with geom_text() on a geom_col() however, the labels (numbers) are not printing...
72,773,212
Getting the week number from a Timestamp in SQL<p>I have a field which displays a timestamp <code>'mm/dd/yyyy hh:mi:ss'</code>. I am trying to extract the Isoweek number from this field unsuccessfully receiving a variant of error messages depending on the formula I have used.</p> <p>Hi, I hope someone can assist.</p> <...
<p>Use the same format as the string (with <code>HH24</code> for a 24-hour clock, rather than <code>HH</code> or <code>HH12</code> which are for 12-hour clocks):</p> <pre class="lang-sql prettyprint-override"><code>SELECT to_char(to_date(Datestamp, 'MM/DD/YYYY HH24:MI:SS'), 'IW') FROM table_name; </code></pre> <p><em...
Getting the week number from a Timestamp in SQL
sql|oracle|datetime|hyperion
0
44
3
72,773,522
72,773,522
2
true
2022-06-27T13:48:50.603Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the week number from a Timestamp in SQL<p>I have a field which displays a timestamp <code>'mm/dd/yyyy hh:mi:ss'</code>. I am trying to extract the Is...
72,774,025
UnboundLocalError while running in else case in python<p>I wrote a function that looking for some strings in text file which defined as &quot;keys&quot;, In case that all the keys has found, the function will return True and will print ok.</p> <p>If a specific key isn't found, the function will append the checked key ...
<p>I would also suggest to clean up your code something like below. Since you do not use the flags anywhere else in your code (apparently), it would be sufficient just to check for the existence of the keys and then append.</p> <pre><code>def pre_conditions(): with open(NR_log, 'r') as logfile: name_key = recipe_na...
UnboundLocalError while running in else case in python
python
0
44
2
72,774,202
72,774,202
2
true
2022-06-27T14:45:16.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UnboundLocalError while running in else case in python<p>I wrote a function that looking for some strings in text file which defined as &quot;keys&quot;, In ...
72,772,325
In the ARM ABI, how are global variables accessed?<p>I am writing a simple multitasking OS for the ARM Cortex M3. My threads always run using the Process Stack Pointer. I have an application that I inherited and that uses global variables. I am trying to call the functions in that application from my threading code but...
<p>Global variables have nothing to do with the stack, even static locals.</p> <p>So you need to just look at the output of the compiler, it will tell you everything.</p> <p>Your question is very vague you could be asking one of many different questions. I will show some basics and maybe I will get lucky.</p> <p>Note ...
In the ARM ABI, how are global variables accessed?
arm|abi
1
44
1
72,776,814
72,776,814
2
true
2022-06-27T12:45:00.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In the ARM ABI, how are global variables accessed?<p>I am writing a simple multitasking OS for the ARM Cortex M3. My threads always run using the Process Sta...
72,781,840
What widget(s) should be used for creating rows after named section in Flutter?<p>I want to implement rows after named section, something like in Android phone contacts:</p> <p><a href="https://i.stack.imgur.com/zLMqx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zLMqx.png" alt="enter image descrip...
<p>You can use MixedList by customising this example (<a href="https://docs.flutter.dev/cookbook/lists/mixed-list#interactive-example" rel="nofollow noreferrer">provided by Flutter Official Documentation</a>)</p> <pre><code>import 'package:flutter/material.dart'; void main() { runApp( MyApp( items: List&lt...
What widget(s) should be used for creating rows after named section in Flutter?
flutter|dart
0
44
1
72,781,976
72,781,976
2
true
2022-06-28T06:47:43.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What widget(s) should be used for creating rows after named section in Flutter?<p>I want to implement rows after named section, something like in Android pho...
72,787,135
How to explicitly tell compiler to choose exactly one parameter template during template pack expansion?<p>I'm trying using pack parameter template to fit some cases. I want to stop the template packed parameter expanding when there is only one parameter in the list. I want to use the typename explicitly when instancin...
<p>You can constrain the variadic version of the function with <a href="https://en.cppreference.com/w/cpp/language/sfinae" rel="nofollow noreferrer">SFINAE</a> to stop it from being called if the parameter pack is empty. That would look like</p> <pre><code>template &lt;class T, class... Args, std::enable_if_t&lt;(size...
How to explicitly tell compiler to choose exactly one parameter template during template pack expansion?
c++|templates
2
44
1
72,787,448
72,787,448
2
true
2022-06-28T13:16:01.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to explicitly tell compiler to choose exactly one parameter template during template pack expansion?<p>I'm trying using pack parameter template to fit so...
72,787,574
Can we identify the current element content in HTML?<p>Is there any way to get the content of an HTML element -where the function is called- without having to identify it by ID or class name ?</p> <p>example instead of using :</p> <pre><code>&lt;button class=&quot;colm&quot; type=&quot;button&quot; onclick=&quot;show('...
<p>There are a couple ways, the simplest include:</p> <p>Passing <code>this</code> to the inline event handler:</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>function showCon...
Can we identify the current element content in HTML?
javascript
0
44
4
72,787,671
72,787,671
2
true
2022-06-28T13:44:21.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we identify the current element content in HTML?<p>Is there any way to get the content of an HTML element -where the function is called- without having t...
72,786,224
Regroup elements of a list with the help of one other list<p>I solved this problem, but my solution is slow and I'm sure it's not optimal. Here is the problem:</p> <p>I have two lists. The first list contains dictionaries with id and some description (ids are unique; you can't have 2 dictionaries with the same id).</p>...
<p>Since the IDs are unique, you can make a lookup dict based on them, then just use a list comprehension over <code>l2</code>.</p> <pre><code>lookup = {d['id']: d for d in l1} result = [[lookup[e] for e in sublist] for sublist in l2] </code></pre> <p>Result:</p> <pre><code>[[{'id': 259, 'des': '...'}, {'id': 2, 'des':...
Regroup elements of a list with the help of one other list
python|list|dictionary
1
44
1
72,788,007
72,788,007
2
true
2022-06-28T12:13:12.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regroup elements of a list with the help of one other list<p>I solved this problem, but my solution is slow and I'm sure it's not optimal. Here is the proble...
72,795,136
What is the goal of declaring an array with an offset? [8:1] instead of [7:0]<p>What is the goal of declaring an array with an offset? <code>[8:1]</code> instead of <code>[7:0]</code></p> <p>I'm used to declare my signals with <code>reg [7:0] sig;</code> for an 8b signal.</p> <p>Declaring <code>reg [8:1] sig;</code> or...
<p>It depends on the logic you want to create that addresses each individual bit (you might want to read this article on <a href="https://www.techtarget.com/searchnetworking/definition/big-endian-and-little-endian" rel="nofollow noreferrer">Big-Endian versus Little-Endian</a>. If you don't need to select individual bit...
What is the goal of declaring an array with an offset? [8:1] instead of [7:0]
verilog|system-verilog
1
44
1
72,795,420
72,795,420
2
true
2022-06-29T02:28:44.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the goal of declaring an array with an offset? [8:1] instead of [7:0]<p>What is the goal of declaring an array with an offset? <code>[8:1]</code> ins...
72,792,683
CollectionSizeQuota and DocumentQuota in Cosmos DB SDK v3<p>I am currently working on migrate Azure Cosmos DB sdk v2 to v3. In my previous codes, there are some usage like:</p> <pre><code>using Microsoft.Azure.Document.Client public string functionA(ResourceResponse&lt;T&gt; response) { return string.Format( &...
<p>These are available as part of headers with container operation. You will need to enable <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.containerrequestoptions.populatequotainfo?view=azure-dotnet" rel="nofollow noreferrer">PopulateQuotaInfo</a> in the request and use the header values li...
CollectionSizeQuota and DocumentQuota in Cosmos DB SDK v3
azure-cosmosdb
1
44
1
72,797,245
72,797,245
2
true
2022-06-28T20:18:36.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CollectionSizeQuota and DocumentQuota in Cosmos DB SDK v3<p>I am currently working on migrate Azure Cosmos DB sdk v2 to v3. In my previous codes, there are s...
72,800,865
KeyError while retrieving random parameter from dictionary<p>So currently im working on a black jack game where cards are put in a dictionary and each starting deck has a random card taken from the dictionary but when i execute the code i get a keyerror</p> <p>code</p> <pre><code># Black Jack import random from art imp...
<p><a href="https://docs.python.org/3/library/random.html#random.choice" rel="nofollow noreferrer"><code>random.choice(seq)</code></a> does</p> <blockquote> <p>Return a random element from the non-empty sequence <em>seq</em>.</p> </blockquote> <p>and you give it <code>dict</code> which is not <a href="https://docs.pyth...
KeyError while retrieving random parameter from dictionary
python|dictionary|random
0
44
2
72,800,977
72,800,977
2
true
2022-06-29T11:44:35.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KeyError while retrieving random parameter from dictionary<p>So currently im working on a black jack game where cards are put in a dictionary and each starti...
72,805,116
How do I split a list with fixed size number into another list?<p>So I have a loop in regex,</p> <pre><code>List&lt;String&gt; data = new ArrayList&lt;&gt;(); List&lt;String&gt; inputData = // String array Pattern pattern = Pattern.compile(regex); inputData.forEach(i -&gt; { Matcher matcher = pattern.matcher(i); ...
<p>If you want to split this list into sublist with fixed size - you can use Guava, or smth else</p> <p>You can find related docs here - <a href="https://guava.dev/releases/31.0-jre/api/docs/com/google/common/collect/Lists.html#partition(java.util.List,int)" rel="nofollow noreferrer">https://guava.dev/releases/31.0-jre...
How do I split a list with fixed size number into another list?
java|spring-boot
0
44
1
72,805,192
72,805,192
2
true
2022-06-29T16:49:46.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I split a list with fixed size number into another list?<p>So I have a loop in regex,</p> <pre><code>List&lt;String&gt; data = new ArrayList&lt;&gt;()...
72,810,237
How to pass a generic to a React component and use that generic within the component<p>I'm building an input component that takes a <code>displayName</code> that is a string and a <code>value</code> that should be a generic. It also takes a function as a prop that needs to fire and handle that generic value when the in...
<p>You don't actually need to make the <code>onChangeHandler</code> generic.</p> <pre class="lang-js prettyprint-override"><code>import React from 'react' interface MyInterfaceXYZ&lt;T&gt; { displayName: string value: T } interface MyComponentProps&lt;T&gt; { myFunctionThatTakesMyGeneric: (value: T) =&gt;...
How to pass a generic to a React component and use that generic within the component
reactjs|typescript
0
44
1
72,810,347
72,810,347
2
true
2022-06-30T04:13:41.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass a generic to a React component and use that generic within the component<p>I'm building an input component that takes a <code>displayName</code> ...
72,810,958
Google Sheets: Create 1D array of a combination of values repeated a different amount of times<p>I am trying to create an array in google sheets based on a combination of two text values. Or perhaps a better explanation is I need to provide a position X for value B in a 5 cell array of values A and output the resultant...
<p>Assuming that value 1 is in cell <code>A2</code>, value 2 in <code>B2</code> and the zero-indexed position in <code>C2</code>, use this formula in a free row:</p> <p><code>=arrayformula( if( sequence(1, 5, 0) = C2, B2, A2 ) )</code></p>
Google Sheets: Create 1D array of a combination of values repeated a different amount of times
arrays|google-apps-script|google-sheets|google-sheets-formula|array-formulas
0
44
1
72,811,023
72,811,023
2
true
2022-06-30T06:00:51.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheets: Create 1D array of a combination of values repeated a different amount of times<p>I am trying to create an array in google sheets based on a c...
72,811,652
The function can't be unconditionally invoked because it can be 'null'. Try adding a null check ('!')<pre><code>import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'packa...
<p>There's an issue in your getuid() function. Correct function will be like.</p> <pre><code>getuid() { final FirebaseAuth auth = FirebaseAuth.instance; final User? user = auth.currentUser; if (user != null) { setState(() { uid = user.uid; }); } } </code></pre>
The function can't be unconditionally invoked because it can be 'null'. Try adding a null check ('!')
flutter|firebase|visual-studio
0
44
1
72,811,888
72,811,888
2
true
2022-06-30T07:12:18.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The function can't be unconditionally invoked because it can be 'null'. Try adding a null check ('!')<pre><code>import 'package:cloud_firestore/cloud_firesto...
72,812,226
JS finding extreme values in object<p>I need to find extreme values in an object with given average number but honestly I have no idea how to approach to this problem. so I have an object and average with values like that:</p> <pre><code>const avg = 0.5; const myjson = { 'key1': 0.5, 'key2': 0.8, 'key3': 0.3, 'key4...
<p>you can do something like this <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const myjson = { 'key1': 0.5, 'key2': 0.8, 'key3': 0.3, 'key4': 0.2, 'key5': 0.5, }; const ext...
JS finding extreme values in object
javascript|json
-2
44
2
72,812,304
72,812,304
2
true
2022-06-30T07:59:11.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS finding extreme values in object<p>I need to find extreme values in an object with given average number but honestly I have no idea how to approach to thi...
72,820,213
Entity Relationship diagram interpretations of a inventory database<p>This is a Entity relationship diagram of Inventory database. <a href="https://i.stack.imgur.com/bVXpt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bVXpt.png" alt="ER Diagram" /></a> How we can interpret it? my idea is like there...
<p>This diagram says that &quot;products&quot; are &quot;purchased&quot; from &quot;suppliers&quot; and &quot;ordered&quot; by customers (which are only named in the orders table and do not have a separate entity).</p>
Entity Relationship diagram interpretations of a inventory database
sql|database|database-design|entity-relationship
1
44
1
72,820,282
72,820,282
2
true
2022-06-30T18:03:50.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Relationship diagram interpretations of a inventory database<p>This is a Entity relationship diagram of Inventory database. <a href="https://i.stack.i...
72,831,597
How do I count two unique values in one column based on another?<p>If anyone could help with this would be appreciated. I am trying to add two new variables to<br /> my existing DF (*Grade1Sum and *Grade2Sum) summing each film's grade (ET got graded one three times so the *Grade1Sum total is always equal to 3 for exam...
<p>Here is one way to do it</p> <pre><code>df %&gt;% group_by(Film) %&gt;% mutate(Grade1Sum=sum(Grade[Grade==1]), Grade2Sum=sum(Grade[Grade==2])) </code></pre> <p>Here is a more flexible way to do it</p> <pre><code>df %&gt;% group_by(Film, Grade) %&gt;% summarise(Sum=sum(Grade)) %&gt;% pivot_wider(name...
How do I count two unique values in one column based on another?
r|variables|unique
0
44
1
72,831,947
72,831,947
2
true
2022-07-01T15:36:15.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I count two unique values in one column based on another?<p>If anyone could help with this would be appreciated. I am trying to add two new variables ...
72,828,392
Pyspark conditional running window<p>I have a dataframe which looks like this</p> <pre><code>starttime | endtime | 2022-01-01 03:25:53 | 2022-01-01 03:25:52 | 2022-01-01 03:25:53 | 2022-01-01 03:25:52 | 2022-01-01 03:25:53 | 2022-01-01 03:25:52 | 2022-01-01 03:25:55 | 2022-01-01 03:25:54 | 2022-01...
<p>From what I understand the entries will be ordered by starttime and when difference between starttime and next endtime is greater than second we need group +1.</p> <p>So based on above requirement we can use lag and running sum to achieve the same</p> <pre><code>test=spark.createDataFrame([(&quot;2022-01-01 03:25:53...
Pyspark conditional running window
python|apache-spark|pyspark|apache-spark-sql
-2
44
1
72,834,089
72,834,089
2
true
2022-07-01T11:13:22.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pyspark conditional running window<p>I have a dataframe which looks like this</p> <pre><code>starttime | endtime | 2022-01-01 03:25:53 ...
72,835,974
Return Expression Check Condition in C++<p>Still getting used to the formatting when writing C++ code, come from a Lua background. How do I correctly format a if/conditional expressions as my example highlights below.</p> <p>This will correctly run, but with warnings which is unideal:</p> <pre><code>return (boolean == ...
<p><code>and</code> and <code>or</code> are keywords are considered a bit archaic. They are technically valid C++ keywords in modern C++ (since C++98 it seems). You must be using a very old C++ compiler that was written before they were added to C++. They, and their usage, never took off. Classical <code>&amp;&amp;</co...
Return Expression Check Condition in C++
c++|expression
2
44
1
72,836,053
72,836,053
2
true
2022-07-02T02:02:31.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return Expression Check Condition in C++<p>Still getting used to the formatting when writing C++ code, come from a Lua background. How do I correctly format ...
72,842,277
BottomNavigationBar index error (flutter)<p>I'm having an app with a bottom navigation bar:</p> <pre class="lang-dart prettyprint-override"><code> Widget build(BuildContext context) { print(&quot;current tab&quot;); print(currentTab?.index); //&lt;-- It's work!! --&gt; return BottomNavigationBar( ...
<p><code>currentIndex</code> doesn't take nullable int.</p> <p>Doing <code>currentTab?.index</code> means it is accepting null value. You can provide default value as 0 on null case like,</p> <pre class="lang-dart prettyprint-override"><code>currentIndex: currentTab?.index?? 0 </code></pre> <p>More about <a href="http...
BottomNavigationBar index error (flutter)
flutter|dart|dart-null-safety
0
44
2
72,842,465
72,842,465
2
true
2022-07-02T20:38:39.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BottomNavigationBar index error (flutter)<p>I'm having an app with a bottom navigation bar:</p> <pre class="lang-dart prettyprint-override"><code> Widget bui...
72,844,238
how to stop CountDownTimer in another Fragment?<p>I have three fragment, A -&gt; B -&gt; C. I started CountDownTimer in A fragment and want to stop it in C fragment. please help me!</p>
<p>Your best bet would be to use a ViewModel tied to the Activity of the Fragments (so shared between fragments), and start the CountDown there. Then in Fragment C you just need to get the same ViewModel and stop the CountDown from there. |</p> <p>For example, by using <code>implementation &quot;androidx.fragment:fragm...
how to stop CountDownTimer in another Fragment?
kotlin|countdowntimer
0
44
1
72,846,427
72,846,427
2
true
2022-07-03T06:02:27.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to stop CountDownTimer in another Fragment?<p>I have three fragment, A -&gt; B -&gt; C. I started CountDownTimer in A fragment and want to stop it in C f...
72,848,363
Regex match to check US State Code exist in string<p>I am large set of array from which I am trying to find the address</p> <p>For example this(State Code :- CO)</p> <pre><code>0 Site Address, San Luis, CO 81152 </code></pre> <p>Now to match this I am using this regex expression :-</p> <pre><code>e.match(/, CO \d/) </c...
<p>The most basic way to capture any state code would be to include a capture group with all the values you need to match.</p> <p>Ex:</p> <pre><code>e.match(/, (CO|NM|TN|MO) \d/) </code></pre> <p>Wrap the different state options in parentheses, and use the pipe symbol to indicate &quot;or&quot;.</p> <p>If you have all ...
Regex match to check US State Code exist in string
javascript|regex
0
44
2
72,848,421
72,848,421
2
true
2022-07-03T16:56:37.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex match to check US State Code exist in string<p>I am large set of array from which I am trying to find the address</p> <p>For example this(State Code :-...
72,850,013
Checking for existance of value in MySQL<p>I am developing a user authentication system with expressjs. Therefore to store user data i use a mysql database... When I query to my database I do it with this: <code>SELECT password FROM USERS WHERE email=EmailHere</code><br /> The problem with this is I dont know an elegan...
<p><strong>Ok it turns out:</strong></p> <p>If I check if the length of the rows Array &gt; 0 it fixes the problem. In the else statement I can just log out an error message to say the user does not exist. This could look something like this:</p> <pre><code>if (!rows.length &gt; 0) return res.status(400).send('User doe...
Checking for existance of value in MySQL
javascript|mysql|sql|express
1
44
1
72,850,186
72,850,186
2
true
2022-07-03T21:23:26.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checking for existance of value in MySQL<p>I am developing a user authentication system with expressjs. Therefore to store user data i use a mysql database.....
72,862,039
Type inference changing from unknown to known type after using method<p>I have a class with single generic <code>T</code>, where sometimes it may be constructed with a value so <code>T</code> is known, sometimes constructed without a value and so <code>T</code> is <code>unknown</code>. It is tedious to have to specify ...
<blockquote> <p>is there a way I could make it such that <code>any</code> is default?</p> </blockquote> <p>Yes, simply use a <a href="https://learntypescript.dev/06/l6-generic-parameter-defaults" rel="nofollow noreferrer">default type</a> for your generic:</p> <pre><code>class Foo&lt;T = any&gt; {} </code></pre> <p><a ...
Type inference changing from unknown to known type after using method
typescript|type-inference
3
44
2
72,862,386
72,862,386
2
true
2022-07-04T21:08:10.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Type inference changing from unknown to known type after using method<p>I have a class with single generic <code>T</code>, where sometimes it may be construc...
72,876,078
Node.js http module not closing the connection when no 'data' listener is set<p>Consider the following code:</p> <pre><code>const http = require('http') const req = http.request({hostname: 'www.example.com'}, res=&gt;{ console.log('Response received') res.on('data',data=&gt;{ console.log('Received: '+data) }...
<p>Streams in node.js (which a HTTP Response is) start in &quot;paused&quot; mode. They wait for someone to read them, either through calls to <code>read</code> or by changing into &quot;flowing&quot; mode in which they continuously emit <code>data</code> events. Attaching an handler to the <code>data</code> event auto...
Node.js http module not closing the connection when no 'data' listener is set
javascript|node.js|http|events|https
0
44
1
72,876,111
72,876,111
2
true
2022-07-05T22:13:12.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node.js http module not closing the connection when no 'data' listener is set<p>Consider the following code:</p> <pre><code>const http = require('http') con...
72,887,344
.SDcols does on work on x.colname and i.colname prefixes<p>I am trying to use a variable that has the column names of a <code>data.table</code> that is the outcome of a <code>non-equi join</code>.</p> <p>If I use <code>.SDcols</code> to define the column names it throws an error on the prefixed column names.</p> <p>How...
<p>Try this:</p> <pre><code>colnames = c(&quot;x.height&quot;,&quot;i.height&quot;) dt1[dt2 , on = .(height &lt; height, weight &gt; weight) , nomatch = 0 , mget(colnames) ] </code></pre>
.SDcols does on work on x.colname and i.colname prefixes
r|data.table
1
44
2
72,888,579
72,888,579
2
true
2022-07-06T16:58:43.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .SDcols does on work on x.colname and i.colname prefixes<p>I am trying to use a variable that has the column names of a <code>data.table</code> that is the o...
72,888,517
Add border to all images<p>I have a document that has a handful of figures in it, and I am using</p> <pre><code>\tcbox{\includegraphics{./Pictures/image-name.png}} </code></pre> <p>to put a border around them. I end up repeating this for every image though. Is there a way to put something at the top of my document that...
<p>If nothing else in your document relies on <code>\includegraphics</code>, you could try the following redefinition:</p> <pre><code>\documentclass{article} \usepackage[most]{tcolorbox} \let\includegraphicsold\includegraphics \renewcommand{\includegraphics}[2][]{\tcbox{\includegraphicsold[#1]{#2}}} \begin{document}...
Add border to all images
latex
2
44
1
72,889,179
72,889,179
2
true
2022-07-06T18:46:03.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add border to all images<p>I have a document that has a handful of figures in it, and I am using</p> <pre><code>\tcbox{\includegraphics{./Pictures/image-name...
72,900,733
Subtract two timestamptz values and insert the result into a third column<p>I have the following table:</p> <pre><code>CREATE TABLE duration ( departure_time TIMESTAMPTZ, arrival_time TIMESTAMPTZ, duration TIME NOT NULL, -- Not sure about the datatype.. flight_id INT UNIQUE NOT NULL, CHECK (scheduled_duration &gt;...
<p>Use a generated column</p> <pre><code>CREATE TABLE duration ( departure_time TIME WITH TIME ZONE, arrival_time TIME WITH TIME ZONE, scheduled_duration INT, flight_id INT, duration2 TIME GENERATED ALWAYS AS (&quot;arrival_time&quot;::time - &quot;departure_time&quot;::time) STORED, CHECK (scheduled_duration &gt; 0)...
Subtract two timestamptz values and insert the result into a third column
sql|database|postgresql
1
44
2
72,901,152
72,901,152
2
true
2022-07-07T15:42:40.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subtract two timestamptz values and insert the result into a third column<p>I have the following table:</p> <pre><code>CREATE TABLE duration ( departure_time...
72,905,098
google sheets regex multiply values in cell by integer in in same cell<p>I struggled to find something to answer this, perhaps I'm simply looking for the wrong question:</p> <p>I have a field that people may put a string into, such as:</p> <pre><code>colA G7 2xC55 1xG7 G7 C55 </code></pre> <p>I'm attempting to compare...
<p>try:</p> <pre><code>=ARRAYFORMULA(QUERY(IFNA(FLATTEN(SPLIT(FLATTEN(REPT(REGEXEXTRACT(SPLIT(A1:A4, &quot; &quot;), &quot;(?:\d+x)?(.+)&quot;)&amp;&quot;×&quot;, IFNA(REGEXEXTRACT(SPLIT(A1:A4, &quot; &quot;), &quot;(\d+)x&quot;), 1)*1)), &quot;×&quot;))), &quot;select Col1,count(Col1) where Col1 is not null group ...
google sheets regex multiply values in cell by integer in in same cell
google-sheets|count|google-sheets-formula|flatten
1
44
1
72,905,410
72,905,410
2
true
2022-07-07T23:07:58.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: google sheets regex multiply values in cell by integer in in same cell<p>I struggled to find something to answer this, perhaps I'm simply looking for the wro...
72,910,856
How much realtime updating Firestore is possible?<p>There is a group chat with 1000 people. These people listen to real-time updates to the same collection. If these all 1000 people keep chatting fastly like for an hour. All huge chat data could be updated without any problems? And also real-time listener could reflect...
<p>If you attach a <a href="https://firebase.google.com/docs/firestore/query-data/listen" rel="nofollow noreferrer">real-time listener</a> to a collection, all devices that are listening to that collection will be notified in real-time.</p> <blockquote> <p>All huge chat data could be updated without any problems?</p> <...
How much realtime updating Firestore is possible?
firebase|google-cloud-platform|google-cloud-firestore
1
44
1
72,912,284
72,912,284
2
true
2022-07-08T11:40:57.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How much realtime updating Firestore is possible?<p>There is a group chat with 1000 people. These people listen to real-time updates to the same collection. ...
72,915,697
Remove duplicate certain column values Javascript 2D array<p>I have an array for example :</p> <pre><code>var array = [ [ 1, &quot;Hello&quot;, &quot;red&quot;, 0, &quot;yes&quot;], [ 2, &quot;Hello&quot;, &quot;red&quot;, 1, &quot;no&quot;], [ 3, &quot;Hello&quot;, &quot;blue&quot;, 4, &quot;no&quot;], ...
<p>You could take a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set" rel="nofollow noreferrer"><code>Set</code></a> with a function which builds a key of the wanted indices.</p> <p>After checking the set with the combined key, add either the key and return the actual data s...
Remove duplicate certain column values Javascript 2D array
javascript|google-apps-script
2
44
1
72,915,945
72,915,945
2
true
2022-07-08T18:39:33.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove duplicate certain column values Javascript 2D array<p>I have an array for example :</p> <pre><code>var array = [ [ 1, &quot;Hello&quot;, &quot;re...
72,919,715
How should I break the loop in this problem?<p>The problem:</p> <p>We have to create a game, where a user inputs the number of pencils they want to use. Expand your program by creating a loop. Each player takes turns removing pencils until 0 pencils remain on the table. Each iteration prints 2 lines: lines with pencils...
<p>The following code should work:</p> <pre><code>number_of_pencil = int(input(&quot;How many pencils would you like to use: &quot;)) person = input(&quot;Who will be the first (John, Jack): &quot;) print(&quot;|&quot; * number_of_pencil) while number_of_pencil &gt; 1: if person == &quot;John&quot;: print(...
How should I break the loop in this problem?
python
3
44
1
72,919,754
72,919,754
2
true
2022-07-09T07:31:37.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How should I break the loop in this problem?<p>The problem:</p> <p>We have to create a game, where a user inputs the number of pencils they want to use. Expa...
72,920,942
Implicit conversion of Int* to custom class in function call<p>I have a custom type <code>MySeq</code> extending <code>IndexedSeq[Int]</code> and its <code>implicit</code> conversion:</p> <pre class="lang-scala prettyprint-override"><code>package example import scala.language.implicitConversions class MySeq(vals: Ind...
<p>You can implicitly convert only 1 value to another 1 value, you cannot use conversion to &quot;overload&quot; unary method into variadic method.</p> <p>You could implement conversions so that</p> <pre><code>foo(Seq(1, 2, 3)) </code></pre> <p>would become</p> <pre><code>foo(MySeq.seq2MySeq(Seq(1, 2, 3)) </code></pre>...
Implicit conversion of Int* to custom class in function call
scala|implicit-conversion|scala-2.13
0
44
2
72,921,051
72,921,051
2
true
2022-07-09T11:22:56.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implicit conversion of Int* to custom class in function call<p>I have a custom type <code>MySeq</code> extending <code>IndexedSeq[Int]</code> and its <code>i...
72,920,933
What does this error mean: "got logits shape [3,3] and labels shape [33]"?<p>I created two random arrays in NumPy and then I used <code>x</code> and <code>y</code> in <code>model.fit()</code> but I got this error:</p> <blockquote> <p>Node: 'sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/SparseSoftm...
<p>You need to consider multiple steps:</p> <ol> <li>The shape of x, y should be equal in the first dimension. you have error here.</li> <li>Read Doc <a href="https://numpy.org/devdocs/reference/random/generated/numpy.random.randint.html" rel="nofollow noreferrer"><code>numpy.random.randint</code></a>. you write <code>...
What does this error mean: "got logits shape [3,3] and labels shape [33]"?
python|tensorflow|keras
1
44
1
72,921,126
72,921,126
2
true
2022-07-09T11:20:27.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does this error mean: "got logits shape [3,3] and labels shape [33]"?<p>I created two random arrays in NumPy and then I used <code>x</code> and <code>y<...
72,921,906
Calendar like plot with highlighted some consecutive days in R<p>I have daily time-series data for 35 years about the presence and absence of rainfall in winter seasons for around 10 stations. Following is the part of data of one station where, in the third column, 1 indicates the presence and 0 indicates the absence o...
<p>Here's an approach using <code>dplyr</code>. Within each stat_year, I make a new group every time it switches between rain and no rain. Then I track the start and end of each of those groups. I keep rainy groups at least three days.</p> <p>Then we can plot that using <code>geom_rect</code> using that data set. To al...
Calendar like plot with highlighted some consecutive days in R
r
0
44
1
72,923,147
72,923,147
2
true
2022-07-09T13:50:04.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calendar like plot with highlighted some consecutive days in R<p>I have daily time-series data for 35 years about the presence and absence of rainfall in win...
72,923,398
TwoFer program Bug<p>I ran into a problem while writing the TwoFer program <a href="https://i.stack.imgur.com/mUHNW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mUHNW.jpg" alt="enter image description here" /></a></p> <p>This is the program's code</p> <pre><code>public static class TwoFer { pu...
<p>Your <code>Speak(string)</code> method is missing a return type:</p> <pre class="lang-cs prettyprint-override"><code>public static String Speak(string h) // Here ------^ </code></pre>
TwoFer program Bug
c#|compiler-errors|compiler-construction|google-closure-compiler|decompiler
-2
44
1
72,923,411
72,923,411
2
true
2022-07-09T17:24:53.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TwoFer program Bug<p>I ran into a problem while writing the TwoFer program <a href="https://i.stack.imgur.com/mUHNW.jpg" rel="nofollow noreferrer"><img src="...
72,932,434
How can I transform a single json object into json array?<p>My axios api returns a JSON object in the format as follow.</p> <pre><code>{ &quot;GROUP&quot;: &quot;Group&quot;, &quot;NTH_PRODUCT_AFTER_M&quot;: &quot;Nth Product After M&quot;, &quot;CART_DISCOUNT&quot;: &quot;Cart Discount&quot;, &quot;EAC...
<p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries" rel="nofollow noreferrer">Object.entries()</a> to create an array of key / value pairs then map that to the structure you want</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true"...
How can I transform a single json object into json array?
javascript|reactjs|json|axios
-2
44
2
72,932,450
72,932,450
2
true
2022-07-10T23:07:02.860Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I transform a single json object into json array?<p>My axios api returns a JSON object in the format as follow.</p> <pre><code>{ &quot;GROUP&quot...
72,937,350
Unable to access field that has hyphen in it<p>I am struggling to write a firebase rule that is checking the user id that is stored in a document. Hardcoding a given value as a string works</p> <pre><code>allow write: if request.auth.uid == 'user-id-hardcoded'; </code></pre> <p>,however I am unable to find a way to dyn...
<p>If your field name in document contains a hyphen then use the brackets notation instead:</p> <pre><code>allow write: if request.auth.uid == resource.data[&quot;user-id&quot;]; </code></pre>
Unable to access field that has hyphen in it
firebase|google-cloud-firestore|firebase-security
2
44
2
72,937,531
72,937,531
2
true
2022-07-11T10:48:04.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to access field that has hyphen in it<p>I am struggling to write a firebase rule that is checking the user id that is stored in a document. Hardcoding...
72,942,634
How to bind two tables where the row name of the second table matches the values in a column of the first table?<p>I am trying to append a table with limits for the values of another table according to the matrix and analyte of the value.</p> <p><strong>Table One</strong> has columns including <em>Matrix</em> (Fish or ...
<p>If your <code>limits</code> object is a data.frame (see input below), you can do this, using <code>dplyr</code></p> <pre><code>library(dplyr) Results %&gt;% left_join( bind_rows( limits %&gt;% mutate(Matrix = &quot;Fish&quot;) %&gt;% mutate(Floc_PEC = NA, Floc_TEC=NA), limits %&gt;% mutate(Matrix...
How to bind two tables where the row name of the second table matches the values in a column of the first table?
r
1
44
1
72,943,618
72,943,618
2
true
2022-07-11T17:43:29.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bind two tables where the row name of the second table matches the values in a column of the first table?<p>I am trying to append a table with limits ...
72,941,745
How to follow the next page but only up to a certain page in scrapy python<p>So I am scraping some real estate prices but I only want the data before a certain date say 2010, which means I need to follow the next page only up to a certain page. How do I go about to achieve this?</p> <p>I can get the page that I want to...
<p>Scrapy provides the Close spider extension.</p> <blockquote> <p>class scrapy.extensions.closespider.CloseSpider</p> <blockquote> <p>Closes a spider automatically when some conditions are met, using a specific closing reason for each condition.</p> </blockquote> </blockquote> <p>By enabling the extension you get acce...
How to follow the next page but only up to a certain page in scrapy python
python|scrapy
2
44
1
72,945,464
72,945,464
2
true
2022-07-11T16:28:22.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to follow the next page but only up to a certain page in scrapy python<p>So I am scraping some real estate prices but I only want the data before a certa...
72,947,401
how to render if else and else if statement in react functional component<pre><code>const GharwapasiForm = () =&gt; { const [activeStep,setActiveStep] = useState(0); const steps = [ 'Click Your Photo', 'Personal Details', 'Submit Application', ]; return ( &lt;FormContainer className='row'&g...
<p>I think the clean way (not to compose ternary operators) is to create a component.</p> <p>Example:</p> <pre><code>const StepTitle = ({ step }} =&gt; { if (step === 1) { return &lt;span&gt;step one&lt;/span&gt; } if (step === 2) { return &lt;span&gt;This is the step two&lt;/span&gt; } return &lt;spa...
how to render if else and else if statement in react functional component
javascript|reactjs
1
44
3
72,947,499
72,947,499
2
true
2022-07-12T05:27:28.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to render if else and else if statement in react functional component<pre><code>const GharwapasiForm = () =&gt; { const [activeStep,setActiveStep] = u...
72,955,978
Check for message content returns anything that includes the word<p>I need my bot to reply when someone says Hi or Hello, but when someone says a word including the letters 'hi' it will also respond to it, any way to fix this and tell the code to look for the exact word only? I'm using a very simple code ofcourse:</p> ...
<p>You can use regular expressions</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; import re &gt;&gt;&gt; check_hello = re.compile(r&quot;^\bhi\b|\bhello\b&quot;, re.IGNORECASE) &gt;&gt;&gt; re.search(check_hello, &quot;Hi,de&quot;) &lt;re.Match object; span=(0, 2), match='Hi'&gt; &gt;&gt;&gt; re.searc...
Check for message content returns anything that includes the word
python|discord|discord.py
-1
44
3
72,956,302
72,956,302
2
true
2022-07-12T17:05:09.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for message content returns anything that includes the word<p>I need my bot to reply when someone says Hi or Hello, but when someone says a word includ...
72,956,811
In Enterprise Architect What does it mean if the package icon has a red one?<p>We have a remote repository in postgres which is accessed by ODBC, no process or permission is blocked, but some time ago one of the packages appears with a red mark, as shown below</p> <p><img src="https://i.stack.imgur.com/tpvPr.png" alt="...
<p>That means this package is marked as a namespace root.<br /> You can set this property using the option<br /> <strong>Develop | Source Code | Options | Set Package as Namespace Root</strong> <a href="https://i.stack.imgur.com/RraNd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RraNd.png" alt="en...
In Enterprise Architect What does it mean if the package icon has a red one?
enterprise-architect
0
44
1
72,958,019
72,958,019
2
true
2022-07-12T18:22:47.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Enterprise Architect What does it mean if the package icon has a red one?<p>We have a remote repository in postgres which is accessed by ODBC, no process ...
72,958,172
Groupby and compare columns<p>What is the simplest way to compare two columns using groupby - without apply/lambda?</p> <pre><code>df product1 product2 person 0 apple apples abby 1 apple apple abby ... </code></pre> <pre><code>df.groupby(&quot;person&quot;).product1.eq(df.groupby(&quot;person&quot;...
<p>A bit tricky to solve without <code>apply</code> but you can use <code>merge</code> to compare ('person', 'product2) to ('person', 'product1'):</p> <pre><code>idx = (df.rename(columns={'product2': 'product'})[['person', 'product']].reset_index() .merge(df.rename(columns={'product1': 'product'})[['person', '...
Groupby and compare columns
python|pandas|pandas-groupby
-1
44
1
72,958,661
72,958,661
2
true
2022-07-12T20:44:03.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Groupby and compare columns<p>What is the simplest way to compare two columns using groupby - without apply/lambda?</p> <pre><code>df product1 product2 per...
72,958,917
If then conditional logic in regex in python<p>I am attempting to implement a conditional statement within regex, applied via the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.extractall.html" rel="nofollow noreferrer">pandas.Series.str.extractall</a> method. Given the reading I'...
<p>To get the matches, you don't need a conditional.</p> <p>If a, then also match b.. else match c, can be written as:</p> <pre><code>\b(?:ab|c)\b </code></pre> <p><a href="https://regex101.com/r/EoZA9S/1" rel="nofollow noreferrer">Regex demo</a></p>
If then conditional logic in regex in python
python|pandas|regex|conditional-statements|series
1
44
2
72,959,422
72,959,422
2
true
2022-07-12T22:14:11.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If then conditional logic in regex in python<p>I am attempting to implement a conditional statement within regex, applied via the <a href="https://pandas.pyd...
72,965,046
Dynamic variables based on condition<p>I'm trying to make the property value of an object to be dynamic based on a given condition.</p> <p>For example, the property value would become <code>Red</code> if the viewport width is <code>&lt;= 1280</code> , else it would be <code>Yellow</code> .</p> <p>I'm trying to use the ...
<p>Use a ternary operator to do it cleaner.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const data = { apple: document.documentElement.clientWidth &lt;= 1280 ? "Red" : "Y...
Dynamic variables based on condition
javascript
1
44
3
72,965,093
72,965,093
2
true
2022-07-13T10:49:20.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dynamic variables based on condition<p>I'm trying to make the property value of an object to be dynamic based on a given condition.</p> <p>For example, the p...
72,966,089
How to zip images to images as targets in tf.data.Dataset<p>I'm trying to train an CNN autoencoder model on a pretty big dataset so I'm using tf.data.Dataset. I've been trying to zip the train images so that I can use the images themselves as targets. I tried doing it like this:</p> <pre><code>train_dataset_target = tf...
<p>Maybe set the <code>shuffle</code> parameter of <code>tf.keras.preprocessing.image_dataset_from_directory</code> to <code>False</code> for <code>train_dataset_target</code> and <code>train_dataset_images</code> and call shuffle after zipping:</p> <pre><code>train_dataset = tf.data.Dataset.zip((train_dataset_target, ...
How to zip images to images as targets in tf.data.Dataset
python|tensorflow|keras|tensorflow-datasets|autoencoder
2
44
1
72,966,203
72,966,203
2
true
2022-07-13T12:11:43.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to zip images to images as targets in tf.data.Dataset<p>I'm trying to train an CNN autoencoder model on a pretty big dataset so I'm using tf.data.Dataset...
72,974,102
How to accept str.chars() or str.bytes() in a function and iterate twice?<p>Is there any way to pass <code>somestring.chars()</code> or <code>somestring.bytes()</code> to a function and allow that function to reconstruct the iterator?</p> <p>An example is below. The goal is for the function to be able to iterate throug...
<p>This can work but not the way you have it written.</p> <p>You can't iterate a shared reference because <code>Iterator::next()</code> takes <code>&amp;mut self</code>. <code>IntoIterator::into_iter()</code> <em>could</em> be made to work with e.g. <code>&amp;Chars</code>, but that's not necessary because <code>Chars...
How to accept str.chars() or str.bytes() in a function and iterate twice?
string|rust|iteration|traits
1
44
1
72,974,145
72,974,145
2
true
2022-07-14T00:53:09.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to accept str.chars() or str.bytes() in a function and iterate twice?<p>Is there any way to pass <code>somestring.chars()</code> or <code>somestring.byte...
72,979,549
Failed to retrieve data with axios get from a date (Reactjs)<p>I need to retrieve data based on a date. I tested my route with Postman and everything works fine. However, when I do my axios query with a date, it returns an empty array. I understood that it would be a date format problem with axios, but I couldn't solve...
<p>You're using the wrong type of request. A <strong>GET</strong> request can't include a body in the request, while a <strong>POST</strong> request can include a body in the request. Maybe you should check the documentation again and get the parameters sorted.</p>
Failed to retrieve data with axios get from a date (Reactjs)
javascript|reactjs|axios
0
44
2
72,979,637
72,979,637
2
true
2022-07-14T11:09:34.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed to retrieve data with axios get from a date (Reactjs)<p>I need to retrieve data based on a date. I tested my route with Postman and everything works f...
72,986,459
I am trying to write VBA code to unhide sheets in excel but not all hides sheets<p>i dont know why &quot;while loop &quot; doesn't work I dont want to unhide all sheets I need unhide by click button to unhide one sheet only and then click again to unhide another</p> <pre><code>For Each ws In ThisWorkbook.Worksheets ...
<p>To Unhide the first hidden each time it is run:</p> <pre><code>For Each ws In ThisWorkbook.Worksheets If ws.Visible = False Then ws.Visible = True Exit For End If Next </code></pre>
I am trying to write VBA code to unhide sheets in excel but not all hides sheets
excel|vba
0
44
1
72,986,559
72,986,559
2
true
2022-07-14T20:44:24.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am trying to write VBA code to unhide sheets in excel but not all hides sheets<p>i dont know why &quot;while loop &quot; doesn't work I dont want to unhide...
72,989,186
NodeJS + Express: Server cannot resolve GET, PUT, POST, or DELETE requests (Status 404)<p><code>server.js</code></p> <pre><code>const express = require('express') const dotenv = require('dotenv').config() const port = process.env.PORT ||9999 const goals = require('./routes/goalRoutes') const app = express() app.use('/...
<p>You've registered all your controllers as <a href="https://expressjs.com/en/guide/error-handling.html#writing-error-handlers" rel="nofollow noreferrer">error handling middleware</a>.</p> <blockquote> <p>Define error-handling middleware functions in the same way as other middleware functions, except error-handling fu...
NodeJS + Express: Server cannot resolve GET, PUT, POST, or DELETE requests (Status 404)
javascript|node.js|express
1
44
2
72,989,228
72,989,228
2
true
2022-07-15T04:52:55.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS + Express: Server cannot resolve GET, PUT, POST, or DELETE requests (Status 404)<p><code>server.js</code></p> <pre><code>const express = require('expr...
72,984,882
How to git know if a file is staged or commited?<p>The git <code>index</code> file stores the hash of the file, filename along with <a href="https://github.com/git/git/blob/867b1c1bf68363bcfd17667d6d4b9031fa6a1300/Documentation/technical/index-format.txt#L38" rel="nofollow noreferrer">other metadata</a> such as created...
<blockquote> <p>When we do <code>git status</code> how does git knows whether the file which already exists in the index is staged or committed since it stores hash of the file for both staged and commited files?</p> </blockquote> <p>This question fundamentally doesn't make sense. I think you're imagining Git is doing...
How to git know if a file is staged or commited?
git
0
44
2
72,994,041
72,994,041
2
true
2022-07-14T18:03:03.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to git know if a file is staged or commited?<p>The git <code>index</code> file stores the hash of the file, filename along with <a href="https://github.c...
73,004,023
How Can I align Text In Center<p>I am trying to create a Link with glyphicon and I want my Icon and text to aligned in center. I tried with padding and marging both but it moves both the icon and text and I want to move text only. This is my code</p> <p><div class="snippet" data-lang="js" data-hide="false" data-consol...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.quick-links{ margin-left: 15px; line-height: 2; font-family: 'arial rounded MT'; border:1px solid; } .text-posi...
How Can I align Text In Center
html|css|twitter-bootstrap
1
44
2
73,004,165
73,004,165
2
true
2022-07-16T12:02:18.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Can I align Text In Center<p>I am trying to create a Link with glyphicon and I want my Icon and text to aligned in center. I tried with padding and margi...
73,004,500
PostgresSQL: Validate specific value exists once in the column<p>I'm trying to check the uniqueness where for the same values in the column <strong>APP</strong> will exist only specific value in the column <strong>STATUS</strong>.</p> <p>Example: Each app can be only once &quot;true&quot;.<br /> APP cannot be a PRIMARY...
<p>Per @lemon suggestion in comments you could use a trigger or as an alternative:</p> <pre><code>create table unique_test ( id integer, app varchar, status boolean, unique(app, status)); insert into unique_test values (1, 'app1', null); insert into unique_test values (2, 'app2', null); insert into uniq...
PostgresSQL: Validate specific value exists once in the column
postgresql|indexing|constraints|unique
1
44
1
73,005,785
73,005,785
2
true
2022-07-16T13:09:57.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgresSQL: Validate specific value exists once in the column<p>I'm trying to check the uniqueness where for the same values in the column <strong>APP</stro...
73,014,053
How to make a computationally expensive row-wise operation into efficient vectorized one?<p>Fellow contributors, I have written a program that is meant to be applied on a data set of more than a million observations. At some point of the program I need to do row-wise operations on a pandas data frame where considering ...
<p>You can use <code>np.select</code></p> <pre class="lang-py prettyprint-override"><code>df['D'] = np.select( [df['A'].eq('Yes') &amp; df['B'].eq('Blue'), df['A'].eq('Yes') &amp; df['B'].eq('Red')], ['foo', 'bar'], 'foobar' ) </code></pre> <pre><code>print(df) A B C D 0 Yes Blu...
How to make a computationally expensive row-wise operation into efficient vectorized one?
python-3.x|pandas|dataframe
1
44
2
73,014,082
73,014,082
2
true
2022-07-17T17:47:10.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a computationally expensive row-wise operation into efficient vectorized one?<p>Fellow contributors, I have written a program that is meant to be...
73,015,322
Pandas: Row reduction via Groupby<p>For an example, I have a simple DataFrame like:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">index</th> <th style="text-align: left;">data1</th> <th style="text-align: left;">replace_me</th> <th style="text-align: left;">agg_m...
<p>Try this:</p> <pre><code>vc = df['ID'].map(df['ID'].value_counts()).gt(1) pd.concat([df.loc[~vc], df.loc[vc] .groupby(['ID',df.groupby('ID').cumcount().floordiv(2)]).agg( index = ('index','first'), data1 = ('data1','first'), replace_me = ('replace_me',lambda x: '(=)'), agg_me...
Pandas: Row reduction via Groupby
python|pandas
0
44
1
73,015,934
73,015,934
2
true
2022-07-17T20:59:52.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Row reduction via Groupby<p>For an example, I have a simple DataFrame like:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> ...
73,015,676
Extract Alt Text From Sheet Chart - Apps Script<p>Is there a way to extract the alt text of a Google Sheet Chart in Apps Script?</p> <pre><code>function extractAltText() { var chart = SpreadsheetApp.getActiveSheet().getCharts()[0] var chartOptions = chart.getOptions() var altText = chartOptions.get(&quot;altText&...
<p>Also, in my environment, <code>chartOptions.get(&quot;altText&quot;)</code> returns <code>null</code>. And, also, when the description is added with <code>setOption(&quot;altText&quot;, &quot;sample&quot;)</code>, the chart is broken, and I have confirmed the infinite loop for reopening the Spreadsheet occurred. So,...
Extract Alt Text From Sheet Chart - Apps Script
google-apps-script|google-sheets|google-sheets-api
1
44
1
73,016,091
73,016,091
2
true
2022-07-17T22:07:50.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract Alt Text From Sheet Chart - Apps Script<p>Is there a way to extract the alt text of a Google Sheet Chart in Apps Script?</p> <pre><code>function extr...
73,018,334
Quick reshaping of table in Excel<p>I'm new to using Excel/DAX.</p> <p>Just wondering if there would be a quicker way to format the table</p> <p><img src="https://i.stack.imgur.com/CHQw9.png" alt="Table 1" /></p> <p>What I'm trying to achieve, is getting the above table to be formatted the same as below</p> <p><img src...
<ol> <li>Load the table into <strong>PowerQuery</strong></li> <li>Select the first 2 columns</li> <li>In the <strong>Transform tab</strong> select from <strong>Unpivot other columns</strong></li> <li>There you go!</li> </ol> <p>Btw, it's a typical ETL step (hence PowerQuery) called <em>stacking</em> a table from <em>wi...
Quick reshaping of table in Excel
excel|powerquery|data-analysis
0
44
1
73,019,417
73,019,417
2
true
2022-07-18T06:56:48.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Quick reshaping of table in Excel<p>I'm new to using Excel/DAX.</p> <p>Just wondering if there would be a quicker way to format the table</p> <p><img src="ht...
72,822,220
Numpy: chained boolean indexing not properly updating boolean array without using np.where<p>I'm writing a simple root finder in NumPy that is designed to operate on entire NumPy arrays simultaneously. The basic idea of the solver is that the array <code>not_converged</code> is the size of all the data points while <co...
<p>The <code>np.where()</code> is equivalent to the following indexing.</p> <p>Note that <code>not_converged[not_converged][newly_converged]</code> is not a view into <code>not_converged</code>, it's a copy, so nothing should change.</p> <pre><code>not_converged = np.array([True, False, True]) # A previously not conver...
Numpy: chained boolean indexing not properly updating boolean array without using np.where
python|arrays|numpy
2
44
2
72,822,481
72,822,481
2
true
2022-06-30T21:28:23.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy: chained boolean indexing not properly updating boolean array without using np.where<p>I'm writing a simple root finder in NumPy that is designed to op...
73,030,503
Instantiation failure caused by function value with approximate constraint<pre><code>func GAddAll[E int, S ~[]E](e E, s S) S { copyS := make(S, len(s)) for i, v := range s { copyS[i] = v + e } return copyS } </code></pre> <p>For the above code, if I instantiate it like this, it will give an error when ru...
<p>Instantiation fails because <code>S ~[]E</code> has an approximate constraint, and there isn't enough type information to instantiate <code>S</code>.</p> <p>When you assign the function value with:</p> <pre><code>b := GAddAll[int] </code></pre> <p>the function is already being instantiated. Quoting the spec:</p> <bl...
Instantiation failure caused by function value with approximate constraint
go|generics
4
44
1
73,032,063
73,032,063
2
true
2022-07-19T02:34:13.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instantiation failure caused by function value with approximate constraint<pre><code>func GAddAll[E int, S ~[]E](e E, s S) S { copyS := make(S, len(s)) ...
72,863,923
Error importing a dictionary into the external file. Problem self and 'Dict' object has no attribute 'items'<p>I had a dictionary inside the same single python script file. The script worked fine, all right.</p> <p>I wanted to create an external file that contains the dictionary. Next, I imported the external file (dic...
<p>There are a couple of problems:</p> <ol> <li><p>On line 3, <code>dict_team = dictionary.Dict(self)</code>, it doesn't make sense to write <code>self</code> there. <code>self</code> is defined only in the class and is used to refer to the current instance. It isn't used <em>outside</em> a class, so you shouldn't be p...
Error importing a dictionary into the external file. Problem self and 'Dict' object has no attribute 'items'
python|python-3.x|dictionary|import|module
0
44
2
72,863,992
72,863,992
2
true
2022-07-05T04:12:05.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error importing a dictionary into the external file. Problem self and 'Dict' object has no attribute 'items'<p>I had a dictionary inside the same single pyth...
72,992,785
Solve Catastrophic Backtracking in my regex detecting Email<p>I have regex</p> <pre><code>/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,4})+$/ </code></pre> <p>for checking valid Email. It works, but GitHub's code scanner shows this error</p> <pre><code>This Part of the Regular Expression May Cause Exponential Backtracking on...
<p>A good place to start is this: <a href="https://stackoverflow.com/questions/12841970/how-can-i-recognize-an-evil-regex">How can I recognize an evil regex?</a></p> <p>As one of the answers there says, the key is to avoid &quot;repetition of a repetition&quot;. For instance, given <code>(\w+)*</code> and the input <co...
Solve Catastrophic Backtracking in my regex detecting Email
javascript|regex
2
44
1
72,992,984
72,992,984
2
true
2022-07-15T10:44:30.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Solve Catastrophic Backtracking in my regex detecting Email<p>I have regex</p> <pre><code>/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,4})+$/ </code></pre> <p>for ...
72,856,120
Summing values up to a column value change in pandas dataframe<p>I have a pandas data frame that looks like this:</p> <pre><code> Count Status Date 2021-01-01 11 1 2021-01-02 13 1 2021-01-03 14 1 2021-01-04 8 0 2021-...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.agg.html" rel="nofollow noreferrer"><code>GroupBy.agg</code></a> by consecutive groups created by comapre shifted values with cumulative sum, last subtract last and first value:</p> <pre><code>df = (df.groupby(df['Stat...
Summing values up to a column value change in pandas dataframe
python|pandas|dataframe
1
44
2
72,856,154
72,856,154
2
true
2022-07-04T11:40:16.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Summing values up to a column value change in pandas dataframe<p>I have a pandas data frame that looks like this:</p> <pre><code> Count Status Da...
72,808,654
Why code code wrapped inside DB::transaction() is executed so much faster than without it?<p>I have a database seeder that seeds 10k+ entries into a database; When running the code without DB:transaction, the while loop takes more than 5 minutes to execute against less than one minute if i wrap it inside DB::transactio...
<p>using SQL without transactions in the code, will actually be a pseudo transaction per action. The flow could be described as below.</p> <pre><code>Transaction begin Insert car 1 Transaction end Transaction begin Insert car 2 Transaction end </code></pre> <p>If you Wrap it in a transaction it will be more like this.<...
Why code code wrapped inside DB::transaction() is executed so much faster than without it?
laravel
0
44
2
72,808,744
72,808,744
2
true
2022-06-29T22:51:56.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why code code wrapped inside DB::transaction() is executed so much faster than without it?<p>I have a database seeder that seeds 10k+ entries into a database...