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,338,089 | Tkinter winfo_ismapped() method not working<p>I have a program in python which in which I use Listboxes, buttons and labels. So today I came conflicting with a problem. I wanted to make my listbox appear when a button is clicked and disappear when the same button is clicked again. How can I achieve this? I tried using ... | <p>The problem is every time <code>showMenu()</code> is called another <code>Listbox</code> is created. To fix that, create the <code>Listbox</code> <em>outside</em> of the function (so it's a global).</p>
<p>(I also noticed you misspelled the name of <code>place_forget()</code> method.)</p>
<pre><code>import tkinter a... | Tkinter winfo_ismapped() method not working | python|tkinter | 0 | 60 | 1 | 72,338,430 | 72,338,430 | 1 | true | 2022-05-22T13:40:39.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tkinter winfo_ismapped() method not working<p>I have a program in python which in which I use Listboxes, buttons and labels. So today I came conflicting with... |
72,385,537 | How to join in pandas on a.date<=b.date and then taking the only the row where a.date is max?<p>I am trying to join two dataframes by ID and Date. However, the date criteria is that the a.date<=b.date and in case a.date has a many results, then taking the max value (but still <b.date). How would I do that?</p>
<p... | <p>Here's a way to do what your question asks:</p>
<pre class="lang-py prettyprint-override"><code>dfA = dfA.sort_values(['ID', 'date']).join(
dfB.set_index('ID'), on='ID', rsuffix='_b').query('date <= date_b').drop(
columns='date_b').groupby(['ID']).last().reset_index()
</code></pre>
<p>Explanation:</p>
<ul... | How to join in pandas on a.date<=b.date and then taking the only the row where a.date is max? | python|pandas|join | 1 | 60 | 3 | 72,385,761 | 72,385,761 | 1 | true | 2022-05-26T00:48:39.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to join in pandas on a.date<=b.date and then taking the only the row where a.date is max?<p>I am trying to join two dataframes by ID and Date. However, t... |
72,327,872 | How can I create an input that will loop and create a new list each time?<p>in case it isn't already obvious im new to python so if the answers could explain like im 5 years old that would be hugely appreirecated.</p>
<p>I'm basically trying to prove to myself that I can apply some of the basic that I have learnt into ... | <p>You will need to create a variable which can store multiple contacts inside of it. Each contact will be a list (or a <a href="https://www.w3schools.com/python/python_tuples.asp" rel="nofollow noreferrer">tuple</a>. Here I have used a tuple, but it doesn't matter much either way).</p>
<p>For this you could use a list... | How can I create an input that will loop and create a new list each time? | python|python-3.x|list|input | 1 | 60 | 4 | 72,328,067 | 72,328,067 | 1 | true | 2022-05-21T08:25:59.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create an input that will loop and create a new list each time?<p>in case it isn't already obvious im new to python so if the answers could explain... |
72,320,529 | Js mysql query not using boolean value given with GET request<p>I'm trying to search the <strong>MySQL</strong> database for <em>active</em> or <em>inactive</em> users that have the value isActive, the idea is that a <strong>GET request</strong> is sent with either <code>isActive=true</code> or <code>isActive=false</co... | <p>You need to convert from <code>true/false</code> to <code>1/0</code> for MySQL to understand the boolean values.</p>
<p>Also, since you're building the query string dynamically, you also have to build the parameters array dynamically, so that the parameters match the placeholders.</p>
<p><div class="snippet" data-la... | Js mysql query not using boolean value given with GET request | javascript|mysql | 0 | 60 | 1 | 72,320,736 | 72,320,736 | 1 | true | 2022-05-20T14:23:43.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Js mysql query not using boolean value given with GET request<p>I'm trying to search the <strong>MySQL</strong> database for <em>active</em> or <em>inactive<... |
72,289,575 | Filter an ObservableCollection of DirectoryInfo with LINQ<p>I'm using MVVM to populate a TreeView with a DirectoryInfo and all its sub-directories and files.</p>
<p>I then want to search through the treeview with LINQ .where() but I'm only searching the top directories and not the files.</p>
<p><strong>I'm creating the... | <p>You can override <code>.Where(..)</code> by a recursive version:</p>
<pre><code> public static class ExtenstioMethods
{
public static IEnumerable<Item> Where<Item>(this IEnumerable<Item> source, Func<Item, bool> predicate)
{
var result = new List<Item>();
... | Filter an ObservableCollection of DirectoryInfo with LINQ | c#|mvvm|treeview|directoryinfo | 2 | 60 | 2 | 72,291,200 | 72,291,200 | 1 | true | 2022-05-18T12:52:32.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter an ObservableCollection of DirectoryInfo with LINQ<p>I'm using MVVM to populate a TreeView with a DirectoryInfo and all its sub-directories and files.... |
72,397,978 | Google Sheet Script for arranging data according to input text value<p>I've been looking script for this googlesheet.</p>
<p><a href="https://i.stack.imgur.com/O6XmW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O6XmW.png" alt="enter image description here" /></a></p>
<p>What I want to do is that I... | <p>Well, I had put something together recently that accomplishes this, as I haven't found any real answers. Unfortunately, it's not as easy as it sounds.</p>
<p>The code below will work to sort your data, while preserving: values, formulas, bandings, font styles, background colors, notes and (experimentally) validation... | Google Sheet Script for arranging data according to input text value | google-apps-script|google-sheets|script | 1 | 60 | 2 | 72,398,422 | 72,398,422 | 1 | true | 2022-05-26T21:03:12.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheet Script for arranging data according to input text value<p>I've been looking script for this googlesheet.</p>
<p><a href="https://i.stack.imgur.c... |
72,314,088 | What is the proper Typing for props.src? (Typescript)<p>I have the following component working, but I would like to make it a bit more "Typescripty" by typing the props properly. As you can see, right now I have it set to "any". Here's my code:</p>
<pre><code>import React, {useState, useEffect} from... | <p>You expect string as image src prop. Even if it would be another type, with typescript it should look like this (just use correct type in TProps type):</p>
<pre><code>import React, {useState, useEffect, FC} from "react";
type TProps = {
src: string;
};
//The line in question here
const AsyncImage:FC&... | What is the proper Typing for props.src? (Typescript) | typescript|image|types|components|react-props | 0 | 60 | 1 | 72,314,564 | 72,314,564 | 1 | true | 2022-05-20T05:47:05.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the proper Typing for props.src? (Typescript)<p>I have the following component working, but I would like to make it a bit more "Typescripty"... |
72,375,016 | Converting Miles to Degrees for postgis Sequelize<p>I am querying the PostGres database using POSTGIS extension as I want to get users in a radius.</p>
<p>I am following this <a href="https://galxzx.github.io/blog/2017/03/15/Distance-Based-Queries-with-PostgreSQL-PostGIS-and-Sequelize/" rel="nofollow noreferrer">post</... | <p>To make things easier, I would suggest you cast the geometry column <code>position</code> and <code>ST_MakePoint</code> to geography which will allow you to use metric input. You can read more about it here <a href="https://www.crunchydata.com/blog/postgis-and-the-geography-type" rel="nofollow noreferrer">https://ww... | Converting Miles to Degrees for postgis Sequelize | node.js|postgresql|sequelize.js|postgis | 0 | 60 | 1 | 72,377,558 | 72,377,558 | 1 | true | 2022-05-25T09:24:53.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting Miles to Degrees for postgis Sequelize<p>I am querying the PostGres database using POSTGIS extension as I want to get users in a radius.</p>
<p>I ... |
72,366,783 | How to set background color for children of column<p>I am trying to implement Admob banner ad in my Flutter app. There is a black line above Admob banner, I could not understand how it happened. I did not set any background.</p>
<p><a href="https://i.stack.imgur.com/Pu5OP.png" rel="nofollow noreferrer"><img src="https:... | <p>You can use Container around Column widget.</p>
<pre><code>return Container(color: Colors.white,
child:
Column(
//backgroundColor:Colors.white,//This line is problematic.
children: [
Expanded(
...
...
...
),
Container(height: 30, color: Colors.red),
... | How to set background color for children of column | ios|flutter|dart|flutter-layout|admob | 1 | 60 | 1 | 72,366,850 | 72,366,850 | 1 | true | 2022-05-24T17:02:04.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set background color for children of column<p>I am trying to implement Admob banner ad in my Flutter app. There is a black line above Admob banner, I ... |
72,245,872 | useEffect does not see the state update<p>I'm trying to make the functionality of adding products to the cart with updating the counter of the number of products and the total amount.</p>
<p>I can't understand why useEffect is triggered only when a new product is added to the cart. If I update the current quantity of t... | <p>instead of this</p>
<pre><code> return setCart(cart) // useEffect does not work
</code></pre>
<p>write</p>
<pre><code> setCart(prevCart => prevCart.map(el => {
if (id === el.id) {
const price = el.price / el.quantity
el.quantity += 1
el.price = price * el.quantity
... | useEffect does not see the state update | reactjs|react-hooks | 0 | 60 | 1 | 72,245,880 | 72,245,880 | 1 | true | 2022-05-15T06:00:34.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
useEffect does not see the state update<p>I'm trying to make the functionality of adding products to the cart with updating the counter of the number of prod... |
72,240,633 | How to remove everything from ListView using a button onClick?<p>How to remove everything from ListView using a button onClick? When i try "fullCourseList.clear();", I can't add any more courses and the page is refreshed only after visiting the page again</p>
<pre><code>import static com.example.diplom.MainAc... | <p>You should save off the adapter so you can call <code>clear()</code> on it. Clearing the list this way will also automatically notify the adapter to update. Since you copied your data into a new list (<code>coursesTitle</code>) clearing the original list will have no immediate effect.</p>
<p>For example:</p>
<pre cl... | How to remove everything from ListView using a button onClick? | java|android | 0 | 60 | 3 | 72,243,443 | 72,243,443 | 1 | true | 2022-05-14T13:23:26.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove everything from ListView using a button onClick?<p>How to remove everything from ListView using a button onClick? When i try "fullCourseLi... |
72,253,479 | Passing values between two structs thats have a slice inside<p>i have 2 structs with a slice inside like this:</p>
<pre><code>type BookX struct {
SomeValue string
Book1 []Book1
}
type Book1 struct {
Name string
Author string
}
type BookY struct {
SomeValue string
Book2 []Book2
}
type Book2 struct {
Name ... | <p><code>Book1</code> and <code>Book2</code> are the diffrent type even they have same members. You can not append <code>[]Book1</code> to <code>[]Book2</code>.</p>
<p>One solution is to create a <code>Book2</code> instance from <code>Book1</code> and add them to <code>[]Book2</code>.</p>
<pre><code>func someName(bookX... | Passing values between two structs thats have a slice inside | go | -2 | 60 | 1 | 72,253,701 | 72,253,701 | 2 | true | 2022-05-16T01:51:42.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing values between two structs thats have a slice inside<p>i have 2 structs with a slice inside like this:</p>
<pre><code>type BookX struct {
SomeValue... |
72,265,919 | Indexing every other 2x2 block in 2D array<p>Say I have an array that looks like</p>
<pre><code>array([[ 0, 1, 2, 3, 4, 5, 6, 7],
[ 8, 9, 10, 11, 12, 13, 14, 15],
[16, 17, 18, 19, 20, 21, 22, 23],
[24, 25, 26, 27, 28, 29, 30, 31],
[32, 33, 34, 35, 36, 37, 38, 39],
[40, 41, 42,... | <p>Here's one way you could do it:</p>
<pre><code>In [73]: a
Out[73]:
array([[ 0, 1, 2, 3, 4, 5, 6, 7],
[ 8, 9, 10, 11, 12, 13, 14, 15],
[16, 17, 18, 19, 20, 21, 22, 23],
[24, 25, 26, 27, 28, 29, 30, 31],
[32, 33, 34, 35, 36, 37, 38, 39],
[40, 41, 42, 43, 44, 45, 46, 47],
... | Indexing every other 2x2 block in 2D array | python|arrays|numpy | 1 | 60 | 2 | 72,266,141 | 72,266,141 | 2 | true | 2022-05-16T21:40:58.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Indexing every other 2x2 block in 2D array<p>Say I have an array that looks like</p>
<pre><code>array([[ 0, 1, 2, 3, 4, 5, 6, 7],
[ 8, 9, 10, ... |
72,267,105 | Rounding off to the nearest 50's pandas dataframe<p>I have a pandas dataframe , screenshot shown below:</p>
<pre><code>ID Price
100 1040.0
101 1025.0
102 750.0
103 891.0
104 924.0
</code></pre>
<p>Expected output shown below</p>
<pre><code>ID Price Price_new
100 1040.0 1050
101 ... | <p>This is due to the issue : <a href="https://stackoverflow.com/questions/10825926/python-3-x-rounding-behavior">round with python 3</a></p>
<pre><code>s = (df['Price'] % 50)
df['new'] = df['Price'] + np.where(s>=25,50-s,-s)
df
Out[33]:
ID Price new
0 100 1040 1050
1 101 1025 1050
2 102 750 7... | Rounding off to the nearest 50's pandas dataframe | python|pandas | 1 | 60 | 2 | 72,267,144 | 72,267,144 | 2 | true | 2022-05-17T00:56:03.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rounding off to the nearest 50's pandas dataframe<p>I have a pandas dataframe , screenshot shown below:</p>
<pre><code>ID Price
100 1040.0
101 ... |
72,269,283 | How to delete diacritics from a string in C#?<p>I have a string -</p>
<pre><code>125DF885DF44é112846522FF001
</code></pre>
<p>I want to remove <strong>é</strong> from the string. When I search online I get solutions to remove the accents from <strong>é</strong> and returns <strong>e</strong>.</p>
<p>The <em>diacritic ... | <p>You can use this</p>
<pre><code>string s = "125DF885DF44é112846522FF001";
string s1 = s.Replace("é","");
</code></pre> | How to delete diacritics from a string in C#? | c#|string | 0 | 60 | 2 | 72,269,323 | 72,269,323 | 2 | true | 2022-05-17T06:47:09.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete diacritics from a string in C#?<p>I have a string -</p>
<pre><code>125DF885DF44é112846522FF001
</code></pre>
<p>I want to remove <strong>é</st... |
72,271,669 | not able to print star pattern in given patter in nodeJS<p>I am looking to solve this problem for printing * start pattern in nodejs commandline. Here is the code I wrote in nodejs</p>
<pre><code>var readlineSync = require('readline-sync');
const input = readlineSync.question('Enter a number')
for (var i = 0; i <=... | <p><code>console.log</code> always puts data in a new line
set a string before the <code>j</code> loop, add to the string in that loop, then <code>console.log</code> that string after that loop</p>
<pre class="lang-js prettyprint-override"><code>var readlineSync = require('readline-sync');
const input = readlineSync.q... | not able to print star pattern in given patter in nodeJS | javascript|node.js | 0 | 60 | 3 | 72,271,737 | 72,271,737 | 2 | true | 2022-05-17T09:43:32.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
not able to print star pattern in given patter in nodeJS<p>I am looking to solve this problem for printing * start pattern in nodejs commandline. Here is the... |
72,304,786 | how to count number of lines, within a cell in pandas dataframe, which are not empty lines<p>For the data that I have, which looks like below (sample):</p>
<pre><code>import pandas as pd
MyDict = {'text' : ['\nbla bla text \n\n bla bla another text \n # bla text \n\n\n bla bla another text',
'\nbl... | <p>You could try something like this:</p>
<pre><code>df['total_lines'] = df['text'].str.split('\n').apply(lambda x: len(x) - x.count(''))
</code></pre>
<p>Output:</p>
<pre><code> text total_lines
0 \nbla bla text \n\n bla bla another text \n # ... 4
1 \n... | how to count number of lines, within a cell in pandas dataframe, which are not empty lines | python|pandas | 2 | 60 | 1 | 72,304,904 | 72,304,904 | 2 | true | 2022-05-19T12:43:17.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to count number of lines, within a cell in pandas dataframe, which are not empty lines<p>For the data that I have, which looks like below (sample):</p>
<... |
72,320,495 | Error: CS0019: Operator '+' cannot be applied to operands of type 'TextBox' and 'TextBox' WPF + c# application<p>So I'm working on a application that ask for age, weight, height, sex, name and after clicking a button makes a info.txt and writes the information given by the user</p>
<p>WPF:</p>
<pre><code>
<TextBox M... | <p>You need to access the text atribute of the TextBoxes not the TextBox themselves.</p>
<pre><code>tw.WriteLine(txtAge.Text + txtWeight.Text + txtHeight.Text + txtSex.Text + txtName.Text);
</code></pre> | Error: CS0019: Operator '+' cannot be applied to operands of type 'TextBox' and 'TextBox' WPF + c# application | c#|wpf | -2 | 60 | 1 | 72,320,544 | 72,320,544 | 2 | true | 2022-05-20T14:20:54.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error: CS0019: Operator '+' cannot be applied to operands of type 'TextBox' and 'TextBox' WPF + c# application<p>So I'm working on a application that ask for... |
72,320,830 | Need to prevent 10 consecutive digits, and 11 consecutive digits, with some tricky parameters<p>I'm trying to alter a regex expression for emails, with the requirement that we can't have a 10 digit phone number in it, or an 11 digit phone number that starts with a 1. The difficult part is that if the 11 digit phone num... | <p>You may use this regex:</p>
<pre class="lang-sh prettyprint-override"><code>^(?!1?\d{10}@)[\w-]+(?:\.[\w-]+)*@[\w-]+(?:\.[\w-]+)*\.[A-Za-z]{2,}$
</code></pre>
<p><a href="https://regex101.com/r/ZG0NXr/1" rel="nofollow noreferrer">RegEx Demo</a></p>
<p><strong>RegEx Details:</strong></p>
<ul>
<li><code>^</code>: Star... | Need to prevent 10 consecutive digits, and 11 consecutive digits, with some tricky parameters | regex|java-8 | 0 | 60 | 2 | 72,320,928 | 72,320,928 | 2 | true | 2022-05-20T14:43:05.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to prevent 10 consecutive digits, and 11 consecutive digits, with some tricky parameters<p>I'm trying to alter a regex expression for emails, with the r... |
72,341,094 | Filter out numbers from text using list comprehension<p>I have a small text with currency values. I would like to save only the values without the currency signs in a list. Here is my working example so far</p>
<pre><code>Text = "Out of an estimated $5 million budget, $3 million is channeled to program XX, $1 mill... | <p>Try this</p>
<pre><code>Text = "Out of an estimated $5 million budget, $3 million is channeled to program XX, $1 million to program YY and the remainder to program ZZ"
# slice $ sign off of each string
amount = [x[1:] for x in Text.split() if x.startswith('$')]
amount
['5', '3', '1']
</code></pre> | Filter out numbers from text using list comprehension | python|list-comprehension | 1 | 60 | 4 | 72,341,120 | 72,341,120 | 2 | true | 2022-05-22T20:31:14.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter out numbers from text using list comprehension<p>I have a small text with currency values. I would like to save only the values without the currency s... |
72,342,105 | How to create a staggered square tiling pattern in svg?<p>I want to fill a rectangle space with a repeating image pattern. The images are arranged in a staggered square tiling. Two adjacent rows are staggered in the x-direction by half the width of the side of the square.</p>
<p>How to use the pattern element in svg to... | <p>Something like this... You can replace the paths with images.</p>
<p>The trick is to draw one of the pieces in two separate halves allowing the pattern rect to clip each half.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="s... | How to create a staggered square tiling pattern in svg? | javascript|html|svg|d3.js|svg-pattern | 2 | 60 | 1 | 72,342,301 | 72,342,301 | 2 | true | 2022-05-23T00:09:27.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a staggered square tiling pattern in svg?<p>I want to fill a rectangle space with a repeating image pattern. The images are arranged in a stagg... |
72,344,458 | Why can't my conditional detect an empty char?<p>I'm trying to create "String Array Count" function. How does it it work? The loop is going to stop if the char is empty, then the length is going to show. The error is, empty char conditional didn't detect empty char. The result is infinite while loop.</p>
<p>E... | <p>Here you are using a true 2D array. That means that you have <code>s</code> (1000) arrays of <code>s</code> characters. As you initialize it, the C language ensures that all unused chars are 0.</p>
<p>It means that the first unused slot will the the first one where the <strong>first character</strong> is 0. So your ... | Why can't my conditional detect an empty char? | arrays|c|string | 2 | 60 | 2 | 72,344,925 | 72,344,925 | 2 | true | 2022-05-23T07:06:33.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't my conditional detect an empty char?<p>I'm trying to create "String Array Count" function. How does it it work? The loop is going to stop... |
72,347,497 | Why does my loop execute commands not in the order they are described<p>Now i'm trying to learn go.</p>
<p>I'm have code:</p>
<pre><code>package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var wallCount int
var width, height, area float64
var r = bufio.NewRea... | <p>There are a few things going wrong here. First of all, you used <code>%d</code>, which denotes an integer value, while you are using float values (which use <code>%f</code>).</p>
<p>This function: <code>fmt.Fscanf(r, "%d %d", &width, &height)</code> returns two values. The first value is the number... | Why does my loop execute commands not in the order they are described | go | -2 | 60 | 1 | 72,347,780 | 72,347,780 | 2 | true | 2022-05-23T11:05:02.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my loop execute commands not in the order they are described<p>Now i'm trying to learn go.</p>
<p>I'm have code:</p>
<pre><code>package main
import... |
72,347,128 | Dplyr: How to Rearrange and Split a Dataframe by A Categorical Group Within a Pivot Table Showing Summary Statistics in R<p><strong>Issue:</strong></p>
<p>I apologise if this is a repeat, as I've no idea whats' the correct terminology for what I'm trying to achieve. I have a categorical variable called <code>Country</c... | <p>Does this give you what you want? (If you scroll to the bottom :)). It combines the answer from the previous issue with <code>group_by</code>, excluding <code>Country</code> and <code>n</code> from the <code>pivot_longer</code> and also renaming <code>Center_Freq</code> so it names correctly when pivoting.</p>
<pre ... | Dplyr: How to Rearrange and Split a Dataframe by A Categorical Group Within a Pivot Table Showing Summary Statistics in R | r|dplyr|split|pivot-table|tidyr | 0 | 60 | 1 | 72,348,010 | 72,348,010 | 2 | true | 2022-05-23T10:36:24.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dplyr: How to Rearrange and Split a Dataframe by A Categorical Group Within a Pivot Table Showing Summary Statistics in R<p><strong>Issue:</strong></p>
<p>I ... |
72,366,662 | How to take the most recent row of data in R?<p>If i have this dataframe:</p>
<pre><code>tibble(
period = c("2010END", "2011END",
"2010Q1","2010Q2","2010Q3","2010Q4","2010END",
"2011Q1","2011Q2","... | <p>The code below selects the most recent non <code>NA</code> row by website.<br />
As this isn't fully your expected result, as suggested in comments please clarify your question if necessary.</p>
<pre><code>data[,most_recent:=fifelse(!is.na(values)&date==.SD[!is.na(values),max(date)],'yes','no'),by=website][]
... | How to take the most recent row of data in R? | r|dataframe|dplyr|data.table|tidyverse | 2 | 60 | 1 | 72,367,970 | 72,367,970 | 2 | true | 2022-05-24T16:52:07.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to take the most recent row of data in R?<p>If i have this dataframe:</p>
<pre><code>tibble(
period = c("2010END", "2011END",
... |
72,381,048 | Search for folder in Google Drive python<p>Problem is I want to upload files to google drive what I have already sorted, but the problem is I need to get the <code>folder_id</code> of the folder named <code>Location</code> in gdrive. Normally I would use the provided library from google, but I can't authenticate with m... | <p>I think that in your showing script, even when the files and folders of the name of <code>Location</code> are not existing, the value is returned like <code>"files": []</code> instead of <code>Invalid Value</code>. And, for example, when an access token is invalid, the error like <code>"reason": ... | Search for folder in Google Drive python | python|google-drive-api|drive | 0 | 60 | 1 | 72,385,221 | 72,385,221 | 2 | true | 2022-05-25T16:10:51.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search for folder in Google Drive python<p>Problem is I want to upload files to google drive what I have already sorted, but the problem is I need to get the... |
72,394,245 | Have "APP" as prefix and then allow only numbers in input field<p>I have a requirement where I have an input field, that must have the prefix "APP " and then allow the user to type in 7 numeric only values. I was hoping I could use ngx-mask, but it doesn't seem possible. Alternatively I was thinking of using ... | <h2><a href="https://stackblitz.com/edit/angular-ivy-mask-eisqcs?file=src%2Fapp%2Fapp.component.html" rel="nofollow noreferrer">Stackblitz</a></h2>
<p>How about,</p>
<pre><code><input type="text" prefix="APP " mask="0000000" [clearIfNotMatch]="true" />
</code></pre>
<p>usin... | Have "APP" as prefix and then allow only numbers in input field | javascript|html|angular|ngx-mask | 0 | 60 | 1 | 72,395,354 | 72,395,354 | 2 | true | 2022-05-26T15:26:19.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Have "APP" as prefix and then allow only numbers in input field<p>I have a requirement where I have an input field, that must have the prefix "APP "... |
72,266,695 | Add totals on top of each bar<p>I am plotting my data and want to display totals on top of each bar but as soon as I add total count the bars disappear.</p>
<pre><code>long<- data.frame(
Name = c("abc","abc","abc","gif","gif","gif","xyz&quo... | <p>You can achieve that creating another df with the sum of value per Name and passing this to <code>geom_text()</code></p>
<pre><code>long<- data.frame(
Name = c("abc","abc","abc","gif","gif","gif","xyz","xyz","xyz"),
... | Add totals on top of each bar | r|ggplot2 | 0 | 60 | 1 | 72,266,759 | 72,266,759 | 2 | true | 2022-05-16T23:40:44.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add totals on top of each bar<p>I am plotting my data and want to display totals on top of each bar but as soon as I add total count the bars disappear.</p>
... |
72,290,168 | How to rewrite this ramda.js code in vanilla JS<p>I am removing ramda from some code I've inherited as part of an effort to reduce the JavaScript size. But I'm stuck with the below because this line really baffles me as it apparently doesn't operate on any object.</p>
<pre><code>var iterate = R.addIndex(R.forEach);
</... | <p>Convert the object to a standard array using <code>Array.from()</code> and then you JS <code>Array.forEach()</code>:</p>
<pre><code>const iterate = (fn, o) => Array.from(o).forEach(fn)
iterate(function(li) {
// Other code
}, lis);
</code></pre> | How to rewrite this ramda.js code in vanilla JS | javascript|ramda.js | 4 | 60 | 2 | 72,290,356 | 72,290,356 | 2 | true | 2022-05-18T13:31:35.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rewrite this ramda.js code in vanilla JS<p>I am removing ramda from some code I've inherited as part of an effort to reduce the JavaScript size. But ... |
72,243,517 | Are indexes built CONCURRENTLY different in any way?<p>Does PostgreSQL <code>CREATE INDEX CONCURRENTLY</code> mean that even after initial index build, new and future inserts won't be indexed immediately (strongly consistent in terms of indexing)?</p> | <p>No. <a href="https://www.postgresql.org/docs/current/sql-createindex.html" rel="nofollow noreferrer"><code>CREATE INDEX</code></a> with the modifier <code>CONCURRENTLY</code> produces exactly the same kind of index as without the modifier.</p>
<p><code>CONCURRENTLY</code> only changes the way the index is created in... | Are indexes built CONCURRENTLY different in any way? | sql|postgresql|indexing|concurrency | 1 | 60 | 1 | 72,243,545 | 72,243,545 | 2 | true | 2022-05-14T20:06:19.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are indexes built CONCURRENTLY different in any way?<p>Does PostgreSQL <code>CREATE INDEX CONCURRENTLY</code> mean that even after initial index build, new a... |
72,396,394 | how to use setTimeout on a react component<p>This question might be simple to most web developers but I am pretty new and cannot figure out the way to put a settimeout function on what I would like to show on a page. below is the example of the code I would like to add a timeout for.</p>
<pre><code>import React from &q... | <p>You can add <code>setTimeout</code> in your App Component. It should look like this:</p>
<pre class="lang-js prettyprint-override"><code>import React, { useState, useEffect } from "react";
import Navbar from "./Navbar";
import Contact from "./Contact";
function App() {
const [showNav... | how to use setTimeout on a react component | javascript|reactjs | -1 | 60 | 2 | 72,396,456 | 72,396,456 | 2 | true | 2022-05-26T18:23:33.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to use setTimeout on a react component<p>This question might be simple to most web developers but I am pretty new and cannot figure out the way to put a ... |
72,380,000 | Load more data from json on click<p>I had another request which complicated my life even more.</p>
<p>I'd like to load more datas in to my html when I click my button ´See more´.
Ideally I should have only 4 items displayed by default. And each load should add 2 more.</p>
<p>Now, what's the best approach?
I'd like a hi... | <p>You can try this with some explanation in 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>const friendAndFamily = [{
name: "Serena Gosling",
supporterNumber: "0... | Load more data from json on click | javascript|json | 0 | 60 | 1 | 72,380,368 | 72,380,368 | 2 | true | 2022-05-25T15:00:17.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Load more data from json on click<p>I had another request which complicated my life even more.</p>
<p>I'd like to load more datas in to my html when I click ... |
72,258,146 | 1062 Duplicate entry 'General' - skip the insert if there is already a category with same name<p>I have a migration post_categories like this:</p>
<pre><code> public function up()
{
Schema::create('post_categories', function (Blueprint $table) {
$table->id();
$table-&... | <p>There are many methods that accomplish what you want using <code>Query Builder</code></p>
<h2><a href="https://laravel.com/docs/9.x/queries#insert-statements" rel="nofollow noreferrer">insertOrIgnore</a></h2>
<p>Here is an example of this method:</p>
<pre><code>$data = array_map(fn ($category) => [
'post_id' ... | 1062 Duplicate entry 'General' - skip the insert if there is already a category with same name | php|laravel | -1 | 60 | 1 | 72,259,097 | 72,259,097 | 2 | true | 2022-05-16T10:59:38.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
1062 Duplicate entry 'General' - skip the insert if there is already a category with same name<p>I have a migration post_categories like this:</p>
<pre><code... |
72,374,803 | How do you finish working with a git project?<p>I'm new to git and github and I'm struggling to figure out what's going on with git in cmd. I've just made lots of commits and I'm done working on one of my repos (locally and pushed to GitHub).</p>
<p>I now want to work on another repo locally for which I have a repo on ... | <blockquote>
<p>Is there a way to break the connection in cmd between the local repo and the GitHub repo? A proper way to 'close' it?</p>
</blockquote>
<p>You <em>can</em> break the connection between your local and the remote repository by using the <code>git remote remove</code> command, but you will not gain anythin... | How do you finish working with a git project? | git | -2 | 60 | 3 | 72,374,874 | 72,374,874 | 2 | true | 2022-05-25T09:08:51.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you finish working with a git project?<p>I'm new to git and github and I'm struggling to figure out what's going on with git in cmd. I've just made lo... |
72,303,693 | Optimize function creation and subsequent autocomplete configuration with a hash table<h2>Primary Question</h2>
<p>My question is whether it is possible to optimize the creation of functions and subsequent autocomplete settings with a hash table.</p>
<p>The Functions I want to optimize e.g. with a <code>ForEach</code> ... | <p>Registering functions programmatically is as straightforward as creating new items in the <code>functions:</code> drive:</p>
<pre><code>$functions = @{
"wu" = "winget upgrade --include-unknown";
"wui" = "winget upgrade -i -e";
"wi" = "winget install ... | Optimize function creation and subsequent autocomplete configuration with a hash table | powershell|function|hashtable|powershell-7.0 | 1 | 60 | 1 | 72,303,849 | 72,303,849 | 2 | true | 2022-05-19T11:25:19.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optimize function creation and subsequent autocomplete configuration with a hash table<h2>Primary Question</h2>
<p>My question is whether it is possible to o... |
72,355,589 | Why the sort method not working in the parent component?<p>This is the first project for me in VueJS.
I have a product list and want to sort it by price. I built two components and tried to pass a sort method to the parent from the child component (dropdown button) by emitting an event. but after a lot of attempts, I c... | <p>Suggestions:</p>
<ul>
<li>emit when an individual item is clicked, not when the button is clicked. You want to emit when the user makes a selection</li>
<li>So this means calling the sortPrice function from the menu-item div via <code>@click="sortPrice(item)"</code></li>
<li>Then in the sortPrice function,... | Why the sort method not working in the parent component? | javascript|vue.js|vuejs2|vuejs3 | 1 | 60 | 1 | 72,356,536 | 72,356,536 | 2 | true | 2022-05-23T22:58:29.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why the sort method not working in the parent component?<p>This is the first project for me in VueJS.
I have a product list and want to sort it by price. I b... |
72,346,845 | Change color of the rectangle which the mouse is in by using the mouse wheel<p>Sorry for posting my whole code but this way you can check my problem easier, no?</p>
<pre><code>package task3;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import j... | <h1>Introduction</h1>
<p>Since your code is not runnable, I went ahead and created an example GUI. Here's the example GUI.</p>
<p><a href="https://i.stack.imgur.com/rWipG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rWipG.png" alt="Colored Rectangles 1" /></a></p>
<p>Here's the example GUI after ... | Change color of the rectangle which the mouse is in by using the mouse wheel | java|graphics|rectangles | -1 | 60 | 1 | 72,350,255 | 72,350,255 | 2 | true | 2022-05-23T10:15:33.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change color of the rectangle which the mouse is in by using the mouse wheel<p>Sorry for posting my whole code but this way you can check my problem easier, ... |
72,358,494 | Laravel WhereHas only the latest record on the HasMany Relationship<p>I have <strong>Items</strong> table that has relation to <strong>Histories</strong> table.</p>
<p>I want to get count of <strong>items</strong> that has only latest <strong>history.status</strong></p>
<p>I still can't get the exact same count result ... | <p>i guess you mean <a href="https://laravel.com/docs/9.x/eloquent-relationships#has-one-of-many" rel="nofollow noreferrer">latestOfMany()</a> ?</p>
<pre class="lang-php prettyprint-override"><code>//Item.php
public function latestHistory() {
return $this->hasOne(History::class)->latestOfMany();
}
</c... | Laravel WhereHas only the latest record on the HasMany Relationship | php|laravel|eloquent | 2 | 60 | 1 | 72,359,157 | 72,359,157 | 2 | true | 2022-05-24T07:02:38.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel WhereHas only the latest record on the HasMany Relationship<p>I have <strong>Items</strong> table that has relation to <strong>Histories</strong> tab... |
72,264,912 | Issue with creating nested map using streams and collectors<pre><code>class QuizAnswers {
List<CheckboxAnswer> checkBoxAnswers;
}
class CheckboxAnswer {
int questionId;
// The indices of the selected answer choices
List<Integer> answer_selections;
}
</code></pre>
<p>The input to my function is a <c... | <p>Although you were close, your usage of collectors is syntactically incorrect.</p>
<p>Firstly, the required method <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/Stream.html#collect(java.util.stream.Collector)" rel="nofollow noreferrer"><code>collect()</code></a> expects a coll... | Issue with creating nested map using streams and collectors | java|hashmap|java-stream|collectors | 1 | 60 | 2 | 72,265,368 | 72,265,368 | 2 | true | 2022-05-16T19:57:33.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue with creating nested map using streams and collectors<pre><code>class QuizAnswers {
List<CheckboxAnswer> checkBoxAnswers;
}
class CheckboxAnsw... |
72,293,400 | Problem using dbplyr to create a SQL query<p>I am trying to create a query that cleans a data in SQL but I don't know SQL. To do so, I create a sample of the dataset and use <code>dplyr</code> to clean and create the final data that I want and then I want to use <code>dbplyr</code> to create the query. But I am having... | <p><code>show_query()</code> will only work on a database, and you are trying to use it on a dataframe. To send your data from the csv to a temporary database object to create the query, you could use <a href="https://dbplyr.tidyverse.org/reference/memdb_frame.html" rel="nofollow noreferrer"><code>tbl_memdb()</code></a... | Problem using dbplyr to create a SQL query | sql|r|dbplyr | 1 | 60 | 1 | 72,293,543 | 72,293,543 | 3 | true | 2022-05-18T17:14:37.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem using dbplyr to create a SQL query<p>I am trying to create a query that cleans a data in SQL but I don't know SQL. To do so, I create a sample of the... |
72,314,386 | pandas fillna sequentially step by step<p>I have dataframe like as below</p>
<pre><code>Re_MC,Fi_MC,Fin_id,Res_id,
1,2,3,4
,7,6,11
11,,31,32
,,35,38
df1 = pd.read_clipboard(sep=',')
</code></pre>
<p>I would like to <code>fillna</code> based on two steps</p>
<p>a) First, compare only <code>Re_MC</code> and <code>F... | <p>You can use dictionaries in <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html" rel="nofollow noreferrer"><code>fillna</code></a>:</p>
<pre><code>(df1
.fillna({'Re_MC': df1['Fi_MC'], 'Fi_MC': df1['Re_MC']})
.fillna({'Re_MC': df1['Res_id'], 'Fi_MC': df1['Fin_id']})
)
</code></pre>
<p... | pandas fillna sequentially step by step | python|pandas|dataframe|series|fillna | 3 | 60 | 1 | 72,314,628 | 72,314,628 | 3 | true | 2022-05-20T06:22:19.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas fillna sequentially step by step<p>I have dataframe like as below</p>
<pre><code>Re_MC,Fi_MC,Fin_id,Res_id,
1,2,3,4
,7,6,11
11,,31,32
,,35,38
df... |
72,326,702 | Typing with keyof and template literal<p>For each arbitrary object, e.g.</p>
<pre class="lang-js prettyprint-override"><code>{
name: string;
age: number;
}
</code></pre>
<p>I'd like to have a type e.g.:</p>
<pre class="lang-js prettyprint-override"><code>type ConsumerFn<T> = (value: T) => void;
type Consum... | <p>The following mapping type should work, transforming the properties into your template literals is a bit verbose</p>
<pre><code>type ConsumerFn<T> = (value: T) => void;
type Consumer<Type> = {
[Property in keyof Type as `${string & Property}Consumer`]: ConsumerFn<Type[Property]>
};
typ... | Typing with keyof and template literal | typescript|typescript-generics | 1 | 60 | 2 | 72,326,762 | 72,326,762 | 3 | true | 2022-05-21T04:37:42.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typing with keyof and template literal<p>For each arbitrary object, e.g.</p>
<pre class="lang-js prettyprint-override"><code>{
name: string;
age: number;... |
72,382,876 | Scala update object fields incrementally<p>I need to build records with multiple fields.</p>
<p>The record definition is like:</p>
<pre><code>class Record(
f1: Int,
f2: String,
...
err: String
)
</code></pre>
<p>The logic is like:</p>
<pre><code>record.f1 = get_f1()
record.f2 = get_f2()
...
</code></pre>
<p>The... | <blockquote>
<p>The question is how can I implement this in a more functional way?</p>
</blockquote>
<p>By properly modeling this in a functional style.</p>
<p>First, let's remove the <code>err</code> field from the <code>case class</code>, and rather use <code>Either</code><br>
Second, let's properly handle the <code>... | Scala update object fields incrementally | scala | 0 | 60 | 2 | 72,383,210 | 72,383,210 | 3 | true | 2022-05-25T18:56:18.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scala update object fields incrementally<p>I need to build records with multiple fields.</p>
<p>The record definition is like:</p>
<pre><code>class Record(
... |
72,399,329 | Dynamic key in typescript type<p>Suppose a type key has this format: <code>XXX_{placeholder1}_{placeholder2}</code> where <code>placeholder1</code> could be <code>a,b,c,...,z</code>, same for <code>placeholder2</code>.
Instead of explicitly defining</p>
<pre><code>type ObjectT = {
XXX_a_a: '...',
XXX_a_b: '...',
... | <p>Yes, you can use <a href="https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html" rel="nofollow noreferrer">template literal types</a> !</p>
<pre><code>type az = 'a' | 'b' | 'c' | ... | 'z'
type keys = `XXX_${az}_${az}`;
type ObjectT = Record<keys,string>
</code></pre>
<p><a href="https:/... | Dynamic key in typescript type | typescript | 0 | 60 | 1 | 72,399,373 | 72,399,373 | 3 | true | 2022-05-27T00:38:15.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamic key in typescript type<p>Suppose a type key has this format: <code>XXX_{placeholder1}_{placeholder2}</code> where <code>placeholder1</code> could be ... |
72,298,414 | In Go, how do stay in a for loop, but print a different output if user guesses too high or too low<p>I'm trying to develop a guessing game in <strong>GO</strong> that gives the user three attempts to guess the random number correctly.</p>
<p>It mostly seems to work, I'm using a for loop to count the amount of lives lef... | <p>You're not assigning the output of your function <code>guessRandomNumber()</code> to your <code>_guess</code>. Apart from this also you're using extra <code>if-else</code>, which are not required. Also you're giving 4 attempts to user instead of 3. You can try:</p>
<pre><code>package main
import (
"fmt&quo... | In Go, how do stay in a for loop, but print a different output if user guesses too high or too low | loops|for-loop|go|random | 0 | 60 | 2 | 72,298,660 | 72,298,660 | 3 | true | 2022-05-19T03:51:55.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Go, how do stay in a for loop, but print a different output if user guesses too high or too low<p>I'm trying to develop a guessing game in <strong>GO</str... |
72,287,700 | How to prevent MultiBinding chain through null object<p>I have the following XAML code:</p>
<pre><code> <TextBox Text="Image.Bytes" IsReadOnly="True"/>
<TextBox IsReadOnly="True">
<TextBox.Text>
<MultiBinding Converter="... | <p>You can't avoid that the converter is called, but you can check whether all of the Bindings did produce a value.</p>
<pre><code>public object Convert(
object[] values, Type targetType, object parameter, CultureInfo culture)
{
string result = string.Empty;
string separator = parameter?.ToString() ?? "... | How to prevent MultiBinding chain through null object | c#|wpf|xaml|converters|multibinding | 2 | 60 | 2 | 72,287,881 | 72,287,881 | 3 | true | 2022-05-18T10:43:54.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to prevent MultiBinding chain through null object<p>I have the following XAML code:</p>
<pre><code> <TextBox Text="Image.Bytes" IsRea... |
72,261,133 | Can't delete file within folder in C<p>Im making a txt editor in the terminal, one of it's features is to edit a specific line.
To do so,</p>
<p>I am creating a new temporary txt file,
deleting the old/original one
and renaming the temporary one to the original.</p>
<p>Here's the code:</p>
<pre><code>FileLineEdit(char ... | <p>The <code>/tmp</code> folder has the sticky bit (<code>s</code>) set, and that means, that anyone can read and create/modify files in it, but only its owner (root) can remove them.</p>
<p>So, if is what you want your program to do, you should do it in some directory other than <code>/tmp</code></p>
<p>Also, as jarmo... | Can't delete file within folder in C | c | 3 | 60 | 1 | 72,261,479 | 72,261,479 | 3 | true | 2022-05-16T14:49:03.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't delete file within folder in C<p>Im making a txt editor in the terminal, one of it's features is to edit a specific line.
To do so,</p>
<p>I am creatin... |
72,363,511 | pip and python referring to different interpreters<p>I know "multiple-versions-of-python-mess" is nothing new but my question is more specific. I'm learning how to use venv (and pyenv, etc.) and I've run into a strange situation.</p>
<p>I have a number of different versions of python installed (as one does). ... | <p><code>venv</code> will not <code>unalias</code> anything for you; if you have aliases, your shell interprets those before the <code>venv</code> stuff even gets a chance.</p>
<p>My simple recommendation would be to remove these aliases from your shell's startup files, or at least interactively <code>unalias</code> th... | pip and python referring to different interpreters | python|pip|python-venv|pyenv | 1 | 60 | 1 | 72,363,840 | 72,363,840 | 3 | true | 2022-05-24T13:10:41.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pip and python referring to different interpreters<p>I know "multiple-versions-of-python-mess" is nothing new but my question is more specific. I'm... |
72,305,316 | Can using foreach of CopyOnWriteArrayList cause ConcurrentModificationException in java?<p>I look to java 11 implementation of <code>.foreach</code> method in <code>CopyOnWriteArrayList</code></p>
<pre><code>public void forEach(Consumer<? super E> action) {
Objects.requireNonNull(action);
for (Object x : ... | <blockquote>
<p>Can using <code>foreach</code> of <code>CopyOnWriteArrayList</code> cause <code>ConcurrentModificationException</code> in java?</p>
</blockquote>
<p>No. You can see that from the code that it doesn't throw <code>ConcurrentModificationException</code>:</p>
<pre><code>public void forEach(Consumer<? s... | Can using foreach of CopyOnWriteArrayList cause ConcurrentModificationException in java? | java|concurrency|copyonwritearraylist | 0 | 60 | 1 | 72,305,613 | 72,305,613 | 3 | true | 2022-05-19T13:19:30.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can using foreach of CopyOnWriteArrayList cause ConcurrentModificationException in java?<p>I look to java 11 implementation of <code>.foreach</code> method i... |
72,263,833 | ggplot2 dual axes plot with character vector on secondary axis<p>I want to include a secondary y-axis in my coefficient plot. On the secondary axis, I want to display a var which contains the point estimates and their 95% CI. The examples I have seen so far work if the information on the secondary axis is numeric but m... | <p>Discrete scales don't support secondary axes, see <a href="https://github.com/tidyverse/ggplot2/issues/3171" rel="nofollow noreferrer">issue</a>. That said, you can work around it by using <code>ggh4x::guide_axis_manual()</code>. It's a bit of a pain where exactly the breaks should be though (I cheated by looking at... | ggplot2 dual axes plot with character vector on secondary axis | r|ggplot2 | 0 | 60 | 1 | 72,264,151 | 72,264,151 | 3 | true | 2022-05-16T18:17:39.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ggplot2 dual axes plot with character vector on secondary axis<p>I want to include a secondary y-axis in my coefficient plot. On the secondary axis, I want t... |
72,384,054 | How to fill null values using pandas reindex with multiple indexes?<p>I am trying to generate a set of summary statistics for each day in a dataset. Specifically, I want to know the percentage of time spent within, above, and below a certain range of values.</p>
<p>Starting example df:</p>
<pre><code>date ... | <p>In your 1st you can do <code>cut</code></p>
<pre><code>df['range'] = pd.cut(df.value,
bins = [0,54,70,180,250,np.inf],
labels = ['extreme low','low','in range','high','extreme high'])
</code></pre>
<p>For the 2nd</p>
<pre><code>out = pd.crosstab(df['date'].dt.date, df['range... | How to fill null values using pandas reindex with multiple indexes? | python|pandas | 1 | 60 | 2 | 72,384,271 | 72,384,271 | 4 | true | 2022-05-25T20:53:29.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fill null values using pandas reindex with multiple indexes?<p>I am trying to generate a set of summary statistics for each day in a dataset. Specific... |
72,308,299 | typing : how to get if a class attribute is of a type alias?<p>For example:</p>
<pre class="lang-py prettyprint-override"><code>import typing
tuple2 = typing.Tuple[float,float]
class A:
a: tuple2 = (1.,1.)
print(typing.get_type_hints(A)['a'])
</code></pre>
<p>This prints, as expected: <code>typing.Tuple[float, flo... | <p><code>tuple2</code> is just a variable that refers to <code>typing.Tuple[float,float]</code>. In general, you can't get the name of a variable based on its value, unless you do weird stuff with inspecting the variable namespace.</p>
<p>What you might want to do is use <code>typing.NewType</code> to define an actual... | typing : how to get if a class attribute is of a type alias? | python|typing | 2 | 60 | 1 | 72,308,376 | 72,308,376 | 4 | true | 2022-05-19T16:47:57.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
typing : how to get if a class attribute is of a type alias?<p>For example:</p>
<pre class="lang-py prettyprint-override"><code>import typing
tuple2 = typin... |
72,253,089 | How to create a nested dictionary comprehensions?<p>How to convert the following code into a nested comprehensions?</p>
<pre><code>new_dict = {'Accounts': 'lbl1', 'Inventory': 'lbl2', 'Manufacture': 'lbl3', 'PayRoll': 'lbl4', 'kannagu': 'lbl1', 'Saragu': 'lbl2', 'Thayarippu': 'lbl3', 'Sambalam': 'lbl4', 'F1': 'lbl1', ... | <p>Dictionary comprehensions are useful for creating a dictionaries compactly. They need to result in a new dictionary, and they shouldn't have side effects like printing values. This code doesn't create a dictionary, so they're not suitable here.</p>
<p>You actually don't need either of the loops. Both of them are jus... | How to create a nested dictionary comprehensions? | python|python-3.x | 0 | 60 | 3 | 72,253,125 | 72,253,125 | 4 | true | 2022-05-16T00:24:07.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a nested dictionary comprehensions?<p>How to convert the following code into a nested comprehensions?</p>
<pre><code>new_dict = {'Accounts': '... |
72,278,593 | Is this causing a dangling pointer when using map of pointers<p>This simple code generates a warning about "Object baking the pointer will be destroyed at the end of the full expression". What does that mean? Can I not use the object <code>entry</code> after I use <code>get_map</code>? And also why is this w... | <blockquote>
<p>Can I not use the object <code>entry</code> after I use <code>get_map</code>?</p>
</blockquote>
<p>No, you cannot.</p>
<pre><code>static std::map<std::string, int *> get_map()
</code></pre>
<p>returns a <strong>copy</strong> of the map.</p>
<pre><code>auto entry = get_map().find("HEY");
... | Is this causing a dangling pointer when using map of pointers | c++|c++17 | -2 | 60 | 1 | 72,278,662 | 72,278,662 | 5 | true | 2022-05-17T17:52:46.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is this causing a dangling pointer when using map of pointers<p>This simple code generates a warning about "Object baking the pointer will be destroyed ... |
72,325,988 | Does Rust define what happens when you cast a non-finite float to an integer?<p>I believe that traditionally, all degenerate floats are referred to as "NaN", but Rust seems to distinguish between three kinds of degenerate floats: +inf, -inf, and nan (that's why I use the term "non-finite" in the tit... | <p>This is defined in the Rust Reference <a href="https://doc.rust-lang.org/stable/reference/expressions/operator-expr.html#numeric-cast" rel="noreferrer">here</a> as:</p>
<blockquote>
<h2>Numeric cast</h2>
<p>Casting from a float to an integer will round the float towards zero</p>
<ul>
<li><p>NaN will return 0</p>
</l... | Does Rust define what happens when you cast a non-finite float to an integer? | rust | 4 | 60 | 1 | 72,326,090 | 72,326,090 | 7 | true | 2022-05-21T01:11:02.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does Rust define what happens when you cast a non-finite float to an integer?<p>I believe that traditionally, all degenerate floats are referred to as "... |
72,249,330 | Find value in array or object<p>I want to find a value in a array with a path.</p>
<p>Example:</p>
<pre><code>var object = {
"value1": [
{
"valueinarray": "myvalue"
}
]
}
</code></pre>
<pre><code>var ... | <p>comment from cmgchess was the solution</p>
<pre class="lang-js prettyprint-override"><code>const lodash = require("lodash")
lodash.get(object, path)
</code></pre> | Find value in array or object | javascript|arrays | 0 | 60 | 4 | 72,266,148 | 72,266,148 | -2 | true | 2022-05-15T14:44:23.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find value in array or object<p>I want to find a value in a array with a path.</p>
<p>Example:</p>
<pre><code>var object = {
"value1"... |
72,379,661 | pandas merge dataframes with same columns and reference its id<p>I have a problem with python pandas. I have serveral different dataframes which I want to split up into an SQLite Database. My first Dataframe <code>to_country</code>:</p>
<p><a href="https://i.stack.imgur.com/1F2ZY.png" rel="nofollow noreferrer"><img src... | <p>I solved it like that in the end:</p>
<pre><code>#Add Countries to Database
to_country = df[['country']]
to_country = to_country.rename(columns={'country': 'Name'})
to_country = to_country.drop_duplicates()
#Add Index to Country Dataframe
to_country = to_country.reset_index()
to_country = to_country.rename(columns={... | pandas merge dataframes with same columns and reference its id | python|pandas|dataframe | 0 | 60 | 2 | 72,380,853 | 72,380,853 | -1 | true | 2022-05-25T14:37:53.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas merge dataframes with same columns and reference its id<p>I have a problem with python pandas. I have serveral different dataframes which I want to sp... |
73,011,125 | Name for pattern of an object providing information about a held object<p>Is there a name for the pattern of instantiating an object holding another one and executing informative methods on the held object?</p>
<pre class="lang-golang prettyprint-override"><code>type Foo {
prop1 string
prop2 string
prop3 bo... | <p>In my view, this piece of code:</p>
<ul>
<li>is not using any pattern.</li>
<li>it is some sort of <a href="https://en.wikipedia.org/wiki/Pure_function" rel="nofollow noreferrer">pure functions</a></li>
<li>this code is auxiliary code which can be used in code where additional steps are required to create an object<... | Name for pattern of an object providing information about a held object | design-patterns | 1 | 60 | 1 | 73,020,236 | 73,020,236 | 1 | true | 2022-07-17T10:47:00.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Name for pattern of an object providing information about a held object<p>Is there a name for the pattern of instantiating an object holding another one and ... |
72,813,738 | How to add overlapping fill_between bounds on a line plot<p>I have two data frames - one data frame consists of all metric values on a monthly basis, and another one consists of lower and upper bounds for a given period.</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
# sample data
data1 = {'Me... | <ul>
<li>Given the data in the OP</li>
<li>All of the date columns in both dataframe must be <code>datetime64[ns] Dtype</code>, which can be done with <a href="https://pandas.pydata.org/docs/reference/api/pandas.to_datetime.html" rel="nofollow noreferrer"><code>pd.to_datetime</code></a> if necessary.</li>
<li>Plot <cod... | How to add overlapping fill_between bounds on a line plot | python|pandas|matplotlib|data-visualization | 1 | 60 | 1 | 72,817,389 | 72,817,389 | 1 | true | 2022-06-30T09:52:21.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add overlapping fill_between bounds on a line plot<p>I have two data frames - one data frame consists of all metric values on a monthly basis, and ano... |
72,830,782 | Python unittest Mock an object to not have an attribute<p>I have a function that runs some code if the object has a certain attribute, and in rare cases if if the object does not have the attribute, it runs different code. It is hard for me to create the object without the attribute for testing. I tried <code>del insta... | <p>You could try to use a <a href="https://docs.python.org/3/library/unittest.mock.html?highlight=patch#unittest.mock.PropertyMock" rel="nofollow noreferrer">PropertyMock</a> for the property, and generally you shall be able to set the respective side effect. Here is a simple working example:</p>
<pre class="lang-py pr... | Python unittest Mock an object to not have an attribute | python-unittest|python-unittest.mock | 0 | 60 | 1 | 72,841,069 | 72,841,069 | 1 | true | 2022-07-01T14:28:09.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python unittest Mock an object to not have an attribute<p>I have a function that runs some code if the object has a certain attribute, and in rare cases if i... |
72,779,749 | C(Linked List): Unable to do node->next->next(error: dereferencing pointer to incomplete type 'struct node') and being limited to only node->next<p>I am learning how to create my first linked list and trying different functions with popping/adding the first/last element from list.</p>
<p>When I try to pop the last item... | <p>Edit:</p>
<p>The compiler gives an error because there is a reference to <code>struct node</code> before it has been defined.</p>
<pre><code>typedef struct Node
{
int data;
struct node* addressOfNextNode; // <-- this is the error
} node;
</code></pre>
<p>In this statement, you haven't finished defining <... | C(Linked List): Unable to do node->next->next(error: dereferencing pointer to incomplete type 'struct node') and being limited to only node->next | c|linked-list | 2 | 60 | 1 | 72,779,911 | 72,779,911 | 1 | true | 2022-06-28T01:17:30.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C(Linked List): Unable to do node->next->next(error: dereferencing pointer to incomplete type 'struct node') and being limited to only node->next<p>I am lear... |
72,810,900 | How to compare two perl object values?<p>I need to compare two Perl object values, one is from a variable and another one is from an array value</p>
<p>ImmediateParent and data contain path directive values(C:\Users\Public\Documents)</p>
<pre><code>while (length(basename(dirname(($immediateParent)))) > 1)
{
$imm... | <p>If <a href="https://perldoc.pl/Data::Dumper" rel="nofollow noreferrer">Data::Dumper</a> shows</p>
<pre><code>$immediateParent = 'C:\\Users\\Public';
$dictionaryitem = 'C:\\Users\\Public';
</code></pre>
<p>then you should compare them directly without array dereference, i.e. remove the <code>->[0]</code>:</p>
<pr... | How to compare two perl object values? | perl|perlscript|fc | 0 | 60 | 1 | 72,812,729 | 72,812,729 | 1 | true | 2022-06-30T05:54:06.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to compare two perl object values?<p>I need to compare two Perl object values, one is from a variable and another one is from an array value</p>
<p>Immed... |
72,830,781 | How to operate with binary files faster?<p>What I'm trying to do:</p>
<ol>
<li>Open two binary files, each 64 MB</li>
<li>Take first half of each byte of each file and combine those halves in 1 bytes same with second half, for example: first byte in first file is 0x51, in second file its 0xA2, so I need write two bytes... | <p>The files are small enough to load into RAM for processing. Processing the data in RAM can minimise the disk I/O needed, the latter very often being the slowest part of a program, especially if it is done in very small pieces like individual bytes. As also <a href="https://stackoverflow.com/questions/72830781/how-to... | How to operate with binary files faster? | vb.net|performance|filestream|binarywriter | 0 | 60 | 1 | 72,833,672 | 72,833,672 | 1 | true | 2022-07-01T14:28:03.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to operate with binary files faster?<p>What I'm trying to do:</p>
<ol>
<li>Open two binary files, each 64 MB</li>
<li>Take first half of each byte of eac... |
72,774,322 | Sort of VLookup script deleting all the data in the column (Appscript, Gsheet)<p>Good afternoon,</p>
<p>I am currently developing a database on Google sheets that I am trying to populate with data from another GSheet using a script that acts sort of like a VLookup</p>
<p>I used the script from this comment : <a href="h... | <p><code>null</code> is set here, if <code>row[0]</code> is not in hash object:</p>
<blockquote>
<p>setValues(toCompArr.map(row => (row[0] in obj1 ? [obj1[row[0]]] : [null])));
}</p>
</blockquote>
<p>Get the column to set as <code>toColRng</code> and get it's values like to set in place of null:</p>
<pre><code>cons... | Sort of VLookup script deleting all the data in the column (Appscript, Gsheet) | javascript|google-apps-script|google-sheets | 0 | 60 | 1 | 72,776,249 | 72,776,249 | 1 | true | 2022-06-27T15:04:37.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort of VLookup script deleting all the data in the column (Appscript, Gsheet)<p>Good afternoon,</p>
<p>I am currently developing a database on Google sheets... |
72,962,416 | Calculate duration of gap in 24 hour time period loop<p>I'm trying to work out the duration of any gaps in a 24 hour time period that exist across all periods. In particular when the gap is between the start of the first boundary and the end of the last.</p>
<p>The example boundaries are as follows. The gap is from 23:... | <p>The problem is 23 is greater than 1.</p>
<p>I'm going to assume the wrap around means that a day has passed, so what you can do is when you detect a wrap around (i.e. <code>index+1 === array.length</code>) you can add 24 to <code>c</code> and <code>d</code>, unless <code>b</code> is midnight, then don't increase <co... | Calculate duration of gap in 24 hour time period loop | javascript | 0 | 60 | 1 | 72,963,407 | 72,963,407 | 1 | true | 2022-07-13T07:25:57.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculate duration of gap in 24 hour time period loop<p>I'm trying to work out the duration of any gaps in a 24 hour time period that exist across all period... |
72,974,575 | Search and get the first string and index from a string arrays in C<p>I need to get the first item from an string arrays in C, this is my code:</p>
<pre><code>#include <stdio.h>
#include <string.h>
int main() {
char *codes[16] = {
"VVVV", "VVVB", "VVBV", "VVBB... | <p>Your code has a buffer overflow, which is a very dangerous kind of <a href="https://en.cppreference.com/w/c/language/behavior" rel="nofollow noreferrer">undefined behaviour</a>.</p>
<p>The following line</p>
<pre><code>char code[4];
</code></pre>
<p>declares an array of char that can hold up to 3 characters <em>plus... | Search and get the first string and index from a string arrays in C | arrays|c|string|pointers|char | 1 | 60 | 1 | 72,977,621 | 72,977,621 | 1 | true | 2022-07-14T02:34:23.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search and get the first string and index from a string arrays in C<p>I need to get the first item from an string arrays in C, this is my code:</p>
<pre><cod... |
72,900,742 | Jest throws "Types of property 'id' are incompatible" error when it is trying to use stories from storybook using typescript<p>So..I am trying to use stories for my unit test with jest + RTL to minimize duplication (explained <a href="https://medium.com/storybookjs/testing-lib-storybook-react-8c36716fab86" rel="nofollo... | <p>You're trying to render the Story, not the Checkbox itself. Why not import the checkbox directly, but use the story args too?</p>
<pre><code>import * as React from 'react';
import { screen, render } from '@testing-library/react';
import AccountCheckbox from '../components/AccountCheckbox';
import { Default as Accoun... | Jest throws "Types of property 'id' are incompatible" error when it is trying to use stories from storybook using typescript | reactjs|typescript|jestjs|react-testing-library|storybook | 0 | 60 | 1 | 72,900,839 | 72,900,839 | 1 | true | 2022-07-07T15:43:13.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jest throws "Types of property 'id' are incompatible" error when it is trying to use stories from storybook using typescript<p>So..I am trying to use stories... |
73,024,618 | How to change chart's backgroundColor for specific dataset with onclick event using ChartJS<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>// Set Chart Global Variables
let x_value... | <p>You can use <a href="https://www.chartjs.org/docs/3.8.0/charts/line.html#segment" rel="nofollow noreferrer"><code>segment</code></a> styling that update dynamicly when you add new data:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pr... | How to change chart's backgroundColor for specific dataset with onclick event using ChartJS | javascript|html|arrays|charts|chart.js | 2 | 60 | 1 | 73,047,956 | 73,047,956 | 1 | true | 2022-07-18T15:11:22.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change chart's backgroundColor for specific dataset with onclick event using ChartJS<p><div class="snippet" data-lang="js" data-hide="false" data-cons... |
73,012,212 | creating a custom serializer for large data classes<p>I have a data class for a currency conversion rate response.</p>
<p>I keep getting this error: Rejecting invocation, expected 76 argument registers, method signature has 78 or more ...</p>
<p>as you can see below. (the <code>Conversion Rates</code> class has more t... | <p>There is a <a href="https://github.com/Kotlin/kotlinx.serialization/issues/632" rel="nofollow noreferrer">known bug</a> with the maximum number of fields supported by the automatic serialization routine.</p>
<p>Say you have a large data class (more than about 250 entries) to represent a nested object in a container ... | creating a custom serializer for large data classes | android|json|kotlin|serialization|ktor-client | 1 | 60 | 1 | 73,012,621 | 73,012,621 | 1 | true | 2022-07-17T13:33:03.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
creating a custom serializer for large data classes<p>I have a data class for a currency conversion rate response.</p>
<p>I keep getting this error: Rejecti... |
72,963,011 | Remote git branch changed to `main' but `master' in local submodule<p>I have a submodule repo, added to my project when the remote called its main branch <code>master</code>. Now they renamed it to <code>main</code> and when I try to pull I get error:</p>
<pre><code>Your configuration specifies to merge with the ref 'r... | <p>There is at least one <code>.gitmodules</code> file in your repository, and it should have something like</p>
<pre><code> [submodule "foo"]
path = bar
url = https://github.com/baz/foo
branch = master
</code></pre>
<p>If <code>branch</code> is not there, it defaults to <code>master</code>. You c... | Remote git branch changed to `main' but `master' in local submodule | git|git-submodules | 0 | 60 | 1 | 72,963,431 | 72,963,431 | 1 | true | 2022-07-13T08:18:36.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remote git branch changed to `main' but `master' in local submodule<p>I have a submodule repo, added to my project when the remote called its main branch <co... |
72,945,983 | Can you use the Array.prototype.find() to check against more than one condition to find something?<p>I am creating a calculator app in JS and I got it to work by using the mouse to click buttons on the screen so I am now integrating the use of the keyboard. Long story short, in part of my functionality before the keyb... | <p>Your conditions are messed up. This</p>
<pre><code>if (e !== 'Enter') {
return e
} else if (e !== '=') {
return e
}
</code></pre>
<p>will invariably result in one of those branches being fulfilled. If the first condition isn't fulfilled, then e is <code>'Enter'</code>, so <code>e !== '='</code> is fulfilled.... | Can you use the Array.prototype.find() to check against more than one condition to find something? | javascript|arrays|if-statement|conditional-statements | 0 | 60 | 2 | 72,945,999 | 72,945,999 | 1 | true | 2022-07-12T00:50:31.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you use the Array.prototype.find() to check against more than one condition to find something?<p>I am creating a calculator app in JS and I got it to wor... |
72,778,097 | System.InvalidOperationException:'Connection Property must not be null' in MySQL Connection<p>While Testing the project I came across the error <em><strong>"System.InvalidOperationException:'Connection property must be non-null</strong></em>.
Attempting to fix the error, I edited database values and re-defined ent... | <p>It's throw error because your command doesn't know which connection your command use. You need to pass your connection to your <code>MySqlCommand</code> when initialize.</p>
<pre><code>var cmd = new MySqlCommand("SELECT _Password FROM * WHERE email=" + enter_email);
cmd.Connection = connection; // <- ad... | System.InvalidOperationException:'Connection Property must not be null' in MySQL Connection | c#|mysql|xamarin.forms | 0 | 60 | 1 | 72,778,250 | 72,778,250 | 2 | true | 2022-06-27T20:44:48.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
System.InvalidOperationException:'Connection Property must not be null' in MySQL Connection<p>While Testing the project I came across the error <em><strong>&... |
72,813,077 | Can I insert a table name by using a query parameter?<p>I have an SQL Alchemy engine where I try to insert parameters via sqlalchemy.sql.text to protect against SQL injection.</p>
<p>The following code works, where I code variables for the condition and conditions values.</p>
<pre><code>from sqlalchemy import create_en... | <blockquote>
<p>Any ideas why this does not work?</p>
</blockquote>
<p>Query parameters are used to supply the <em>values</em> of things (usually column values), not the <em>names</em> of things (tables, columns, etc.). Every database I've seen works that way.</p>
<p>So, despite the ubiquitous advice that dynamic SQL i... | Can I insert a table name by using a query parameter? | python|sqlalchemy | 1 | 60 | 1 | 72,818,255 | 72,818,255 | 2 | true | 2022-06-30T09:03:36.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I insert a table name by using a query parameter?<p>I have an SQL Alchemy engine where I try to insert parameters via sqlalchemy.sql.text to protect agai... |
72,822,147 | How could I implement “HH:MM:SS” format<p>I am asked to do this:</p>
<p>Write a program that adds one second to a clock time, given its hours, minutes and seconds.</p>
<p>Input consists of three natural numbers h, m and s that represent a clock time, that is, such that h<24, m<60 and s<60.</p>
<p>This is the c... | <p>Usually, you don't want to deal with calculating date and time yourself, so a better approach is to use the <a href="https://docs.python.org/3/library/datetime.html" rel="nofollow noreferrer">native library</a> that works with date and time out of the box:</p>
<pre class="lang-py prettyprint-override"><code>from dat... | How could I implement “HH:MM:SS” format | python | 2 | 60 | 3 | 72,822,304 | 72,822,304 | 2 | true | 2022-06-30T21:19:14.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How could I implement “HH:MM:SS” format<p>I am asked to do this:</p>
<p>Write a program that adds one second to a clock time, given its hours, minutes and se... |
72,818,704 | How can use Ef Core Migration for JetBrains Rider<p>I'm using JetBrains Rider IDE. I want use code first but I can't find Package Manager Console in JetBrains Rider. I want to work on EF Core.</p> | <p>Package Manager Console is a feature of Visual Studio. You cannot use these tools in Rider.</p>
<p>You need to install an extension to the dotnet CLI instead:</p>
<pre><code>dotnet tool install --global dotnet-ef
</code></pre>
<p>Then you can execute commands using <code>dotnet ef</code>.</p>
<p>Here is the document... | How can use Ef Core Migration for JetBrains Rider | entity-framework-core|migration|jetbrains-ide|jetbrains-rider | 0 | 60 | 2 | 72,827,650 | 72,827,650 | 2 | true | 2022-06-30T15:52:02.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can use Ef Core Migration for JetBrains Rider<p>I'm using JetBrains Rider IDE. I want use code first but I can't find Package Manager Console in JetBrain... |
72,835,344 | CS50 readability error: expected expression in C when using ! operator on a while loop<pre><code>#include <cs50.h>
#include <stdio.h>
int count_letters (string text);
int main(void)
{
string text = get_string("Text: ");
printf("%i\n", count_letters (text));
}
int count_lette... | <p>You can't combine multiple comparisons like that. You need to write each comparison separately, and combine them with a logical operator.</p>
<pre><code>int count_letters (string text)
{
int i = 0;
while (text [i] ! = '\0' && text[i] != '!' && text[i] != '?' && text[i] != '.')
... | CS50 readability error: expected expression in C when using ! operator on a while loop | c|cs50 | -1 | 60 | 1 | 72,835,370 | 72,835,370 | 2 | true | 2022-07-01T23:12:20.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CS50 readability error: expected expression in C when using ! operator on a while loop<pre><code>#include <cs50.h>
#include <stdio.h>
int count_... |
72,837,408 | Passing a templated function as argument without instantiation?<p>I've been doing some exercises in C++ and stumbled upon one, it was about creating a simple a templated function iterator that takes an array of any type and another templated function to do some processing in each element in the array, i've completed th... | <p>Yes, you are correct. A function template cannot be passed as a template argument because it does not have a type yet.</p>
<p>What you can pass is a functor, either custom one with overloaded <code>operator()</code> or just a lambda. Are you sure the wording does not talk about functors?</p>
<p>The following code wo... | Passing a templated function as argument without instantiation? | c++|templates|function-templates | 0 | 60 | 2 | 72,837,533 | 72,837,533 | 2 | true | 2022-07-02T07:48:54.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing a templated function as argument without instantiation?<p>I've been doing some exercises in C++ and stumbled upon one, it was about creating a simple... |
72,848,824 | Compare rankings using the Spearman Rho coefficient<p>I would like to compare the ranking results of Methods 2, 3 and 4 with Method 1. In this regard, I would like to use the Spearman Rho coefficient. I would also like to know if a significant relationship between the results of methods 2, 3 and 4 with method 1. So how... | <p>Using <code>summarise</code> with <code>across</code></p>
<pre><code>library(dplyr)
database %>%
summarise(across(Method2:Method4, ~cor.test(., Method1, method = "spearman")$estimate))
Method2 Method3 Method4
1 0.8787879 0.9272727 0.9030303
</code></pre> | Compare rankings using the Spearman Rho coefficient | r | 2 | 60 | 3 | 72,849,156 | 72,849,156 | 2 | true | 2022-07-03T18:05:48.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare rankings using the Spearman Rho coefficient<p>I would like to compare the ranking results of Methods 2, 3 and 4 with Method 1. In this regard, I woul... |
72,854,452 | Python | while is repeating old data, even if False<p>I'm trying to create a loop if the condition is not met. If it is met at minimum second run, the print from my last run is also in my output, like in the example its printing the same print() that was printed in the previous run in addition to the result of the seco... | <p>This control flow does not make any sense. Please keep in mind that calling a function is <strong>not at all like</strong> telling the code to "go here next". It is a <em>request to compute a result</em>, which you will then <em>use in the current context</em>. It is also important to understand that each ... | Python | while is repeating old data, even if False | python|python-3.x|while-loop | 1 | 60 | 1 | 72,855,082 | 72,855,082 | 2 | true | 2022-07-04T09:22:24.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python | while is repeating old data, even if False<p>I'm trying to create a loop if the condition is not met. If it is met at minimum second run, the print ... |
72,860,949 | Rename a Column name in a specific Table in SQL from Python<p>I'm trying to rename a column name in SQL-Server from Python.</p>
<h3>Code</h3>
<pre class="lang-py prettyprint-override"><code>def ModifeingColumnName():
try:
myconn = mysql.connector.connect(host ="localhost" , user = "root"... | <p>you can use it like this:</p>
<pre><code># Establish connection to MySQL database
import mysql.connector
db = mysql.connector.connect(
host="localhost", # your host
user="root", # your username
password="root123", # your password
database = "meow" # name of the data... | Rename a Column name in a specific Table in SQL from Python | python|sql | 0 | 60 | 1 | 72,861,004 | 72,861,004 | 2 | true | 2022-07-04T18:51:03.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rename a Column name in a specific Table in SQL from Python<p>I'm trying to rename a column name in SQL-Server from Python.</p>
<h3>Code</h3>
<pre class="lan... |
72,864,973 | TypeError: Cannot read property 'toUpperCase' of undefined |CodeWars|<p>So, here is the kata:</p>
<p>Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized (known as Upper Camel ... | <p>In codewars the first test case that they provide is an empty string. Therefore array.from("")[0] will produce undefined and cause the error later on. This can be avoid by checking if the string is empty and returning it if it is. I would suggest to always look for edge cases that are described in the task... | TypeError: Cannot read property 'toUpperCase' of undefined |CodeWars| | javascript|visual-studio-code|typeerror|codewarrior | 0 | 60 | 4 | 72,865,049 | 72,865,049 | 2 | true | 2022-07-05T06:40:48.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: Cannot read property 'toUpperCase' of undefined |CodeWars|<p>So, here is the kata:</p>
<p>Complete the method/function so that it converts dash/un... |
72,871,282 | Is the std::vector copied or moved in this case?<p>In the following code which implements the Viterbi algorithm: (<a href="https://en.wikipedia.org/wiki/Viterbi_algorithm#Pseudocode" rel="nofollow noreferrer">Wikipedia link</a>)</p>
<pre><code>std::pair<std::vector<index_t>, float> viterbi_get_optimal_path(... | <p>Assuming C++17 or later, it will be copied once if the function returns via <code>return {seq, prob};</code> and moved once if it returns via <code>return {std::vector<index_t>({curr_index}), 1.0f};</code>.</p>
<p>You can avoid the copy, by explicitly moving in the return statement:</p>
<pre><code>return {std:... | Is the std::vector copied or moved in this case? | c++ | 2 | 60 | 1 | 72,871,485 | 72,871,485 | 2 | true | 2022-07-05T14:39:35.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is the std::vector copied or moved in this case?<p>In the following code which implements the Viterbi algorithm: (<a href="https://en.wikipedia.org/wiki/Vite... |
72,873,914 | Google Sheets Less than or equal (<=) provide wrong result<p>Formula <code>0<=(1.36*100/1.36)-100</code> returns FALSE while expects TRUE.</p>
<p>But</p>
<p><code>0<=(1.26*100/1.26)-100</code> returns correct result TRUE.
Why?</p> | <p>if you run:</p>
<pre><code>=(1.36*100/1.36)-100
</code></pre>
<p>and expand decimal places you will get:</p>
<p><a href="https://i.stack.imgur.com/gCd6U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gCd6U.png" alt="enter image description here" /></a></p>
<p>which is totally fine even if you do ... | Google Sheets Less than or equal (<=) provide wrong result | google-sheets|floating-point|google-sheets-formula|rounding|precision | 1 | 60 | 1 | 72,874,095 | 72,874,095 | 2 | true | 2022-07-05T18:20:16.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheets Less than or equal (<=) provide wrong result<p>Formula <code>0<=(1.36*100/1.36)-100</code> returns FALSE while expects TRUE.</p>
<p>But</p>
... |
72,874,076 | rootBundle.loadString does not read the whole text in file<p>I have a file named <strong>A#</strong> in the assets folder.</p>
<p>When i read its content with <strong>rootBundle.loadString</strong> not all the data is read.</p>
<p>This is the files content</p>
<blockquote>
<p>Lorem ipsum dolor sit amet, consetetur sadi... | <p>When i used <strong>debugPrint</strong> instead of <strong>print</strong> all the text was shown.</p>
<p>There was no problem with <strong>rootBundle.loadString</strong>, but the print command has its limit.</p> | rootBundle.loadString does not read the whole text in file | flutter|assets|readfile | 0 | 60 | 1 | 72,874,141 | 72,874,141 | 2 | true | 2022-07-05T18:33:43.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rootBundle.loadString does not read the whole text in file<p>I have a file named <strong>A#</strong> in the assets folder.</p>
<p>When i read its content wit... |
72,882,382 | Join many to one: combine related characteristics<p>I have a dataframe where each row represents a spatial unit. The nbid* variables indicate which unit is a neighbour. I would like to get the <em>dum</em> variable of the neighbour into the main dataframe. (Instead of spatial units it could be any kind of relations wit... | <p>A key clue is that when you see <code>var_1, var_2, ..., var_n</code>, it suggests that the data can be transformed to be longer. See <code>pivot_longer()</code> or <code>data.table::melt()</code> where <code>molten</code> data is discussed frequently.</p>
<p>For your example, we can pivot and then join the <code>df... | Join many to one: combine related characteristics | r|data-manipulation | 5 | 60 | 2 | 72,883,088 | 72,883,088 | 2 | true | 2022-07-06T10:58:59.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Join many to one: combine related characteristics<p>I have a dataframe where each row represents a spatial unit. The nbid* variables indicate which unit is a... |
72,879,788 | Why I am not able to change the state of my react component the second time and got no error<p><a href="https://i.stack.imgur.com/e5a1D.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e5a1D.gif" alt="enter image description here" /></a></p>
<p>I have a currency dropdown menu when click appear and whe... | <p><code>handleClickOutside = (event)</code> is being triggered also when clicking inside the icon.</p>
<p>When both <code>handleClickOutside = (event)</code> and <code>const handleCurrencyActive = ()</code> are being triggered at the same time you end up with the same initial state.</p>
<p>You can change the logic of ... | Why I am not able to change the state of my react component the second time and got no error | javascript|reactjs|react-hooks | 1 | 60 | 3 | 72,885,758 | 72,885,758 | 2 | true | 2022-07-06T07:56:28.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why I am not able to change the state of my react component the second time and got no error<p><a href="https://i.stack.imgur.com/e5a1D.gif" rel="nofollow no... |
72,878,613 | Passing unit8 to pcl::Passthrough<p>I have a customized <code>PointXYZB</code> with fields <code>x</code>, <code>y</code>, <code>z</code>, and <code>beam</code> in <code>pcl</code>. <code>x</code>, <code>y</code>, <code>z</code> are float and <code>beam</code> is unit8 with either value equals to 0 or 1. I have registe... | <p>I just checked, <code>PassThrough</code> only works for fields of type float: <a href="https://github.com/PointCloudLibrary/pcl/blob/master/filters/include/pcl/filters/impl/passthrough.hpp#L101" rel="nofollow noreferrer">https://github.com/PointCloudLibrary/pcl/blob/master/filters/include/pcl/filters/impl/passthroug... | Passing unit8 to pcl::Passthrough | ros|point-cloud-library | 1 | 60 | 1 | 72,888,807 | 72,888,807 | 2 | true | 2022-07-06T06:05:28.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing unit8 to pcl::Passthrough<p>I have a customized <code>PointXYZB</code> with fields <code>x</code>, <code>y</code>, <code>z</code>, and <code>beam</co... |
72,905,655 | Specifying a range inside an if condition in C language<p>I just want to know the difference between these C code segments. I used it in two different ways and final output was not same.</p>
<pre><code>if(120<=units<160){
total= total- total*(15.0/100);
printf("Revenue : %.2f", total);
... | <p>No, you can't test ranges in this way. What's happening here is the operators are evaluated left-to-right as per <a href="https://en.cppreference.com/w/c/language/operator_precedence" rel="nofollow noreferrer">operator precedence</a>.</p>
<p>So this means: <code>(120 <= units) < 160</code></p>
<p>The value of ... | Specifying a range inside an if condition in C language | c|if-statement|range | 1 | 60 | 3 | 72,905,688 | 72,905,688 | 2 | true | 2022-07-08T01:00:10.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specifying a range inside an if condition in C language<p>I just want to know the difference between these C code segments. I used it in two different ways a... |
72,858,721 | Error "No such device or address" from child_process.exec, pipe helps. Why?<p>I'm using <code>child_process.exec</code> to execute various <a href="https://manpages.debian.org/bullseye/quilt/quilt.1.en.html" rel="nofollow noreferrer">quilt</a> commands and capture their output. This works fine so far for all commands e... | <p>This line of your <code>strace</code> output is the smoking gun:</p>
<pre class="lang-none prettyprint-override"><code>[pid 23320] openat(AT_FDCWD, "/dev/stdout", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 ENXIO (No such device or address)
</code></pre>
<p>Now notice these errors listed by <a href="htt... | Error "No such device or address" from child_process.exec, pipe helps. Why? | node.js|pipe|stdout|child-process|quilt | 2 | 60 | 1 | 72,906,798 | 72,906,798 | 2 | true | 2022-07-04T15:02:29.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error "No such device or address" from child_process.exec, pipe helps. Why?<p>I'm using <code>child_process.exec</code> to execute various <a href="https://m... |
72,913,437 | replace values in a pandas df column if they appear in another column<p>I have a pandas dataframe and would like to replace words in column <code>something</code> if they are the same as column <code>to_hide</code>. So I'd like to go from here</p>
<pre><code> to_hide something
0 bla there is bl... | <p>You need to use a loop here:</p>
<pre><code>df['something'] = [s.replace(pat, 'to_hide')
for pat, s in zip(df['to_hide'], df['something'])]
</code></pre>
<p>output (as new column for clarity):</p>
<pre><code> to_hide something something2
0 bla there is bl... | replace values in a pandas df column if they appear in another column | python|pandas|string|replace | 1 | 60 | 2 | 72,913,494 | 72,913,494 | 2 | true | 2022-07-08T15:07:04.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
replace values in a pandas df column if they appear in another column<p>I have a pandas dataframe and would like to replace words in column <code>something</... |
72,933,156 | Is there any risk if I call clear when loop a vector?<p>I want to call <code>clear</code> when loop to visit the <code>vector</code>. I think this will be dangerous, but in my experiment code below, it seems ok to run, it just stop the loop when i called <code>clear</code>.</p>
<pre><code>#include <bits/stdc++.h>... | <p>There is a very, very major temptation that when you have a loop that looks like this:</p>
<pre><code>for (size_t i = 0; i < a.size(); ++i) {
</code></pre>
<p>then you will be under the impression that looking at <code>a[i]</code> and/or modifying it, freely, inside the loop, whenever you have an urge to do so, i... | Is there any risk if I call clear when loop a vector? | c++|stl | 1 | 60 | 1 | 72,933,186 | 72,933,186 | 2 | true | 2022-07-11T02:23:22.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any risk if I call clear when loop a vector?<p>I want to call <code>clear</code> when loop to visit the <code>vector</code>. I think this will be da... |
72,934,623 | CSS Flex items not filling container<p>Struggling to get the flex items inside the calculator to fill the parent.
Have been messing with so many declarations i'm going crazy.</p>
<p>Thought it was maybe because I didnt have flex-wrap set properly.. however that didn't seem to fix the issue.
Any advice on where to start... | <p>Try this code.
I just added <code>width: 100% and height: 100%</code>, and set height <code>20%</code> to <code>.screen</code> class element relative to <code>.calculator</code> class element. and, added <code>box-sizing: border-box</code> as universal style.</p>
<p><div class="snippet" data-lang="js" data-hide="fal... | CSS Flex items not filling container | html|css|flexbox | 0 | 60 | 1 | 72,934,765 | 72,934,765 | 2 | true | 2022-07-11T06:42:49.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS Flex items not filling container<p>Struggling to get the flex items inside the calculator to fill the parent.
Have been messing with so many declarations... |
72,954,220 | How to reduce size of docker image by removing files and comitting<p>I have created a docker image and started installing many packages I needed for some tests.</p>
<p>However, after I was done, I realized I could remove some folders in order to reduce image size.</p>
<p>So that's what I did, and I commited those chang... | <p>yes, you should start from scratch. The initial layers are indeed adding content to your image, as the existing answer notes.</p>
<p>If you kept your <code>Dockerfile</code>, you should be able to just replay the changes you made to your original image. This is a key way of working with Docker. The outcome of a buil... | How to reduce size of docker image by removing files and comitting | docker | 0 | 60 | 1 | 72,954,292 | 72,954,292 | 2 | true | 2022-07-12T14:45:36.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce size of docker image by removing files and comitting<p>I have created a docker image and started installing many packages I needed for some tes... |
72,955,005 | x axis label cropped on saved image<p>So I'm trying to do a bar plot on a data where <code>x</code> is the username (string ) and each <code>x</code> is long enough to overlap each other, so I have to rotate the <code>x</code> label. No problem there. However, when exporting the plot results, the <code>x</code> label o... | <p>You can play around with the rcParams size settings and the <code>plt.subplots_adjust</code> settings until you get your desired image.</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
x= ['abc', 'ronaldo', 'melon_killer_123456']
y= [1, 2, 3]
plt.rcParams["figure.figsize"... | x axis label cropped on saved image | python|matplotlib|plot|data-visualization|savefig | 1 | 60 | 2 | 72,955,150 | 72,955,150 | 2 | true | 2022-07-12T15:43:01.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
x axis label cropped on saved image<p>So I'm trying to do a bar plot on a data where <code>x</code> is the username (string ) and each <code>x</code> is long... |
72,959,776 | How to join strings conditionally without using let in javascript<p>I have a situation where I'm trying to join the array of strings only if it has a value. I did using let variable, but I wonder can I do this using map. I'm very mindful on the position, so I used in this way.</p>
<p><div class="snippet" data-lang="js"... | <p>If you put the hours, minutes, and seconds back into an array, you can make another array for the suffixes, add the suffixes by mapping the values, then filter out the resulting substrings that are 1 character or less (which would indicate that there wasn't a corresponding value).</p>
<p><div class="snippet" data-la... | How to join strings conditionally without using let in javascript | javascript|string | 1 | 60 | 3 | 72,959,799 | 72,959,799 | 2 | true | 2022-07-13T00:49:50.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to join strings conditionally without using let in javascript<p>I have a situation where I'm trying to join the array of strings only if it has a value. ... |
72,967,256 | Primefaces ajax event contextMenu causes default right click menu to show<p>I have a fairly simple <code><p:dataTable></code> in which I list some person data. The users should be able to add and remove persons. However, I have an issue with setting the <code>selection</code> value.</p>
<p>Let me show you what I ... | <p>Fixed for 12.0.0: <a href="https://github.com/primefaces/primefaces/issues/8376" rel="nofollow noreferrer">https://github.com/primefaces/primefaces/issues/8376</a></p>
<p><strong>MonkeyPatch (just add to your application JS file):</strong></p>
<pre class="lang-js prettyprint-override"><code>if (PrimeFaces.widget.Dat... | Primefaces ajax event contextMenu causes default right click menu to show | ajax|jsf|primefaces|contextmenu | 2 | 60 | 1 | 72,970,057 | 72,970,057 | 2 | true | 2022-07-13T13:35:52.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Primefaces ajax event contextMenu causes default right click menu to show<p>I have a fairly simple <code><p:dataTable></code> in which I list some pers... |
72,987,980 | Importing test in clojure<p><code>deps.edn</code>:</p>
<pre><code>{:paths ["test" "src"]
:deps
{clojure.java-time/clojure.java-time {:mvn/version "0.3.2"}}}
</code></pre>
<p>in <code>doppelkopf/test/</code></p>
<pre><code>(ns doppelkopf.core-test
(:require
[clojure.test :as test]
... | <p>Your project structure and/or your namespace names are off.</p>
<p>Your Project is in <code>$HOME/ClojureProjects/doppelkopf</code> (I'll use <code>$P</code> for
that from here on), where (hopefully) your <code>deps.edn</code> resides. Then
from there you have added <code>src</code> and <code>test</code> as source ... | Importing test in clojure | clojure | 0 | 60 | 1 | 72,989,739 | 72,989,739 | 2 | true | 2022-07-15T00:48:30.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Importing test in clojure<p><code>deps.edn</code>:</p>
<pre><code>{:paths ["test" "src"]
:deps
{clojure.java-time/clojure.java-time {:m... |
73,001,611 | Pull multiple xpath values into a single cell using IMPORTXML in Google Sheets<p>I am trying to pull the price from <a href="https://www.samsclub.com/p/purina-cat-chow-indoor-dry-cat-food-hairball-healthy-weight/P03003663?xid=plp_product_1" rel="nofollow noreferrer">Sam's Club's website</a> into a spreadsheet (for groc... | <p>I believe your goal is as follows.</p>
<ul>
<li>You want to retrieve the value of <code>22.98</code> from the URL of <code>https://www.samsclub.com/p/purina-cat-chow-indoor-dry-cat-food-hairball-healthy-weight/P03003663?xid=plp_product_1</code> using <code>IMPORTXML</code>.</li>
</ul>
<p>In this case, how about the ... | Pull multiple xpath values into a single cell using IMPORTXML in Google Sheets | google-sheets|google-sheets-formula | 2 | 60 | 1 | 73,001,732 | 73,001,732 | 2 | true | 2022-07-16T04:50:17.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pull multiple xpath values into a single cell using IMPORTXML in Google Sheets<p>I am trying to pull the price from <a href="https://www.samsclub.com/p/purin... |
73,007,747 | JSON.parse error (Unexpected token) with escaped string<p>As you can see, the special characters are escaped in the string. But it gives error.
The error is related to <strong>description</strong> part</p>
<pre><code>...Adam Goldberg delivers \"an uproarious study...
^
</code></pre>
<p><... | <p>Doing <code>let str = `...`</code> turns <code>\"</code> to just <code>"</code>. That's why you're getting an error.</p>
<p>Try <code>let str = String.raw`...`</code>. Works for me</p> | JSON.parse error (Unexpected token) with escaped string | javascript|json | 0 | 60 | 1 | 73,007,797 | 73,007,797 | 2 | true | 2022-07-16T21:26:11.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSON.parse error (Unexpected token) with escaped string<p>As you can see, the special characters are escaped in the string. But it gives error.
The error is ... |
73,021,126 | Why VS Code autocomplete doesn't suggest .value attribute when working with Java Script file?<p><strong>HTML:</strong></p>
<pre class="lang-html prettyprint-override"><code> <body>
<h1>Grocery List</h1>
<form action="/nowhere">
<label for="item">Enter A P... | <p><code>Document.querySelector()</code> returns a <code>Element</code>, so the editor cannot know that it has a <code>value</code>.</p>
<p>If you would create the element by javascript, then the editor DOES know...</p>
<pre><code>let input = document.createElement("input")
let test = input.value // now you c... | Why VS Code autocomplete doesn't suggest .value attribute when working with Java Script file? | javascript|visual-studio-code | 0 | 60 | 1 | 73,022,001 | 73,022,001 | 2 | true | 2022-07-18T10:49:26.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why VS Code autocomplete doesn't suggest .value attribute when working with Java Script file?<p><strong>HTML:</strong></p>
<pre class="lang-html prettyprint-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.