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,337,828 | How to fill the missing attribute value with null | python |<p>I am been trying to implement the logic , But not getting how do I start</p>
<p>My xml as below data in which if you see the child root as 3 attributes
If any one of the attribute is missing it should be populated as <code>null</code> in that case</p>
<p><s... | <p>Here is how you can do that. You need to define all fields and then just search for them.</p>
<p><strong>EDIT</strong>
As in the comments discussed I changed your <code>xml_data</code> in the 3rd role, <code>name</code> field exists now but it doesn`t have a value.</p>
<pre><code>import xml.etree.ElementTree as ET
... | How to fill the missing attribute value with null | python | | python|xml | 0 | 45 | 1 | 72,338,008 | 72,338,008 | 1 | true | 2022-05-22T13:06:58.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fill the missing attribute value with null | python |<p>I am been trying to implement the logic , But not getting how do I start</p>
<p>My xml as belo... |
72,266,716 | read event is received before the write one in kqueue<p>I'm having an issue with my code, I'm trying to create an HTTP server using C++ 98 on MacOS, and I'm expecting the block of read to be executed before the write one, but the opposite is happening and I don't know why.
So I'm expecting to read first the request, th... | <p>In order for it to be possible to read from the socket, first the other side has to detect that the connection is complete, then it has to compose its query and put it on the wire. Then your side has to receive the information and process it. Only then it is possible to read from the socket.</p>
<p>In order for it t... | read event is received before the write one in kqueue | sockets|unix|select|file-descriptor|kqueue | 0 | 45 | 1 | 72,266,747 | 72,266,747 | 1 | true | 2022-05-16T23:44:50.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
read event is received before the write one in kqueue<p>I'm having an issue with my code, I'm trying to create an HTTP server using C++ 98 on MacOS, and I'm ... |
72,271,842 | Filtering rows within a group<p>I have a dataframe like the following:</p>
<pre><code>ID <- c(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5)
Type <- c('A','B','C','B', 'C','A','B', 'C','A','C', 'C')
Value <- c(10, 11, 12, 1, 2, 100, 101, 102, -1, -2, -10)
df <- data.frame(ID, Type, Value)
</code></pre>
<p>My goal is a d... | <p>In <code>dplyr</code>, use <code>slice_min</code>, which by default filters the minimum value by group ordered by a variable (here <code>Type</code>, which is sorted by alphabetical order).</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
df %>%
group_by(ID) %>%
slice_min(Type)
# A tibb... | Filtering rows within a group | r|dplyr | 2 | 45 | 2 | 72,271,901 | 72,271,901 | 1 | true | 2022-05-17T09:54:39.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering rows within a group<p>I have a dataframe like the following:</p>
<pre><code>ID <- c(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5)
Type <- c('A','B','C','B... |
72,360,176 | Identify the second max value in hive based on condition<p>I have a table with rows that looks like that with a column that rank all rows partition by ticket id over timestamp desc.</p>
<p>All rows can only have <strong>one flag</strong> equal to one.</p>
<pre><code>ticketID | flag 1 | flag 2 | flag 3 | flag 4 | Tim... | <p>I'm going to use some sub-queries with a struct group by. This will allow us to ask questions about multiple rows without using a window. Likely will perform faster as we don't have to maintain window state.</p>
<pre><code>create table theRanks (ticketID int, flag_1 int, flag_2 int, flag_3 int, flag_4 int, Timesta... | Identify the second max value in hive based on condition | sql|hadoop|hive|hiveql | 0 | 45 | 1 | 72,365,191 | 72,365,191 | 1 | true | 2022-05-24T09:10:14.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Identify the second max value in hive based on condition<p>I have a table with rows that looks like that with a column that rank all rows partition by ticket... |
72,246,183 | The named parameter 'isSetState' is required, but there's no corresponding argument<p>I am trying to use this parameter in Provider, but I ran into an error. What should I do to resolve it?</p>
<p><a href="https://i.stack.imgur.com/9vePg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9vePg.png" alt=... | <p>The argument is required means it can't be null in this case <code>isSetState</code> is set to <code>null</code> but it can only be either <code>true</code> or <code>false</code>.</p>
<p>If you pass <code>true</code> to <code>isSetState</code> attribute then the ui will update and if you pass <code>false</code> to <... | The named parameter 'isSetState' is required, but there's no corresponding argument | flutter|provider | 0 | 45 | 2 | 72,246,268 | 72,246,268 | 1 | true | 2022-05-15T07:04:13.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The named parameter 'isSetState' is required, but there's no corresponding argument<p>I am trying to use this parameter in Provider, but I ran into an error.... |
72,368,280 | Pandas - concatenating selected rows from several groups with additional condition<p>I have an example</p>
<pre><code>+βββββββββββββ+ββββββββ+ββββββββ+ββββββββ+
| main_group | COL_A | COL_B | COL_C |
+βββββββββββββ+ββββββββ+ββββββββ+ββββββββ+
| 0 | TXT1 | | None |
| 0 | TXT2 | ... | <p>Here's a way to get the final result you've asked for:</p>
<pre class="lang-py prettyprint-override"><code>print('\nInput df:'); print(df)
df = df.assign(range_index=df.index)
gb = df[df['COL_C'].isna()].groupby(['main_group'])
df2 = pd.concat([
gb.nth(0)['range_index'],
gb.last()['COL_A'].copy().rename('C... | Pandas - concatenating selected rows from several groups with additional condition | python|pandas|dataframe | 0 | 45 | 2 | 72,369,190 | 72,369,190 | 1 | true | 2022-05-24T19:11:26.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas - concatenating selected rows from several groups with additional condition<p>I have an example</p>
<pre><code>+βββββββββββββ+ββββββββ+ββββββββ+ββββββ... |
72,276,891 | Multiple git accounts missing username and email<p>I have work and personal repos and want to switch between the two on the same machine with their respective git accounts. I have set up GPG Signed commits on the work repo and I want to set up ssh commits on a personal repo and be able to switch between the two.</p>
<p... | <p>Double-check the path declared in your global config, and use:</p>
<pre><code>git config --list --show-origin --show-scope
</code></pre>
<p>In each repository.</p>
<p>You can compare your setup with the <a href="https://gist.github.com/Icaruk/f024a18093dc28ec1588cfb90efc32f7" rel="nofollow noreferrer">process descri... | Multiple git accounts missing username and email | git|github|ssh|multiple-accounts | 1 | 45 | 1 | 72,285,241 | 72,285,241 | 1 | true | 2022-05-17T15:34:45.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple git accounts missing username and email<p>I have work and personal repos and want to switch between the two on the same machine with their respectiv... |
72,355,120 | How can I implement existing code into a fuction?<p>I found out that this is what I am struggling the most.
I know how to write a function:</p>
<pre><code> def test(a,b):
for x in range(20):
if x == 15:
return
print("test")
test()
</code></pre>
<p>but I don't know how t... | <p>A function is a way that allows you to automate a certain process in your code.</p>
<p>In your test function, you define 2 parameters so that means you have to provide those 2 variables in order for that function to work. A simple function could be as well as</p>
<pre><code>def test(a,b):
c = a + b
p... | How can I implement existing code into a fuction? | python|function | 0 | 45 | 3 | 72,355,208 | 72,355,208 | 1 | true | 2022-05-23T21:46:23.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I implement existing code into a fuction?<p>I found out that this is what I am struggling the most.
I know how to write a function:</p>
<pre><code> ... |
72,314,694 | How to give group numbers based on a condition in sql<p>Here is my table. I am using Snowflake</p>
<pre><code>CREATE TABLE testx
(
c_order int,
c_condition varchar(10)
);
INSERT INTO testx
VALUES (1, 'and'), (2, 'and'), (3, 'or'), (4, 'and'), (5, 'or');
SELECT * FROM testx
c_order c_condition
-------... | <p>Idea is to use same value for C_ORDER as group_no if
C_ORDER is more then previous OR's c_order.
In CTE we only select rows with OR and assign them a
group number using ROW_NUMBER() generator -</p>
<p>Main query -</p>
<pre><code>with temp_cte as
(
select c_order,
case -- to check if 'or' is the first row or not
when... | How to give group numbers based on a condition in sql | sql|snowflake-cloud-data-platform|grouping | 0 | 45 | 1 | 72,322,317 | 72,322,317 | 1 | true | 2022-05-20T06:49:20.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to give group numbers based on a condition in sql<p>Here is my table. I am using Snowflake</p>
<pre><code>CREATE TABLE testx
(
c_order int,
c... |
72,313,948 | Why is this code not working as intended? Python<pre><code>import string
decimal1 = 55
binary1 = 0
def convert(decimal1, binary1):
binary1 = str(decimal1 % 2) + str(binary1)
decimal1 = decimal1//2
if decimal1 == 0:
binary1 = str(binary1)
return binary1
convert(decimal1, binary1)
x = co... | <p>I think if you want to reteurn the result, then you don't need to pass <code>binary1</code> variable.</p>
<pre><code>import string
decimal1 = 55
def convert(decimal1):
value = str(decimal1 % 2)
decimal1 = decimal1//2
if decimal1 == 0:
return value
else:
return convert(decimal1) + va... | Why is this code not working as intended? Python | python|function | -1 | 45 | 3 | 72,314,035 | 72,314,035 | 1 | true | 2022-05-20T05:28:01.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is this code not working as intended? Python<pre><code>import string
decimal1 = 55
binary1 = 0
def convert(decimal1, binary1):
binary1 = str(decima... |
72,332,461 | SwiftUI List Rows Different Heights for Different System Images<p>In my SwiftUI app, I have a <code>List</code> inside of a sidebar <code>NavigationView</code> with 2 rows, like this:</p>
<pre><code>List {
NavigationLink(destination: MyView1()) {
Label("Test Row 1", systemImage: "list.bullet&... | <p>If you want to ensure that the rows are even, you can use <code>PreferenceKeys</code> to set the row heights to the height of the tallest row like this:</p>
<pre><code>struct EvenHeightListRow: View {
@State var rowHeight = CGFloat.zero
var body: some View {
List {
NavigationLink(de... | SwiftUI List Rows Different Heights for Different System Images | swift|swiftui|swiftui-list|swiftui-navigationlink|swiftui-navigationview | 0 | 45 | 1 | 72,333,623 | 72,333,623 | 1 | true | 2022-05-21T18:59:25.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI List Rows Different Heights for Different System Images<p>In my SwiftUI app, I have a <code>List</code> inside of a sidebar <code>NavigationView</cod... |
72,321,938 | Update user meta from checkout page before payment<p>Could you help me please - I have separated billing/shipping address form on the checkout page with the button Next. I want save the address in DB via AJAX on click button Next. Now I have right return in POST when I change data in the form address, but the data is n... | <p>at first, please use only lowercase action name</p>
<p>"updateAddress" -> "updateaddress"</p>
<p>second, you try alert "message", but never returning data from php function.</p>
<pre><code>success: function( data ) {
alert( data.message );
}
</code></pre>
... | Update user meta from checkout page before payment | php|jquery|ajax|wordpress|woocommerce | 0 | 45 | 1 | 72,323,120 | 72,323,120 | 1 | true | 2022-05-20T16:14:42.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update user meta from checkout page before payment<p>Could you help me please - I have separated billing/shipping address form on the checkout page with the ... |
72,397,034 | Conditionally use set-retuning function as join clause<H1>Context</H1>
<p>I'm implementing a "job posting" feature that will list jobs available for users. A job can be set for either an interval <code>start_date</code> and <code>end_date</code> or sparse dates in an array <code>service_dates</code>. The avai... | <p>This table structure is invalid or incomplete (no user_id field in availabilities table) but just to show an idea</p>
<pre class="lang-sql prettyprint-override"><code>
SELECT j.*
FROM jobs j
LEFT JOIN
availabilities a
ON a.user_id = 1234
WHERE
case when cardinality(j.service_dates) > 0
... | Conditionally use set-retuning function as join clause | sql|database|postgresql|join|left-join | 0 | 45 | 2 | 72,397,395 | 72,397,395 | 1 | true | 2022-05-26T19:25:25.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conditionally use set-retuning function as join clause<H1>Context</H1>
<p>I'm implementing a "job posting" feature that will list jobs available fo... |
72,261,511 | Access violation executing in classes with inheritance/ c++<p>I have a base class Participant and I need to sort object in array of participant by quantity of their prizes or diplomas. The virtual function get_data return this number. But whileI try to sort, i've got error Access violation executing in row with compar... | <p>The issue here is that when you are passing *pa, only the first element is accessible. If you run it in debug mode you will be able to see that inside sort function, p[1] is not a valid object. Basically, only p[0] is passed to the function. You should pass the reference to the array i.e. <code>**pa</code> to the so... | Access violation executing in classes with inheritance/ c++ | c++|sorting|oop | 0 | 45 | 1 | 72,261,872 | 72,261,872 | 1 | true | 2022-05-16T15:13:09.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access violation executing in classes with inheritance/ c++<p>I have a base class Participant and I need to sort object in array of participant by quantity o... |
72,392,947 | How to validate keys of a json in java<p>Let's assume valid json is</p>
<pre><code>{
"a": "valueA",
"b": "valueB"
}
</code></pre>
<p>Is there a neat way in java to validate the keys of json so that if the following is processed it fails with a message stating a particular key... | <p>You have to map this json to any java class something like:</p>
<pre><code>class Foo{
String a;
String b;
}
</code></pre>
<p>& then calling :</p>
<pre><code>Foo foo=new ObjectMapper().readValue("{ \"a1\" : \"valueA\", \"b\" : \"valueB\"}",Foo.class);
</co... | How to validate keys of a json in java | java|json|validation | -1 | 45 | 1 | 72,393,738 | 72,393,738 | 1 | true | 2022-05-26T13:52:04.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to validate keys of a json in java<p>Let's assume valid json is</p>
<pre><code>{
"a": "valueA",
"b": "valueB"... |
72,309,853 | How to remove data based on the timestamp<p>I have a data frame that looks like this:</p>
<pre><code>head(data1)
# A tibble: 6 Γ 10
Date Time Axis1 Axis2 Axis3 VM Standing Stepping Cycling
<date> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> &l... | <p>You may use <code>weekdays()</code> and <code>data.table::between()</code>.</p>
<pre><code>res <- dat[!weekdays(dat$time) %in% c("Saturday", "Sunday") &
data.table::between(as.integer(gsub('\\D', '', substring(dat$time, 12))), 7e4, 17e4), ]
</code></pre>
<h2>Gives</h2>
<pre><code>names(t... | How to remove data based on the timestamp | r | 2 | 45 | 2 | 72,311,502 | 72,311,502 | 1 | true | 2022-05-19T19:02:21.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove data based on the timestamp<p>I have a data frame that looks like this:</p>
<pre><code>head(data1)
# A tibble: 6 Γ 10
Date Time Axi... |
72,310,799 | Scrolling issue with Canvas style.left/top<p>I am making a magnifying glass for a canvas application but ive run into an issue with scrolling.
Essentially the goal is to take a canvas and when an image is added (in this case a cgm image) and make a snapshot of it, scale it up and draw it on to a second smaller canvas t... | <p>I simplified a lot of the code on your JSFiddle.</p>
<p>See if this is the behavior you are looking for:</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 canvas = docum... | Scrolling issue with Canvas style.left/top | javascript|html|html5-canvas | 0 | 45 | 1 | 72,321,915 | 72,321,915 | 1 | true | 2022-05-19T20:36:48.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scrolling issue with Canvas style.left/top<p>I am making a magnifying glass for a canvas application but ive run into an issue with scrolling.
Essentially th... |
72,368,755 | Trouble with creating bar & pie subplot with R plotly<p>I've created a Plotly bar and pie chart and want to combine them to form one chart.</p>
<p>When I use subplot() to combine these Plotly charts, the pie & bar charts overlap.</p>
<p>Any advice on how to present these plots so that each is in its own row? Thank ... | <p>Pie charts and <code>plotly::subplot()</code> are notoriously challenging - though you can get around many of the issues by specifying the domain manually. Below I have changed the <code>pie</code> code by specifying the <code>domain = list(...)</code> as so:</p>
<pre><code>pie <- plot_ly(data = pie_tibble, label... | Trouble with creating bar & pie subplot with R plotly | r|plotly | 1 | 45 | 1 | 72,369,035 | 72,369,035 | 1 | true | 2022-05-24T19:53:22.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trouble with creating bar & pie subplot with R plotly<p>I've created a Plotly bar and pie chart and want to combine them to form one chart.</p>
<p>When I use... |
72,385,521 | Can I run cloud-based native mobile app testing from cloud?<p>I wrote tests in Robot Framework with Appium. I test the same app on both Android and iOS.</p>
<p>I want to find out a cloud-based native mobile app testing vendor where (a) I can test the app on various mobile devices and (b) I could also run the tests in t... | <p>With BrowserStack you get to run your tests on 100% real mobile devices on our infrastructure via cloud.</p>
<p>While I cannot say about the others names mentioned, but with BrowserStack you can easily get access to 3000+ real devices which will help you to ensure your application is tested on a variety of different... | Can I run cloud-based native mobile app testing from cloud? | browserstack|saucelabs|perfecto|kobiton|headspin | 1 | 45 | 1 | 72,397,868 | 72,397,868 | 1 | true | 2022-05-26T00:45:15.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I run cloud-based native mobile app testing from cloud?<p>I wrote tests in Robot Framework with Appium. I test the same app on both Android and iOS.</p>
... |
72,367,085 | Problem with JavaScript closure and possible call/apply solution<p>I have a hierarchical relationship between the following the objects:</p>
<ul>
<li><p>spaceObject (base class of sorts)</p>
</li>
<li><p>star (inherits from spaceObject)</p>
</li>
<li><p>planet (inherits from spaceObject)</p>
</li>
</ul>
<p>star just pa... | <p>You're main issue is one of scoping. I'll add some comments to clarify what is happening.</p>
<p>First let's have a look at:</p>
<pre class="lang-js prettyprint-override"><code>const that = spaceObject(params);
that.x = params.parent.x + params.dist;
that.y = params.parent.y;
</code></pre>
<p>If we now take a look ... | Problem with JavaScript closure and possible call/apply solution | javascript | 0 | 45 | 1 | 72,367,525 | 72,367,525 | 1 | true | 2022-05-24T17:28:54.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem with JavaScript closure and possible call/apply solution<p>I have a hierarchical relationship between the following the objects:</p>
<ul>
<li><p>spac... |
72,343,989 | Check if character in string has space behind<p>I am trying to write a function that breaks up camel casing by using a space between words. How do I check if char already has space behind?</p>
<pre><code>def solution(s):
space = ' '
for chr in s:
if chr.isupper() == True:
new_str = s.replace... | <p>Your solution does not work, because you always use the base <code>s</code> as "source":</p>
<pre><code>s = "someWordWithCases"
</code></pre>
<p>will replace <code>"W"</code> with <code>" W"</code>and store it in <code>new_str</code> ... then throw that result away and repla... | Check if character in string has space behind | python|task | 0 | 45 | 2 | 72,344,297 | 72,344,297 | 1 | true | 2022-05-23T06:14:39.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if character in string has space behind<p>I am trying to write a function that breaks up camel casing by using a space between words. How do I check if... |
72,246,350 | Using updateOne with Arrays in Mongoose with NodeJS<p>Im working on an API for a custom game and i need to update specific <em>fields</em> in an array in my <a href="https://i.stack.imgur.com/zRJEv.png" rel="nofollow noreferrer">Database Entry</a>. How do i do that without adding a new thing to the array, instead just ... | <p>Hello I'm not sure the name of your schema so I'm assuming its called Game so here is an example for how to update an index in an array assuming its the board array field you're trying to update. Also reference <a href="https://stackoverflow.com/questions/11372065/mongodb-how-do-i-update-a-single-subelement-in-an-ar... | Using updateOne with Arrays in Mongoose with NodeJS | node.js|express|mongoose | 1 | 45 | 1 | 72,246,609 | 72,246,609 | 1 | true | 2022-05-15T07:34:02.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using updateOne with Arrays in Mongoose with NodeJS<p>Im working on an API for a custom game and i need to update specific <em>fields</em> in an array in my ... |
72,242,166 | Uncaught Reference Error: variable undefined<p>I'm trying to define a class in a separate javascript file and then use that class in my HTML file.</p>
<p>Here's what I'm trying.</p>
<ol>
<li>I create the class VoiceCard in the VoiceCard.js file:</li>
</ol>
<pre><code>class VoiceCard {
constructor(nickname, date_tim... | <p>Modules don't create globals. That's most of the point of them. :-)</p>
<p>Here's how to do what you seem to want to do:</p>
<ol>
<li><p>Remove the <code>script</code> tag for <code>VoiceCard.js</code>.</p>
</li>
<li><p>In <code>VoiceCard.js</code>, <strong>export</strong> the class by adding <code>export</code> in ... | Uncaught Reference Error: variable undefined | javascript|html|oop|referenceerror | 0 | 45 | 2 | 72,242,223 | 72,242,223 | 2 | true | 2022-05-14T16:35:54.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Uncaught Reference Error: variable undefined<p>I'm trying to define a class in a separate javascript file and then use that class in my HTML file.</p>
<p>Her... |
72,246,386 | How to use SUM and MAX in select statement more than one table<p>I have 2 Tables</p>
<pre><code>table a mempur
memberno = member number
purdt = purchase date
amount = purchase amount
table b meminfo
memberno = member number
fname = first name
age = age
select ... | <p>You can aggregate in <code>mempur</code> and then join to <code>meminfo</code>:</p>
<pre><code>SELECT i.*, p.total_amount, p.maxdate
FROM meminfo i
INNER JOIN (
SELECT memberno, SUM(amount) total_amount, MAX(purdt) maxdate
FROM mempur
WHERE purdt BETWEEN '01-JAN-22' AND '28-FEB-22'
GROUP BY memberno
) p ON... | How to use SUM and MAX in select statement more than one table | oracle|join|group-by|sum|max | 0 | 45 | 2 | 72,246,451 | 72,246,451 | 2 | true | 2022-05-15T07:40:33.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use SUM and MAX in select statement more than one table<p>I have 2 Tables</p>
<pre><code>table a mempur
memberno = member number
... |
72,253,361 | How can I loop through array and get value of all it's items<p>I want to loop through an array of objects and get all data of all of objects but only I only get the data of last object I'don't why it skips the first object , please any one could help me</p>
<h1>Here is my array </h1>
<pre><code>item {
_id: new Objec... | <p>The result variable where you store the data inside the loop gets overrided on every iteration, so when you return, there is only the last value stored.
A quick fix could be assign an empty array in your declaration on result</p>
<pre><code> let result: any = [];
</code></pre>
<p>Then inside the loop you could push... | How can I loop through array and get value of all it's items | javascript|arrays|typescript|object | -1 | 45 | 1 | 72,253,412 | 72,253,412 | 2 | true | 2022-05-16T01:25:49.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I loop through array and get value of all it's items<p>I want to loop through an array of objects and get all data of all of objects but only I only... |
72,263,741 | Can I mutate many columns according to many other columns with mutate() and across()?<p>I have a dataset where loads of columns have <code>NA</code> characters because they depend on another column response. For example :</p>
<pre><code> df <- data.frame(X_home = c("Yes", "Yes", "No"... | <p>We can <code>get</code> the value of the corresponding column after replacing the substring of column name (<code>cur_column()</code>) using <code>str_replace</code></p>
<pre><code>library(dplyr)
library(stringr)
df %>%
mutate(across(starts_with("Y_"),
~ case_when(get(str_replace(cur_column(), &q... | Can I mutate many columns according to many other columns with mutate() and across()? | r|dplyr|across | 2 | 45 | 2 | 72,263,760 | 72,263,760 | 2 | true | 2022-05-16T18:09:10.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I mutate many columns according to many other columns with mutate() and across()?<p>I have a dataset where loads of columns have <code>NA</code> characte... |
72,292,770 | Regex for dutch phone numbers that works inside a sentence or if concatenated<p>I'm looking for a regex that will find a dutch phone number inside a piece of text. For example:</p>
<ul>
<li>Mijn telefoonnnummer is 0612131415</li>
<li>Mijn telefoonnnummer is 06-12345678</li>
<li>Mijn telefoonnummer0612131415email</li>
<... | <p>You can use</p>
<pre class="lang-none prettyprint-override"><code>(?<![^a-zA-Z\s])((\+|00(\s|\s?-\s?)?)31(\s|\s?-\s?)?(\(0\)[-\s]?)?|0)[1-9]((\s|\s?-\s?)?[0-9])((\s|\s?-\s?)?[0-9])((\s|\s?-\s?)?[0-9])\s?[0-9]\s?[0-9]\s?[0-9]\s?[0-9]\s?[0-9](?![^a-zA-Z\s])
</code></pre>
<p>See the <a href="https://regex101.com/r/0... | Regex for dutch phone numbers that works inside a sentence or if concatenated | regex | 1 | 45 | 2 | 72,292,846 | 72,292,846 | 2 | true | 2022-05-18T16:22:14.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex for dutch phone numbers that works inside a sentence or if concatenated<p>I'm looking for a regex that will find a dutch phone number inside a piece of... |
72,293,047 | Catch exception from rx.net Observable.FromAsync<p>I have the following Reactive Extensions <code>Subject</code> and need to log exceptions, and also shutdown this potentially blocking async task created on <code>Observable.FromAsync</code> cleanly.</p>
<p>In relation to this and on cancelling the token, the exception ... | <p>Use a different <code>Subscribe</code> overload:</p>
<pre><code> feed
.GroupByUntil(x => (x.Execution.Contract.Symbol, x.Execution.AccountId, x.Tenant, x.UserId), x => Observable.Timer(TimeSpan.FromSeconds(5)))
.SelectMany(x => x.ToList())
.Select(trades => Observable.FromAsync... | Catch exception from rx.net Observable.FromAsync | c#|rx.net | 1 | 45 | 1 | 72,299,340 | 72,299,340 | 2 | true | 2022-05-18T16:44:32.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Catch exception from rx.net Observable.FromAsync<p>I have the following Reactive Extensions <code>Subject</code> and need to log exceptions, and also shutdow... |
72,343,100 | Make red color for wrong prediction in python plot<p>I am trying to make scatter plot based on my ML project.
I am able to plot actual and prediction to compare the results.
I found that there are some wrong prediction. I would like to add wrong prediction with different color and <code>label = wrong prediction</code> ... | <p>You an first make a <code>correct</code> column which tells if the prediction for that index was true or not and then use the <code>hue</code> parameter for this column.</p>
<pre><code>df["correct"] = (df["actual"] == df["prediction"])
plt.figure(figsize = (20,5))
sns.scatterplot(data ... | Make red color for wrong prediction in python plot | python|python-3.x|matplotlib|machine-learning|seaborn | 0 | 45 | 1 | 72,343,308 | 72,343,308 | 2 | true | 2022-05-23T03:55:08.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make red color for wrong prediction in python plot<p>I am trying to make scatter plot based on my ML project.
I am able to plot actual and prediction to comp... |
72,348,646 | How to assign value based on one unique key but evaluating two rows?<p>If for every unique <code>id</code>, one of the two value columns read <code>0</code> then I want the status to be <code>single</code> if not <code>mixed</code>. Any ideas on how to achieve this?</p>
<p>I do <em>not</em> want a solution with spread ... | <p>Here's one way.</p>
<pre><code>library(dplyr)
df %>%
group_by(id) %>%
mutate(status = ifelse(any(val == 0), 'single', 'mixed')) %>%
ungroup()
#> # A tibble: 8 Γ 4
#> level val id status
#> <fct> <dbl> <dbl> <chr>
#> 1 high 9 1 single
#> 2 low... | How to assign value based on one unique key but evaluating two rows? | r|if-statement|dplyr | 0 | 45 | 2 | 72,348,708 | 72,348,708 | 2 | true | 2022-05-23T12:38:00.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to assign value based on one unique key but evaluating two rows?<p>If for every unique <code>id</code>, one of the two value columns read <code>0</code> ... |
72,350,719 | Why does the conditional formatting in this question only apply to a single row?<p>I want to colour row "4" using this custom function "=REGEXMATCH(B4;"Skorpion")" in conditional formatting, but that doesn't work. Only "A4" is blue, and I wanted all row 4 in blue colour.</p>
<p><... | <p>for a row highlight use:</p>
<pre><code>=REGEXMATCH($B4; "Skorpion")
</code></pre> | Why does the conditional formatting in this question only apply to a single row? | if-statement|google-sheets|formatting|conditional-statements|conditional-formatting | 1 | 45 | 1 | 72,351,721 | 72,351,721 | 2 | true | 2022-05-23T15:00:57.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does the conditional formatting in this question only apply to a single row?<p>I want to colour row "4" using this custom function "=REGEX... |
72,353,448 | Turning rows into columns with a condition? SQL Server<p>I have table1 with the following data for example:</p>
<pre><code>PersonID Description StartDate EndDate
---------------------------------------------------------
ABC Do not call 2000-05-10 NULL
ABC Do... | <p>Rather than a pivot I would choose to use conditional aggregation for this. Also, I would suggest not putting spaces in your column names as it just makes it harder to work with and provides no actual benefit.</p>
<pre><code>select PersonID
, DoNotCall = MAX(case when Description = 'Do Not Call' then 1 end)
... | Turning rows into columns with a condition? SQL Server | sql|sql-server|pivot | 0 | 45 | 1 | 72,353,498 | 72,353,498 | 2 | true | 2022-05-23T18:43:46.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Turning rows into columns with a condition? SQL Server<p>I have table1 with the following data for example:</p>
<pre><code>PersonID Description ... |
72,369,024 | How can I match list elements with tuple elements?<p>I have the following lists and tuple lists:</p>
<pre class="lang-py prettyprint-override"><code>adsh_list_sub
['0000007084-22-000008', '0000766421-22-000009', '0000320193-22-000007']
</code></pre>
<pre class="lang-py prettyprint-override"><code>cik_list
['7084', '766... | <p>You can create a dictionary from the list of tuples, and then use a list comprehension to read off the result using the generated mapping:</p>
<pre class="lang-py prettyprint-override"><code>mapping = dict(adsh_cik_tuple)
[mapping[item] for item in adsh_list_num]
</code></pre>
<p>This outputs:</p>
<pre class="lang-p... | How can I match list elements with tuple elements? | python|tuples | -3 | 45 | 1 | 72,369,080 | 72,369,080 | 2 | true | 2022-05-24T20:19:23.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I match list elements with tuple elements?<p>I have the following lists and tuple lists:</p>
<pre class="lang-py prettyprint-override"><code>adsh_lis... |
72,376,642 | how to make a functional "if" condition using Json in Python?<p>I'm trying to do a comparison between a value, if it exists in Json, using "if and else", but it always falls into the "else" condition first.</p>
<p>my code:</p>
<pre><code>with open(arquivo, 'r') as f:
data= json.load(f)
data2 = d... | <p>It seems like you want to check whether the value you are looking for is found at least once.</p>
<p>You can use:</p>
<pre><code>for s in data2:
if s['id'] == baka:
print('found')
break # exit loop
else: # no break
print('not found')
</code></pre>
<p>Note that it's <code>for/else</code> here,... | how to make a functional "if" condition using Json in Python? | python|json|python-3.x | -3 | 45 | 1 | 72,376,728 | 72,376,728 | 2 | true | 2022-05-25T11:17:59.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to make a functional "if" condition using Json in Python?<p>I'm trying to do a comparison between a value, if it exists in Json, using "if and else&... |
72,396,432 | Adding a new element to a nested dictionary in python<p>I have a list nested dictionary that looks in the following way and I have an epoch timestamp stored as a variable.</p>
<p>ts = 1653070640</p>
<pre><code> [
{
"HR": {
"EKG": {
"HR_EKG": 136... | <p>You can do this to add <code>timestamp</code> only at depths where there are no sub-dicts:</p>
<pre class="lang-py prettyprint-override"><code>def set_ts(d, ts):
any_nested = False
for k, v in d.items():
if isinstance(v, dict):
set_ts(v, ts)
any_nested = True
if not any_ne... | Adding a new element to a nested dictionary in python | python|json|python-3.x|dictionary | 0 | 45 | 1 | 72,396,572 | 72,396,572 | 2 | true | 2022-05-26T18:27:14.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding a new element to a nested dictionary in python<p>I have a list nested dictionary that looks in the following way and I have an epoch timestamp stored ... |
72,241,504 | neither find_all nor find works<p>I am trying to scrape the name of every favorites on the page of a user of our choice. but with this code I get the error "ResultSet object has no attribute 'find_all'" but if I try to use find it get the opposite error and it ask me to use find_all. I'm a beginner and I don'... | <p>Your program throws exception because you are trying to use <code>.find_all</code> on <code>ResultSet</code> (favs_title = favs.find_all(...)<code>, </code>ResultSet<code>doesn't have function</code>.find_all`). Instead, you can use CSS selector and select all required elements directly:</p>
<pre class="lang-py pret... | neither find_all nor find works | python|beautifulsoup | 0 | 45 | 2 | 72,241,548 | 72,241,548 | 2 | true | 2022-05-14T15:12:49.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
neither find_all nor find works<p>I am trying to scrape the name of every favorites on the page of a user of our choice. but with this code I get the error &... |
72,339,246 | how to call all items in a list at once?<pre><code>for i in objects:
if self.y + self.y_vel > HEIGHT+self.ySize:
self.y_vel = 0
break
elif pygame.Rect.colliderect(self.rect, i.rect):
self.y_vel = 0
break
else:
self.y_vel += 0.05
</code></pre>
<p>this code works all... | <p>You don't want to use <a href="https://docs.python.org/3/library/functions.html#all" rel="nofollow noreferrer"><code>all</code></a> but <a href="https://docs.python.org/3/library/functions.html#any" rel="nofollow noreferrer"><code>any</code></a>. Also, you need to restructure the code, because when the object collid... | how to call all items in a list at once? | python|list|pygame | 1 | 45 | 1 | 72,339,524 | 72,339,524 | 2 | true | 2022-05-22T16:08:08.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to call all items in a list at once?<pre><code>for i in objects:
if self.y + self.y_vel > HEIGHT+self.ySize:
self.y_vel = 0
break
... |
72,335,197 | Changing the button name without changing all buttons names<p>I have a button <code>Name</code>, by clicking on it the name changes to <code>Stop</code>. For this I am just using <code>useState</code> where passing false/true when it's clicked. Everything works well, but if I add another button and click on it, the nam... | <p>You are trying to use only one single boolean value to control multiple buttons' states, which is absolutely impossible.</p>
<p>One way to achieve this is to have a state storing the name of the button that is playing.</p>
<p>Try something like this:</p>
<pre class="lang-js prettyprint-override"><code>const [playing... | Changing the button name without changing all buttons names | reactjs | 0 | 45 | 5 | 72,335,265 | 72,335,265 | 2 | true | 2022-05-22T06:09:20.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing the button name without changing all buttons names<p>I have a button <code>Name</code>, by clicking on it the name changes to <code>Stop</code>. For... |
72,397,403 | Wrapper around importdata() in Google Sheets<p>I am trying to write a wrapper around Google Sheets' <code>importdata()</code> in <code>code.gs</code>:</p>
<pre><code>100
101 function cryptofinance(token) {
102 var currentCell = SpreadsheetApp.getCurrentCell();
103 currentCell.setValue('=importdata("https... | <p>Custom functions can be used to return values, period.</p>
<p>Custom function can't be used to execute any method that require authorization to run and can't modify attributes of the cell / range that contain the formula using the custom function. Ref. <a href="https://developers.google.com/apps-script/guides/sheet... | Wrapper around importdata() in Google Sheets | javascript|google-apps-script|google-sheets|custom-function | 0 | 45 | 3 | 72,399,038 | 72,399,038 | 2 | true | 2022-05-26T19:59:43.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wrapper around importdata() in Google Sheets<p>I am trying to write a wrapper around Google Sheets' <code>importdata()</code> in <code>code.gs</code>:</p>
<p... |
72,264,105 | Matplotlib legend half-color line entry<p>Is there a way of drawing a multi-colored line for a single legend entry in Matplotlib?</p>
<p>For example, in the below figure, the line for entries Class 1 and two appear black to the left and gray to the right of the middle point.</p>
<p><a href="https://i.stack.imgur.com/hY... | <p>You can combine the handlers of each label via the tuple legend handler (<a href="https://matplotlib.org/stable/api/legend_handler_api.html#matplotlib.legend_handler.HandlerTuple" rel="nofollow noreferrer"><code>HandlerTuple</code></a>).</p>
<pre class="lang-py prettyprint-override"><code>from matplotlib import pypl... | Matplotlib legend half-color line entry | matplotlib | 0 | 45 | 1 | 72,264,732 | 72,264,732 | 2 | true | 2022-05-16T18:41:33.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matplotlib legend half-color line entry<p>Is there a way of drawing a multi-colored line for a single legend entry in Matplotlib?</p>
<p>For example, in the ... |
72,271,370 | True if for every true value of a fact another fact is also true<p>I tried this as <code>hello</code>, but I think it doesn't work.</p>
<pre><code>kng_bck(1).
kng_bck(2).
kng_bck(3).
:- dynamic(p/1).
hello :- kng_bck(X), p(X).
% true if p(1). p(2). and p(3). are all defined,
% that is for every true value of kng_bc... | <p>Try using the following definition of <code>hello</code> instead:</p>
<pre><code>hello :- \+ (kng_bck(X), \+ p(X)).
</code></pre>
<p>The following query should then return true:</p>
<pre><code>?- assert(p(1)), assert(p(2)), assert(p(3)), hello.
</code></pre>
<p><a href="https://www.swi-prolog.org/pldoc/man?predicate... | True if for every true value of a fact another fact is also true | prolog | 0 | 45 | 1 | 72,272,453 | 72,272,453 | 2 | true | 2022-05-17T09:20:04.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
True if for every true value of a fact another fact is also true<p>I tried this as <code>hello</code>, but I think it doesn't work.</p>
<pre><code>kng_bck(1)... |
72,303,056 | Bean failiing to initialize in a not deterministic way<p>I have a Spring Boot application that has the following bean:</p>
<pre class="lang-java prettyprint-override"><code>@Configuration
public class ConfigStatus {
@Value("${olt.id}")
private int olt_id;
@Bean
Status createStatus() {
... | <p>I believe you should do:</p>
<pre class="lang-java prettyprint-override"><code>@Configuration
public class ConfigStatus {
@Bean
Status currentStatus(@Value("${olt.id}") int olt_id) {
return new Status(olt_id);
}
}
</code></pre>
<p>I'm not 100% confident if Spring prioritises <code>@Val... | Bean failiing to initialize in a not deterministic way | java|spring|spring-boot | 0 | 45 | 1 | 72,303,838 | 72,303,838 | 2 | true | 2022-05-19T10:37:53.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bean failiing to initialize in a not deterministic way<p>I have a Spring Boot application that has the following bean:</p>
<pre class="lang-java prettyprint-... |
72,314,661 | Plotting average observation counts by weekday and hour across multiple dates using ggplot2<p>I have a dataframe with each observation representation an object in the real world I have counted using OpenCV. After some mutations and using tidyverse and lubridate my dataframe looks like this:</p>
<pre><code>> head(odc... | <p>You can summarize e.g. over all Mondays in a given hour using the <code>dplyr</code> package. After that summation, the x axis is just a number from 0 to 23 which is not of the type POSIXct representing a specific, unambiguous time point any more.</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)... | Plotting average observation counts by weekday and hour across multiple dates using ggplot2 | r|ggplot2 | 0 | 45 | 1 | 72,315,245 | 72,315,245 | 2 | true | 2022-05-20T06:45:32.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting average observation counts by weekday and hour across multiple dates using ggplot2<p>I have a dataframe with each observation representation an obje... |
72,290,983 | Calculating the Number of Observations Since an Event Occurred<p>I have the following vector of temperatures (in Λ C):</p>
<pre><code>Temperature <- c(-3:3, 3:-3, rep(-3, 2), -2:-1, 1:3, 2:1, -1:-4)
</code></pre>
<p>I need to calculate the time (number of observations) elapsed since the last freeze event and I also ... | <p>You can use this function, which basically checks the index of freeze and thaw in the original vector, then compute apply a sequence of consecutive number of length <code>dif</code> between every freeze or thaw moments:</p>
<pre class="lang-r prettyprint-override"><code>f <- function(temp, freeze){
if(freeze)
... | Calculating the Number of Observations Since an Event Occurred | r|vector|indexing|time-series | 1 | 45 | 3 | 72,291,209 | 72,291,209 | 2 | true | 2022-05-18T14:22:56.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculating the Number of Observations Since an Event Occurred<p>I have the following vector of temperatures (in Λ C):</p>
<pre><code>Temperature <- c(-3:... |
72,376,154 | Template literal throws errors in some scenarios but not others<p>As part of a code review a colleague recommended using a type rather than an enum. Whilst making the changes we found an issue neither of us expected.</p>
<p>We'd expect scenario one and two to throw compiler and/or intellisense errors as one of the valu... | <p><code>as Type</code> is a way of saying "This value <strong>is</strong> this type, even if it doesn't look like it".</p>
<p>You're overriding normal type detection.</p>
<p>It's useful for things like:</p>
<pre><code>const response = await fetch('/some/url');
const data = await response.json();
return data ... | Template literal throws errors in some scenarios but not others | javascript|typescript | 0 | 45 | 1 | 72,376,193 | 72,376,193 | 2 | true | 2022-05-25T10:43:38.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Template literal throws errors in some scenarios but not others<p>As part of a code review a colleague recommended using a type rather than an enum. Whilst m... |
72,320,608 | Joining values from a DataFrame row with comma being separator<p>My <em>DataFrame</em> row <code>line = fd.iloc[0]</code> is:</p>
<pre><code>id 31458598
total_matched 104671.25
market Under 3.5 Goals FT
one 0
two 0... | <p>You can use <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.str.cat.html" rel="nofollow noreferrer"><code>str.cat</code></a> after ensuring you have strings:</p>
<pre><code>line.astype(str).str.cat(sep=',')
</code></pre>
<p>output: <code>'31458598,104671.25,Under 3.5 Goals FT,0,0,0,0,0,0'</code><... | Joining values from a DataFrame row with comma being separator | python|pandas|dataframe | 1 | 45 | 2 | 72,320,741 | 72,320,741 | 2 | true | 2022-05-20T14:28:46.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Joining values from a DataFrame row with comma being separator<p>My <em>DataFrame</em> row <code>line = fd.iloc[0]</code> is:</p>
<pre><code>id ... |
72,367,073 | SQL remove results from list<p>I have a Locations table, and a Visit table. Each location need to be visited annually based on a particular visit type. When we log a Visit, we add the type of visit it is and for what location (date time and all that other stuff). I need to deduce from what we collect, those locations t... | <p>One way is to check for the lack of an annual, visit using the EXISTS statement.</p>
<pre><code>SELECT
L.Name, L.ID
FROM
Location L
WHERE
NOT EXISTS
(
SELECT
*
FROM
Visit V2
WHERE
V2.LocationID = L.LocationID
... | SQL remove results from list | sql | 0 | 45 | 3 | 72,367,264 | 72,367,264 | 2 | true | 2022-05-24T17:27:30.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL remove results from list<p>I have a Locations table, and a Visit table. Each location need to be visited annually based on a particular visit type. When ... |
72,276,444 | trying to group_by and then summarize max and min - running into error for unambiguous format<p>I have addresses that have duplicated information from Kingwood and Humble addresses. I am trying to combine these entries, preserving the the minimum first reported date, and the max last reported dates, using this code:</p... | <p>Embed everything in the same summarise call. Also, you should specify the format of your date in the <code>format</code> argument of <code>as.Date</code> when your data is not in the <a href="https://en.wikipedia.org/wiki/ISO_8601" rel="nofollow noreferrer">international date format</a>.</p>
<pre class="lang-r prett... | trying to group_by and then summarize max and min - running into error for unambiguous format | r|dataframe|date|dplyr|data-manipulation | 0 | 45 | 1 | 72,276,585 | 72,276,585 | 3 | true | 2022-05-17T15:07:44.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
trying to group_by and then summarize max and min - running into error for unambiguous format<p>I have addresses that have duplicated information from Kingwo... |
72,277,073 | Pandas pick values in group between two quantiles<p>I'd like to filter my dataset by picking rows that are between two values (dinamically defined as quantiles) <em>per each group</em>. Concretely, I have a dataset like</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'day': ['one', 'one', 'one', 'one', 'one', 'on... | <h3>Transform <code>value</code> with <code>quantile</code></h3>
<pre><code>g = df.groupby(['day', 'weather'])['value']
df[df['value'].between(g.transform('quantile', 0.1), g.transform('quantile', 0.9))]
</code></pre>
<hr />
<pre><code> day weather value
1 one rain 2
4 one sun 5
8 two rain ... | Pandas pick values in group between two quantiles | pandas|dataframe|group-by | 2 | 45 | 1 | 72,277,262 | 72,277,262 | 3 | true | 2022-05-17T15:47:31.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas pick values in group between two quantiles<p>I'd like to filter my dataset by picking rows that are between two values (dinamically defined as quantil... |
72,283,027 | Unable to access the key of a dictionary in python<p>I'm trying to access a key of a dictionary here</p>
<pre><code>{'application_id': '467377486141980682',
'attachments': [],
'author': {'avatar': '25cb9058944599f9f1ba15279f9e4a8f',
'bot': True,
'discriminator': '0000',
'id': '9648... | <p><code>username</code> isn't a key in that dictionary. There's a key called <code>author</code> whose value is a dictionary and in there, you can find <code>username</code>.</p> | Unable to access the key of a dictionary in python | python|dictionary | -2 | 45 | 1 | 72,283,068 | 72,283,068 | 3 | true | 2022-05-18T03:58:10.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to access the key of a dictionary in python<p>I'm trying to access a key of a dictionary here</p>
<pre><code>{'application_id': '467377486141980682',
... |
72,285,486 | Flag only the first time a column value changes rowwise per id in R<p>I'll get straight to the point. I found some code on stackoverflow that partially works.</p>
<pre><code>df1 <- read.table(text = "
ID V1 V2
A X SBI123
A Y SBI123
A Y SBI133
B A SBI888
B A SBI999
B B SBI... | <p>In <code>dplyr</code>, you can use <code>across</code> and <code>lag</code>. Basically, the value is 1 when the previous value is different from the actual value, and 0 otherwise.</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
df1 %>%
group_by(ID) %>%
mutate(across(V1:V2, ~ +(lag(.x, ... | Flag only the first time a column value changes rowwise per id in R | r|dplyr|group-by|compare|rowwise | 0 | 45 | 2 | 72,285,572 | 72,285,572 | 3 | true | 2022-05-18T08:15:28.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flag only the first time a column value changes rowwise per id in R<p>I'll get straight to the point. I found some code on stackoverflow that partially works... |
72,266,508 | In the new Elmish.WPF 4.0 beta version, where is runWindowWithConfig?<p>I've been playing with the new beta version of Elmish.WPF 4.0 and can't seem to find
Program.runWindowWithConfig. Has it been replaced?</p>
<pre><code>let entryPoint (_: string[], mainWindow: Window) =
Program.mkProgram init update bindings... | <p>Yes, it has been replaced. I replaced it with a setting function on <code>WpfProgram</code> for each field of the config. This design allows adding a new value to configure in a backwards compatible manner. See <a href="https://github.com/elmish/Elmish.WPF/blob/master/src/Samples/SingleCounter.Core/Program.fs" re... | In the new Elmish.WPF 4.0 beta version, where is runWindowWithConfig? | f#|elmish-wpf | 2 | 45 | 1 | 72,288,553 | 72,288,553 | 3 | true | 2022-05-16T23:08:21.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In the new Elmish.WPF 4.0 beta version, where is runWindowWithConfig?<p>I've been playing with the new beta version of Elmish.WPF 4.0 and can't seem to find
... |
72,325,955 | How can I send a string in a function<p>I have this code and I want to make it send "b1" when when executing the command mic_press <code>b1 = Button(root, image= img1, bd=0, bg='#292424', activebackground='#292424', command=mic_press)</code></p> | <p>I guess you want</p>
<pre class="lang-py prettyprint-override"><code>b1 = Button(root, image= img1, bd=0, bg='#292424', activebackground='#292424', command=lambda:mic_press('b1'))
</code></pre>
<p>Tkinter commands take and pass no arguments, but you can use a <code>lambda</code> function to call your method with the... | How can I send a string in a function | python|tkinter | -1 | 45 | 1 | 72,326,037 | 72,326,037 | 3 | true | 2022-05-21T01:03:15.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I send a string in a function<p>I have this code and I want to make it send "b1" when when executing the command mic_press <code>b1 = Butto... |
72,379,806 | Set increasing value of one column based on value in another column in pandas dataframe<p>I have a pandas dataframe that looks like this:</p>
<pre><code>import pandas as pd
d = {'date': ['2021-01-01', '2021-01-02', '2021-01-03', '2021-01-04', '2021-01-05', '2021-01-06', '2021-01-07', '2021-01-08', '2021-01-09', '2021-0... | <p>Doing</p>
<pre><code>df['out'] = (pd.to_datetime(df.date) - pd.to_datetime('2021-01-06')).dt.days
Out[20]:
0 -5
1 -4
2 -3
3 -2
4 -1
5 0
6 1
7 2
8 3
9 4
Name: date, dtype: int64
</code></pre> | Set increasing value of one column based on value in another column in pandas dataframe | python | 0 | 45 | 3 | 72,379,997 | 72,379,997 | 3 | true | 2022-05-25T14:47:03.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set increasing value of one column based on value in another column in pandas dataframe<p>I have a pandas dataframe that looks like this:</p>
<pre><code>impo... |
72,332,729 | preserve index names when melting<p>I'd like to preserve the proper yearly index names as I recast my data from wide to long.</p>
<pre><code>dt = data.table(country = c(1,2,3,4,5), gdp_1990 = rnorm(5), gdp_1991 = rnorm(5), gdp_1992 = rnorm(5),
unemp_1990 = rnorm(5), unemp_1991 = rnorm(5), unemp_1992 = rnorm(5))
... | <p>With <code>data.table</code> (<code>dev</code> version - <code>1.14.3</code>) we can use <code>measure</code> with <code>sep</code> as documented in <code>?measure</code></p>
<blockquote>
<p>measure(..., sep, pattern, cols, multiple.keyword="value.name")</p>
</blockquote>
<pre><code>library(data.table)
mel... | preserve index names when melting | r|data.table|melt | 1 | 45 | 2 | 72,332,883 | 72,332,883 | 3 | true | 2022-05-21T19:42:08.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
preserve index names when melting<p>I'd like to preserve the proper yearly index names as I recast my data from wide to long.</p>
<pre><code>dt = data.table(... |
72,380,849 | JavaFX - Remove Shape With Button setOnAction<p>I am trying to create an application where a user inputs a number of sides, and upon clicking a button, removes any current shape from the Scene and generates a shape with the specified number of sides.</p>
<p>Whilst the logic to generate the shape is working, implementat... | <p>Just make <code>shape</code> an instance variable. Also note there is no need for all the ugly downcasting.</p>
<pre><code>public class GenShape extends Application
{
private Shape shape ;
@Override
public void start(Stage stage)
{
// configure text fields for input
... | JavaFX - Remove Shape With Button setOnAction | java|javafx | -1 | 45 | 1 | 72,381,201 | 72,381,201 | 3 | true | 2022-05-25T15:56:53.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaFX - Remove Shape With Button setOnAction<p>I am trying to create an application where a user inputs a number of sides, and upon clicking a button, remov... |
72,341,443 | calculate 5 year average of panel data with factors kept<p>I have a panel data set that may look like</p>
<pre><code>set.seed(123)
df <- data.frame(
year = rep(2011:2020,5),
county = rep(c("a","b",'c','d','e'), each=10),
state = rep(c("A","B",'C','D','E'), each=10),
co... | <p>The warnning results from that <code>summarise_all(mean)</code> calculates averages not only on <code>var1</code> & <code>var2</code> but on <code>state</code> & <code>country</code>. If you want to keep <code>state</code> and <code>country</code> as grouping columns, you should put them into <code>group_by(... | calculate 5 year average of panel data with factors kept | r|dataframe|dplyr | 2 | 45 | 1 | 72,342,634 | 72,342,634 | 3 | true | 2022-05-22T21:35:21.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calculate 5 year average of panel data with factors kept<p>I have a panel data set that may look like</p>
<pre><code>set.seed(123)
df <- data.frame(
yea... |
72,273,146 | How do i do math with object instance variables once i have created the object in java<p>I have constructed an object in java with integer instance variables, how do find the quotient of two of these variables after i have created the object.</p>
<p>The objects i have created are like this:</p>
<pre><code>class Student... | <p>Here's what I'd recommend:</p>
<pre><code>class Student {
private int grade;
private int maxGrade;
public Student(int grade, int maxGrade) {
this.grade = grade;
this.maxGrade = maxGrade;
}
public double getPercentage() {
return 100.0 * grade/maxGrade;
}
}
</code></... | How do i do math with object instance variables once i have created the object in java | java | 1 | 45 | 1 | 72,273,247 | 72,273,247 | 4 | true | 2022-05-17T11:20:55.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i do math with object instance variables once i have created the object in java<p>I have constructed an object in java with integer instance variables... |
72,333,488 | Coin flip based on randint returns false mostly?<p>I am writing a game in python using Pygame. In the game, I am setting a variable to a random value of either True or False using this statement:</p>
<pre><code>(False, True)[random.randint(0, 1)]
</code></pre>
<p>After running this 2 to 3 times, it kept returning False... | <p>It's just a coincidence. The nature of random chance is that you're more likely to get "unrandom"-looking results the smaller the sample size is. Luckily with a computer program it's very easy to do tests with very large sample sizes.</p>
<pre><code>>>> import random
>>> import collecti... | Coin flip based on randint returns false mostly? | python|random|tuples | 0 | 45 | 1 | 72,333,505 | 72,333,505 | 4 | true | 2022-05-21T21:57:42.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Coin flip based on randint returns false mostly?<p>I am writing a game in python using Pygame. In the game, I am setting a variable to a random value of eith... |
72,338,617 | How to order rows by the greatest date of each row, for a table with 8 date columns?<p>This is very different from doing an <a href="https://stackoverflow.com/questions/10506843/sql-order-by-2-date-columns">SQL order by 2 date columns</a> (or for <a href="https://stackoverflow.com/questions/24223098/proper-way-to-sort-... | <p>You can use the <code>GREATEST</code> function to achieve it.</p>
<pre><code>SELECT GREATEST(date_1,date_2,date_3,date_4,date_5,date_6,date_7,date_8) max_date,t.*
FROM Tab t
ORDER BY GREATEST(date_1,date_2,date_3,date_4,date_5,date_6,date_7,date_8) Desc;
</code></pre>
<p>DB Fiddle: <a href="https://dbfiddle.uk/?rdb... | How to order rows by the greatest date of each row, for a table with 8 date columns? | sql|mariadb|sql-order-by | -1 | 45 | 2 | 72,338,892 | 72,338,892 | 4 | true | 2022-05-22T14:47:56.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to order rows by the greatest date of each row, for a table with 8 date columns?<p>This is very different from doing an <a href="https://stackoverflow.co... |
72,364,612 | Size of static array initialization in C via contents in define?<p>There is a similar discussion on <a href="https://stackoverflow.com/questions/36700227/count-number-of-elements-for-static-array-initialization-in-c">Count number of elements for static array initialization in C</a> - but I still cannot tell if all the ... | <p>You could use a compound literal as an operand of <code>sizeof</code> when declaring <code>mydata_arr</code>.</p>
<pre><code>
#define _my_data 0x11, 0x22, 0x33, 0x44, 0x55, 0x66
extern const uint8_t mydata_arr[sizeof ((uint8_t[]) {_my_data}) / sizeof(uint8_t)];
^^ compound li... | Size of static array initialization in C via contents in define? | arrays|c|c99|extern | 1 | 45 | 1 | 72,364,713 | 72,364,713 | 4 | true | 2022-05-24T14:22:13.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Size of static array initialization in C via contents in define?<p>There is a similar discussion on <a href="https://stackoverflow.com/questions/36700227/cou... |
72,292,478 | JavaFX TreeTableView Css for unfocused selected line<p>I have a problem with CSS on TreeTableView.</p>
<p>For TableView when I define CSS like this :</p>
<pre class="lang-css prettyprint-override"><code>.table-row-cell:selected{
-fx-background-color: #f1734f;
-fx-background-insets: 0;
-fx-background-radius:... | <p>Try setting the text fill on the cells themselves, instead of the row cells:</p>
<pre><code>.tree-table-row-cell:selected{
-fx-background-color: #f1734f;
-fx-background-insets: 0;
-fx-background-radius: 1;
-fx-table-cell-border-color: white;
}
.tree-table-row-cell:selected .tree-table-cell,
.tree-ta... | JavaFX TreeTableView Css for unfocused selected line | css|javafx|treetableview | 4 | 45 | 1 | 72,293,061 | 72,293,061 | 5 | true | 2022-05-18T16:00:37.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaFX TreeTableView Css for unfocused selected line<p>I have a problem with CSS on TreeTableView.</p>
<p>For TableView when I define CSS like this :</p>
<pr... |
72,301,175 | I want to use fluent-ffmpeg module<p>I want to ask about video convert in JS. I chose the <a href="https://www.npmjs.com/package/fluent-ffmpeg" rel="nofollow noreferrer"><code>fluent-ffmpeg</code></a> module to do that.</p>
<p>But, when I imported that in JS file, something happen like the picture below:</p>
<p><a href... | <p>Your package.json is correct the thing you need to do is add @types/fluent-ffmpeg to your dev dependencies to get hinting !
<a href="https://www.npmjs.com/package/@types/fluent-ffmpeg" rel="nofollow noreferrer">https://www.npmjs.com/package/@types/fluent-ffmpeg</a></p>
<pre><code>npm i --save-dev @types/fluent-ffmpe... | I want to use fluent-ffmpeg module | javascript|fluent-ffmpeg | -2 | 45 | 1 | 72,301,223 | 72,301,223 | -1 | true | 2022-05-19T08:32:22.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to use fluent-ffmpeg module<p>I want to ask about video convert in JS. I chose the <a href="https://www.npmjs.com/package/fluent-ffmpeg" rel="nofollow... |
72,386,145 | How to use environment variables in React?<pre class="lang-r prettyprint-override"><code>process.env.VARIABLE_NAME
</code></pre>
<p>This does not work for some reason. It works in node after configuration the <code>dotenv</code> library.</p>
<p>What do I need to do in the react side to make it work?</p> | <p>You can use <code>dotenv</code> in React only for variables that start with <code>REACT_APP_</code>.</p>
<p>So,</p>
<pre><code>// index.js
require('dotenv').config();
console.log(process.env.REACT_APP_API_KEY) //works
console.log(process.env.DB_USER) //does not work
</code></pre> | How to use environment variables in React? | reactjs|environment-variables | -1 | 45 | 1 | 72,386,163 | 72,386,163 | -1 | true | 2022-05-26T02:47:59.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use environment variables in React?<pre class="lang-r prettyprint-override"><code>process.env.VARIABLE_NAME
</code></pre>
<p>This does not work for so... |
72,392,624 | Getting CreationTime from PNG<p>I'm coding a winForm application that renames images with the datetime taken.
e.g. Original image name => Image_YYYYMMDD_HHMMSS</p>
<p>I was using GetPropertyItem(36867) which is the Exif Date/Time Origin.
But this only works on JPG, not PNG.
As far as I know PNG does not have exif un... | <p><code>File.GetCreationTime(file path)</code> from the <code>System.IO</code> namespace is the best you can (reliably) do. Unfortunately PNG metadata doesn't usually contian a creation date so getting the write date is the best you can do. For more information on how to use this, read:</p>
<p><a href="https://docs.mi... | Getting CreationTime from PNG | c#|datetime|png|exif|exiftool | 0 | 45 | 1 | 72,393,148 | 72,393,148 | -1 | true | 2022-05-26T13:29:42.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting CreationTime from PNG<p>I'm coding a winForm application that renames images with the datetime taken.
e.g. Original image name => Image_YYYYMMDD_H... |
72,866,499 | How to pass arbitrary Python object (e.g. InMemoryUploadFile) to a different Django view<p>This question will likely betray my inexperience in web development, so please let me know if I'm solving entirely the wrong problem.</p>
<p>I'm building a web application where users are asked to upload a data file. After upload... | <p>I see your problem can be solved in two ways:</p>
<p>a) <code>InMemoryUploadFile</code> will be deleted after your <code>view (function)</code> returns something.</p>
<ol>
<li>User send file on <code>view_reciever</code>, where this file will be processed with your business logic, and saved on the <code>cloud</code>... | How to pass arbitrary Python object (e.g. InMemoryUploadFile) to a different Django view | python|django | 1 | 45 | 1 | 72,866,985 | 72,866,985 | 1 | true | 2022-07-05T08:46:40.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass arbitrary Python object (e.g. InMemoryUploadFile) to a different Django view<p>This question will likely betray my inexperience in web developmen... |
72,996,656 | Image Picker from gallery or camera is not opening when clicking the bottomSheet icons - flutter<p>I am building a registration screen and it is asking the user to choose a profile picture which is implemented inside the CircleAvatar widget, when the user clicks the avatar a bottomSheet appears with Camera Icon and Gal... | <p>I used your part of your code and add <em>the pick image function</em>.
Each button will trigger different functions and show correctly.</p>
<p>Could you try my code or extract code inside onPressed() as a new function again?</p>
<pre class="lang-dart prettyprint-override"><code>import 'dart:async';
import 'dart:io'... | Image Picker from gallery or camera is not opening when clicking the bottomSheet icons - flutter | flutter|dart | 0 | 45 | 3 | 72,997,204 | 72,997,204 | 1 | true | 2022-07-15T15:52:58.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Image Picker from gallery or camera is not opening when clicking the bottomSheet icons - flutter<p>I am building a registration screen and it is asking the u... |
73,013,202 | How to extract elements from a complex list in Python<p>I have a list like this:</p>
<pre><code>ls = {
'info': {
'id': '237371250',
'market': 'BCH-PERP',
'future': 'BCH-PERP',
'side': 'sell',
'type': 'stop',
'orderPrice': None,
'triggerPrice': '104.2',
... | <p>This datastructure is called a <strong>dictionary</strong> (<code>dict</code>) and it works the same way as JSON, just the types are Pythonic.</p>
<p>E.g.:
A typical JSON file would be like this</p>
<pre class="lang-json prettyprint-override"><code>{
"id": 2,
"name": null,
"is_al... | How to extract elements from a complex list in Python | python | -3 | 45 | 1 | 73,013,396 | 73,013,396 | 1 | true | 2022-07-17T15:49:04.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract elements from a complex list in Python<p>I have a list like this:</p>
<pre><code>ls = {
'info': {
'id': '237371250',
'mark... |
72,808,198 | How transform colums with list to adjacency matrix<p>I have dataframe and one column contain lists about market basket.
For example:</p>
<pre><code>|receipt_no |items|
|--| --- |
|0 | ['2672', '121431', '121', '49292', '1827']|
|1 |['331', '131', '121']|
|2 |['121', '49292', '1313']|
|3 |['131345', '24', '2314', '194'... | <p>Following some discussion in comments, I now understand the OP's design of his 'adjacency matrix'. Properly formatted, it looks like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th></th>
<th>121</th>
<th>131</th>
<th>331</th>
<th>49292</th>
<th>...</th>
</tr>
</thead>
<tbody>
<tr>... | How transform colums with list to adjacency matrix | python|list|graph|networkx | 1 | 45 | 1 | 72,815,249 | 72,815,249 | 1 | true | 2022-06-29T21:44:41.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How transform colums with list to adjacency matrix<p>I have dataframe and one column contain lists about market basket.
For example:</p>
<pre><code>|receipt_... |
72,835,703 | Sort 2d C++ array by first element in subarray<p>I am trying to sort a c++ subarray by first element.
My code is currently set up like this:</p>
<pre><code>int umbrellas[3][2] = {{5, 6}, {2, 7}, {9, 20}};
int n = sizeof(umbrellas) / sizeof(umbrellas[0]);
sort(umbrellas, umbrellas + n, greater<int>());
</code></... | <p>Use a <code>std::vector</code> of <code>std::vector</code> as your container and the sort becomes much easier to do with. Not only is <code>std::vector</code> the preferred container for C++ but using STL functions on it is way simpler and direct , without any substantiable overhead.</p>
<p>Define your data as</p>
<... | Sort 2d C++ array by first element in subarray | c++|arrays|sorting | 2 | 45 | 2 | 72,837,755 | 72,837,755 | 1 | true | 2022-07-02T00:41:27.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort 2d C++ array by first element in subarray<p>I am trying to sort a c++ subarray by first element.
My code is currently set up like this:</p>
<pre><code>i... |
72,912,518 | ReacJS destruct function<p>I learnig reactjs (I'm from Angular, C#) and I broking my head with this....have this lib</p>
<pre><code>const libA=()=>{
const fnA = () => {
return ...
}
const fnB = () => {
return ...
}
const fnC = () => {
return ...
}
return [fnA, fnB, fbC]
}
expo... | <p>Firstly, you exported <code>libA</code> as a <code>default export</code> so you should not import them as <code>named imports</code></p>
<p>Eg: <code>import libA from '../myLib.js'</code> instead of <code>import { libA } from '../myLib.js'</code>.</p>
<p>Secondly, deconstructing arrays in JS mean that sequence/order... | ReacJS destruct function | reactjs|react-hooks | 0 | 45 | 3 | 72,912,660 | 72,912,660 | 1 | true | 2022-07-08T13:57:40.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ReacJS destruct function<p>I learnig reactjs (I'm from Angular, C#) and I broking my head with this....have this lib</p>
<pre><code>const libA=()=>{
con... |
72,977,273 | Impute Average value of one column grouped by other columns in Pandas Dataframe<p>I have a dataframe <code>df</code> :</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>City</th>
<th>Territory</th>
<th>Region</th>
<th>Area</th>
<th>Sales</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chicopee</td>
<td>... | <p>try this:</p>
<pre><code>avg_sale = df.groupby('Region').agg(avg_sale_region=('Sales', np.mean))
df.merge(avg_sale, on='Region')
</code></pre>
<p>This is for region, you can do the same for other columns such as city, ...</p>
<pre><code>for col in columns_you_want: #columns_you_want=['City', 'Region', ...]
avg_s... | Impute Average value of one column grouped by other columns in Pandas Dataframe | pandas|dataframe | -1 | 45 | 1 | 72,977,326 | 72,977,326 | 1 | true | 2022-07-14T08:11:18.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Impute Average value of one column grouped by other columns in Pandas Dataframe<p>I have a dataframe <code>df</code> :</p>
<div class="s-table-container">
<t... |
72,878,466 | Rerendering child component when parent state changes in React<p>I'm still pretty new to React, so I'm sorry if this has a simple answer. I'm trying to make a bar at the top of the page re-render every time the URL changes (with React Router). After struggling with this for a while (please let me know if you have any t... | <p>Just a few remarks:</p>
<p>Don't use the state as a key for <code>TopBar</code>, In the <code>render</code> of <code>PhotoShare</code>.<br />
React keys should be simple Strings.<br />
You can simply use <code>"TopBar"</code> as a key.<br />
Anyways it's a single child & a key may not be even required.... | Rerendering child component when parent state changes in React | javascript|reactjs|state|react-props | 0 | 45 | 1 | 72,878,679 | 72,878,679 | 1 | true | 2022-07-06T05:47:01.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rerendering child component when parent state changes in React<p>I'm still pretty new to React, so I'm sorry if this has a simple answer. I'm trying to make ... |
72,940,855 | Pandas - how to flag if a dataframe column has a non-permitted value in it?<p>I have a dataframe that looks a bit like this:</p>
<pre><code>offer | type
------|-----
123 | A
456 | B
789 | C
</code></pre>
<p>I want to set up an if statement which prints a warning message if any values other than A or B are include... | <p><a href="https://stackoverflow.com/a/72940924/9769953">Chris's answer</a> is the better solution, but to show where your method went wrong:</p>
<pre><code>if (~df["type"].isin(["A","B","a","b"])).any():
print("WARNING - Not all offers are the correct types!&... | Pandas - how to flag if a dataframe column has a non-permitted value in it? | python|pandas | 0 | 45 | 3 | 72,940,994 | 72,940,994 | 1 | true | 2022-07-11T15:18:30.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas - how to flag if a dataframe column has a non-permitted value in it?<p>I have a dataframe that looks a bit like this:</p>
<pre><code>offer | type
----... |
72,774,092 | bash: change names of multiple filles<p>within the workdir I have number of files</p>
<pre><code>mol0.pdb
mol1.pdb
mol2.pdb
...
mol888.pdb
</code></pre>
<p>I need to rename this files changing the number +1 for each file in order that it could became like:</p>
<pre><code>mol1.pdb
mol2.pdb
mol3.pdb
...
mol889.pdb
</code... | <pre class="lang-bash prettyprint-override"><code>list=( mol*.pdb )
while IFS= read -r n; do
mv "mol$n.pdb" "mol$((n + 1)).pdb"
done < <( printf '%s\n' "${list[@]}" | sed 's/mol\(.*\)\.pdb/\1/' | sort -nr )
</code></pre>
<p><code>sort -rn</code> is here to sort the list of numbers ... | bash: change names of multiple filles | bash | 1 | 45 | 3 | 72,774,585 | 72,774,585 | 1 | true | 2022-06-27T14:49:33.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bash: change names of multiple filles<p>within the workdir I have number of files</p>
<pre><code>mol0.pdb
mol1.pdb
mol2.pdb
...
mol888.pdb
</code></pre>
<p>I... |
73,024,742 | Outlook Windows Background Image Space Email Template<p>I am trying to get rid of a space at the right hand side of my banner image in my email template. I have tried things from this <a href="https://www.emailonacid.com/blog/article/email-development/html-background-images-in-email/#vml" rel="nofollow noreferrer">bac... | <p>Worked for me on my Outlook (Windows, 365) when I changed from px to pt. You also have to multiply by 0.75 of course. So it becomes:</p>
<pre><code><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:450pt; height:247pt; border: 0; display: in... | Outlook Windows Background Image Space Email Template | html|css|email|outlook|html-email | 0 | 45 | 1 | 73,029,200 | 73,029,200 | 1 | true | 2022-07-18T15:20:37.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Outlook Windows Background Image Space Email Template<p>I am trying to get rid of a space at the right hand side of my banner image in my email template. I ... |
72,950,402 | Howto locate a git merge commit which accidentally rewinded a submodule<p>We have a large repository with several submodules.
Every now an then a submodule is accidentally rewinded when commiting a merge. (Sometime it happend when using TortoiseGIT and the submodule got checked. We also have a case where is happend usi... | <p>As a first cut that should get the candidates down into easy eyeball territory, you're looking for commits where changed submodule entries aren't descended from what they were before.</p>
<p>Checking this conveniently is hardcore, but not hard.</p>
<pre><code>find $PWD -type d -name objects -execdir test -f HEAD -a ... | Howto locate a git merge commit which accidentally rewinded a submodule | git | 0 | 45 | 1 | 72,953,868 | 72,953,868 | 1 | true | 2022-07-12T09:55:46.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Howto locate a git merge commit which accidentally rewinded a submodule<p>We have a large repository with several submodules.
Every now an then a submodule i... |
72,778,213 | Using MySQL window function to section timeseries when value changes<p>I am looking for a way to split a dataset into sections whenever a value change inside a partition. Note that each switch of value is a new section - also if the value switches back to the same as in an earlier section.</p>
<p>Trying to illustrate u... | <p>You get a number that distinguishes which time a value has occurred for a group_id by subtracting the number of times that value has occurred for the group_id so far from the total occurrences of that group_id so far; a little thought will show you this value will always be the same within a series of the same value... | Using MySQL window function to section timeseries when value changes | mysql|group-by|window-functions|gaps-and-islands | 0 | 45 | 1 | 72,779,377 | 72,779,377 | 1 | true | 2022-06-27T20:55:52.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using MySQL window function to section timeseries when value changes<p>I am looking for a way to split a dataset into sections whenever a value change inside... |
72,931,638 | Django link to a specific users profile page<p>I have a social media website that will allow a user to view another users profile page by clicking their username from one of their posts that appears in the feed section of my page. I have view_profile view created but need to pass in the desired users username into the ... | <p>Add a variable to your view:</p>
<pre><code>def view_profile(request, account):
...
</code></pre>
<p>And urls:</p>
<pre><code>path('view_profile/<str:account>', ...)
</code></pre>
<p>Then you can go to url: <code>localhost:8000/view_profile/logan9997</code>.</p>
<p>You can do it better with <code>User</cod... | Django link to a specific users profile page | python|django|django-views|python-requests|request | 1 | 45 | 1 | 72,931,700 | 72,931,700 | 1 | true | 2022-07-10T20:24:21.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django link to a specific users profile page<p>I have a social media website that will allow a user to view another users profile page by clicking their user... |
72,921,310 | String To Double Error With Switch-Case Calculator<p>Basically, the program calculates the two numbers we enter, according to the entered sign.</p>
<p><img src="https://i.stack.imgur.com/SAtAN.png" alt="Program Picture" /></p>
<p>But I got an error:</p>
<blockquote>
<p>Cannot implicitly convert type 'string' to 'double... | <p>This row is causing the trouble:</p>
<pre><code>rslt = textBox4.ToString();
</code></pre>
<p>You're trying to read an string containing object information into a double, that won't work.</p>
<p>Just skip this line. Then add this:</p>
<pre><code>textBox4.Text = rslt.ToString();
</code></pre>
<p>to your code after the... | String To Double Error With Switch-Case Calculator | c# | 0 | 45 | 1 | 72,921,379 | 72,921,379 | 1 | true | 2022-07-09T12:21:10.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
String To Double Error With Switch-Case Calculator<p>Basically, the program calculates the two numbers we enter, according to the entered sign.</p>
<p><img s... |
72,844,295 | How to avoid cycles when introducing FOREIGN KEY constraint in a table?<p>I'm using <strong>code-first</strong> approach with <strong>EF Core 6</strong> to construct the database and its tables. The problem is that when I update the database, I get an error regarding cycles or multiple cascade paths. I searched the sam... | <p>you need to add some extra config like this :</p>
<pre><code> protected override void OnModelCreating(ModelBuilder mb)
{
var pmConfig = mb.Entity<PmDataSet>();
pmConfig.HasOne(n => n.Equipment).WithMany(n => n.PmDataSets).OnDelete(DeleteBehavior.NoAction);
}
</code></pre>
<p>the problem is ... | How to avoid cycles when introducing FOREIGN KEY constraint in a table? | c#|entity-framework-core|ef-code-first | 0 | 45 | 1 | 72,844,652 | 72,844,652 | 1 | true | 2022-07-03T06:14:23.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to avoid cycles when introducing FOREIGN KEY constraint in a table?<p>I'm using <strong>code-first</strong> approach with <strong>EF Core 6</strong> to c... |
72,778,482 | I am having a problem with Query selectors for this project website<p>So I am learning web dev, and I am a beginner. I have learned a tiny bit about DOM manipulation and I am facing a small issue with a click event.</p>
<p><a href="https://codepen.io/meroosa/pen/dymbEGm" rel="nofollow noreferrer">The HTML CSS and JS co... | <p>Check out the below snippet. i have updated theFoodImg variable to theFoodImgs and leveraged querySelectorAll to get a node list of all the .food-img class elements.
Then use a foreach loop on the nodelist to loop it and add your listeners.
You may want to update more of your variables from querySelector to querySel... | I am having a problem with Query selectors for this project website | javascript|html|css | 0 | 45 | 3 | 72,778,587 | 72,778,587 | 1 | true | 2022-06-27T21:26:50.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am having a problem with Query selectors for this project website<p>So I am learning web dev, and I am a beginner. I have learned a tiny bit about DOM mani... |
72,775,274 | How to display data from jquery api call for stock price<p>I am trying to display the end of day (eod) stock price for a share (Lloyds Bank) for a school project.</p>
<p>I have an account with marketstack.com who provide the API. The URL request works well, but I would really love some help helping me display this on a... | <p>Your logic is correct. The issue you have is that your syntax around the template literal is incorrect. You have used too many <code>`</code> characters. It's clearer to see this if you keep the literal on a single line.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fal... | How to display data from jquery api call for stock price | jquery|api|stock | 1 | 45 | 1 | 72,775,548 | 72,775,548 | 1 | true | 2022-06-27T16:16:01.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display data from jquery api call for stock price<p>I am trying to display the end of day (eod) stock price for a share (Lloyds Bank) for a school pro... |
72,869,708 | How to use an option in a selection element to run a function depending on the selected option<p>I aim to use a selected option (item01) on a selector element to run a specific function and this function should then apply a class to each of the objects inside of the array (array01) using the ids of the objects that cor... | <p>The simplest way to do what you require would be to match the elements which should have the class to the selected option's value. In the example below I've done this by placing the classes to group the elements in the HTML.</p>
<p>Note in the example below that it's using the <code>change</code> event of the <code>... | How to use an option in a selection element to run a function depending on the selected option | javascript|jquery|arrays|function|drop-down-menu | 1 | 45 | 1 | 72,869,812 | 72,869,812 | 1 | true | 2022-07-05T12:47:32.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use an option in a selection element to run a function depending on the selected option<p>I aim to use a selected option (item01) on a selector elemen... |
72,956,707 | Using INSERT and UPSERT in SQLite trigger to update one table from another table?<p>I'm attempting to create a SQL database for an Auction company I work for. The issue I'm running into is creating triggers that update other inventory tables from the main inventory. I've tried quite a few different things, but can't wr... | <p>I figured it out and was able to solve the above problem with:</p>
<pre><code>CREATE TRIGGER Inventory_Update AFTER UPDATE ON AllInventory
FOR EACH ROW
WHEN new.Location LIKE 'Keyword'
BEGIN
INSERT OR REPLACE INTO Inventory1 (UID, LotNumber, ItemType, AuctionDate, AuctionHouse, Location)
VALUES (new.UID, ne... | Using INSERT and UPSERT in SQLite trigger to update one table from another table? | sql|sqlite|triggers|relational-database | 0 | 45 | 1 | 72,957,028 | 72,957,028 | 1 | true | 2022-07-12T18:12:42.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using INSERT and UPSERT in SQLite trigger to update one table from another table?<p>I'm attempting to create a SQL database for an Auction company I work for... |
72,913,878 | TypeScript type for a function with a return type specified by an input parameter<p>Iβm trying to specify a TypeScript type for a function that takes an <code>input</code> and an optional <code>outputType</code> parameter which determines the return type. If no <code>outputType</code> is specified the return type match... | <p>The first thing we need is a map which maps from the string literal type to the return type.</p>
<pre><code>type TypeMap = {
string: string
buffer: Buffer
stream: stream.Readable
}
</code></pre>
<p>For both <code>input</code> and <code>output</code> we add the generic types <code>I</code> and <code>O</code> to... | TypeScript type for a function with a return type specified by an input parameter | typescript | 0 | 45 | 1 | 72,914,315 | 72,914,315 | 1 | true | 2022-07-08T15:42:16.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeScript type for a function with a return type specified by an input parameter<p>Iβm trying to specify a TypeScript type for a function that takes an <cod... |
72,776,575 | Convert a conditional formatting formula into an ARRAYFORMULA to display text on first occurrence of duplicate<p>I'm trying to create an ARRAYFORMULA for a column that will display text if the value in Column A is unique, and if it is a duplicate display text indicating if the value is the first occurrence of a duplica... | <pre><code>=ARRAYFORMULA(IF(LEN(A2:A),IF(COUNTIFS(A:A,A2:A)=1,"Great! I'm unique!",IF(MATCH(A2:A,A:A,0)=ROW(A2:A),"I'm the first instance!", "I'm just a clone..")),""))
</code></pre>
<p><a href="https://i.stack.imgur.com/1qhV0.png" rel="nofollow noreferrer"><img src="https://i.st... | Convert a conditional formatting formula into an ARRAYFORMULA to display text on first occurrence of duplicate | google-sheets|google-sheets-formula | 0 | 45 | 1 | 72,777,034 | 72,777,034 | 2 | true | 2022-06-27T18:04:37.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a conditional formatting formula into an ARRAYFORMULA to display text on first occurrence of duplicate<p>I'm trying to create an ARRAYFORMULA for a c... |
72,781,697 | Return Data From Other Component [React Native/React]<p>hope you guys have a great great day! :)</p>
<p>I want to ask something, i need to return some list data from API,</p>
<p>I have 3 files, one called <code>getUser.js</code> and the othe is <code>User.js</code> and <code>OtherUser.js</code>, i already fetch the dat... | <p>Avoid using <code>then</code> chains, when using async-await. Refactor your <code>getUser</code> funciton to</p>
<pre><code>export const getUser = async () => {
const response = await fetch("https://myapi.com");
const json = await response.json();
return json;
};
</code></pre>
<p>Then in your <cod... | Return Data From Other Component [React Native/React] | reactjs|react-native|components | 0 | 45 | 2 | 72,781,761 | 72,781,761 | 2 | true | 2022-06-28T06:32:43.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return Data From Other Component [React Native/React]<p>hope you guys have a great great day! :)</p>
<p>I want to ask something, i need to return some list d... |
72,782,763 | How to access the value of a struct member which stores return value of a function pointer?<p>I have the following structure definitions:</p>
<pre><code>typedef struct S_t S_t;
struct S_t {
float *s_ptr;
uint32_t ns;
};
typedef struct p_t p_t;
struct p_t {
int32_t pID;
float pVal;
};
typedef struct... | <p>You need to call the function to get the return value. It is not stored anywhere and the function pointer does not store the last return value. Use it as any "normal" function</p>
<pre><code>if(SP2->TrimS(tS2, 8) == failure)
{
/* do something */
}
else
{
/* do something else */
}
</code></pre>
<... | How to access the value of a struct member which stores return value of a function pointer? | c|pointers|struct|function-pointers | 0 | 45 | 1 | 72,783,002 | 72,783,002 | 2 | true | 2022-06-28T08:02:12.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access the value of a struct member which stores return value of a function pointer?<p>I have the following structure definitions:</p>
<pre><code>type... |
72,787,559 | Serializable field String JSON<p>I have a class</p>
<pre><code>public class ClassSerializable {
private Long id;
private String json;
}
</code></pre>
<p>Where field <code>json = {"fieldJson": {"one": 1, "two": 1}}</code></p>
<p>If deserialize with ObjectMapper this object</p>
<pre><c... | <p>The behaviour is correct, but it is different from your intention.</p>
<p>You have an object with two fields:</p>
<ul>
<li>id of type long</li>
<li>json of type String</li>
</ul>
<p>but your intention is to store an object in the json field.
You need to store it as an Object in java too. If you know that the json fi... | Serializable field String JSON | java|json|objectmapper|serializable | 0 | 45 | 2 | 72,787,805 | 72,787,805 | 2 | true | 2022-06-28T13:43:26.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Serializable field String JSON<p>I have a class</p>
<pre><code>public class ClassSerializable {
private Long id;
private String json;
}
</code></pre>
<... |
72,788,843 | How to print out request.body data in django?<p>Just working through the Django tutorials and playing around with stuff. Was going through the HttpResponse and HttpRequest docs and I'm just trying to print out data to see how things work.</p>
<p>However, when I try to print to console the <code>request.body</code> I ge... | <p>The print displays an empty string because GET does not accept a body. Taken directly from the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Request/body" rel="nofollow noreferrer">Mozilla Web APIs docs</a>:</p>
<blockquote>
<p>Note that a request using the GET or HEAD method cannot have a body and null ... | How to print out request.body data in django? | django | -2 | 45 | 1 | 72,790,395 | 72,790,395 | 2 | true | 2022-06-28T15:01:04.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to print out request.body data in django?<p>Just working through the Django tutorials and playing around with stuff. Was going through the HttpResponse a... |
72,790,477 | GroupBy with Maximal Group Size<p>I have a dataframe <code>df</code> that looks like this:</p>
<pre><code>column_a ...
1
1
1
2
3
3
3
3
3
</code></pre>
<p>I now want to group the dataframe based on <code>column_a</code> but the resulting groups should be not of greater size than <code>s</code>.
So, fo... | <p>It seems like you could group by <code>a</code> and the floor div of the groupby cumcount and s.</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'a':[1,1,1,2,3,3,3,3,3]})
s = 2
df.groupby(['a',df.groupby('a').cumcount()//s]).size()
</code></pre>
<p>Output</p>
<pre><code>a
1 0 2
1 1
2 0 1
3 0 ... | GroupBy with Maximal Group Size | python|pandas|dataframe|group-by | 2 | 45 | 1 | 72,790,793 | 72,790,793 | 2 | true | 2022-06-28T16:56:01.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GroupBy with Maximal Group Size<p>I have a dataframe <code>df</code> that looks like this:</p>
<pre><code>column_a ...
1
1
1
2
3
3
3
3
3
<... |
72,791,342 | How can I make modern search bar in PySide2?<p>I was making my own web browser until I realized that making a searchbar was a difficult task. I tried removing the title bar, but it didn't work out as expected because of <code>pyside2</code> limitations. Then, I made my own searchbar but it wasn't interactive and the de... | <p>Use <code>QlineEdit</code> and <code>setPlaceHolderText</code>, if you want some effects to use like google search completer, use <code>QCompleter</code>. Hope it helps you. As far as I come across, there is nothing called as search bar option in pyqt5.</p> | How can I make modern search bar in PySide2? | python-3.x|pyqt5|pyside2 | -2 | 45 | 1 | 72,798,602 | 72,798,602 | 2 | true | 2022-06-28T18:15:20.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make modern search bar in PySide2?<p>I was making my own web browser until I realized that making a searchbar was a difficult task. I tried removin... |
72,826,393 | Get the value of obserable inside obserable rxjs<p>I have below Observable</p>
<pre><code> config$: Observable<QueryBuilderConfig>;
this.config$.pipe(map(item => {
return {
fieldGroups: [
{ id: CustomAttributeEntityType.Risk, label: this.l('Risk') },
{ id: CustomAttributeEntityType.RiskAsse... | <p>Depends on what you exactly mean by "value from other observable": two streams emitting independently, and you want to catch values from both? That's</p>
<pre><code>combineLatest([stream1$, stream2$])
.subscribe(([val1$, val2$]) => //...
</code></pre>
<p>Or use value from one stream to create anothe... | Get the value of obserable inside obserable rxjs | javascript|angular|rxjs|rxjs-observables|rxjs-pipeable-operators | -3 | 45 | 2 | 72,826,701 | 72,826,701 | 2 | true | 2022-07-01T08:23:12.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get the value of obserable inside obserable rxjs<p>I have below Observable</p>
<pre><code> config$: Observable<QueryBuilderConfig>;
this.config$.pipe... |
72,827,596 | Remove dynamically appended <TR> from jquery<p>I append the <code><tr></code> to <code><tbody></code></p>
<pre><code>for (var i = 0 ;i < 12 ;i++){
$(`<tr><td>test</td></tr>`).appendTo('#songsTbody');
}
</code></pre>
<p>to this html.</p>
<pre><code><tbody id="songsTbody&q... | <p>You can pass a selector into the <code>.remove()</code> call so if there are no other s and you want to remove them all, you could do <code>$('#songsTbody').remove('tr')</code> or even just <code>$('#songsTbody tr').remove()</code>.</p>
<p>If you need to just remove the last one that was added, you could try <code>$... | Remove dynamically appended <TR> from jquery | javascript|html|jquery | 1 | 45 | 3 | 72,827,653 | 72,827,653 | 2 | true | 2022-07-01T10:01:55.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove dynamically appended <TR> from jquery<p>I append the <code><tr></code> to <code><tbody></code></p>
<pre><code>for (var i = 0 ;i < 12 ;i... |
72,833,347 | How to test if var is not either of two strings?<p>I've stumbled upon a problem I can't explain.</p>
<pre><code>chosen = input()
if chosen == "1" or chosen == "2":
print("Okay")
else:
print("Please choose between 1 or 2.")
</code></pre>
<p>If written like that it executes as ... | <p>Ideally, you'd use <code>in</code> for this, which reads much cleaner</p>
<pre><code>while True:
chosen = input()
if chosen in ["1", "2"]:
print("Okay")
break
else:
print("Please choose between 1 or 2.")
</code></pre> | How to test if var is not either of two strings? | python|if-statement | -1 | 45 | 2 | 72,833,479 | 72,833,479 | 2 | true | 2022-07-01T18:29:57.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test if var is not either of two strings?<p>I've stumbled upon a problem I can't explain.</p>
<pre><code>chosen = input()
if chosen == "1" o... |
72,841,316 | Iterating over object and displaying as table - React.js<p>I have an object:</p>
<pre><code>{
cities: {
MCR: "Manchester",
LDN: "London",
NYC: "New York"
}
}
</code></pre>
<p>and I want to iterate over these and display them in a table format which will show the city code ... | <p>let say you have an object as:</p>
<pre><code> const obj = {
cities: {
MCR: "Manchester",
LDN: "London",
NYC: "New York"
}
};
</code></pre>
<blockquote>
<p>It would be better to loop over <code>cities</code> and create a new <code>tr</code> so that It looks ... | Iterating over object and displaying as table - React.js | javascript|reactjs|typescript | 1 | 45 | 3 | 72,841,346 | 72,841,346 | 2 | true | 2022-07-02T17:56:23.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Iterating over object and displaying as table - React.js<p>I have an object:</p>
<pre><code>{
cities: {
MCR: "Manchester",
LDN: "Lo... |
72,831,474 | Is there a way to run a bat file from python and keep going with the execution of the program?<p>I am running a program where first I run a batch and then I want to do other things which need the script run by batch file to be active.</p>
<p>The problem is that the instructions after the running of the batch are not ex... | <p>Try using this:</p>
<pre><code>subprocess.Popen([<path_bat_file_to_run>])
</code></pre>
<p>Instead of:</p>
<pre><code>subprocess.call([<path_bat_file_to_run>])
</code></pre>
<p>More detailed answer here:
<a href="https://stackoverflow.com/questions/16071866/non-blocking-subprocess-call">Non blocking subp... | Is there a way to run a bat file from python and keep going with the execution of the program? | python|batch-file|subprocess | 1 | 45 | 1 | 72,849,820 | 72,849,820 | 2 | true | 2022-07-01T15:25:50.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to run a bat file from python and keep going with the execution of the program?<p>I am running a program where first I run a batch and then I ... |
72,860,260 | How do I take a JSON string and select a random entry and get the variables from that entry<p>I have the following json..</p>
<pre><code>{
"Followers": [{
"ID": 0,
"Username": "nutty",
"Game": "Just Chatting",
"Viewers&... | <p>You are missing casting here:</p>
<pre><code>int SelectedViewers = Int32.Parse((string)data["Followers"][1]["Viewers"]);
</code></pre>
<p>The above should work.</p> | How do I take a JSON string and select a random entry and get the variables from that entry | c#|json|parsing | 0 | 45 | 2 | 72,860,342 | 72,860,342 | 2 | true | 2022-07-04T17:30:34.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I take a JSON string and select a random entry and get the variables from that entry<p>I have the following json..</p>
<pre><code>{
"Follower... |
72,863,367 | React Native params not updating<p>I am trying to pass params to a detail screen for a blog post but the first time i navigate to the detail screen, the params don't get passed (shows null). then i back to original screen and click on a new blog post and it'll show params from the first blog post..</p>
<p>This is my fu... | <p>try this,</p>
<pre><code>const onBlogDetail = (item) => {
setBlogSelected(item.id)
navigation.navigate( 'BlogDetail', { blog_id: item.id }); // pass item.id here
};
</code></pre> | React Native params not updating | react-native|react-router|parameter-passing|react-native-navigation | 0 | 45 | 1 | 72,863,804 | 72,863,804 | 2 | true | 2022-07-05T02:14:12.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Native params not updating<p>I am trying to pass params to a detail screen for a blog post but the first time i navigate to the detail screen, the para... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.