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,770,734 | How to stop second foreach from looping more than once<p>I have an query which select all ids from a table. Once I have all id's, they are stored in an array which I foreach over.</p>
<p>Then there is an second array which pull data from url (around 5k rows) and should update DB based on the id's.</p>
<p>The problem - ... | <p>Since the question is aboot using a loop, we will talk about the loop, instead of trying to find another way. <strong>Actually, I see no reason to find another way.</strong></p>
<p>-><em>Loops and recursions are great, powerful tools. As usually, with great tools, you need to also find ways of controlling them.
S... | How to stop second foreach from looping more than once | php | 0 | 53 | 1 | 72,771,124 | 72,771,124 | 2 | true | 2022-06-27T10:39:30.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to stop second foreach from looping more than once<p>I have an query which select all ids from a table. Once I have all id's, they are stored in an array... |
73,015,950 | How do I change a key's value to that of another key's value if the value is the name of another key?<p>To explain what I mean, I'm adding keys and values to a dictionary but if a key in the dictionary has a value that's the name of another key, I want that key to be assigned the other key's value. For example, if I ha... | <p>You can use:</p>
<pre><code>my_dict = {"a": 100, "b": 200, "c": "a"}
for k, v in my_dict.items():
if v in my_dict:
my_dict[k] = my_dict[v]
</code></pre>
<p>You can alternatively use a dict comprehension:</p>
<pre><code>result = {
k: my_dict[v] if v in my_dict e... | How do I change a key's value to that of another key's value if the value is the name of another key? | python|dictionary | 1 | 53 | 1 | 73,015,974 | 73,015,974 | 2 | true | 2022-07-17T23:05:50.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I change a key's value to that of another key's value if the value is the name of another key?<p>To explain what I mean, I'm adding keys and values to... |
72,910,506 | beautifulsoup problems extracting a table<p>It's literally my first time using <code>BeautifulSoup</code>, and I'm having trouble extracting the table I want to work with ([https://ansm.sante.fr/disponibilites-des-produits-de-sante/medicaments]). I want to extract the table <code>table table-products sortable searchabl... | <p>There must be something wrong with the CSS class filter, <strong>without it works</strong>:</p>
<pre><code>table = soup.find("table")
table_data = table.tbody.find_all("tr")
</code></pre>
<p>Add the class filter back but <strong>remove the trailing space</strong>:</p>
<pre><code>table = soup.find... | beautifulsoup problems extracting a table | python|beautifulsoup | -1 | 53 | 3 | 72,910,651 | 72,910,651 | 2 | true | 2022-07-08T11:08:12.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
beautifulsoup problems extracting a table<p>It's literally my first time using <code>BeautifulSoup</code>, and I'm having trouble extracting the table I want... |
72,874,213 | How to get sum of List element by group<p>I have list of Cars <CarsName, Price>. I need to make some logic in method named <strong>sumOfPrice</strong>, but I have no idea how to do that. Please help or give some sugestion.</p>
<pre><code>//file Car.class
class Car {
private String name;
private double pr... | <pre><code>public Map<String, Double> sumOfPrice(List<Car> cars) {
Map<String, Double> sum = new HashMap<String, Double>();
for (Car car : cars) {
if(sum.containKey(car.getName()) { // Checkes if car already exists in sum.
sum.put(car.getName(), sum.get(car.getName())... | How to get sum of List element by group | java | -4 | 53 | 1 | 72,874,626 | 72,874,626 | 2 | true | 2022-07-05T18:48:09.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get sum of List element by group<p>I have list of Cars <CarsName, Price>. I need to make some logic in method named <strong>sumOfPrice</strong>... |
72,789,942 | Can two models reference each other by ForeignKey?<p>I have two models</p>
<pre><code>class Customer(models.Model):
name = models.CharField(max_length=255, unique=True)
default_contact = models.ForeignKey("CustomerContact", verbose_name="...", related_name="default_contacts", null=... | <p>As I can see you want to have many <code>CustomerContact</code> related to one <code>Customer</code>, but <code>Customer</code> can also pick his favourite (or one can be set by manager). It's valid approach.</p>
<p>It can go both ways, as long as you will secure <code>related_name</code>s properly.</p>
<pre><code>d... | Can two models reference each other by ForeignKey? | django|django-models|foreign-keys | 2 | 53 | 1 | 72,790,034 | 72,790,034 | 2 | true | 2022-06-28T16:14:42.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can two models reference each other by ForeignKey?<p>I have two models</p>
<pre><code>class Customer(models.Model):
name = models.CharField(max_length=25... |
72,810,722 | Python login program using textfiles<p>Im new to python and I'm trying to code a python login program. Instead of printing out "Welcome to the database" when the username provided is correct, it printed out both "Welcome to the database" and "Username invalid. Please try again.". May I kn... | <p>You are looping through all the users in the text file and for each of them printing to the console. The thing you probably want could be done like this:</p>
<pre><code>def login():
while True:
loginSucessful = False
name = input("Name: ")
with open('username.txt', "r"... | Python login program using textfiles | python | 0 | 53 | 2 | 72,810,788 | 72,810,788 | 2 | true | 2022-06-30T05:33:08.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python login program using textfiles<p>Im new to python and I'm trying to code a python login program. Instead of printing out "Welcome to the database&... |
72,826,402 | How to detect missing year in time series data in R?<p>Let's say we have column with the following years:</p>
<pre><code>2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020, 2021, 2022
</code></pre>
<p>Now I need a code which will identify which years is missing (2016 in this case)</p> | <p>You could use <code>setdiff()</code>.</p>
<pre class="lang-r prettyprint-override"><code>setdiff(seq(min(x), max(x)), x)
# [1] 2016
</code></pre>
<h5>Data</h5>
<pre class="lang-r prettyprint-override"><code>x <- c(2012,2013,2014,2015,2017,2018,2019,2020,2021,2022)
</code></pre>
<hr />
<h5>Update</h5>
<p>According... | How to detect missing year in time series data in R? | r|loops|for-loop|dplyr | 0 | 53 | 4 | 72,826,468 | 72,826,468 | 2 | true | 2022-07-01T08:24:03.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to detect missing year in time series data in R?<p>Let's say we have column with the following years:</p>
<pre><code>2012, 2013, 2014, 2015, 2017, 2018, ... |
72,782,069 | Vue: V-if with condition<p>in my vue application I have following code:</p>
<pre><code><div v-if="partner == true && kids == false" class="row">
<input type="text" id="testInput">
</div>
</code></pre>
<p>Now when I want to try out this code snippet it... | <p>Your code is fine:</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>new Vue({
el: "#demo",
data() {
return {
partner: true,
kids: false
}
}
})</code... | Vue: V-if with condition | javascript|html|vue.js|vuejs2 | 0 | 53 | 1 | 72,782,174 | 72,782,174 | 3 | true | 2022-06-28T07:08:27.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue: V-if with condition<p>in my vue application I have following code:</p>
<pre><code><div v-if="partner == true && kids == false" clas... |
72,796,373 | Why does my code freeze when using for loop but not specified number loop?<p>I figured it out but it sure took me 4 hours. It never caused any errors so I used the debug feature which wasn't much help. Since there was no error I'm unsure what else to look up before I ask my question.</p>
<pre><code>for (var i = 0; i &l... | <p>The problem with your code is that you aren't assigning the value to <code>i</code> again.</p>
<p>When you write <code>i++</code> you basically write a shorthand version of <code>i = i + 1</code>. In your code you write <code>i + 7</code> which doesn't do anything and basically is an infinite loop. You should have w... | Why does my code freeze when using for loop but not specified number loop? | javascript|node.js|for-loop|while-loop | -3 | 53 | 2 | 72,796,409 | 72,796,409 | 3 | true | 2022-06-29T05:50:27.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my code freeze when using for loop but not specified number loop?<p>I figured it out but it sure took me 4 hours. It never caused any errors so I us... |
72,809,616 | Unnest hierarchy json with python?<p>I have a JSON like this:</p>
<pre><code>{
"department":"Data & Analytics",
"child":[
{
"department":"Data Enginnering",
"child": [
{"department":"AW... | <p>For a non-recursive approach, you can use the standard breadth-first traversal of using a queue and pushing the children into it.</p>
<pre><code>from collections import deque
def flatten(data):
q = deque([data])
while q:
current = q.popleft()
d = {"department": current['department... | Unnest hierarchy json with python? | python|json | 1 | 53 | 2 | 72,809,812 | 72,809,812 | 3 | true | 2022-06-30T02:09:26.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unnest hierarchy json with python?<p>I have a JSON like this:</p>
<pre><code>{
"department":"Data & Analytics",
"child&q... |
72,819,819 | SwiftUI - Update body only once when @EnviromentObject and @State changes<p>I have created this example project replicating my app architecture, in which a random number is generated in a <code>Manager</code> class and then displayed in the <code>SecondaryView</code>. Inside this view, calculations need to be made base... | <p>You have two "source of truth" changed, so two updates. So make one - <code>manager.randomNumber</code> as it is really so, and everything else should be just based on it.</p>
<p>This exact case can be fixed by making <code>randomNumberTimesTen</code> calculable instead of state, like</p>
<pre><code>struct... | SwiftUI - Update body only once when @EnviromentObject and @State changes | ios|macos|swiftui | 1 | 53 | 1 | 72,820,015 | 72,820,015 | 3 | true | 2022-06-30T17:29:19.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI - Update body only once when @EnviromentObject and @State changes<p>I have created this example project replicating my app architecture, in which a r... |
72,832,521 | is it safe to use std::move_iterator in std algorithm with lambda as pred<pre><code>std::vector<std::string> foo{"a","b","c"};
std::set<std::string> check{"a"};
std::vector<std::string> bar{"something_here"};
typedef std::vector<std::string>::ite... | <blockquote>
<p>Is it because although string is passed into lambda as rvalue, it was not used to construct another string, so effectively the input string was not "moved", i.e., ownership of that string resource is unchanged?</p>
</blockquote>
<p>Yes. Simply forming an rvalue reference does not modify an ob... | is it safe to use std::move_iterator in std algorithm with lambda as pred | c++|c++11|move-semantics | 2 | 53 | 1 | 72,832,768 | 72,832,768 | 3 | true | 2022-07-01T16:59:42.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is it safe to use std::move_iterator in std algorithm with lambda as pred<pre><code>std::vector<std::string> foo{"a","b","c&qu... |
72,837,604 | C# is there a way to write an instance of a class to a txt file<p>I am new to c# so im not sure if this is a stupid question or not but..
i have a class with variables inside of it</p>
<pre><code>public class A {
string name;
int age;
public A() {
Console.WriteLine("Input name");
... | <p>Yes, it's possible – it's called <a href="https://en.wikipedia.org/wiki/Serialization" rel="nofollow noreferrer">serialization</a>. Currently .NET supports it among others with <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.json" rel="nofollow noreferrer"><code>System.Text.Json</code></a> standard ... | C# is there a way to write an instance of a class to a txt file | c# | 1 | 53 | 1 | 72,837,704 | 72,837,704 | 3 | true | 2022-07-02T08:25:23.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# is there a way to write an instance of a class to a txt file<p>I am new to c# so im not sure if this is a stupid question or not but..
i have a class with... |
72,854,989 | Vue 3 - Component is not loaded or rendering<p>I have following component:</p>
<pre><code><script setup>
import {defineProps, ref, watch} from "vue";
import ProductsComponent from '@/components/Products.vue'
import OrdersComponent from '@/components/Orders.vue'
import {useTableOrderStore} from "@/... | <p>The component is not rendered because the array <code>orders</code> is still empty and the watcher to update it is not working properly which should be written by returning props from callback and adding other options (<code>immediate</code> and <code>deep</code>):</p>
<pre class="lang-js prettyprint-override"><code... | Vue 3 - Component is not loaded or rendering | vue.js|vue-component|vuejs3|vue-composition-api|vue-script-setup | 0 | 53 | 1 | 72,855,205 | 72,855,205 | 3 | true | 2022-07-04T10:04:12.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue 3 - Component is not loaded or rendering<p>I have following component:</p>
<pre><code><script setup>
import {defineProps, ref, watch} from "v... |
72,883,759 | why is my if else statement returns true two times?<p>so I am new to React and I am trying to learn the basics. I got stuck at a point, where I try to show/hide an element on a page. The problem is that when I click Show details, it works, but Hide details must be clicked 2 times in order to do what its supposed to do.... | <p>You should use the state in your condition. If you declare a variable like your <code>visible</code> one, this will be assigned on every render (every time you set the state with <code>changeButtonText</code> or <code>showDetails</code>. So every time will be set to <code>false</code>. You can simplify your componen... | why is my if else statement returns true two times? | javascript|reactjs | 2 | 53 | 3 | 72,883,882 | 72,883,882 | 3 | true | 2022-07-06T12:41:38.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is my if else statement returns true two times?<p>so I am new to React and I am trying to learn the basics. I got stuck at a point, where I try to show/h... |
72,905,602 | How can I use a JpaRepository, with @Autowired, inside a service class?<p>I've already read these questions and none of them worked:</p>
<p><a href="https://stackoverflow.com/questions/71541018/spring-boot-mvc-unable-to-autowire-repository-in-the-service-class">Spring boot MVC - Unable to Autowire Repository in the ser... | <p>You not need create new object. You have to call like this:</p>
<pre><code>@Controller
@RequestMapping("/test")
public class TestController {
@Autowired
private DayTradeServiceImpl dayTradeService;
@GetMapping(value = "/get")
public void getTrades() {
dayTradeService.ge... | How can I use a JpaRepository, with @Autowired, inside a service class? | java|spring|repository | 0 | 53 | 1 | 72,905,863 | 72,905,863 | 3 | true | 2022-07-08T00:50:13.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use a JpaRepository, with @Autowired, inside a service class?<p>I've already read these questions and none of them worked:</p>
<p><a href="https://... |
72,905,953 | Select specific column from multiple dataframe to combine into one dataframe pandas<p>I want to select specific columns from multiple dataframes and combine them into one dataframe, how can I accomplish this?</p>
<p>df1</p>
<pre><code> count grade
0 3 0
1 5 100
2 4 50.5
3 10 80.1... | <pre class="lang-py prettyprint-override"><code>df = pd.concat([df1['grade'], df2['saving']], axis=1)
</code></pre>
<p>Similar question has been answered <a href="https://stackoverflow.com/questions/23521511/pandas-creating-dataframe-from-series">here</a>.</p>
<p>Pandas documentation for this function: <a href="https:/... | Select specific column from multiple dataframe to combine into one dataframe pandas | python|python-3.x|pandas|dataframe | 1 | 53 | 1 | 72,906,015 | 72,906,015 | 3 | true | 2022-07-08T02:02:23.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select specific column from multiple dataframe to combine into one dataframe pandas<p>I want to select specific columns from multiple dataframes and combine ... |
72,918,175 | Attribute error in Python Crash course alien invasion project<p>I would very appreciate if someone could tell me how to fix this error:</p>
<pre class="lang-py prettyprint-override"><code>AttributeError: 'AlienInvasion' object has no attribute '_check_events'
</code></pre>
<p>I am starting to learn python and I don't k... | <p>It's hard to debug your code because it's poorly formatted, but:</p>
<p>it seems like your entire code base is incorrectly indented, also the function <code>_update_screen()</code>, which means it is defined inside <code>_check_events()</code> - if you remove one level of indentation of <code>_update_screen()</code>... | Attribute error in Python Crash course alien invasion project | python | 0 | 53 | 1 | 72,918,420 | 72,918,420 | 3 | true | 2022-07-09T00:45:53.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Attribute error in Python Crash course alien invasion project<p>I would very appreciate if someone could tell me how to fix this error:</p>
<pre class="lang-... |
72,937,059 | Qt calculate age from a QDate<p>I have a birthdate stored as QDate and I would like to kown how many years the person has.<br>
I've tried the daysTo() function but then I cannot convert days in years.<br>
How can I do?</p> | <p>You might want to do this:</p>
<pre><code>int age(const QDate &birthday)
{
const auto today = QDate::currentDate();
auto age = today.year() - birthday.year();
return today.month() >= birthday.month() && today.day() >= birthday.day() ? age : age - 1;
}
</code></pre> | Qt calculate age from a QDate | qt | 0 | 53 | 1 | 72,937,210 | 72,937,210 | 3 | true | 2022-07-11T10:22:46.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Qt calculate age from a QDate<p>I have a birthdate stored as QDate and I would like to kown how many years the person has.<br>
I've tried the daysTo() functi... |
72,938,144 | How to remove or modify a div tag using css when the div tag is not associated with any class or id<p>Hi I have the following html code and this is part of the html</p>
<pre><code><div class="template-page-wrapper">
<div class="templemo-content-wrapper">
<div class="templat... | <p>In CSS you only can override an inline property by adding <code>!important</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-css lang-css prettyprint-override"><code>#example+div{
height:80px;
background... | How to remove or modify a div tag using css when the div tag is not associated with any class or id | html|css | 0 | 53 | 3 | 72,938,233 | 72,938,233 | 3 | true | 2022-07-11T11:51:18.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove or modify a div tag using css when the div tag is not associated with any class or id<p>Hi I have the following html code and this is part of t... |
72,944,329 | Print multiple COUT using looop<p>I am making a program to calculate taxes and tips based on the meal price. Is there anyway for me to loop the <code>cout</code> and print different percentages for each <code>cout</code> for 5 times?</p>
<p>This is the code I wrote but I am stuck, I can write 5 <code>cout</code> but I ... | <p>As I suggested in the comment, I think that the point breaking your loop is the fact that you change <code>tips</code> inside the loop itself and, in yuour example, in the first cycle you start with a tip of 0.05, then multiply it by 100, and at the next iteration you do not even enter because you do not comply with... | Print multiple COUT using looop | c++ | -2 | 53 | 1 | 72,944,613 | 72,944,613 | 3 | true | 2022-07-11T20:29:34.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print multiple COUT using looop<p>I am making a program to calculate taxes and tips based on the meal price. Is there anyway for me to loop the <code>cout</c... |
72,963,409 | PhpStorm is set to 8.1.7 but throws error on 8.0.* methods<p>I have this code snippet that PhpStorm does not like:</p>
<pre class="lang-php prettyprint-override"><code>public function __construct(LogFacade $logFacade)
{
private LogFacade $logFacade
} ()
</code></pre>
<p>It mainly says <code>Undefined constant 'LogF... | <p>Your first snippet should declare the visibility inside the constructor arguments. There is then no need to reference it again in the constructor body</p>
<pre class="lang-php prettyprint-override"><code>public function __construct(private LogFacade $logFacade) {}
</code></pre> | PhpStorm is set to 8.1.7 but throws error on 8.0.* methods | php|phpstorm | 1 | 53 | 2 | 72,964,166 | 72,964,166 | 3 | true | 2022-07-13T08:50:16.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PhpStorm is set to 8.1.7 but throws error on 8.0.* methods<p>I have this code snippet that PhpStorm does not like:</p>
<pre class="lang-php prettyprint-overr... |
72,958,258 | How does UserPrincipal.FindByIdentity(PrincipalContext context, string identityValue) query Active Directory?<p>I am using .NET Framework 4.8 by necessity. I am running into an issue where:
<code>UserPrincipal.FindByIdentity(context, username);</code> is resulting in a <code>System.DirectoryServices.AccountManagement.M... | <p>When you don't specify which identifier you're using, it's going to try them all at once. The source code is available now. The code that actually builds the query and executes it is <a href="https://github.com/dotnet/runtime/blob/a5f3676cc71e176084f0f7f1f6beeecd86fbeafc/src/libraries/System.DirectoryServices.Accoun... | How does UserPrincipal.FindByIdentity(PrincipalContext context, string identityValue) query Active Directory? | c#|.net|active-directory|userprincipal | 1 | 53 | 1 | 72,969,242 | 72,969,242 | 3 | true | 2022-07-12T20:52:42.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does UserPrincipal.FindByIdentity(PrincipalContext context, string identityValue) query Active Directory?<p>I am using .NET Framework 4.8 by necessity. I... |
72,985,521 | Java Chronounits Months: exactly one month, greater or less<p>I need to check if two dates cover exactly one full calendar month, e.g</p>
<pre><code>2022-06-01 to 2022-06-30
2022-06-02 to 2022-06-30
2022-06-01 to 2022-07-01
2022-06-15 to 2022-07-15
</code></pre>
<p>The first is exactly one month, the second less, the t... | <p>I would use the <code>firstDayOfMonth</code> and <code>lastDayOfMonth</code> temporal adjusters to adjust the start and end dates. If they cover exactly one month, then adjusting the start date to the end of the month should equal the end date, and adjusting the end date to the start of month should equal the start ... | Java Chronounits Months: exactly one month, greater or less | java | 1 | 53 | 1 | 72,985,616 | 72,985,616 | 3 | true | 2022-07-14T19:06:26.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Chronounits Months: exactly one month, greater or less<p>I need to check if two dates cover exactly one full calendar month, e.g</p>
<pre><code>2022-06-... |
72,799,028 | Is It possible to switch rows or columns between numpy arrays?<p>I have the following numpy arrays</p>
<pre><code>[[[0 0 1 0 0]
[1 0 0 0 0]
[0 0 1 0 0]]
[[1 0 0 0 0]
[0 0 1 0 0]
[0 0 0 1 0]]]
</code></pre>
<p>am trying to switch rows between them, 1 row 2 rows it doesn't matter am trying to see if it's possib... | <p>You can switch values like rows on NumPy arrays with Python variable swap operator:</p>
<pre><code>import numpy as np
m = np.array([[0, 0, 1, 0, 0],
[1, 0 ,0, 0, 0],
[0, 0, 1, 0, 0]])
n = np.array([[1, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0]])
#m[:, 0], n[:, 0] = n[:, 0].copy(), m[:, 0].copy() #Only for c... | Is It possible to switch rows or columns between numpy arrays? | python|numpy|numpy-ndarray | 0 | 53 | 1 | 72,799,149 | 72,799,149 | 3 | true | 2022-06-29T09:30:00.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is It possible to switch rows or columns between numpy arrays?<p>I have the following numpy arrays</p>
<pre><code>[[[0 0 1 0 0]
[1 0 0 0 0]
[0 0 1 0 0]]
... |
72,973,428 | Extract all percentage numbers from a data frame column<p>I have a data.frame <code>df</code> with a character column <code>text</code> that contains text. From that column, I would like to extract all percentage numbers (say, 1.2% and -2.3%) but not the ordinary numbers (say, 123 and 1.2) into a character vector.</p>
... | <p>Probably not the most robust general-purpose solution, but works for your example:</p>
<pre><code>unlist(stringr::str_extract_all(df$text, "[+\\-]?[0-9\\.]+%"))
#[1] "1.3%" "+1.4%" "-1.5%" "123.3%"
## or using R's native forward pipe operator, since R 4.1.0
stri... | Extract all percentage numbers from a data frame column | r | 2 | 53 | 2 | 72,973,480 | 72,973,480 | 3 | true | 2022-07-13T22:46:17.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract all percentage numbers from a data frame column<p>I have a data.frame <code>df</code> with a character column <code>text</code> that contains text. F... |
72,837,193 | C++ Socket libraries are not being identified by the compiler<p>I am trying to to learn how to stream image frames via UDP in C++ and I was following this <a href="https://www.youtube.com/watch?v=iVq4aecyQto" rel="nofollow noreferrer">tutorial</a> for the server part to receive my frames, this tutorial clearly uses cod... | <p>You are using <code>SOCKET</code> or <code>SOCKADDR_IN</code> which is Microsoft dedicated but I see Linux headers.</p>
<p>You need to select what you want to do:</p>
<ol>
<li>You need code only for Windows.</li>
<li>You need code only for Linux.</li>
<li>You need a cross-platform code.</li>
</ol>
<p>Your approach s... | C++ Socket libraries are not being identified by the compiler | c++|sockets | 0 | 53 | 2 | 72,837,214 | 72,837,214 | 3 | true | 2022-07-02T07:14:28.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Socket libraries are not being identified by the compiler<p>I am trying to to learn how to stream image frames via UDP in C++ and I was following this <a... |
72,943,920 | rationalize() for BigFloats has an upper limit?<p>I have the following code:</p>
<pre><code>function recursion(i::BigFloat)
r = BigFloat(0)
if i >= 1.0
i = i - 1.0
r = 1.0/(2.0+recursion(i))
end
return r
end
function main()
solution = 0
i = BigFloat(1)
while i < 1000
... | <p>There are a few issues here, all dealing with making sure that you're using types that can get as accurate or as large as you want.</p>
<p>First, you need to break the habit of putting decimals in your exact numbers — as in <code>1.0</code> and <code>2.0</code>, which are interpreted as literal <code>Float64</code>s... | rationalize() for BigFloats has an upper limit? | julia|rational-number|bigfloat | 2 | 53 | 2 | 72,944,546 | 72,944,546 | 3 | true | 2022-07-11T19:49:24.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rationalize() for BigFloats has an upper limit?<p>I have the following code:</p>
<pre><code>function recursion(i::BigFloat)
r = BigFloat(0)
if i >... |
72,832,246 | Oracle SQL "Queue" Table: Every time an ID leaves the table<p>I have a "Queue" table in an Oracle sql database where IDs enter on a certain date, and have an entry/row every day they remain in the table until they leave. These IDs can return multiple times. Each time they have consecutive dates/rows until the... | <p>From Oracle 12, you can use <code>MATCH_RECOGNIZE</code> to perform row-by-row processing:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT *
FROM table_name
MATCH_RECOGNIZE(
PARTITION BY account_number
ORDER BY dt
MEASURES
LAST(dt) AS leave_dt
PATTERN (consecutive_dt* last_dt)
DEFINE... | Oracle SQL "Queue" Table: Every time an ID leaves the table | sql|oracle|gaps-and-islands | 0 | 53 | 1 | 72,833,057 | 72,833,057 | 3 | true | 2022-07-01T16:31:49.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle SQL "Queue" Table: Every time an ID leaves the table<p>I have a "Queue" table in an Oracle sql database where IDs enter on a certain date, a... |
72,968,947 | How count duplicates in one file and output it beautiful Python<p>I have data with 3 columns. I need to compare this fields and if they are similar count them. If they are not similar then output information. I need to get this<a href="https://i.stack.imgur.com/q3GQL.png" rel="nofollow noreferrer">1</a>. In below I put... | <p>Here is a simple way using <a href="https://pandas.pydata.org/docs/reference/index.html#api" rel="nofollow noreferrer"><code>pandas</code></a> to do what I believe you are attempting:</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
input_file = "test.csv"
output_file = "test.xl... | How count duplicates in one file and output it beautiful Python | python|excel|file|xlsxwriter | 0 | 53 | 1 | 72,969,255 | 72,969,255 | 3 | true | 2022-07-13T15:35:12.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How count duplicates in one file and output it beautiful Python<p>I have data with 3 columns. I need to compare this fields and if they are similar count the... |
72,848,427 | .net - Get embedded resource path from Assembly<p>I've a .net6 F# solution with a test project.<br />
The test project is in a folder named "MyProject.Core.Tests" and the project file is
<strong>Core.UnitTests.fsproj</strong>:</p>
<pre class="lang-xml prettyprint-override"><code><Project Sdk="Microsof... | <p>I think the resource name is qualified by the project's <code>RootNamespace</code>, rather than its <code>DefaultNamespace</code>, so this seems to work in the .fsproj file:</p>
<pre><code> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>UnitTests.Core</Ro... | .net - Get embedded resource path from Assembly | f#|.net-assembly | 2 | 53 | 1 | 72,849,112 | 72,849,112 | 3 | true | 2022-07-03T17:05:47.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.net - Get embedded resource path from Assembly<p>I've a .net6 F# solution with a test project.<br />
The test project is in a folder named "MyProject.C... |
73,011,253 | Change favicon, using Visibility API<p>I have seen some websites (discord. hotjar), using the <code>Visibility API</code> to show a bullet when the tab is inactive, and hide it when its active again,</p>
<p>How we can do that?</p>
<p><a href="https://i.stack.imgur.com/zsAij.png" rel="nofollow noreferrer"><img src="http... | <p>For this, you need to create two different favicons for each mode and toggle between them using the <code>Visibility API</code>. Something like this:</p>
<pre><code>// Set the name of the hidden property and the change event for visibility
let hidden;
let visibilityChange;
if (typeof document.hidden !== "undefi... | Change favicon, using Visibility API | javascript | 2 | 53 | 1 | 73,011,615 | 73,011,615 | 3 | true | 2022-07-17T11:09:36.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change favicon, using Visibility API<p>I have seen some websites (discord. hotjar), using the <code>Visibility API</code> to show a bullet when the tab is in... |
72,813,551 | Choose class specialization using default template parameter<p>Can someone please explain why in the following code C choses the specialization but A does not? They look the same to me</p>
<pre class="lang-cpp prettyprint-override"><code>#include <iostream>
template <typename T=int>
struct C {
int i=3;... | <p>Without an explicit template argument list (as in <code>A a</code> instead of <code>A<> a</code>) <em>class template argument deduction</em> (CTAD) will be performed.</p>
<p>CTAD basically tries to find a matching constructor for the declaration from which it can deduce the template arguments. But it always co... | Choose class specialization using default template parameter | c++|c++17 | 1 | 53 | 1 | 72,813,821 | 72,813,821 | 3 | true | 2022-06-30T09:40:55.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Choose class specialization using default template parameter<p>Can someone please explain why in the following code C choses the specialization but A does no... |
72,989,240 | Invalid JSON files in FireBase<p><a href="https://i.stack.imgur.com/3ICgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ICgK.png" alt="enter image description here" /></a></p>
<p>I want to import json file in Realtime Database of firebase but showing error "Invalid JSON file" even though... | <p>I noticed that
<strong>Size of a single write request to the database</strong> :</p>
<ol>
<li><p>256 MB from the REST API;</p>
</li>
<li><p>16 MB from the SDKs.</p>
</li>
</ol>
<p>If you upload JSON files, you have to separate them into multi JSON files (16MB) and upload each one manually.</p>
<p><a href="https://f... | Invalid JSON files in FireBase | firebase|firebase-realtime-database | 1 | 53 | 2 | 72,989,507 | 72,989,507 | 3 | true | 2022-07-15T05:02:30.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Invalid JSON files in FireBase<p><a href="https://i.stack.imgur.com/3ICgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ICgK.png" alt="... |
72,999,922 | Search the first and second variable (with spaces and special character like $) using awk<p>I have a dataset where i need to search for the 2 variables in it. Both vars should be present, otherwise ignore them.</p>
<p>inputfile.txt:</p>
<pre><code>IFRA-SCN-01001B.brz.com Tower Sales
IFRA-SCN-01001B.brz.com Z$
IFRA-SCN-... | <p>I see a number of problems here. First, where you split the fields from inputfile.txt with</p>
<pre><code>while read -r zz; do
var1=`echo $zz | print '{print $1}'`
var2=`echo $zz | print '{print $2}'`
</code></pre>
<p>When the line is something like "IFRA-SCN-01002B.brz.com Build Docs", <code>var1<... | Search the first and second variable (with spaces and special character like $) using awk | bash|awk | 0 | 53 | 2 | 73,000,234 | 73,000,234 | 3 | true | 2022-07-15T21:52:30.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search the first and second variable (with spaces and special character like $) using awk<p>I have a dataset where i need to search for the 2 variables in it... |
72,829,889 | Don't understand how nextpow works<p>Recently I have been looking at how the <code>nextpow(a::Real, x::Real)</code> function works inside. The code is in <code>base/intfuncs.jl</code> of the Julia project. For the case <code>a == 2</code> there is an optimization as it is very common as case.</p>
<pre><code>a == 2 &... | <p>for an unsigned Int, whatever its <code>bitstring()</code> is, say <code>0000000001xxxxxx</code>, the next power of 2 is just put a <code>1</code> at the last leading 0 and replace the entire <code>1xxxxxx</code> with <code>0000000</code></p>
<pre><code>julia> function f(x)
@show bitstring(x)
... | Don't understand how nextpow works | julia|pow | 1 | 53 | 1 | 72,830,679 | 72,830,679 | 4 | true | 2022-07-01T13:17:22.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Don't understand how nextpow works<p>Recently I have been looking at how the <code>nextpow(a::Real, x::Real)</code> function works inside. The code is in <co... |
72,925,162 | How to visually separate dollar sign from variable name in Visual Studio Code?<p>I just switched to Visual Studio Code from Atom and I'm looking for a way to <strong>visually</strong> separate dollar sign from variable name. Such thing was possible in Atom by <a href="https://flight-manual.atom.io/using-atom/sections/b... | <p>It is possible to change the color of <code>$</code> or <code>$$</code> of php variables as they both have the textmate scope of</p>
<pre><code>punctuation.definition.variable.php
</code></pre>
<p>You can check that with the tool in the Command Palette <code>Developer: Inspect Editor Tokens and Scopes</code>. Once ... | How to visually separate dollar sign from variable name in Visual Studio Code? | php|visual-studio-code|syntax-highlighting | 0 | 53 | 1 | 72,925,504 | 72,925,504 | 4 | true | 2022-07-09T23:06:08.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to visually separate dollar sign from variable name in Visual Studio Code?<p>I just switched to Visual Studio Code from Atom and I'm looking for a way to... |
72,932,410 | Tailwind issue with media queries<p>I have such queries</p>
<pre><code> screens: {
414: { max: "414px" },
500: { max: "500px" },
630: { max: "630px" },
720: { max: "720px" },
840: { max: "840px" },
1000: { max: "1000p... | <pre><code>Maybe you can use this..
But tailwind is use min width not max width
You can read the docuentation here https://tailwindcss.com/docs/screens
{
"screens": {
"414": "414px",
// => @media (min-width: 414px) { ... }
"500": "500px&... | Tailwind issue with media queries | tailwind-css | 1 | 53 | 1 | 72,932,719 | 72,932,719 | 4 | true | 2022-07-10T23:00:45.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tailwind issue with media queries<p>I have such queries</p>
<pre><code> screens: {
414: { max: "414px" },
500: { max: "500px&q... |
72,951,831 | JavaScript wrap existing function in async one: deal with the result (automatically wrapped into a Promise)?<p>I'm trying to write a "mixing" for JavaScript classes (controllers, in my app) to automatically "await" for a given function to be resolved, before actually invoke the real methods. Real cl... | <blockquote>
<p>...in theory, I should check if the original function is <code>async</code> and if it was not, <code>await</code> for it's return value?"</p>
</blockquote>
<p>It wouldn't matter, your wrapper is <code>async</code>; an <code>async</code> function <strong>always</strong> returns a promise, whether yo... | JavaScript wrap existing function in async one: deal with the result (automatically wrapped into a Promise)? | javascript|async-await | 2 | 53 | 1 | 72,951,957 | 72,951,957 | 4 | true | 2022-07-12T11:49:21.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript wrap existing function in async one: deal with the result (automatically wrapped into a Promise)?<p>I'm trying to write a "mixing" for J... |
72,986,476 | Macro with a C++ class<p>I was going through this code (line 41):</p>
<p><a href="https://github.com/black-sat/black/blob/master/src/lib/include/black/logic/parser.hpp" rel="nofollow noreferrer">https://github.com/black-sat/black/blob/master/src/lib/include/black/logic/parser.hpp</a></p>
<p>and came across something li... | <p>The way you've written it there isn't much point. But if you look at the project's <a href="https://github.com/black-sat/black/blob/master/src/lib/include/black/support/common.hpp" rel="nofollow noreferrer">common.hpp</a> file to see how it's used, it makes a lot of sense, and is a common pattern in C and C++:</p>
<... | Macro with a C++ class | c++|class|c++11|c++17|c++14 | -1 | 53 | 2 | 72,986,592 | 72,986,592 | 4 | true | 2022-07-14T20:46:05.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Macro with a C++ class<p>I was going through this code (line 41):</p>
<p><a href="https://github.com/black-sat/black/blob/master/src/lib/include/black/logic/... |
72,769,305 | UTC formatted string to UTC Date Object using SimpleDateFormat<p>I have a <strong>UTC</strong> formatted DateTime <strong>String</strong></p>
<p>and need this String to be converted to DATE Object without any Format change.</p>
<p>Currently, when I try to convert it to a date Object it is returned as GMT formatted Date... | <blockquote>
<p>I have a UTC formatted DateTime String</p>
</blockquote>
<p>No, you don’t.</p>
<p>UTC is the prime meridian commonly used for time-keeping. Time zones towards the east use an offset some number of hours-minutes-seconds ahead of UTC; those to the west, behind UTC.</p>
<p><a href="https://en.m.wikipedia.o... | UTC formatted string to UTC Date Object using SimpleDateFormat | java|android|date|utc|android-date | 0 | 53 | 1 | 72,769,913 | 72,769,913 | 4 | true | 2022-06-27T08:46:22.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UTC formatted string to UTC Date Object using SimpleDateFormat<p>I have a <strong>UTC</strong> formatted DateTime <strong>String</strong></p>
<p>and need thi... |
72,935,274 | Redgate SQL Source Control: ignoring Database Roles<p>I'm using Redgate Source Control to changetrack a database. I have a testing database from which I commit, and a production database which is the final target.</p>
<p>I want to have a different Database Role (the setting found of Database->Security->Roles->... | <p>In SQL Source Control, there is an option for ignoring roles entirely (or using a rule to ignore certain ones).</p>
<p>Select your source controlled database in the Object Explorer, and then click SQL Source Control in your toolbar. Go to the Setup Page, and then select "Edit filter rules".</p>
<p>Then sim... | Redgate SQL Source Control: ignoring Database Roles | sql-server|redgate | 1 | 53 | 1 | 72,935,433 | 72,935,433 | 4 | true | 2022-07-11T07:50:16.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Redgate SQL Source Control: ignoring Database Roles<p>I'm using Redgate Source Control to changetrack a database. I have a testing database from which I comm... |
72,850,041 | Print content of two lists<p>I'm not sure how to title this post, so I tried to make it as accurate as possible. I'm trying to print the content of two lists of the same length.</p>
<p>Let's say we have two lists:</p>
<pre><code>name = ['Tyler', 'Daniel', 'Connor', 'Jeff']
number = ['64', '34', '76', '24']
</code></pre... | <p><code>zip()</code> will do the "matching up" for you by evenly iterating over all its arguments:</p>
<pre class="lang-py prettyprint-override"><code>names = ['Tyler', 'Daniel', 'Connor', 'Jeff']
numbers = ['64', '34', '76', '24']
for name, number in zip(names, numbers):
print(f"{name} {number}"... | Print content of two lists | python | -3 | 53 | 3 | 72,850,045 | 72,850,045 | 4 | true | 2022-07-03T21:28:27.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print content of two lists<p>I'm not sure how to title this post, so I tried to make it as accurate as possible. I'm trying to print the content of two lists... |
72,771,478 | scipy rotation: from_matrix -> as_quat -> from_quat -> as_matrix gives the output that differs from input<p>I have camera intrinsic matrix. I do the following operations: from_matrix -> as_quat -> from_quat -> as_matrix, and it gives me the output that is not equal to input:</p>
<pre><code>from scipy.spatial.t... | <p>From <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.from_matrix.html" rel="noreferrer">the docs</a>:</p>
<blockquote>
<p>Initialize from rotation matrix.</p>
<p>Rotations in 3 dimensions can be represented with 3 x 3 proper orthogonal matrices [1]. If the input is not ... | scipy rotation: from_matrix -> as_quat -> from_quat -> as_matrix gives the output that differs from input | python|scipy | 0 | 53 | 1 | 72,771,623 | 72,771,623 | 5 | true | 2022-06-27T11:39:45.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
scipy rotation: from_matrix -> as_quat -> from_quat -> as_matrix gives the output that differs from input<p>I have camera intrinsic matrix. I do the followin... |
72,848,509 | Use String functions on an element while using map() on array in javascript?<p>I am trying to do the following.</p>
<pre class="lang-js prettyprint-override"><code>strs = ["one", "two"];
let sorted_str = strs.map((s) => [s.sort(), s]);
</code></pre>
<p>Essentially, what I am trying to do is creat... | <p>You need to get an array of characters, sort it and get a string back.</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
strs = ["one", "two"],
sorted_str = strs... | Use String functions on an element while using map() on array in javascript? | javascript|arrays|string | 1 | 53 | 5 | 72,848,528 | 72,848,528 | 5 | true | 2022-07-03T17:18:06.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use String functions on an element while using map() on array in javascript?<p>I am trying to do the following.</p>
<pre class="lang-js prettyprint-override"... |
72,951,359 | Is there any way to merge object properties as follow?<p>I want to refactor initial object in JavaScript to refactored object as below example.is there any way to do it with Lodash or in plain JavaScript?</p>
<pre><code>const initialObject = {
status: 'success',
fields: [
{
name: 'price',
... | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="noreferrer"><code>map</code></a> here</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-... | Is there any way to merge object properties as follow? | javascript | -2 | 53 | 1 | 72,951,431 | 72,951,431 | 5 | true | 2022-07-12T11:10:10.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any way to merge object properties as follow?<p>I want to refactor initial object in JavaScript to refactored object as below example.is there any w... |
72,916,613 | Elements are not displayed on the pane inside a pane<p>I am writing a vector canvas in JavaFX (vector graphics, just shapes are displayed on the canvas): well, so that you can move around and zoom in on it.</p>
<p>Since the position of the upper-left corner of the node changes when translating, and it no longer respond... | <p>You should not override <code>getChildren()</code> and <code>getChildrenUnmodifiable()</code> to return the children of a different node (especially a contained node).</p>
<p>That may confuse and break the JavaFX layout system because it would be something quite unexpected for it.</p> | Elements are not displayed on the pane inside a pane | java|user-interface|javafx | 2 | 53 | 1 | 72,917,204 | 72,917,204 | 5 | true | 2022-07-08T20:20:58.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Elements are not displayed on the pane inside a pane<p>I am writing a vector canvas in JavaFX (vector graphics, just shapes are displayed on the canvas): wel... |
72,862,435 | rust if not MyStruct::MyVariant = my_struct, is it possible?<pre><code>pub enum Letters{
A,
B,
C,
D,
E,
F
}
fn main() {
let letter = Letters::A;
if not let Letters::A = letter {
println!("letter is not a");
}
}
</code></pre>
<p>What if I want to test if the letter ... | <p>Derive <a href="https://doc.rust-lang.org/nightly/std/cmp/trait.PartialEq.html" rel="noreferrer"><code>PartialEq</code></a> (perhaps also <a href="https://doc.rust-lang.org/nightly/std/cmp/trait.Eq.html" rel="noreferrer"><code>Eq</code></a>) and use <code>!=</code>:</p>
<pre class="lang-rust prettyprint-override"><c... | rust if not MyStruct::MyVariant = my_struct, is it possible? | rust | 1 | 53 | 1 | 72,862,451 | 72,862,451 | 6 | true | 2022-07-04T22:14:12.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rust if not MyStruct::MyVariant = my_struct, is it possible?<pre><code>pub enum Letters{
A,
B,
C,
D,
E,
F
}
fn main() {
let lett... |
72,902,270 | Do only one time in multiple Kubernetes pods<p>I have a general question in optimization in having multiple Kubernetes pods. I have a Java application <code>service A</code> which checks on <code>service B</code> every 5 mins for a condition to do <code>task T</code>. Every 5 mins, if the condition is met, I want <code... | <p>May I ask why is it necessary for you to run this apparently periodic service with a 4 pod deployment?</p>
<p>A better idea would be to use a <code>CronJob</code> instead that runs every 5 minutes and performs the task you want it to. Every time the <code>CronJob</code> is to run it will spawn a pod, which will chec... | Do only one time in multiple Kubernetes pods | java|docker|kubernetes | 0 | 53 | 1 | 72,902,385 | 72,902,385 | 6 | true | 2022-07-07T17:53:19.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do only one time in multiple Kubernetes pods<p>I have a general question in optimization in having multiple Kubernetes pods. I have a Java application <code>... |
72,838,115 | How to empty the strings in an array of strings, but keep the length of array<p>I have an array of strings in javaScript:</p>
<pre><code>array = ['xx', 'xxxxxxxx', 'xxx'];
</code></pre>
<p>I want to reach this:</p>
<pre><code> array = ['', '', '']; //empty the strings but keep the length of array
</code></pre>
<p>What ... | <p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill" rel="nofollow noreferrer"><code>Array.fill</code></a>.</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 ... | How to empty the strings in an array of strings, but keep the length of array | javascript|arrays|string | 0 | 53 | 4 | 72,838,170 | 72,838,170 | 7 | true | 2022-07-02T09:52:36.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to empty the strings in an array of strings, but keep the length of array<p>I have an array of strings in javaScript:</p>
<pre><code>array = ['xx', 'xxxx... |
72,904,330 | How can i use single qoutes in html using python<p>Here is the code title its an attribute</p>
<pre><code>``` src="[sc name='testt2' id='''+title+'''][/sc]/```
</code></pre>
<p>whene i put it between single qoutes the attribute shows up like a html code :</p>
<pre><code>``` src="[sc name='testt2' id=''''+titl... | <p>Add \ backslash before each comma.</p> | How can i use single qoutes in html using python | python|html|shortcode | 0 | 53 | 1 | 72,904,472 | 72,904,472 | -1 | true | 2022-07-07T21:17:16.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i use single qoutes in html using python<p>Here is the code title its an attribute</p>
<pre><code>``` src="[sc name='testt2' id='''+title+'''][/... |
72,988,872 | SQLite - add a column if it does not exist<p>I am new to SQLite. I want to add a column if it does not exist.</p>
<p>How to check if the column name exists and then add if it does not?</p>
<p>I tried</p>
<pre><code>ALTER TABLE table ADD COLUMN colname INTEGER ON CONFLICT IGNORE
</code></pre>
<p>But it shows an error</p... | <p>First get a list of table column names - as list - with something like:</p>
<pre><code>select group_concat(c.name) from pragma_table_info('table_name') c;
</code></pre>
<p>Then do a CASE expression on whether the new column name you want to add exists in the list above. More info at: <a href="https://www.sqlite.org/... | SQLite - add a column if it does not exist | sql|sqlite|sqflite | -2 | 53 | 1 | 72,991,643 | 72,991,643 | -1 | true | 2022-07-15T03:52:46.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQLite - add a column if it does not exist<p>I am new to SQLite. I want to add a column if it does not exist.</p>
<p>How to check if the column name exists a... |
72,843,783 | python scrapy - Output json file empty<p>I'm new to Scrapy and having some problems with the output from my first spider. No matter what I try, the output json file is always empty. Im using the 2.5.1 version due to running into a bug on the current 2.6.1 version. The spiders code is:</p>
<pre><code>import scrapy
from ... | <p>You are about to your goal. Use <code>//a//text() </code>instead of<code> /text()</code></p>
<pre><code>import scrapy
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.crawler import CrawlerProcess
class WormSpider(CrawlSpider):
name = 'Worm'
custom_sett... | python scrapy - Output json file empty | python|wordpress|web-scraping|scrapy | -1 | 53 | 1 | 72,844,401 | 72,844,401 | -1 | true | 2022-07-03T03:39:54.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python scrapy - Output json file empty<p>I'm new to Scrapy and having some problems with the output from my first spider. No matter what I try, the output js... |
72,322,958 | cannot capture the struct value inside of the kernal function<p>It is so strange and I am struggling with this problem for the whole week. I just want to use the variable which is defined inside of the struct constructor, but fail to do that. The simple code is here:</p>
<pre><code>#include <CL/sycl.hpp>
#include... | <p>According to <a href="https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:kernel.parameter.passing" rel="nofollow noreferrer">4.12.4. Rules for parameter passing to kernels</a> from <a href="https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html" rel="nofollow noreferrer"... | cannot capture the struct value inside of the kernal function | c++|lambda|intel-oneapi|sycl|dpc++ | 0 | 54 | 1 | 72,765,708 | 72,765,708 | 0 | true | 2022-05-20T17:48:58.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cannot capture the struct value inside of the kernal function<p>It is so strange and I am struggling with this problem for the whole week. I just want to use... |
72,769,807 | How to not copy empty rows when splitting files where split range exceeds Usedrange<p>I found code here to split a large Excel file into smaller csv files.</p>
<p>The output csv includes empty rows when the number of rows left is less than the number in the loop.<br />
<a href="https://i.stack.imgur.com/cKyjf.png" rel=... | <p>I introduced a variable called rowsToDo in order to do this, with the min of 3000 or the number of rows left:</p>
<pre><code>Sub testCSV()
Dim rLastCell As Range
Dim rCells As Range
Dim strName As String
Dim lLoop As Long, lCopy As Long
Dim wbNew As Workbook
With Sheets("CSV Table&q... | How to not copy empty rows when splitting files where split range exceeds Usedrange | excel|vba|csv | 0 | 54 | 2 | 72,770,402 | 72,770,402 | 0 | true | 2022-06-27T09:27:40.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to not copy empty rows when splitting files where split range exceeds Usedrange<p>I found code here to split a large Excel file into smaller csv files.</... |
72,777,960 | Need help in to extract values to new row in Kusto<p>I kinda need help extracting a value from a string and dynamically add new row</p>
<p>Below is the string that I have in the column <strong>DBInfo</strong>.</p>
<blockquote>
<p>[{"DBName":"master","TriggerName":"ramp_sqlpreventivetr... | <p>you can use <code>mv-expand</code>: <a href="https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/mvexpandoperator" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/mvexpandoperator</a></p>
<p>for example:</p>
<pre><code>datatable(DBInfo:string)
[
'[{"DB... | Need help in to extract values to new row in Kusto | azure-data-explorer|kql | 1 | 54 | 1 | 72,778,076 | 72,778,076 | 0 | true | 2022-06-27T20:29:48.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need help in to extract values to new row in Kusto<p>I kinda need help extracting a value from a string and dynamically add new row</p>
<p>Below is the strin... |
72,791,208 | The menu close button only works once, can you help me?<p>I created a navbar using javascript, the closing button is only used once, if I repeatedly open and close the menu, the closing button does not work, maybe there is an error but I can't access it, can someone help me? thank you ..................................... | <ul>
<li>When comparing values (inside an <code>if</code> statement) use <code>===</code>, not <code>=</code> (assignment operator)</li>
<li>start your menu (navbar) as <code>display: none;</code> than you can toggle the <code>display = "flex" / "none"</code> in a ternary operator <code>?:</code></l... | The menu close button only works once, can you help me? | javascript|html|css | 0 | 54 | 2 | 72,791,604 | 72,791,604 | 0 | true | 2022-06-28T18:03:14.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The menu close button only works once, can you help me?<p>I created a navbar using javascript, the closing button is only used once, if I repeatedly open and... |
72,795,442 | How to wait for suspend function to be completed before executing other code in kotlin<p>I'm wondering if I can wait until a suspend function has completed before executing other code? <code>loadParticlesWithoutSetCall</code>, which I call inside of <code>setParticlePicking</code>, has a suspend function. I do not want... | <p>Mark both functions suspending functions by adding the <code>suspend</code> modifier before <code>fun</code>. Then move the <code>AppScope.launch {}</code> call to wrap the call to <code>setParticlePicking</code>, wherever it is (you did not include in the sample).</p>
<p>It should look something like this:</p>
<pre... | How to wait for suspend function to be completed before executing other code in kotlin | kotlin|kotlin-coroutines|suspend | 0 | 54 | 1 | 72,796,768 | 72,796,768 | 0 | true | 2022-06-29T03:21:12.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to wait for suspend function to be completed before executing other code in kotlin<p>I'm wondering if I can wait until a suspend function has completed b... |
72,798,789 | Angular mat-button-toggle-group limit number of displayed characters and add hint<p>Is is possible to limit the number of characters of the value displayed on the mat-button-toggle elements from a mat-button-toggle-group?
The component.html file:</p>
<pre><code>...
<mat-button-toggle-group #group="matButtonTogg... | <p>Create a method in component to truncate the string if length exceed 10 and use <a href="https://material.angular.io/components/tooltip/overview" rel="nofollow noreferrer">mat tool tip</a> to show hint on hover.Show the code will be. <strong>Ts</strong></p>
<pre><code> truncateVal(val:string){
return val?.length... | Angular mat-button-toggle-group limit number of displayed characters and add hint | html|angular|typescript|button|angular-material | -1 | 54 | 2 | 72,799,091 | 72,799,091 | 0 | true | 2022-06-29T09:12:43.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular mat-button-toggle-group limit number of displayed characters and add hint<p>Is is possible to limit the number of characters of the value displayed o... |
72,799,511 | TypeError: Cannot assign to read only property 'value' of object react after using the value of state in a function<p>I am trying to develop an E-commerce website with a <em>product detail page</em>. Users may select available options of the product. Supposed I choose a <em>shoe</em> and selected <em>size 42</em>, when... | <p>Problem with your code is here:</p>
<pre><code>else{
const newData = [...this.state.selected_variation];
newData[index].value = value
this.setState({
selected_variation:newData,
})
}
</code></pre>
<p>First, you copied old state using spread. Like that you just created new array, but arra... | TypeError: Cannot assign to read only property 'value' of object react after using the value of state in a function | javascript|reactjs | 0 | 54 | 1 | 72,799,758 | 72,799,758 | 0 | true | 2022-06-29T10:04:48.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: Cannot assign to read only property 'value' of object react after using the value of state in a function<p>I am trying to develop an E-commerce we... |
72,801,791 | Updating Json Value with that of another Json<p>I want to update automatically the value of comments_list with the values in the comments JSON object</p>
<pre><code>const tweet = JSON.stringify({"tweet_id":1,"created_at":"2022-06-28","comments_list":[]})
const comments = JSON.str... | <p>I'd work with those strings in an object form, otherwise string-manipulation could be slow in some cases.</p>
<p>This is by no means the fastest solution but perhaps the idea behind it can be helpful.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="sn... | Updating Json Value with that of another Json | javascript|node.js|json | -2 | 54 | 2 | 72,802,028 | 72,802,028 | 0 | true | 2022-06-29T12:55:27.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating Json Value with that of another Json<p>I want to update automatically the value of comments_list with the values in the comments JSON object</p>
<pr... |
72,801,721 | numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U20'), dtype('int64')) -> None PYHTON<p>Whenever I try to run this code below, I am met with the the error:<br />
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matc... | <p>You wrote :</p>
<pre class="lang-py prettyprint-override"><code>with open(r'W:\Python\NEA Dice Project\account_number.data', 'wb') as x:
pickle.dump(uploaded_numbers)
</code></pre>
<p>I think you probably forgot the 'x' parameter.</p>
<pre class="lang-py prettyprint-override"><code>with open(r'W:\Python\NEA Dice... | numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U20'), dtype('int64')) -> None PYHTON | python|numpy|pickle | 0 | 54 | 1 | 72,802,228 | 72,802,228 | 0 | true | 2022-06-29T12:49:12.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U20'), dtype('int64')) -> None PYHTON<p>When... |
72,798,225 | Remote Connection fails in setup of Python data-science client for SQL Server Machine Learning Services<p>I am trying to test the remote connection of a Python data-science client with SQL Server Machine Learning Services following this guide: <a href="https://docs.microsoft.com/en-us/sql/machine-learning/python/setup-... | <p>I just figured out the reason. As of today, the Python versions for the data clients in <a href="https://docs.microsoft.com/de-de/sql/machine-learning/python/setup-python-client-tools-sql?view=sql-server-ver15" rel="nofollow noreferrer">https://docs.microsoft.com/de-de/sql/machine-learning/python/setup-python-client... | Remote Connection fails in setup of Python data-science client for SQL Server Machine Learning Services | python|sql-server|azure-machine-learning-studio|microsoft-machine-learning-server | 0 | 54 | 1 | 72,803,260 | 72,803,260 | 0 | true | 2022-06-29T08:32:20.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remote Connection fails in setup of Python data-science client for SQL Server Machine Learning Services<p>I am trying to test the remote connection of a Pyth... |
72,803,433 | use option -std=c99 or -std=gnu99 to compile your code<p>I've the following error:</p>
<pre><code>'for' loop initial declarations are only allowed in C99 mode
use option -std=c99 or -std=gnu99 to compile your code.
</code></pre>
<p>How can I add this option to my makefile? This is my makefile: (I think that this option... | <p>You have a line:</p>
<pre><code>CFLAGS += -DBOARD_$(shell echo $(BOARD) | tr a-z A-Z)
</code></pre>
<p>You can add it to the end of this line so it reads:</p>
<pre><code>CFLAGS += -DBOARD_$(shell echo $(BOARD) | tr a-z A-Z) -std=c99
</code></pre> | use option -std=c99 or -std=gnu99 to compile your code | c|linux|gcc|compilation | -1 | 54 | 1 | 72,803,511 | 72,803,511 | 0 | true | 2022-06-29T14:48:38.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
use option -std=c99 or -std=gnu99 to compile your code<p>I've the following error:</p>
<pre><code>'for' loop initial declarations are only allowed in C99 mod... |
72,800,848 | Why do I keep getting the axios error in my Django React app on Heroku?<p>I developed a simple Django React application and deployed on to heroku:</p>
<pre><code>https://friendly-interview-duck.herokuapp.com/
</code></pre>
<p>Even though the backend and frontend connection was working correctly via axios in local, I st... | <p>When your application was running locally, your frontend can fetch info from the backend through the local URL (localhost) but this changes when you deploy the backend and it runs on an entirely different URL on the internet.</p>
<p>Your React application, as it is now, is essentially <em>trying to fetch from the us... | Why do I keep getting the axios error in my Django React app on Heroku? | django|heroku | 0 | 54 | 1 | 72,804,421 | 72,804,421 | 0 | true | 2022-06-29T11:43:27.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I keep getting the axios error in my Django React app on Heroku?<p>I developed a simple Django React application and deployed on to heroku:</p>
<pre><... |
72,787,356 | Twilio HTTP Post format for receiving Message<p>I am using Twilio for receiving messages.
Currently using a webhook for incoming messages and can't figure out what's the format of this string.</p>
<p><code>ToCountry=GB&ToState=&SmsMessageSid=SM9e341f9cf646bf9ea3b7918e3f422202&NumMedia=0&ToCity=&SmsS... | <p>Twilio sends to your application using application/x-www-form-urlencoded format.</p>
<p><a href="https://www.twilio.com/docs/usage/webhooks/webhooks-faq" rel="nofollow noreferrer">https://www.twilio.com/docs/usage/webhooks/webhooks-faq</a></p> | Twilio HTTP Post format for receiving Message | twilio | 0 | 54 | 1 | 72,806,435 | 72,806,435 | 0 | true | 2022-06-28T13:31:18.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Twilio HTTP Post format for receiving Message<p>I am using Twilio for receiving messages.
Currently using a webhook for incoming messages and can't figure ou... |
72,810,140 | How to place the border correctly in the scrollable table<p>I have a sticky header table with fixed height, to view more rows in the table, we need o access them using scroll.</p>
<p>The table design shows border on the table.</p>
<p>The issue is when there are more rows the border moves with the scroll. In the start o... | <p>Fixed it by adding the style to TableContainer instead of Table.</p>
<pre><code>style={{ border: "1px solid black" }}
</code></pre> | How to place the border correctly in the scrollable table | css|typescript|html-table|material-ui|border | 0 | 54 | 1 | 72,810,151 | 72,810,151 | 0 | true | 2022-06-30T03:54:38.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to place the border correctly in the scrollable table<p>I have a sticky header table with fixed height, to view more rows in the table, we need o access ... |
72,813,235 | How to write a file on a particular folder on google colab using Python?<p>I tried this but it gives me a syntax error.
Here 'win' is the folder and dosa_bce_win.py is the code file I want to write inside this folder.</p>
<pre><code>!mkdir win
%%writefile dosa_bce_win.py
</code></pre>
<p>Thanks for the help:)</p> | <p>Okay so now I got the answer:</p>
<pre><code>%%writefile ./win/dosa_bce_win.py
print("Hello")
</code></pre> | How to write a file on a particular folder on google colab using Python? | python|machine-learning|google-colaboratory | 0 | 54 | 1 | 72,813,400 | 72,813,400 | 0 | true | 2022-06-30T09:16:01.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write a file on a particular folder on google colab using Python?<p>I tried this but it gives me a syntax error.
Here 'win' is the folder and dosa_bce... |
72,822,281 | LATERAL syntax in MySQL - Is it just to say that "the left table" is executed first so that the next one can reference it?<p>What does "<em>A derived table cannot contain references to other tables of the same SELECT</em>" mean? <strong>I looked it up in the MySQL documentation</strong></p>
<pre><code>SELECT
... | <p>The key to understanding this is in the manual you have read:</p>
<blockquote>
<p>Derived tables must be constant over the query's duration, not contain references to columns of other FROM clause tables.</p>
</blockquote>
<p>That is, think of the derived table as running at the initial time of the query, before any ... | LATERAL syntax in MySQL - Is it just to say that "the left table" is executed first so that the next one can reference it? | mysql|sql|subquery|correlated-subquery|derived-table | 1 | 54 | 2 | 72,823,086 | 72,823,086 | 0 | true | 2022-06-30T21:35:18.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LATERAL syntax in MySQL - Is it just to say that "the left table" is executed first so that the next one can reference it?<p>What does "<em>A derived ta... |
72,825,578 | Why is getAttribute() in js giving error :?<p>following is the code i wrote.
If i change code in for loop to i<len-1 then its working just fine except for last link
But if i keep it like i<len, it isn't working for any link.</p>
<pre><code>const allLists = document.querySelectorAll("a:link");
var len = ... | <p>Because <code>i</code> variable by <code>len</code> after your looping</p>
<p>Then, each time the click event is called, the code to be run will always be:</p>
<pre><code>const href = allLists[len].getAttribute("href");
</code></pre>
<p>This problem is a <code>closure</code> problem you can see more <a hre... | Why is getAttribute() in js giving error :? | javascript | 0 | 54 | 2 | 72,825,714 | 72,825,714 | 0 | true | 2022-07-01T07:11:49.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is getAttribute() in js giving error :?<p>following is the code i wrote.
If i change code in for loop to i<len-1 then its working just fine except for... |
72,826,046 | excel concatenate 3 cells<p>my question is when ever i try any combination i should get one of the result<br>
row 1 is first letter of cells <br>
row 2 is if Cell A is blank then two letter of Cell B then one letter of Cell C <br>
row 3 is if Cell A and Cell C is blank then three letter of Cell B<br>
row 4 is if Cell C... | <p>Just combine all your conditions into a single formula with SEVERAL if:</p>
<p><a href="https://i.stack.imgur.com/EvS6t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EvS6t.png" alt="enter image description here" /></a></p>
<pre><code>=IF(COUNTA(A1:C1)=3;LEFT(A1;1)&LEFT(B1;1)&LEFT(C1;1);I... | excel concatenate 3 cells | excel|if-statement|concatenation | 0 | 54 | 2 | 72,826,798 | 72,826,798 | 0 | true | 2022-07-01T07:51:34.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
excel concatenate 3 cells<p>my question is when ever i try any combination i should get one of the result<br>
row 1 is first letter of cells <br>
row 2 is if... |
72,828,779 | finding amount of same texts<p>hello I am making a survival game but I don't know how to make if there is some same text in a string it deletes it and then makes it to</p>
<p><code><amount><item.title></code></p>
<p>here is the code</p>
<pre class="lang-cs prettyprint-override"><code>string[] needs = new st... | <p>If you're trying to create a string without duplicates based on your list of items, you can first create another list of items that doesn't contain duplicates. You will need LINQ for this.</p>
<pre><code>var distinctItemGroups = items.GroupBy(item => item.Title);
</code></pre>
<p>I would also recommend using a <a... | finding amount of same texts | c#|string | -1 | 54 | 2 | 72,829,516 | 72,829,516 | 0 | true | 2022-07-01T11:45:51.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
finding amount of same texts<p>hello I am making a survival game but I don't know how to make if there is some same text in a string it deletes it and then m... |
72,826,549 | Can I determine if a subscription is eligible for a "free tier" Cosmos DB account in an ARM template?<p>I'm writing an ARM template that will be executed as part of an installer for an app that will be distributed to some customers. The app depends on Cosmos DB. It would be preferable for the customer for the Cosmos DB... | <p>You can parameterize the <code>enableFreeTier</code> property and specify it at deployment time. Default it to true if you like. How that parameter is ascertained will depend on your deployment process.</p>
<p>Determining the value within the template won't be possible as @NotFound said.</p> | Can I determine if a subscription is eligible for a "free tier" Cosmos DB account in an ARM template? | azure|azure-cosmosdb|arm-template | 0 | 54 | 1 | 72,830,563 | 72,830,563 | 0 | true | 2022-07-01T08:36:22.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I determine if a subscription is eligible for a "free tier" Cosmos DB account in an ARM template?<p>I'm writing an ARM template that will be executed as ... |
72,832,751 | Append Dataframe values in Dictionary by matching Dictionary key with Dataframe Column name Python<p>I'm trying to add values in dictionary of list by matching column name of dataframe with dictionary key.
my value is getting added in dictionary but its adding for each in every key which is present in dictionary not to... | <p>Generating some data</p>
<pre><code>alldata_dict = {'PE_15300': [0], 'PE_15350': [0], 'PE_15400': [0], 'PE_15450': [0], 'PE_15500': [0], 'PE_15550': [0], 'PE_15600': [0], 'PE_15650': [0], 'PE_15700': [0], 'PE_15750': [0], 'PE_15800': [0], 'PE_15850': [0], 'PE_15900': [0]}
df = pd.DataFrame({
15550: [-588],
1... | Append Dataframe values in Dictionary by matching Dictionary key with Dataframe Column name Python | python|pandas|dataframe|dictionary | 0 | 54 | 1 | 72,833,202 | 72,833,202 | 0 | true | 2022-07-01T17:24:11.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Append Dataframe values in Dictionary by matching Dictionary key with Dataframe Column name Python<p>I'm trying to add values in dictionary of list by matchi... |
72,833,884 | Filtering MS Graph query for Planner Tasks<p>I am querying ms graph for planner tasks <a href="https://graph.microsoft.com/v1.0/Planner/Plans/PlanID/tasks" rel="nofollow noreferrer">https://graph.microsoft.com/v1.0/Planner/Plans/PlanID/tasks</a></p>
<p>This returns all the tasks in planner. I am hoping to filter these ... | <p>Unfortunately, Planner doesn't support filters at this time. The recommended approach is for the client to read the data and filter on the client side.</p>
<p>For general filtering and query parameters, this documentation should help: <a href="https://docs.microsoft.com/en-us/graph/query-parameters?view=graph-rest-1... | Filtering MS Graph query for Planner Tasks | microsoft-graph-api|msgraph | 0 | 54 | 1 | 72,834,059 | 72,834,059 | 0 | true | 2022-07-01T19:32:44.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering MS Graph query for Planner Tasks<p>I am querying ms graph for planner tasks <a href="https://graph.microsoft.com/v1.0/Planner/Plans/PlanID/tasks" r... |
72,831,095 | ASP.Net Core on AWS Serverless: The SPA default page middleware could not return the default page '/index.html' because it was not found<p>I have an ASP.Net Core 6.0 application using Angular that runs perfectly fine locally in Visual Studio, but when I deploy it to AWS Serverless and navigate to '/', I get the below e... | <p>My application specifies the location of the Angular app with this line:</p>
<pre><code>services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
</code></pre>
<p>For some reason, I thought that this was only used for development in VS, and that at runtime, it woul... | ASP.Net Core on AWS Serverless: The SPA default page middleware could not return the default page '/index.html' because it was not found | angular|amazon-web-services|asp.net-core|aws-lambda|aws-serverless | 0 | 54 | 1 | 72,834,242 | 72,834,242 | 0 | true | 2022-07-01T14:54:31.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ASP.Net Core on AWS Serverless: The SPA default page middleware could not return the default page '/index.html' because it was not found<p>I have an ASP.Net ... |
72,834,155 | What information is located on the clipboard? Using Python 3, win32clipboard<p>Recently I wanted to write something like a synchronized clipboard. So i wrote this code on <strong>python 3 using win32clipboard from pywin32</strong> to see what is located on clipboard.</p>
<p>'''</p>
<pre><code>import win32clipboard as w... | <p>From <a href="https://docs.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats#standard-clipboard-formats" rel="nofollow noreferrer">the Microsoft docs</a>, there are three classes of clipboard formats: Standard formats, registered formats, and private formats.</p>
<p><a href="https://docs.microsoft.com/en-... | What information is located on the clipboard? Using Python 3, win32clipboard | python|clipboard | 0 | 54 | 1 | 72,834,986 | 72,834,986 | 0 | true | 2022-07-01T20:03:27.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What information is located on the clipboard? Using Python 3, win32clipboard<p>Recently I wanted to write something like a synchronized clipboard. So i wrote... |
72,785,247 | Should you store additional user informations in business database whilst using ASP .Net Identity?<p>so - I've just started working with ASP .Net Identity framework in my newbie project but I've stumbled upon a logic problem regarding users that I don't know how to resolve, so let me tell what I mean by that.</p>
<p>In... | <p>Nevermind, I've found needed informations in this answer (even though I searched before, I've just now found that whole post and answer) - <a href="https://stackoverflow.com/questions/48623667/using-ef-core-identitycontext-and-dbcontext-both-for-order-management/48624628#48624628">using EF Core IdentityContext and D... | Should you store additional user informations in business database whilst using ASP .Net Identity? | c#|database|asp.net-core|asp.net-identity|business-logic | 2 | 54 | 1 | 72,838,420 | 72,838,420 | 0 | true | 2022-06-28T11:00:12.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should you store additional user informations in business database whilst using ASP .Net Identity?<p>so - I've just started working with ASP .Net Identity fr... |
72,838,633 | Configure globally property types mapping for all models using Mapster<p>I have a LocalizedString struct with a GetCurrentLocalization() method and <strong>I want to call it when map an Entity to a DTO</strong> (so I don't have to do it manually). And ideally, do not manually configure mappings every time, but write a ... | <p>Okay, everything turned out to be much easier :)</p>
<pre><code>config.NewConfig<LocalizedString, string>().MapWith(
localized => localized.GetCurrentLocalization());
config.NewConfig<string, LocalizedString>().MapWith(
rawString => (LocalizedString)rawString);
</code></pre> | Configure globally property types mapping for all models using Mapster | c#|.net|mapster | 0 | 54 | 1 | 72,838,881 | 72,838,881 | 0 | true | 2022-07-02T11:21:42.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Configure globally property types mapping for all models using Mapster<p>I have a LocalizedString struct with a GetCurrentLocalization() method and <strong>I... |
72,839,007 | How to iterate over a Map in Kotlin<p>So I am new to Kotlin and I am wondering what's the standard way of iterating a Map. I have tried different ways and all of them seem to work, but I don't know if there's one better than the rest or there are some differences that I am not aware of.</p>
<pre><code> var mutMap = ... | <p>If you browse through Kotlin's <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/" rel="nofollow noreferrer">Collections</a> package there is a whoooole lot of stuff you can use, yeah! Lots of different functions that let you drill down into specific pieces of data (like keys or values vs entr... | How to iterate over a Map in Kotlin | kotlin|dictionary|mutablemap | 0 | 54 | 2 | 72,841,977 | 72,841,977 | 0 | true | 2022-07-02T12:20:28.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to iterate over a Map in Kotlin<p>So I am new to Kotlin and I am wondering what's the standard way of iterating a Map. I have tried different ways and al... |
72,840,322 | Mongoose apply schema property changes to documents<p>I am using mongoose and MongoDB for my Node.js project. I have basic schemas, and since the project is new I am updating some properties in the schemas. But, when I update a schema's some property (this may adding or removing property), the change is not updated to ... | <p>Let's say I created a new property on a UserSchema. The new property is called "test", it is of type String, and it is not required. This new property I added is a <a href="https://www.mongodb.com/docs/atlas/app-services/sync/data-model/update-schema/#breaking-vs.-non-breaking-change-quick-reference" rel="... | Mongoose apply schema property changes to documents | node.js|mongodb|mongoose|schema | 1 | 54 | 1 | 72,842,043 | 72,842,043 | 0 | true | 2022-07-02T15:37:02.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongoose apply schema property changes to documents<p>I am using mongoose and MongoDB for my Node.js project. I have basic schemas, and since the project is ... |
72,848,525 | Comparing two dates in different formats<p>I have two dates, one is a string in following format,</p>
<pre><code>"2022-07-03T12:23:49.000Z"
</code></pre>
<p>The other is a <code>datetime</code> object from this:</p>
<pre><code>minimumDate = datetime.today() - timedelta(days=10)
</code></pre>
<p>How can I for... | <p>You can convert your format of date to datetime object using the below:</p>
<pre><code>date_str = "2022-07-03T12:23:49.000Z"
date_formatted = datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S.%fZ")
</code></pre>
<p>Then both the formatted date(date_formatted) and minimumDate will be in datetime form... | Comparing two dates in different formats | python|datetime|format | 0 | 54 | 2 | 72,848,770 | 72,848,770 | 0 | true | 2022-07-03T17:20:39.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparing two dates in different formats<p>I have two dates, one is a string in following format,</p>
<pre><code>"2022-07-03T12:23:49.000Z"
</code>... |
72,854,780 | Getting IndexOutOfBoundsException in ArrayList while using .add(index, element)<p>I am using the <code>list.add(index, element)</code> function to insert elements into an ArrayList, where the index is not in order.</p>
<p>For eg,
first i call <code>list.add(5, element5)</code>
and then <code>list.add(3, element3)</code... | <p>You can only use indexes that are existing or one larger than the last existing. Otherwise you would have some spots with no element in it.
If you need a ficxed length to store elements on a specified position, try to fill the List before with empty entries or use an array:</p>
<pre><code>MyElement[] myArray = new M... | Getting IndexOutOfBoundsException in ArrayList while using .add(index, element) | java|android|android-studio|arraylist | 0 | 54 | 5 | 72,855,308 | 72,855,308 | 0 | true | 2022-07-04T09:48:22.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting IndexOutOfBoundsException in ArrayList while using .add(index, element)<p>I am using the <code>list.add(index, element)</code> function to insert ele... |
72,846,232 | When appending elements in the list in Python, using while loop, it returns only the result of the first iteration<p>Learning web scraping in Python using Selenium. I want to scrape the prices and names of the goods from Amazon and store them in a list. I'm doing it using while loop until it is impossible to click to t... | <p>Add a sleep as shown below</p>
<pre><code>while True:
try:
web_elements_names = driver.find_elements(By.CLASS_NAME,
"a-size-base-plus.a-color-base.a-text-normal") # names (webelems)
web_elements_prices = driver.find_elements(By.CLASS_NA... | When appending elements in the list in Python, using while loop, it returns only the result of the first iteration | python|selenium|while-loop|try-except|timeoutexception | 0 | 54 | 1 | 72,855,432 | 72,855,432 | 0 | true | 2022-07-03T11:46:57.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When appending elements in the list in Python, using while loop, it returns only the result of the first iteration<p>Learning web scraping in Python using Se... |
72,857,941 | ERROR TypeError: Cannot read properties of undefined (reading 'push') in child element in angular<p>I have this array in my child element</p>
<pre><code> @Input() listAnswer: any;
changestyle(event)
{
let activeSpan = event.target;
this.listAnswer.push(activeSpan.innerText.trim());
}
</code></pre>
<p>pass... | <p>your listanswer needs to be declared as an array:</p>
<pre><code>@Input listAnswer: any[];
</code></pre>
<p>and in your parent component also needs to have its listAnswer property be an array type.</p> | ERROR TypeError: Cannot read properties of undefined (reading 'push') in child element in angular | angular|typescript | 0 | 54 | 2 | 72,858,079 | 72,858,079 | 0 | true | 2022-07-04T13:58:01.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ERROR TypeError: Cannot read properties of undefined (reading 'push') in child element in angular<p>I have this array in my child element</p>
<pre><code> @I... |
72,858,206 | What's the good write to display this json form in angular 13<p>So to be simple i've got in json this:<a href="https://i.stack.imgur.com/4vKNW.png" rel="nofollow noreferrer">response img</a> my classes are :</p>
<pre><code>export class Operation {
operations?: (OperationDetail);//change by OperationDetail[]
... | <p>Try with an array :</p>
<pre><code>operations?: OperationsDetails[];
</code></pre> | What's the good write to display this json form in angular 13 | html|json|angular|typescript | -4 | 54 | 2 | 72,858,291 | 72,858,291 | 0 | true | 2022-07-04T14:20:32.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the good write to display this json form in angular 13<p>So to be simple i've got in json this:<a href="https://i.stack.imgur.com/4vKNW.png" rel="nofo... |
72,827,960 | How to get image classification prediction from GCP AIPlatform in ruby?<p>I'm new with ruby and I want to use GCP AIPlatform but I'm struggeling with the payload.</p>
<p>So far, I have :</p>
<pre class="lang-rb prettyprint-override"><code>client = ::Google::Cloud::AIPlatform::V1::PredictionService::Client.new do |confi... | <p>I managed it</p>
<pre class="lang-rb prettyprint-override"><code>client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new do |config|
config.endpoint = "#{location}-aiplatform.googleapis.com"
end
img = File.open(imgPath, 'rb') do |img|
Base64.strict_encode64(img.read)
end
instance = Goog... | How to get image classification prediction from GCP AIPlatform in ruby? | ruby|google-cloud-vertex-ai | 0 | 54 | 1 | 72,858,789 | 72,858,789 | 0 | true | 2022-07-01T10:33:22.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get image classification prediction from GCP AIPlatform in ruby?<p>I'm new with ruby and I want to use GCP AIPlatform but I'm struggeling with the pay... |
72,781,338 | Transform GA API output to structured json format<h2>I would like to convert json data below into structured json format using Jolt Transformation.</h2>
<p><strong>Input data:</strong></p>
<pre><code> "containsSampledData": false,
"columnHeaders": [
{
"name": "ga:pagePath... | <p>Considering this as your input</p>
<p>Input:</p>
<pre><code>{
"containsSampledData": false,
"columnHeaders": [
{
"name": "ga:pagePath",
"columnType": "DIMENSION",
"dataType": "STRING"
},
{
"na... | Transform GA API output to structured json format | json|jolt | 0 | 54 | 1 | 72,860,007 | 72,860,007 | 0 | true | 2022-06-28T05:53:24.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transform GA API output to structured json format<h2>I would like to convert json data below into structured json format using Jolt Transformation.</h2>
<p><... |
72,861,129 | Detached HEAD on same commit as main?<p>I'm not really sure how I got my repository in this situation, and it's not even a problem anymore, but I'd like to learn about what happened so I don't feel so lost next time.</p>
<p>When doing a pull, I was warned I was in detached HEAD state. <code>git status</code> showed the... | <p>These are really two separate questions:</p>
<ol>
<li>
<blockquote>
<p>trying to understand the difference between what git log showed on the first and second time I ran it (the one with the arrow vs. the one with just a comma),</p>
</blockquote>
</li>
<li>
<blockquote>
<p>understand how I got to that situation in t... | Detached HEAD on same commit as main? | git|github|git-checkout|git-log | 2 | 54 | 3 | 72,861,360 | 72,861,360 | 0 | true | 2022-07-04T19:12:46.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detached HEAD on same commit as main?<p>I'm not really sure how I got my repository in this situation, and it's not even a problem anymore, but I'd like to l... |
72,861,121 | Placing Other Tkinter Objects in Front of Label Objects<p>I'm new here, so forgive any glaring stackoverflow convention issues. I am working with tkinter, and I have placed images across my canvas using label objects. Now I would like to place other canvas objects (for instance, ovals) on top of the images, but I'm fin... | <p>The canvas documentation explicitly states that you cannot draw above embedded widgets:</p>
<p><em>"Note: due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that ... | Placing Other Tkinter Objects in Front of Label Objects | python|image|tkinter | 0 | 54 | 1 | 72,873,364 | 72,873,364 | 0 | true | 2022-07-04T19:12:12.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Placing Other Tkinter Objects in Front of Label Objects<p>I'm new here, so forgive any glaring stackoverflow convention issues. I am working with tkinter, an... |
72,873,787 | Selenium : Get a div that contains a specific div class inside it<p>I have a page structure which contains a classname assigned to multiple divs. But there is one specific div that will contain a specific div.class inside it which happens dynamically.</p>
<pre><code><div class="ProductVariants__VariantCard-sc-1... | <p>If you want to select ancestor node that <em>contain specific descendant node</em> try</p>
<pre><code>driver.find_element(by=By.XPATH, value="//div[contains(@class,'ProductVariants__VariantCard-sc-1unev4j-3 bEuNss') and .//div[contains(@class, 'ProductVariants__RadioButtonInner-sc-1unev4j-6 fgFqYM')]]")
</... | Selenium : Get a div that contains a specific div class inside it | python|selenium|selenium-webdriver|selenium-chromedriver|findelement | 1 | 54 | 2 | 72,873,961 | 72,873,961 | 0 | true | 2022-07-05T18:08:35.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selenium : Get a div that contains a specific div class inside it<p>I have a page structure which contains a classname assigned to multiple divs. But there i... |
72,862,649 | Appending a string to the URL using a form<p>This is my form:</p>
<pre><code><form method="post">
{% csrf_token %}
<input class="search" type="text" name="q" placeholder="Search Encyclopedia">
<input type="submit">
</code></pre>
<p>How can I... | <p>At the end, I made it by this way via django:</p>
<pre><code>from django.shortcuts import redirect
if request.method=="POST":
try:
title = request.POST.get("q")
return redirect(f'/wiki/{title}')
</code></pre> | Appending a string to the URL using a form | python|html|django|visual-studio-code | 1 | 54 | 1 | 72,882,329 | 72,882,329 | 0 | true | 2022-07-04T22:59:48.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Appending a string to the URL using a form<p>This is my form:</p>
<pre><code><form method="post">
{% csrf_token %}
<input class="sea... |
72,887,420 | Exception: synthesize_speech() takes from 1 to 2 positional arguments but 4 were given<p>I am new a coding tourist struggling to fix a chabot project that worked well in the past. The project is built on Python 3.7.0. It began a Tensorflow 1.15 but has been upgraded to Tensorflow 2.9.1. . When running google text to... | <p>Instead of passing as positional arguments</p>
<pre><code>response = client.synthesize_speech(synthesis_input, voice, audio_config)
</code></pre>
<p>pass as named arguments</p>
<pre><code>response = client.synthesize_speech(
input=synthesis_input,
voice=voice,
audio_config=audio_config
)
</code></pre>
<p... | Exception: synthesize_speech() takes from 1 to 2 positional arguments but 4 were given | python|tensorflow|google-cloud-platform|google-text-to-speech|speech-synthesis | 0 | 54 | 1 | 72,887,507 | 72,887,507 | 0 | true | 2022-07-06T17:04:33.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exception: synthesize_speech() takes from 1 to 2 positional arguments but 4 were given<p>I am new a coding tourist struggling to fix a chabot project that wo... |
72,889,447 | TextFormField - How to change cursor color<p>I'm would like to change the cursor color in a <code>TextFormField</code>.</p>
<p>I don't find the <code>Property</code>.</p>
<p>To know I'm on a Flutter web app and not mobile.</p> | <p>From <a href="https://stackoverflow.com/a/65898579/14434426">this</a> answer:</p>
<blockquote>
<p>You can change specific textfield cursor color for your solution:</p>
<p>TextField(cursorColor: Colors.white)</p>
<p>but if you want to change it completely in your project then you can
check <a href="https://stackoverf... | TextFormField - How to change cursor color | flutter|flutter-layout|flutter-web | 1 | 54 | 1 | 72,889,674 | 72,889,674 | 0 | true | 2022-07-06T20:22:13.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TextFormField - How to change cursor color<p>I'm would like to change the cursor color in a <code>TextFormField</code>.</p>
<p>I don't find the <code>Propert... |
72,897,125 | "ValueError: I/O operation on closed file" on saving multiple DataFrames in 1 excel file<p>I'm having an error output trying to save multiple DataFrames in a singles excel file.
Here's my code:</p>
<pre><code>import pandas as pd
path = ['path1.txt', 'path2.txt', 'path3.txt']
data = []
data = [pd.read_csv(i, sep=&quo... | <p>The context manager in the <code>with</code> clause closes the file when you exit the block. The additional explicit <code>writer.close()</code> call is redundant and causes this error. Remove it and you should be OK.</p> | "ValueError: I/O operation on closed file" on saving multiple DataFrames in 1 excel file | python|pandas | 1 | 54 | 1 | 72,897,161 | 72,897,161 | 0 | true | 2022-07-07T11:37:04.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"ValueError: I/O operation on closed file" on saving multiple DataFrames in 1 excel file<p>I'm having an error output trying to save multiple DataFrames in a... |
72,901,316 | React useReducer conditional dispatch<p>I am trying to implement a "use company address" button that autofills the inputs if selected.</p>
<p>I get the pre-filled values as expected, however when I hit submit, the data for these fields are blank/didn't update.</p>
<p>My Code:</p>
<pre><code> <Ad... | <p>In case anyone reads this. The issue was the state was not being set before the onChange was triggered.</p>
<pre><code> value={
useCompAddr ? (state.street = companyAddress?.street) : state.street } onChange={(e) => dispatch({ field: "street", payload: e.target.value }) }
</code></pre>
<p>was the sol... | React useReducer conditional dispatch | reactjs|use-reducer | 0 | 54 | 1 | 72,905,699 | 72,905,699 | 0 | true | 2022-07-07T16:27:17.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React useReducer conditional dispatch<p>I am trying to implement a "use company address" button that autofills the inputs if selected.</p>
<p>I get... |
72,906,140 | how to “extract” values from a column, in which values are found in a dictionary<p>I have a dataframe <code>df1</code>:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ID</th>
<th>item</th>
</tr>
</thead>
<tbody>
<tr>
<td>11111</td>
<td>chair</td>
</tr>
<tr>
<td>11112</td>
<td>desk¥blue cha... | <p>You can try this:</p>
<pre><code># !pip install -U swifter #### only in case of very large dataframe
import swifter
delimiter = '¥'
df1['category'] = df1['item'].swifter.apply(
lambda _: delimiter.join([item_dict.get(el, '') for el in _.split(delimiter)])
)
</code></pre> | how to “extract” values from a column, in which values are found in a dictionary | python|pandas | 0 | 54 | 1 | 72,906,307 | 72,906,307 | 0 | true | 2022-07-08T02:46:18.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to “extract” values from a column, in which values are found in a dictionary<p>I have a dataframe <code>df1</code>:</p>
<div class="s-table-container">
<... |
72,912,658 | unexpected EOF while looking for matching `"' bash while im trying to execute command outside a Docker container<p>I dont know what is happening here. Im executing a script that contains the following line:</p>
<pre><code>var="${comand} bash -c \"export PATH=/local/Miniconda3/bin:$PATH >> ~/.bashrc; /l... | <p>You don't really want <code>docker exec</code> here at all. This is a debugging tool that you can use to inspect a running container; I'd use it the same way I'd use a language-specific debugger like Python's <code>pdb</code>.</p>
<p>If you want to run a one-off command like this, you can use <code>docker run</code... | unexpected EOF while looking for matching `"' bash while im trying to execute command outside a Docker container | python|bash|docker|shell|containers | 0 | 54 | 1 | 72,913,526 | 72,913,526 | 0 | true | 2022-07-08T14:09:07.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
unexpected EOF while looking for matching `"' bash while im trying to execute command outside a Docker container<p>I dont know what is happening here. Im exe... |
72,918,188 | How to aggregate in pandas with some conditions?<p>I want to aggregate my data in this way:</p>
<pre><code>df.groupby('date').agg({ 'user_id','nunique',
'user_id':'nunique' ONLY WHERE purchase_flag==1})
date | user_id | purchase_flag
4-1-2020 | 1 | 1
4-1-2020 | 1 | 1 (purchased... | <p>Try this by creating helper column in your dataframe to indicate users who purchased first then groupby and aggregate on that helper column:</p>
<pre><code>df["user_id_purchased"] = df["user_id"].where(df["purchase_flag"].astype(bool))
df_output = df.groupby("date", as_index=F... | How to aggregate in pandas with some conditions? | python|pandas | 1 | 54 | 2 | 72,918,366 | 72,918,366 | 0 | true | 2022-07-09T00:50:15.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to aggregate in pandas with some conditions?<p>I want to aggregate my data in this way:</p>
<pre><code>df.groupby('date').agg({ 'user_id','nunique',
... |
72,918,764 | How to set Max Items Per Row in Responsive Grids in Flutter<p>I have a responsive grid that returns two containers in a row because that's what I want. the problem is that whenever I view the app on a tablet, the grid looks ugly because it expands. I then set the max item per row to 4 so 4 containers appear if the scre... | <p>one trick is to use the width of the device screen and handle this issue with simple short <code>if</code>
for example:</p>
<pre><code>maxItemsPerRow: MediaQuery.of(context).size.width >= 600? 4: 2,
</code></pre> | How to set Max Items Per Row in Responsive Grids in Flutter | flutter|dart|flutter-layout|flutter-dependencies|flutter-web | 0 | 54 | 1 | 72,918,792 | 72,918,792 | 0 | true | 2022-07-09T03:38:13.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set Max Items Per Row in Responsive Grids in Flutter<p>I have a responsive grid that returns two containers in a row because that's what I want. the p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.