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,916,954 | Join Tables in Snowflake on Specific Criteria<p>Attempting to join two tables, A and B in Snowflake on specific criteria. I want to join on Person_id but the Person_id row from Table B has to be 1+row from Table A.</p>
<pre><code>Table: A
|Person_id | Name |
|----------|----------|
| 0 | John |
| 1 ... | <p>The join condition allows calculations, so just add one to the PERSON_ID for Table A:</p>
<pre><code>create table TABLE_A (PERSON_ID int, NAME string);
create table TABLE_B (PERSON_ID int, HOURLY int);
insert into TABLE_A (PERSON_ID, NAME) values
(0, 'John'),
(1, 'Patel'),
(2, 'Aaron');
insert into TABLE_B (PERSON... | Join Tables in Snowflake on Specific Criteria | sql|snowflake-cloud-data-platform | 1 | 41 | 1 | 72,918,302 | 72,918,302 | 1 | true | 2022-07-08T21:02:38.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Join Tables in Snowflake on Specific Criteria<p>Attempting to join two tables, A and B in Snowflake on specific criteria. I want to join on Person_id but the... |
72,918,607 | How to sort a concatenated string in a column in R?<p>Have a data frame with a concatenated column that I want to order numerically with the number after <code>-</code></p>
<pre><code>df <- data.frame(Order = c("A23_2-A27_3-A40_4-A10_1", "A25_2-A21_3-A11_1", "A9_1", "A33_2-A8_1&quo... | <pre><code>df %>%
rowid_to_column() %>%
separate_rows(Order, sep='-') %>%
separate(Order, c('Order', 'v'), convert = TRUE) %>%
arrange(v)%>%
group_by(rowid) %>%
summarise(Order = str_c(Order, collapse = ''))
# A tibble: 4 x 2
rowid Order
<int> <chr>
1 1... | How to sort a concatenated string in a column in R? | r|dplyr|tidyverse | 1 | 41 | 3 | 72,918,652 | 72,918,652 | 1 | true | 2022-07-09T02:55:10.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sort a concatenated string in a column in R?<p>Have a data frame with a concatenated column that I want to order numerically with the number after <co... |
72,919,074 | How to centre rectangle in view<p>I want to centre a rectangle in a view, i try using midX or midY but the view still not centre</p>
<p><a href="https://i.stack.imgur.com/r7fR3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r7fR3.png" alt="overlay rect" /></a></p>
<p>this is how i setup the rectangl... | <p>You have to subtract half-height and width from the center, as you have set start x and y position from the center point</p>
<p>so change your rect code.</p>
<pre><code>let rect = CGRect(x: center.x - size/2, y: center.y - size/2, width: size, height: size)
</code></pre> | How to centre rectangle in view | swift|cgrect|cgpoint | 0 | 41 | 1 | 72,919,234 | 72,919,234 | 1 | true | 2022-07-09T05:02:58.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to centre rectangle in view<p>I want to centre a rectangle in a view, i try using midX or midY but the view still not centre</p>
<p><a href="https://i.st... |
72,920,775 | How to close a sheet using button shortcuts<p>I'm presenting a sheet to let the user enter a new message on a macOS app. I have a <code>cancel</code> and a <code>save</code> buttons, and I have assigned the <code>.cancelAction</code> and another shortcut to them. The idea is that if the user presses ESC, then the sheet... | <p>The answer is to use:</p>
<pre><code>.buttonStyle(.borderless)
</code></pre> | How to close a sheet using button shortcuts | macos|swiftui | 2 | 41 | 1 | 72,920,828 | 72,920,828 | 1 | true | 2022-07-09T10:55:45.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to close a sheet using button shortcuts<p>I'm presenting a sheet to let the user enter a new message on a macOS app. I have a <code>cancel</code> and a <... |
72,921,949 | python count down to event, print line every minute<p>Would anyone have a better way to make a count down timer for a specific date and time in UTC time zone with the <code>datetime</code> library?</p>
<p>The script below works to count down to the <code>start_time</code> but I have something wrong in the while loop th... | <p>You can use this:</p>
<pre class="lang-py prettyprint-override"><code>from datetime import datetime
def timer(countdown_to):
last_minute = datetime.now().minute
while datetime.now() <= countdown_to:
if datetime.now().minute != last_minute:
print('Time left:', int((countdown_to - date... | python count down to event, print line every minute | python | 0 | 41 | 1 | 72,922,131 | 72,922,131 | 1 | true | 2022-07-09T13:56:14.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python count down to event, print line every minute<p>Would anyone have a better way to make a count down timer for a specific date and time in UTC time zone... |
72,922,345 | How to unset default git user on cloned repositories?<p>I use different emails and users in different git repos.
My git global config file has the user section unset. Here it is (notice how nothing comes after <code>[user]</code>):</p>
<pre><code>[core]
editor = nano
pager = less -x1,5
[push]
default = simp... | <p>We can say the following about <code>user.name</code> and <code>user.email</code>:</p>
<ul>
<li><p>Git will read them from configuration files. The configuration file rules—in particular their <em>order</em>—are defined in <a href="https://git-scm.com/docs/git-config" rel="nofollow noreferrer">the documentation</a>... | How to unset default git user on cloned repositories? | git|git-config | 1 | 41 | 1 | 72,924,973 | 72,924,973 | 1 | true | 2022-07-09T14:50:43.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to unset default git user on cloned repositories?<p>I use different emails and users in different git repos.
My git global config file has the user secti... |
72,930,647 | Dataset after merging gives float values and cannot change to Int<p>I have two dataset,</p>
<pre><code>df1
100
20
30
5
df2
3
4
5
6
</code></pre>
<p>When i try to merge
df3=pd.concat([df1, df2], axis=1, ignore_index= False)</p>
<p>I get the output as :</p>
<pre><code>df1 df2
100.0 3
20.0 4
30.0 5
... | <p>You can try and see:</p>
<pre><code>df3.astype(int)
</code></pre> | Dataset after merging gives float values and cannot change to Int | python|pandas|list|dataframe|integer | 0 | 41 | 3 | 72,930,678 | 72,930,678 | 1 | true | 2022-07-10T17:48:35.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dataset after merging gives float values and cannot change to Int<p>I have two dataset,</p>
<pre><code>df1
100
20
30
5
df2
3
4
5
6
</code></p... |
72,931,352 | SvelteKit updating a request<p>I want to build a town-search functionality so i want to recall the API on every key stroke. Unfortunately my code is not working as expected.</p>
<p>Here is my code</p>
<pre class="lang-html prettyprint-override"><code><script lang="ts">
let query: string = "&quo... | <p>You did not bind the query, so it won't change. Should be this:</p>
<pre class="lang-html prettyprint-override"><code><input bind:value={query} ... />
</code></pre> | SvelteKit updating a request | api|svelte|geocoding|sveltekit|svelte-3 | 2 | 41 | 1 | 72,931,593 | 72,931,593 | 1 | true | 2022-07-10T19:34:59.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SvelteKit updating a request<p>I want to build a town-search functionality so i want to recall the API on every key stroke. Unfortunately my code is not work... |
72,931,717 | jQuery .html() returning undefined despite being defined earlier in the function<p>i have started using jQuery recently and have bumped into a problem. in a function, i use the .html() method as a substitute to innerHTML (which from what i've seen in the documentation, isn't wrong), but for some reason when i try to ch... | <p>Right now you are selecting actual DOM element <code><li></code>.</p>
<p>If you want to create virtual element, you should pass not selector, but it's content:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-cod... | jQuery .html() returning undefined despite being defined earlier in the function | javascript|jquery | -2 | 41 | 1 | 72,931,785 | 72,931,785 | 1 | true | 2022-07-10T20:35:34.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery .html() returning undefined despite being defined earlier in the function<p>i have started using jQuery recently and have bumped into a problem. in a ... |
72,939,912 | AWS Linux: ensure that flaky script keeps running<p>I am trying to write a nanny script, to use in AWS's Linux terminal, to run a python script that can be a bit flakey at times. I am very new to using the terminal / bash, etc, so I could be missing something totally obvious / second nature to others. Here is what I h... | <p>I was able to reproduce your issue, by directly copy-pasting the snippet you pasted.</p>
<p>Modified your script slightly. Feel free to copy-paste directly.</p>
<pre><code>#!/bin/bash
while [ True ]
do
python3 script.py
done
</code></pre>
<p><a href="https://stackoverflow.com/questions/1552749/difference-between-c... | AWS Linux: ensure that flaky script keeps running | python|linux|bash|amazon-ec2 | 0 | 41 | 2 | 72,940,186 | 72,940,186 | 1 | true | 2022-07-11T14:08:29.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS Linux: ensure that flaky script keeps running<p>I am trying to write a nanny script, to use in AWS's Linux terminal, to run a python script that can be a... |
72,942,334 | multiple ManyToOne relations serializer<p>sorry my english is not good.</p>
<p>Get request <code>book_id(pk)</code></p>
<p>How do I serialize ManyToOne fields using <code>BookSerializer</code> to retrieve something</p>
<pre><code>class Book(TimeStampedModel):
name = models.CharField(max_length=25, null=False)
o... | <p>You can span a <a href="https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField" rel="nofollow noreferrer"><strong><code>ManyToManyField</code></strong> <sup>[Django-doc]</sup></a> over you <code>BookMember</code> model:</p>
<pre><code>from django.conf import settings
class Book(Ti... | multiple ManyToOne relations serializer | django|optimization|django-rest-framework | 1 | 41 | 1 | 72,942,668 | 72,942,668 | 1 | true | 2022-07-11T17:17:48.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
multiple ManyToOne relations serializer<p>sorry my english is not good.</p>
<p>Get request <code>book_id(pk)</code></p>
<p>How do I serialize ManyToOne field... |
72,943,421 | How to escape single and double quotes in bash<p>I have a script that takes text as an argument and encodes it. If the text contains only single quotes I surround it with double and vice versa, but it gets tricky if it contains both because it will be closed at first appearance.</p>
<pre><code>script "I can't use ... | <p>Use a here-document, and use command subsitution to turn it into an argument.</p>
<pre><code>script "$(cat <<'EOF'
I can't use "test" text
EOF)"
</code></pre>
<p>Or</p> | How to escape single and double quotes in bash | bash|escaping|quotes|double-quotes|single-quotes | 0 | 41 | 1 | 72,943,542 | 72,943,542 | 1 | true | 2022-07-11T19:01:29.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to escape single and double quotes in bash<p>I have a script that takes text as an argument and encodes it. If the text contains only single quotes I sur... |
72,943,642 | array.some() returns unexpected true<p>I have this lines of code</p>
<pre><code>const countryIds = intersectingBbox.split(';');
const countryFound = countryIds.some(async (id) => {
const possibleCountry = await _inBbox(id);
return _checkPointInPolygonAndDispatch(possibleCountry);
});
</code></pre>
<p>This ... | <p>your async function is returning a <code>Promise</code> which is truthy. you will have to restructure your code to handle the promises.</p> | array.some() returns unexpected true | javascript | 1 | 41 | 1 | 72,943,664 | 72,943,664 | 1 | true | 2022-07-11T19:22:52.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
array.some() returns unexpected true<p>I have this lines of code</p>
<pre><code>const countryIds = intersectingBbox.split(';');
const countryFound = countryI... |
72,944,620 | How can I add required attribute?<p>I would like to add the <code>required</code> attribute in the <em><strong>product_title</strong></em> field. How can I do It?</p>
<pre><code>class add_product_info(forms.ModelForm):
product_desc = RichTextField()
class Meta:
model = Products
fields = ('produ... | <p>Just the same way like you added the <code>style</code> or <code>class</code> attribute:</p>
<pre class="lang-py prettyprint-override"><code>class add_product_info(forms.ModelForm):
product_desc = RichTextField()
class Meta:
model = Products
fields = ('product_title')
labels = {'prod... | How can I add required attribute? | django | 0 | 41 | 4 | 72,944,653 | 72,944,653 | 1 | true | 2022-07-11T20:59:20.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I add required attribute?<p>I would like to add the <code>required</code> attribute in the <em><strong>product_title</strong></em> field. How can I d... |
72,944,339 | Pinescript: Detect when any part of a candle touches a given range<p>I have a range which prints as a cloud on the chart, which has the low defined as series float:</p>
<pre><code>sensitiveCloudBottom
</code></pre>
<p>as the high as series float:</p>
<pre><code>sensitiveCloudTop
</code></pre>
<p>I want to detect wheth... | <p>This should do it</p>
<pre><code>withinCloud = high >= sensitiveCloudBottom and low <= sensitiveCloudTop
</code></pre> | Pinescript: Detect when any part of a candle touches a given range | pine-script|pinescript-v5 | 0 | 41 | 1 | 72,944,921 | 72,944,921 | 1 | true | 2022-07-11T20:30:38.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pinescript: Detect when any part of a candle touches a given range<p>I have a range which prints as a cloud on the chart, which has the low defined as series... |
72,946,635 | Powershell array in array to use in Out-GridView<p>I am trying to optimize how my logging file looks in an app I have developed.
I'm currently using the following code:</p>
<pre><code>$pro_arry = @(
"V 1.0 Initial Release 7 July 2022",
"V 1.1 Optimized Update functionality and added lo... | <p><a href="https://i.stack.imgur.com/ZXxcA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZXxcA.png" alt="enter image description here" /></a>As formatted, this is all just one long string. Hence the results you are getting. You have to format each into their own property (thus column). OGV does a ... | Powershell array in array to use in Out-GridView | arrays|powershell|logging|out-gridview | 0 | 41 | 1 | 72,946,893 | 72,946,893 | 1 | true | 2022-07-12T03:11:56.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell array in array to use in Out-GridView<p>I am trying to optimize how my logging file looks in an app I have developed.
I'm currently using the foll... |
72,948,853 | Transform datastructure with TypeScript<p>I would like to normalize and transform my data with TypeScript. The data that I get looks like this:</p>
<pre><code>packages = {
ungroupped: [
{
id: '0',
status: 'active',
owner: 'Stan Smith'
},
{
id: '1',
status: 'active',
own... | <p>This looks like what you're after:</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 packages = {
ungroupped: [{
id: '0',
status: 'active',
owner: 'Stan Sm... | Transform datastructure with TypeScript | javascript|typescript | 1 | 41 | 1 | 72,948,953 | 72,948,953 | 1 | true | 2022-07-12T07:57:33.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transform datastructure with TypeScript<p>I would like to normalize and transform my data with TypeScript. The data that I get looks like this:</p>
<pre><cod... |
72,948,512 | Is there any method to replace selectROI with auto selection?<p>I have finished detecting faces through videos and generating a bounding box if detected by Haar Cascade classifier.
And now I only want to analyze the particular part of the face such as foreheads or cheeks, but I could just choose the place manually thro... | <p>there can be different ways you can go around for detecting and analysing facial regions, I am listing a few:</p>
<ul>
<li>you can use <a href="http://dlib.net/face_landmark_detection.py.html" rel="nofollow noreferrer"><code>Dlib's Landmark Detector</code></a> to detect facial landmarks and classify the facial regio... | Is there any method to replace selectROI with auto selection? | python|opencv|face-detection | 0 | 41 | 1 | 72,949,217 | 72,949,217 | 1 | true | 2022-07-12T07:26:10.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any method to replace selectROI with auto selection?<p>I have finished detecting faces through videos and generating a bounding box if detected by H... |
72,949,956 | How to add new column where the value is from query (MySQL)<p>I have query that split varchar of string and number and only return the number. Is it possible to save result from this Query into a new column on the same table? And I want it to be permanent, meaning if I close and open the database, the result will still... | <p>If you want <code>ColumnC</code> to reflect changes in <code>ColumnA</code> you could use a calculated column:</p>
<pre><code>alter table t
add column ColumnC varchar(20) as (REGEXP_SUBSTR(ColumnA,'[0-9]+'));
</code></pre>
<p><a href="https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=d06d4cbe99a721e727c81ab6715f127... | How to add new column where the value is from query (MySQL) | mysql|sql | 0 | 41 | 1 | 72,950,124 | 72,950,124 | 1 | true | 2022-07-12T09:22:06.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add new column where the value is from query (MySQL)<p>I have query that split varchar of string and number and only return the number. Is it possible... |
72,949,780 | How to set ScrollToTop Button to be active on viewport height?<p>At the moment i am using hardcoded height point to trigger visible ScrollToTop Button.
i would love to get solution to be triggered when passing viewport height.</p>
<pre><code> const { scrollDirection } = useScrollDirection()
const { scrollPosition } ... | <p>you can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight" rel="nofollow noreferrer">window.innerHeight</a></p>
<pre><code>const toggleVisible = () => {
const viewportHeight = window.innerHeight;
if (scrollPosition === 0) {
setIsVisible(false)
}
**if (scrollP... | How to set ScrollToTop Button to be active on viewport height? | css|reactjs | 0 | 41 | 2 | 72,950,191 | 72,950,191 | 1 | true | 2022-07-12T09:11:25.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set ScrollToTop Button to be active on viewport height?<p>At the moment i am using hardcoded height point to trigger visible ScrollToTop Button.
i wou... |
72,951,524 | Does keyword late work as I expect when constructing Widgets<p>I have a convenience <code>StatelessWidget</code> that returns the appropriate widget for one of three display size breakpoints:</p>
<pre><code>/// Return the most appropriate widget for the current display size.
///
/// If a widget for current display siz... | <p><code>late</code> does not do what you want. It's only for the null-safety feature and when you do or don't get warnings about it. Those two texts get built every time regardless of environment, because they need to be there when they are passed to your widget.</p>
<p>If you to only build the appropriate widgets for... | Does keyword late work as I expect when constructing Widgets | flutter|dart | 1 | 41 | 1 | 72,951,681 | 72,951,681 | 1 | true | 2022-07-12T11:23:33.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does keyword late work as I expect when constructing Widgets<p>I have a convenience <code>StatelessWidget</code> that returns the appropriate widget for one ... |
72,951,027 | I can't pass function of a class from another file into tkinter if statement. AttributeError: 'Mood' object has no attribute 'pass_multiple_genres'<p>This is code from main.py. I don't know how to pass function into nested if statement, so when object from option menu is chosen, the text relevant to this object is show... | <p>Here's a simplified reworking of your code, since it was unfortunately a bit hard to make sense of the original.</p>
<ul>
<li>For a simple program like this, it's really not worth it to split it to multiple modules at this point.</li>
<li>The program consists of three logical sections: the API calls to talk with Mov... | I can't pass function of a class from another file into tkinter if statement. AttributeError: 'Mood' object has no attribute 'pass_multiple_genres' | python|function|oop|if-statement|tkinter | 0 | 41 | 1 | 72,952,179 | 72,952,179 | 1 | true | 2022-07-12T10:44:31.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I can't pass function of a class from another file into tkinter if statement. AttributeError: 'Mood' object has no attribute 'pass_multiple_genres'<p>This is... |
72,953,854 | Vue Props passed to SFC end up as attributes in DIV element<p>I trying to pass an object to a child component. The object is from a fetch request to Strapi. I'm using Nuxt Bridge and Vue 2.6.14</p>
<p>The fetch in the parent</p>
<pre><code><script>
export default {
async fetch() {
this.featured = awa... | <p>Yes, <code>v-bind</code> will spread the object properties.</p>
<p>So the child component <code>props</code> will not contain the <code>featured</code> object, but it will contain all its properties and it will bind it to the main element of the component, and the <code>props</code> will be like that.</p>
<pre><code... | Vue Props passed to SFC end up as attributes in DIV element | javascript|vue.js|nuxt.js|vue-component | 0 | 41 | 2 | 72,953,945 | 72,953,945 | 1 | true | 2022-07-12T14:19:02.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue Props passed to SFC end up as attributes in DIV element<p>I trying to pass an object to a child component. The object is from a fetch request to Strapi. ... |
72,952,365 | Run cleanup in library when main program exits<p>I have a small library written in C which controls a hardware device. The library uses pthreads -- it starts a thread which is in charge of interacting with the hardware device.</p>
<p>In some use cases (but not always) this small library may be used from a Java applicat... | <p>I don't know much about JNI, but I guess your shared library is just loaded at some point, using <code>dlopen</code> or the likes in windows.<br />
gcc and clang have <code>__attribute__((destructor))</code> (and <code>constructor</code>).<br />
You can use this for cleanup and initialization.<br />
On windows, you ... | Run cleanup in library when main program exits | c|linux|pthreads|posix | 1 | 41 | 1 | 72,954,364 | 72,954,364 | 1 | true | 2022-07-12T12:31:12.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run cleanup in library when main program exits<p>I have a small library written in C which controls a hardware device. The library uses pthreads -- it starts... |
72,954,789 | In column dataframe, how do I find the date just before a given date<p>I have the following DF :</p>
<pre><code>Date
01/07/2022
10/07/2022
20/07/2022
</code></pre>
<p>The date x is</p>
<pre><code>12/07/2022
</code></pre>
<p>So basically the function should return</p>
<pre><code>10/07/2022
</code></pre>
<p>I am trying t... | <p>Try this:</p>
<pre><code>d = '12/07/2022'
f = '%d/%m/%Y'
(pd.to_datetime(df['Date'],format=f)
.where(lambda x: x.lt(pd.to_datetime(d,format=f)))
.max())
</code></pre> | In column dataframe, how do I find the date just before a given date | python|pandas | 0 | 41 | 3 | 72,954,910 | 72,954,910 | 1 | true | 2022-07-12T15:26:23.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In column dataframe, how do I find the date just before a given date<p>I have the following DF :</p>
<pre><code>Date
01/07/2022
10/07/2022
20/07/2022
</code>... |
72,951,357 | how to draw prespctive image in android canvas<p>i have searched about how to draw prespctive image in canvas like in the picture but i dont find anything thing. if its not possible using canvas, how i can make something like it?
<a href="https://i.stack.imgur.com/ajiBy.jpg" rel="nofollow noreferrer"><img src="https://... | <p>This is possible by magic method of <code>canvas</code> <code>drawBitmapMesh</code>.</p>
<p>This is example from my project:</p>
<pre><code>static void Draw( Canvas canvas, Rect rt, Ini ini ){
final int sections = 256;
Point size = new Point();
float[] verts = Mesh.GetVertices( rt, sections, ini, size );... | how to draw prespctive image in android canvas | java|android|canvas|graphics|drawing | 0 | 41 | 1 | 72,957,532 | 72,957,532 | 1 | true | 2022-07-12T11:09:46.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to draw prespctive image in android canvas<p>i have searched about how to draw prespctive image in canvas like in the picture but i dont find anything th... |
72,960,161 | How to add a missing closing parenthesis at a specific position to a string in R?<p>I would like to <strong>add a closing parenthesis to strings that have an open parenthesis but are missing a closing parenthesis.</strong> For instance, I would like to modify "This is a (test) (1 testing two" to "This is... | <pre class="lang-r prettyprint-override"><code>library(stringr)
library(magrittr)
text = "This is a (test) (1 testing two"
text1 = "Testing missing (parenthesis)"
c(text, text1) %>%
str_detect(., pattern = "\\([^)]*$")
#> [1] TRUE FALSE
c(text, text1) %>%
ifelse(str_... | How to add a missing closing parenthesis at a specific position to a string in R? | r|regex|string | 0 | 41 | 1 | 72,960,272 | 72,960,272 | 1 | true | 2022-07-13T02:09:19.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add a missing closing parenthesis at a specific position to a string in R?<p>I would like to <strong>add a closing parenthesis to strings that have an... |
72,957,963 | JPanel changes its position by itself<p>I create a HashMap<String, Panel> via a method and return it to use, but one Panel(JPanel) element changes its coordinates to x0 y0 even though I don't, is this a compiler error or my code?</p>
<p>I checked the objects during their creation, but the problem is not in the me... | <p>You badly need to use a LayoutManager. It is a class designed to keep your components at the correct size and position, even if windows or content need a resize.</p>
<p>Check this nice <a href="https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html" rel="nofollow noreferrer">Oracle tutorial on Layout Man... | JPanel changes its position by itself | java|swing | 0 | 41 | 1 | 72,961,154 | 72,961,154 | 1 | true | 2022-07-12T20:20:14.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JPanel changes its position by itself<p>I create a HashMap<String, Panel> via a method and return it to use, but one Panel(JPanel) element changes its ... |
72,958,015 | Firestore: how to specify the firestore key to be used for merge?<p>I have a function written in nodejs and another in python. They both do the same thing in different scripts.</p>
<p>I currently have a function that creates a firestore collection called <code>profile</code>, then insert a document, which has as a name... | <p>If you don't have any document reference to update to and need to query the field <code>phone_number</code> then you need to use the <code>where()</code> method with the <code>array_contains</code> operator. Use the <code>array_contains</code> operator to filter based on array values. If a document is found you can ... | Firestore: how to specify the firestore key to be used for merge? | python|node.js|google-cloud-firestore | 0 | 41 | 1 | 72,961,517 | 72,961,517 | 1 | true | 2022-07-12T20:27:07.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firestore: how to specify the firestore key to be used for merge?<p>I have a function written in nodejs and another in python. They both do the same thing in... |
72,962,161 | When i used OnTriggerEnter2D with Input.GetKey the input won't work<p>When i press the key the the scene won't load, when i remove the input statemen, it works.
can anyone help me ?</p>
<pre><code>void OnTriggerEnter2D(Collider2D other)
{
if(Input.GetKey(KeyCode.X)){
Loader.Load(Loader.Scene.Shop);
}
}
... | <p>This is because <code>OnTriggerEnter2D</code> method is called only once when the obstacle enters the collider's area. As soon as the obstacle enters, the code inside this method is read, and it instantly checks for the input, that too only once. That's the reason the code inside the <code>if</code> statement isn't ... | When i used OnTriggerEnter2D with Input.GetKey the input won't work | c#|unity3d|game-development | 0 | 41 | 1 | 72,962,259 | 72,962,259 | 1 | true | 2022-07-13T07:04:53.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When i used OnTriggerEnter2D with Input.GetKey the input won't work<p>When i press the key the the scene won't load, when i remove the input statemen, it wor... |
72,964,453 | How to convert a column of char datatype into time format in R?<p>I have a dataset which contains some columns in hh:mm:ss format in excel. When I imported this excel sheet in R the columns which where in hh:mm:ss format changed to character.</p>
<p>for example:<br />
This is the column in excel</p>
<p><a href="https:/... | <pre class="lang-r prettyprint-override"><code>library(tidyverse)
library(lubridateExtras)
# Sample data
df <- tribble(
~totalHandling,
"00:09:24",
"00:17:28",
"01:40:20"
)
# Code
df2 <- df |> mutate(totalHandling = hms(totalHandling))
df2
#> # A tibble: 3 × 1
#> ... | How to convert a column of char datatype into time format in R? | r | 0 | 41 | 1 | 72,964,815 | 72,964,815 | 1 | true | 2022-07-13T10:06:03.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert a column of char datatype into time format in R?<p>I have a dataset which contains some columns in hh:mm:ss format in excel. When I imported t... |
72,967,315 | Replace HTML tags through regular expression using dart language<p>How should we replace <br /> html tags with line feed '\n' using RegExp in dart?</p>
<p><strong>Input:</strong></p>
<pre><code>one<br />two<br />three
</code></pre>
<p><strong>Output:</strong></p>
<pre><code>one
two
three
</code></pre> | <pre class="lang-dart prettyprint-override"><code>final _brRe = RegExp(r"<br\s*/>");
String replaceBreaks(String input) =>
input.replaceAll(_brRe, "\n");
</code></pre>
<p>You create a RegExp using the <code>RegExp</code> constructor, remembering to always use a <em>raw</em> string liter... | Replace HTML tags through regular expression using dart language | regex|dart | 0 | 41 | 1 | 72,968,438 | 72,968,438 | 1 | true | 2022-07-13T13:39:16.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace HTML tags through regular expression using dart language<p>How should we replace <br /> html tags with line feed '\n' using RegExp in dart?</p>... |
72,967,996 | How to prevent resample -> aggregate from dropping columns?<p>Code</p>
<pre><code>df = pd.DataFrame(
data = {'A': [1, 1, 2], 'B': [None, None, None]},
index = pd.DatetimeIndex([
'1990-01-01 00:00:00',
'1990-01-01 12:00:00',
'1990-01-02 12:00:00'
])
)
print(df.resample('1d').aggregate... | <p><code>resample</code> will drop the non numeric columns when using a numeric aggregation. You can <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.reindex.html" rel="nofollow noreferrer"><code>reindex</code></a> after aggregation:</p>
<pre><code>df.resample('1d').aggregate('mean').reindex(df.co... | How to prevent resample -> aggregate from dropping columns? | python|pandas|pandas-resample | 0 | 41 | 1 | 72,968,583 | 72,968,583 | 1 | true | 2022-07-13T14:28:01.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to prevent resample -> aggregate from dropping columns?<p>Code</p>
<pre><code>df = pd.DataFrame(
data = {'A': [1, 1, 2], 'B': [None, None, None]},
... |
72,967,319 | Have Mockito Return Varying Number of Different Values for Invocations<p>I want a Mockito mock to return several values one after another when the same function is called on the mock, and have those values come from a list, instead of by writing them out as <code>mock.thenReturn(1).thenReturn(2)</code></p>
<p>One way t... | <p>Mockito offers the <a href="https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/AdditionalAnswers.html" rel="nofollow noreferrer">AdditionalAnswers</a>
class for doing something along those lines, to quote the javadocs:</p>
<blockquote>
<p>Additional answers provides factory methods for answers</p>
</... | Have Mockito Return Varying Number of Different Values for Invocations | java|unit-testing|mockito|stubbing | 0 | 41 | 1 | 72,969,525 | 72,969,525 | 1 | true | 2022-07-13T13:39:25.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Have Mockito Return Varying Number of Different Values for Invocations<p>I want a Mockito mock to return several values one after another when the same funct... |
72,975,922 | Parent object changes even if the copy of it is created while splice<p>I have a parent object <code>categories</code>, and a function that flattens and removes duplicate numbers inside the array.
But even though I make a copy the <code>categories</code> object (<code>let newObj = {...categories}</code>) and perform the... | <p>First of all, you get the reference of the <code>List</code> property.</p>
<pre><code>let myList = obj[key].List;
</code></pre>
<p>And then in the bottom, you splice it. ( splice will effect the origin array as it has the same referance )</p>
<pre><code>const spliced = [...myList.splice(index, 1, resList)];
</code><... | Parent object changes even if the copy of it is created while splice | javascript | -1 | 41 | 2 | 72,975,976 | 72,975,976 | 1 | true | 2022-07-14T06:07:11.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parent object changes even if the copy of it is created while splice<p>I have a parent object <code>categories</code>, and a function that flattens and remov... |
72,958,179 | How can I stop pygame looping though a dictionary uncontrollably?<p>I'm trying to make my first GUI quiz game. But for some reason when I run the code to loop through the questions, it does it too fast and doesn't wait for the user to choose one on the choices before moving onto the next question.</p>
<p>The number of ... | <p>The problem is here</p>
<pre class="lang-py prettyprint-override"><code>if pressed:
continue
</code></pre>
<p><a href="https://www.w3schools.com/python/ref_keyword_continue.asp" rel="nofollow noreferrer"><code>continue</code> does not do what you think it does</a>, it only skips the rest of the current iteration... | How can I stop pygame looping though a dictionary uncontrollably? | python|python-3.x|pygame | 0 | 41 | 1 | 72,979,629 | 72,979,629 | 1 | true | 2022-07-12T20:45:11.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I stop pygame looping though a dictionary uncontrollably?<p>I'm trying to make my first GUI quiz game. But for some reason when I run the code to loo... |
72,979,702 | How to make a reference refer to another node of an std::unordered_map<p>I have an <code>std::unordered_map<int, int></code> which stores the frequency count of each element present in a given array. I need to find the max frequency element and print the key and frequency count.</p>
<pre><code>#include <iostre... | <p><code>std::remove_reference</code> is not a callable. Its a type trait with a <code>type</code> member alias. Same goes for <code>std::add_lvalue_reference</code>. As you know all types, adding those type traits adds unnecessary complexity for no obvious gain. The code is barely readable, and frankly I don't underst... | How to make a reference refer to another node of an std::unordered_map | c++ | 0 | 41 | 1 | 72,979,793 | 72,979,793 | 1 | true | 2022-07-14T11:21:02.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a reference refer to another node of an std::unordered_map<p>I have an <code>std::unordered_map<int, int></code> which stores the frequency... |
72,977,537 | Insufficent space for shared memory file when i try the run command on eclipse<p>when i run the command "mvn clean package spring-boot:run" i get this error:</p>
<pre><code>OpenJdk 64-Bit Server VM warning: Insufficent space for shared memory file: 3362281 Try using the -Djava.io.tmpdir= option to select an a... | <p>Your disk is full; nothing (directly) to do with eclipse or Java.</p>
<p>I note that your main disk is 19G, which is small by today's standards; I assume this is not your laptop or desktop, but rather a machine in the cloud or a virtual machine (VM).</p>
<p>Depending on your situation, you have two general options:<... | Insufficent space for shared memory file when i try the run command on eclipse | java|eclipse | 0 | 41 | 2 | 72,982,323 | 72,982,323 | 1 | true | 2022-07-14T08:30:55.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Insufficent space for shared memory file when i try the run command on eclipse<p>when i run the command "mvn clean package spring-boot:run" i get t... |
72,897,219 | Is there a wasy to emulate super with mixins in typescript?<p>I am using multiple inheritance via Mixins (using the alternative pattern). Is there a way to get something similar to 'super' with this pattern? Consider the example here</p>
<pre><code>abstract class Activatable{
private activated: boolean = false;
... | <p>As you know, JavaScript classes don't support multiple inheritance, so you need to do something to simulate it if you want to get that effect. <a href="https://www.typescriptlang.org/docs/handbook/mixins.html" rel="nofollow noreferrer">Mixins</a> are one way to do this, but they don't really support having conflict... | Is there a wasy to emulate super with mixins in typescript? | typescript|multiple-inheritance|mixins | 1 | 41 | 1 | 72,985,926 | 72,985,926 | 1 | true | 2022-07-07T11:43:59.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a wasy to emulate super with mixins in typescript?<p>I am using multiple inheritance via Mixins (using the alternative pattern). Is there a way to g... |
72,980,765 | PhpExcel many columns causes the file to be broken<p>I am generating an excel file using phpexcel, the columns are 186 so I have created an array of the header columns and dynamically adding them</p>
<pre><code> $spreadsheet = new Spreadsheet();
$spreadsheet->setActiveSheetIndex(0);
... | <p>This isn't a PHPExcel or a PhpSpreadsheet issue: what's happening here is that you're misunderstanding how the PHP increment operator works with a string value that contains mixed alpha and numeric characters.</p>
<p>Take a look at the output from your increment when there's no reference to PHPExcel or PhpSpreadshee... | PhpExcel many columns causes the file to be broken | php|codeigniter|phpexcel | 0 | 41 | 2 | 72,993,736 | 72,993,736 | 1 | true | 2022-07-14T12:46:50.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PhpExcel many columns causes the file to be broken<p>I am generating an excel file using phpexcel, the columns are 186 so I have created an array of the head... |
72,990,408 | What difference between proton-j and proton-j2?<p>Recently I'm learning AMQP protocol, I found Proton-J and Proton-J2. From their README in the github repo, it seems like they are both a Java implementation of AMQP. I took a quick look of the code, and still have no idea about the difference between them. And why to cr... | <p>The Qpid protonj2 project is a new generation of AMQP protocol engine that is based on a reactive model vs the temporal squashing model that the proton-j engine provides. The reactive model implementation solves a lot of issues that are experienced by folks implementing clients and servers since you gain full insigh... | What difference between proton-j and proton-j2? | java|amqp|qpid|qpid-proton | 1 | 41 | 1 | 72,995,303 | 72,995,303 | 1 | true | 2022-07-15T07:23:51.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What difference between proton-j and proton-j2?<p>Recently I'm learning AMQP protocol, I found Proton-J and Proton-J2. From their README in the github repo, ... |
72,997,606 | Selenium scrapping probleme on python nothing append<p>I try to scrap this page and all the result of sells.</p>
<p>But nothing append, the code return me nothing.
I would like to have the seller+buyer+price and date on dataframe or something like this</p>
<p>Best</p>
<p><a href="https://www.fxhash.xyz/marketplace/gene... | <p>You can scrape all data from <strong>API</strong> <strong>GraphQL</strong>.<br />
Here you have an example:</p>
<pre class="lang-py prettyprint-override"><code>import requests
def do_request(skip):
json_data = {
'operationName': 'GenTokActiveListings',
'variables': {
'filters': {},
... | Selenium scrapping probleme on python nothing append | python|selenium|web-scraping | 1 | 41 | 1 | 72,999,527 | 72,999,527 | 1 | true | 2022-07-15T17:17:30.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selenium scrapping probleme on python nothing append<p>I try to scrap this page and all the result of sells.</p>
<p>But nothing append, the code return me no... |
73,001,185 | Is using an if statement to redirect user away if page does not exists good practice in React?<p>Basically, I am trying to route a user based on whether or not the page exists. So I tried to do an if statement to check the prop <code>profileExists</code>. If it is true, it would stay on the same page. Otherwise, it wou... | <p>It is ok, but not quite in the way you are using it. You should either issue the redirect as an imperative navigation in a <code>useEffect</code> hook</p>
<pre><code>useEffect(() => {
if (!profileExists) {
history.replace('/homepage');
}
}, [profileExists]);
...
return (
<div className={classes.roo... | Is using an if statement to redirect user away if page does not exists good practice in React? | javascript|reactjs|dom|react-router|react-router-dom | 1 | 41 | 1 | 73,001,198 | 73,001,198 | 1 | true | 2022-07-16T02:48:19.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is using an if statement to redirect user away if page does not exists good practice in React?<p>Basically, I am trying to route a user based on whether or n... |
73,001,147 | array is cleared when its function is called with another function in an onclick attribute<p>I have two parent divs each of them has 5 child divs, onClick on one of the child divs a function that changes the class name is called and onDoubleClick on the child div a function is called to pop the last element from an arr... | <p>React Functional component will execute the component(function) itself every time it re-render.</p>
<p>In your case, your array1 and array 2 are not a state, every time component re-render, your array will be [ ] as you declare it.</p>
<pre><code>const array1 = [];
const array2 = [];
</code></pre>
<p>wrap it into st... | array is cleared when its function is called with another function in an onclick attribute | javascript|reactjs|arrays|array-push | 0 | 41 | 2 | 73,001,389 | 73,001,389 | 1 | true | 2022-07-16T02:35:33.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
array is cleared when its function is called with another function in an onclick attribute<p>I have two parent divs each of them has 5 child divs, onClick on... |
73,002,095 | PhpStorm How to open the folder containing files on remote host<p>I'm so tired of opening each folder to get where I need to go</p>
<p>Go to Folder Local: Ctrl + Shift + N -> Open File > Select Opened File</p>
<p><a href="https://i.stack.imgur.com/CpIuN.png" rel="nofollow noreferrer"><img src="https://i.stack.img... | <blockquote>
<p>Go to Folder Remote Host: ???? Is there a way to find the folder containing the file in the fastest way on the remote host?</p>
</blockquote>
<p>If you are asking: "I have some folder name and want to type/paste it somewhere and the IDE should select that folder in the Remote Host panel"... th... | PhpStorm How to open the folder containing files on remote host | phpstorm | 0 | 41 | 1 | 73,003,077 | 73,003,077 | 1 | true | 2022-07-16T06:43:03.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PhpStorm How to open the folder containing files on remote host<p>I'm so tired of opening each folder to get where I need to go</p>
<p>Go to Folder Local: Ct... |
73,004,205 | How to count time on hover with pure javascript?<p>I want when i hover on element to count 4 seconds for example and then do the action. But only if user really hover on that element 4 seconds, i dont want to use setTimeout function.</p>
<p>I found this example:</p>
<p><a href="https://stackoverflow.com/questions/41632... | <p>As an alternative to the previous answer with <code>setInterval</code></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>var handle = null
function enter() {
handle = setTi... | How to count time on hover with pure javascript? | javascript | -5 | 41 | 2 | 73,004,341 | 73,004,341 | 1 | true | 2022-07-16T12:27:15.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count time on hover with pure javascript?<p>I want when i hover on element to count 4 seconds for example and then do the action. But only if user rea... |
73,005,969 | Ensure that children functions have terminated<p>I have a function that walks recursively over a folder, performing an expensive operation on each file. So far, the function was simple and pretty:</p>
<pre class="lang-js prettyprint-override"><code>import fs from 'fs';
async function openPath(path) {
// Path is a d... | <p>You'll want to collect all the promises from any called functions into an array and use <code>Promise.all</code> on them.</p>
<pre><code>import fs from 'fs/promises';
async function openPath(path) {
const stat = await fs.stat(path);
if (stat.isDirectory()) {
return openDirectory(path);
} else if ... | Ensure that children functions have terminated | javascript|node.js|async-await | 2 | 41 | 1 | 73,007,080 | 73,007,080 | 1 | true | 2022-07-16T16:37:08.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ensure that children functions have terminated<p>I have a function that walks recursively over a folder, performing an expensive operation on each file. So f... |
73,009,259 | BehaviorSubject delete bug<p>I have a simple select all and select one item. The error happens when selectAll is clicked then selectone is clicked next. The original list also gets deleted. What can I do to solve this? Any help is appreciated.</p>
<p>TS code:</p>
<pre><code>
original$: BehaviorSubject<SomeObject... | <p><strong>Problem</strong></p>
<p>Due to behavior subjects storing array values:</p>
<p><code>this.selected$.next(this.original$.value)</code></p>
<p>assigns the same array pointer to both behavior subjects.</p>
<p><strong>Solution:</strong></p>
<p>Instead, do</p>
<p><code>this.selected$.next([...this.original$.value]... | BehaviorSubject delete bug | angular|behaviorsubject | 0 | 41 | 1 | 73,011,136 | 73,011,136 | 1 | true | 2022-07-17T04:26:49.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BehaviorSubject delete bug<p>I have a simple select all and select one item. The error happens when selectAll is clicked then selectone is clicked next. The ... |
73,014,369 | Calulcating consecutive months in R<p>I would like to apply the following logic in R:</p>
<ol>
<li>I already have grou_by the data by Donor.ID</li>
<li>The first step is to identify the Firs.Date, which is the first donation</li>
<li>What I need is to check on each donor if there has been a donation, meaning another ro... | <p>I used lubridate to make a duration from the first time in every group to the current time, and some basic summarization to check if any values meet the criteria. Let me know if this works.</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
library(tibble)
library(lubridate)
df <- tribble(
~Dono... | Calulcating consecutive months in R | r|dplyr | 0 | 41 | 1 | 73,014,507 | 73,014,507 | 1 | true | 2022-07-17T18:33:05.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calulcating consecutive months in R<p>I would like to apply the following logic in R:</p>
<ol>
<li>I already have grou_by the data by Donor.ID</li>
<li>The f... |
73,014,237 | How can I do an Android retrofit 2 recyclerview interface?<p>Here is my code.</p>
<p>My adapter:</p>
<pre class="lang-java prettyprint-override"><code>public class MyAdapter extends RecyclerView.Adapter<MyAdapter.myviewholder> {
List<ResponseModel> data;
private final IOtobusSaatleriInterface iOtob... | <p>Instead of <strong>this</strong>, write something like <em><strong>HomeFragment.this</strong></em>.</p>
<p>I assume that HomeFragment implements IOtobusSaatleriInterface.</p> | How can I do an Android retrofit 2 recyclerview interface? | java|android | 0 | 41 | 1 | 73,015,094 | 73,015,094 | 1 | true | 2022-07-17T18:12:25.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I do an Android retrofit 2 recyclerview interface?<p>Here is my code.</p>
<p>My adapter:</p>
<pre class="lang-java prettyprint-override"><code>public... |
73,017,578 | Serialization Exception in Apache Spark and Java<p>I had a task for creating a POC for Apache Spark w/Springboot. I created a controller for getting my data through API:</p>
<pre><code>@PostMapping(path = "/memberData")
public Map<String, Profile> processData(@RequestBody Member member) {
logger.inf... | <p>Please add <code>implements Serializable</code> in the classes that you are serializing.
Here, Profile is a sub-object for the Member, so you need to Serialize both classes to make your code executable. I am illustrating this for the member class below:</p>
<pre><code>public Member implements Serializable{
...
}... | Serialization Exception in Apache Spark and Java | java|spring-boot|apache-spark | 0 | 41 | 1 | 73,017,994 | 73,017,994 | 1 | true | 2022-07-18T05:12:59.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Serialization Exception in Apache Spark and Java<p>I had a task for creating a POC for Apache Spark w/Springboot. I created a controller for getting my data ... |
73,017,983 | What is the advantage of workdocs over s3<p>They both pretty much offers the same service and purpose, i don't see any reason why one would use workdocs over s3.</p> | <p><strong>Amazon WorkDocs</strong> is an online document editor and file sharing system. AWS describes it as a "fully managed, secure enterprise storage and sharing service with strong administrative controls and feedback capabilities that improve user productivity."</p>
<p><strong>Amazon Simple Storage Serv... | What is the advantage of workdocs over s3 | amazon-web-services|amazon-s3|amazon-workdocs | -1 | 41 | 1 | 73,018,084 | 73,018,084 | 1 | true | 2022-07-18T06:15:10.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the advantage of workdocs over s3<p>They both pretty much offers the same service and purpose, i don't see any reason why one would use workdocs over... |
73,018,098 | Git `pre-commit hooks` how to refer from parent directory instead of direct folder<p>My <code>.husky</code> placed in the parent directory. in the child I have the <code>nx workspace</code> code. in this case how can I add the reference link to check my script in the parent directory?</p>
<pre><code> parent/
├─ nx-w... | <p>In the <code>pre-commit</code> hook, we can get the absolute path to the .git directory by</p>
<pre><code>git rev-parse --absolute-git-dir
</code></pre>
<p>And then it's easy to get the path to other directories if we know the folder structure.</p> | Git `pre-commit hooks` how to refer from parent directory instead of direct folder | git|githooks | 0 | 41 | 1 | 73,018,401 | 73,018,401 | 1 | true | 2022-07-18T06:28:50.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git `pre-commit hooks` how to refer from parent directory instead of direct folder<p>My <code>.husky</code> placed in the parent directory. in the child I ha... |
73,019,567 | How can I align a widget in a column<p><a href="https://i.stack.imgur.com/KO2mW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KO2mW.png" alt="enter image description here" /></a></p>
<p>How can I align a widget in a column, it's complex to describe, please read the code in the pic,</p>
<p>part of ... | <p>You just have to add mainAxisAlignment property in your Column Widget. Like this:</p>
<pre><code> Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: const [
Text("this line might have lots of lette... | How can I align a widget in a column | flutter|dart|flexbox|flutter-layout | 0 | 41 | 1 | 73,019,862 | 73,019,862 | 1 | true | 2022-07-18T08:45:34.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I align a widget in a column<p><a href="https://i.stack.imgur.com/KO2mW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KO2mW.png"... |
73,019,284 | Converting a string into Unsigned int 8 array<p>I am new to bash and I am trying to convert a <a href="https://gist.github.com/DejanEnspyra/80e259e3c9adf5e46632631b49cd1007" rel="nofollow noreferrer">swift obfuscation</a> into a bash script.</p>
<p>Basically, I want to convert a string into an Unsigned-Int 8 array (UTF... | <p>The following shell script converts input in the for of <code>hey</code> into the string <code>[104, 101, 121]</code>.</p>
<pre><code># Print hey
printf "%s" hey |
# convert to hex one per line
xxd -p -c 1 |
# convert to decimal one per line
xargs -I{} printf "%d\n" 0x{} |
# Join lines with comma... | Converting a string into Unsigned int 8 array | bash|shell | 0 | 41 | 2 | 73,019,938 | 73,019,938 | 1 | true | 2022-07-18T08:20:24.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting a string into Unsigned int 8 array<p>I am new to bash and I am trying to convert a <a href="https://gist.github.com/DejanEnspyra/80e259e3c9adf5e46... |
73,020,661 | 'NoneType' object has no attribute 'get' Python Flask login function<p>I'm trying to create a login function using Python Flask to authenticate my APIs but when trying to get the email and password to authenticate these I get the following error:</p>
<pre><code>'NoneType' object has no attribute 'get'
</code></pre>
<p>... | <p>In postman set in the <strong>headers</strong> section the <code>Content-Type</code> of your request to <code>application/json</code>:
<a href="https://i.stack.imgur.com/evdAF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/evdAF.png" alt="enter image description here" /></a>
Also pay attention to... | 'NoneType' object has no attribute 'get' Python Flask login function | python|json|flask|jwt | 0 | 41 | 1 | 73,021,004 | 73,021,004 | 1 | true | 2022-07-18T10:14:21.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
'NoneType' object has no attribute 'get' Python Flask login function<p>I'm trying to create a login function using Python Flask to authenticate my APIs but w... |
73,020,262 | Access Google Sheet with service account in Java<p>I am currently working on an app that connects with google sheets through OAuth client Id, I was wondering if there's a way to do same thing using service account ?</p> | <p>If you are a Google Workspace administrator then yes, you will be able to use <a href="https://support.google.com/a/answer/162106" rel="nofollow noreferrer">domain wide delegation</a> in order to impersonate an user of your domain and allow the service account to make changes on it's behalf. Be aware that the servic... | Access Google Sheet with service account in Java | java|google-sheets-api | 2 | 41 | 1 | 73,025,485 | 73,025,485 | 1 | true | 2022-07-18T09:44:22.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access Google Sheet with service account in Java<p>I am currently working on an app that connects with google sheets through OAuth client Id, I was wondering... |
73,022,891 | How Do I Generate RowId For Intermediate Group Rows?<p>I am working on implementing grouping w/ the Server Side Row Model. I need to generate an appropriate ID for the intermediate group rows. For example, if I group by Status then I would have intermediate rows representing each Status (NEW, IN PROGRESS, COMPLETE, etc... | <p>The columnApi exposes the 'getRowGroupColumns' function from which the field property can be deduced:</p>
<pre><code>getRowId: ({ columnApi, data, level, parentKeys = [] }) => {
const groupColumns = columnApi.getRowGroupColumns();
if (groupColumns.length > level) {
const field = groupColumns[level].get... | How Do I Generate RowId For Intermediate Group Rows? | ag-grid|ag-grid-react | 1 | 41 | 1 | 73,025,703 | 73,025,703 | 1 | true | 2022-07-18T13:13:19.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How Do I Generate RowId For Intermediate Group Rows?<p>I am working on implementing grouping w/ the Server Side Row Model. I need to generate an appropriate ... |
72,998,615 | Jquery: <select> with images, having trouble to handle response of two <select> separate<p>I am using online jquery to handle images in "select" element of HTML. But now I am facing trouble separating events on each "select" element.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-... | <p>This should do it,</p>
<p>You might want to change the image on the button and use ccs to add it as it block the click of the button because its effectively on top o it as is the text,</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre... | Jquery: <select> with images, having trouble to handle response of two <select> separate | html|jquery|css | 0 | 41 | 3 | 73,029,656 | 73,029,656 | 1 | true | 2022-07-15T19:06:06.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery: <select> with images, having trouble to handle response of two <select> separate<p>I am using online jquery to handle images in "select" el... |
72,923,514 | Flutter: LateError (LateInitializationError: Field 'note' has not been initialized.)<p>I am working on a notes app where the added notes are stored in a SQLFlite DB. Opening the Notes detail page of the stored notes I get the following error:</p>
<p><a href="https://i.stack.imgur.com/p79te.png" rel="nofollow noreferrer... | <p>Your Note object is loaded asynchronously. The body will execute before that object gets loaded from the database. So you have to check that object availability there.</p>
<p>Declare that object like:</p>
<pre><code>Note? note;
</code></pre>
<p>And change the build function as follows:</p>
<pre><code>Widget build(Bu... | Flutter: LateError (LateInitializationError: Field 'note' has not been initialized.) | database|flutter|dart-null-safety|sqflite | 1 | 41 | 1 | 72,923,661 | 72,923,661 | 1 | true | 2022-07-09T17:45:46.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter: LateError (LateInitializationError: Field 'note' has not been initialized.)<p>I am working on a notes app where the added notes are stored in a SQLF... |
72,850,275 | Taking 30yr average of a gridded (coordinate ordered), annual timeries dataset<p>I have a .csv of a gridded dataset. Each grid (represented by lat/lon coordinates) has a annual timeseries from 1950-2100 and accompanyning values.</p>
<p>It's formated like this:</p>
<div class="s-table-container">
<table class="s-table">... | <p>Here is an option, where we can use <code>case_when</code> to create the groups, then <code>summarise</code>:</p>
<pre><code>library(tidyverse)
df %>%
mutate(time = format(as.Date(time), "%Y")) %>%
group_by(lon, lat,
grp = case_when(time >= 1950 & time <= 1969 ~ "1950-196... | Taking 30yr average of a gridded (coordinate ordered), annual timeries dataset | r|time-series|coordinates|spatial | 3 | 41 | 2 | 72,850,391 | 72,850,391 | 1 | true | 2022-07-03T22:19:56.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Taking 30yr average of a gridded (coordinate ordered), annual timeries dataset<p>I have a .csv of a gridded dataset. Each grid (represented by lat/lon coordi... |
72,792,948 | Issues setting a maximum amount of tokens in ERC20 contract<p>I've been trying to create a very simple ERC20 token with truffle in the rinkeby network. I placed the following code into my .sol file but the max supply doesnt seem to match.</p>
<pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import &q... | <p>The EVM does not support decimal numbers (to prevent rounding errors related to the network nodes running on different architectures), so all numbers are integers.</p>
<p>The <a href="https://eips.ethereum.org/EIPS/eip-20" rel="nofollow noreferrer">ERC-20</a> token standard defines the <code>decimals()</code> functi... | Issues setting a maximum amount of tokens in ERC20 contract | token|ethereum|solidity|erc20 | 1 | 41 | 1 | 72,798,552 | 72,798,552 | 1 | true | 2022-06-28T20:43:53.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issues setting a maximum amount of tokens in ERC20 contract<p>I've been trying to create a very simple ERC20 token with truffle in the rinkeby network. I pla... |
73,029,007 | After doing GridSearch why am I getting less accurate results?<p>So I have applied random search first then grid search for my MLP Regressor. The thing is my R^2 for the optimum parameters suggested by randomsearch (hidden layers 18,18,18 (R^2= 0.90)) is better than the same suggested by gridsearch (hidden layers 17,17... | <p><code>GridSearchCV</code> and <code>RandomizedSearchCV</code> both take <code>random_state</code> parameters. This is different to the random state in the model itself (i.e. <code>MLPRegressor</code>) and controls the way in which the data is separated into training and testing datasets.</p>
<p>Try setting the same ... | After doing GridSearch why am I getting less accurate results? | python|scikit-learn | 1 | 41 | 1 | 73,030,253 | 73,030,253 | 1 | true | 2022-07-18T21:52:41.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
After doing GridSearch why am I getting less accurate results?<p>So I have applied random search first then grid search for my MLP Regressor. The thing is my... |
72,871,417 | Ansible: merge dictionaries appending values<p>How can I get a dictionary with values from input separated with a comma? There can be a different number and order of input parameters. What I've tried just gives the error below</p>
<pre><code>- set_fact:
input:
- port: 1234
protocol: TCP
messag... | <p>You do have three issues here:</p>
<ol>
<li>if you intend to use <code>map</code>, then you need to do it on a list, so, you should have expressions like
<pre class="lang-yaml prettyprint-override"><code>var: input | map(attribute='file')
</code></pre>
And not act on the <code>item</code> of a <code>loop</code>.</li... | Ansible: merge dictionaries appending values | data-structures|ansible | 1 | 41 | 1 | 72,872,119 | 72,872,119 | 1 | true | 2022-07-05T14:49:09.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ansible: merge dictionaries appending values<p>How can I get a dictionary with values from input separated with a comma? There can be a different number and ... |
72,940,367 | SQL Replacing HREF of HTML Structure if href contains substring<p>In my database, there is this column called blog_content that has html structures of blog posts. In those html structures, there are 2 types of links with the following structure:</p>
<ul>
<li><code><a class="service-content-link" href="... | <p>You can use <code>regexp_replace</code>:</p>
<pre><code>select regexp_replace(blog_content, 'href="[^#"]+#h_(.+)"', 'href="#h_$1"') from blog_posts
</code></pre>
<p><a href="https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=9a850150fd7ebb2a19058ae63a984af6" rel="nofollow noreferrer">See fiddle... | SQL Replacing HREF of HTML Structure if href contains substring | mysql|sql | 1 | 41 | 1 | 72,940,802 | 72,940,802 | 1 | true | 2022-07-11T14:44:37.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Replacing HREF of HTML Structure if href contains substring<p>In my database, there is this column called blog_content that has html structures of blog p... |
72,823,647 | How to specify an interface with conditional properties in typescript?<p>I'm creating a helper function to create new HTML elements</p>
<pre><code>interface NewElement {
type: string;
className: string;
innerText: string;
href: string;
}
const createElement = ({ type, className, innerText, href }: NewElement) =... | <p>In Typescript, you can specify a field as optional as below:</p>
<pre><code>interface NewElement {
type: string;
className: string;
innerText?: string;
href?: string;
}
</code></pre>
<p>It's also a good practice to give those optional fields a default value in your function. For example:</p>
<pre><code>const... | How to specify an interface with conditional properties in typescript? | typescript | 0 | 41 | 1 | 72,823,684 | 72,823,684 | 1 | true | 2022-07-01T01:51:33.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to specify an interface with conditional properties in typescript?<p>I'm creating a helper function to create new HTML elements</p>
<pre><code>interface ... |
72,961,230 | center text in cell and adjust cell width<p>Basically I've got two problems which I'm currently not able to solve properly on my own and therefore I am looking for help!</p>
<ol>
<li><p>I am looking for a way to center the text in the cells of my table. Currently I am using grid() to build my table, but haven't found a... | <p>To center the text in a <code>Text</code> widget, you need to configure the <code>justify</code> option of a <code>tag</code> and insert the text using the <code>tag</code>:</p>
<pre><code>text.tag_config('center', justify='center') # config a tag
text.insert(INSERT, ..., 'center') # specify the tag
</code></pre>
<p... | center text in cell and adjust cell width | python|tkinter | 0 | 41 | 1 | 72,961,559 | 72,961,559 | 1 | true | 2022-07-13T05:13:42.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
center text in cell and adjust cell width<p>Basically I've got two problems which I'm currently not able to solve properly on my own and therefore I am looki... |
72,973,977 | UIView.animatekeyframes skips all keyframes except first<p>My goal is to have my UIview notification slide up from the bottom of the controller page, and then slide down again after a few seconds.</p>
<p>Inside the <code>animateUp()</code> func, I use <code>UIView.animateKeyFrames</code> function to add 2 keyframes. On... | <p>You have some very confusing constraints, and we're missing your <code>config()</code> func and <code>ToastViewModel</code> and an example view controller showing how you set things up...</p>
<p>But, after taking some guesses to fill in the missing pieces, your animation code works for me - although it animates the ... | UIView.animatekeyframes skips all keyframes except first | ios|swift|animation|uiview | 0 | 41 | 1 | 72,981,792 | 72,981,792 | 1 | true | 2022-07-14T00:22:24.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UIView.animatekeyframes skips all keyframes except first<p>My goal is to have my UIview notification slide up from the bottom of the controller page, and the... |
72,925,651 | Flutter how to accesss a single SharedPreference instance through the whole app<p>I'm using SharedPreferences to store settings data, problem is that I need to access this data in multiple different locations & right now I need a new futurebuilder for every different screen I need to access the data from..</p>
<p>I... | <p>You can create a file called <code>globals.dart</code> and create a <code>SharedPreferences</code> variable without setting it:</p>
<p><em>globals.dart</em></p>
<pre class="lang-dart prettyprint-override"><code>SharedPreferences? sharedPreferences;
</code></pre>
<p>Then, in your <code>main.dart</code> instantiate yo... | Flutter how to accesss a single SharedPreference instance through the whole app | flutter | 1 | 41 | 1 | 72,925,718 | 72,925,718 | 1 | true | 2022-07-10T01:40:52.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter how to accesss a single SharedPreference instance through the whole app<p>I'm using SharedPreferences to store settings data, problem is that I need ... |
73,019,930 | Reduce of empty array with no initial value, how to sort function with two parameters from highest to lowest value<p>I am running npm test for my code and I am failing the third test out of six test.
I've tried to sort it with the following :</p>
<pre><code>sumAll.sort(function(min,max)) {
return max - min;
}
... | <p>The reducer to sum array value is :</p>
<pre><code>arr.reduce((ac, cv) => ac + cv, 0);
</code></pre>
<p>Add a initial value should prevent error : <code>empty array with no initial value</code></p>
<p>This code works for me :</p>
<pre><code>const sumAll = function( min, max ) {
let fullArr = [];
let sum =... | Reduce of empty array with no initial value, how to sort function with two parameters from highest to lowest value | javascript|npm|jestjs | 0 | 41 | 1 | 73,019,972 | 73,019,972 | 1 | true | 2022-07-18T09:17:18.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reduce of empty array with no initial value, how to sort function with two parameters from highest to lowest value<p>I am running npm test for my code and I ... |
73,019,224 | how to correctly return data from async function node js, jest error<p>I have a function something like that:</p>
<pre><code>async function example(){
let data = await another_function();
var ws = fs.createWriteStream('path');
let jsonData = [{'id':'1234', 'name': 'Alex'}];
fastcsv
.write(jsonData, { header... | <p>Can you try refactoring your example function as follows.</p>
<p>You can wait for that particular promise in <code>function example()</code> to be resolved. from the main function. In this case we are not returning a value from the function, but a promise that can be awaited and then the value can be used. You can w... | how to correctly return data from async function node js, jest error | node.js|asynchronous|jestjs|async.js|fast-csv | 0 | 41 | 1 | 73,019,582 | 73,019,582 | 1 | true | 2022-07-18T08:15:42.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to correctly return data from async function node js, jest error<p>I have a function something like that:</p>
<pre><code>async function example(){
let da... |
73,014,202 | case_when ignores some arguments when using group by<p>I have a longitudinal dataset with individuals of different socioeconomic statuses (SES) divided into 4 classes, high, mid, low mid, and low. For some of the analyses, I only want to show the sample size for low mid group if <em>both</em> the mid and low class grou... | <p><code>case_when/ifelse/if_else</code> all requires the arguments to be of same length. Here, one of the logical expression is of different length. A correct approach would be to wrap with <code>any</code> of the subset of 'total'</p>
<pre><code>test_data %>%
group_by(month) %>%
mutate(adjusted_total = cas... | case_when ignores some arguments when using group by | r|dplyr|group-by | 2 | 41 | 1 | 73,014,207 | 73,014,207 | 1 | true | 2022-07-17T18:06:29.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
case_when ignores some arguments when using group by<p>I have a longitudinal dataset with individuals of different socioeconomic statuses (SES) divided into ... |
72,911,164 | From a txt file with entries, create an array and from the array search element and print out<h2>My Issue</h2>
<p>I'm building a simple tool in .NET using VB.NET in VisualStudio 2019 which, from a .txt file formatted like this, with an "n" number of entries (like idk 130 or more):</p>
<pre><code>IDelement1;Te... | <p>Here you go. The secret is to make use of a dictionary.</p>
<pre><code>Private Sub btn_TestTranslations_Click(sender As Object, e As EventArgs) Handles btn_TestTranslations.Click
' Import the translations
ImportTranslations("c:\temp\translations.txt")
' Lookup a translation
MessageBox.Show(... | From a txt file with entries, create an array and from the array search element and print out | .net|vb.net | 0 | 41 | 1 | 72,913,236 | 72,913,236 | 1 | true | 2022-07-08T12:08:06.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
From a txt file with entries, create an array and from the array search element and print out<h2>My Issue</h2>
<p>I'm building a simple tool in .NET using VB... |
72,982,607 | Make a list of Flutter Firebase field<p><a href="https://i.stack.imgur.com/XKNUj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XKNUj.png" alt="enter image description here" /></a></p>
<p>Hi, I want to make a list inside the Flutter Firebase field. I'm creating an id for followers in the Field. In F... | <p>The problem is that <code>_FollowersScreenState.initState</code> is in the wrong place. It's inside the function <code>getdata</code> that it is trying to call. The <code>initState</code> is never called. That's why there is no list being built.</p>
<p>Also, <code>setState</code> is the one that assigns <code>State<... | Make a list of Flutter Firebase field | flutter|dart | 1 | 41 | 1 | 72,986,995 | 72,986,995 | 1 | true | 2022-07-14T14:57:06.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make a list of Flutter Firebase field<p><a href="https://i.stack.imgur.com/XKNUj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XKNUj.png... |
72,975,366 | Efficiently get array of all previous dates per id per date limited to past 6 months in BigQuery<p>I have a very big table 'DATES_EVENTS' (20 T) that looks like this:</p>
<pre><code>ID DATE
1 '2022-04-01'
1 '2022-03-02'
1 '2022-03-01'
2 '2022-05-01'
3 '2021-12-01'
3 '2021-11-11'
3 '2020-11-11'
3 ... | <p>Consider below approach</p>
<pre><code>select id, date, array(
select day
from t.date_list day
where day <= date
order by day desc
) as date_list
from (
select *, array_agg(date) over win as date_list
from dates_events
window win as (
partition by id
order by extract(year from date) * 12 +... | Efficiently get array of all previous dates per id per date limited to past 6 months in BigQuery | performance|google-bigquery|bigdata | 3 | 41 | 1 | 72,975,518 | 72,975,518 | 1 | true | 2022-07-14T04:53:44.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Efficiently get array of all previous dates per id per date limited to past 6 months in BigQuery<p>I have a very big table 'DATES_EVENTS' (20 T) that looks l... |
72,783,547 | Hive sentence CREATE OR REPLACE VIEW permissions<p>My question is what do this sentences when exists the view.</p>
<p>It performs an ALTER VIEW (that don't change the permissions)</p>
<p>Or it performs a DROP and a CREATE (that makes that other users lost his permissions on the view).</p> | <p><code>create or replace</code> is equivalent to <code>drop and create</code>. (You can refer to this jira - <a href="https://issues.apache.org/jira/browse/HIVE-1078" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/HIVE-1078</a>).
So, permissions may get reset.</p>
<p>Hive permission on table can be c... | Hive sentence CREATE OR REPLACE VIEW permissions | hive|view|permissions | 1 | 41 | 1 | 72,790,159 | 72,790,159 | 1 | true | 2022-06-28T08:58:54.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hive sentence CREATE OR REPLACE VIEW permissions<p>My question is what do this sentences when exists the view.</p>
<p>It performs an ALTER VIEW (that don't c... |
72,994,133 | PowerShell - CSV - Multiple Headers and Values - Foreach - Group by Header<p>I have a csv-File which i import into PowerShell.</p>
<pre><code>[ID];[GroupID];[en];[de]
001;001;on;an
002;001;off;aus
</code></pre>
<p>I tried to sort by the certain header names ([en], [de]) and display all values below.</p>
<p>What i tried... | <p>The key is to loop over all the columns that represent languages, and print all rows for each, but with only that language's value following the <code>[ID]</code> and <code>[GroupID]</code> columns:</p>
<pre class="lang-bash prettyprint-override"><code># Create a sample CSV file.
@'
[ID];[GroupID];[en];[de]
001;001;... | PowerShell - CSV - Multiple Headers and Values - Foreach - Group by Header | powershell|csv | 1 | 41 | 1 | 72,994,457 | 72,994,457 | 1 | true | 2022-07-15T12:39:05.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PowerShell - CSV - Multiple Headers and Values - Foreach - Group by Header<p>I have a csv-File which i import into PowerShell.</p>
<pre><code>[ID];[GroupID];... |
72,973,933 | How to create a 32 bits exclusive conda env<p>How can I create a exclusively 32 bits conda environment? I tried:</p>
<pre><code>set CONDA_FORCE_32BIT=1
conda create -n py310_32 python=3.10.5
</code></pre>
<p>But it didn't work.</p> | <p>Follwing commands will successfully get a 32-bit python. I suppose the main problem is the environment variable. You know windows is this. :(</p>
<pre><code>conda create -n py27_32
conda activate py27_32
conda config --env --set subdir win-32
conda install python=2.7
</code></pre>
<p><a href="https://i.stack.imgur.c... | How to create a 32 bits exclusive conda env | python|conda | 0 | 41 | 1 | 72,974,089 | 72,974,089 | 1 | true | 2022-07-14T00:13:34.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a 32 bits exclusive conda env<p>How can I create a exclusively 32 bits conda environment? I tried:</p>
<pre><code>set CONDA_FORCE_32BIT=1
conda... |
73,005,289 | How to remove screen content from StatusBar in Flutter/Dart?<p>When I have an AppBar on my screen, it looks like this:</p>
<p><a href="https://i.stack.imgur.com/8mZIY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8mZIY.jpg" alt="enter image description here" /></a></p>
<p>But I don't need AppBar so... | <p>Wrap your scaffold body with <code>SafeArea</code> widget</p>
<pre class="lang-dart prettyprint-override"><code> @override
Widget build(BuildContext context) {
return SafeArea(
</code></pre>
<p>For your case, do it on home or scaffold.</p>
<pre class="lang-dart prettyprint-override"><code>home: SafeArea(
</co... | How to remove screen content from StatusBar in Flutter/Dart? | flutter|dart|flutter-layout | 1 | 41 | 1 | 73,005,296 | 73,005,296 | 1 | true | 2022-07-16T15:06:42.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove screen content from StatusBar in Flutter/Dart?<p>When I have an AppBar on my screen, it looks like this:</p>
<p><a href="https://i.stack.imgur.... |
72,978,104 | What is the Type returned by GetValues in each of the overloaded versions<pre><code>Module Module1
Enum Colors
Red
Green
Blue
Yellow
End Enum
Sub main()
Dim values = [Enum].GetValues(GetType(Colors)) ' Statement 1
Console.WriteLine(values.GetType) 'O/P: Colors... | <p>EDIT:</p>
<p>I just realised that the generic overload was only introduced in .NET 5, so any earlier versions can only use the non-generic version. That means .NET Core 3.1 or earlier and any version of .NET Framework. It is always a good idea to read the documentation and confirm exactly what .NET versions a type o... | What is the Type returned by GetValues in each of the overloaded versions | vb.net | 0 | 41 | 1 | 72,978,662 | 72,978,662 | 1 | true | 2022-07-14T09:17:31.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the Type returned by GetValues in each of the overloaded versions<pre><code>Module Module1
Enum Colors
Red
Green
Blue
... |
72,919,425 | How to find all non-dictionary words in a file in bash/zsh?<p>I'm trying to find all words in a file that don't exist in the dictionary. If I look for a single word the following works</p>
<pre><code>b=ther; look $b | grep -i "^$b$" | ifne -n echo $b => ther
b=there; look $b | grep -i "^$b$" | if... | <p><strong>Regarding ifne</strong></p>
<p>If <code>stdin</code> is non-empty, <code>ifne -n</code> reprints <code>stdin</code> to <code>stdout</code>. From the manpage:</p>
<pre><code> -n Reverse operation. Run the command if the standard input is empty
Note that if the standard input is not empty, it is ... | How to find all non-dictionary words in a file in bash/zsh? | bash|zsh | -1 | 41 | 1 | 72,919,540 | 72,919,540 | 1 | true | 2022-07-09T06:29:00.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find all non-dictionary words in a file in bash/zsh?<p>I'm trying to find all words in a file that don't exist in the dictionary. If I look for a sing... |
72,922,430 | bash script not functioning when run by cron<p>the below bash script is set to kill firefox processes (used by python script) and kill any running same script before running the python script in a loop untill it give error code 0.</p>
<pre><code>#!/bin/bash
for pid in $(pidof -x start-manheim.sh);
do
if [ $pid != ... | <p>The CRON environment may be different; e.g., the <code>PATH</code> may be different and a <code>python</code> executable may not be in the CRON <code>PATH</code>. Consider adding an <code>export PATH=/bin:/sbin:/usr/bin:/usr/sbin</code> or similar to your script prior to executing a first external command, a reason... | bash script not functioning when run by cron | python|bash|cron | 0 | 41 | 1 | 72,923,467 | 72,923,467 | 1 | true | 2022-07-09T15:01:35.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bash script not functioning when run by cron<p>the below bash script is set to kill firefox processes (used by python script) and kill any running same scrip... |
73,014,104 | Python file not debugging in vscode docker container<p>Opened VSCode. Started container by docker extension. Attached visual studio code with container. Start debugging but nothing shows on terminal. Added break points, debugging not started. Debugging palette appears for a while.<a href="https://i.stack.imgur.com/Ueoc... | <p>Problem is caused by python extension(microsoft) in container. Downgraded python extension from v2022.10.1 to v2022.8.0 in container extensions. Problem solved.</p> | Python file not debugging in vscode docker container | docker|debugging|visual-studio-code | 1 | 41 | 1 | 73,014,875 | 73,014,875 | 1 | true | 2022-07-17T17:53:20.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python file not debugging in vscode docker container<p>Opened VSCode. Started container by docker extension. Attached visual studio code with container. Star... |
72,849,915 | Delete the duplicate values in the SUM with MySQL or SQL<p>Hi I am doing a sum of a table, but the problem is that the table has duplicate rows, so I wonder how can I do the sum without duplicated rows:</p>
<p>The main table is this one:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>folio... | <p>Given your provided input tables, you can use the <code>DISTINCT</code> clause inside the <code>SUM</code> aggregation function to solve your problem:</p>
<pre><code>SELECT cashier_id, SUM(DISTINCT amount)
FROM tab
GROUP BY cashier_id,
folio,
date
</code></pre>
<p>Check the demo <a href="https://ww... | Delete the duplicate values in the SUM with MySQL or SQL | mysql|sql | 1 | 41 | 1 | 72,850,057 | 72,850,057 | 1 | true | 2022-07-03T21:07:53.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete the duplicate values in the SUM with MySQL or SQL<p>Hi I am doing a sum of a table, but the problem is that the table has duplicate rows, so I wonder ... |
72,787,661 | Modify a table in .txt file using python<p>I have a .txt file containing a set of data organized as follow:</p>
<pre><code>(id1) (name1) (x coordinate1) (y coordinate1) (value1)
(id2) (name2) (x coordinate2) (y coordinate2) (value2)
(id3) (name3) (x coordinate3) (y coordinate3) (value3)
.....
</code></pre>
<p>Now I... | <p>You are adding a line break, try removing this line:</p>
<p><code>table[6*i+5] = "\n"</code></p>
<p>Since the file you are pulling in has line breaks they get automatically included with the last item in your list.</p>
<p>Edit:
Your source file might be a little wonky, you can also change that last line to... | Modify a table in .txt file using python | python | 0 | 41 | 4 | 72,787,718 | 72,787,718 | 1 | true | 2022-06-28T13:49:57.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Modify a table in .txt file using python<p>I have a .txt file containing a set of data organized as follow:</p>
<pre><code>(id1) (name1) (x coordinate1) (y c... |
73,016,470 | Why SQL where greater than is doesn't work?<p>I tried to select data where total greater than 3, but is not work, how to fix it?</p>
<p><strong>SQL</strong></p>
<pre><code>SELECT p.image, p.id, p.name, sum(od.qty) AS total, sum(od.price * od.qty) AS nilai
FROM products p, order_details od, orders o
WHERE p.id = od.pr... | <p>Use having group by :</p>
<pre><code> SELECT p.image, p.id, p.name, sum(od.qty) AS total, sum(od.price * od.qty) AS nilai
FROM products p, order_details od, orders o
WHERE p.id = od.product_id
AND o.id = od.order_id
AND o.status = "Finished"
GROUP BY p.id
HAVING sum(od.qty) ... | Why SQL where greater than is doesn't work? | mysql|sql | 0 | 41 | 1 | 73,016,511 | 73,016,511 | 1 | true | 2022-07-18T01:20:06.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why SQL where greater than is doesn't work?<p>I tried to select data where total greater than 3, but is not work, how to fix it?</p>
<p><strong>SQL</strong><... |
72,845,772 | Why does ExpressJS not match all paths on root app.get('/'<p>The following express routing matches <code>GET /</code> but not <code>GET /anything/else</code>.</p>
<pre class="lang-js prettyprint-override"><code>app.get('/', (req, res, next) => {
res.send('I only answer to /');
});
</code></pre>
<p>Is Express Routi... | <p><code>app.get</code> must match the full path and stores it in <code>req.path</code>, whereas <code>app.use</code> matches a prefix and sets <code>req.path</code> to the path <em>after</em> the prefix. You could write</p>
<pre class="lang-js prettyprint-override"><code>app.use('/', (req, res, next) => {
if (req... | Why does ExpressJS not match all paths on root app.get('/' | express | 0 | 41 | 2 | 72,847,046 | 72,847,046 | 1 | true | 2022-07-03T10:36:29.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does ExpressJS not match all paths on root app.get('/'<p>The following express routing matches <code>GET /</code> but not <code>GET /anything/else</code>... |
72,802,072 | How to remove key data from all rows from json array using javascript<p>This is a JSON array. I want to remove the productID from all the rows.
when I console log I don't want to see the productID in it.</p>
<pre><code>"items":
[
{
"productID": "... | <p>assuming</p>
<pre><code>const items =
[
{
"productID": "11234567",
"added": "TIMESTAMP",
"title": "Project",
"type": "Weekend Project... | How to remove key data from all rows from json array using javascript | javascript|arrays|json | 0 | 41 | 2 | 72,802,212 | 72,802,212 | 1 | true | 2022-06-29T13:15:47.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove key data from all rows from json array using javascript<p>This is a JSON array. I want to remove the productID from all the rows.
when I consol... |
72,832,547 | Unlisting lists in a Dataframe column<p>I have a column of values split in two lists</p>
<pre><code>coordinates
----
[[36.2046069345455, 23.466756], [56.678766, 45.1405656576776]]
[[46.2034534576765, 56.877879], [34.207049, 18.1565655652422]]
[[41.3223449567164, 34.645445], [78.206545, 66.1402362184811]]
[[23.204606988... | <p>Assuming that each value of 'coordinates' consists of one list containing two lists with two values, you can use something like this:</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({
"coordinates": [
[[36.2046069345455, 23.466756], [56.678766, 45.1405656576776]],
[[46... | Unlisting lists in a Dataframe column | python|pandas|list|dataframe|data-manipulation | 0 | 41 | 2 | 72,832,746 | 72,832,746 | 1 | true | 2022-07-01T17:02:11.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unlisting lists in a Dataframe column<p>I have a column of values split in two lists</p>
<pre><code>coordinates
----
[[36.2046069345455, 23.466756], [56.6787... |
72,843,922 | finding total size of C files in gcc<p>I'm trying to compute the <em>source code size</em> of <code>gcc</code> by considering <code>cpp</code> files first:</p>
<pre class="lang-bash prettyprint-override"><code># NOTE: the cpp loop finishes immediately
LOC=0
BYTES=0
FILES=$(find . -name "*.cpp")
for f in ${FIL... | <p>Size of all *.c and *.cpp files in bytes:</p>
<pre><code>find . -name *.cpp -o -name *.c -exec wc -c {} \; | sed "s/ .*//" | paste -sd+ | bc
</code></pre>
<p>Number of lines in all *.c and *.cpp files:</p>
<pre><code>find . -name *.cpp -o -name *.c -exec wc -l {} \; | sed "s/ .*//" | paste -sd+ |... | finding total size of C files in gcc | bash|gcc|code-size | 0 | 41 | 3 | 72,844,756 | 72,844,756 | 1 | true | 2022-07-03T04:29:25.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
finding total size of C files in gcc<p>I'm trying to compute the <em>source code size</em> of <code>gcc</code> by considering <code>cpp</code> files first:</... |
72,858,760 | networkx draw nodes on a line in order with curved edges<p>I would like to draw a set of nodes on a line with spaces in between that correspond to the difference in a node property (here: the time when the node entered the system).
I would then like to draw curved edges between these nodes. Is this possible in networkx... | <p>You can control the position of your nodes by passing a dictionary of the positions (x,y) of your nodes to the <code>nx.draw</code> function (see doc <a href="https://networkx.org/documentation/stable/reference/generated/networkx.drawing.nx_pylab.draw.html#networkx.drawing.nx_pylab.draw" rel="nofollow noreferrer">he... | networkx draw nodes on a line in order with curved edges | python|networkx | 0 | 41 | 1 | 72,860,518 | 72,860,518 | 1 | true | 2022-07-04T15:05:15.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
networkx draw nodes on a line in order with curved edges<p>I would like to draw a set of nodes on a line with spaces in between that correspond to the differ... |
72,872,395 | How can you write a query that checks the value of a JSON column?<p>Suppose I have a table with three columns: <code>id</code>, <code>name</code>, <code>state</code>. The <code>state</code> column is of type <code>jsonb</code> and the structure would always have (as a minimum) a key called <code>active</code> e.g.</p>
... | <p>You'd use use the <code>@Query</code> annotation and whatever facilities your database offers to query json.</p>
<p>Just as an example this <a href="https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-json/" rel="nofollow noreferrer">tutorial for working with JSON in Postgres</a> suggests that somethin... | How can you write a query that checks the value of a JSON column? | json|spring-data|spring-data-jdbc | 0 | 41 | 1 | 72,878,993 | 72,878,993 | 1 | true | 2022-07-05T15:58:52.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you write a query that checks the value of a JSON column?<p>Suppose I have a table with three columns: <code>id</code>, <code>name</code>, <code>stat... |
72,937,287 | Regular expression to find string which is not part of bigger subscript<p>I have a very big file with text and want to find:</p>
<ol>
<li>all occurrences of string <code>selectedRow</code> which are not:</li>
<li>part of <code>selectedRowIds</code></li>
<li>are proceeded by <code>props.</code></li>
</ol>
<p>I am intere... | <p>You can use look around to exclude matches with particular prefix/postfixes:</p>
<pre><code>(?<!props\.)selectedRow(?!Ids)
</code></pre> | Regular expression to find string which is not part of bigger subscript | javascript|regex|intellij-idea | 0 | 41 | 1 | 72,937,702 | 72,937,702 | 1 | true | 2022-07-11T10:42:24.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regular expression to find string which is not part of bigger subscript<p>I have a very big file with text and want to find:</p>
<ol>
<li>all occurrences of ... |
72,856,861 | How can I get the mean of each group in a table - preferebly in bash (awk?<p>In bash (maybe awk?) how can I summarize/aggregate a table (like below) to get the mean per group?</p>
<pre><code>grp1 1
grp1 3
grp2 5
grp2 8
grp4 9
</code></pre> | <p>It's fairly simple to do this in <code>awk</code> :</p>
<pre><code>awk '{sum[$1]+=$2; count[$1]++} END {for(key in sum) print key ": " sum[key]/count[key]}' input_file
</code></pre>
<p>Output for your sample file :</p>
<pre><code>grp1: 2
grp2: 6.5
grp4: 9
</code></pre>
<p>Explanation :</p>
<ul>
<li><p><co... | How can I get the mean of each group in a table - preferebly in bash (awk? | bash|awk|mean | -1 | 41 | 2 | 72,856,965 | 72,856,965 | 1 | true | 2022-07-04T12:33:53.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get the mean of each group in a table - preferebly in bash (awk?<p>In bash (maybe awk?) how can I summarize/aggregate a table (like below) to get t... |
72,816,631 | How to pass a variable dynamically to a URL in playwright page.goto function?<p>I want to pass a variable in the URL, here is my code:</p>
<pre><code> url_id = ["253443","456545"]
for id in url_id :
print("Inside For loop", id) # this print the correct id (253443)
page.g... | <p>You are very close, so to embed the string value from the array you have to use the <a href="https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep498" rel="nofollow noreferrer">formatted string literals</a>, something like this:</p>
<pre class="lang-py prettyprint-override"><code>url_id = ["253443", &... | How to pass a variable dynamically to a URL in playwright page.goto function? | python-3.x|playwright|playwright-python|playwright-test | 0 | 41 | 1 | 72,816,734 | 72,816,734 | 1 | true | 2022-06-30T13:24:08.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass a variable dynamically to a URL in playwright page.goto function?<p>I want to pass a variable in the URL, here is my code:</p>
<pre><code> url_... |
72,997,376 | mail() not set in php.ini or custom "From:" header missing error<p>I made a form to send an email using php
and i got this error</p>
<pre><code> <b>Warning</b>: mail(): &quot;sendmail_from&quot;
not set in php.ini or custom &quot;From:&quot;
header missing in <b>C:\xampp\htdocs\PH... | <p>Solution : You need a SMTP Server to send emails using php because mail() function requires a MTA(Mail Transfer Agent)
to work and it will not work if you use a local server like XAMPP.</p>
<p>1.You Can Setup SMTP on XAMPP locally .. see this question for more info <a href="https://stackoverflow.com/questions/46525... | mail() not set in php.ini or custom "From:" header missing error | php|html|server|xampp | 1 | 41 | 1 | 72,997,377 | 72,997,377 | 1 | true | 2022-07-15T16:56:27.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mail() not set in php.ini or custom "From:" header missing error<p>I made a form to send an email using php
and i got this error</p>
<pre><code> <b>... |
72,891,589 | sql query to get the time period the position was tagged to the employee<p>The table below gives assignment and position details</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ASG_NUMBER</th>
<th>START_dATE</th>
<th>END_DATE</th>
<th>JOB_CODE</th>
<th>GRADE_CODE</th>
<th>POS_CDOE</th>
</tr... | <p>From Oracle 12, you can use the <code>MATCH_RECOGNIZE</code> and <code>MONTHS_BETWEEN</code>:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT asg_number,
CASE
WHEN time_in_post >= 12
THEN TO_CHAR(TRUNC(time_in_post/12), 'fm90') || 'y '
END
||
CASE
WHEN ... | sql query to get the time period the position was tagged to the employee | sql|oracle | 0 | 41 | 1 | 72,894,288 | 72,894,288 | 1 | true | 2022-07-07T02:13:35.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sql query to get the time period the position was tagged to the employee<p>The table below gives assignment and position details</p>
<div class="s-table-cont... |
72,804,106 | Efficiently reduce the size of groups in a dataframe<p>I have a dataframe which I am grouping based on the names of each row using the groupby function. I then want to reduce each group to a given size. I then add these groups back into a database to use for other processes. Currently I am doing this in a for loop but ... | <p>Group by the name and apply a <code>sample</code> (that'll take randomly N within that group) where N is either your desired amount or the complete amount for that group, eg:</p>
<pre><code>out = df.groupby('NAME').apply(lambda g: g.sample(min(len(g), target_number_rows)))
</code></pre>
<p>Otherwise, take the first ... | Efficiently reduce the size of groups in a dataframe | python|pandas|dataframe|pandas-groupby | 0 | 41 | 1 | 72,804,217 | 72,804,217 | 1 | true | 2022-06-29T15:30:34.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Efficiently reduce the size of groups in a dataframe<p>I have a dataframe which I am grouping based on the names of each row using the groupby function. I th... |
73,020,585 | Is there a way to get datatype long php?<p>Can I convert my int datatype variable to longint datatype because I need the object type to be long for soap API (XML)?</p> | <p>To convert PHP variables/arrays and object you can use SoapVar
to know further about <a href="https://www.php.net/manual/en/class.soapvar.php" rel="nofollow noreferrer">SoapVar</a></p>
<p>for your task you need something like
$workOrder['ID'] = new SoapVar($data['ID'],XSD_LONG);</p>
<p>to convert PHP object into Soa... | Is there a way to get datatype long php? | php|xml|soap|types|custom-data-type | 1 | 41 | 1 | 73,021,187 | 73,021,187 | 1 | true | 2022-07-18T10:09:10.443Z | 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 get datatype long php?<p>Can I convert my int datatype variable to longint datatype because I need the object type to be long for soap API ... |
72,981,587 | How to write a table encoded as a list of dictionaries directly to a zipped archive containing a CSV?<p>Suppose you have data in the form of a list of dictionaries like <code>d</code> here:</p>
<pre><code>d = [{'a' : 1, 'b' : 2}, {'a' : 3, 'c' : 5}]
</code></pre>
<p>and you want to save it as a comma-separated table to... | <p>You might use <a href="https://docs.python.org/3/library/codecs.html#codecs.StreamWriter" rel="nofollow noreferrer"><code>codecs.StreamWriter</code></a> if you want to use <code>csv.DictWriter</code> with binary file-handle, consider following simple example</p>
<pre><code>import csv
import codecs
utf8 = codecs.getw... | How to write a table encoded as a list of dictionaries directly to a zipped archive containing a CSV? | python|csv|zip|sparse-matrix | 0 | 41 | 1 | 72,982,130 | 72,982,130 | 1 | true | 2022-07-14T13:46:55.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write a table encoded as a list of dictionaries directly to a zipped archive containing a CSV?<p>Suppose you have data in the form of a list of dictio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.