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
71,419,928
Trigger an action based on Prometheus metrics<p>I need to trigger a bash command based on Prometheus metrics (not alerts). I found <a href="https://home.robusta.dev/" rel="nofollow noreferrer">https://home.robusta.dev/</a> that can execute an action, but it consumes only Prometheus alerts. Please recommend a tool that ...
<p>Prometheus has an <a href="https://prometheus.io/docs/prometheus/latest/querying/api/" rel="nofollow noreferrer">API</a>, you can get metrics with just anything capable of performing HTTP requests:</p> <pre class="lang-sh prettyprint-override"><code>curl 'http://prometheus.example.com:9090/api/v1/query?query=up!=1' ...
Trigger an action based on Prometheus metrics
prometheus
0
278
1
71,420,146
71,420,146
1
true
2022-03-10T06:53:22.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trigger an action based on Prometheus metrics<p>I need to trigger a bash command based on Prometheus metrics (not alerts). I found <a href="https://home.robu...
71,393,294
How to invert a rectangle ina Canvas Flutter?<p>I am making a background using <code>CustomPainter</code> in Flutter. Below is the result I want vs what I got from my code. What should I do to invert the Rectangle as shown in the expected output?</p> <pre class="lang-dart prettyprint-override"><code> @override void ...
<p>try this</p> <pre><code> final radius = min(size.height, size.width)/2; final gradient = RadialGradient( colors: [ CustomColors.crispBackgroundGradientColor1, CustomColors.crispBackgroundPrimaryColor, ], ); final paint = Paint() ..shader = gradient.createShader(Rect.f...
How to invert a rectangle ina Canvas Flutter?
flutter|flutter-layout
0
43
1
71,395,269
71,395,269
1
true
2022-03-08T10:17:23.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to invert a rectangle ina Canvas Flutter?<p>I am making a background using <code>CustomPainter</code> in Flutter. Below is the result I want vs what I go...
71,099,320
Does XCUITest type text function send a keyboard input?<p>Does the XCUITest typetext function actually send a keyboard event through the iOS keyboard or does it simple copy the value provided to it directly into the text box?</p> <p>I tried to send in Chinese through the typeText Function while the keyboard was of Engl...
<p>For those of you stuck on this problem,</p> <p>I found an answer <a href="https://developer.apple.com/forums/thread/29861" rel="nofollow noreferrer">here</a></p> <p>There is a method called <code>app.key['character shown on keyboard'].tap()</code> that taps on the keyboard instead of simply copying the text and past...
Does XCUITest type text function send a keyboard input?
ios|automated-tests|xcuitest
0
274
1
71,099,827
71,099,827
1
true
2022-02-13T09:19:15.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does XCUITest type text function send a keyboard input?<p>Does the XCUITest typetext function actually send a keyboard event through the iOS keyboard or does...
71,097,032
Divi - Slide Navigation On Button Optimisation<p>I have a slide navigation script that allows me to navigate to a particular slide using an &quot;nth-child(#) that triggers a click event.</p> <p>Each button currently has its own slide reference, i.e Slide-1 button will link to nth-child(1) and so forth through to slide...
<p>you can give a class to all slide buttons like : slideBtn</p> <p>then :</p> <pre><code>jQuery(document).ready(function ($) { var selector = &quot;.activelinks a&quot;; $(selector).on(&quot;click&quot;, function () { $(selector).removeClass(&quot;active&quot;); ...
Divi - Slide Navigation On Button Optimisation
javascript|jquery|wordpress|divi
0
34
1
71,098,862
71,098,862
1
true
2022-02-13T00:42:05.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Divi - Slide Navigation On Button Optimisation<p>I have a slide navigation script that allows me to navigate to a particular slide using an &quot;nth-child(#...
71,349,431
Spark Error: Executor XXX finished with state EXITED message Command exited with code 1 exitStatus 1<p>I build the standalone spark cluster on Oracle linux. I add this line in <strong>spark-env.sh</strong> on Master:</p> <pre><code> export SPARK_MASTER_HOST=x.x.x.x </code></pre> <p>And add these lines in <strong>spark-...
<p>Problem solved.</p> <p>I think it was because of network problem. Since when I added this part to <strong>spark-submit</strong> every thing worked fine.</p> <pre><code> --conf spark.driver.host=x.x.x.x </code></pre> <p>In fact, I run this:</p> <pre><code>/opt/spark/bin/spark-submit --master spark://x.x.x.x:7077 --co...
Spark Error: Executor XXX finished with state EXITED message Command exited with code 1 exitStatus 1
apache-spark|pyspark
0
1,063
1
71,350,008
71,350,008
1
true
2022-03-04T09:43:55.890Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark Error: Executor XXX finished with state EXITED message Command exited with code 1 exitStatus 1<p>I build the standalone spark cluster on Oracle linux. ...
71,141,572
Replace Text in XML files with placeholder text<p>I performed text mining on files that I am preparing for publication right now. There are several XML files that contain text within segments (see basic example below). Due to copyright restrictions, I have to make sure that the files that I am going to publish do not c...
<p>There is <code>rapply</code> to recursively replace values in a nested list:</p> <p>Let be <code>data.xml</code> containing your input.</p> <pre><code>library(tidyverse) library(xml2) read_xml(&quot;data.xml&quot;) %&gt;% as_list() %&gt;% rapply(how = &quot;replace&quot;, function(x) { tokens &lt;- x ...
Replace Text in XML files with placeholder text
r|xml|replace|dummy-data
0
38
1
71,141,845
71,141,845
1
true
2022-02-16T12:06:49.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace Text in XML files with placeholder text<p>I performed text mining on files that I am preparing for publication right now. There are several XML files...
71,209,076
make a method available to all Activities<p>I have a method &quot;InitView&quot;, I want to call it in every Activity, I create a class &quot;Helper&quot; and in it my method I make it static and pass Activity like parameter.</p> <p>I'm wondering if its the best solution and if there is no memory leak or something like...
<p>You can do this with the concept of <strong>Inheritance</strong>.</p> <p>Make a base/parent class, which can be inherited to all its child classes where you want to use the functions.</p> <pre><code>public class BaseActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceSta...
make a method available to all Activities
android
0
45
1
71,209,483
71,209,483
1
true
2022-02-21T15:38:44.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: make a method available to all Activities<p>I have a method &quot;InitView&quot;, I want to call it in every Activity, I create a class &quot;Helper&quot; an...
71,163,113
how do I find the percent change from column X in dataframe?<p>I have a dataframe that is 49x10, and I need to find the percent change for each index item to a specific column in that row, for each index item.</p> <p>Here is a sample of the dataframe being 5x10.</p> <pre><code> -15 -10 -5 ...
<p>The answer of @nonDucor found the mistake but I would be cautious to mix percentages with absolute values. (All columns are in percentage except for column '0' which you left unchanged). To complete the answer you should update the percentages of the reference column at the end.</p> <pre><code># Compute percentages ...
how do I find the percent change from column X in dataframe?
python|pandas|numpy|data-science
0
27
2
71,163,610
71,163,610
1
true
2022-02-17T17:54:21.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do I find the percent change from column X in dataframe?<p>I have a dataframe that is 49x10, and I need to find the percent change for each index item to...
71,250,043
How to store qt containers inside qt containers<p>Do I understand right that it does not make real sense to have</p> <pre class="lang-cpp prettyprint-override"><code>QVector&lt;QSharedPointer&lt;QVariantHash&gt;&gt; </code></pre> <p>and that I can stick just to:</p> <pre><code>QVector&lt;QVariantHash&gt; </code></pre> ...
<p>No, those have different behaviour.</p> <p>The <code>QVector&lt;QVariantHash&gt;</code> is still copy-on-write, so copies of the vector only share elements up to the first modification, whereas so long as you leave the pointers alone, the <code>QVariantHash</code>s pointed-to by the elements of <code>QVector&lt;QSha...
How to store qt containers inside qt containers
c++|qt|containers
0
43
1
71,250,397
71,250,397
1
true
2022-02-24T09:48:24.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store qt containers inside qt containers<p>Do I understand right that it does not make real sense to have</p> <pre class="lang-cpp prettyprint-overrid...
71,385,012
How to convert timezone in number to UTC?<p>I have some random dates with different timezones, they are in formats like this <code>&quot;07 Mar 2022 13:52:00 -0300&quot;</code>, or they could be like this: <code>&quot;07 Mar 2022 11:12:00 -0700&quot;</code>. I don't know which timezone exactly they will be coming from....
<p>You can use standard module <a href="https://docs.python.org/3/library/datetime.html" rel="nofollow noreferrer">datetime</a> for this.</p> <p>Function <code>strptime()</code> (<code>string parsing time</code>) can convert string to object <code>datetime</code> using matching pattern. For your examples works pattern ...
How to convert timezone in number to UTC?
python|timezone|utc
0
266
2
71,388,202
71,388,202
1
true
2022-03-07T17:29:00.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert timezone in number to UTC?<p>I have some random dates with different timezones, they are in formats like this <code>&quot;07 Mar 2022 13:52:00...
71,145,470
How do I show different yaxis value in a subplot?<p>I want to show different ranges in the first row and different ranges in the second row? For instance first row can show up to 50 and second can show up to 100?</p> <pre><code>from plotly.subplots import make_subplots import plotly.graph_objects as go import plotly.ex...
<p>After creating the figure using <strong>Plotly Express</strong> update each yaxis so that it is not configured to match the primary yaxis. Have also updated <strong>showticklabels</strong></p> <pre><code>import plotly.express as px import numpy as np import pandas as pd # set seed np.random.seed(41) # create thre...
How do I show different yaxis value in a subplot?
python|numpy|plotly
0
23
1
71,148,529
71,148,529
1
true
2022-02-16T16:19:09.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I show different yaxis value in a subplot?<p>I want to show different ranges in the first row and different ranges in the second row? For instance fir...
71,187,794
Push state of reactive value to dependencies<p>I have an object: <em>dynamicJSON</em> that is changing. I would like to pass this object down to multiple dependencies: <em>componentA, componentB</em>. I also want the parts of the dependencies using the object to render when the object is changed.</p> <p>I tried the us...
<p>Have you tried <code>useEffect()</code> with a dependency array? If anything in the dependency array is changed, the hook function will be triggered.</p> <p>Reference: <a href="https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect" rel="nofollow noreferrer">https://reactjs.org/docs/hooks-refer...
Push state of reactive value to dependencies
reactjs
0
25
1
71,187,848
71,187,848
1
true
2022-02-19T18:14:09.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Push state of reactive value to dependencies<p>I have an object: <em>dynamicJSON</em> that is changing. I would like to pass this object down to multiple de...
71,142,814
Removing specific lines from a string by index<p>I have a String paragraph that always gonna have 6 lines, like the example below.</p> <pre><code> val result= &quot;&quot;&quot; ${getValue(A1)} ${getValue(A2)} ${getValue(A3)} ${getValue(A4)} ${getValue(A5)} ${getValue(B1)} ${getValue(B2)} $...
<pre><code>val text = &quot;&quot;&quot; A A A A A B B B B B C C C C C D D D D D E E E E E F F F F F &quot;&quot;&quot;.trimIndent() fun String.deleteLinesAt(vararg lineNumbers: Int): String { return this .trim() .split(&quot;\n&quot;) .filterIndexed { index, _ -&gt; index + 1 !in lineNumbers } .join...
Removing specific lines from a string by index
android|arrays|string|kotlin
0
21
1
71,142,920
71,142,920
1
true
2022-02-16T13:32:42.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing specific lines from a string by index<p>I have a String paragraph that always gonna have 6 lines, like the example below.</p> <pre><code> val re...
71,134,209
MongoDb: Select a random record with a specifi condition and update it<p>Friends</p> <p>I have a collection with around 20 records of lastAccessed as null and now I want to select a random lastAccessed and update it with $$Now for which I have the below code</p> <pre class="lang-js prettyprint-override"><code> db.my...
<p>For your scenario, you can use <code>$merge</code> at the end of the aggregation pipeline to perform update by id behaviour.</p> <pre class="lang-js prettyprint-override"><code>db.collection.aggregate([ { $match: { &quot;lastAccessed&quot;: { $exists: false } } }, { &quot;$sampl...
MongoDb: Select a random record with a specifi condition and update it
mongodb|mongodb-query
0
45
2
71,134,664
71,134,664
1
true
2022-02-15T22:30:48.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDb: Select a random record with a specifi condition and update it<p>Friends</p> <p>I have a collection with around 20 records of lastAccessed as null an...
71,372,534
Copy/Paste VBA Script Recorder Logs Wrong<p>A few issues: Script is linked to a form ctrl button that runs <code>Update Data</code> every minute. This runs <code>Copy Data</code> and copies row <code>A39:T39</code> and pastes that row in the other sheet. That is the intent. But it doesn't paste right. Need to past in a...
<p>Put this code into an own module. To start logging, call <strong>StartRecordingData()</strong> and for stopping call <strong>StopRecordingData()</strong></p> <pre><code>Option Explicit Dim boolLoggingActive As Boolean Public Sub StartRecordingData() Application.StatusBar = &quot;Recording Dashboard St...
Copy/Paste VBA Script Recorder Logs Wrong
arrays|excel|vba|rows
0
41
1
71,373,500
71,373,500
1
true
2022-03-06T17:17:26.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy/Paste VBA Script Recorder Logs Wrong<p>A few issues: Script is linked to a form ctrl button that runs <code>Update Data</code> every minute. This runs <...
71,409,781
JavaScript file name selector application, only selecting first element<p>JavaScript file name selector application, only selecting first element.</p> <p>There are twelve images with a class of foto, each labelled step1.png, step2.png etc. When one of the images is clicked, the name of the image file should be displaye...
<p>your issue come from the line</p> <pre><code> var fullPath = document.querySelector(&quot;.foto&quot;).src </code></pre> <p>that return only the first element that match selector .foto</p> <p>to solve your issue recover image clicked by :</p> <ol> <li>pass an event parameter to your function</li> <li>recover target ...
JavaScript file name selector application, only selecting first element
javascript
0
42
1
71,409,886
71,409,886
1
true
2022-03-09T13:00:42.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript file name selector application, only selecting first element<p>JavaScript file name selector application, only selecting first element.</p> <p>The...
71,164,112
pandas: return mutated column into original dataframe<p>Ive attempted to search the forum for this question, but, I believe I may not be asking it correctly. So here it goes.</p> <p>I have a large data set with many columns. Originally, I needed to sum all columns for each row by multiple groups based on a name pattern...
<p>is this what you need?</p> <pre><code>data['sum'] = data.groupby(['id','group'])[cols].transform('sum').sum(axis = 1) </code></pre>
pandas: return mutated column into original dataframe
python|pandas
0
45
1
71,164,176
71,164,176
1
true
2022-02-17T19:12:28.860Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas: return mutated column into original dataframe<p>Ive attempted to search the forum for this question, but, I believe I may not be asking it correctly....
71,193,098
Robotframework datadriver library not able to find a variable from CSV file<p>I have a problem while trying to set up datadriver library with robot framework. I get to error that one of the variables is not found.</p> <p>CSV File:</p> <pre><code>${username},${password} admin@yourstore.com,adm adm@yourstore.com,admin ad...
<p>I'm no expert on this library but it looks to me like the delimiter arg is overwritten by the default dialect settings and is remaining as &quot;;&quot; even when you try the override.</p> <p>It could be worth trying arg <code>dialect=excel</code> as this defaults to ',' delimiter</p> <p><a href="https://github.com/...
Robotframework datadriver library not able to find a variable from CSV file
python|selenium|csv|robotframework
0
257
1
71,194,051
71,194,051
1
true
2022-02-20T09:35:11.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Robotframework datadriver library not able to find a variable from CSV file<p>I have a problem while trying to set up datadriver library with robot framework...
71,239,664
Find a certain word in a string using R<p>I'm trying to use the billboard tibble in R to find all the songs titles that contain the word &quot;Love&quot; in them using string basics but I'm struggling.</p> <p>The end result should look like this:</p> <pre><code> [1]&quot;I'm Outta Love&quot; &quot;My First Lov...
<pre><code>data(&quot;billboard&quot;) # as suggested by @Cath which is of course the way to go grep(&quot;Love&quot;, billboard$track, value = TRUE) # original answer billboard$track[grepl(&quot;Love&quot;, billboard$track)] # [1] &quot;I'm Outta Love&quot; &quot;My First Love&quot; &quot;My Lov...
Find a certain word in a string using R
r|string
0
37
1
71,239,801
71,239,801
1
true
2022-02-23T15:22:48.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find a certain word in a string using R<p>I'm trying to use the billboard tibble in R to find all the songs titles that contain the word &quot;Love&quot; in ...
71,292,701
FLUTTER || changing background of navBar selecteditem<p>In my flutter project I used scroll_navigation but I want to change background of the selected item and I don't know how. It's been days I can't solve this problem. Please any help is highly appreciated.</p> <p>like this if I select a icon the background become gr...
<p>I think that ScrollNavigation package you are using is limited and you are not able to do that with it. Why don't you make your custom navigation that imitates that package and customize it according to your needs, something like this: class</p> <pre><code>CustomScrollNavigation extends StatefulWidget { const Cust...
FLUTTER || changing background of navBar selecteditem
android|flutter|dart|navbar
0
38
1
71,295,184
71,295,184
1
true
2022-02-28T09:12:48.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FLUTTER || changing background of navBar selecteditem<p>In my flutter project I used scroll_navigation but I want to change background of the selected item a...
71,229,501
.htaccess rewriteCond that ignores your own domain<p>If I have a rule in <code>.htaccess</code> like this:</p> <pre><code>RewriteCond %{QUERY_STRING} ^URL\=(.+?)(-[0-9]+)?$ RewriteRule ^(.*)$ /index.php? [R=404,L] </code></pre> <p>how would I change it so that ignores anything after <code>?URL=</code> from the site's o...
<p>You can use:</p> <pre><code>RewriteCond %{QUERY_STRING} !^URL\=https?://my-domain.com [NC] RewriteCond %{QUERY_STRING} ^URL\=(.+?)(-[0-9]+)?$ RewriteRule ^(.*)$ /index.php? [R=404,L] </code></pre>
.htaccess rewriteCond that ignores your own domain
.htaccess|mod-rewrite
0
23
1
71,230,783
71,230,783
1
true
2022-02-22T23:18:21.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .htaccess rewriteCond that ignores your own domain<p>If I have a rule in <code>.htaccess</code> like this:</p> <pre><code>RewriteCond %{QUERY_STRING} ^URL\=(...
71,279,859
SPAQRL: select item and count occurences of its label<p>I have <a href="https://www.orkg.org/orkg/triplestore?query=%0APREFIX%20orkgr%3A%20%3Chttp%3A%2F%2Forkg.org%2Forkg%2Fresource%2F%3E%0APREFIX%20orkgc%3A%20%3Chttp%3A%2F%2Forkg.org%2Forkg%2Fclass%2F%3E%0APREFIX%20orkgp%3A%20%3Chttp%3A%2F%2Forkg.org%2Forkg%2Fpredicat...
<p>I see two options:</p> <p>First (and probably better) is to use <a href="https://www.w3.org/TR/sparql11-query/#defn_aggGroupConcat" rel="nofollow noreferrer"><code>GROUP_CONCAT</code></a> and collect the entities into one field to be parsed again on application side. this could look like this (<a href="https://www.o...
SPAQRL: select item and count occurences of its label
duplicates|sparql|rdf
0
22
1
71,279,934
71,279,934
1
true
2022-02-26T19:55:05.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SPAQRL: select item and count occurences of its label<p>I have <a href="https://www.orkg.org/orkg/triplestore?query=%0APREFIX%20orkgr%3A%20%3Chttp%3A%2F%2For...
71,341,654
How to package JavaFX + Spring Boot application via jpackage correctly?<p>I'm having trouble packaging my project using jpackage by badass jlink plugin. Project contains <code>Spring Boot</code>, which works with <code>JavaFX</code> via <code>FXVeawer</code>. And with <code>Spring Data</code> application works with Da...
<p><em>Explaining the error</em></p> <pre><code>Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessException module spring.geodemo does not open spring.geodemo to unnamed module @39cd0bac </code></pre> <p>See</p> <ul> <li><a href="https://stackoverflow.com/questions/41265266/how...
How to package JavaFX + Spring Boot application via jpackage correctly?
java|spring-boot|javafx|jpackage
0
281
1
71,343,793
71,343,793
1
true
2022-03-03T17:53:41.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to package JavaFX + Spring Boot application via jpackage correctly?<p>I'm having trouble packaging my project using jpackage by badass jlink plugin. Proj...
71,128,503
ElasticSearch - merge/combine the results by group<p>Following is the data stored in ElasticSearch:</p> <pre class="lang-json prettyprint-override"><code>[ { &quot;id&quot;: 1, &quot;class&quot;: &quot;class 1&quot;, &quot;name&quot;: &quot;Scott&quot;, &quot;scores&quot;: [ { &quot;year&quot;: ...
<p>Disclaimer: Tighten your seatbelt it is going to be verbose ^^</p> <h1>TLDR;</h1> <p>Yes, it is possible, using term <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html" rel="nofollow noreferrer">aggregation</a>.</p> <p>Such as, grouping by class:</p> <p>You will find a ...
ElasticSearch - merge/combine the results by group
elasticsearch|filter|aggregate|group
0
290
1
71,130,891
71,130,891
1
true
2022-02-15T14:49:50.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ElasticSearch - merge/combine the results by group<p>Following is the data stored in ElasticSearch:</p> <pre class="lang-json prettyprint-override"><code>[ ...
71,213,337
Sed: capture the text between the first ( and )<p>I have the following badly formatted text:</p> <pre><code>&lt;h1 id=&quot;page-title&quot;&gt;ABCD TEXT TEXT ( QQQ-10-123-01)&lt;/h1&gt; &lt;h1 id=&quot;page-title&quot;&gt;ABCD TEXT TEXT (QQQ-10-123-02)&lt;/h1&gt; &lt;h1 id=&quot;page-title&quot;&gt;ABCD TEXT TEXT (QQQ...
<p>Using <code>sed</code></p> <pre><code>$ sed 's/[^(]*([[:space:]]\?\([^)]*)\?\)).*/\1/' input_file QQQ-10-123-01 QQQ-10-123-02 QQQ-10-123-03 (QWERTY) </code></pre> <pre><code>$ sed -E 's/[^(]*\([[:space:]]?([^)]*\)?)\).*/\1/' input_file QQQ-10-123-01 QQQ-10-123-02 QQQ-10-123-03 (QWERTY) </code></pre>
Sed: capture the text between the first ( and )
sed
0
44
2
71,213,416
71,213,416
1
true
2022-02-21T21:39:46.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sed: capture the text between the first ( and )<p>I have the following badly formatted text:</p> <pre><code>&lt;h1 id=&quot;page-title&quot;&gt;ABCD TEXT TEX...
71,287,030
network issues in dockerfile while accessing database<p>I have an small python backend and a mariaDB. Deperated in Docker Services.</p> <p>The docker-compse looks like this:</p> <pre><code>version: '3.5' networks: web: name: web external: true wsm: name: wsm internal: true volumes: wsm-partsfinde...
<p>You are not able to run queries on the database in your build stage, because your database container not is started at that current point.</p> <p>The <code>RUN</code> statement is only executed in the build stage. You need to move it to the <code>CMD</code> (entrypoint), so it's executed when the container and the d...
network issues in dockerfile while accessing database
python|docker|docker-compose|pip
0
43
1
71,287,288
71,287,288
1
true
2022-02-27T17:36:14.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: network issues in dockerfile while accessing database<p>I have an small python backend and a mariaDB. Deperated in Docker Services.</p> <p>The docker-compse ...
71,397,038
How to add the folder filenames in a pandas column, where each name is the one where one csv concatenated comes from?<p>I am reading one csv file in several folder, everytime this is the same csv name.</p> <p>I have this function:</p> <pre><code>def get_all_projects(path,var): folder=[] for i in os.listdir(path...
<p>You can do something along the lines:</p> <p>Update the <code>try</code> block with below:</p> <pre><code>try: file_path = path+'\\'+folder[x]+'\\'+var+'.csv' tmp = pd.read_csv(file_path, sep=';',header=0) tmp['folder_filename'] = file_path # tweak this for exact value df.append(tmp) </code></pre>
How to add the folder filenames in a pandas column, where each name is the one where one csv concatenated comes from?
python|pandas
0
21
1
71,397,141
71,397,141
1
true
2022-03-08T14:55:59.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add the folder filenames in a pandas column, where each name is the one where one csv concatenated comes from?<p>I am reading one csv file in several ...
71,264,046
Get the value from the file & add the values in an array...But getting values multiple times<pre><code>#!/bin/bash while IFS= read -r -a line; do for raw_value in $line; do raw_value_1=`echo $line | sed &quot;s/,/ /g&quot; | head -n1 | awk '{print $1;}'` raw_value_2=`echo $line | sed &quot;s/,/ /g&quot; | head -n1 |...
<p>It's not entirely clear what your purpose is, but given this input</p> <pre class="lang-sh prettyprint-override"><code>cat file.txt </code></pre> <pre class="lang-none prettyprint-override"><code>Jack,master,1.0.1 Tom,master,1.0.2 </code></pre> <p>here's how to parse the data with three different action scenarios:</...
Get the value from the file & add the values in an array...But getting values multiple times
arrays|bash
0
31
2
71,264,398
71,264,398
1
true
2022-02-25T09:55:32.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the value from the file & add the values in an array...But getting values multiple times<pre><code>#!/bin/bash while IFS= read -r -a line; do for raw_v...
71,322,737
jq: limitting all arrays in a complex json<p>Trying the following code:</p> <pre><code>echo '[&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;]' | jq '..|= if type == &quot;array&quot; then [limit(3;.[])] else . end' [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot;, null, null ] </code></pre...
<p>If while the overall structure may be complex, the amount and arrangement of the arrays are not (e.g. no array is itself an item of another array at a position higher than 3, etc), you can simply address &quot;all arrays&quot; and shorten them independently from each other:</p> <pre class="lang-none prettyprint-over...
jq: limitting all arrays in a complex json
arrays|json|jq
0
43
1
71,322,909
71,322,909
1
true
2022-03-02T12:30:33.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jq: limitting all arrays in a complex json<p>Trying the following code:</p> <pre><code>echo '[&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e...
71,352,016
Reuse the hash-key and generate csv ready format<p>I'm trying to create an csv ready output with jq, and want to reuse the nested hash key on the way.</p> <p>In this example http, https should be reused to generate csv ready format <code>([][]...)</code>.</p> <p><strong>Original</strong></p> <pre><code>{ &quot;googl...
<p>If you separate accessing <code>.key</code> and the iteration over <code>.value[]</code>, you'll get the cartesian product:</p> <pre class="lang-sh prettyprint-override"><code>jq 'to_entries[] | [.key] + (.value[] | [.dest_url])' </code></pre> <pre class="lang-json prettyprint-override"><code>[ &quot;google.com&qu...
Reuse the hash-key and generate csv ready format
json|jq
0
25
1
71,352,092
71,352,092
1
true
2022-03-04T13:16:42.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reuse the hash-key and generate csv ready format<p>I'm trying to create an csv ready output with jq, and want to reuse the nested hash key on the way.</p> <p...
71,370,136
With JQ update JSON array with values from another one, namely JOIN<p>Given two files <code>1.json</code> and <code>2.json</code>. They are both arrays of objects. Need to update field <code>ping_latency</code> to 1.json from 2.json</p> <p><code>1.json</code></p> <pre class="lang-json prettyprint-override"><code>[ ...
<p>Assuming <code>.domain</code> is unique to the updating objects in <code>2.json</code> (change if this holds true for another key instead; even spannig over multiple keys is possible using an array, e.g. <code>[.name, .ip_address]</code>), you could use <code>JOIN</code> based on the unique <code>INDEX</code> to mat...
With JQ update JSON array with values from another one, namely JOIN
json|jq
0
262
1
71,371,163
71,371,163
1
true
2022-03-06T12:10:33.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: With JQ update JSON array with values from another one, namely JOIN<p>Given two files <code>1.json</code> and <code>2.json</code>. They are both arrays of ob...
71,206,759
How to return 14th day from month which was 2 months ago with determinated time in Oracle SQL?<p>How can I take the 14th day from month which was 2 months ago with time <code>23:59:59</code> in Oracle SQL ? I have query like below and I need answer something like below (similar style):</p> <pre><code>select to_char(to_...
<p>You can use:</p> <pre class="lang-sql prettyprint-override"><code>SELECT ADD_MONTHS(TRUNC(sysdate, 'MM'), -2) + INTERVAL '13 23:59:59' DAY TO SECOND AS day FROM DUAL </code></pre> <p>Which outputs:</p> <blockquote> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align...
How to return 14th day from month which was 2 months ago with determinated time in Oracle SQL?
sql|oracle|date|time
0
37
3
71,206,897
71,206,897
1
true
2022-02-21T13:00:07.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return 14th day from month which was 2 months ago with determinated time in Oracle SQL?<p>How can I take the 14th day from month which was 2 months ag...
71,213,420
Expanding Oracle rows with comma-delimited values into multiple rows<p>I have a table in Oracle like the following:</p> <pre><code>KEY,VALS k1,&quot;a,b&quot; </code></pre> <p>I need it to look like:</p> <pre><code>KEY,VAL k1,a k1,b </code></pre> <p>I did this with <code>CONNECT BY</code> and <code>LEVEL</code>, follow...
<h3>Option 1: Simple, fast string functions and a recursive query:</h3> <pre class="lang-sql prettyprint-override"><code>with t (key, vals) as ( SELECT 'k1', 'a,b' FROM DUAL UNION ALL SELECT 'k2', 'c,d,e' FROM DUAL ), bounds (key, vals, spos, epos) AS ( SELECT key, vals, 1, INSTR(vals, ',', 1) FROM t UNIO...
Expanding Oracle rows with comma-delimited values into multiple rows
oracle|connect-by
0
26
1
71,213,481
71,213,481
1
true
2022-02-21T21:49:31.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expanding Oracle rows with comma-delimited values into multiple rows<p>I have a table in Oracle like the following:</p> <pre><code>KEY,VALS k1,&quot;a,b&quot...
71,299,155
How to remove rows with different values within the same option value<p>In SQL, can someone help me understand what the query may look like if I'm trying to remove the red-highlighted rows from the image? Based on the logic I need, I need to remove records with <strong>different</strong> priority values within an optio...
<p>You can use the analytic <code>COUNT(DISTINCT ...)</code> function and then you do not need to use a self-join:</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM ( SELECT t.*, COUNT(DISTINCT priority) OVER (PARTITION BY cntry, item, &quot;OPTION&quot;) AS cnt FROM table_n...
How to remove rows with different values within the same option value
sql|oracle
0
32
2
71,299,449
71,299,449
1
true
2022-02-28T18:00:11.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove rows with different values within the same option value<p>In SQL, can someone help me understand what the query may look like if I'm trying to ...
71,415,255
How to understand what colors are being used in angular material theme for the components?<p>we are using angular-material on the project <a href="https://material.angular.io/" rel="nofollow noreferrer">https://material.angular.io/</a>. It allows to define custom color theme <a href="https://material.angular.io/guide/t...
<p>At the end of this answer I show the source code to find exactly which hues are used from the palette, but you really don't need to worry about it.</p> <p>You can choose which of the three themes to use with the <code>color</code> property of the component, and that's really the only decision you're supposed to make...
How to understand what colors are being used in angular material theme for the components?
angular|angular-material
0
262
1
71,419,534
71,419,534
1
true
2022-03-09T19:50:53.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to understand what colors are being used in angular material theme for the components?<p>we are using angular-material on the project <a href="https://ma...
71,133,784
Display pages source in iframe?<p>This might be one of the more daft questions to ask,</p> <p>but since</p> <pre><code>&lt;iframe src=&quot;view-source:https://ry3yr.github.io/OSTR/Diarykeepers_Homepage/Daymusic.html&quot; width=&quot;800&quot; height=&quot;600&quot;&gt;&lt;/iframe&gt; </code></pre> <p>doesn't work:</p...
<p>You could use javascript to fetch the page in question and escape the html.</p> <p>As an <a href="https://jsfiddle.net/mw0tz5sd/" rel="nofollow noreferrer">example</a> try using JQuery:</p> <pre><code> $.get('https://ry3yr.github.io/OSTR/Diarykeepers_Homepage/Daymusic.html', function(data) { var x = doc...
Display pages source in iframe?
iframe
0
38
1
71,134,079
71,134,079
1
true
2022-02-15T21:46:04.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display pages source in iframe?<p>This might be one of the more daft questions to ask,</p> <p>but since</p> <pre><code>&lt;iframe src=&quot;view-source:https...
71,247,736
How can I dump a specific section of memory with Windbg?<p>I am debugging a kernel application and want to dump a specific part of memory. I want to copy a driver (meaning its PE header and all of its sections) after breaking at a specific point, into a dump file. I have tried to use a regular memory dump and cut out t...
<p>(was meant to be a comment but is a bit too long)</p> <p>In a perfect world the easiest thing would be to do <code>lmvm &lt;driver_name&gt;</code> (see <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/lm--list-loaded-modules-" rel="nofollow noreferrer"><code>lm</code></a> command), look at...
How can I dump a specific section of memory with Windbg?
windows|kernel|windbg
0
515
1
71,250,971
71,250,971
1
true
2022-02-24T05:57:45.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I dump a specific section of memory with Windbg?<p>I am debugging a kernel application and want to dump a specific part of memory. I want to copy a d...
71,104,477
2 boxplots on the same vertical axis cause them to shift sideways<p>I have the following dataset:</p> <pre><code>structure(list(imaging_date = structure(c(19010, 19010, 19024, 19024, 19010, 19024, 19010, 19024, 19010, 19024, 19010, 19024, 19010, 19010, 19024, 19010, 19010, 19010, 19024, 19024, 19024, 19010, 19010, 1...
<p>You need to use the <code>position</code> argument. I've defined a slightly different version for you, that does what you need.</p> <pre><code>ggplot(dt, aes(x=region, y=norm_diameter, group=interaction(imaging_date,region))) + geom_boxplot(position=position_dodge(1), aes(colour = factor(imaging_date), fill = af...
2 boxplots on the same vertical axis cause them to shift sideways
r|ggplot2|tidyverse|boxplot
0
26
1
71,104,655
71,104,655
1
true
2022-02-13T20:14:23.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 2 boxplots on the same vertical axis cause them to shift sideways<p>I have the following dataset:</p> <pre><code>structure(list(imaging_date = structure(c(19...
71,103,664
AngularJS two different actions in ng-submit<p>I'm new to AngularJS, currently I am trying to create a spa for tracking expenses as a simple project but I have some problems with my code.</p> <p>I managed to do the most of the function but I got stuck at the update function, I want to be able to update the data without...
<p>You could have two scope variables to keep track if in edit mode and to keep track of the index that is being edited, and in the <code>newItem()</code> can have an if else statement based on edit mode or not For example you could do something like</p> <pre class="lang-js prettyprint-override"><code>var myApp = angul...
AngularJS two different actions in ng-submit
javascript|html|angularjs
0
1,066
1
71,103,984
71,103,984
1
true
2022-02-13T18:25:09.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS two different actions in ng-submit<p>I'm new to AngularJS, currently I am trying to create a spa for tracking expenses as a simple project but I ha...
71,340,404
Subtract the values for each group in java 8<p>I have class Data10 which have 5 fields and have list of values then i want to subtract the value from each unique id group of valuePeriod as below example then finally in result generate new Data10 object with same id, same year, new name, same valuePeriod and result of s...
<p>If I can think of a better way I will post it. But for now it's a two stage process.</p> <ul> <li>first create a map using the name, id, valuePeriod, and year as the key. This presumes every <code>A</code> has a matching <code>B</code> (else it gets more complicated).</li> </ul> <pre><code>Map&lt;String, Data10&gt;...
Subtract the values for each group in java 8
java-8|java-stream
0
300
1
71,341,522
71,341,522
1
true
2022-03-03T16:20:46.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subtract the values for each group in java 8<p>I have class Data10 which have 5 fields and have list of values then i want to subtract the value from each un...
71,197,346
How to combine parsing arguments in BeatifulSoup<p>This is my 1st attempt at scraping right out of the book. I managed to achieve what i needed however I think I can skip 1 step, if I knew how.</p> <pre><code>import requests from bs4 import BeautifulSoup as bs page = requests.get(&quot;https://finance.yahoo.com/&quot;...
<p>If combine means chain, you can do it this way:</p> <pre><code>ticker = soup.find('ul', class_='Carousel-Slider Pos(r) Whs(nw)').find_all('li') </code></pre> <p>or with <code>css selectors</code> - It would also be a better strategy to use the tag or attribute <code>id</code> instead of <code>class</code> cause fir...
How to combine parsing arguments in BeatifulSoup
python|beautifulsoup
0
26
1
71,197,499
71,197,499
1
true
2022-02-20T18:15:11.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine parsing arguments in BeatifulSoup<p>This is my 1st attempt at scraping right out of the book. I managed to achieve what i needed however I thi...
71,316,195
Custom Control Entry not getting set the Place Holder Color Bindable Property<p>I have a custom control its a date picker but the PlaceHolderColor is not being set and not having affect.</p> <pre><code>public Color PlaceHolderColorText { get =&gt; (Color)GetValue(PlaceHolderColorProperty); set =&gt; S...
<ol> <li><p>Initial <code>BindableProperty</code> correctly , the name should be same as the property .</p> <pre><code>public Color PlaceHolderColor { get =&gt; (Color)GetValue(PlaceHolderColorProperty); set =&gt; SetValue(PlaceHolderColorProperty, value); } public static readonly BindableProperty Place...
Custom Control Entry not getting set the Place Holder Color Bindable Property
c#|xamarin.forms
0
44
1
71,317,009
71,317,009
1
true
2022-03-02T00:37:44.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Control Entry not getting set the Place Holder Color Bindable Property<p>I have a custom control its a date picker but the PlaceHolderColor is not b...
71,351,249
Spring Rest Controller returns XML instead of JSON after Jasperreports update<p>I have a Spring boot project with version 2.6.4. And after I updated the jasperreports dependency to 6.19.0 all my RestControllers returns now XML instead of JSON Where can I change this, without changing to</p> <pre><code>@GetMapping(produ...
<p>I just have same issue today, I checked with Chrome and saw it doesn't add application/json in Accept header. My solution is create a wrapper filter:</p> <pre><code>@Component public class JsonRequestHeaderFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse resp...
Spring Rest Controller returns XML instead of JSON after Jasperreports update
java|spring|spring-boot|jasper-reports
0
278
3
71,391,485
71,391,485
1
true
2022-03-04T12:14:41.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Rest Controller returns XML instead of JSON after Jasperreports update<p>I have a Spring boot project with version 2.6.4. And after I updated the jasp...
71,328,977
Cumulative count using grouping, sorting, and condition<p>i want Cumulative count of zero only in column c grouped by column a and sorted by b if other number the count reset to 1 this a sample</p> <pre><code>df = pd.DataFrame({'a':[1,1,1,1,2,2,2,2], 'b':[1,2,3,4,1,2,3,4], 'c':[10,...
<p>Try use <code>cumsum</code> to create a group variable and then use <code>groupby.cumcount</code> to create the new column:</p> <pre><code>df.sort_values(['a', 'b'], inplace=True) df['n'] = df['c'].groupby([df.a, df['c'].ne(0).cumsum()]).cumcount() + 1 df a b c n 0 1 1 10 1 1 1 2 0 2 2 1 3 0 3...
Cumulative count using grouping, sorting, and condition
python-3.x|pandas|dataframe
0
41
1
71,329,034
71,329,034
1
true
2022-03-02T20:51:06.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cumulative count using grouping, sorting, and condition<p>i want Cumulative count of zero only in column c grouped by column a and sorted by b if other numbe...
71,364,233
Remove a particular character ("-") and characters after it in a column of dataframe<p>From my dataframe column, I want to remove the &quot;-&quot; character and the letters following it.</p> <p>For eg.</p> <p>Input dataframe</p> <pre><code>Name Subset Apple AP-, GP- Bat BT-01A, KL Cat CT-L, OK-01 </code><...
<p>You can use <code>-[^,]*</code> to match everything from <code>-</code> till a comma, here we use negation <code>[^,]</code> to match a non comma character:</p> <pre><code>df['Subset'] = df.Subset.str.replace('-[^,]*', '', regex=True) df Name Subset 0 Apple AP, GP 1 Bat BT, KL 2 Cat CT, OK </code></...
Remove a particular character ("-") and characters after it in a column of dataframe
python|pandas|string
0
36
2
71,364,370
71,364,370
1
true
2022-03-05T17:10:36.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove a particular character ("-") and characters after it in a column of dataframe<p>From my dataframe column, I want to remove the &quot;-&quot; character...
71,256,096
Oracle substract previous row<p>I've got this query:</p> <pre><code>SELECT user_id, from_loc_id, to_loc_id, to_char(dstamp, 'hh24:mi:ss') FROM inventory_transaction WHERE code = 'Pick' AND substr(work_group,1,6) = 'BRANCH' AND dstamp BETWEEN to_date('24/02/2022 17:00:00', 'dd/mm/yyyy hh24:mi:ss') AND to_date('24/0...
<p>You can use <code>NUMTODSINTERVAL</code> function with <code>day</code> argument and applying <code>SUBSTR</code> to extract <code>hours:minutes:seconds</code> portion as your data resides within a specific date such as</p> <pre class="lang-sql prettyprint-override"><code>SELECT t.user_id, t.dstamp, S...
Oracle substract previous row
sql|oracle
0
25
1
71,256,299
71,256,299
1
true
2022-02-24T17:42:29.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle substract previous row<p>I've got this query:</p> <pre><code>SELECT user_id, from_loc_id, to_loc_id, to_char(dstamp, 'hh24:mi:ss') FROM inventory_tran...
71,098,284
natrsort function not returning values<p>I am trying to sort a flat file (.txt) in descending order.</p> <p>Here's the list inside file.txt (name, age, ID No.) :</p> <pre><code>Jason, 24, 18299 Bryan, 19, 12999 James, 32, 72990 </code></pre> <p>My goal is to arrange the list in descending natural order based on the sec...
<p>When you use <code>$data[$key]</code>, <code>$key</code> is equals to <code>0</code>,<code>1</code> and <code>2</code>, because <a href="https://php.net/array_reverse" rel="nofollow noreferrer"><code>array_reverse()</code></a> re-index the array. So, your printed array is in the same order than your data in the file...
natrsort function not returning values
php|flat-file|natsort
0
29
1
71,098,829
71,098,829
1
true
2022-02-13T05:57:53.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: natrsort function not returning values<p>I am trying to sort a flat file (.txt) in descending order.</p> <p>Here's the list inside file.txt (name, age, ID No...
71,139,111
How can I begin a string with a number?<p>I have written the following python project which provides a random output of 20 strings and I have set the limit of it to be less than 100,000 during each run and every string shall be unique.</p> <p>Now I want to add a line of code that helps me start each output with a numbe...
<p>Just generate it separately, I guess.</p> <pre><code>import random results = [] while len(results) &lt; 100000: result_str = random.choice('0123456789') + ''.join((random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for i in range(19))) if result_str not in results: resul...
How can I begin a string with a number?
python
0
32
2
71,139,243
71,139,243
1
true
2022-02-16T09:21:14.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I begin a string with a number?<p>I have written the following python project which provides a random output of 20 strings and I have set the limit o...
71,413,091
Using Operator Module to Pass 'Nothing'<p>The code below executes fine when the third condition and choice are removed.</p> <p>I am using the <code>operator</code> module to pass in a tilde.</p> <p>The problem is that there are times where I want to NOT take the inverse of these statements, and other times that I do.</...
<p>I think something like this should work. The idea is to use a <code>conditional expression</code> (aka <code>ternary operator</code>) to toggle between actually calling <code>tilde2</code> vs simply returning a like-sized result filled with <code>True</code> (there may be a more elegant way to do this, but I have go...
Using Operator Module to Pass 'Nothing'
python|pandas|numpy
0
37
1
71,413,335
71,413,335
1
true
2022-03-09T16:52:59.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Operator Module to Pass 'Nothing'<p>The code below executes fine when the third condition and choice are removed.</p> <p>I am using the <code>operator<...
71,373,505
How to combinate LIKE + IN in SQL or JPA<p>For example I have this strings:</p> <pre><code>Tesla is good car Tesla is electric car Opel is budget auto </code></pre> <p>And by words: <strong>opel</strong>, <strong>tesla</strong> I want to select all this strings.</p>
<p><code>SIMILAR TO</code> would work</p> <blockquote> <pre><code>CREATE TABLE tab1 ( &quot;id&quot; INTEGER, &quot;mytext&quot; VARCHAR(21) ); INSERT INTO tab1 (&quot;id&quot;, &quot;mytext&quot;) VALUES ('1', 'Tesla is good car'), ('2', 'Tesla is electric car'), ('4', 'Opel is budget auto'); </code></pr...
How to combinate LIKE + IN in SQL or JPA
sql|postgresql|jpa
0
39
3
71,373,588
71,373,588
1
true
2022-03-06T19:25:10.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combinate LIKE + IN in SQL or JPA<p>For example I have this strings:</p> <pre><code>Tesla is good car Tesla is electric car Opel is budget auto </code...
71,245,238
fleissner grille javascript<p>Can I use a function that allows me to get the hidden message? If so, could you enlighten me, how can I do it?<br /> Using fleissner grille 6 x 6, decipher the hidden message: &quot;lróaon. sg sdersoildsu.:.cc kiomamii&quot;. For this, it must be rotated 90° clockwise. The open grids are a...
<p>I had no idea what a Fleissner Grille was but this <a href="https://www.instructables.com/Fleissner-Grille-Cipher/" rel="nofollow noreferrer">instructables.com</a> site explained it pretty well.</p> <p>This is a little tricky in a few places, I hope my explanation helps.</p> <p><strong>getChar</strong> Calculate whi...
fleissner grille javascript
javascript|arrays
0
32
1
71,246,688
71,246,688
1
true
2022-02-23T23:28:06.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: fleissner grille javascript<p>Can I use a function that allows me to get the hidden message? If so, could you enlighten me, how can I do it?<br /> Using flei...
71,306,416
Combining dictionaries with same key while running in a loop?<p>I have a function that generates the frequency of the words in a sentence. I also have a list of sentences.</p> <pre><code>sentences = [&quot;this word is used for testing&quot;, &quot;code runs this word&quot;, &quot;testing the code now&quot;] def findF...
<p>If you want to keep your existing code, let <code>findFreq</code> return a dict (instead of printing it). Then update a <code>Counter</code> in each iteration of the <code>for</code> loop.</p> <pre><code>from collections import Counter c = Counter() for sen in sentences: c.update(findFreq(sen)) print(c) </code...
Combining dictionaries with same key while running in a loop?
python|loops|dictionary|frequency
0
24
1
71,306,493
71,306,493
1
true
2022-03-01T09:40:12.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining dictionaries with same key while running in a loop?<p>I have a function that generates the frequency of the words in a sentence. I also have a list...
71,318,345
Show loading button during mutation<p>I have a component to create an Announcement that uses a custom hook for mutation -</p> <pre class="lang-js prettyprint-override"><code>function CreateAnnouncement() { const [text, setText] = useState('') const [isCreating, setIsCreating] = useState(false) const { mutat...
<p>Toggling a loading flag when the callback passed as <a href="https://react-query.tanstack.com/reference/useMutation" rel="nofollow noreferrer">onMutate</a> option is executed should be correct, so you have got that right. You can unset the flag using <code>onSettled</code>, so that loading stops being indicated on s...
Show loading button during mutation
react-query
0
542
1
71,319,130
71,319,130
1
true
2022-03-02T06:34:07.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show loading button during mutation<p>I have a component to create an Announcement that uses a custom hook for mutation -</p> <pre class="lang-js prettyprint...
71,357,432
Entity Framework - Parent Child relational table<p>I have an Organization entity table</p> <pre><code>public class Organization { public int OrganizationId { get; set; } public string Name { get; set; } public int OrganizationTypeId { get; set; } public OrganizationType OrganizationType { get;...
<p>You didn't map <code>OrganizationRelation.ParentOrganization</code> to <code>Organization.OrganizationRelations</code>, so EF is adding an additional FK to <code>OrganizationRelation</code> for the second navigation property.</p> <p>But that model seems overly complex. Why not just</p> <pre><code>public class Organ...
Entity Framework - Parent Child relational table
entity-framework-core|ef-core-5.0
0
38
1
71,362,852
71,362,852
1
true
2022-03-04T21:34:43.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Framework - Parent Child relational table<p>I have an Organization entity table</p> <pre><code>public class Organization { public int Organization...
71,377,219
incrementing the value of child in firebase<p><img src="https://i.stack.imgur.com/y8ffg.png" alt="firebase details photo" /></p> <p>My app is a monthly basis app. like every 1st of the month my app should do the calculations and update the data in firebase.. as there is no function like that I'm using a button(reset) o...
<p>To increment by one the value of the <code>date</code> property within all nodes, please use the following lines of code:</p> <pre><code>DatabaseReference db = FirebaseDatabase.getInstance().getReference(); DatabaseReference outstdlnRef = db.child(&quot;outstdln&quot;); outstdlnRef.get().addOnCompleteListener(new On...
incrementing the value of child in firebase
java|android|firebase|firebase-realtime-database
0
37
1
71,380,663
71,380,663
1
true
2022-03-07T06:34:14.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: incrementing the value of child in firebase<p><img src="https://i.stack.imgur.com/y8ffg.png" alt="firebase details photo" /></p> <p>My app is a monthly basis...
71,237,055
Reading command line argument on push in github action<p>I have a workflow which is executed on push. Is there any way to read some flags from the push command? So, I will push like this on my local computer</p> <pre><code>git push origin my-branch --do-something </code></pre> <p>I want to pass the flag (if available) ...
<p>I am afraid it's not possible like this.</p> <p>Depending on what you exactly need to trigger and how complicated things you want to pass, the most common solutions are:</p> <ol> <li><p>Trigger workflows based on <code>tags</code> and encode options into tags themselves - so for example to identify if workflow shoul...
Reading command line argument on push in github action
node.js|github-actions
0
257
1
71,238,419
71,238,419
1
true
2022-02-23T12:36:59.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading command line argument on push in github action<p>I have a workflow which is executed on push. Is there any way to read some flags from the push comma...
71,136,941
Specifying table dependency when many entries in upstream table for one entry in downstream table<p>I would like to create a datajoint computed table that depends on multiple entries (about 20) from an upstream table. I know it is possible to create a table that depends on multiple entries from an upstream table using ...
<p>A foreign key in the child table always refers to one entry in the parent table. If the child entry always refers to exactly two entries in the parent, then you can have a pair of foreign keys, renaming the foreign key attribute. If you must refer to an arbitrary subset, then you will need to model an additional mas...
Specifying table dependency when many entries in upstream table for one entry in downstream table
datajoint
0
41
1
71,144,644
71,144,644
1
true
2022-02-16T05:47:33.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Specifying table dependency when many entries in upstream table for one entry in downstream table<p>I would like to create a datajoint computed table that de...
71,143,265
How to include tools/commands in yocto image recipe?<p>I have a question regarding including different tools into Yocto image recipe. Currently I am building image recipe for my Avenger96 board. I have created a base image and it runs fine on the device. But when I try to do <code>sgdisk</code> after booting it says <c...
<p><code>sgdisk</code> is present under recipe: <code>meta/recipes-devtools/fdisk/gptdisk_xx.bb</code></p> <p>For <code>xx</code> it depends on your poky version.</p> <p>For dunfell this is the recipe <a href="https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/fdisk/gptfdisk_1.0.4.bb?h=dunfell" rel="nofollow ...
How to include tools/commands in yocto image recipe?
embedded-linux|yocto
0
268
1
71,153,882
71,153,882
1
true
2022-02-16T14:01:14.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to include tools/commands in yocto image recipe?<p>I have a question regarding including different tools into Yocto image recipe. Currently I am building...
71,157,342
Change the specified cell in the data frame in Python<p>I have a data frame like below:</p> <pre><code>0 INT_ID F1_ID chr start T1 T2 1 F143-F44837 143 1 5000 True True 2 F144-F153 144 1 15000 True True 3 F152-F153 152 1 20000 True True 4 F152-F175 152 2 250...
<p>Use <code>loc</code> and your conditions. It is important to use <code>loc</code> to <a href="https://stackoverflow.com/questions/20625582/how-to-deal-with-settingwithcopywarning-in-pandas">avoid <code>SettingWithCopyWarning</code></a>.</p> <pre><code>df.loc[df['F1_ID'].eq(144) &amp; df['start'].eq( 15000), 'T1'] = ...
Change the specified cell in the data frame in Python
python|pandas|dataframe
0
32
1
71,157,436
71,157,436
1
true
2022-02-17T11:32:13.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the specified cell in the data frame in Python<p>I have a data frame like below:</p> <pre><code>0 INT_ID F1_ID chr start T1 T2 1 F143-F...
71,173,678
pandas: split a column on multiple words present in all cells<p>I would like to split the column in this dataframe on name into two columns,</p> <pre><code>import pandas as pd import re df1 = pd.DataFrame({'Name': ['Steve _ (ICANA) Smith', 'Joe _ (ICANA) Nadal', 'Roger _ (ICANA) Federer_blu']}) <...
<p>You regex was incorrect, you need to escape the parentheses:</p> <pre><code>df1[['First','last']] = df1.Name.str.split(r&quot;\s*_ \(ICANA\)\s*&quot;, expand=True) </code></pre> <p>However, to avoid any issue, the best remains to use <code>extract</code>, which will ensure a fixed number of output columns:</p> <pre>...
pandas: split a column on multiple words present in all cells
python|regex|pandas|string|split
0
36
1
71,173,742
71,173,742
1
true
2022-02-18T12:42:40.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas: split a column on multiple words present in all cells<p>I would like to split the column in this dataframe on name into two columns,</p> <pre><code>i...
71,305,873
pandas replace nan multiple fields with another dataframe<p>I want to replace some nan fields in the first dataframe with another dataframe. first dataframe like this:</p> <pre><code>data={'month':['2021-10','2021-11','2021-12','2022-01','2021-02'], 'sessions':[10000,25000,32684,7415,None], 'users':[2500,36...
<p>Use <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.combine_first.html" rel="nofollow noreferrer"><code>combine_first</code></a> and <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.reindex_like.html" rel="nofollow noreferrer"><code>reindex_like</code></a> to keep the sam...
pandas replace nan multiple fields with another dataframe
python|pandas
0
41
1
71,305,914
71,305,914
1
true
2022-03-01T08:51:19.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas replace nan multiple fields with another dataframe<p>I want to replace some nan fields in the first dataframe with another dataframe. first dataframe ...
71,322,213
How to convert a unique time value to a string time interval format?<p>I have a pandas dataframe with time values 0,..,23. How can I convert the the time values to a range using string manipulation?</p> <p>ex.</p> <pre><code>print(hours) 0 17 1 0 2 11 3 19 4 13 ...
<p>Simply use:</p> <pre><code>df['hours_str'] = df['hours'].astype(str)+'-'+df['hours'].add(1).mod(24).astype(str) </code></pre> <p>output:</p> <pre><code> hours hours_str 0 17 17-18 1 0 0-1 2 11 11-12 3 19 19-20 4 13 13-14 1458639 13 ...
How to convert a unique time value to a string time interval format?
python|pandas|datetime
0
38
1
71,322,443
71,322,443
1
true
2022-03-02T11:50:08.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a unique time value to a string time interval format?<p>I have a pandas dataframe with time values 0,..,23. How can I convert the the time val...
71,287,359
CommentViewRow comment text weird spacing behavior...?<p>I am trying to make an adaptive <code>CommentViewRow</code> for a social app where the whole comment text can be displayed within the row.</p> <p>So far I am achieving this but I have <strong>3 issues</strong>:</p> <p>1 When the comment-text is short it is being ...
<h4>1st option: If you really need that view to be <code>310</code> wide</h4> <p>You can change <code>.frame(width: 310)</code> to <code>.frame(width: 310, alignment: .leading)</code></p> <h4>2nd option: Let the view adjust itself based on content, you just need to specify the alignment (<code>.leading</code> in this c...
CommentViewRow comment text weird spacing behavior...?
ios|swiftui
0
35
2
71,287,687
71,287,687
1
true
2022-02-27T18:16:03.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CommentViewRow comment text weird spacing behavior...?<p>I am trying to make an adaptive <code>CommentViewRow</code> for a social app where the whole comment...
71,235,267
animation on button to scale down and up<p>I have an image tag, when the user clicks on it I want to make that image scale down and scale up with a similar animation in phone when we do long press on app icons.</p> <p>What I have tried so far</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="tr...
<p><a href="https://codepen.io/helloCaptMomo/pen/QWOxQyx" rel="nofollow noreferrer">https://codepen.io/helloCaptMomo/pen/QWOxQyx</a></p> <p>I believe you can achieve it using animations, set the duration for what you think is considered a long press and then create a <code>@keyframes</code>, and use it in the <code>ani...
animation on button to scale down and up
html|css
0
42
2
71,235,390
71,235,390
1
true
2022-02-23T10:30:31.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: animation on button to scale down and up<p>I have an image tag, when the user clicks on it I want to make that image scale down and scale up with a similar a...
71,414,410
Javascript Appear-Disappear Animation dont work<p>I want to make h1 disappear and after 3 sec appear again. It disappears but dont appear again. Or do i need inline style for it? And any other useful loop for this except if?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa...
<p>You can use <code>setTimeout</code> to do it once.</p> <pre><code>const h1 = document.querySelector('h1'); h1.style.display = 'none'; setTimeout(() =&gt; h1.style.display = 'block', 3000); </code></pre> <p>Or you can use <code>setInterval</code> to do it every 3 seconds.</p> <pre><code>const h1 = document.querySelec...
Javascript Appear-Disappear Animation dont work
javascript
0
28
2
71,414,725
71,414,725
1
true
2022-03-09T18:36:34.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript Appear-Disappear Animation dont work<p>I want to make h1 disappear and after 3 sec appear again. It disappears but dont appear again. Or do i need...
71,265,937
laravel how to handle third party API Http::post error<p>im new in laravel im using Third Party API for sending sms notification, but Third Party API having some Down time so i need to refresh page ONCE OR TWISE to send notification, i that time get error on my website.</p> <p>i need to auto send second attempt if ge...
<p>HTTP client has a <code>retry</code> function, so you could do the following:</p> <pre><code>Http::retry(3, 30)-&gt;post(&quot;some_stuff&quot;); </code></pre> <p>where the 1st parameter is the number of retries and the 2nd are the seconds between the retries which is optional.</p> <p>So the above will retry 3 times...
laravel how to handle third party API Http::post error
laravel|laravel-5|eloquent|laravel-7|laravel-6
0
523
1
71,278,593
71,278,593
1
true
2022-02-25T12:32:48.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: laravel how to handle third party API Http::post error<p>im new in laravel im using Third Party API for sending sms notification, but Third Party API having ...
71,125,289
Make the taskbar disappear on all monitors<p>This code only removes the taskar on my laptop screen:</p> <pre class="lang-py prettyprint-override"><code>from ctypes import WinDLL user32 = WinDLL(&quot;user32&quot;) SW_HIDE = 0 SW_SHOW = 5 # Hides the taskbar: hWnd = user32.FindWindowW(u&quot;Shell_traywnd&quot;, None)...
<p>The taskbars on secondary monitors have a different class name (Shell_SecondaryTrayWnd).</p> <p>You should not hide the taskbars like this. If you create a window that fills the monitor area exactly then the shell will notice and hide the taskbar for you if you are a fullscreen application.</p>
Make the taskbar disappear on all monitors
python|windows|ctypes|taskbar
0
39
1
71,125,749
71,125,749
1
true
2022-02-15T11:01:06.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make the taskbar disappear on all monitors<p>This code only removes the taskar on my laptop screen:</p> <pre class="lang-py prettyprint-override"><code>from ...
71,301,612
find nearest lat/lng - loop through subArray as $key<p>as per the guide here <a href="https://www.intelliwolf.com/find-nearest-location-from-array-of-coordinates-php/" rel="nofollow noreferrer">https://www.intelliwolf.com/find-nearest-location-from-array-of-coordinates-php/</a></p> <p>I am trying to write a version tha...
<p>This seemed like an interesting exercise, a bit of a cast around and all the code you need is out there for you to utilise</p> <pre><code>function getDistance($from_lat, $from_long, $to_lat, $to_long, $unit = 'nmi', $decimals = 2) { // Calculate the distance in degrees $degrees = rad2deg(acos((sin(deg2rad($f...
find nearest lat/lng - loop through subArray as $key
php|arrays
0
36
2
71,302,085
71,302,085
1
true
2022-02-28T22:11:38.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find nearest lat/lng - loop through subArray as $key<p>as per the guide here <a href="https://www.intelliwolf.com/find-nearest-location-from-array-of-coordin...
71,273,195
Hide/Show div and then hide all div<p>I am trying to make a &quot;meet the staff&quot; section that has hidden bios that display on click. Right now the div displays as it should, but only disappears when the original button is clicked again. I am needing some additional javascript to hide any opened divs when a differ...
<p>You will need to add some attributes to your HTML to keep track of which item is active, what item a button controls and which ones should be hidden from screen readers. aria-controls aria-expanded and aria-hidden do just that. Once a button is clicked... if it is currently open, just close it (remove active) and to...
Hide/Show div and then hide all div
javascript
0
45
2
71,273,447
71,273,447
1
true
2022-02-26T00:55:02.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hide/Show div and then hide all div<p>I am trying to make a &quot;meet the staff&quot; section that has hidden bios that display on click. Right now the div ...
71,200,745
Background text in a Flutter list<p>I am looking for a quick alternative to indicate that the list is blank.</p> <p>Something quick and easy occurs to me that would be to show a text that always says that it is blank... and when the list has an element, said element is placed above the text making it hide.</p> <p>That ...
<p>Here's a way to do this by adding an optional progress loading, if you prefer you can remove it. If your list has items, it will be built, otherwise the text will be displayed.</p> <pre><code>StreamBuilder&lt;List&lt;ScanResult&gt;&gt;( stream: FlutterBlue.instance.scanResults, initialData: [], builder: (c, sn...
Background text in a Flutter list
flutter
0
44
1
71,200,815
71,200,815
1
true
2022-02-21T02:58:01.527Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Background text in a Flutter list<p>I am looking for a quick alternative to indicate that the list is blank.</p> <p>Something quick and easy occurs to me tha...
71,361,094
mongodb $lookup and match for an array item from inside look up<p>return the order with the user where purchase id: 123, product id: p123 and user and order shipping.mode =2</p> <pre><code>db={ &quot;orders&quot;: [ { &quot;_id&quot;: ObjectId(&quot;62155381877d4300196008ef&quot;), &quot;shipping&quot...
<p><a href="https://mongoplayground.net/p/IomR8U7Ard-" rel="nofollow noreferrer">https://mongoplayground.net/p/IomR8U7Ard-</a></p> <pre><code>db.orders.aggregate([ { &quot;$lookup&quot;: { &quot;from&quot;: &quot;users&quot;, &quot;localField&quot;: &quot;user&quot;, &quot;foreignField&quot;: &q...
mongodb $lookup and match for an array item from inside look up
mongodb|aggregation-framework
0
550
1
71,361,263
71,361,263
1
true
2022-03-05T09:40:32.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongodb $lookup and match for an array item from inside look up<p>return the order with the user where purchase id: 123, product id: p123 and user and order ...
71,117,138
Text manipulation of a comma separated string in python<p>I want to read a textfile <code>test.txt</code> where the txt is in the format</p> <pre><code>'Jon, Stacy, Simon, ..., Maverick' </code></pre> <p>I'd want to save the string into <code>test2.txt</code> as</p> <pre><code>'Jon AS t1_Jon, Stacy AS t1_Stacy, Simon A...
<p>One nice approach is to use the re module.</p> <pre><code>import re s_in = 'apple, banana, orange,\n mango, guava' words = re.split(r'[,\n]\s*',s_in) s_out = ', '.join([f'{word} AS t1_{word}' for word in words]) print(s_out) </code></pre> <p>Result:</p> <pre><code>apple AS t1_apple, banana AS t1_banana, orange AS t...
Text manipulation of a comma separated string in python
python|file|text|nlp
0
38
2
71,117,222
71,117,222
1
true
2022-02-14T19:13:50.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text manipulation of a comma separated string in python<p>I want to read a textfile <code>test.txt</code> where the txt is in the format</p> <pre><code>'Jon,...
71,145,913
get a list of tuples with the columns that have only two same strings:<p>I have the following problem:</p> <p>In case I want to get the columns of a dataframe which have all same strings I use the code that follows:</p> <p>Let's create the dataframe first: <code>df_example1 = pd.DataFrame({'A':[1,2,3],'B':[1,2,3]})</co...
<p>You want the <em>intersection</em> of both columns to contain two (or more?) values. You can use the <a href="https://docs.python.org/3/library/stdtypes.html#set" rel="nofollow noreferrer"><code>set</code> class</a> and its operations for this.</p> <pre><code>df_example2 = pd.DataFrame({'A':[2,3,4],'B':[1,2,3]}) int...
get a list of tuples with the columns that have only two same strings:
python
0
34
1
71,146,026
71,146,026
1
true
2022-02-16T16:48:10.113Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get a list of tuples with the columns that have only two same strings:<p>I have the following problem:</p> <p>In case I want to get the columns of a datafram...
71,250,385
Calcualte points in range with with different properties<p>I have the following data frame that contains points that originate from different samples. Each point has a type. I need to calculate, for each point belonging to a given sample of a given type (for instance for &quot;Sample_1&quot; type &quot;A&quot;) how ma...
<p>You can try using <code>RANN::nn2</code> function:</p> <pre><code>id_list &lt;- split(a_test, a_test$ID) res &lt;- id_list %&gt;% map(~select(.x, xpos, ypos)) %&gt;% map(~RANN::nn2(.x, .x, k = nrow(.), searchtype = &quot;radius&quot;, radius = threshold)) %&gt;% map(1) %&gt;% map2( id_list, functi...
Calcualte points in range with with different properties
r|optimization|distance
0
43
1
71,250,936
71,250,936
1
true
2022-02-24T10:16:29.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calcualte points in range with with different properties<p>I have the following data frame that contains points that originate from different samples. Each ...
71,281,324
Interferance when pairing <input> with DOMs<p>HTML:</p> <pre class="lang-html prettyprint-override"><code>&lt;h1 id=&quot;ws-title&quot;&gt;&lt;/h1&gt; &lt;time datetime=&quot;&quot; id=&quot;ws-date&quot;&gt;&lt;/time&gt; </code></pre> <p>JS:</p> <pre class="lang-js prettyprint-override"><code>inp1 = document.querySel...
<p>That's because when you declare a variable without a declarator (i.e. <code>var</code>, <code>let</code>, or <code>const</code>) it automatically gets defined in <code>window</code>, <code>this</code>, and <code>globalThis</code> (making those kinds of variables <strong>global</strong>, accessible anywhere in your c...
Interferance when pairing <input> with DOMs
javascript|html
0
19
1
71,281,349
71,281,349
1
true
2022-02-27T00:41:45.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interferance when pairing <input> with DOMs<p>HTML:</p> <pre class="lang-html prettyprint-override"><code>&lt;h1 id=&quot;ws-title&quot;&gt;&lt;/h1&gt; &lt;t...
71,113,496
Why after I click the go back button, the cancel button doesn't work?<p>I'm using react js on a simple project and what I'm trying to do is that if the user clicks the cancel button it pops up a modal that asks the user: If are you sure you want to cancel?. They are 2 options the first is: Go back(which returns the use...
<p>You mixing 2 ways of opening and closing the modal. These eventually conflict. Probably its best to remove the open/close functionality from <code>ModalCancel.js</code> and handle this logic in the parent.</p> <pre><code>export default function ModalCancel({ showModal, setShowModal }) { const [open, setOpenModal] ...
Why after I click the go back button, the cancel button doesn't work?
reactjs
0
25
1
71,113,638
71,113,638
1
true
2022-02-14T14:30:19.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why after I click the go back button, the cancel button doesn't work?<p>I'm using react js on a simple project and what I'm trying to do is that if the user ...
71,123,594
.twilio-cli/node_modules/@k88/typescript-compile-error-formatter/dist/<p>I got an error when I built a typewritten code with an error. I have developed a Twilio plugin. After resaving, nothing changed, the error was also in the console and it was necessary to restart the run command</p> <p>Want to share here to save so...
<p>I updated twilio-cli (@twilio-labs/plugin-flex) from <strong>4.3.0</strong> -&gt; <strong>4.3.4</strong> and everything started working</p> <p><a href="https://www.twilio.com/docs/flex/developer/plugins/cli/upgrade" rel="nofollow noreferrer">Instructions for updating</a></p>
.twilio-cli/node_modules/@k88/typescript-compile-error-formatter/dist/
twilio|twilio-cli
0
28
1
71,123,595
71,123,595
1
true
2022-02-15T08:57:38.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .twilio-cli/node_modules/@k88/typescript-compile-error-formatter/dist/<p>I got an error when I built a typewritten code with an error. I have developed a Twi...
71,101,978
avr-gcc calculation results varies with statement complexity<p>So i have this line of C code that takes 10-bit ADC value on the ATmega2560 and scales it to be used later by counters. results should be between 44 and 4166 or something like that</p> <pre><code>uint16_t tcnt = (60 * 16000000)/((100 + adc_latest * 9) * 64...
<p>I'm guessing you're working on a 16-bit processor, and that you've been bitten by integer overflow.</p> <p>I'm guessing <code>adc_latest</code> is an <code>int</code> (16 bits), or perhaps a <code>uint16_t</code>.<br /> And the constants 100, 9, 64, and 36 are all small enough to be represented as 16-bit <code>int</...
avr-gcc calculation results varies with statement complexity
c|atmega|avr-gcc
0
37
1
71,102,173
71,102,173
1
true
2022-02-13T15:10:42.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: avr-gcc calculation results varies with statement complexity<p>So i have this line of C code that takes 10-bit ADC value on the ATmega2560 and scales it to ...
71,211,137
Check if date in an array is older than dates in another array<p>I'm trying to check the date from arrayA against the all the dates in arrayB, if the date from arrayA is older than any in arrayB then return.</p> <p>Not too sure if I am able to check values in an array against other values in an array.</p> <pre><code>co...
<p>It's a bit confusing what you are asking, and there are contradictions in your question, so I'll make a few assumptions:</p> <ol> <li><p>I assume that you actually want to know whether <em>all</em> dates in <code>arrayA</code> are <strong>later (newer) or the same</strong> - and not older - than <em>all</em> dates i...
Check if date in an array is older than dates in another array
arrays|date
0
23
1
71,211,297
71,211,297
1
true
2022-02-21T18:12:21.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if date in an array is older than dates in another array<p>I'm trying to check the date from arrayA against the all the dates in arrayB, if the date fr...
71,249,596
how to join in queryset<p>I have some problems with QuerySet in Django python. I have 2 tables/models.</p> <pre><code>class PP(models.Model): imei = models.BigIntegerField(primary_key=True) name = models.CharField(max_length = 50) val2 = models.IntegerField(default = 0) def __str__(self): retur...
<p>Provided all <code>PP</code> have one or more related <code>mea</code> (i.e. no nulls) then I think you can filter the mea table to exclude duplicates, and you won't miss any PP rows without one or more related Mea rows.</p> <pre><code>qs = Mea.objects.order_by('-dates' # descending, so newest first ).distin...
how to join in queryset
python|django|django-queryset
0
39
2
71,249,962
71,249,962
1
true
2022-02-24T09:13:07.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to join in queryset<p>I have some problems with QuerySet in Django python. I have 2 tables/models.</p> <pre><code>class PP(models.Model): imei = mode...
71,212,502
A-frame set websubsurface source to a variable<p>I am using the websurface A-frame component () and I'm wondering how I can make it so when a button is clicked, the url of the websurface will change to the value of a variable I've defined called source. What should happen is for example, if the variable source is set t...
<p>The component is using an <code>i-frame</code> <a href="https://github.com/ryota-mitarai/aframe-websurfaces#members" rel="nofollow noreferrer">accessible with the reference</a>:</p> <pre><code>element.websurface_iframe </code></pre> <p>You can use it like any other <a href="https://developer.mozilla.org/en-US/docs/W...
A-frame set websubsurface source to a variable
javascript|three.js|aframe|webvr
0
30
1
71,212,895
71,212,895
1
true
2022-02-21T20:14:42.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A-frame set websubsurface source to a variable<p>I am using the websurface A-frame component () and I'm wondering how I can make it so when a button is click...
71,133,426
With ffmpeg, how to double a stream while applying a filter to the second copy?<p>I'm using Plex, which always considers the first audio stream, but is also failing to decode surround media files on my stereo system (my laptop).</p> <p>For that reason, I intend to downmix (following a formula suggested in <a href="http...
<p>So, you want to map 5.1 audio to 2 output audio streams: filtered 2.0 and original 5.1. You are on a right track but mixed up in the stream specifiers. Try this:</p> <pre><code>ffmpeg -i &quot;INPUT.mkv&quot; \ -filter_complex &quot;[0:a:0]pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+...
With ffmpeg, how to double a stream while applying a filter to the second copy?
ffmpeg
0
275
1
71,133,927
71,133,927
1
true
2022-02-15T21:09:13.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: With ffmpeg, how to double a stream while applying a filter to the second copy?<p>I'm using Plex, which always considers the first audio stream, but is also ...
71,337,545
Uncaught ReferenceError: init is not defined at HTMLButtonElement.onclick<p>I am trying to use a function in <strong>html</strong>. I wnat to use this in angular ts, in a component. However, it tells me that error and code must be good because it is provided by tensorflow. My <strong>code</strong> is:</p> <pre><code>&l...
<p>Instead of calling <code>init</code> via <code>on*</code> attributes (or <code>on*</code> methods), use an event listener instead.</p> <pre class="lang-html prettyprint-override"><code>&lt;!-- Don't --&gt; &lt;button type=&quot;button&quot; onclick=&quot;init()&quot;&gt;Start&lt;/button&gt; &lt;script&gt; async func...
Uncaught ReferenceError: init is not defined at HTMLButtonElement.onclick
javascript|html|angular|tensorflow|npm
0
1,821
1
71,337,602
71,337,602
1
true
2022-03-03T12:53:21.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught ReferenceError: init is not defined at HTMLButtonElement.onclick<p>I am trying to use a function in <strong>html</strong>. I wnat to use this in ang...
71,296,332
Django form: visibly group or separate fields<p>I have a form that I'm displaying within a Django app. This form has a number of fields.</p> <p>To make the UI more intuitive, I would like to display the fields not simply one after the other, but instead grouped into sections - be it within a box or by separating the se...
<p>You are luck, my friend.</p> <p>Take a look at Django Crispy Forms. Using this product, you can programmatically control the layout of your form from within the Form definition.</p> <p>Once you install Django Crispy Forms into your virtual environment, you'll have to add a line to your settings file to be able to u...
Django form: visibly group or separate fields
html|django|forms
0
36
1
71,296,375
71,296,375
1
true
2022-02-28T14:14:13.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django form: visibly group or separate fields<p>I have a form that I'm displaying within a Django app. This form has a number of fields.</p> <p>To make the U...
71,115,554
Inputs on how to convert Mule3 code to Mule4<p>We are migrating a project from mule3 to mule4 and encountered below MEL or DW code after migrating using MMA. Any inputs on how to convert these into mule4 code is appreciated. There are variables which might confuse for eg. tempMonthlyData, dataRecord, MonthlyData, etc. ...
<p>The question lacks in context and details. I'll have to make some educated guesses in the answers to mitigate that. See the answers by method.</p> <p>Note, none of these are Mule operations. It is all the equivalent of Java code inside MEL expressions. You need to be aware exactly of what is the Java class and metho...
Inputs on how to convert Mule3 code to Mule4
mule|dataweave|mule4
0
37
1
71,126,943
71,126,943
1
true
2022-02-14T17:05:25.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inputs on how to convert Mule3 code to Mule4<p>We are migrating a project from mule3 to mule4 and encountered below MEL or DW code after migrating using MMA....
71,305,153
how to extract json data from jquery Id while scrapping/crawling<p>I have some issue when fetch api data the data will comes in JQuery format as shown in bellow</p> <p><em>the data is coming through API in below belo format when I use responce.text</em></p> <p>('jQuery22409533634503620285_1646033040125([{&quot;id&quot;...
<pre><code>import requests import json url = &quot;https://live.uppsalaauktion.se/api/searcharchive/execute?callback=jQuery22401117076961935719_1646032781147&amp;estimate_max=100000000&amp;estimate_min=1000&amp;hammer_max=100000000&amp;hammer_min=1000&amp;query=picasso&amp;per_page=100&amp;language_id=2&amp;paging=1&...
how to extract json data from jquery Id while scrapping/crawling
python|jquery|web-scraping
0
44
1
71,305,650
71,305,650
1
true
2022-03-01T07:41:08.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to extract json data from jquery Id while scrapping/crawling<p>I have some issue when fetch api data the data will comes in JQuery format as shown in bel...
71,380,398
Flutter : Carousel image not showing?<p>eg: details about the questions ......................................................I've implemented CarouselSlider to make a banner in home page. I've debug from my mobile data is coming correct but image not showing. Below I've mentioned the model class and home page please f...
<p>future builders require return type <code>widget</code> but you forget to add the <code>return</code> keyword in your slider widget just add the return keyword and it will work.</p> <pre><code>import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:carousel_slider/carousel_slider.dart...
Flutter : Carousel image not showing?
flutter|carousel
0
280
2
71,380,644
71,380,644
1
true
2022-03-07T11:29:34.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter : Carousel image not showing?<p>eg: details about the questions ......................................................I've implemented CarouselSlider...
71,370,318
How to preserve order in python while comparing images from 2 different directories?<p>I was comparing images from 2 different directories. I write code but the sequence of comparing is this</p> <p>{ 0,1,10,11,12,...,19,2,20,21,..} not like {0,1,2,3,...,9,10,11,12,...}</p> <pre><code>L1 = os.listdir(&quot;D:\\image_dir...
<p>You have to sort the <strong>L1</strong> list:</p> <pre><code>L1 = sorted(os.listdir(&quot;D:\\image_dir_1\\&quot;), key=lambda str: int(str[:-4].strip())) </code></pre> <p>The issue is that without sorting them by their actual int value, you have the files names sorted lexicographically.</p>
How to preserve order in python while comparing images from 2 different directories?
python|python-3.x|pandas|list|glob
0
39
1
71,370,344
71,370,344
1
true
2022-03-06T12:34:50.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to preserve order in python while comparing images from 2 different directories?<p>I was comparing images from 2 different directories. I write code but ...
71,236,724
Spring IntegrationFlow StoredProcPollingChannelAdapter<p>How do we pass the update query for the <code>StoredProcPollingChannelAdapter</code> to update the fetched rows?</p> <pre><code>@Bean public MessageSource&lt;Object&gt; fromDatabase() { return new StoredProcPollingChannelAdapter(storedProcExecutor()); } @Be...
<p>You said it yourself - stored procedure. There is no reason to have a separate simple operation on this component since the target stored procedure can do everything for us before returning from DB.</p>
Spring IntegrationFlow StoredProcPollingChannelAdapter
spring-integration
0
18
1
71,238,216
71,238,216
1
true
2022-02-23T12:13:02.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring IntegrationFlow StoredProcPollingChannelAdapter<p>How do we pass the update query for the <code>StoredProcPollingChannelAdapter</code> to update the f...
71,416,152
I need to know how i can call a variable in from a stateful widget to a stateless one<p>I need to call a variable from a stateful widget to another class but it's not working fine.</p> <p>Below is my code snippet</p> <pre><code>class donateMain extends StatefulWidget { const donateMain({Key? key}) : super(key: key); @...
<p>In order to communicate between the two widgets (<strong>donateMain</strong> and <strong>ButtonsRow</strong>) you'll need a middle-man, like a state-management provided sort of service. But if you want to keep things simple, just pass it via the constructor the same way you're passing the <strong>onSetAmount</strong...
I need to know how i can call a variable in from a stateful widget to a stateless one
flutter
0
29
1
71,416,331
71,416,331
1
true
2022-03-09T21:25:08.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to know how i can call a variable in from a stateful widget to a stateless one<p>I need to call a variable from a stateful widget to another class but...
71,252,387
Getting data from queryparser<p>I am attempting to use queryparser to extract table relationships from an SQL query. I can get most of what I need, I'm just having issues unpacking the lists.</p> <pre><code>library(queryparser) file &lt;- &quot;select p.name, p.age, p.hometown, c.state, c.country, n.capi...
<p>Convert to character and then use stack. For the info in the attributes remove the names and simplify giving the character matrix shown.</p> <pre><code>stack(sapply(query$from, as.character)) ## values ind ## 1 person p ## 2 city c ## 3 nation n simplify2array(attributes(query$from)[-1]) ## join_typ...
Getting data from queryparser
r|list
0
25
1
71,252,762
71,252,762
1
true
2022-02-24T13:00:04.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting data from queryparser<p>I am attempting to use queryparser to extract table relationships from an SQL query. I can get most of what I need, I'm just...
71,148,418
Make two rows equivalent based on differences between columns in R<p>I have two dataframes of equal size:</p> <pre><code>df_1=data.frame(UA=c(1, 2, 3),plot1=c(100,100,100),plot2=c(100,0,0),plot3=c(100,100,0)) df_2=data.frame(UA=c(1, 2, 3),plot1=c(100,100,100),plot2=c(100,100,0),plot3=c(100,0,0)) </code></pre> <p>What ...
<p>You could use intersect for the element locations of 100 in each data frame:</p> <pre><code>intersect(which(df_1 == 100), which(df_2 == 100)) </code></pre> <p>Edit: For row and column positions:</p> <pre><code>library(prodlim) # Indices for data frame 1 and 2 for values = 100 indices_1 &lt;- which(df_1 == 100, arr....
Make two rows equivalent based on differences between columns in R
r|select|filter|match|tidyverse
0
36
1
71,148,545
71,148,545
1
true
2022-02-16T19:50:10.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make two rows equivalent based on differences between columns in R<p>I have two dataframes of equal size:</p> <pre><code>df_1=data.frame(UA=c(1, 2, 3),plot1=...
71,095,979
Toggle element data for element that I click on, not all elements<p>I want to toggle data for specific element I click on. Whenever I try to display element data then all items are toggling which I do not want. How can I only toggle the item I click on?</p> <pre class="lang-js prettyprint-override"><code>export default...
<p>You want to be able to show or hide each item of the array separately, so your state should reflect that - it should contain a value for each element of the array, instead of having just a single <code>displayId</code> boolean.</p> <pre><code>const [displayToggles, setDisplayToggles] = useState([]); const getPosts =...
Toggle element data for element that I click on, not all elements
reactjs
0
26
1
71,096,012
71,096,012
1
true
2022-02-12T21:22:20.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Toggle element data for element that I click on, not all elements<p>I want to toggle data for specific element I click on. Whenever I try to display element ...
71,402,457
Is there a way for my manual special case if statement look more pretty and cleaner?<p>I have a website where some of the Titles have been translated to my country's language.</p> <p>Because of that, when I match with worldwide data <code>API</code>, it'll not match (just some cases) due to <code>API title</code> is us...
<p>An object indexed by search string whose values are the string to replace it with would work.</p> <pre><code>const titles = { 'vua hai tac': 'One Piece', 'su mang than chet': 'Bleach', 'nanatsu no taizai that dai toi': 'Nanatsu no Taizai', // etc }; const slugWithSpaces = animeSlug.replace(/-/g, &quo...
Is there a way for my manual special case if statement look more pretty and cleaner?
javascript|node.js
0
22
2
71,402,493
71,402,493
1
true
2022-03-08T23:02:29.527Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way for my manual special case if statement look more pretty and cleaner?<p>I have a website where some of the Titles have been translated to my c...
71,257,363
Discord.py Send a specified, by the discord user, message to a channel<p>Is it possible to get the user's input and then return it? This is my concept:</p> <pre><code>@bot.command() async def return(ctx, *msg): await ctx.send(msg) </code></pre> <p>let's say that the user types: <code>!return Some message specified ...
<p>You can use the <code>*</code> separated with a comma to make this work:</p> <pre class="lang-py prettyprint-override"><code>@bot.command() async def return(ctx, *, msg): await ctx.send(msg) </code></pre> <p>Reference: <a href="https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html?highlight=keywo...
Discord.py Send a specified, by the discord user, message to a channel
python|discord.py|tuples
0
31
1
71,257,409
71,257,409
1
true
2022-02-24T19:37:32.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Discord.py Send a specified, by the discord user, message to a channel<p>Is it possible to get the user's input and then return it? This is my concept:</p> <...
71,178,149
How to user inner query with mongoDB update operation?<p>i'm trying to write an update query to update a column/filed of a collection. My collection has 4 fields: _id, name, date1, date2.</p> <p>I'm trying to write an update query to set date1 = date2 and i tried using inner query as shown below but didn't work.</p> <p...
<p>Maybe something like this( version 4.2+):</p> <pre><code>db.collection.update({}, [ { $addFields: { date1: &quot;$date2&quot; } } ], { multi: true }) </code></pre> <p><a href="https://mongoplayground.net/p/_xylB0jKVkj" rel="nofollow noreferrer">playground</a></p> <p>For your case ( Version 3.6 ):</p> <pre...
How to user inner query with mongoDB update operation?
mongodb|mongodb-query
0
30
2
71,179,722
71,179,722
1
true
2022-02-18T18:18:23.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to user inner query with mongoDB update operation?<p>i'm trying to write an update query to update a column/filed of a collection. My collection has 4 fi...
71,379,229
mongodb group each fields along with total count<p>I have a collection with documents in cosmosDB .How can I group each field distinct values using mongoDB?</p> <p>Here is my sample data:</p> <pre><code>{ &quot;_id&quot; : ObjectId(&quot;61ba65af74cf385ee93ad2c8&quot;), &quot;Car_brand&quot;:&quot;A&quo...
<p>Option1: Here is how to do in mongoDB , I guess it is similar in cosmosDB:</p> <pre><code>db.collection.aggregate([ { $group: { _id: null, Car_brand: { $push: &quot;$Car_brand&quot; }, Plate_number: { $push: &quot;$Plate_number&quot; }, Model_year: { $push: &quot;$Model_year&quot; }, Comp...
mongodb group each fields along with total count
database|mongodb
0
21
1
71,379,357
71,379,357
1
true
2022-03-07T09:54:30.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongodb group each fields along with total count<p>I have a collection with documents in cosmosDB .How can I group each field distinct values using mongoDB?<...
71,365,871
adding elements to a numpy array and reshape it<p>I have the following numpy array</p> <pre><code>a= np.array([1,1]) </code></pre> <p>I have the two elements</p> <pre><code>b= [2, 2] c= [3, 3] </code></pre> <p>I would like to add those elements b and c, so that my output seems like this</p> <pre><code>a= [[1, 1], [...
<p>Create a new <code>numpy</code> array with the three elements</p> <pre><code>&gt;&gt;&gt; np.array([a,b,c]) array([[1, 1], [2, 2], [3, 3]]) # shape : (3, 2) </code></pre> <p>If a had more than 1 dimension, <code>np.append</code> can be used :</p> <pre><code>&gt;&gt;&gt; a= np.array([[1,1], [4,4]]) &gt;&gt;&gt;...
adding elements to a numpy array and reshape it
python|arrays|numpy
0
28
1
71,365,888
71,365,888
1
true
2022-03-05T20:52:37.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: adding elements to a numpy array and reshape it<p>I have the following numpy array</p> <pre><code>a= np.array([1,1]) </code></pre> <p>I have the two elements...
71,189,079
Keep other columns untouched<p>Im trying to divide some columns by fixed number (<code>1000</code>) and remove commas, also change mix type into <code>int</code> with the second last code line. Except the list of <code>columns</code>, I do have other columns that are being deleted after executing the code. How can I ke...
<p>Your problem is in this part:</p> <pre><code>df_1 = df_1.loc[...]... </code></pre> <p>You're overriding the original value of <code>df_1</code> to a subset of your columns (and it seems that you're losing some rows too) when using this selector: <code>[:len(df_1) - 2, columns]</code>. You only need to update the val...
Keep other columns untouched
python|pandas
0
37
1
71,189,129
71,189,129
1
true
2022-02-19T20:49:14.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keep other columns untouched<p>Im trying to divide some columns by fixed number (<code>1000</code>) and remove commas, also change mix type into <code>int</c...
71,258,084
only convert to date cells with data<p>I have a data frame with dates and missing dates:</p> <pre><code>date 2022-02-02 2022-02-03 - - </code></pre> <p>I need to convert to date only the ones different from '-', I'm using .loc for this but is not working:</p> <pre><code>df.loc[oppty['date'] != '-', 'date'] = pd.to_date...
<p>Will this work?</p> <pre><code>df1 = pd.DataFrame({'date':['2022-02-02', '2022-02-03', '-','-']}) df1 pd.to_datetime(df1['date'], errors='coerce') </code></pre> <p><a href="https://i.stack.imgur.com/wZ5mU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wZ5mU.png" alt="enter image description here"...
only convert to date cells with data
python|datetime|pandas-loc
0
20
1
71,258,174
71,258,174
1
true
2022-02-24T20:49:05.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: only convert to date cells with data<p>I have a data frame with dates and missing dates:</p> <pre><code>date 2022-02-02 2022-02-03 - - </code></pre> <p>I nee...