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,178,753 | How to make a status command in discord.js<p>I want to make a command that changes my bots status. all i know is that <code>client.user.setActivity('STATUS');</code> sets a status but im having trouble getting the status to set from the message</p> | <p>There are more elements to the status than just a string</p>
<pre class="lang-js prettyprint-override"><code>client.user.setActivity({
name: `Actual text here`,
type: '', // 1 of the 4 below here
});
// 'WATCHING'
// 'LISTENING'
// 'PLAYING'
// 'STREAMING'
</code></pre>
<p>Depending on how you have your com... | How to make a status command in discord.js | javascript|node.js|discord.js | 0 | 45 | 1 | 72,178,831 | 72,178,831 | 2 | true | 2022-05-09T22:17:35.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a status command in discord.js<p>I want to make a command that changes my bots status. all i know is that <code>client.user.setActivity('STATUS')... |
72,178,276 | Error on export_text for decision tree Sklearn<p>I'm trying to use the function <code>export_text</code> from sklearn.tree (version 1.0.2), but when I'm using the parameter feature_names I get an error, this is what I'm trying</p>
<pre class="lang-py prettyprint-override"><code># decision_tree is the fitted algorithm
t... | <p>It looks like a small bug in the export_text code. Try forcing <code>features_names_in_</code> to be a python list.</p>
<pre><code># decision_tree is the fitted algorithm
text_representation = export_text(decision_tree=decision_tree, feature_names=decision_tree.feature_names_in_.tolist())
</code></pre>
<p>I assume y... | Error on export_text for decision tree Sklearn | python|scikit-learn|decision-tree | 0 | 72 | 1 | 72,179,021 | 72,179,021 | 2 | true | 2022-05-09T21:15:03.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error on export_text for decision tree Sklearn<p>I'm trying to use the function <code>export_text</code> from sklearn.tree (version 1.0.2), but when I'm usin... |
72,179,118 | Place a small array into a big array<p>I have 2 arrays; one is small array and second is big array as follows,</p>
<pre><code>import pandas as pd
import numpy as np
dat1 = np.array([2, 3 ,4 ,4 ,3 ,2, 2, 4 ,3 ,4 ,4, 3])
dat2 = np.array([1, 4 ,4, 4, 2 ,1, 3 ,3 ,2, 3, 3, 1])
small_array = pd.crosstab(dat1, dat2)
big_arra... | <p>You can <code>update</code> <code>big_array</code> in-place:</p>
<pre class="lang-py prettyprint-override"><code>big_array.update(small_array)
print(big_array)
</code></pre>
<p>If you want to create a new DataFrame, you can use <code>combine_first</code>:</p>
<pre class="lang-py prettyprint-override"><code>out = sma... | Place a small array into a big array | arrays|python-3.x|pandas|numpy | 0 | 34 | 2 | 72,179,136 | 72,179,136 | 2 | true | 2022-05-09T23:15:49.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Place a small array into a big array<p>I have 2 arrays; one is small array and second is big array as follows,</p>
<pre><code>import pandas as pd
import nump... |
72,179,115 | How to calculating interval days by factor in R<p>I have this dataset and I would like to calculate the duration of days for each ID. How can I do this? If the date jumped from the 26th to the 30th for example, I would like those days to be counted as well. I tried with <code>summarise()</code> and <code>aggregate()</c... | <pre><code>df %>%
group_by(id) %>%
summarise(days=difftime(max(date),min(date), units = "day"))
</code></pre> | How to calculating interval days by factor in R | r|datetime|aggregate|lubridate|summarize | 0 | 34 | 1 | 72,179,417 | 72,179,417 | 2 | true | 2022-05-09T23:15:04.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculating interval days by factor in R<p>I have this dataset and I would like to calculate the duration of days for each ID. How can I do this? If t... |
72,179,792 | Combine a span of columns in Pandas based on a condition (exclude nans)<p>Let's say I have a <code>dataframe</code> like this:</p>
<pre><code> a b c d
0 S t f nan
1 S t t nan
2 S f nan nan
3 Q t nan nan
</code></pre>
<p>I want to combine the last 3 columns into a single column, as an ar... | <p>You could use a nested list comprehension where you use the fact that NaN is not equal to itself to filter out NaNs:</p>
<pre class="lang-py prettyprint-override"><code>df['e'] = [[x for x in ary if x==x] for ary in df.iloc[:,-3:].to_records(index=False)]
</code></pre>
<p>Output:</p>
<pre class="lang-py prettyprint-... | Combine a span of columns in Pandas based on a condition (exclude nans) | python|pandas|dataframe | 0 | 73 | 2 | 72,179,841 | 72,179,841 | 2 | true | 2022-05-10T01:30:05.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine a span of columns in Pandas based on a condition (exclude nans)<p>Let's say I have a <code>dataframe</code> like this:</p>
<pre><code> a b c ... |
72,179,861 | localStorage data keeps resetting on page reload - React js<p>Error: <code>localStorage</code> data keeps resetting on page reload. Despite of being updated to localStorage before.</p>
<p>If I add new todo item, it is added to localStorage. But the updated items disappears after page reload and I get initial state valu... | <p>The issue you were running into is that your <code>useEffect</code> to set the todos from the storage happens at a bad time in comparison with the one to set it.</p>
<p>So, instead of using an effect to grab the todos, get them synchronously with the state. This style of <code>useState</code> with a function argumen... | localStorage data keeps resetting on page reload - React js | reactjs|react-hooks|local-storage | 0 | 371 | 2 | 72,179,937 | 72,179,937 | 2 | true | 2022-05-10T01:44:25.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
localStorage data keeps resetting on page reload - React js<p>Error: <code>localStorage</code> data keeps resetting on page reload. Despite of being updated ... |
72,179,439 | Is it possible to get executable file icon by Golang?<p>I'm trying to write a "Download Page Website", and I trying to show the file icon to my webpage.</p>
<p>Like Windows system, ".exe" file has icon image inside. Or linux executable file. Can I read it?</p>
<p>I know python can do it with a packa... | <p>You can use the linux package in your advantage.</p>
<p>For example, you can use <code>icoextract</code>, which can be installed via apt:</p>
<pre><code>apt install icoextract
</code></pre>
<p>And then run it like this:</p>
<pre><code>icoextract /path/to/file.exe /path/to/file.ico
</code></pre>
<p>Go make possible t... | Is it possible to get executable file icon by Golang? | go | 0 | 192 | 1 | 72,179,938 | 72,179,938 | 2 | true | 2022-05-10T00:14:41.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to get executable file icon by Golang?<p>I'm trying to write a "Download Page Website", and I trying to show the file icon to my web... |
72,179,388 | Delete duplicated fields in Array of Hashes Ruby<p>I have a Array of Hashes that have JSONs with duplicated fields and I want to delete the duplicated ones:</p>
<pre><code>[ {
"code" : "32F",
"lon" : 0.963335,
"fint" : "2022-05-03T13:00:00",
"prec" : 0... | <p>First you have wrong syntax</p>
<p><code>"code" : "32F",</code> -- you don't need whitespace here</p>
<p>Right variant is <code>"code": "32F",</code></p>
<p>And you even don't need quotes here. Just <code>code: "32F",</code></p>
<p>To <strong>delete</strong> duplicat... | Delete duplicated fields in Array of Hashes Ruby | arrays|ruby|hash | 0 | 60 | 3 | 72,179,939 | 72,179,939 | 2 | true | 2022-05-10T00:05:25.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete duplicated fields in Array of Hashes Ruby<p>I have a Array of Hashes that have JSONs with duplicated fields and I want to delete the duplicated ones:<... |
72,179,672 | How to print every number that is divisible by either 3 or 5, but not both?<p>I have a function threeOrFive(max). It should loop every number that is divisible by either 3 or 5 but not both. So it won't loop 15 since it's divisible by both numbers but will print out "3, 5, 6 , 9, 10, 12, 18".</p>
<p>The code ... | <p>You can use this function. This will return a array of all numbers that divisible by 3 or 5 but not by both.</p>
<pre><code>const threeOrFive = max => {
const store = [];
for(let i = 0; i < max; i++){
if (i%3==0 && i%5==0) continue;
else if (i%3==0) store.push(i);
else... | How to print every number that is divisible by either 3 or 5, but not both? | javascript|loops | 0 | 199 | 1 | 72,179,962 | 72,179,962 | 2 | true | 2022-05-10T01:06:46.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to print every number that is divisible by either 3 or 5, but not both?<p>I have a function threeOrFive(max). It should loop every number that is divisib... |
72,178,236 | How to take multiple value from multiple drop downs in the same POST form in Django<p>Hello I am creating a cinema book system in Django, and the user must select a film and its date/time from two drop down menus. My issue is that it only takes the film and not date/time. I was wondering how I would be able to add thes... | <p>You haven't given your selectedDate dropdown a name. Note that your film dropdown has a name attribute and works. Try</p>
<pre><code><select id="selectedDate" name="selectedDate">
</code></pre>
<p>This will enable the selection to be pulled by your view.</p>
<p>Also, probably best to remo... | How to take multiple value from multiple drop downs in the same POST form in Django | python|django|django-forms | 0 | 18 | 1 | 72,179,969 | 72,179,969 | 2 | true | 2022-05-09T21:09:14.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to take multiple value from multiple drop downs in the same POST form in Django<p>Hello I am creating a cinema book system in Django, and the user must s... |
72,180,058 | How to make image fit to div and centered at the same time?<p>If I want to fit a large image(with arbitrary aspect ratio) into a small div, according to <a href="https://stackoverflow.com/a/3029434/3043719">this answer</a>, I just need to set the maximum width and height to 100%,</p>
<pre class="lang-css prettyprint-ov... | <p>you can use display flex:</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>.div {
border: 1px solid;
display: flex;
justify-content: center;
align-items: center;
}
... | How to make image fit to div and centered at the same time? | javascript|css | 0 | 72 | 3 | 72,180,148 | 72,180,148 | 2 | true | 2022-05-10T02:21:12.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make image fit to div and centered at the same time?<p>If I want to fit a large image(with arbitrary aspect ratio) into a small div, according to <a h... |
72,178,752 | Passing variables from one php file to another with sessions and resetting the session<p>So I have these two pages: one page has a form that will take some text, and it is supposed to show it on another page. So I have a php script that will catch the value from the input and through session and a php file is suppose t... | <p>Remove the include 'enter-content' on the 'content' page.</p>
<p>The include calls session_start(), that would be the second call on the same page.</p> | Passing variables from one php file to another with sessions and resetting the session | php|html|session | 0 | 59 | 1 | 72,180,198 | 72,180,198 | 2 | true | 2022-05-09T22:16:58.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing variables from one php file to another with sessions and resetting the session<p>So I have these two pages: one page has a form that will take some t... |
72,177,863 | Populate HighCharts Dataset in Javascript from ViewData Object .Net Core<p>I'm trying to use HighCharts in .Net and having difficulty in populating the dataset that HighChart uses on the chart. Originally I was doing it in the view using the following:</p>
<pre><code>new BubbleSeries
{
Data = (ViewData["bubbl... | <p>Here is a working sample:</p>
<p>model:</p>
<pre><code>public class BubbleSeriesData {
public int x { get; set; }
public int y { get; set; }
public int z { get; set; }
public string name { get; set; }
public string country { get; set; }
}
</code></pre>
<p>ViewData:</p>
<p... | Populate HighCharts Dataset in Javascript from ViewData Object .Net Core | asp.net-core|highcharts|.net-core-3.1 | 0 | 27 | 1 | 72,180,216 | 72,180,216 | 2 | true | 2022-05-09T20:26:16.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Populate HighCharts Dataset in Javascript from ViewData Object .Net Core<p>I'm trying to use HighCharts in .Net and having difficulty in populating the datas... |
72,179,333 | Is it possible to override the return of a controller method using a NestJS decorator?<p>I'd like to create an <code>@IgnoreDev</code> decorator that overrides a method return on a NestJS controller when it detects that we're running code in a dev environment.</p>
<p>For example:</p>
<pre><code>@Controller()
class Some... | <p>I would agree with Mical Levi. You can use Interceptors for overriding the response from the controller.</p>
<p>Create a new file with the name <strong>response.override.interceptor.ts</strong>
Place the following code :</p>
<pre><code>import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from "... | Is it possible to override the return of a controller method using a NestJS decorator? | controller|overriding|nestjs|decorator | 0 | 188 | 1 | 72,181,439 | 72,181,439 | 2 | true | 2022-05-09T23:57:53.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to override the return of a controller method using a NestJS decorator?<p>I'd like to create an <code>@IgnoreDev</code> decorator that overrid... |
72,181,499 | Convert a list of jsons into a dataframe and then step-by-step<p>I have a problem. I have a list that contains <code>2549150</code> elements. However, I don't want to convert the whole list into a dataframe at once, using the <code>pd.json_normalize</code> method.</p>
<p>I would like to convert the list into a datafram... | <p>Rather than step up to your guess at how many elements there should be, step by the chunk size up to the length of the array instead:</p>
<pre class="lang-py prettyprint-override"><code>df_complete = pd.DataFrame()
chunk = 100000
for i in range(0, len(a1D), chunk):
df = pd.json_normalize(a1D[i:i+chunk], sep='_')... | Convert a list of jsons into a dataframe and then step-by-step | python|json|pandas|dataframe|for-loop | 0 | 22 | 1 | 72,181,685 | 72,181,685 | 2 | true | 2022-05-10T06:17:11.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a list of jsons into a dataframe and then step-by-step<p>I have a problem. I have a list that contains <code>2549150</code> elements. However, I don'... |
72,142,088 | How to load my own map in indoor map app?<p>I tried to run the indoor_map_app example in navigate\flutter but it shows a blank map, How can I load my own map to the example or get the venue id to search for it and load my own indoor map in the application ?</p> | <p>Did the HERE team already create the indoor map for you? Then you should have received a map ID (venue ID) which you can also enter inside the example application.</p>
<p>But just for your information, I think it's hard to find that info on the HERE website: You are just able to use indoor maps if you have a contrac... | How to load my own map in indoor map app? | here-api | 0 | 168 | 1 | 72,181,739 | 72,181,739 | 2 | true | 2022-05-06T13:16:27.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load my own map in indoor map app?<p>I tried to run the indoor_map_app example in navigate\flutter but it shows a blank map, How can I load my own map... |
72,181,855 | How to increment number in roman word in flutter/dart<p>I need to increment number dynamically in <code>Roman</code></p>
<p><img src="https://i.stack.imgur.com/iDwAE.png" alt="something like:" /></p> | <p>You can increment by int and convert it to number in roman by this library :</p>
<p><a href="https://pub.dev/packages/numerus" rel="nofollow noreferrer">numerus</a></p>
<pre><code>final n = 2;
print(n.toRomanNumeralString());
</code></pre> | How to increment number in roman word in flutter/dart | flutter|dart | 0 | 61 | 3 | 72,181,918 | 72,181,918 | 2 | true | 2022-05-10T06:55:02.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to increment number in roman word in flutter/dart<p>I need to increment number dynamically in <code>Roman</code></p>
<p><img src="https://i.stack.imgur.c... |
72,182,120 | Use property in formula<p>I've added to my Excel file a new property <code>prop</code>.</p>
<p>picture of my property from the settings</p>
<p><a href="https://i.stack.imgur.com/ONvSn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ONvSn.png" alt="enter image description here" /></a></p>
<p>I would n... | <p>You can't directly use the property in a formula, you'd have to use a macro or UDF, and reference the <a href="https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.customdocumentproperties" rel="nofollow noreferrer">workbook.customdocumentproperties</a> object to get the value.</p>
<p>However, to suggest a... | Use property in formula | excel|properties|formula | 0 | 46 | 2 | 72,182,202 | 72,182,202 | 2 | true | 2022-05-10T07:18:03.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use property in formula<p>I've added to my Excel file a new property <code>prop</code>.</p>
<p>picture of my property from the settings</p>
<p><a href="https... |
72,182,170 | My code is printing none, and i dont know why<p>I was just like studying/practicing, and I want to start by creating the "Menu":</p>
<pre><code>Menu = input(print("Please choose an option from the menu: \n 1. Information \n 2. Modify my account \n 3. Log out"))
if Menu == "1" or Menu == &... | <p>You don't need a print inside your input.</p>
<p>Also, please use code formatting next time.</p>
<p>Here you go</p>
<pre class="lang-py prettyprint-override"><code>menu = input("Please choose an option from the menu: \n 1. Information \n 2. Modify my account \n 3. Log out\n")
if menu == "1" or m... | My code is printing none, and i dont know why | python-3.x | 0 | 31 | 1 | 72,182,277 | 72,182,277 | 2 | true | 2022-05-10T07:23:11.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My code is printing none, and i dont know why<p>I was just like studying/practicing, and I want to start by creating the "Menu":</p>
<pre><code>Men... |
72,180,104 | Trouble pinpointing source of uninitialized value<p>I am writing a simple earthquake detection program for the BeagleBone Green using a vibration sensor that I have hooked up, together with a cape that has a built in accelerometer and digit display. The brains of the earthquake detector are located in the <code>Earthqu... | <p>Unless I'm mistaken your problem is your constructor</p>
<pre><code>Accelerometer::Accelerometer() {
std::atomic<bool> shutdown(false);
std::atomic<double> current_reading(0.0f);
std::atomic<double> highest_reading(0.0f);
// Activate accelerometer using I2C.
ActivateAcceleromet... | Trouble pinpointing source of uninitialized value | c++|initialization|embedded-linux|valgrind | 0 | 50 | 1 | 72,182,566 | 72,182,566 | 2 | true | 2022-05-10T02:28:04.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trouble pinpointing source of uninitialized value<p>I am writing a simple earthquake detection program for the BeagleBone Green using a vibration sensor that... |
72,182,725 | React reducer - data.map is not a function or how to add values to case in a reducer<p>I have this reducer:</p>
<pre><code>export const reducer = ( state, { type, payload } ) => {
switch ( type ) {
case 'SET_TOURS_IN_CART':
return { ...state, toursInCart: payload };
default:
... | <p>You return an object, not an array: <code>return { ...state, toursInCart: payload };</code> (the <code>toursInCart: payload</code> part)</p>
<p>If you want to add the <code>payload</code> to the array <code>toursInCart</code>,
try:</p>
<pre><code>return {...state, toursInCart: [...state.toursInCart, payload]}
</code... | React reducer - data.map is not a function or how to add values to case in a reducer | reactjs|use-context|use-reducer | 0 | 78 | 1 | 72,182,763 | 72,182,763 | 2 | true | 2022-05-10T08:06:03.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React reducer - data.map is not a function or how to add values to case in a reducer<p>I have this reducer:</p>
<pre><code>export const reducer = ( state, { ... |
72,182,423 | Stop an input field in a form from being submitted in react-hook-form in react<p>I was doing form validation in <strong>react</strong> with <strong>react-hook-form</strong> npm package. It has field like First Name, Last Name, Email, Password and Confirm Password. When I click on submit it will be handled by <strong>ha... | <p>You can remove those fields in handleSubmit callback:</p>
<pre><code>const onSubmit = (data) => {
delete data.confirmPassword;
alert(JSON.stringify(data));
};
</code></pre>
<p>working example:
<a href="https://codesandbox.io/s/react-hook-form-handlesubmit-v7-uqmiy?file=/src/index.jsx:195-230... | Stop an input field in a form from being submitted in react-hook-form in react | javascript|reactjs|validation|react-hook-form | 0 | 455 | 1 | 72,182,896 | 72,182,896 | 2 | true | 2022-05-10T07:42:03.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop an input field in a form from being submitted in react-hook-form in react<p>I was doing form validation in <strong>react</strong> with <strong>react-hoo... |
72,181,896 | Unexpected token s in JSON at position 7 at parse (<anonymous>)<p>Why I get this error when I want to start the grahpql server?
I have no error on line 7
I want to start this server on port 3000 with json-graphql-server servergql.json.
<a href="https://i.stack.imgur.com/SqCUn.png" rel="nofollow noreferrer"><img src="ht... | <p>The JSON you've written is malformed - for a valid JSON file your object keys must be strings and must be contained within quotes ("").</p>
<p>The error you're seeing somewhat shows you what the problem is: <code>unexpected token s in JSON at position 7</code> which is highlighting that <code>students</cod... | Unexpected token s in JSON at position 7 at parse (<anonymous>) | json|graphql | 0 | 33 | 1 | 72,183,139 | 72,183,139 | 2 | true | 2022-05-10T06:58:19.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unexpected token s in JSON at position 7 at parse (<anonymous>)<p>Why I get this error when I want to start the grahpql server?
I have no error on line 7
I w... |
72,182,772 | Get all elements which have both values grouped by ParentId<p>I have the following problem:</p>
<p>I have a relation table like this:</p>
<pre><code>ParentId | ValueId
1 1
1 2
2 3
2 4
2 1
</code></pre>
<p>Then, I want to get the ParentId who have exactly the values which ... | <p>There are number of ways to do this in Postgres. Like this for instance:</p>
<pre><code>SELECT "ParentId" FROM public."ParentValueRelation"
WHERE "ValueId" = 1 OR "ValueId" = 2
GROUP BY "ParentId"
HAVING COUNT("ValueID")=2
</code></pre>
<p>If there are dup... | Get all elements which have both values grouped by ParentId | postgresql|sequelize.js | 0 | 14 | 1 | 72,183,178 | 72,183,178 | 2 | true | 2022-05-10T08:11:06.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get all elements which have both values grouped by ParentId<p>I have the following problem:</p>
<p>I have a relation table like this:</p>
<pre><code>ParentId... |
72,183,048 | What is the permission scope of id-token in GitHub Action?<p>What does the <code>id-token</code> mean in the example below and what is the use?</p>
<pre class="lang-yaml prettyprint-override"><code>jobs:
job_id:
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
... | <p>The <code>id-token</code> is used in combination with <a href="https://docs.github.com/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect" rel="nofollow noreferrer">OpenID Connect</a>.</p>
<p>Setting the permissions to <code>write</code> is required in order to reques... | What is the permission scope of id-token in GitHub Action? | github|github-actions | 0 | 339 | 1 | 72,183,279 | 72,183,279 | 2 | true | 2022-05-10T08:31:54.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the permission scope of id-token in GitHub Action?<p>What does the <code>id-token</code> mean in the example below and what is the use?</p>
<pre clas... |
72,183,353 | I'm trying to understand how to make 2 classes hover at same time<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>.ellenon {
box-sizing: border-box;
width: 350px;
height:350... | <p>You can select the <code>.outer:hover</code> and <code>.outer:hover .inner</code> so both will change when the outer is hovered</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"><... | I'm trying to understand how to make 2 classes hover at same time | javascript|html|css | 0 | 60 | 2 | 72,183,656 | 72,183,656 | 2 | true | 2022-05-10T08:56:55.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to understand how to make 2 classes hover at same time<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fal... |
72,183,299 | How to remove from a multidimensional array all duplicate elements including the original?<p>I am using php 7.1.</p>
<p>I have seen that to eliminate the duplicate elements it is enough with this</p>
<pre><code>array_unique($array, SORT_REGULAR);
</code></pre>
<p>I've also seen this work</p>
<pre><code>array_map("... | <p>This should be straightforward. Pluck all IDs using <a href="https://www.php.net/manual/en/function.array-column.php" rel="nofollow noreferrer"><code>array_column</code></a> and use <a href="https://www.php.net/manual/en/function.array-count-values.php" rel="nofollow noreferrer"><code>array_count_values</code></a> t... | How to remove from a multidimensional array all duplicate elements including the original? | php|arrays|multidimensional-array | 0 | 48 | 2 | 72,183,674 | 72,183,674 | 2 | true | 2022-05-10T08:53:12.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove from a multidimensional array all duplicate elements including the original?<p>I am using php 7.1.</p>
<p>I have seen that to eliminate the dup... |
72,183,147 | How to escape specific JSON characters in Powershell<h1>Background</h1>
<p>I am using PowerShell 7.</p>
<p>Yesterday, I asked <a href="https://stackoverflow.com/questions/72173138/convert-json-to-a-powershell-object-then-replace-that-object-with-a-new-object">this</a> question on help merging some JSON together and sav... | <p>You are treating the array in <code>$ToolSetSystemObject.powershellModules</code> as if it were an array of <strong>strings</strong>, but in fact this is an array of <strong>objects</strong></p>
<p>To add a new object to it, just do</p>
<pre><code>$ToolSetSystemObject.powershellModules += @{name = "SqlServer&qu... | How to escape specific JSON characters in Powershell | json|powershell | 0 | 27 | 1 | 72,183,745 | 72,183,745 | 2 | true | 2022-05-10T08:39:20.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to escape specific JSON characters in Powershell<h1>Background</h1>
<p>I am using PowerShell 7.</p>
<p>Yesterday, I asked <a href="https://stackoverflow.... |
72,183,425 | Terraform YAML config - object does not have an attribute names<p>I'm pulling my hair out trying to debug an issue where I have a yaml file which contains two attributes per entry:</p>
<pre><code>topics:
- name: topic_one
partitions: 24
- name: topic_two
partitions: 1
- name: topic_three
partitions: 1... | <p>Your logic is all well, except the looping with attribute <code>name</code>. You can't have the <code>name</code> attribute & fetch the <code>partitions</code> field from it. It can be only fetched from <code>topic</code> object.</p>
<p>Try this..</p>
<pre><code>resource "confluent_kafka_topic" "k... | Terraform YAML config - object does not have an attribute names | terraform|hcl|confluent-cloud | 0 | 164 | 1 | 72,184,144 | 72,184,144 | 2 | true | 2022-05-10T09:01:18.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Terraform YAML config - object does not have an attribute names<p>I'm pulling my hair out trying to debug an issue where I have a yaml file which contains tw... |
72,183,934 | Interaction between browser() and ls()<p>Hi I am trying to find some information as to what is going on under the hood in the interaction between <code>browser()</code> and <code>ls()</code> in an R Shiny application.</p>
<p>If I add a <code>browser()</code> statement to my code outside of an R Shiny function, e.g.:</p... | <blockquote>
<p>and the environment in this case is the R Shiny session</p>
</blockquote>
<p>No, that’s a misunderstanding. The “environment” in the case of a function call is the <em>local environment</em> of that function. However, your case is slightly different still, because you need to distinguish between a funct... | Interaction between browser() and ls() | r|shiny | 0 | 31 | 1 | 72,184,157 | 72,184,157 | 2 | true | 2022-05-10T09:34:53.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interaction between browser() and ls()<p>Hi I am trying to find some information as to what is going on under the hood in the interaction between <code>brows... |
72,181,822 | EXPO useEffect not called on navigating to same screen<p>I have one screen which called useEffect when rendered first time in the flow.
The second time I navigate to the screen in the flow , use Effect is not called but I want to call a function upon first time before , after or during render function is called when we... | <p>The problem here is that a screen <code>remains mounted in react-native</code> after the initial navigation. Thus, a <code>useEffect</code> with an empty dependency array won't be called subsequently on navigation.</p>
<p>Notice that <a href="https://reactnavigation.org/docs/navigation-lifecycle/" rel="nofollow nore... | EXPO useEffect not called on navigating to same screen | javascript|react-native|navigation|expo|onload | 0 | 157 | 2 | 72,184,183 | 72,184,183 | 2 | true | 2022-05-10T06:51:59.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EXPO useEffect not called on navigating to same screen<p>I have one screen which called useEffect when rendered first time in the flow.
The second time I nav... |
72,183,885 | intent.resolveActivity returns null on android.intent.action.OPEN_DOCUMENT in API 30<p>I am having problem to pick a pdf file.
Before, the targetSdk is 29 and it's working fine but when I updated it to 30, device with Android 11 and above can't open the file manager to pick the pdf file. Device with version below Andro... | <p>in Android 11 were made some changes in package visbility, some info <a href="https://developer.android.com/training/package-visibility" rel="nofollow noreferrer">HERE</a> and <a href="https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9" rel="nofollow noreferrer">HERE</a></p>
<p>note t... | intent.resolveActivity returns null on android.intent.action.OPEN_DOCUMENT in API 30 | java|android|kotlin | 0 | 79 | 1 | 72,184,216 | 72,184,216 | 2 | true | 2022-05-10T09:31:59.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
intent.resolveActivity returns null on android.intent.action.OPEN_DOCUMENT in API 30<p>I am having problem to pick a pdf file.
Before, the targetSdk is 29 an... |
72,184,276 | Search TYPO3 BE by data present in related model<p>I have an extension with an "event" model with an "address" field related to the "tt_address" model.</p>
<p>In the TCA configuration I have set:</p>
<pre><code>ctrl['searchFields'] = 'address'
</code></pre>
<p>Now, if in TYPO3 BE I search ... | <p>Unfortunately this is not supported. At the time of this writing only the following TCA types are supported in <a href="https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/Ctrl/Properties/SearchFields.html" rel="nofollow noreferrer"><code>searchFields</code></a>:</p>
<ul>
<li>text</li>
<li>flex</li>
<li>slug</li... | Search TYPO3 BE by data present in related model | typo3|typo3-10.x | 0 | 22 | 1 | 72,184,425 | 72,184,425 | 2 | true | 2022-05-10T10:00:14.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search TYPO3 BE by data present in related model<p>I have an extension with an "event" model with an "address" field related to the "... |
72,184,322 | How to make code more efficient (create a loop or function) for str.get() from column using pandas<p>I have a data frame with the nested fields. I need to extract only the display_value from the columns:
<a href="https://i.stack.imgur.com/QdMo4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QdMo4.pn... | <p>This is cleaner and more efficient:</p>
<pre class="lang-py prettyprint-override"><code>for column in df.columns:
df[column] = df[column].str.get('display_value')
</code></pre> | How to make code more efficient (create a loop or function) for str.get() from column using pandas | python|pandas|dataframe | 0 | 28 | 1 | 72,184,503 | 72,184,503 | 2 | true | 2022-05-10T10:04:12.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make code more efficient (create a loop or function) for str.get() from column using pandas<p>I have a data frame with the nested fields. I need to ex... |
72,177,477 | Delete again a file via a previous commit that deleted that file in the first place<p>Scenario:</p>
<ul>
<li>delete <em>file.txt</em> file, commitA and push</li>
<li>restore <em>file.txt</em> via <strong>git checkout commitA~1 file.txt</strong> , commitB and push</li>
</ul>
<p>I want to delete the file <em>again</em> b... | <blockquote>
<p>I want to [use <code>git checkout</code> to] delete the file <em>again</em> by invoking [the commit in which I deleted it] ...</p>
</blockquote>
<p>You cannot do that. This form of <code>git checkout</code> (or <code>git restore</code> for that matter) can only <em>add or replace</em> the file, not <em... | Delete again a file via a previous commit that deleted that file in the first place | git|git-commit|git-checkout | 0 | 28 | 2 | 72,184,566 | 72,184,566 | 2 | true | 2022-05-09T19:47:25.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete again a file via a previous commit that deleted that file in the first place<p>Scenario:</p>
<ul>
<li>delete <em>file.txt</em> file, commitA and push<... |
72,184,331 | Select the latest records (i.e. ORDER by) when IDs IN multiple values<p>For example, a <code>devices</code> table like this</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>id</th>
<th>user_id</th>
<th>last_used_at</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>111</td>
<td>2000-01-01 00:00... | <p>You can use PostgreSQL specific <a href="https://www.postgresql.org/docs/current/sql-select.html#SQL-DISTINCT" rel="nofollow noreferrer"><code>DISTINCT ON</code></a> for this:</p>
<pre><code>SELECT DISTINCT ON (user_id) *
FROM devices
ORDER BY user_id, last_used_at DESC
</code></pre> | Select the latest records (i.e. ORDER by) when IDs IN multiple values | sql|postgresql|greatest-n-per-group | 0 | 53 | 2 | 72,184,598 | 72,184,598 | 2 | true | 2022-05-10T10:05:08.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select the latest records (i.e. ORDER by) when IDs IN multiple values<p>For example, a <code>devices</code> table like this</p>
<div class="s-table-container... |
72,180,562 | Using docker registry to share my multi-image containerized app: Encountering Problems connecting multiple image repos<p>My local docker container app is made up of 4 images, React, Django, nginx, postgres. It runs perfectly locally, (although of course I need to manually go to 127.1.1.0 on my local computer to view th... | <p>Let's focus on a single service. You'll need to make similar changes to all of them.</p>
<pre class="lang-yaml prettyprint-override"><code> react:
</code></pre>
<pre><code> build:
context: ./frontend
dockerfile: Dockerfile
</code></pre>
<p>This builds the <code>frontend</code> directory on your <em>... | Using docker registry to share my multi-image containerized app: Encountering Problems connecting multiple image repos | django|docker|nginx|devops|port | 0 | 72 | 2 | 72,184,710 | 72,184,710 | 2 | true | 2022-05-10T03:54:21.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using docker registry to share my multi-image containerized app: Encountering Problems connecting multiple image repos<p>My local docker container app is mad... |
72,184,728 | How to split a dataframe based on column class<p>Let's take the iris dataset for example.</p>
<p>I want to create two dataframes from this one. This first one would have the contiuous variables, and the second one the discrete ones.</p>
<p>What I do first is create a list with the category of the column</p>
<pre><code>... | <p>Try the following code:</p>
<pre><code>classes_iris <- sapply(iris, class)
split.default(iris, classes_iris)
</code></pre>
<p>Output:</p>
<pre><code>$factor
Species
1 setosa
2 setosa
3 setosa
4 setosa
5 setosa
6 setosa
7 setosa
8 setosa
9 setosa
10 ... | How to split a dataframe based on column class | r|dataframe|split | 0 | 19 | 1 | 72,184,825 | 72,184,825 | 2 | true | 2022-05-10T10:32:28.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split a dataframe based on column class<p>Let's take the iris dataset for example.</p>
<p>I want to create two dataframes from this one. This first on... |
72,173,954 | Null pointer exception while running selenium test. I am using Page object model<p>Below is my Testbase class:</p>
<pre><code>public class TestBase {
public static WebDriver driver; //Initialise web-driver
public static Properties prop;
public TestBase() {
try {
prop= new... | <p>You are using <code>TestNG</code> as your test automation framework.</p>
<p>In <code>TestNG</code>, execution will take place according to the annotation that you define in your <code>test</code> class.</p>
<p><code>@BeforeMethod</code> has higher priority than <code>@Test</code> or <code>@AfterMethod</code></p>
<p... | Null pointer exception while running selenium test. I am using Page object model | java|selenium|nullpointerexception | 0 | 332 | 1 | 72,185,057 | 72,185,057 | 2 | true | 2022-05-09T14:49:38.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Null pointer exception while running selenium test. I am using Page object model<p>Below is my Testbase class:</p>
<pre><code>public class TestBase {
... |
72,185,606 | Grouping then max on MSSQL Query<p>I have two tables as follows.</p>
<p><strong>Table 1:</strong></p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ID</th>
<th>ArtNumber</th>
<th>Date</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Article1</td>
<td>07.05.2022</td>
<td>100.00</... | <p>You can use a simple greatest-n-per-group query:</p>
<pre><code>with cte as (
select *, row_number() over (partition by artnumber order by date desc) as rn
from table1
)
select *
from cte
join table2 on cte.artnumber = table2.artnumber
where rn = 1 and cte.price < table2.price
</code></pre> | Grouping then max on MSSQL Query | sql|sql-server|sorting|grouping | 0 | 38 | 1 | 72,186,044 | 72,186,044 | 2 | true | 2022-05-10T11:35:33.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grouping then max on MSSQL Query<p>I have two tables as follows.</p>
<p><strong>Table 1:</strong></p>
<div class="s-table-container">
<table class="s-table">... |
72,185,779 | How is have to be a dataset to perform an ANOVA test in R?<p>I have three columns, one per group, with numeric values. I want to analyze them using an Anova test, but I found applications when you have the different groups in a column and the respective values in the second column. I wonder if it is necessary to reorde... | <p>You can convert a wide table having many columns into another table having only two columns for key (group) and value (response) by pivoting the data:</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
# create example data
set.seed(1337)
data <- tibble(
VIH = runif(100),
VIH2 = runif(100)... | How is have to be a dataset to perform an ANOVA test in R? | r|anova | 0 | 38 | 1 | 72,186,094 | 72,186,094 | 2 | true | 2022-05-10T11:48:52.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How is have to be a dataset to perform an ANOVA test in R?<p>I have three columns, one per group, with numeric values. I want to analyze them using an Anova ... |
72,185,404 | How to create multiple arrays with random numbers in BigQuery<p>I have the following piece of code, in which I create 3 random arrays of length 5, 10, and 15 respectively.</p>
<pre><code>with example as (
select 1 as id, mod(cast(10*rand() as int64), 10) as random_array from unnest(generate_array(1, 5))
union a... | <p>You can use <code>STRUCT</code></p>
<pre><code>SELECT * FROM UNNEST([
STRUCT(1 AS id, ARRAY((SELECT mod(cast(10*rand() as int64), 10) FROM UNNEST(GENERATE_ARRAY(1, 5)))) AS random_arr),
STRUCT(2 AS id, ARRAY((SELECT mod(cast(10*rand() as int64), 10) FROM UNNEST(GENERATE_ARRAY(1, 10)))) AS random_arr),
STRUCT(3... | How to create multiple arrays with random numbers in BigQuery | google-bigquery | 0 | 97 | 2 | 72,186,236 | 72,186,236 | 2 | true | 2022-05-10T11:18:21.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create multiple arrays with random numbers in BigQuery<p>I have the following piece of code, in which I create 3 random arrays of length 5, 10, and 15... |
72,186,051 | Javascript: How to populate arguments passed to a function?<p>I have this code that returns cartesian product of three arrays:</p>
<pre><code>function getcartesianProduct(symbols: Array<string>) {
const cartesian = <T,>(...sets: T[][]) => sets.reduce<T[][]>((accSets, set) => accSets.flatMap(ac... | <p>I think something like this should work:</p>
<pre><code>function getcartesianProduct(symbols: string[], nrOfArrays: number) {
const cartesian = <T,>(sets: T[][]) => sets.reduce<T[][]>((accSets, set) => accSets.flatMap(accSet => set.map(value => [...accSet, value])), [[]]);
return cartesia... | Javascript: How to populate arguments passed to a function? | javascript|typescript|function|arguments | 0 | 43 | 1 | 72,186,492 | 72,186,492 | 2 | true | 2022-05-10T12:08:36.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript: How to populate arguments passed to a function?<p>I have this code that returns cartesian product of three arrays:</p>
<pre><code>function getcar... |
72,186,602 | Extracting the values of a list as individual strings<p>Hi I have an issue in passing the values of a list as input in a form so it is interpolated as individual values.</p>
<p>I have a function Get_input which take two inputs.
I then want to define the inputs in a list and feed the list into a function.<br />
My issue... | <p>The * is the operator you are looking for. So your call would look as follows:</p>
<p><code>Datetimes=Get_input(*input)</code></p>
<p>The operator seems to be referred to as "iterable unpacking" as you can see here: <a href="https://docs.python.org/3/reference/expressions.html#expression-lists" rel="nofoll... | Extracting the values of a list as individual strings | python | 0 | 29 | 2 | 72,186,641 | 72,186,641 | 2 | true | 2022-05-10T12:47:54.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extracting the values of a list as individual strings<p>Hi I have an issue in passing the values of a list as input in a form so it is interpolated as indivi... |
72,186,689 | Sum array values of a column within each column of an array with 3 levels<p>I'm trying to use <code>array_sum()</code> on columns within columns of a multidimensional array.</p>
<p>For eg: I have an array that looks like this:</p>
<pre><code>$array = [
[['value' => 1100], ['value' => 1000], ['value' => 300... | <p>You can sum your columns doing like this:</p>
<pre><code>foreach($array as $key => $point){
$arr[] = array_sum(array_column( array_column($array,$key),'value'));
}
print_r($arr);
</code></pre> | Sum array values of a column within each column of an array with 3 levels | php|arrays|multidimensional-array|transpose|array-sum | 0 | 83 | 3 | 72,187,019 | 72,187,019 | 2 | true | 2022-05-10T12:53:22.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sum array values of a column within each column of an array with 3 levels<p>I'm trying to use <code>array_sum()</code> on columns within columns of a multidi... |
72,182,506 | How to handle CancellationToken in Azure function eventhub trigger<p>In an Azure function event hub trigger (v3) it takes in a cancellation token in the <code>Run</code> method. When cancellation is signaled it means the server it shutting down. If I send this token to for example a <code>Get</code> operation using <co... | <blockquote>
<p>Will the events that this function was processing be sent to another instance of the function on another server or are they lost?</p>
</blockquote>
<p><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-reliable-event-processing" rel="nofollow noreferrer">They are lost</a>:</p>
<bl... | How to handle CancellationToken in Azure function eventhub trigger | c#|azure|azure-functions|azure-eventhub|cancellation-token | 0 | 252 | 1 | 72,187,241 | 72,187,241 | 2 | true | 2022-05-10T07:49:25.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle CancellationToken in Azure function eventhub trigger<p>In an Azure function event hub trigger (v3) it takes in a cancellation token in the <cod... |
72,187,265 | Find sum of each month Pandas<pre><code>df = pd.read_csv("wind_data.csv")
df = df[['SETTLEMENTDATE', 'wind']].copy()
dataset = df.set_index("SETTLEMENTDATE")
dataset.index = pd.to_datetime(dataset.index)
print(dataset.head())
print(dataset.shape)
</code></pre>
<p>Dataset</p>
<p><a href="https://i.s... | <p>Use <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html" rel="nofollow noreferrer"><code>DataFrame.resample</code></a>:</p>
<pre><code>dataset.resample('M')['wind'].sum()
</code></pre> | Find sum of each month Pandas | pandas|dataframe | 0 | 39 | 2 | 72,187,368 | 72,187,368 | 2 | true | 2022-05-10T13:30:12.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find sum of each month Pandas<pre><code>df = pd.read_csv("wind_data.csv")
df = df[['SETTLEMENTDATE', 'wind']].copy()
dataset = df.set_index("... |
72,185,933 | Reshape THEN explode an array in a spark dataframe<p>I have a spark dataframe in the following format:</p>
<pre><code>+--------------------+--------------------+
| profiles|__record_timestamp__|
+--------------------+--------------------+
|[0, 1, 1, 1, 3, 1...| 1651737406300000000|
|[1, 0, 1, 2, 1, 0...| 165... | <p>You can do so by creating an array of the required <a href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.functions.slice.html" rel="nofollow noreferrer">slices</a> and then using <a href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.functions.posexplode.html"... | Reshape THEN explode an array in a spark dataframe | python|arrays|apache-spark|pyspark|split | 0 | 72 | 2 | 72,187,431 | 72,187,431 | 2 | true | 2022-05-10T11:59:19.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reshape THEN explode an array in a spark dataframe<p>I have a spark dataframe in the following format:</p>
<pre><code>+--------------------+-----------------... |
72,187,162 | Is there a way to make instructions with 300ms between them?<p>I have this problem: I should vibrate the phone for 500ms *, 300ms of pause, 500ms * of vibration, 300ms of pause and finally 500ms * of vibration. I tried using Handler but unfortunately it's like they add up in one wait time. Is there a specific way to do... | <p>Try the below code, which is working for me perfectly.</p>
<pre><code>fun Fragment.vibratePhone() {
val vibrator = context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
... | Is there a way to make instructions with 300ms between them? | android|kotlin|native|delay|vibration | 0 | 60 | 2 | 72,187,526 | 72,187,526 | 2 | true | 2022-05-10T13:22:00.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to make instructions with 300ms between them?<p>I have this problem: I should vibrate the phone for 500ms *, 300ms of pause, 500ms * of vibrat... |
72,187,850 | Golang testing with dynamic linking for Kafka on M1 chip<p>I'm trying to write some unit tests for a poc I'm doing in Golang / Kafka on a new M1 Mac. I'm using the official Golang Kafka libs from confluent:</p>
<pre><code>"github.com/confluentinc/confluent-kafka-go/kafka"
</code></pre>
<p>Apparently, this pa... | <p>Ok, never mind. I sorted this... in my ~/.zshrc I wasn't exporting the PKG_CONFIG_PATH, so I changed this:</p>
<pre><code>PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
</code></pre>
<p>to this:</p>
<pre><code>export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
</cod... | Golang testing with dynamic linking for Kafka on M1 chip | go|testing|dynamic-linking | 0 | 800 | 1 | 72,187,929 | 72,187,929 | 2 | true | 2022-05-10T14:05:15.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Golang testing with dynamic linking for Kafka on M1 chip<p>I'm trying to write some unit tests for a poc I'm doing in Golang / Kafka on a new M1 Mac. I'm us... |
72,187,819 | Use custom service in a Symfony Command<p>I have created a class with a PHP function I would like to run from the command windows.</p>
<p>Therefore I have created a class extending command but I'm having trouble because I have to call the <code>EntityManagerInterface</code> and the <code>UserPasswordHasherInterface</co... | <p>You should be able to use autowiring for your command as well (with default services.yaml configuration).</p>
<p>Instead of creating a <code>new TestHashPassword();</code>, use auto wiring to inject it as a service.</p>
<p>Add in your command a <code>__construct</code>:</p>
<pre><code>use App\TestHashPassword;
class... | Use custom service in a Symfony Command | php|symfony|command-line | 0 | 155 | 1 | 72,188,023 | 72,188,023 | 2 | true | 2022-05-10T14:03:35.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use custom service in a Symfony Command<p>I have created a class with a PHP function I would like to run from the command windows.</p>
<p>Therefore I have cr... |
72,188,039 | Write to file help c#<p>I am taking data from a file and counting the Status Codes and writing it to a file. When I run the program it does separate the StatusCode from the other numbers and in the output in visual studio the counts are correct but the file is blank, nothing writes to it. I've researched inline but sti... | <pre><code>for (int i = 0; i >= dataInputList.Count; i++)
</code></pre>
<p>It appears you have your comparison backwards, my friend. It should be:</p>
<pre><code>for (int i = 0; i < dataInputList.Count; i++)
</code></pre>
<p>I would also remove the <code>=</code> because Count is non-zero inclusive and <code>i</c... | Write to file help c# | c#|streamwriter | 0 | 82 | 2 | 72,188,082 | 72,188,082 | 2 | true | 2022-05-10T14:18:18.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Write to file help c#<p>I am taking data from a file and counting the Status Codes and writing it to a file. When I run the program it does separate the Stat... |
72,186,464 | Manipulation of sympy Functions<p>I am working over arbitrary discrete functions like x<sub>1</sub>(k), x<sub>2</sub>(k), etc. where k is an Integer, and for any k, x<sub>i</sub>(k) is a real number (however, I might add that for the symbolic computations I want to perform, this is not relevant).</p>
<p>I need to manip... | <p>Your code tries to multiply the function themselves, not the result of their <em>application</em>.</p>
<blockquote>
<p>I need to be able to perform typical operations like multiplication or addition of these functions (e.g. <code>x1(k)x2(k)</code>)</p>
</blockquote>
<p>You can do this like this:</p>
<pre><code>>&... | Manipulation of sympy Functions | python|sympy | 0 | 72 | 1 | 72,188,087 | 72,188,087 | 2 | true | 2022-05-10T12:38:58.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Manipulation of sympy Functions<p>I am working over arbitrary discrete functions like x<sub>1</sub>(k), x<sub>2</sub>(k), etc. where k is an Integer, and for... |
72,187,432 | Use object included from global <script> tag inside React component<p>I am trying to add paypal <a href="https://developer.paypal.com/demo/checkout/#/pattern/server" rel="nofollow noreferrer">button</a> using React.</p>
<p>According to paypals dev <a href="https://developer.paypal.com/docs/checkout/standard/customize/s... | <p>There are two ways to square that circle:</p>
<pre class="lang-js prettyprint-override"><code>const PayPalButton = window.paypal.Buttons.driver("react", { React, ReactDOM });
</code></pre>
<p>Remember that in Javascript global variables are also properties of the global object (<code>window</code> in the b... | Use object included from global <script> tag inside React component | javascript|reactjs|paypal | 0 | 119 | 1 | 72,188,456 | 72,188,456 | 2 | true | 2022-05-10T13:41:00.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use object included from global <script> tag inside React component<p>I am trying to add paypal <a href="https://developer.paypal.com/demo/checkout/#/pattern... |
72,190,039 | there is lag in my react app on a add to card button<p>I don't know why my react app is lagging after clicking on add to cart button, It takes multiple clicks to add a product into the cart.</p>
<p>following are the app.js file and products.jsx file where the contexts are being consumed The logic is working very well b... | <p>There is no lag. The problem is that inside the Product.jsx, the <code>onClick</code> is inside the <code>span</code> instead of the <code>button</code> and the <code>span</code> doesn't occupy the whole button. When you click the <code>button</code> (the outer part which the <code>span</code> doesn't reach), no fun... | there is lag in my react app on a add to card button | javascript|html|css|node.js|reactjs | 0 | 91 | 1 | 72,190,197 | 72,190,197 | 2 | true | 2022-05-10T16:36:45.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
there is lag in my react app on a add to card button<p>I don't know why my react app is lagging after clicking on add to cart button, It takes multiple click... |
72,190,439 | Unable to redirect error to /dev/null in gnu make<p>In a gnu script, I want to check if an intel c compiler is in the path.
To do this, I run the following command:</p>
<pre><code>COMPILER_IN_PATH := $(shell icc -dumpversion | grep 2021.3.0)
</code></pre>
<p>Later I test to see if COMPILER_IN_PATH is set.</p>
<p>If an ... | <p>You are redirecting the output of the <code>grep</code> command. You want to redirect the output of the <code>icc</code> command.</p>
<pre><code>COMPILER_IN_PATH := $(shell icc -dumpversion 2>/dev/null | grep 2021.3.0)
</code></pre> | Unable to redirect error to /dev/null in gnu make | linux|shell|sh|gnu-make | 0 | 71 | 1 | 72,190,452 | 72,190,452 | 2 | true | 2022-05-10T17:08:04.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to redirect error to /dev/null in gnu make<p>In a gnu script, I want to check if an intel c compiler is in the path.
To do this, I run the following c... |
72,189,954 | XSD assuring that each enumeration value can only occur once as attribute<p>Let's say I have a schema to define a list of articles. Each of these articles has a list of long names, one for each known language. The language is an attribute at the level of an individual long name.</p>
<p>I want to assure 2 things:</p>
<o... | <p>Please try the following solution.</p>
<p><strong>Input XML</strong></p>
<pre><code><article>
<articleNumber>3019</articleNumber>
<longNames>
<longName language="EN">
<description>A French Omelette with Cheese</description>
</... | XSD assuring that each enumeration value can only occur once as attribute | xml|xsd|unique|enumeration | 0 | 38 | 1 | 72,190,530 | 72,190,530 | 2 | true | 2022-05-10T16:29:53.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSD assuring that each enumeration value can only occur once as attribute<p>Let's say I have a schema to define a list of articles. Each of these articles ha... |
72,190,564 | Scanning from dynamodb with out partition key using boto3<ul>
<li><p>I need to extract the items from dynamodb which is matching <code>id, name, role</code></p>
</li>
<li><p>Above 3 are just attributes of the table they are not part key or sort key</p>
</li>
</ul>
<p>Below is the code</p>
<pre><code>import boto3
from b... | <p>You aren't passing the <code>LastEvaluatedKey</code> into the <code>scan()</code> call, so it is starting the scan over from the beginning each time.</p>
<p>Change it to this:</p>
<pre><code>while scan_response.get('LastEvaluatedKey'):
scan_response = table.scan(
ExclusiveStartKey=scan_response.get('Last... | Scanning from dynamodb with out partition key using boto3 | python|amazon-dynamodb|boto3 | 0 | 194 | 1 | 72,190,615 | 72,190,615 | 2 | true | 2022-05-10T17:17:28.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scanning from dynamodb with out partition key using boto3<ul>
<li><p>I need to extract the items from dynamodb which is matching <code>id, name, role</code><... |
72,190,732 | Gitlab CI CD Production Config Unkown Keys<p>Gitlab CI CD Pipeline fails for the following yml with the error</p>
<pre><code>obs:production config contains unknown keys: type
</code></pre>
<p>.gitlab-ci.yml</p>
<pre><code>image: node:latest
before_script:
- apt-get update -qy
- apt-get install -y ruby-dev
... | <p>Job-defined types are deprecated and <a href="https://docs.gitlab.com/ee/ci/yaml/#job-defined-type" rel="nofollow noreferrer">have been removed in GitLab 15</a>. Use <code>stage:</code> instead.</p> | Gitlab CI CD Production Config Unkown Keys | gitlab|gitlab-ci | 0 | 41 | 1 | 72,190,831 | 72,190,831 | 2 | true | 2022-05-10T17:32:31.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gitlab CI CD Production Config Unkown Keys<p>Gitlab CI CD Pipeline fails for the following yml with the error</p>
<pre><code>obs:production config contains u... |
72,188,535 | Deep search is object in javascript<p>I am trying to search any pairs key:value in an object in JavaScript, and return the sub-object it belongs to.</p>
<p>What I have done so far doesn’t return my object as expected and I can’t find why.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" ... | <p>Ian Brindley's comment is partly correct. You are discarding the return value of the recursive call. You can fix your code by changing this</p>
<pre><code>if (typeof obj[prop] == "object") {
searchSheet(obj[prop], keyName, valName);
} else { //...
</code></pre>
<p>to this</p>
<pre><code>if (typeof obj[pr... | Deep search is object in javascript | javascript|json|object | 0 | 82 | 1 | 72,190,898 | 72,190,898 | 2 | true | 2022-05-10T14:49:46.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deep search is object in javascript<p>I am trying to search any pairs key:value in an object in JavaScript, and return the sub-object it belongs to.</p>
<p>W... |
72,191,939 | Filter index total from a list by passing the total value as a function argument<p>If I know perfectly how many indexes I'm looking for, I do it like this:</p>
<pre><code>def main():
lst = [['111','222','333'],['111','222','3333'],['111','222','333']]
new_sublist = [[sublist[0],sublist[1]] for sublist in lst]
... | <p>You can just slice your list with [:len] notation</p>
<pre><code>def main(total_index):
lst = [['111','222','333'],['111','222','3333'],['111','222','333']]
new_sublist = [sublist[:total_index] for sublist in lst]
print(new_sublist)
if __name__ == '__main__':
main(2)
</code></pre> | Filter index total from a list by passing the total value as a function argument | python | 0 | 19 | 2 | 72,191,966 | 72,191,966 | 2 | true | 2022-05-10T19:20:01.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter index total from a list by passing the total value as a function argument<p>If I know perfectly how many indexes I'm looking for, I do it like this:</... |
72,189,323 | gspread set column type/format<p>I'm using gpread to write data into google sheet.
The data is written correctly, but I need to set a whole specific column to be of type "Number" so that it can be ordered by default without having to change the column format by hand each time. This column has only numbers (be... | <h3>Instead of this:</h3>
<p><code>sheet.format("R", { "numberFormat": { "type": "NUMBER" }})</code></p>
<h3>Try this:</h3>
<p><code>sheet.format("R", { "numberFormat": { "type": "NUMBER","pattern": "#,##0" }})</code></p... | gspread set column type/format | python|google-sheets-api|gspread | 0 | 312 | 1 | 72,192,072 | 72,192,072 | 2 | true | 2022-05-10T15:41:26.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
gspread set column type/format<p>I'm using gpread to write data into google sheet.
The data is written correctly, but I need to set a whole specific column t... |
72,192,078 | Split strings into different columns not working correctly<p>I am working with a large dataset with a column for reviews which is comprised of a series of strings for example: "A,B,C" , "A,B*,B" etc..</p>
<p>for example,</p>
<pre><code>import pandas as pd
df=pd.DataFrame({'cat1':[1,2,3,4,5],
... | <blockquote>
<p>when i use df["A"].unique() there are entries that should not be in the column. I only want 'A' to appear there</p>
</blockquote>
<p>IIUC, you wanted to create dummy variables instead?</p>
<pre class="lang-py prettyprint-override"><code>df2 = df.join(df['review'].str.get_dummies(sep=',').pipe(... | Split strings into different columns not working correctly | python|pandas|dataframe|split | 0 | 54 | 1 | 72,192,111 | 72,192,111 | 2 | true | 2022-05-10T19:35:59.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split strings into different columns not working correctly<p>I am working with a large dataset with a column for reviews which is comprised of a series of st... |
72,191,756 | Retrieve Folder path based on cell value (match cell value to folder in directory)<p>I appreciate all the help with my last question <a href="https://stackoverflow.com/questions/72190715/retrieve-file-path-based-on-cell-value-match-cell-value-to-file-name-in-directo/72191217#72191217">previous post</a></p>
<p>Previous ... | <p>Please, try the next way. Since you cannot use <code>Dir</code> in two different loops, in the <code>Sub</code> I will use "Scripting.FileSystemObject", to iterate between the main folder subfolders:</p>
<pre><code>Sub extractSubfolderPathFromSubfolders()
Dim sh As Worksheet, lastRow As Long, i As Long... | Retrieve Folder path based on cell value (match cell value to folder in directory) | excel|vba | 0 | 74 | 1 | 72,192,446 | 72,192,446 | 2 | true | 2022-05-10T19:01:10.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieve Folder path based on cell value (match cell value to folder in directory)<p>I appreciate all the help with my last question <a href="https://stackov... |
72,192,467 | How to write an or statement in mongodb using the find function in mongoose<p>I'm trying to check if there is a booking in a range of time. Not sure how to use the or condition in mongodb using mongoose.</p>
<p>Here is what I have:</p>
<pre><code>const appoinments = await Appointment.find({
seller: seller._id,
... | <p>You can simply use the <code>or()</code> member function that mongoose provides. It works just like the <code>$or</code> operator defined in the mongoose <a href="https://www.mongodb.com/docs/manual/reference/operator/query/or/" rel="nofollow noreferrer">documentation</a>.</p>
<p>I hope it helped!</p>
<pre><code>con... | How to write an or statement in mongodb using the find function in mongoose | javascript|node.js|mongodb|express|mongoose | 0 | 46 | 1 | 72,192,560 | 72,192,560 | 2 | true | 2022-05-10T20:15:02.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write an or statement in mongodb using the find function in mongoose<p>I'm trying to check if there is a booking in a range of time. Not sure how to u... |
72,187,220 | Can I sniff a BLE communication between my multimeter and my smartphone?<p>I am currently trying to manipulate a multimeter (Zoyi ZT-5BQ) using an Arduino board, but I don't know the protocol that uses my multimeter to change the reading mode (in example, from ohmeter to termometer).
I have tried to pair my AT-09 modul... | <p>The manufacturers' app can't find the AT-09 most likely because the app searches for devices that advertise a specific service that the module does not offer.</p>
<p>Start your research by installing a generic BLE scanner app such as <a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-mobi... | Can I sniff a BLE communication between my multimeter and my smartphone? | arduino|bluetooth|bluetooth-lowenergy|android-bluetooth|bluetooth-gatt | 0 | 105 | 2 | 72,192,682 | 72,192,682 | 2 | true | 2022-05-10T13:26:34.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I sniff a BLE communication between my multimeter and my smartphone?<p>I am currently trying to manipulate a multimeter (Zoyi ZT-5BQ) using an Arduino bo... |
72,192,830 | Throw Exception in method who throws this Excpetion<p>I am doing a method who return an UUID of a Minecraft player from his username using the Mojang API. This method takes a String in parameter (the username of the player who we want to know the UUID). To use the resultat of the API, I use the SimpleJSON library (to p... | <p>Have you verified that your exception might get caught? If it is caught, the code prints a stack trace. But if it is not caught, the JVM will print a stack trace anyway.</p>
<p>So throw the exception with some message you can verify, like</p>
<pre><code>throw new IOException("Invalid user");
</code></pre>
... | Throw Exception in method who throws this Excpetion | java|exception|try-catch|throw|throws | 0 | 49 | 2 | 72,192,969 | 72,192,969 | 2 | true | 2022-05-10T20:54:48.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Throw Exception in method who throws this Excpetion<p>I am doing a method who return an UUID of a Minecraft player from his username using the Mojang API. Th... |
72,193,196 | convert a list of strings of ints to list of tuples<p>If I have a list that looks like this below of strings that are int values:</p>
<p><code>['10 90', '10 -90', '100 45', '20 180']</code></p>
<p>How would I convert it to a list of tuples? Like this:</p>
<p><code>[(10,90), (10,-90), (100,45), (20,180)]</code></p>
<p>T... | <p>You have to split each string first. Then convert each split item to an integer; finally convert the pair to a tuple:</p>
<pre class="lang-py prettyprint-override"><code>out = [tuple(map(int, item.split())) for item in lst]
</code></pre>
<p>Output:</p>
<pre class="lang-none prettyprint-override"><code>[(10, 90), (10... | convert a list of strings of ints to list of tuples | python|string|list | 0 | 48 | 3 | 72,193,211 | 72,193,211 | 2 | true | 2022-05-10T21:34:47.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
convert a list of strings of ints to list of tuples<p>If I have a list that looks like this below of strings that are int values:</p>
<p><code>['10 90', '10 ... |
72,146,806 | Borb reading pdf results in spaces between all letters<p>I am trying to use borb to extract text from pdf's. Some pdfs works well but when trying to extract text from some pdf's I get extra spaces between all letters and spaces.
It looks like:</p>
<p><code>I N B E T A L N I N G / G I R E R I N G A V</code>
If I c... | <p>Disclaimer: I am the author of <code>borb</code></p>
<p>A pdf document doesn't really contain text as is. It contains rendering instructions that a program like Adobe Reader will execute. These instructions yield something a human might interpret as text.</p>
<p>For instance:</p>
<ul>
<li>go to position 30, 50</li>
... | Borb reading pdf results in spaces between all letters | python|pdf|borb | 0 | 115 | 1 | 72,193,726 | 72,193,726 | 2 | true | 2022-05-06T20:01:44.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Borb reading pdf results in spaces between all letters<p>I am trying to use borb to extract text from pdf's. Some pdfs works well but when trying to extract ... |
72,147,601 | Detecting WebView2 vs standalone Edge browser?<p>I have a page that needs to render differently depending on whether it's being viewed from a WebView2 component (inside another application) or from a standalone Microsoft Edge browser. I tried distinguishing the two via the user agent string, but the strings are more or... | <p>There's no perfect way for web content to identify that is running within a WebView2 because the host app of the WebView2 can customize so many aspects of the WebView2.</p>
<p>For example, the host app can change the user agent via <code>CoreWebView2Settings.UserAgent</code> to appear to be Chrome or any other brows... | Detecting WebView2 vs standalone Edge browser? | javascript|webview|microsoft-edge|browser-detection|webview2 | 0 | 316 | 1 | 72,194,120 | 72,194,120 | 2 | true | 2022-05-06T21:36:07.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detecting WebView2 vs standalone Edge browser?<p>I have a page that needs to render differently depending on whether it's being viewed from a WebView2 compon... |
72,192,484 | Using XSLT to expand a flattened XML with path delimiters<p>(Edit) As per advice from @michael.hor257k I have also included the verbose form of the input XML.</p>
<p>I have an input XML that I can't control, and need to transform it in XSLT. Please note that unlike many "related answers" on SO, in this case, ... | <p>It seems to me that given your "verbose" input, you could achieve the expected result quite easily using:</p>
<p><strong>XSLT 1.0</strong></p>
<pre><code><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.example.org/standards/templ... | Using XSLT to expand a flattened XML with path delimiters | xml|xslt|nested|xslt-1.0 | 0 | 90 | 1 | 72,194,142 | 72,194,142 | 2 | true | 2022-05-10T20:17:14.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using XSLT to expand a flattened XML with path delimiters<p>(Edit) As per advice from @michael.hor257k I have also included the verbose form of the input XML... |
72,193,727 | Why does a React component unmount but jsx doesn't<p>I came across this behaviour recently and was trying to understand its cause. Basically, what I noticed so far is that a React child component will be mounted and unmounted on state changes of its parent. However, a jsx containing the same child component does not.</... | <p>I think your question is about the difference between the two buttons' behavior, one is coming back to zero after clicking to rerender the parent component and the other not.</p>
<p>First of all, we should understand the life-cycle of a function component, the render is executing each state change.</p>
<pre><code>fu... | Why does a React component unmount but jsx doesn't | reactjs|use-state|react-props | 0 | 228 | 1 | 72,194,215 | 72,194,215 | 2 | true | 2022-05-10T22:54:01.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does a React component unmount but jsx doesn't<p>I came across this behaviour recently and was trying to understand its cause. Basically, what I noticed ... |
72,194,074 | OpenCV running otsu thresh on video gives weird window<p>I am trying to run this opencv code to run otsu tresh on my image and get mask</p>
<pre><code>import cv2
import numpy as np
video = cv2.VideoCapture('video.mp4')
# loop runs if capturing has been initialized
while True:
# reads frames from a camera
... | <p>You are missing <code>cv2.waitKey()</code>. Put this after <code>cv2.imshow()</code></p>
<pre><code> cv2.imshow('result', result)
cv2.waitKey(0)
video.release()
</code></pre> | OpenCV running otsu thresh on video gives weird window | python|opencv|contour|image-thresholding | 0 | 123 | 2 | 72,194,455 | 72,194,455 | 2 | true | 2022-05-10T23:59:38.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OpenCV running otsu thresh on video gives weird window<p>I am trying to run this opencv code to run otsu tresh on my image and get mask</p>
<pre><code>import... |
72,192,264 | Getting the error detail of a Stored Procedure Activity in Azure Data Factory<p>I need to store the error generated during the execution of a Stored Procedure in ADF. However, the output list of this activity does not provine any value for this. Instead, it shows the DETAILS fo the error and is this value the one that ... | <p>Use the below expression to capture the error details of an activity.</p>
<p><code>@activity('your_activity_name').error.message</code></p>
<p><strong>Example:</strong></p>
<p>• Stored procedure activity error details.</p>
<p><a href="https://i.stack.imgur.com/ojg7A.png" rel="nofollow noreferrer"><img src="https:/... | Getting the error detail of a Stored Procedure Activity in Azure Data Factory | stored-procedures|error-handling|azure-data-factory | 0 | 276 | 1 | 72,194,857 | 72,194,857 | 2 | true | 2022-05-10T19:56:00.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting the error detail of a Stored Procedure Activity in Azure Data Factory<p>I need to store the error generated during the execution of a Stored Procedur... |
72,193,991 | Netty Http Client - Configure DNSResolution timeout<p>I am getting this error with WebClient. This is expected as per my configuration. But how to configure the timeout for dns name resolution via netty http client?</p>
<pre><code>Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [/127.0.0.11:53] query ... | <p>By default, DNS query timeout is 5 sec (<a href="https://github.com/reactor/reactor-netty/blob/72f88aafd0647efac43b20ca37d1c899b11d488a/reactor-netty-core/src/main/java/reactor/netty/transport/NameResolverProvider.java#L560" rel="nofollow noreferrer">DEFAULT_QUERY_TIMEOUT</a>) but you could customize underlining Net... | Netty Http Client - Configure DNSResolution timeout | netty|spring-webflux|reactor-netty | 0 | 698 | 1 | 72,194,884 | 72,194,884 | 2 | true | 2022-05-10T23:43:37.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Netty Http Client - Configure DNSResolution timeout<p>I am getting this error with WebClient. This is expected as per my configuration. But how to configure ... |
72,193,273 | How to establish types with `create temp table as` in psql?<p>Let's say I'm trying to dynamically load in some data to a psql script like this. My first step is to create a temporary table with the data I'm loading in dynamically.</p>
<pre><code>create temp table data (id, date, value1, value2, value3) as (
values
... | <p>You can't define column types when using <code>create table ... as select ...</code></p>
<p>But it's enough to cast the values of the <em>first</em> row, because those determine the data type for all:</p>
<pre><code>create temp table data (id, date, value1, value2, value3) as
values
(1002178, '2022-05-10'::da... | How to establish types with `create temp table as` in psql? | postgresql | 0 | 28 | 1 | 72,195,833 | 72,195,833 | 2 | true | 2022-05-10T21:46:38.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to establish types with `create temp table as` in psql?<p>Let's say I'm trying to dynamically load in some data to a psql script like this. My first step... |
72,195,988 | Python while string comparison<p>I was trying to debug some Python code of mine and I can't seem to figure this out. Any ideas why this keeps repeating if I input the correct argument for the direction input variable?</p>
<pre><code>direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n")
wh... | <p>Try <code>and</code> instead of <code>or</code>. Alternatively, you might find the following more readable:</p>
<pre class="lang-py prettyprint-override"><code>while direction not in ('encode', 'encrypt', 'decrypt', 'decode'):
</code></pre> | Python while string comparison | python|python-3.x | 0 | 51 | 3 | 72,196,010 | 72,196,010 | 2 | true | 2022-05-11T05:49:35.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python while string comparison<p>I was trying to debug some Python code of mine and I can't seem to figure this out. Any ideas why this keeps repeating if I ... |
72,195,497 | How do I automatically run a function after manually saving a buffer in Emacs Lisp in a particular mode?<p>I would like to run <code>untabify</code> on the current buffer on manually saving the buffer. Is there an easy way using Emacs Lisp to run this function as a on-save-hook for <code>elm-mode</code>?</p>
<p>This d... | <p>First of all, the code you posted cannot work, because (assuming it is written exactly like this in your init file), it will run when Emacs starts; at this point, <code>major-mode</code> is most likely not <code>elm-mode</code> and so no hook gets added.</p>
<p>Then: <code>print</code> does not <em>return</em> a str... | How do I automatically run a function after manually saving a buffer in Emacs Lisp in a particular mode? | emacs | 0 | 79 | 1 | 72,196,240 | 72,196,240 | 2 | true | 2022-05-11T04:39:05.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I automatically run a function after manually saving a buffer in Emacs Lisp in a particular mode?<p>I would like to run <code>untabify</code> on the c... |
72,194,080 | Unable to use Itext7 and other 3rd party library after updating to Android Studio Chipmunk<p>I just update my Android Studio to Chipmunk 2021.2.1 and my itext code dont work anymore. Im using itext7-core:7.2.2.</p>
<p><a href="https://i.stack.imgur.com/5WJfS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>I had the same problem with another library.</p>
<p>In my case, I was managing the library locally and importing it into my project as a jar file.</p>
<p>Specifying the path to the jar file directly solved the problem.
In my case, the problem was solved by adding the following notation to the app-level build.gradle.... | Unable to use Itext7 and other 3rd party library after updating to Android Studio Chipmunk | android-studio|itext7 | 0 | 238 | 1 | 72,196,359 | 72,196,359 | 2 | true | 2022-05-11T00:01:20.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to use Itext7 and other 3rd party library after updating to Android Studio Chipmunk<p>I just update my Android Studio to Chipmunk 2021.2.1 and my itex... |
72,194,959 | Keep bins between 5% and 95% of a histogram in OpenCV/Python<p>I am intending to skip some histograms of an image in the extreme points of the distribution of any gray image.
The extreme points to the left are represented by all the histograms lying in the region of 5%, and to the right are represented by all histogram... | <p>Based on my understanding of your question; you would like to avoid pixel intensities that are on the tail ends of your histogram. Pixels below 5% and above 95% of the distribution must be clipped.</p>
<p>First, obtain histogram of your grayscale image with 256 bins:</p>
<pre><code>hist = cv2.calcHist([img],[0],None... | Keep bins between 5% and 95% of a histogram in OpenCV/Python | python|numpy|opencv|image-processing | 0 | 130 | 1 | 72,196,764 | 72,196,764 | 2 | true | 2022-05-11T03:10:55.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keep bins between 5% and 95% of a histogram in OpenCV/Python<p>I am intending to skip some histograms of an image in the extreme points of the distribution o... |
72,196,951 | How to get unique element from two arrays in js?<p>I'm trying to get unique (by id) values from two arrays.</p>
<p>But it returns whole array instead of <code>{ id: 3 }</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snip... | <p>You cannot compare objects you should check that an element with that id doesn't exists in the other array</p>
<p>here I used <code>some</code> that returns a boolean if he can find a match</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">... | How to get unique element from two arrays in js? | javascript|reactjs|ecmascript-6 | 0 | 84 | 3 | 72,196,990 | 72,196,990 | 2 | true | 2022-05-11T07:21:37.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get unique element from two arrays in js?<p>I'm trying to get unique (by id) values from two arrays.</p>
<p>But it returns whole array instead of <cod... |
72,196,922 | Can't get value of selected option<p>I am trying to create a dashboard in react. I want to be able to select today, yesterday. this week. etc, and have data change. I am trying to do this by using:</p>
<pre><code><select onChange={handlefilter}>
{data.map((item) => (
<option value={item.id}>{item.... | <p>You need to change <code>select</code> to :</p>
<p><code><select onChange={handleFilter}></code></p>
<p>Then update your handler to :</p>
<pre><code>const handleFilter = (e) => {
console.log(e.target.value); // this is the order.id
}
</code></pre> | Can't get value of selected option | reactjs | 0 | 44 | 3 | 72,197,006 | 72,197,006 | 2 | true | 2022-05-11T07:18:53.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't get value of selected option<p>I am trying to create a dashboard in react. I want to be able to select today, yesterday. this week. etc, and have data ... |
72,197,128 | Typo3 v10 Persistence Mapping foreignClass<p>since Typo3 v10 you have to use Classes.php file in Configuration/extbase/Persistence Folder for configuration of persistence table mapping.</p>
<p>Does anyone know how to implement</p>
<pre><code>config.tx_extbase.persistence.classes {
Domain\DomainUsergroupMailer\Doma... | <p>There never was such a feature in TYPO3 as confirmed by searching the TYPO3v9 source code for <code>foreignClass</code>. So this must be provided by a 3rd party extension.</p>
<p>However, from the name it sounds like you only need to use an appropriate element type for your collection relation:</p>
<pre class="lang-... | Typo3 v10 Persistence Mapping foreignClass | mapping|typo3|persistence|extbase | 0 | 86 | 1 | 72,197,316 | 72,197,316 | 2 | true | 2022-05-11T07:36:45.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typo3 v10 Persistence Mapping foreignClass<p>since Typo3 v10 you have to use Classes.php file in Configuration/extbase/Persistence Folder for configuration o... |
72,197,784 | Deleting duplicates on combination of two columns in oracle<p>I have a table for example :
Port Table</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">S No</th>
<th style="text-align: center;">A Port</th>
<th style="text-align: right;">B port</th>
</tr>
</thead>
<tb... | <p>You can use a single <code>MERGE</code> statement and the <code>ROW_NUMBER</code> analytic function combined with <code>GREATEST</code> and <code>LEAST</code> to find and delete the duplicates:</p>
<pre class="lang-sql prettyprint-override"><code>MERGE INTO table_name dst
USING (
SELECT ROWID rid,
ROW_NUM... | Deleting duplicates on combination of two columns in oracle | sql|oracle | 0 | 31 | 2 | 72,197,980 | 72,197,980 | 2 | true | 2022-05-11T08:27:50.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting duplicates on combination of two columns in oracle<p>I have a table for example :
Port Table</p>
<div class="s-table-container">
<table class="s-tab... |
72,197,946 | I have two "exact" functions and one doesn't work<p>I have two functions that are, from what I can tell, exactly the same. The only difference is one is a concise body and the other is the pre-ES6 long version. The concise version works and the other doesn't. What's the problem with the longer version?</p>
<pre><code>/... | <p>The <code>() => something()</code> syntax inserts an implicit return before <code>something()</code>. To make these functions equivalent add a <code>return</code> to the function:</p>
<pre><code>function() {
return getSleepHours('monday') +
getSleepHours('tuesday') +
getSleepHours('wednesday') +
get... | I have two "exact" functions and one doesn't work | javascript|function|syntax-error | 0 | 35 | 1 | 72,197,997 | 72,197,997 | 2 | true | 2022-05-11T08:40:37.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have two "exact" functions and one doesn't work<p>I have two functions that are, from what I can tell, exactly the same. The only difference is one is a co... |
72,198,016 | How can I create a dynamic object in a literal?<p>I have an object which includes several fields, most values are strings (constants) but I also want to use a variable (populated using some state)</p>
<pre><code>const {order} = this.state;
myObject={{
fieldA: 2,
fieldB: ${order.value}
}}
</code></pre>
<p>I tri... | <p>You are adding 2 brackets for an object which is not valid and no need of template literal.</p>
<pre><code>const { order } = this.state;
const myObject = {
fieldA: 2,
fieldB: order.value,
};
</code></pre> | How can I create a dynamic object in a literal? | javascript|reactjs|material-ui | 0 | 80 | 3 | 72,198,058 | 72,198,058 | 2 | true | 2022-05-11T08:44:43.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a dynamic object in a literal?<p>I have an object which includes several fields, most values are strings (constants) but I also want to use ... |
72,198,156 | How to create a function that randomly selects a string?<p>I have a function that adds the string "add" to the list every 5 seconds. How can I make a function so that it randomly selects one of 3 rows and adds it? And every 5 seconds chose another.
Strings: 'add', 'delete', 'remove'.
My code:</p>
<pre class="... | <p>Random is indeed the way to go. Since this is Dart, and not JS, <code>Math.random()</code> specifically won't work, but you can use <code>Random</code> in <code>dart:math</code> instead ;)</p>
<pre class="lang-dart prettyprint-override"><code>final List<String> options = ["add", "delete", &... | How to create a function that randomly selects a string? | flutter|dart | 0 | 42 | 1 | 72,198,442 | 72,198,442 | 2 | true | 2022-05-11T08:55:36.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a function that randomly selects a string?<p>I have a function that adds the string "add" to the list every 5 seconds. How can I make... |
72,197,777 | A question about parameter type and return type of buildBlock in @resultBuilder<p>According to the swift language guide, I need to implement buildBlock method when I define a result builder. And the guide also says:</p>
<p>"
static func buildBlock(_ components: Component...) -> Component</p>
<p>Combines an arra... | <p>When they say</p>
<pre><code>static func buildBlock(_ components: Component...) -> Component
</code></pre>
<p>They don't <em>strictly</em> mean that there exists one type, <code>Component</code>, that <code>buildBlock</code> must take in and return. They just mean that <code>buildBlock</code> should take in a num... | A question about parameter type and return type of buildBlock in @resultBuilder | swift|swiftui | 0 | 53 | 1 | 72,198,669 | 72,198,669 | 2 | true | 2022-05-11T08:27:14.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A question about parameter type and return type of buildBlock in @resultBuilder<p>According to the swift language guide, I need to implement buildBlock metho... |
72,198,725 | Check values in array without using a loop<p>i'm trying to check two values and if they are met do something if not obviously throw an error. Now the problem im having is that the array needs to be completely checked before the error has to be thrown.
EX:</p>
<ul>
<li>in my sheet i have a letter d</li>
<li>in my array ... | <p>You can use a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else" rel="nofollow noreferrer"><code>else if</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break" rel="nofollow noreferrer"><code>break</code></a>:</p>
<pre... | Check values in array without using a loop | arrays|google-apps-script|google-sheets | 0 | 63 | 2 | 72,198,832 | 72,198,832 | 2 | true | 2022-05-11T09:36:43.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check values in array without using a loop<p>i'm trying to check two values and if they are met do something if not obviously throw an error. Now the problem... |
72,170,009 | How can I include dagre/graphlib in a vue.js site built with vite<p>I want to include dagre (or graphlib, get same issues) in a vite based vue project but hitting issues at either runtime or build time depending on options I've tried.</p>
<pre><code>➜ npm create vite@latest
✔ Project name: … demo
✔ Select a framework: ... | <p>A workaround is to add an option to the CommonJS compilation module, it's discussed on GitHub: <a href="https://github.com/vitejs/vite/issues/5759#issuecomment-1034461225" rel="nofollow noreferrer">https://github.com/vitejs/vite/issues/5759#issuecomment-1034461225</a></p>
<p>Vite's config file should be changed like... | How can I include dagre/graphlib in a vue.js site built with vite | javascript|vue.js|vite|dagre | 0 | 264 | 1 | 72,198,834 | 72,198,834 | 2 | true | 2022-05-09T09:47:41.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I include dagre/graphlib in a vue.js site built with vite<p>I want to include dagre (or graphlib, get same issues) in a vite based vue project but hi... |
72,197,835 | How to reduce model file size in ".h5"<p>I'm using tensorflow and keras 2.8.0 version.</p>
<p>I have the following network:</p>
<pre><code>#defining model
model=Sequential()
#adding convolution layer
model.add(Conv2D(256,(3,3),activation='relu',input_shape=(256,256,3)))
#adding pooling layer
model.add(MaxPool... | <p><strong>General reason</strong>: The size of your h5 file is based only on the number of parameters your model has.</p>
<p>After constructing the model add the line <code>model.summary()</code> and look at the number of parameters the model has in general.</p>
<p><strong>Steps to reduce model size</strong>: You have... | How to reduce model file size in ".h5" | python|tensorflow|machine-learning|keras|deep-learning | 0 | 371 | 1 | 72,199,053 | 72,199,053 | 2 | true | 2022-05-11T08:31:18.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce model file size in ".h5"<p>I'm using tensorflow and keras 2.8.0 version.</p>
<p>I have the following network:</p>
<pre><code>#defining model
... |
72,198,839 | what is the equivalent method for .pack("H*")].pack("m0") of Ruby in Javascript?<p>In Ruby, I use function <code>.pack("H*")].pack("m0")</code> to encode a hex message string to base64 string.</p>
<p>ex.</p>
<pre class="lang-rb prettyprint-override"><code>msg_hex = 8308862831031591345F01010102066360... | <p>You was nearly there with what you supplied.</p>
<p>You just forgot to tell <code>Buffer.from</code> what you was supplying, as default if you send a string it's just going to store it as a string. But what you wanted was to decode the source as hex and then store as binary.</p>
<p>So doing -></p>
<pre><code>Buf... | what is the equivalent method for .pack("H*")].pack("m0") of Ruby in Javascript? | javascript|base64 | 0 | 44 | 1 | 72,199,074 | 72,199,074 | 2 | true | 2022-05-11T09:45:01.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is the equivalent method for .pack("H*")].pack("m0") of Ruby in Javascript?<p>In Ruby, I use function <code>.pack("H*")].pack("m0")<... |
72,196,265 | make two fields in serializer from a same model<p>I'm using a nested serializer in another serializer and I have two models <code>Object</code> and <code>ObjectMedia</code> see the following code:</p>
<pre><code>class ObjectMediaSerializer(serializers.ModelSerializer):
media_address = serializers.SerializerMethodFi... | <p>You can do this using a <code>SerializerMethodField</code>:</p>
<pre class="lang-py prettyprint-override"><code>class ObjectAddEditSerializer(serializers.ModelSerializer):
slug = serializers.SlugField(read_only=True)
object_media_type1 = serializers.SerializerMethodField()
object_media_type2 = serial... | make two fields in serializer from a same model | django|django-rest-framework|django-serializer | 0 | 188 | 1 | 72,199,532 | 72,199,532 | 2 | true | 2022-05-11T06:21:27.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
make two fields in serializer from a same model<p>I'm using a nested serializer in another serializer and I have two models <code>Object</code> and <code>Obj... |
72,199,157 | Java Generic Type flexibility with subtype assignment<p>I have the following structure. A parent class:</p>
<pre><code>public class MyTree<E extends MyTree<E>>{
List<E> children;
public MyTree(List<E> ls){
this.children = ls;
}
public void insert(E t){
this.children.a... | <p>The error occurs because <code>insert</code> expects <code>SpecTree<Number></code>, but we are giving it <code>SpecTree<Integer></code>.</p>
<p>According to <a href="https://stackoverflow.com/q/2723397/5133585">PECS</a>, <code>insert</code> would be able to take both <code>SpecTree<Number></code> a... | Java Generic Type flexibility with subtype assignment | java|generics | 0 | 32 | 1 | 72,199,632 | 72,199,632 | 2 | true | 2022-05-11T10:06:44.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Generic Type flexibility with subtype assignment<p>I have the following structure. A parent class:</p>
<pre><code>public class MyTree<E extends MyTre... |
72,199,214 | b-form-checkbox v-model as a Boolean<p>I tried to bind class attribute inside Vue component template to model's value that is expected to be true/false boolean type. When my view firstly created it get classes properly based on boolean value. But when I click on checkbox it seems to be rewrite model's value to strings ... | <ol>
<li><code>value=true</code> is not valid HTML (even though for some reason Vue compiles it just fine and behaves like in case 2.)</li>
<li><code>value="true"</code> - when not using <code>v-bind</code>, right side is always treated as a string (as an attribute value in HTML is always string)</li>
<li><co... | b-form-checkbox v-model as a Boolean | twitter-bootstrap|vue.js | 0 | 387 | 1 | 72,199,879 | 72,199,879 | 2 | true | 2022-05-11T10:10:41Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
b-form-checkbox v-model as a Boolean<p>I tried to bind class attribute inside Vue component template to model's value that is expected to be true/false boole... |
72,200,057 | This interaction failed - Discord.js<p>I'm making a discord slash command <code>nowplaying</code> with save button in it and sent the current music playing in user's dm. i manage to create the buttons working but my problem is after clicking the button "Save Song" it says <strong>"This interaction failed... | <p>After you switched case to your id, you need to <code>defer</code> your interaction with <code>await interaction.deferReply()</code> also if you want it an ephemeral message there's option as <code>await interaction.deferReply({ ephemeral: true })</code>. This line should be awaited.</p> | This interaction failed - Discord.js | javascript|node.js|discord.js | 0 | 622 | 1 | 72,200,173 | 72,200,173 | 2 | true | 2022-05-11T11:14:56.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
This interaction failed - Discord.js<p>I'm making a discord slash command <code>nowplaying</code> with save button in it and sent the current music playing i... |
72,199,441 | Mule 4 sftp read file - reconnection strategy not working<p>Am trying to read a file from a SFTP location .
Am using Mule 4.4 Community edition.
If there is any error while connecting to SFTP server or file is not present , would like mule to retry 2 times .</p>
<p>So I configured in sftp connector : 'Reconnection stra... | <p>Reconnection strategies are for connections, not operations that fail. In your example the connection is working ok. The operation fails because the directory doesn't exists.</p>
<p>For an operations you should put the operation inside an <code><until-successful></code> scope. You can use the maxRetries attrib... | Mule 4 sftp read file - reconnection strategy not working | mule|mule-component|mule4|mule-connector | 0 | 102 | 1 | 72,200,197 | 72,200,197 | 2 | true | 2022-05-11T10:28:12.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mule 4 sftp read file - reconnection strategy not working<p>Am trying to read a file from a SFTP location .
Am using Mule 4.4 Community edition.
If there is ... |
72,198,774 | How to get all the links of all children of an element<p>I have a element that I am able to locate:</p>
<p><code>cy.get('[foo="bar"]')</code></p>
<p>Now I'm trying to locate all the <code>a</code> elements within said element:</p>
<p><code>cy.get('[foo="bar"] a')</code> this should give me all the e... | <p>I think the step <code>.invoke('attr', 'href')</code> is just returning the first, see <a href="https://api.jquery.com/attr/" rel="nofollow noreferrer">.attr()</a></p>
<blockquote>
<p>Get the value of an attribute for the <strong>first element</strong> in the set of matched elements</p>
</blockquote>
<p>So, maybe</p... | How to get all the links of all children of an element | javascript|cypress | 0 | 41 | 1 | 72,200,235 | 72,200,235 | 2 | true | 2022-05-11T09:40:46.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get all the links of all children of an element<p>I have a element that I am able to locate:</p>
<p><code>cy.get('[foo="bar"]')</code></p>
<... |
72,192,252 | How to terminate all subprocesses when the first one completes<p>How to terminate both processes simultaneously? Code below starts and awaits for both processes to end execution until it terminates them, I want to terminate both processes when one of them reaches the goal first. (Enters loop 1000 times and calculates i... | <p>Pass to each process a <code>multiprocessing.Event</code> instance that the processes set when they complete. The main process simply waits for the event to be set indicating that a process has completed.</p>
<p>If the tasks are daemon tasks and the main process has nothing further to do, it can simply exit and what... | How to terminate all subprocesses when the first one completes | python|multiprocessing | 0 | 59 | 1 | 72,200,253 | 72,200,253 | 2 | true | 2022-05-10T19:54:38.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to terminate all subprocesses when the first one completes<p>How to terminate both processes simultaneously? Code below starts and awaits for both proces... |
72,200,238 | Comparing two lists of tuples and looking for different values<p>I have two lists of tuples. For example:</p>
<p>The first one I keep:</p>
<pre><code>[
("base", "first_val", "value 1", "1"),
("base", "first_val", "value 2", "0"),
("bas... | <p>You can use <code>set</code> in Python to determine changed values:</p>
<pre class="lang-py prettyprint-override"><code>first_list = [("base", "first_val", "value 1", "1"),
("base", "first_val", "value 2", "0"),
... | Comparing two lists of tuples and looking for different values | python|python-3.x | 0 | 39 | 1 | 72,200,377 | 72,200,377 | 2 | true | 2022-05-11T11:27:45.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparing two lists of tuples and looking for different values<p>I have two lists of tuples. For example:</p>
<p>The first one I keep:</p>
<pre><code>[
(&quo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.