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,236,230 | Remove redundant legends on the chart using generateLabels with ChartJS v3<p>I have a chart as follows, I only need one pair of legends (data 1 and data 2) to show on the chart.</p>
<p>In ChartJS v2, I can use generateLabels like <a href="https://codesandbox.io/s/sandbox-group-stacked-forked-2j4602?file=/src/index.js:1... | <p><code>options.plugins.legend.labels.generateLabels</code> can still be used in <a href="https://www.chartjs.org/docs/latest/configuration/legend.html#legend-label-configuration" rel="nofollow noreferrer">Chart.js v3</a>. For your case, this could look as follows:</p>
<pre><code>generateLabels: chart => chart.data... | Remove redundant legends on the chart using generateLabels with ChartJS v3 | javascript|charts|chart.js | 0 | 168 | 1 | 72,237,654 | 72,237,654 | 1 | true | 2022-05-13T23:25:32.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove redundant legends on the chart using generateLabels with ChartJS v3<p>I have a chart as follows, I only need one pair of legends (data 1 and data 2) t... |
72,199,063 | Save folder name as variable in a loop using bash<p>I have multiple folders and I'm trying to save each folder name as a varible for downstream use in a loop:</p>
<pre><code>for f in TINKER*;
do
name=$(echo $f | sed 's/TINKER_more([0-9]+)_less([0-9]+)/TINKER_$1_$2/')
echo $name
done
</code></pre>
<p>Folder exam... | <p>The <code>+</code> in POSIX BRE regex matches a literal <code>+</code> char. You need to add an <code>-E</code> option to make <code>sed</code> use the POSIX ERE syntax.</p>
<p>Besides, you need to use <code>\n</code>, not <code>$n</code>, in the replacement. <code>perl</code> uses <code>$n</code> replacement backre... | Save folder name as variable in a loop using bash | bash|sed | 0 | 62 | 3 | 72,199,296 | 72,199,296 | 1 | true | 2022-05-11T10:00:23.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save folder name as variable in a loop using bash<p>I have multiple folders and I'm trying to save each folder name as a varible for downstream use in a loop... |
72,166,420 | Can console.log be passed in to test a Ember.js component from my application template?<p>I am building a simple button component and I would like to test that my click handler is working by passing in <code>console.log</code> (or some other function) into my component. This is in Ember 4.</p>
<p><code>app/components/e... | <p>I don't think you can do it from the <code>.hbs</code> file. But if that's not your goal (which i doubt it is) then you can add a function called an action to your controller <code>application.js</code> (or wherever you call the component from; might be a containing component) file and there you'll be able to do wha... | Can console.log be passed in to test a Ember.js component from my application template? | ember.js|glimmer.js | 0 | 136 | 1 | 72,175,554 | 72,175,554 | 1 | true | 2022-05-09T02:25:21.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can console.log be passed in to test a Ember.js component from my application template?<p>I am building a simple button component and I would like to test th... |
72,125,273 | Is there a way to query specific values from psql in Ruby Ransack?<p>I'm trying to optimize a report building function, and as it always does, the querying takes most of the time, so I try to speed it up a bit.</p>
<p>Now I found a solution for the problem, I'm just trying to implement it, but I want to use Ransack for... | <p>I believe you need to call <code>select</code> on the <code>result</code>.</p>
<p>For Example:</p>
<pre><code>@search= Spree::Order.complete.ransack(@search_pattern)
@table_info = @search.result
.joins(:payments)
.left_joins(:refunds)
.where(payments: Spree::Payment.completed) # not sure how this is working
... | Is there a way to query specific values from psql in Ruby Ransack? | sql|ruby|postgresql|ransack | 0 | 26 | 1 | 72,131,250 | 72,131,250 | 1 | true | 2022-05-05T09:58:12.960Z | 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 query specific values from psql in Ruby Ransack?<p>I'm trying to optimize a report building function, and as it always does, the querying t... |
72,198,379 | Convert two repeated values in array into a string<p>I have some old documents where a field has an array of two vales repeated, something like this:</p>
<pre class="lang-json prettyprint-override"><code> "task" : [
"first_task",
"first_task"
],
<... | <p>You can achieve this with <code>_update_by_query</code> endpoint. Here is an example:</p>
<pre class="lang-json prettyprint-override"><code>POST tasks/_update_by_query
{
"script": {
"source": """
if (ctx._source['task'][0] == ctx._source['task'][1]) {
ctx._sou... | Convert two repeated values in array into a string | elasticsearch|dsl|elasticsearch-dsl | 0 | 47 | 1 | 72,200,472 | 72,200,472 | 1 | true | 2022-05-11T09:12:27.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert two repeated values in array into a string<p>I have some old documents where a field has an array of two vales repeated, something like this:</p>
<pr... |
72,217,216 | Android 13 - enable accessibility service for APK which installed not from Google Play<p>On the <a href="https://developer.android.com/about/versions/13/get" rel="nofollow noreferrer">beta version of Android 13</a> user can't enable Accessibility from the Settings app. When the user try to do it there is an error:</p>
... | <p>Here is a workaround:</p>
<ol>
<li>Go to app info.</li>
<li>Tap on 3 dots.</li>
<li>Choose "allow restricted settings".</li>
<li>You'll asked for you lock code.</li>
</ol>
<p>Now you can enable accessibility.</p>
<p>Note: this is a beta version so it can be changed in the next beta versions.</p> | Android 13 - enable accessibility service for APK which installed not from Google Play | android|accessibilityservice|android-13 | 0 | 1,127 | 1 | 72,217,217 | 72,217,217 | 1 | true | 2022-05-12T14:12:41.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android 13 - enable accessibility service for APK which installed not from Google Play<p>On the <a href="https://developer.android.com/about/versions/13/get"... |
72,164,251 | Method chaning in javascript<p>How do I create method chaining functionality similar to <code>jQuery</code> in <code>JavaScript</code>. For eg. I have a main function where I can add different methods to it like add, subtract, multiply, divide, while main function taking one param.</p>
<p><code>Main(5).add(3).subtract(... | <p>Change your code to:</p>
<pre><code>function Main(a) {
this.value = a;
}
Main.prototype.sum = function (a) {
this.value += a;
return this;
}
Main.prototype.subtract = function (a) {
this.value -= a;
return this;
}
</code></pre>
<p>Usage:</p>
<pre><code>let var1 = new Main(5).sum(3).subtract(2);... | Method chaning in javascript | javascript | 0 | 55 | 3 | 72,164,303 | 72,164,303 | 1 | true | 2022-05-08T18:59:53.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Method chaning in javascript<p>How do I create method chaining functionality similar to <code>jQuery</code> in <code>JavaScript</code>. For eg. I have a main... |
72,213,707 | ValueError: Index data must be 1-dimensional<p>I am trying to make a dataframe with RANDOM FOREST actual . prediction value and all the information from <code>X_test</code>.</p>
<p>This is my code:</p>
<pre><code>def makeDataframe(self):
self.df.index = self.X_test.reset_index()
self.df['type'] = self.y_test
... | <p>You are getting the above error because reset_index() will return a DataFrame and not a 1-dimensional data you can replace it with <code>self.X_test.index.values</code> or To create a DataFrame you can use a Dictionary like this:</p>
<pre><code>def makeDataframe(self):
data = {}
data.update({'index': self.X.... | ValueError: Index data must be 1-dimensional | python|python-3.x|dataframe|random-forest|prediction | 0 | 181 | 1 | 72,213,847 | 72,213,847 | 1 | true | 2022-05-12T10:10:12.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ValueError: Index data must be 1-dimensional<p>I am trying to make a dataframe with RANDOM FOREST actual . prediction value and all the information from <co... |
72,179,282 | How to merge duplicates<p>I want to merge the same records to:</p>
<pre><code>Audi A3 / S3 / RS3
8V / 8Y
Audi A4 / S4 / RS4
B8 / B9
</code></pre>
<p>etc.</p>
<p><a href="https://i.stack.imgur.com/ffX4M.png" rel="nofollow noreferrer">But now it looks like that</a></p>
<p>Here is my repository code:</p>
<pre><code>... | <p>As mentioned in the comments, you need to restructure the resulting data array, that is, prepare the desired data structure and pass the template to twig.</p>
<p>Controller method:</p>
<pre><code>public function index(ModelRepository $modelRepository): Response
{
$cars = [];
foreach ($modelRepository->ca... | How to merge duplicates | symfony|doctrine-orm|twig | 0 | 77 | 2 | 72,182,383 | 72,182,383 | 1 | true | 2022-05-09T23:48:01.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to merge duplicates<p>I want to merge the same records to:</p>
<pre><code>Audi A3 / S3 / RS3
8V / 8Y
Audi A4 / S4 / RS4
B8 / B9
</code></pre>
<p>et... |
72,209,528 | Populate dynamic dropdown, Codeigniter<p>I'm trying to make a dynamic dropdown with Codeigniter but I'm having trouble getting the values on the next dropdown. When I select and option on the first dropdown, the second dropdown is not populated:</p>
<p><a href="https://i.stack.imgur.com/9OBQB.png" rel="nofollow norefer... | <p>Your question doesn't mention it, but your CSS suggests your <code>select</code>s are actually using <a href="https://select2.org/" rel="nofollow noreferrer">Select2</a>. When you initialise a <code>select</code> as a Select2, it makes a copy of the initial HTML, and adds styling and JS to it, and it is the copy th... | Populate dynamic dropdown, Codeigniter | codeigniter | 0 | 74 | 2 | 72,211,547 | 72,211,547 | 1 | true | 2022-05-12T02:34:49.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Populate dynamic dropdown, Codeigniter<p>I'm trying to make a dynamic dropdown with Codeigniter but I'm having trouble getting the values on the next dropdow... |
72,073,747 | Finding elements in array using for loop<pre class="lang-java prettyprint-override"><code>import java.util.Arrays;
import java.util.Scanner;
public class Grocer2 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[] names = new String[5];
int count = 0;
... | <pre class="lang-java prettyprint-override"><code>while(true){
System.out.println("Who are you looking for ? ");
String contact = scan.nextLine();
bool isFound = false;
for(int i = 0; i < names.length; i++){
if(names[i].equals(contact)){
System.out.println("They are... | Finding elements in array using for loop | java|arrays|for-loop|java.util.scanner | 0 | 291 | 5 | 72,073,759 | 72,073,759 | 1 | true | 2022-05-01T03:15:14.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding elements in array using for loop<pre class="lang-java prettyprint-override"><code>import java.util.Arrays;
import java.util.Scanner;
public class Gr... |
72,213,478 | Terraform: Reference locals values inside the creation block<p>Is it possible to reference another locals value inside the creation of a locals value?</p>
<p>The example below was the smallest and simplest example I could come up with.</p>
<pre><code>variable "size" {
default = 3
}
variable "infra... | <p>Instead of doing variable interpolation every time a value should be used, it's possible to create a local module that acts as a function.
Where you can use local variables and reuse previously created variables.</p>
<p>Short example below, it's better suited when used for more complex and larger applications due to... | Terraform: Reference locals values inside the creation block | terraform|terraform0.12+ | 0 | 606 | 2 | 72,270,219 | 72,270,219 | 1 | true | 2022-05-12T09:52:41.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Terraform: Reference locals values inside the creation block<p>Is it possible to reference another locals value inside the creation of a locals value?</p>
<p... |
72,169,107 | Is it possible to save file locations in Visual Studio Code to navigate between folders?<p>I have a Visual Studio Code project with lots of files in lots of subfolders. As I am working on my code I need to navigate back and forth through all of these different (sub-)locations which is very tedious. <strong>Is there a w... | <p>With the extension <a href="https://marketplace.visualstudio.com/items?itemName=rioj7.html-related-links" rel="nofollow noreferrer">HTML Related Links</a> you can create a file with relative paths to files and have a <code>Related Links</code> View in the Explorer bar. This View can be locked to the file with the li... | Is it possible to save file locations in Visual Studio Code to navigate between folders? | file|visual-studio-code|directory|hyperlink|navigation | 0 | 119 | 1 | 72,171,063 | 72,171,063 | 1 | true | 2022-05-09T08:35:51.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to save file locations in Visual Studio Code to navigate between folders?<p>I have a Visual Studio Code project with lots of files in lots of ... |
72,194,618 | Escape char in filenamedir under Windows<p>I have a really specific issue with Vs Code, which i probably guess has a simple solution but haven't been able to find it.</p>
<p>At some keybind, i get the location of the current file using <code>${fileDirname}</code> and then send it as text to an ipython terminal for some... | <p>With the extension <a href="https://marketplace.visualstudio.com/items?itemName=rioj7.command-variable" rel="nofollow noreferrer">Command Variable</a> you can transform a text with variables with <code>find</code>/<code>replace</code> and send it to the terminal</p>
<pre class="lang-json prettyprint-override"><code>... | Escape char in filenamedir under Windows | python|visual-studio-code|ipython | 0 | 43 | 1 | 72,195,183 | 72,195,183 | 1 | true | 2022-05-11T02:00:35.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Escape char in filenamedir under Windows<p>I have a really specific issue with Vs Code, which i probably guess has a simple solution but haven't been able to... |
72,219,150 | “sed” replace ambiguous pattern along with argument<p>I've got bunch of logs in which, on regular basis, I need to replace sensitive information like passwords and hostnames. Let’s say all occurrences needs to be replaced with keyword REMOVED. I cannot delete them as there need to be a proof that data was there.</p>
<p... | <p>Using <code>sed</code></p>
<pre><code>$ cat input_file
password secret123 do-not-delete
password: secret123 do-not-delete
password = secret123 do-not-delete
app_password=secret123 do-not-delete
web-one do-not-delete
web-two do-not-delete
chicagonode1 do-not-delete
chicagonode2 do-not-delete
</code></pre>
<pre><code>... | “sed” replace ambiguous pattern along with argument | shell|sed | 0 | 48 | 1 | 72,219,591 | 72,219,591 | 1 | true | 2022-05-12T16:27:08.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
“sed” replace ambiguous pattern along with argument<p>I've got bunch of logs in which, on regular basis, I need to replace sensitive information like passwor... |
72,143,115 | javascript split array in two arrays<p>I am trying to split this array into two different arrays using the values inside the first array.</p>
<p>This is my initial array:</p>
<pre><code> "carList": [
{
"brand": [
{
"model": [
{ "mot... | <p>This would be one way of doing it:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const data={"carList":[
{"brand":[{"model": [{ "motor": { "id": 1 }, "color": 10 },
... | javascript split array in two arrays | javascript|arrays|filter | 0 | 63 | 1 | 72,143,454 | 72,143,454 | 1 | true | 2022-05-06T14:27:28.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript split array in two arrays<p>I am trying to split this array into two different arrays using the values inside the first array.</p>
<p>This is my i... |
72,230,659 | Pandas : Create new column based on text values of other columns<p>My dataframe looks like this:</p>
<pre class="lang-python prettyprint-override"><code> id text labels
0 447 glutamine synthetase [protein]
1 447 GS [protein]
2 447 hepa... | <p>Use <code>df.explode</code> with <code>Groupby.agg</code> and <code>df.pivot</code>:</p>
<pre><code>In [417]: out = df.explode('labels').groupby(['id', 'labels'])['text'].agg(','.join).reset_index().pivot('id', 'labels').reset_index().droplevel(0, axis=1).rename_axis(None, axis=1)
In [423]: out.columns = ['id', 'in... | Pandas : Create new column based on text values of other columns | python|pandas|dataframe | 0 | 43 | 1 | 72,230,752 | 72,230,752 | 1 | true | 2022-05-13T13:49:08.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas : Create new column based on text values of other columns<p>My dataframe looks like this:</p>
<pre class="lang-python prettyprint-override"><code> ... |
72,164,710 | Change the select to custom select with down arrow in react quill<p>Is there a way I can change this select drop down to a custom select drop down with a down arrow instead of the default quill arrows?</p>
<p><a href="https://i.stack.imgur.com/MLLXB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MLL... | <p>You can select <code>ql-picker-label</code>, and makes its default icon (the double pointing arrow) which is enclosed within an <code>svg</code> hidden, by setting <code>display: none</code>. Then, since the text itself is enclosed within the <code>::before</code> pseudo-element, you can set the <code>background-ima... | Change the select to custom select with down arrow in react quill | react-quill | 0 | 191 | 1 | 72,164,765 | 72,164,765 | 1 | true | 2022-05-08T20:05:41.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change the select to custom select with down arrow in react quill<p>Is there a way I can change this select drop down to a custom select drop down with a dow... |
72,205,071 | How to dispose subscription?<p>How can I dispose subscription if my class is not in StatefulWidge? Is there any method?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>class Ev... | <p>I don't believe it's necessary in this case, since both the stream and subscription will be freed by the GC when the instance is freed.</p>
<p>However, <code>ValueNotifier</code> does have a <a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/dispose.html" rel="nofollow noreferrer">dispose method</a>.... | How to dispose subscription? | flutter|dart | 0 | 47 | 1 | 72,205,236 | 72,205,236 | 1 | true | 2022-05-11T17:12:41.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to dispose subscription?<p>How can I dispose subscription if my class is not in StatefulWidge? Is there any method?</p>
<p><div class="snippet" data-lang... |
72,147,592 | Multi-part geometries: Get line & part number when extracting parts (via SDO_UTIL.EXTRACT_ALL)<p>I have multi-part SDO_GEOMETRIES in Oracle 18c.</p>
<p>I can extract the <em>parts</em> as individual rows using the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/18/spatl/SDO_UTIL-reference.html#GUID-... | <p>Adapting <a href="https://stackoverflow.com/a/72076942/1509264">my answer to your previous question</a>, you can use:</p>
<pre class="lang-sql prettyprint-override"><code>with cte (shape) as (
--Each part is wrapped in brackets and separated by commas: (p1),(p2)
select sdo_geometry('MULTILINESTRING((1 1 1, 2 2 2... | Multi-part geometries: Get line & part number when extracting parts (via SDO_UTIL.EXTRACT_ALL) | sql|oracle|geometry|oracle-spatial|object-type | 0 | 58 | 1 | 72,147,723 | 72,147,723 | 1 | true | 2022-05-06T21:34:51.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multi-part geometries: Get line & part number when extracting parts (via SDO_UTIL.EXTRACT_ALL)<p>I have multi-part SDO_GEOMETRIES in Oracle 18c.</p>
<p>I can... |
72,197,614 | Set new field priority in SELECT SQL<p>I have a table of bills with the following structure:</p>
<pre><code>id | store_name | sum | payment_date
1 | Amazon | 10 | 11.05.2022
2 | Amazon | 20 | 11.05.2022
3 | Ebay | 15 | 11.05.2022
4 | AppleStore | 13 | 11.05.2022
5 | Google Play| 6 | 11.05.2022
... | <p>Order the rows for each day and then assign priority based on the row number:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT t.*,
CASE ROW_NUMBER()
OVER (PARTITION BY TRUNC(payment_date) ORDER BY sum DESC)
WHEN 1 THEN 1
WHEN 2 THEN 1
WHEN 3 THEN 2
WHEN 4 ... | Set new field priority in SELECT SQL | sql|oracle | 0 | 34 | 1 | 72,197,759 | 72,197,759 | 1 | true | 2022-05-11T08:14:31.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set new field priority in SELECT SQL<p>I have a table of bills with the following structure:</p>
<pre><code>id | store_name | sum | payment_date
1 | Amazon ... |
72,198,281 | Commenting out in a bulk SQL developer<p>How to single comment out selected text in a bulk? I have 100+ lines of text that have to be commented out, single line each but idk how to do it, you can only comment out in bulk multiple lines that are treated like one entity using <code>/* text */</code>, but I want to transf... | <p>Highlight the lines and then use:</p>
<ul>
<li><kbd>Ctrl</kbd>+<kbd>/</kbd></li>
<li><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>/</kbd> or</li>
<li>from the menu <code>Source > Toggle Line Comments</code>.</li>
</ul> | Commenting out in a bulk SQL developer | oracle-sqldeveloper | 0 | 27 | 1 | 72,198,385 | 72,198,385 | 1 | true | 2022-05-11T09:04:26.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Commenting out in a bulk SQL developer<p>How to single comment out selected text in a bulk? I have 100+ lines of text that have to be commented out, single l... |
72,233,656 | Is there a way to create an inline anonymous table in Oracle like in PostgreSQL?<p>I have a postgres query that creates an anonymous table from string values and then joins on them like this:</p>
<pre><code>select distinct anon_table.string1,
anon_table.string2,
anon_table.string3,
... | <p>You can do it with SQL if you <code>SELECT</code> from the <code>DUAL</code> table and use <code>UNION ALL</code> for multiple rows:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT DISTINCT
anon_table.string1,
anon_table.string2,
anon_table.string3,
rt.string4
FROM real_t... | Is there a way to create an inline anonymous table in Oracle like in PostgreSQL? | sql|oracle|join | 0 | 59 | 1 | 72,233,694 | 72,233,694 | 1 | true | 2022-05-13T17:51:51.477Z | 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 create an inline anonymous table in Oracle like in PostgreSQL?<p>I have a postgres query that creates an anonymous table from string values... |
72,204,021 | Today's date in utc formatted in epoch<p>I need to use <code>utc</code> epoch to match the correct Stackoverflow API values and the API uses the date without time as a filter parameter.</p>
<p>See the example on final to this page:<br />
<a href="https://api.stackexchange.com/docs/no-answer-questions#fromdate=2022-05-1... | <p>You need to feed it a timestamp integer. You should do this with</p>
<pre><code>from datetime import datetime, timezone
utc_timestamp = datetime.now(tz=timezone.utc).timestamp()
round(utc_timestamp)
</code></pre>
<p>Clarification - Per FObersteiner's comment,</p>
<p><code>datetime.utcnow()</code> is dangerously time... | Today's date in utc formatted in epoch | python|datetime|timestamp | 0 | 36 | 1 | 72,204,207 | 72,204,207 | 1 | true | 2022-05-11T15:48:37.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Today's date in utc formatted in epoch<p>I need to use <code>utc</code> epoch to match the correct Stackoverflow API values and the API uses the date without... |
72,176,235 | Why doesn't spark add performance configurations by default?<p>I was reading for some spark optimization techniques and found some configurations that we need to enable,such as</p>
<pre><code>spark.conf.set("spark.sql.cbo.enabled", true)
spark.conf.set("spark.sql.adaptive.enabled",true)
spark.conf.s... | <p>It does not turn on these features as they have a little more risk than not using them. To have the most stable platform they're not enabled by default.
One thing that is called out and called out by <a href="https://docs.databricks.com/spark/latest/spark-sql/cbo.html" rel="nofollow noreferrer">Databricks</a> is th... | Why doesn't spark add performance configurations by default? | apache-spark|pyspark|apache-spark-sql | 0 | 95 | 1 | 72,187,107 | 72,187,107 | 1 | true | 2022-05-09T17:49:18.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't spark add performance configurations by default?<p>I was reading for some spark optimization techniques and found some configurations that we nee... |
72,189,046 | Partitions in Spark Vs Partitions in a Data Lake<p>When writing a file to a Data Lake, specifically through Databricks, we have the option of specifying a partition column. This will save the data in separate folders (partitions) based on the values available in that column of the dataset.</p>
<p>At the same time, when... | <p>saving into a partition(folders) and spark partitions both partition data but that's about where there similarities end.</p>
<p>If you will query data by filtering on a particular(folder) column often then it makes sense to use save the data in partitions(folder). If you are going to roll data up across columns the... | Partitions in Spark Vs Partitions in a Data Lake | apache-spark|pyspark|apache-spark-sql|databricks|data-lake | 0 | 238 | 1 | 72,191,089 | 72,191,089 | 1 | true | 2022-05-10T15:24:36.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Partitions in Spark Vs Partitions in a Data Lake<p>When writing a file to a Data Lake, specifically through Databricks, we have the option of specifying a pa... |
72,150,751 | How to check if supervisor process is running or stopped using bash script<p>I run multiple supervisor processes sometimes due to server overload some processes <strong>Stop</strong> indefinitely until you manually restart them. Is there a way I can write a bash script that can be regularly executed by a crontab to che... | <p>First make and test a script without crontab that performs the actions you want.<br />
When the script is working, check that it still runs without the settings in your <code>.bashrc</code>, such as the path to <code>supervisorctl</code>.
Also check that your script doesn't write to stdout, perhaps introduce a logfi... | How to check if supervisor process is running or stopped using bash script | linux|bash|supervisord | 0 | 623 | 1 | 72,152,611 | 72,152,611 | 1 | true | 2022-05-07T08:22:50.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if supervisor process is running or stopped using bash script<p>I run multiple supervisor processes sometimes due to server overload some proces... |
72,132,186 | find feedback from text file from a list of training_id<p>I've a list of training_id_list= ['235', '121']
and I also have a sample txt file where feedback is saved in format:</p>
<pre><code>576---Great training---5.0---235
577---Not bad ---5.0---235
feedbacck_id--feedback--rating--training_id
</code></pre>
<p>Now, ... | <pre><code>training_id_list = ['235','233','234'] #your list which contains ids
max_print = 5
for id in training_id_list :
with open(r'abc.txt') as sample_txt:
read_sample_txt = sample_txt.readlines()
read_sample_txt = read_sample_txt[:-1:]
printed_review_count = 1
for line in read... | find feedback from text file from a list of training_id | python | 0 | 27 | 1 | 72,132,254 | 72,132,254 | 1 | true | 2022-05-05T18:42:20.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
find feedback from text file from a list of training_id<p>I've a list of training_id_list= ['235', '121']
and I also have a sample txt file where feedback is... |
72,232,350 | Trying to compare todays date to given date from HTML<p>I'm trying to compare dates as i take input from user using date in html and send it to servlet to validate it or know if it's today's date this is my trial and it would only work with two digit months as it prints month as 5 not 05</p>
<pre><code> String d... | <h1>tl;dr</h1>
<pre><code>LocalDate
.parse(
"2022-05-24"
)
.isEqual(
LocalDate
.now(
ZoneId.of( "America/Edmonton" )
)
)
</code></pre>
<h1>Avoid legacy classes</h1>
<p>Do not use <code>Calendar</code>, <code>Date</code>, <code>SimpleDateFormat</code> classes. These terribl... | Trying to compare todays date to given date from HTML | java | 0 | 49 | 2 | 72,233,679 | 72,233,679 | 1 | true | 2022-05-13T15:56:14.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to compare todays date to given date from HTML<p>I'm trying to compare dates as i take input from user using date in html and send it to servlet to va... |
72,235,533 | Java Time & Rest API<p>I’ve red multiple articles and discussions and still I have some uncertainty: I’m not sure if I should use <code>Instant</code> or any other type to store Booking – in the sense of “Online booking” (so participants that are from different countries/time zones needs meet in the same moment on the ... | <blockquote>
<p>store Booking – in the sense of “Online booking” (so participants that are from different countries/time zones needs meet in the same moment on the timeline). I tend to use LocalDateTime, since DB and Backend is set to UTC and since incoming “create booking” json message contains ISO 8601 (with offset) ... | Java Time & Rest API | java|rest|timezone|java-time|localdatetime | 0 | 420 | 2 | 72,237,097 | 72,237,097 | 1 | true | 2022-05-13T21:21:03.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Time & Rest API<p>I’ve red multiple articles and discussions and still I have some uncertainty: I’m not sure if I should use <code>Instant</code> or any... |
72,187,684 | Perimeter function in python<p>I am currently coding a program that calculates the perimeter of a geometric figure with the following coordenates:
(0.0, 0.0) (1.0, 5.0) (4.0, 8.0) (9.0, 4.0) (7.0, 1.0)
The perimeter should be 26.4214. However, my program prints a lower number.</p>
<p>I know for a fact that the error is... | <p>I think there is something wrong in the indentation.</p>
<pre><code>def perimetre(pol, num_vertexs):
perim= 0
for i in range(0, num_vertexs-1):
perim=perim+distancia_entre_dos_punts(pol[i,0],pol[i,1],pol[i+1,0],pol[i+1,1]) <----- Error?
perim= perim+distancia_entre_dos_punts(pol[num_vertexs,0]... | Perimeter function in python | python | 0 | 54 | 1 | 72,187,785 | 72,187,785 | 1 | true | 2022-05-10T13:55:42.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perimeter function in python<p>I am currently coding a program that calculates the perimeter of a geometric figure with the following coordenates:
(0.0, 0.0)... |
72,159,480 | How to fix string interpolation is not working in textarea with fornControlName?(Angular)<p>in the following code if I use</p>
<blockquote>
<p>formControlName="work_sample_description"</p>
</blockquote>
<p>for textarea , the text area does not load with the value of</p>
<blockquote>
<p>WorkSampleObj.work_samp... | <p>The issue is, that <code>[formControlName]</code> expects string name of the given form control. And you are passing reference to it. If you form group <code>workSampleEditForm</code> contains <code>work_sample_description</code> form control then just pass its name as a string (put the name in the single quotes)</p... | How to fix string interpolation is not working in textarea with fornControlName?(Angular) | angular|angular-material|textarea|string-interpolation | 0 | 123 | 2 | 72,160,999 | 72,160,999 | 1 | true | 2022-05-08T09:01:52.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix string interpolation is not working in textarea with fornControlName?(Angular)<p>in the following code if I use</p>
<blockquote>
<p>formControlNam... |
72,173,481 | How to get query s3 bucket by specific file size<p>at the moment there's some files being uploaded where they are getting corrupted. They'll have a filesize of 0 bytes. May I ask how do I query my s3 bucket and filter by specific size, i'm trying to query when byte is 0?</p>
<p><a href="https://i.stack.imgur.com/NCsZO.... | <p>You can use the <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html" rel="nofollow noreferrer"><code>--query</code></a> logic to filter the list objects locally to only those that are zero-byte big:</p>
<pre><code>aws s3api list-objects-v2 --bucket example-bucket --query 'Contents[?Size==... | How to get query s3 bucket by specific file size | amazon-web-services|amazon-s3|aws-cli | 0 | 157 | 1 | 72,174,949 | 72,174,949 | 1 | true | 2022-05-09T14:16:44.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get query s3 bucket by specific file size<p>at the moment there's some files being uploaded where they are getting corrupted. They'll have a filesize ... |
72,156,745 | tried saving a JOptionPane with a combo box result in a String, but it gives me "void cannot be converted to string"<p>here is the code that gives me error:</p>
<pre><code>private void btnLLamada1ActionPerformed(java.awt.event.ActionEvent evt) {
minutos = Integer.parseInt... | <p><code>JOptionPane.showMessageDialog(...)</code> does not return anything hence it returns <code>void</code>. And nothing (<code>void</code>) cannot be converted into a string. You want to use the method <code>showInputDialog</code>. For inspiration look at <a href="https://docs.oracle.com/javase/tutorial/uiswing/com... | tried saving a JOptionPane with a combo box result in a String, but it gives me "void cannot be converted to string" | java|swing|joptionpane | 0 | 32 | 1 | 72,156,935 | 72,156,935 | 1 | true | 2022-05-07T22:21:41.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tried saving a JOptionPane with a combo box result in a String, but it gives me "void cannot be converted to string"<p>here is the code that gives me error:<... |
72,214,735 | Flutter Firestore real-time pagination using multiple listeners streamed combined<p>I want to create a pagination screen, using Bloc, from the Firestore database. The screen should update on document changes.</p>
<p>My <code>FirestoreProviderApi</code> receives fetch requests from the Bloc unit. After fetching the docu... | <h2>Issue solved.</h2>
<p>I found good documentation of how to implement <a href="https://www.filledstacks.com/post/how-to-perform-real-time-pagination-with-firestore/" rel="nofollow noreferrer">real-time pagination using Firestore</a> (been implemented it, works like a charm).</p>
<p>Youtube implementation: <a href="h... | Flutter Firestore real-time pagination using multiple listeners streamed combined | flutter|dart|google-cloud-firestore|stream | 0 | 287 | 1 | 72,242,178 | 72,242,178 | 1 | true | 2022-05-12T11:30:40.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Firestore real-time pagination using multiple listeners streamed combined<p>I want to create a pagination screen, using Bloc, from the Firestore data... |
72,189,090 | how do I turn off data reloading from firebase while using FlutterFire_ui?<p>I am using googles flutter fire ui library and for the most part it is working fine, the only problem is there doesn't seem to be anyway listed to stop the snapshots from refreshing whenever the data changes.</p>
<p>here's my query:</p>
<pre><... | <p>The <code>FirestoreQueryBuilder</code> will automatically unsubscribe from realtime listeners if the widget is destroyed.</p>
<p>If you need more control about when to cancel, pause or resume a listener, I would recommend to use a <code>StreamSubscription</code> instead.</p>
<p>You can cancel your <code>StreamSubscr... | how do I turn off data reloading from firebase while using FlutterFire_ui? | firebase|flutter | 0 | 42 | 1 | 72,191,286 | 72,191,286 | 1 | true | 2022-05-10T15:27:24.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do I turn off data reloading from firebase while using FlutterFire_ui?<p>I am using googles flutter fire ui library and for the most part it is working f... |
72,203,917 | Is RandomOverSampler Causing my Model to Overfit?<p>I am attempting to see how well I can classify books according to genre using Tfidf vectorization. I am using five moderately imbalanced genre labels, and I want to use multi label classification to assign each document one or more genres. Initially my performance was... | <p>Oversampling doesn't cause overfitting.</p>
<p>Oversampling before splitting for cross-validation causes <em>data leakage</em>, and the scores you're seeing are indeed not usable as estimates of future performance. Your test folds (probably) contain copies of the same data points included in training folds.</p>
<p>Y... | Is RandomOverSampler Causing my Model to Overfit? | python|scikit-learn|multilabel-classification|overfitting-underfitting | 0 | 106 | 1 | 72,208,409 | 72,208,409 | 1 | true | 2022-05-11T15:40:30.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is RandomOverSampler Causing my Model to Overfit?<p>I am attempting to see how well I can classify books according to genre using Tfidf vectorization. I am u... |
72,161,569 | Python: Is it possible to execute a VBScript script in Python?<p>I am attempting to create a password manager that runs on startup and autofills passwords using a certain keybind.</p>
<p>Currently, when running on startup the application creates a window and I researched ways to make the window hidden and I have found ... | <p>VBScript are run using <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wscript" rel="nofollow noreferrer"><code>wscript</code></a>. So just call it passing your script as argument.</p>
<p>So your function would look like:</p>
<pre><code>import subprocess
def run_vbscript(sc... | Python: Is it possible to execute a VBScript script in Python? | python|vbscript | 0 | 192 | 1 | 72,161,627 | 72,161,627 | 1 | true | 2022-05-08T13:38:36.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Is it possible to execute a VBScript script in Python?<p>I am attempting to create a password manager that runs on startup and autofills passwords us... |
72,173,638 | How can I connect to postgres data base by input parameters?<p>I'm trying to connect to a postgres database by using psycopg2. I ask for the user and user password via input. But I think, this way doesnt let me connect to the database. Is there another way to place the values?</p>
<p>I try to connect like this:</p>
<pr... | <p>There are a couple of ways to build the connection string from inputs, first:</p>
<pre><code># From input
user_name = 'some_name'
pwd = 'some_pwd'
connection = psycopg2.connect(host=localhost, dbname=dbname, user=user_name, password=pwd)
</code></pre>
<p>Second from here <a href="https://www.psycopg.org/docs/extens... | How can I connect to postgres data base by input parameters? | postgresql|psycopg2 | 0 | 32 | 1 | 72,173,977 | 72,173,977 | 1 | true | 2022-05-09T14:27:34.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I connect to postgres data base by input parameters?<p>I'm trying to connect to a postgres database by using psycopg2. I ask for the user and user pa... |
72,062,834 | New column to calculate percentage<p>Need to add a column with percentage for each "adh_classi" by "stop_code"
ex.</p>
<p>"Stop_code" Count adh_Classi<br />
10013 32 Early<br />
10013 101 Late<br />
10013 317 On-Time</p>
<p>Total for 10013 = 450... | <p>Accomplishing in a query requires an aggregate subquery or DSum() aggregate function to calculate the total for each class.</p>
<pre><code>SELECT Stop_Code, 100 * Count / (SELECT Sum(Count) AS SumCnt FROM tablename AS Q1
WHERE Q1.Stop_Code = tablename.Stop_Code) AS Pct FROM tablename;
</code></pre>
<p>or</p>
<pre><... | New column to calculate percentage | ms-access | 0 | 32 | 1 | 72,064,810 | 72,064,810 | 1 | true | 2022-04-29T19:24:31.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
New column to calculate percentage<p>Need to add a column with percentage for each "adh_classi" by "stop_code"
ex.</p>
<p>"Stop_code... |
72,169,277 | Custom printer to string<p>I defined a custom pretty-printer that takes a message, customise it and prints it:</p>
<pre class="lang-ml prettyprint-override"><code>let mypp ppf msg =
Format.fprintf ppf "Hello";
Format.fprintf ppf msg
</code></pre>
<p>Now, I wanted to use it to print to a string but since I... | <p>Since you want to run some function after that all format arguments have been provided, the only option is to use <code>kfprintf</code>:</p>
<pre><code>let to_string msg =
let b = Buffer.create 17 in
let ppf = Format.formatter_of_buffer b in
Format.fprintf ppf "Hello: ";
Format.kfprintf (fun ppf -&... | Custom printer to string | ocaml|variadic-functions | 0 | 39 | 1 | 72,169,599 | 72,169,599 | 1 | true | 2022-05-09T08:50:35.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom printer to string<p>I defined a custom pretty-printer that takes a message, customise it and prints it:</p>
<pre class="lang-ml prettyprint-override">... |
72,223,548 | Convert Reference to Parent to Reference to Child<p>I have an ArrayList of an object type, let's call it 'Parent'. I need to use a method (.method1()) that is only available in its child, another object called 'Child'. I'm 100% certain every reference to an instance of 'Parent' that I'm trying to convert is also an ins... | <p>This will only work if <code>List<Parent></code> is also a <code>List<Child></code>. If that is the case then you have to cast each Parent instance to Child.</p>
<pre><code>public void randomMethod(ArrayList<Parent> a){
for(Parent p: a){
((Child)p).method1() //method1 is a method of Chi... | Convert Reference to Parent to Reference to Child | java|oop | 0 | 33 | 1 | 72,223,666 | 72,223,666 | 1 | true | 2022-05-13T01:21:44.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert Reference to Parent to Reference to Child<p>I have an ArrayList of an object type, let's call it 'Parent'. I need to use a method (.method1()) that i... |
72,230,216 | Why does my boolean value remain as false despite meeting the if condition in my setter?<pre><code>public class Main {
public static void main(String[] args) {
// test1 where all variables are valid
Main test1 = new Main("David", "male", 2);
System.out.println(test1);
... | <p>As you pointed out in your question, <code>booleans</code> default to <code>false</code>. That includes the boolean <code>human</code> which is not set in your three argument constructor so it uses the default value.</p>
<p>But why you are returning <code>booleans</code> from your setters anyway? Your class defini... | Why does my boolean value remain as false despite meeting the if condition in my setter? | java|boolean|setter | 0 | 162 | 1 | 72,230,609 | 72,230,609 | 1 | true | 2022-05-13T13:17:05.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my boolean value remain as false despite meeting the if condition in my setter?<pre><code>public class Main {
public static void main(String[] a... |
72,155,285 | How to reset(delete) CORS settings for a bucket? (GCP)<p>I wrote <strong>the CORS settings</strong> to <strong>"cors.json" file</strong> as shown below.</p>
<p><strong>"cors.json"</strong>:</p>
<pre class="lang-json prettyprint-override"><code>[
{
"origin": ["http://localhos... | <p>You need to write only <strong>"[]"</strong> to <strong>"cors.json" file</strong> as shown below:</p>
<p><strong>"cors.json"</strong>:</p>
<pre class="lang-json prettyprint-override"><code>[]
</code></pre>
<p>Then, run the command below again to reset(delete) <strong>the CORS settings o... | How to reset(delete) CORS settings for a bucket? (GCP) | google-cloud-platform|cors|google-cloud-storage|bucket|gsutil | 0 | 243 | 1 | 72,155,286 | 72,155,286 | 1 | true | 2022-05-07T18:17:29.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reset(delete) CORS settings for a bucket? (GCP)<p>I wrote <strong>the CORS settings</strong> to <strong>"cors.json" file</strong> as shown b... |
72,140,237 | How to get focused window handler<p>I have a <code>WPF</code> custom virtual keyboard application. I need to host this WPF application as standalone and user should be able to use this to enter values for any window application.</p>
<p>How to get the current focused application window? ex: notepad, notepad++ or any oth... | <p>To get the current active window handle, you could use <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow" rel="nofollow noreferrer">GetForegroundWindow</a> from the user32.dll.</p>
<p>In C# it should look something like</p>
<pre><code>[DllImport("user32.dll"... | How to get focused window handler | c#|wpf|winapi | 0 | 119 | 1 | 72,141,054 | 72,141,054 | 1 | true | 2022-05-06T10:47:12.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get focused window handler<p>I have a <code>WPF</code> custom virtual keyboard application. I need to host this WPF application as standalone and user... |
72,202,198 | sys.excepthook in multiprocessing.Process ignored?<p>Suppose we have the two files namely <code>mymanger.py</code> and <code>mysub.py</code>.</p>
<p><code>mymanager.py</code></p>
<pre><code>import time
from multiprocessing import Process
import mysub # the process file
def main():
xprocess = Process(
t... | <p><code>sys.excepthook</code> is invoked when an exception goes uncaught (bubbling all the way out of the running program). But <code>Process</code> objects run their target function in a special bootstrap function (<code>BaseProcess._bootstrap</code> if it matters to you) that intentionally catches all exceptions, pr... | sys.excepthook in multiprocessing.Process ignored? | python|python-3.x|exception|multiprocessing | 0 | 64 | 1 | 72,202,729 | 72,202,729 | 1 | true | 2022-05-11T13:44:44.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sys.excepthook in multiprocessing.Process ignored?<p>Suppose we have the two files namely <code>mymanger.py</code> and <code>mysub.py</code>.</p>
<p><code>my... |
72,139,633 | How to add styles to angular component? (every second element)<p>I have a question about adding styles to Angular components.
e.g I would like to have every second angular component in a list to have red background-color.
How can I make it happen?</p>
<p>I tried a lot of different things - it seems that it is added in ... | <pre><code>ang-component:nth-child(odd) > * {
background-color: red;
}
</code></pre>
<p>because your component root element is probably only a container w 0 width and 0 height</p>
<p><a href="https://i.stack.imgur.com/rmyEf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rmyEf.png" alt="enter ima... | How to add styles to angular component? (every second element) | html|css|angular | 0 | 156 | 1 | 72,140,253 | 72,140,253 | 1 | true | 2022-05-06T09:59:47.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add styles to angular component? (every second element)<p>I have a question about adding styles to Angular components.
e.g I would like to have every ... |
72,205,163 | Modeling Multiple Depot Vehicle Scheduling Problem in OR-Tools<p>Is it possible to solve the Multiple Depot Vehicle Scheduling Problem (MDVSP) in OR-tools?</p>
<p>The problem is detailed in <a href="https://pubsonline.informs.org/doi/abs/10.1287/mnsc.44.12.1637" rel="nofollow noreferrer">this paper</a>, but here is a b... | <p>Seems you want to take into account the arc cost only if vehicle is empty. (note: fixed typo)</p>
<p>AFAIK, there is no easy way to do it using OR-Tools. In C++ you may use the DimensionDependentDimension and returning the arc cost if a capacity dimension is zero, and zero otherwise...</p>
<ol start="0">
<li><p>Also... | Modeling Multiple Depot Vehicle Scheduling Problem in OR-Tools | or-tools | 0 | 156 | 1 | 72,211,524 | 72,211,524 | 1 | true | 2022-05-11T17:20:25.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Modeling Multiple Depot Vehicle Scheduling Problem in OR-Tools<p>Is it possible to solve the Multiple Depot Vehicle Scheduling Problem (MDVSP) in OR-tools?</... |
72,091,119 | Airflow: Issues with Calling TaskGroup<p>I am having issues with calling TaskGroups, the error log thinks my Job id is <code>avg_speed_20220502_22c11bdf</code> instead of just <code>avg_speed</code>, and I can't figure out why.</p>
<p>Here's my code:</p>
<pre><code>with DAG(
'debug_bigquery_data_analytics',
... | <p>In Airflow task identifier is <code>task_id</code>. However when using TaskGroups you can have same <code>task_id</code> in different groups thus tasks defined in task group have identifier of <code>group_id.task_id</code>.</p>
<p>For <a href="https://pypi.org/project/apache-airflow-providers-google/" rel="nofollow ... | Airflow: Issues with Calling TaskGroup | airflow | 0 | 284 | 1 | 72,095,229 | 72,095,229 | 1 | true | 2022-05-02T18:54:25.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Airflow: Issues with Calling TaskGroup<p>I am having issues with calling TaskGroups, the error log thinks my Job id is <code>avg_speed_20220502_22c11bdf</cod... |
72,168,802 | Pass json data to JavaScript without creating new object<p>I am querying json data from database then performing some filtering and further procedures. After that I want to display that data on map, so I am passing it through JSInterop to JavaScript. Everything seems to be working except that on each method execution I... | <p>i've not used this map engine before but i would suggest</p>
<pre><code>var map = new ol.Map({
overlays: [overlay],
target: 'map',
layers: layers,
view: new ol.View({
center: ol.proj.fromLonLat([25.2849, 60.0917]),
zoom: 8
})
});
</code></pre>
<p>should be</p>
<pre><code>if(! document.map){
do... | Pass json data to JavaScript without creating new object | javascript|c#|asp.net-core|blazor|blazor-jsinterop | 0 | 140 | 1 | 72,169,390 | 72,169,390 | 1 | true | 2022-05-09T08:08:26.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pass json data to JavaScript without creating new object<p>I am querying json data from database then performing some filtering and further procedures. After... |
72,104,552 | How to fix this error when take data in Python<p>The problem here that when I put in user='U3' and debugging I see <strong>history1[:, 1][i1][j1]</strong> and <strong>transactions1[:, 0][m]</strong> have the same value. That is ['T500'] but the expression return false (also ['T600']) and when they are have value ['T100... | <p>Your <code>history1</code> argument has spaces after T500 and T600.</p>
<pre><code> [array(['U3'], dtype='<U2') array(['T500 ', 'T600 ', 'T1000'], dtype='<U5')]
</code></pre>
<p>Your <code>transaction1</code> argument does not.</p>
<pre><code>[array(['T500'], dtype='<U4') array(['I1', 'I3'], dtype='<U2')... | How to fix this error when take data in Python | python|arrays|numpy | 0 | 35 | 1 | 72,105,905 | 72,105,905 | 1 | true | 2022-05-03T19:28:32.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix this error when take data in Python<p>The problem here that when I put in user='U3' and debugging I see <strong>history1[:, 1][i1][j1]</strong> an... |
72,202,093 | Mule 4 sftp read file - retry mechanism using Until successful , unable to catch exception<p>This question is a followup to an earlier question <a href="https://stackoverflow.com/questions/72199441/mule-4-sftp-read-file-reconnection-strategy-not-working">here</a></p>
<p>So:
Am trying to read a file from a SFTP location... | <p>It is not <code>SFTP:RETRY_EXHAUSTED</code> it is <code>MULE:RETRY_EXHAUSTED</code>. Try to catch <code>MULE:RETRY_EXHAUSTED</code> or simply <code>RETRY_EXHAUSTED</code> in the error handler.</p>
<p>You can refer to <a href="https://docs.mulesoft.com/mule-runtime/4.4/until-successful-scope" rel="nofollow noreferrer... | Mule 4 sftp read file - retry mechanism using Until successful , unable to catch exception | mule|mule4 | 0 | 78 | 1 | 72,203,141 | 72,203,141 | 1 | true | 2022-05-11T13:38:25.093Z | 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 - retry mechanism using Until successful , unable to catch exception<p>This question is a followup to an earlier question <a href="http... |
72,217,492 | how to parse this xml data into table in python<p>I have the following xml and I want to parse it into a table. I have been looking around and did not find a good answer. The difficult parts are:</p>
<ol>
<li>The header and data in different subtree</li>
<li>All inner tags have same name (th or td)</li>
</ol>
<div clas... | <p>As long as you take care of your namespace, you should be OK with something like this, though it's a bit convoluted:</p>
<pre><code>from lxml import etree
nsmap = {"ns0": "urn:hl7-org:v3"}
rows = []
cols = doc.xpath('//ns0:thead//ns0:tr//ns0:th/text()', namespaces=nsmap)
cols.append("ID&quo... | how to parse this xml data into table in python | xml|parsing | 0 | 35 | 1 | 72,218,946 | 72,218,946 | 1 | true | 2022-05-12T14:30:59.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to parse this xml data into table in python<p>I have the following xml and I want to parse it into a table. I have been looking around and did not find a... |
72,054,656 | How to map fetched API data into JSON object for looping<p>I have the following working code that fetches a JSON data from Azure API:</p>
<pre><code>@code {
string responseBody;
protected override async Task OnInitializedAsync()
{
var personalaccesstoken = "*******";
var uri = "https://dev.azu... | <p>Your models:</p>
<pre><code>public class Self
{
public string href { get; set; }
}
public class Web
{
public string href { get; set; }
}
public class SourceVersionDisplayUri
{
public string href { get; set; }
}
public class Timeline
{
public string href { get; set; }
}
public class Badge
{
pu... | How to map fetched API data into JSON object for looping | c#|blazor|blazor-server-side | 0 | 257 | 4 | 72,055,445 | 72,055,445 | 1 | true | 2022-04-29T08:02:32.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to map fetched API data into JSON object for looping<p>I have the following working code that fetches a JSON data from Azure API:</p>
<pre><code>@code {
... |
72,156,755 | My Java code is not running due to error, how do I fix it to run<p>The error I get is:
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main</p>
<p>I am new to Java and dont understand what to do in this instance or how to fix this code to run</p>
<p>I think this has something ... | <p>Whenever Java code is compiled on that website, the website's compiler looks for a class named "Main" to start execution from. Once its compiler finds that class, it calls whatever method has the signature of <code>public static void main(String[] args)</code> . In your case, there's no class named "M... | My Java code is not running due to error, how do I fix it to run | java|class|oop|methods | 0 | 103 | 1 | 72,156,828 | 72,156,828 | 1 | true | 2022-05-07T22:23:36.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My Java code is not running due to error, how do I fix it to run<p>The error I get is:
Error: Could not find or load main class Main
Caused by: java.lang.Cla... |
72,218,656 | DBT set test severity for all test in a model<p>In DBT, I can configure the <a href="https://docs.getdbt.com/reference/resource-configs/severity" rel="nofollow noreferrer">severity of a test</a> on either the project level or test level, like so:</p>
<p><strong>Project level:</strong></p>
<pre class="lang-yaml prettypr... | <p>You can nest project and directory names under the <code>tests:</code> tag in your <code>dbt_project.yml</code> file:</p>
<pre class="lang-yaml prettyprint-override"><code>tests:
jaffle_shop: # project name
staging: # top-level dir inside models/ dir
+severity: warn
</code></pre>
<p>See the <a href="... | DBT set test severity for all test in a model | yaml|dbt | 0 | 362 | 1 | 72,218,825 | 72,218,825 | 1 | true | 2022-05-12T15:51:40.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DBT set test severity for all test in a model<p>In DBT, I can configure the <a href="https://docs.getdbt.com/reference/resource-configs/severity" rel="nofoll... |
72,067,290 | Diferrence in inititializing array in python by these methods<p>I declared an array of array by two methods:</p>
<p>Method 1:
<code>bucket = [[]] * 6)</code></p>
<p>Method 2:
<code>bucket = [[] for i in range(6)]</code></p>
<p>but while appending elements to the inner array it works diferrently.</p>
<pre><code>bucket[0... | <p>So this is what happening:</p>
<ul>
<li>when you do this <code>bucket = [[]]*(len(nums)+1)</code> all the nested lists<br />
are same.</li>
<li>To confirm that you can <code>print(id(bucket[0]))</code> and<br />
<code>print(id(bucket[1]))</code>.</li>
<li>Both will print same memory address as all are same. So, wh... | Diferrence in inititializing array in python by these methods | python|list | 0 | 34 | 1 | 72,069,697 | 72,069,697 | 1 | true | 2022-04-30T09:35:15.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Diferrence in inititializing array in python by these methods<p>I declared an array of array by two methods:</p>
<p>Method 1:
<code>bucket = [[]] * 6)</code>... |
72,206,986 | puppeteer page.evaluate() returns empty object<p>I am trying to scrape this web <a href="https://poe.ninja/challenge/builds?time-machine=day-6" rel="nofollow noreferrer">https://poe.ninja/challenge/builds?time-machine=day-6</a> using Puppeteer. I tried <a href="https://stackoverflow.com/questions/46377955/puppeteer-pag... | <p>Looks like the problem is really with waiting, you are looking for elements even if full dom content isnt fully loaded.</p>
<pre><code> const scrapeNinja = async () => {
const browser = await puppeteer.launch({headless: false})
const page = await browser.newPage()
await page.goto(`https://poe.ninja/chall... | puppeteer page.evaluate() returns empty object | javascript|node.js|google-chrome-devtools|puppeteer | 0 | 385 | 1 | 72,227,699 | 72,227,699 | 1 | true | 2022-05-11T20:01:12.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
puppeteer page.evaluate() returns empty object<p>I am trying to scrape this web <a href="https://poe.ninja/challenge/builds?time-machine=day-6" rel="nofollow... |
72,149,109 | How to convert YYYYMM to YYYY-MM datetime format without day?<p>I have two datasets that have monthly frequencies. For one of them,<code>df</code>, I had to aggregate some data to turn it from daily to monthly using the following code:</p>
<pre><code>df_grouped=df.groupby([df.index.to_period('M'),'City ID']).agg({'Esti... | <p>You can use</p>
<pre class="lang-py prettyprint-override"><code>df2['DATE'] = pd.to_datetime(df2['DATE'],format='%Y%m').dt.strftime('%Y-%m')
# or
df['date'] = df['date'].astype(str).str.replace(r'(\d{4})(\d{2})', r'\1-\2', regex=True)
</code></pre> | How to convert YYYYMM to YYYY-MM datetime format without day? | python|pandas|date | 0 | 76 | 3 | 72,149,125 | 72,149,125 | 1 | true | 2022-05-07T02:52:02.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert YYYYMM to YYYY-MM datetime format without day?<p>I have two datasets that have monthly frequencies. For one of them,<code>df</code>, I had to ... |
72,218,046 | Get values out of sub lists in data frame<p>I want to remove the list type in my pandas data frame. So far every string is in a list. I want to keep the string and remove the list. Thank you<img src="https://i.stack.imgur.com/N0tqJ.png" alt="enter image description here" /></p> | <p>You can try</p>
<pre class="lang-py prettyprint-override"><code>df.filter('decision') = df.filter('decision').applymap(lambda lst: eval(lst)[0])
# or
cols = ['decision1 category', 'decision2 category', 'decision3 category']
df[cols] = df[cols].applymap(lambda lst: eval(lst)[0])
</code></pre> | Get values out of sub lists in data frame | pandas|list | 0 | 19 | 1 | 72,218,246 | 72,218,246 | 1 | true | 2022-05-12T15:08:06.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get values out of sub lists in data frame<p>I want to remove the list type in my pandas data frame. So far every string is in a list. I want to keep the stri... |
72,077,793 | MongoDB finding nested properties<p>So I have a document and model that is structured like this</p>
<pre><code>{
"name":"root",
"children":[
{
"_id":1,
"name":"A",
"children":[
{
"... | <p>you need _id in the path (and to omit "treeModel") like:</p>
<pre><code>db.treeModel.find({'children._id': 1})
db.treeModel.find({'children._id': 3})
</code></pre>
<p>keep in mind that this will still return the entire parent document</p>
<p>mongo/mongoose does not support recursive nested document lookups... | MongoDB finding nested properties | database|mongodb|mongoose|nosql|backend | 0 | 26 | 1 | 72,078,038 | 72,078,038 | 1 | true | 2022-05-01T14:54:46.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB finding nested properties<p>So I have a document and model that is structured like this</p>
<pre><code>{
"name":"root",
&qu... |
72,155,433 | How to iterate an array of indexed objects<p>I have an array of objects that is indexed and I want to iterate through it to convert it to a new flat array.</p>
<p>This is the array of objects:</p>
<pre><code>"attentionSchedules": [
{
"room": "1",
"schedules": ... | <p>I'm not sure you need to loop over <code>Object.entries(elm.place.loc)</code> (if I've understood the problem). I think you can just extract the values somewhat directly:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippe... | How to iterate an array of indexed objects | javascript|arrays|angular|typescript|object | 0 | 38 | 1 | 72,155,503 | 72,155,503 | 1 | true | 2022-05-07T18:36:47.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to iterate an array of indexed objects<p>I have an array of objects that is indexed and I want to iterate through it to convert it to a new flat array.</... |
72,151,781 | How can i get raspberry pi pico to communicate with PC / external devices<p>For example when i give 5 to the code, i want to turn on the led in our rpi pico (rpi pico connected to pc with cable)</p>
<pre><code>#This code will run in my computer (test.py)
x=int(input("Number?"))
if (x==5):
#turn on raspbe... | <p>A simple method of communicating between the host and the Pico is to use the serial port. I have a <a href="https://www.waveshare.com/rp2040-zero.htm" rel="nofollow noreferrer">rp2040-zero</a>, which presents itself to the host as <code>/dev/ttyACM0</code>. If I use code like this on the rp2040:</p>
<pre><code>impor... | How can i get raspberry pi pico to communicate with PC / external devices | python|raspberry-pi|micropython|raspberry-pi-pico | 0 | 1,900 | 1 | 72,154,097 | 72,154,097 | 1 | true | 2022-05-07T10:48:55.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i get raspberry pi pico to communicate with PC / external devices<p>For example when i give 5 to the code, i want to turn on the led in our rpi pico ... |
72,152,626 | how to take user input to let the user specify which aspect of a python program they want to access<p>Currently working on some python (version 3.10.4) code on PyCharm (Community Edition 2021.3.3) using the python-docx library (version 0.8.1.1), that allows to check the layout specifications of a Word document. These s... | <p>The input is a string, so you can conveniently use the <code>in</code> operator to check if it contains certain digits, provided that you have only single-digit access codes. You can use a set operation, as shown below, to check if the input contains at least one valid digit. If I understand you correctly, the logic... | how to take user input to let the user specify which aspect of a python program they want to access | python|python-docx | 0 | 44 | 1 | 72,152,801 | 72,152,801 | 1 | true | 2022-05-07T12:42:53.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to take user input to let the user specify which aspect of a python program they want to access<p>Currently working on some python (version 3.10.4) code ... |
72,198,886 | Specifying a range of columns as parameter<p>I want to extract the max value of a table that has 100 rows: Something that can be <strong>poorly</strong> achieved like this:</p>
<pre><code>maxA = max(data['a1size'].max(), data['a2size'].max(), data['a3size'].max()... and continuing like this until a100size.
</code></pre... | <p>The <code>loc</code> operator allows you to use slicing by column names:</p>
<pre class="lang-py prettyprint-override"><code>maxA = data.loc[:, 'a1size':'a100size'].values.max()
</code></pre>
<p>Note that in contrast to core Python slicing, the final column is included here. The first <code>:</code> specifies that y... | Specifying a range of columns as parameter | python|pandas|jupyter-notebook | 0 | 28 | 1 | 72,199,172 | 72,199,172 | 1 | true | 2022-05-11T09:48:04.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specifying a range of columns as parameter<p>I want to extract the max value of a table that has 100 rows: Something that can be <strong>poorly</strong> achi... |
72,177,971 | Cannot access mysql database after migrating from Homestead to Sail<p>I am trying to migrate a Laravel 8 project from Homestead to Sail. Sail seems to be set up correctly since I can get to my project's website locally. But I can't get into mysql to look around in the database:</p>
<pre><code>➜ myproject git:(master) ... | <p>I Just tried to connect to a fresh laravel 9 app and I think you only need to change a few lines in order to connect to Sail's Mysql:</p>
<h3>.env</h3>
<pre><code>DB_CONNECTION=mysql
DB_HOST=host.docker.internal
DB_PORT=3306
DB_DATABASE=myproject
DB_USERNAME=sail # <-- "sail" as default user name
DB_P... | Cannot access mysql database after migrating from Homestead to Sail | mysql|laravel|docker|laravel-sail | 0 | 527 | 1 | 72,178,238 | 72,178,238 | 1 | true | 2022-05-09T20:37:41.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot access mysql database after migrating from Homestead to Sail<p>I am trying to migrate a Laravel 8 project from Homestead to Sail. Sail seems to be set... |
72,223,911 | r add math symbol to x axis text<p>I am trying to add a math symbol (sum) to some texts in x-axis.</p>
<p>For example, if this is my plot.</p>
<pre><code>data(iris)
p1 <- ggplot(iris, aes(x=Species, y=Sepal.Length)) +
geom_boxplot()
p1
</code></pre>
<p>What I am trying to accomplish is this. Not sure how to do th... | <p>This is almost certainly a duplicate, but I couldn't find the answer when I searched, so here is a potential solution:</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
iris_correctly_labelled <- iris %>%
mutate(Species = case_when(Species == "setosa" ~ paste0("\u2211"... | r add math symbol to x axis text | r|ggplot2 | 0 | 65 | 2 | 72,223,960 | 72,223,960 | 1 | true | 2022-05-13T02:41:19.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
r add math symbol to x axis text<p>I am trying to add a math symbol (sum) to some texts in x-axis.</p>
<p>For example, if this is my plot.</p>
<pre><code>dat... |
72,209,623 | How to give create/alter stage privileges to a role<p>I have given <code>grant all privileges to role svn_dev</code>, but it is not giving access to create, alter and drop stage permissions across all schemas. How do I provide this to a role?</p>
<p>I have also tried</p>
<pre><code>grant ownership on database DA_DEV to... | <p>The error message gives a way to fix it in most cases. Try this:</p>
<pre><code>grant ownership on database DA_DEV to role svn_dev revoke current grants;
</code></pre>
<p>If you can't revoke current grants because it would be too much work to re-issue the grants, you can explicitly revoke the grants that are prevent... | How to give create/alter stage privileges to a role | snowflake-cloud-data-platform | 0 | 346 | 1 | 72,209,744 | 72,209,744 | 1 | true | 2022-05-12T02:54:31.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to give create/alter stage privileges to a role<p>I have given <code>grant all privileges to role svn_dev</code>, but it is not giving access to create, ... |
72,188,269 | XCode Admob build failed issue<p>I was trying to get build my Unity game with XCode. About two weeks ago everything is fine builds are working, but now I have this issue;</p>
<ul>
<li>Unity Version: 2021.3.1f1</li>
<li>Xcode Version: 13.3</li>
<li>Admob SDK Version: 7.0.0 , 6.1.2</li>
</ul>
<p><a href="https://i.stack.... | <p>Find the solution after 2 days;</p>
<p>Use Admob SDK Version: 7.0.0</p>
<p>Build your Project. Go to your project file using terminal. Write this code;</p>
<p><strong>arch -x86_64 pod install</strong></p>
<p>Enter</p>
<p><strong>chmod +x MapFileParser.sh</strong></p>
<p>Enter</p>
<p><strong>chmod +x process_symbols.... | XCode Admob build failed issue | ios|swift|xcode|unity3d|admob | 0 | 127 | 1 | 72,201,126 | 72,201,126 | 1 | true | 2022-05-10T14:33:06.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XCode Admob build failed issue<p>I was trying to get build my Unity game with XCode. About two weeks ago everything is fine builds are working, but now I hav... |
72,200,003 | Python regex pattern in order to find if a code line is finishing with a space or tab character<p>Sorry for putting such a low level question but I really tried to look for the answer before coming here...
Basically I have a script which is searching inside .py files and reads line by line there code -> the object ... | <p>Try:</p>
<pre class="lang-py prettyprint-override"><code>rules = {
'ends with tab': re.compile(r'\t$'),
'ends with space': re.compile(r' $'),
}
</code></pre>
<p>Note: while getting lines from iterating the file will leave newline (<code>'\n'</code>) at the end of each string, <code>$</code> in a regex matches th... | Python regex pattern in order to find if a code line is finishing with a space or tab character | python|regex | 0 | 63 | 1 | 72,200,175 | 72,200,175 | 1 | true | 2022-05-11T11:10:53.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python regex pattern in order to find if a code line is finishing with a space or tab character<p>Sorry for putting such a low level question but I really tr... |
72,062,266 | Python for loop multi-dimensional array indexing issue<p>I have the first two strings in a string list <code>strs</code> that is guaranteed to have length of at least 2. I want to compare their letters against each other, and perform a task when their letters are identical. Here is the code I am using:</p>
<pre><code> ... | <p>If you need to iterate through two sequences in lockstep, it's generally best practice to use <a href="https://docs.python.org/3.3/library/functions.html#zip" rel="nofollow noreferrer"><code>zip</code></a>:</p>
<pre><code>for a,b in zip(strs[0], strs[1]):
if a == b:
#[do a thing]
</code></pre>
<p>This wi... | Python for loop multi-dimensional array indexing issue | python|arrays|loops | 0 | 26 | 1 | 72,062,344 | 72,062,344 | 1 | true | 2022-04-29T18:25:23.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python for loop multi-dimensional array indexing issue<p>I have the first two strings in a string list <code>strs</code> that is guaranteed to have length of... |
72,208,212 | How can I make catching exceptions assign a variable a certain value without constantly repeating the code?<p>I'm going to clarify.</p>
<p>I'm logging 6 different variables and some of them have errors (what kind of error doesn't matter). When that error occurs, I just want that specific variable to be put to "NA&... | <p>Here's an example of an approach that will do what you're asking.</p>
<p>First some comments:</p>
<ul>
<li>You have used the term "error", but your sample code uses try/except, so I will assume that each "error" results in an exception being raised.</li>
<li>In the code below, I use an artificial... | How can I make catching exceptions assign a variable a certain value without constantly repeating the code? | python|exception|try-catch | 0 | 61 | 1 | 72,208,994 | 72,208,994 | 1 | true | 2022-05-11T22:22:04.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make catching exceptions assign a variable a certain value without constantly repeating the code?<p>I'm going to clarify.</p>
<p>I'm logging 6 diff... |
72,221,186 | How do I retain column headers when executing storedprocedure using python?<p>After I run my code below, i receive all the data from my storedproc. However, the column names are not returned</p>
<pre><code>import pandas as pd
import pyodbc
conn = pyodbc.connect('Driver={SQL Server};'
'Server=PMI0... | <p>you can add the column name from cursor description:</p>
<pre><code>df = pd.DataFrame.from_records(results, columns = [column[0] for column in cursor.description])
</code></pre>
<p>alternatively, you could use <code>read_sql</code> and directly load into pandas :</p>
<pre><code>conn = pyodbc.connect('Driver={SQL Ser... | How do I retain column headers when executing storedprocedure using python? | python|pandas|pyodbc | 0 | 87 | 1 | 72,221,240 | 72,221,240 | 1 | true | 2022-05-12T19:30:59.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I retain column headers when executing storedprocedure using python?<p>After I run my code below, i receive all the data from my storedproc. However, ... |
72,143,417 | PineScript order entry, stop loss and take profit<p>I am just getting to grips with PineScript and more specifically writing strategies to place orders/trades however, have a quick question.</p>
<p>I want to create a basic template strategy that will enter a trade, set its stop loss and take profit, and that's all to b... | <p>You can use the following to get the pip size:</p>
<pre><code>pip_size = syminfo.mintick * (syminfo.type == "forex" ? 10 : 1)
</code></pre>
<p>And use this to get the entry price:</p>
<pre><code>entry_price = strategy.closedtrades.entry_price(strategy.closedtrades - 1)
</code></pre>
<p>Then:</p>
<pre><code... | PineScript order entry, stop loss and take profit | pine-script | 0 | 521 | 1 | 72,152,080 | 72,152,080 | 1 | true | 2022-05-06T14:49:26.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PineScript order entry, stop loss and take profit<p>I am just getting to grips with PineScript and more specifically writing strategies to place orders/trade... |
72,167,728 | Why Int and Float literals are allowed to be added, but Int and Float variables are not allowed to do the same in Swift?<p>I tried adding an <code>Int</code> and <code>Float</code> literal in Swift and it compiled without any error :</p>
<pre class="lang-swift prettyprint-override"><code>var sum = 4 + 5.0 // sum is ass... | <p>In case of <code>var sum = 4 + 5.0</code> the compiler automatically converts 4 to a float as that is what is required to perform the operation.
Same happens if you write <code>var x: Float = 4</code>. The 4 is automatically converted to a float.</p>
<p>In second case, since you have explicitly defined the type of t... | Why Int and Float literals are allowed to be added, but Int and Float variables are not allowed to do the same in Swift? | swift|casting|swift5|type-safety | 0 | 131 | 3 | 72,168,091 | 72,168,091 | 1 | true | 2022-05-09T06:25:39.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why Int and Float literals are allowed to be added, but Int and Float variables are not allowed to do the same in Swift?<p>I tried adding an <code>Int</code>... |
72,193,182 | How can you preview a swift view that uses ViewBuilder<p>How can I pass test content to preview in this example. I get the error "Generic parameter 'Content' could not be inferred" and I don't understand what that is saying.</p>
<pre><code>struct CoolView<Content:View>: View {
let content: Cont... | <p>Something like below. You need to return a view for preview to compile.</p>
<pre><code>struct CoolView_Previews: PreviewProvider {
static var previews: some View {
CoolView {
Text("Testing")
}
}
}
</code></pre> | How can you preview a swift view that uses ViewBuilder | swift | 0 | 33 | 1 | 72,193,347 | 72,193,347 | 1 | true | 2022-05-10T21:33:48.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you preview a swift view that uses ViewBuilder<p>How can I pass test content to preview in this example. I get the error "Generic parameter 'Con... |
72,200,916 | Best way to get the context of an activity in a viewmodel<p>I want to use this context to make a notification, but it should be called in a viewmodel that is made by <code>hiltViewModel()</code> function. How should I pass the context there?</p> | <p>I'd recommend creating a single method that accepts a context and displays the notification. This way you'll avoid memory leaks which can be caused if you store the activity's context instead.</p> | Best way to get the context of an activity in a viewmodel | android|android-context|dagger-hilt | 0 | 200 | 1 | 72,203,219 | 72,203,219 | 1 | true | 2022-05-11T12:17:10.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to get the context of an activity in a viewmodel<p>I want to use this context to make a notification, but it should be called in a viewmodel that is... |
72,066,804 | How to make json with infinite parent child category from database<p>I have an SQLite database table</p>
<pre><code>+---------------------------------------------------+
| id | Cat_Name | Parent_ID |
|---------------------------------------------------+
| 1 | Asset | NULL... | <p>I suggest you change the design of the output object. I think the array approach would be better for the frontend.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const rawD... | How to make json with infinite parent child category from database | javascript|arrays|json|sqlite|object | 0 | 277 | 3 | 72,069,162 | 72,069,162 | 1 | true | 2022-04-30T08:17:22.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make json with infinite parent child category from database<p>I have an SQLite database table</p>
<pre><code>+----------------------------------------... |
72,171,410 | PPT VBA Routine works in Step Mode, but not in Run<p>I try to use a selected picture on the slide and <strong>copy/paste</strong> it into the Placeholder <em>(I can not load the picture from a file, it has to be from the slide itself.)</em></p>
<p>It works fine when I go through the code with <kbd>F8</kbd> step by step... | <p>Try adding DoEvents after you copy and after you paste. Also, try separating your copy and paste operations into separate procedures. VBA should wait until the operations are complete before entering and exiting a procedure. I haven't tested it, but maybe something like this . . .</p>
<pre><code>Option Explicit
... | PPT VBA Routine works in Step Mode, but not in Run | vba|powerpoint | 0 | 40 | 1 | 72,173,587 | 72,173,587 | 1 | true | 2022-05-09T11:41:35.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PPT VBA Routine works in Step Mode, but not in Run<p>I try to use a selected picture on the slide and <strong>copy/paste</strong> it into the Placeholder <em... |
72,156,541 | SVG aspect ratio is preserved when width is greater than height despite of the preventive setting<p>I want the blue line to always connect top left and bottom right corners without overflow and scroll bar being displayed. Currently it only happens for when the width is less than height (more or less), otherwise it incr... | <p>If I've understood correctly, you want the svg to change aspect ratio such that the diagonal line is always wholly in view.</p>
<p>Your svg is structured correctly to do this with <code>preserveAspectRatio="none"</code> on an image drawn with user units for the line and viewbox matching.</p>
<p>The reason ... | SVG aspect ratio is preserved when width is greater than height despite of the preventive setting | html|svg|resize | 0 | 215 | 1 | 72,156,832 | 72,156,832 | 1 | true | 2022-05-07T21:40:26.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SVG aspect ratio is preserved when width is greater than height despite of the preventive setting<p>I want the blue line to always connect top left and botto... |
72,228,163 | Structure formData in an array<p>I have an extensive form and I'm trying to organize this so that it remains practicable for the plan that I intend to have with it.</p>
<p>An example showing what my form looks like:</p>
<pre><code><input type="text" name="data[0][name]">
<input type="e... | <p>To convert a (single layer) <a href="https://developer.mozilla.org/en-US/docs/Web/API/NodeList" rel="nofollow noreferrer">NodeList</a> of form elements into a nested object, using the form element name components, you can loop over the data form elements:</p>
<pre><code>const dataform_obj = {} // instantiate empty o... | Structure formData in an array | javascript|arrays|forms|form-data | 0 | 197 | 2 | 72,229,053 | 72,229,053 | 1 | true | 2022-05-13T10:32:40.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Structure formData in an array<p>I have an extensive form and I'm trying to organize this so that it remains practicable for the plan that I intend to have w... |
72,164,552 | Update existing document of Elasticsearch and insert current record through logstash<p>I am trying to insert a record into elasticsearch and also update a field of an existing document whose _id I'll be getting from the current record. After searching online, I found that we can use the _update_by_query api with the ht... | <p>It's not how you're supposed to do it, you can simply use the <code>elasticsearch</code> output for both use cases.</p>
<p>The first one for indexing a new record and the following one for partial updating another record whose id is <code>previous_record_id</code>. The event data can be accessed in <code>params.even... | Update existing document of Elasticsearch and insert current record through logstash | elasticsearch|logstash|kibana|elastic-stack|logstash-configuration | 0 | 304 | 1 | 72,166,819 | 72,166,819 | 1 | true | 2022-05-08T19:42:21.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update existing document of Elasticsearch and insert current record through logstash<p>I am trying to insert a record into elasticsearch and also update a fi... |
72,232,617 | SQL Server Change Data Capture - Validating Incremental Window<p>I want to implement an incremental load process using SQL Server Change Data Capture. Every example I find takes the "happy path."</p>
<p>In other words, they assume that the CDC history exceeds the time since the last successful incremental loa... | <p>I would always stay in the "log domain" not the "time domain" when working directly with CDC. So track the last LSN of the last run and compare it against <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-cdc-get-min-lsn-transact-sql?view=sql-server-ver1... | SQL Server Change Data Capture - Validating Incremental Window | sql-server|azure-data-factory|sql-server-2019|change-data-capture | 0 | 108 | 1 | 72,233,323 | 72,233,323 | 1 | true | 2022-05-13T16:18:40.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Server Change Data Capture - Validating Incremental Window<p>I want to implement an incremental load process using SQL Server Change Data Capture. Every ... |
72,178,972 | traefik.go: command traefik error: failed to eval New: undefined: xxx<p>I am trying to build a Traefik plugin and test it in local mode based on <a href="https://github.com/traefik/plugindemo#local-mode" rel="nofollow noreferrer">https://github.com/traefik/plugindemo#local-mode</a></p>
<p>Right now this plugin does not... | <p>Got an answer from Tom Moulard and thanks! <a href="https://github.com/traefik/plugindemo/issues/15#issuecomment-1123741949" rel="nofollow noreferrer">https://github.com/traefik/plugindemo/issues/15#issuecomment-1123741949</a></p>
<blockquote>
<p>Your error means that Yaegi cannot find the <code>New</code> function ... | traefik.go: command traefik error: failed to eval New: undefined: xxx | go|traefik|traefik-plugins|yaegi | 0 | 156 | 1 | 72,205,579 | 72,205,579 | 1 | true | 2022-05-09T22:50:01.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
traefik.go: command traefik error: failed to eval New: undefined: xxx<p>I am trying to build a Traefik plugin and test it in local mode based on <a href="htt... |
72,237,138 | Read raw file contents in private repo in C#<p>I want to read the contents of a private GitHub repo file and declare the value in a variable in a C# Visual Studio .NET Application. What's easiest the way of going about this?</p> | <p>You can call the <a href="https://docs.github.com/en/rest/repos/contents#get-repository-content=" rel="nofollow noreferrer">Get Repository content API</a> from your CSharp program, assuming:</p>
<ul>
<li>you have a <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-per... | Read raw file contents in private repo in C# | c#|github | 0 | 116 | 1 | 72,237,183 | 72,237,183 | 1 | true | 2022-05-14T03:32:01.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Read raw file contents in private repo in C#<p>I want to read the contents of a private GitHub repo file and declare the value in a variable in a C# Visual S... |
72,105,117 | Call component function that inside a page from another page<p>I'm trying to understand how I can trigger OnSwipe from inside another JS file called CardFooter.js containing a button with OnClick triggering OnSwipe from the previous JS file called CardItem.js. They both are called inside Card.js.</p>
<p>I'm learning Ne... | <p>In React, you <strong>can't</strong> pass props up from child components into parent components. This means that you wouldn't be able to pass the <code>handleSwipe</code> function up to <code><CardFooter></code>.</p>
<p>But it doesn't look like you'd need to do that anyways, since you have the <code>handleRigh... | Call component function that inside a page from another page | javascript|reactjs|next.js | 0 | 29 | 1 | 72,105,207 | 72,105,207 | 1 | true | 2022-05-03T20:28:31.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Call component function that inside a page from another page<p>I'm trying to understand how I can trigger OnSwipe from inside another JS file called CardFoot... |
72,228,481 | convert List of string array into xml<p>I need to convert list of array into xml. In the list the first object is the elements of the xml and from second object onwards it is the values of the elements.</p>
<p>For eg:</p>
<pre><code>list[0]={"firstname","lastname","age","empid"}
... | <p>Here is the solution. Note that there is the 2nd parameter for <code>Zip</code> method, that allows you to implement more appropriate names for tuple fields names, instead of <code>First</code> and <code>Second</code>.</p>
<h2>The code</h2>
<pre><code>using System.Xml.Linq;
string[][] data =
{
new[] { "fir... | convert List of string array into xml | c#|arrays|xml|list | 0 | 101 | 2 | 72,228,776 | 72,228,776 | 1 | true | 2022-05-13T10:57:15.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
convert List of string array into xml<p>I need to convert list of array into xml. In the list the first object is the elements of the xml and from second obj... |
72,172,642 | When a new image is added, the old image is automatically replasing in nodejs how to fix<p>I have created a file from which I can successfully upload the image, But the name of the image that comes up ( undefiend.jpg ) in this project use express file upload middleware</p>
<p>*<strong>admin.js</strong></p>
<pre><code... | <p>I think you should use data.insertedId,</p>
<pre class="lang-js prettyprint-override"><code> module.exports = {
addProduct: (product, callback) => {
db.get().collection('product').insertOne(product).then((data) => {
callback(data.insertedId)
})
}
}
</code></pre>
<p>in the m... | When a new image is added, the old image is automatically replasing in nodejs how to fix | javascript|html|css|node.js|mongodb | 0 | 118 | 1 | 72,173,547 | 72,173,547 | 1 | true | 2022-05-09T13:18:19.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When a new image is added, the old image is automatically replasing in nodejs how to fix<p>I have created a file from which I can successfully upload the ima... |
72,220,229 | Invalid "id" when trying to set up Google OAuth2 with Passport<p>I'm trying to set up my user authentication routes with <code>passport</code> using the <code>GoogleStrategy</code> and having some issues configuring it. I grabbed some code snippets to at least get it running.</p>
<p><code>passport.js</code></p>
<pre cl... | <p>Your error is sourced from here:</p>
<pre><code>const dotenv = require("dotenv"); // returns object
const passport = require("passport");
const GoogleStrategy = require("passport-google-oauth20").Strategy;
require(dotenv).config();//you have used an object here instead of a string
</c... | Invalid "id" when trying to set up Google OAuth2 with Passport | node.js|express|passport.js|passport-google-oauth | 0 | 27 | 1 | 72,227,130 | 72,227,130 | 1 | true | 2022-05-12T18:00:26.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Invalid "id" when trying to set up Google OAuth2 with Passport<p>I'm trying to set up my user authentication routes with <code>passport</code> using the <cod... |
72,172,183 | Designing tags system with nosql/elastic search<p>I have to design a system with this schema.</p>
<pre><code>{
"documentId" : 123
"documentType" : "paper"
"tags" :["abc","xyz"]
//other meta data of document
}
</code></pre>
<p>The queries I will be doing wi... | <p>It depends;</p>
<ul>
<li>Do we need a free text search for tag system ?</li>
<li>What is the update rate ( Number of docs updated every minute).</li>
</ul>
<p>IMHO,
If answer to Q1 is Yes and update rate is low , use ES</p>
<p>If answer to Q1 is No, and the Update rate is high, you may want to consider a non-Elastic... | Designing tags system with nosql/elastic search | sql|elasticsearch|search|nosql|full-text-search | 0 | 368 | 1 | 72,177,136 | 72,177,136 | 1 | true | 2022-05-09T12:39:49.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Designing tags system with nosql/elastic search<p>I have to design a system with this schema.</p>
<pre><code>{
"documentId" : 123
"documentT... |
72,088,006 | check if cumsum of the column is greater than range value than increment the element in list<p>I have a list</p>
<pre><code>sample_dates = ["10/07/2021","11/07/2021","12/07/2021","13/07/2021",
"14/07/2021","15/07/2021","16/07/2021",&q... | <p>You can compute the cumsum per group and either <code>cut</code> is manually or use a mathematical trick to make groups.</p>
<p>Then <code>map</code> your dates:</p>
<pre><code># round to thousands, clip to get min 1000 km
kms = df.groupby(['Truckid', 'Tripid'])['kms'].cumsum().floordiv(1000).clip(1)
# OR use manua... | check if cumsum of the column is greater than range value than increment the element in list | python|pandas|dataframe|pandas-groupby | 0 | 34 | 1 | 72,088,079 | 72,088,079 | 1 | true | 2022-05-02T14:13:45.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
check if cumsum of the column is greater than range value than increment the element in list<p>I have a list</p>
<pre><code>sample_dates = ["10/07/2021&... |
72,141,862 | How to convert binary into sign representation?<p>If an array consist of decimal number which represents as blocks('#') or empty(' ').
For example.</p>
<p><code>A = [31,21,29,19,31] </code><br />
represents<br />
<code>['11111', '10101', '11101', '10011', '11111']</code></p>
<p>and I want to have this array to be like... | <p>You can use a <a href="https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions" rel="nofollow noreferrer">list comprehension</a> with string formatting (here a <a href="https://peps.python.org/pep-0498/" rel="nofollow noreferrer">f-string</a>) and a <a href="https://docs.python.org/3/library/stdty... | How to convert binary into sign representation? | python|arrays | 0 | 23 | 1 | 72,141,901 | 72,141,901 | 1 | true | 2022-05-06T12:59:06.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert binary into sign representation?<p>If an array consist of decimal number which represents as blocks('#') or empty(' ').
For example.</p>
<p><c... |
72,226,886 | Apply change to timedelta to columns containing a given string<p>Be the following DataFrame in python pandas:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>date</th>
<th>time_SEL</th>
<th>time_02_SEL_01</th>
<th>time_03_SEL_05</th>
<th>other</th>
</tr>
</thead>
<tbody>
<tr>
<td>2022-01-01... | <p>You can <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html" rel="nofollow noreferrer"><code>apply</code></a> <a href="https://pandas.pydata.org/docs/reference/api/pandas.to_timedelta.html" rel="nofollow noreferrer"><code>pandas.to_timedelta</code></a> on all columns selected by <a href... | Apply change to timedelta to columns containing a given string | python|pandas|dataframe|timedelta | 0 | 55 | 2 | 72,226,915 | 72,226,915 | 1 | true | 2022-05-13T08:53:41.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply change to timedelta to columns containing a given string<p>Be the following DataFrame in python pandas:</p>
<div class="s-table-container">
<table clas... |
72,237,079 | Getting the average value of each hour for specific columns in data frame<p>I have a data frame with the date/time passed as "parse_dates" and then set as the index column for the data frame.</p>
<pre><code> Flow Enter Leave kWE kW
Time ... | <p>You can use <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html" rel="nofollow noreferrer"><code>resample</code></a> with hourly (<code>h</code>) frequency:</p>
<pre><code>cols = ['Flow', 'kWE']
df.resample('h')[cols].mean()
</code></pre>
<p>output:</p>
<pre><code> ... | Getting the average value of each hour for specific columns in data frame | python|pandas|dataframe|datetime | 0 | 59 | 2 | 72,237,125 | 72,237,125 | 1 | true | 2022-05-14T03:20:09.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting the average value of each hour for specific columns in data frame<p>I have a data frame with the date/time passed as "parse_dates" and then... |
72,143,700 | Target map()'ed items one by one<p>I want to create a contact form where the form fields are changed after they are filled.
For example when you fill the email field, you press enter or click the Next button it disappears and the next field appears. There will be different form field types (text, email, select, etc).
W... | <p>you need to create your own iterator... either through the use of generators or a custom class.. here's one I've written</p>
<pre><code>export class BidirectionalIterator {
// TODO: support for other data types
// #iterate_over: string = 'index'
static index: number = 0
static start_index: number = 0
... | Target map()'ed items one by one | javascript|reactjs|react-hooks | 0 | 66 | 1 | 72,143,861 | 72,143,861 | 1 | true | 2022-05-06T15:09:33.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Target map()'ed items one by one<p>I want to create a contact form where the form fields are changed after they are filled.
For example when you fill the ema... |
72,193,039 | Make the layout use the transformed coordinate (CSS)<p>Is there a way to make HTML/CSS to use the transformed coordinates in layout calculations? E.g. if I scale a div, I want the next div to automatically start on the scaled div's boundary.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="tru... | <blockquote>
<p>Is there a way to make HTML/CSS to use the transformed coordinates in layout calculations?</p>
</blockquote>
<p>Yes, that's what the <code>transform</code> property is for.</p>
<p>However, <code>transform</code> (like many other properties) only applies to an element and its descendants <em>not</em> its... | Make the layout use the transformed coordinate (CSS) | html|css|transformation|css-transforms | 0 | 26 | 1 | 72,193,203 | 72,193,203 | 1 | true | 2022-05-10T21:16:05.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make the layout use the transformed coordinate (CSS)<p>Is there a way to make HTML/CSS to use the transformed coordinates in layout calculations? E.g. if I s... |
72,143,287 | How to find all Confluence pages with PowerShell<p>I'm trying to pull <em>all</em> Confluence pages in my instance that haven't been modified since 1/1/21. I was able to get all of the parent pages that haven't been modified since 1/1/21 fairly easily. However, I'm now trying to get all of the <em>child</em> pages.</... | <p>I've just tested Atlassian's <code>ConfluencePS</code> module (v2.5.1) on a self-hosted Confluence instance (v7.3.5), and the <code>Get-ConfluencePage</code> cmdlet <strong>appears</strong> to return a flattened list of the entire document tree for a given space.</p>
<p>Based on that, your code would simply be:</p>
... | How to find all Confluence pages with PowerShell | powershell|confluence|confluence-rest-api | 0 | 163 | 1 | 72,146,518 | 72,146,518 | 1 | true | 2022-05-06T14:39:45.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find all Confluence pages with PowerShell<p>I'm trying to pull <em>all</em> Confluence pages in my instance that haven't been modified since 1/1/21. ... |
72,070,779 | How to modifying child component's slots from parent components in Svelte<p>I am developing a <code>DataTable</code> component in Svelte with this usage:</p>
<pre><code><script>
import DataTable from './DataTable.svelte'
import Column from './Column.svelte'
let items = [
{id: 1, name: 'Na... | <p>The correct way of doing this is probably to not do it like this at all. I worked on implementing a tab control in a similar fashion and Svelte seems to be not so great at interacting with slots/child components that are used in multiple places.</p>
<p>To make this work to some degree you can apply a few changes:</p... | How to modifying child component's slots from parent components in Svelte | svelte|svelte-3|svelte-component | 0 | 283 | 1 | 72,071,063 | 72,071,063 | 1 | true | 2022-04-30T17:42:29.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modifying child component's slots from parent components in Svelte<p>I am developing a <code>DataTable</code> component in Svelte with this usage:</p>... |
72,106,282 | Get outer this-context without loosing inner one<p>I need to have access to two this-contexts at the same time</p>
<pre><code>export class ToolSelectionComponent implements OnInit {
@ViewChild('toolGroupGrid') public grid: GridComponent;
public tools: Tool[] = [...];
public toolGroups: { Id: number, Name: string... | <p>You could wrap the value in an immediately invoked function and pass the component that way, e.g.:</p>
<pre><code>export class ToolSelectionComponent {
public parentProp = 42;
public childGrid = (component => ({
columns: 3,
load() {
const grid = this;
console.log(grid.columns);
... | Get outer this-context without loosing inner one | typescript | 0 | 16 | 1 | 72,106,441 | 72,106,441 | 1 | true | 2022-05-03T23:00:38.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get outer this-context without loosing inner one<p>I need to have access to two this-contexts at the same time</p>
<pre><code>export class ToolSelectionCompo... |
72,183,725 | Wrong timezone shift after adding a time delta over DST<p>I'm trying to shift a tz-aware timestamp for one month. Since <code>datetime.timedelta</code> does not have a month option, package <code>relativedelta</code> should be used.</p>
<p>The problem arises when the time point is after the summer DST and the result af... | <p>since you use <code>dateutil</code> anyway, why not use it for tz handling?</p>
<pre class="lang-py prettyprint-override"><code>from datetime import datetime
import dateutil
offset = dateutil.relativedelta.relativedelta(months=1)
dt = datetime(2022,4,26,7,tzinfo=dateutil.tz.gettz("Europe/Berlin"))
print... | Wrong timezone shift after adding a time delta over DST | python|datetime|dst|pytz|relativedelta | 0 | 90 | 2 | 72,189,459 | 72,189,459 | 1 | true | 2022-05-10T09:20:14.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wrong timezone shift after adding a time delta over DST<p>I'm trying to shift a tz-aware timestamp for one month. Since <code>datetime.timedelta</code> does ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.