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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73,017,547 | Get specific index from map with list of lists as value<p>I cant figure how to do the following in java</p>
<p>In groovy, if I want to iterate over a map and inside that map the value is a list of lists. then get a specific index from a list of lists i.e. the following code will work</p>
<pre><code>def total = value.co... | <p>You can use Java 8 stream API to iterate over outer list and fetch specific index form inner list. And then use mapToInt and sum function to retrieve required output.</p>
<pre><code>Map<Integer, List<List<Integer>>> map = new HashMap<>();
int key = 8;
int index = 0;
int sum = map.get(key).str... | Get specific index from map with list of lists as value | java|groovy | 1 | 63 | 1 | 73,018,222 | 73,018,222 | 0 | true | 2022-07-18T05:08:40.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get specific index from map with list of lists as value<p>I cant figure how to do the following in java</p>
<p>In groovy, if I want to iterate over a map and... |
72,990,918 | ms access: 'cannot assign value to this object' message, but assigning value works anyway<p>I have a strange issue with one of my data entry forms. I have a main form from which I open said data entry form using a button. Once the form is open, I can enter a new record (the DE-form is set to allow additions and data en... | <p>I found a solution on another site. Apparently, what is causing the message is an invisible textfield bound to the primary key <code>stoff_id</code> (which is AutoValue) of <code>chemikalien_tabelle</code> on the DE-subform. I usually add the primary key somewhere to my forms since it is likely I will need it. I st... | ms access: 'cannot assign value to this object' message, but assigning value works anyway | ms-access|data-entry | 0 | 63 | 1 | 73,018,374 | 73,018,374 | 0 | true | 2022-07-15T08:08:01.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ms access: 'cannot assign value to this object' message, but assigning value works anyway<p>I have a strange issue with one of my data entry forms. I have a ... |
72,808,870 | Accessing S3 multibyte Unicode character filename files using TypeScript (JavaScript) from the browser<p>I am updating an Angular web application to play any spoken language audio files retrieved from an AWS S3 bucket. Many of the files in the S3 bucket have (will have) multibyte-Unicode file names (because the applica... | <p>The approach below uses <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize" rel="nofollow noreferrer"><code>normalize('NFC')</code></a> to translate each Unicode character into its canonical decomposed form and <a href="https://developer.mozilla.org/en-US/docs/... | Accessing S3 multibyte Unicode character filename files using TypeScript (JavaScript) from the browser | javascript|angular|amazon-s3|unicode|unicode-normalization | 0 | 63 | 1 | 72,900,264 | 72,900,264 | 0 | true | 2022-06-29T23:32:37.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing S3 multibyte Unicode character filename files using TypeScript (JavaScript) from the browser<p>I am updating an Angular web application to play any... |
72,809,193 | Create a history /Log table based on status change<p>So my client wants is
If a user changes the status of the case then a log needs to be generated in a history table.
Basically, a new history record needs to be made in the history table as soon as the case status is changed everytime.</p>
<p>So the history table new ... | <p>After lot of digging, i was able to find the solution.
I know its not much work...But I am fairly new to the VBA like very basic...This is a small win for me :D</p>
<pre><code>Private Sub Form_beforeUpdate(Cancel As Integer)
Dim ststatus As String
Dim ststatus1 As String
ststatus = Me.Case_Status.OldValue
ststatus1... | Create a history /Log table based on status change | ms-access|tracking|audit|ms-access-forms | 0 | 63 | 1 | 72,810,163 | 72,810,163 | 0 | true | 2022-06-30T00:34:13.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a history /Log table based on status change<p>So my client wants is
If a user changes the status of the case then a log needs to be generated in a his... |
72,826,117 | Permission denied to run shell script by subprocess.call<p>I wrote a shell script using python and it successfully run by command <code>bash download_R1.sh</code> on my terminal.</p>
<p>I wanted to test if subprocess can do the same thing in python because I would like to integrate a pipeline in python script. Here is ... | <p>That's the normal way the shell behaves.</p>
<p>You can not directly run a program or script if it not has execution privileges (<code>+x</code>)</p>
<p>But, you can instruct other program <code>bash</code>, <code>python</code> or whatever to run a file even if not has <code>+x</code></p>
<p><strong>foo.sh</strong><... | Permission denied to run shell script by subprocess.call | python|bash|subprocess | 1 | 63 | 1 | 72,826,172 | 72,826,172 | 0 | true | 2022-07-01T07:58:28.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Permission denied to run shell script by subprocess.call<p>I wrote a shell script using python and it successfully run by command <code>bash download_R1.sh</... |
72,786,257 | How to return Json from Flask-SQLAlchemy<p>I am not able to return a JSON string, although it is possible if I request just one entry.</p>
<p>This works:</p>
<pre><code>@app.route('/incomeexpense/<id>', methods=['GET'])
def handle_incomexpense(id):
incomeexpense = IncomeExpenseModel.query.get_or_404(id)
... | <p><code>incomeexpense = IncomeExpenseModel.query.all()</code>
This line returns list of objects.</p>
<p>If you want to return JSON with one object you can use indexing, like:
<code>incomeexpense = IncomeExpenseModel.query.all()[0]</code></p>
<p>Or If you want to return all of them, prepare response using loop:</p>
<pr... | How to return Json from Flask-SQLAlchemy | python|flask|flask-sqlalchemy | -1 | 63 | 1 | 72,786,476 | 72,786,476 | 1 | true | 2022-06-28T12:15:51.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return Json from Flask-SQLAlchemy<p>I am not able to return a JSON string, although it is possible if I request just one entry.</p>
<p>This works:</p>... |
72,789,726 | Could not make proto path relative: java_out=C:\proto\: No such file or directory<br>
I'm learning gRPC and this is my first app.<br>
I'm using windows 10, java Graalvm 11.<br>
my proto file
<pre><code>syntax = "proto3";
package example;
option java_package = "ir.farshad.services";
option java_mul... | <p>In the code snippet of the command, we see:</p>
<pre><code>java_out=%OUTPUT_DIR%
</code></pre>
<p>It should be a flag:</p>
<pre><code>--java_out=%OUTPUT_DIR%
</code></pre> | Could not make proto path relative: java_out=C:\proto\: No such file or directory | java|protocol-buffers|grpc|grpc-java|proto | 0 | 63 | 1 | 72,789,872 | 72,789,872 | 1 | true | 2022-06-28T15:59:09.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Could not make proto path relative: java_out=C:\proto\: No such file or directory<br>
I'm learning gRPC and this is my first app.<br>
I'm using windows 10, j... |
72,774,334 | How can I add like a textbox with longer text to a chart in vega-lite?<p>I have an Scatterplot with a second layer for two lines with benchmark-data, now I need like a legend for these lines. I already managed to include them to the legend of the Scatterplot, but that does not help, as the legends name does not fit for... | <p>You can place your text wherever you want using dx and dy properties.
<a href="https://i.stack.imgur.com/PQvtT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PQvtT.png" alt="enter image description here" /></a></p>
<pre><code>{
"$schema": "https://vega.github.io/schema/vega-lite/... | How can I add like a textbox with longer text to a chart in vega-lite? | vega-lite | 2 | 63 | 2 | 72,790,186 | 72,790,186 | 1 | true | 2022-06-27T15:05:12.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I add like a textbox with longer text to a chart in vega-lite?<p>I have an Scatterplot with a second layer for two lines with benchmark-data, now I n... |
72,786,218 | Decoding a JPEG Huffman Table<p>I am looking for a way to retrieve the minCode, maxCode and valPtr from an arbitrary Huffman table.</p>
<p>For instance, the following is a Huffman DC table generated by JpegSnoop:</p>
<pre><code>Destination ID = 0
Class = 0 (DC / Lossless Table)
Codes of length 01 bits (000 total)... | <p>To generate the code bits, you start with all zero bits. Within each code length, increment the code like an integer for each symbol. When stepping up a code length, increment and then add a zero bit to the end.</p>
<p>So for your example code, we have each length, followed by the corresponding codes in binary:</p>
... | Decoding a JPEG Huffman Table | metadata|huffman-code|imagedecoder | 0 | 63 | 2 | 72,790,213 | 72,790,213 | 1 | true | 2022-06-28T12:12:44.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Decoding a JPEG Huffman Table<p>I am looking for a way to retrieve the minCode, maxCode and valPtr from an arbitrary Huffman table.</p>
<p>For instance, the ... |
72,790,030 | Powershell script for replying to email<p>I am trying to reply to emails using PowerShell, and the code below works successfully, but it doesn't show the original message I'm responding to:</p>
<pre><code>Add-Type -assembly "Microsoft.Office.Interop.Outlook"
Add-type -assembly "System.Runtime.Interopserv... | <p>The reason your reply is not showing is because you're creating your reply with <code>$reply = $mail.ReplyAll()</code> and then replacing the body of that email in this line <code>$reply.body = "TEST BODY"</code></p>
<p>If you wish to retain the existing email, I'd use the <a href="https://docs.microsoft.c... | Powershell script for replying to email | powershell|outlook|office-automation|com-automation | 1 | 63 | 2 | 72,790,245 | 72,790,245 | 1 | true | 2022-06-28T16:21:36.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell script for replying to email<p>I am trying to reply to emails using PowerShell, and the code below works successfully, but it doesn't show the ori... |
72,334,833 | How to import XML by piping from command line?<p>I'm converting from XML to CSV with <code>xml2 | 2csv</code> tool, then call <code>.import</code> to SQLite. I don't want to generate a CSV file, but want to pipe the converted file from <code>xml2</code> to the <code>.import</code> query.</p>
<p>I have tags.xml:</p>
<pr... | <p>I do the same with a 90 GB file, here is how I import it:</p>
<pre><code>xml2 < Posts.xml | 2csv row @Id @PostTypeId @AcceptedAnswerId @CreationDate \
@Score @ViewCount @Body @OwnerUserId @LastEditorUserId \
@LastEditorDisplayName @LastEditDate @LastActivityDate \
@Title @Tags ... | How to import XML by piping from command line? | xml|sqlite|csv|command-line|xml2 | 1 | 63 | 1 | 73,575,919 | 73,575,919 | 0 | true | 2022-05-22T04:36:38.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to import XML by piping from command line?<p>I'm converting from XML to CSV with <code>xml2 | 2csv</code> tool, then call <code>.import</code> to SQLite.... |
72,346,352 | Apache Telnet Client does not recevie non-ASCII characters<p>I've been trying to use<code>org.apache.commons.net.telnet.TelnetClient</code> and I am having trouble to receive non-ASCII characters (in my case polish chars like ą,ę,ć,ź and few others). The problem is not on server side - when I use default Ubuntu telnet ... | <p>I'm not sure why sub negotiation does not work but I found a workaround.</p>
<p>Try to add SimpleOptionHandler with option 0 (BINARY) to TelnetConnection. It will cause that this option will be enabled from the start.</p>
<pre><code>TelnetClient tc = new TelnetClient();
// 1st param 0 means BINARY option
SimpleOptio... | Apache Telnet Client does not recevie non-ASCII characters | java|network-programming|telnet|apache-commons|network-protocols | 1 | 63 | 1 | 73,648,468 | 73,648,468 | 0 | true | 2022-05-23T09:38:43.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apache Telnet Client does not recevie non-ASCII characters<p>I've been trying to use<code>org.apache.commons.net.telnet.TelnetClient</code> and I am having t... |
72,782,946 | Is it possible to get pod metrics from prometheus without RBAC?<p>I have a Kubernetes namespace with limited privileges which excludes the creation of <code>ClusterRole</code> and <code>ClusterRoleBinding</code>.
I want to monitor the resource consumption and pod-related metrics on the namespace level.</p>
<p>E.g., pod... | <p>It is possible to get namespace level entities from kube-state-metrics.</p>
<ol>
<li><p>Pull the helm chart for kube-state-metrics:
<a href="https://bitnami.com/stack/kube-state-metrics/helm" rel="nofollow noreferrer">https://bitnami.com/stack/kube-state-metrics/helm</a></p>
</li>
<li><p>Edit the values.yaml file an... | Is it possible to get pod metrics from prometheus without RBAC? | kubernetes|prometheus|prometheus-alertmanager|prometheus-operator | 1 | 63 | 1 | 73,252,647 | 73,252,647 | 1 | true | 2022-06-28T08:13:52.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to get pod metrics from prometheus without RBAC?<p>I have a Kubernetes namespace with limited privileges which excludes the creation of <code>... |
72,238,744 | How to append parenthesis to the string text in python?<p>I have one string like "Article created on March 03 2021 for the some user"</p>
<p>I want to convert that string to "Article created on (March 03 2021 for the some user)" so I thought I should create a list containing all the name of the mont... | <p>We can try using <code>re.sub</code> here:</p>
<pre class="lang-py prettyprint-override"><code>inp = "Article created on March 03 2021 for the some user"
output = re.sub(r'(\w+ \d{2} \d{4}\b.*)', r'(\1)', inp)
print(output) # Article created on (March 03 2021 for the some user)
</code></pre> | How to append parenthesis to the string text in python? | python | -2 | 63 | 2 | 72,238,782 | 72,238,782 | 0 | true | 2022-05-14T09:01:45.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to append parenthesis to the string text in python?<p>I have one string like "Article created on March 03 2021 for the some user"</p>
<p>I want... |
72,239,372 | How to implement Modular Exponentiation Code<p>Please I was learning from the book <em>Introduction to algorithm (Chapter 31 page 957)</em> and came across this pseudocode. This pseudocode is how we can implement the modular-exponentiation. The pseudocode is as follows</p>
<pre><code>MODULAR-EXPONENTIATION(a,b,n)
1 c ... | <p>You messed up while translating these parts from the pseudocode into actual code:</p>
<pre><code>3 let <b_k,b_(k-i),....b_0> be the binary representation of b
4 for i = k **downto** 0
</code></pre>
<p>These instructions say that you should iterate from the left-most digit (b_k) of the binary representation to... | How to implement Modular Exponentiation Code | python|algorithm | -2 | 63 | 1 | 72,239,603 | 72,239,603 | 0 | true | 2022-05-14T10:30:14.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement Modular Exponentiation Code<p>Please I was learning from the book <em>Introduction to algorithm (Chapter 31 page 957)</em> and came across t... |
72,246,528 | while-loop doesnt stop after meeting the condition<p>Just got started with Javascript and struggling with some pretty easy code:</p>
<pre><code>"use strict";
function math () {
if (action == "+") {
return answer = firstNumber + secondNumber
}
else if (action ... | <p>The error here lies in the while loop conditional statement.</p>
<pre><code>while(action != "+" || action != "-")
</code></pre>
<p>This statement will continue looping if action does not equal "+", or "-". If action is "+", we continue to loop because the action does... | while-loop doesnt stop after meeting the condition | javascript|while-loop | -1 | 63 | 4 | 72,246,565 | 72,246,565 | 0 | true | 2022-05-15T08:02:58.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
while-loop doesnt stop after meeting the condition<p>Just got started with Javascript and struggling with some pretty easy code:</p>
<pre><code>"use str... |
72,243,696 | setOnClickListener is not showing the Toast or doing the Intent<p>this is in Kotlin, it doesn't seem to work no matter what I try it's just a button with a click listener. Its function is to take me to another activity, I tried a toast but didn't show either. I tried not using the function and also didn't work. and can... | <p>Please do not use this syntax, it is not invalid, but improving it will be much better for you and for other developers to understand faster and easily what is going on :). Trigger the function from the on click event as follows:</p>
<pre><code>fun onCreateOrOtherMethod() {
binding.button.setOnClickListener {
... | setOnClickListener is not showing the Toast or doing the Intent | android|android-studio|kotlin | -2 | 63 | 2 | 72,246,749 | 72,246,749 | 0 | true | 2022-05-14T20:37:13.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
setOnClickListener is not showing the Toast or doing the Intent<p>this is in Kotlin, it doesn't seem to work no matter what I try it's just a button with a c... |
72,254,035 | How can I access private property outside that class in Swift?<p>Here I have a class and make its properties private to prevent from modifications by accident.</p>
<pre><code>class Article {
private var lineIndex: [Int] = []
private var text: [String] = []
....
}
</code></pre>
<p>I know I can write a funct... | <p>You can use one of these ways:</p>
<ul>
<li>with <code>private(set)</code>, which allows editable inside the class:</li>
</ul>
<pre class="lang-swift prettyprint-override"><code>class Article {
private(set) var text: [String] = []
...
}
</code></pre>
<ul>
<li>with get only computed property (this is the same... | How can I access private property outside that class in Swift? | swift|getter | 0 | 63 | 1 | 72,254,051 | 72,254,051 | 0 | true | 2022-05-16T04:01:15.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I access private property outside that class in Swift?<p>Here I have a class and make its properties private to prevent from modifications by acciden... |
72,251,600 | Apache Flink Produce Kafka from Csv File<p>I want to produce kafka from CSV file but the kafka output is as follows ;</p>
<p>org.apache.flink.streaming.api.datastream.DataStreamSource@28aaa5a7</p>
<p>how can I do it?</p>
<p>My Code ;</p>
<pre><code>public static class SimpleStringGenerator implements SourceFunction<... | <p><code>text</code> is a DataStream object which represents an unbounded stream of elements (in your code each line in the test file will be a different element) so it is not the actual file contents.</p>
<p>If what you want is to produce these elements to Kafka, you need to initialize a Kafka sink and connect your Da... | Apache Flink Produce Kafka from Csv File | apache-flink|kafka-producer-api | 0 | 63 | 1 | 72,255,485 | 72,255,485 | 0 | true | 2022-05-15T19:33:46.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apache Flink Produce Kafka from Csv File<p>I want to produce kafka from CSV file but the kafka output is as follows ;</p>
<p>org.apache.flink.streaming.api.d... |
72,253,381 | Trying to create import module for Python (for RPi GPIO)<p>I am new to Python. I am trying to create a fake GPIO module for my Raspberry Pi that uses PWM motors so that my interpreter (using Visual Studio Code) can understand it and pass it without error.</p>
<p>This is what I wanted to achieve:</p>
<pre><code>#Motor.p... | <p><code>GPIO.PWM</code> is a class - and <code>start</code> is a member function of that class.</p>
<p>So you'll need to look at how classes are constructed using the <code>__init__()</code> method, and how member functions work.</p>
<p>Here is an example of the PWM class you'll need to create:</p>
<pre><code>class PW... | Trying to create import module for Python (for RPi GPIO) | python|module|raspberry-pi | 0 | 63 | 1 | 72,256,982 | 72,256,982 | 0 | true | 2022-05-16T01:30:45.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to create import module for Python (for RPi GPIO)<p>I am new to Python. I am trying to create a fake GPIO module for my Raspberry Pi that uses PWM mot... |
72,255,847 | How to hot export the configuration of an ActiveMQ Artemis and hot import it?<p>I want to make a hot export of the configuration, in order to be able to import it later, without stopping the machine:</p>
<ul>
<li>address</li>
<li>queue</li>
<li>routing type</li>
<li>address-settings</li>
<li>etc...</li>
</ul>
<p>The cr... | <p>There is currently no way to dump the configuration of the items you mentioned at runtime and then apply them to another running broker.</p>
<p>Instead of modifying the broker via the web console you could change <code>broker.xml</code>. That way all the configuration changes would be captured in a simple format and... | How to hot export the configuration of an ActiveMQ Artemis and hot import it? | activemq-artemis | 0 | 63 | 1 | 72,260,815 | 72,260,815 | 0 | true | 2022-05-16T07:56:32.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hot export the configuration of an ActiveMQ Artemis and hot import it?<p>I want to make a hot export of the configuration, in order to be able to impo... |
72,263,698 | Incorrect json output from csv input<p>I have this csv input which has itemnumber as key field as each itemnumber will be assigned with 2
house-id. so i want my json output to be generated as below. where, itemnumber will be unique and under that there should be details which is an array of objects that contains 2 hous... | <p>You can get your required output using <code>groupBy</code> function. This function takes an Array as input, and a function to get the field on which you want to group your payload. So in your case, you need to group your payload on the basis of the <code>ItemNumber</code> key.</p>
<p>You can read more about this fu... | Incorrect json output from csv input | mule|dataweave|mulesoft | 0 | 63 | 1 | 72,268,697 | 72,268,697 | 0 | true | 2022-05-16T18:05:19.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Incorrect json output from csv input<p>I have this csv input which has itemnumber as key field as each itemnumber will be assigned with 2
house-id. so i want... |
72,259,833 | Error importing private repo into next project<p>I am trying to import a private github repo to use it on a React/Next project, however it throws an error saying that there are currently no loaders configured, I don't think that is actually the problem I imported other <code>.TS</code> files on this project, just not d... | <p>Turns out the problem was indeed on the loader. Check <a href="https://stackoverflow.com/a/64990954/5844134">here</a> to see how to add the loader, basically add the loader with</p>
<pre><code>yarn add ts-loader --dev
</code></pre>
<p>Then add the webpack to your <code>next.config.js</code>:</p>
<pre><code>module.ex... | Error importing private repo into next project | reactjs|import|next.js|importerror | 0 | 63 | 1 | 72,280,369 | 72,280,369 | 0 | true | 2022-05-16T13:14:57.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error importing private repo into next project<p>I am trying to import a private github repo to use it on a React/Next project, however it throws an error sa... |
72,267,417 | Neo4j similarity of single node with entire graph<p>I'm trying to use gds in neo4j do calculate similarities. I understand how to get gds to calculate all the similarities in the in memory graph, but really this answer the question "Tell me, over the whole graph, the similarity of each pair of nodes."
Now my ... | <p>As commented by a Neo4j developer, as of now for the above code snippet, GDS is calculating all the similarities and post-filtering the results (the WHERE is applied to the result stream from the node similarity algorithm).</p>
<p>More sophisticated filters are going to be released with version 2.1, but in the meanw... | Neo4j similarity of single node with entire graph | neo4j|cypher|similarity|graph-data-science | 0 | 63 | 1 | 72,282,625 | 72,282,625 | 0 | true | 2022-05-17T02:04:59.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Neo4j similarity of single node with entire graph<p>I'm trying to use gds in neo4j do calculate similarities. I understand how to get gds to calculate all th... |
72,279,274 | Update column from column from another table partially matched<p>I have two tables, the first table is called <code>IM_ITEM</code> and has the following columns</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ITEM_NO</th>
<th>DESCR</th>
<th>BRAND</th>
</tr>
</thead>
<tbody>
<tr>
<td>10000</... | <p>You can use LIKE clause and use the same in JOIN, as given below.</p>
<pre class="lang-sql prettyprint-override"><code>DECLARE @im_item table (ITEM_NO int, DESCR varchar(500), BRAND varchar(50))
DECLARE @im_attr_cod table (attr_5 varchar(100), DESCR varchar(500))
INSERT INTO @im_item
values
(10000,'Orin Swift Bla... | Update column from column from another table partially matched | sql|sql-server|sql-update | 0 | 63 | 3 | 72,282,835 | 72,282,835 | 0 | true | 2022-05-17T18:49:59.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update column from column from another table partially matched<p>I have two tables, the first table is called <code>IM_ITEM</code> and has the following colu... |
72,278,461 | Android get current datetime and search in Firestore<p><a href="https://i.stack.imgur.com/PYR6x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PYR6x.png" alt="enter image description here" /></a></p>
<p>The above is my firestore database. Now I would like to perform a search to check whether I have ... | <p>The problem is in the query you send to the database:</p>
<pre><code>Query query = doc1.whereEqualTo("userId", user.getStudentID())
.whereEqualTo("timeStamp", "18/5/2022");
</code></pre>
<p>This code compares the date/<code>Timestamp</code> that you store in the database with a ... | Android get current datetime and search in Firestore | java|android|date|google-cloud-firestore | 0 | 63 | 1 | 72,282,976 | 72,282,976 | 0 | true | 2022-05-17T17:40:37.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android get current datetime and search in Firestore<p><a href="https://i.stack.imgur.com/PYR6x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... |
72,281,614 | CMake targets file adds weird suffix to linked libraries<p>I have a project <code>Foo</code> that links libraries <code>curl</code>, <code>threads</code> and <code>jsoncpp</code>. I build <code>Foo</code> and it generates a <code>FooTargets.cmake</code> targets file, that I can use in my project <code>Bar</code> to lin... | <p>This was happening with CMake version 3.16.3. Newer versions of CMake don't seem to have that problem, which explains why the CI was fine.</p> | CMake targets file adds weird suffix to linked libraries | cmake | 0 | 63 | 2 | 72,284,545 | 72,284,545 | 0 | true | 2022-05-17T23:10:23.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CMake targets file adds weird suffix to linked libraries<p>I have a project <code>Foo</code> that links libraries <code>curl</code>, <code>threads</code> and... |
72,284,633 | How to send custom value to sweetalert javascript code from PHP?<p>I want to warn user on attempting to delete a file. how can I transfer some details via the <code>html button</code> to this javascript ? for example, each time the user will be deleting different files, so the button should sent different file id to th... | <p>Add <code>data-fileId</code> attribute to your button and when you click to button, get clicked buttons 'data-fileId'. it should be like this</p>
<p>html:</p>
<pre><code><button type="button" class="btn btn-primary" id="custom-sa-warning" data-fileId="write your fileId">... | How to send custom value to sweetalert javascript code from PHP? | javascript|html|sweetalert2 | 0 | 63 | 1 | 72,284,764 | 72,284,764 | 0 | true | 2022-05-18T07:11:14.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send custom value to sweetalert javascript code from PHP?<p>I want to warn user on attempting to delete a file. how can I transfer some details via th... |
72,287,622 | Hibernate subquery problem with aggregate function<p>I'm trying to run this query within Hibernate (through JPA) but it throws</p>
<p>Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: ( near line 1, column 32</p>
<p>Any way to make this work or make it... | <p>With HQL queries, Hibernate ORM doesn't support subqueries in the FROM clause (you can use them in the WHERE clause).</p>
<p>If you cannot rewrite this query as HQL without the subquery (for performance reasons, for example), I think it's OK to run it on the db as a native SQL query:</p>
<pre><code>String sqlQuery =... | Hibernate subquery problem with aggregate function | java|sql|hibernate|optimization | 0 | 63 | 1 | 72,289,544 | 72,289,544 | 0 | true | 2022-05-18T10:39:30.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hibernate subquery problem with aggregate function<p>I'm trying to run this query within Hibernate (through JPA) but it throws</p>
<p>Caused by: java.lang.Il... |
72,299,886 | Chart.js 3.7 version. How to modify legend label?<p>i am trying to edit it in the labels:{}, but only color is changing but not the text
do let me know if there is a way
plugins: {</p>
<pre><code> legend: {
display: true,
position: 'top',
labels: {
text: "... | <p>You will need to use a custom generateLabels function for this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var options = {
type: 'line',
data: {
labels: ["Red",... | Chart.js 3.7 version. How to modify legend label? | javascript|jquery|ajax|chart.js | 1 | 63 | 1 | 72,300,212 | 72,300,212 | 0 | true | 2022-05-19T06:53:08.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Chart.js 3.7 version. How to modify legend label?<p>i am trying to edit it in the labels:{}, but only color is changing but not the text
do let me know if th... |
72,302,801 | I'm writing my first ever java program and it's not compiling for a certain reason<p>This is the code i have tried running</p>
<pre><code> public class main
{
public static void main(String[] args)
{
System.out.println("Hello, world!");
}
}
</code></pre>
<p>and it gives me this error:</... | <p>basically the compiler tells you whats wrong. It says, "class main is public, should be declared in a file named main.java".
Java has a naming rule, that a class inside a java file needs to match that file name.
Example 1:</p>
<p>Filename -> File.java</p>
<p>inside that file:</p>
<pre><code>public class... | I'm writing my first ever java program and it's not compiling for a certain reason | java|visual-studio-code|compiler-errors | -4 | 63 | 2 | 72,302,850 | 72,302,850 | 0 | true | 2022-05-19T10:18:12.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm writing my first ever java program and it's not compiling for a certain reason<p>This is the code i have tried running</p>
<pre><code> public class ma... |
72,315,753 | Create list of arrays that contain specific element<p>I need to create a function that searches if certain string is within an array and create a list with all the elements (lists) that contain it. For example:</p>
<pre><code>word = 'busy'
array = [[['99', 'Normal', [], ['busy', '0'], 28016.2, 'working', '1']],[['F27',... | <p>Try This</p>
<pre class="lang-py prettyprint-override"><code>word = 'busy'
array = [[['99', 'Normal', [], ['busy', '0'], 28016.2, 'working', '1']],
[['F27', 'Normal', [], ['free', '0'], 28016.537865230806, 'working', '1']]]
def searchBusyWorkers(array,word):
out = []
for a in array:
for i in a:
... | Create list of arrays that contain specific element | python|arrays | 3 | 63 | 4 | 72,315,860 | 72,315,860 | 0 | true | 2022-05-20T08:25:04.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create list of arrays that contain specific element<p>I need to create a function that searches if certain string is within an array and create a list with a... |
72,317,260 | How to download only the selected columns in a dataframe using Colvis from DT in Shiny?<p>I am using the button <code>colvis</code> from the <code>DT</code> package to select which columns I would like to show in the table. Here you have more <a href="https://rstudio.github.io/DT/extensions.html" rel="nofollow noreferr... | <p>Thanks to Stéphane Laurent's answer, I managed to find an answer.</p>
<p>I had some problems to have both buttons (csv and excel) and how to organise the lists with the proposed solution, but I found the way to do it.</p>
<p>I will add the answer with the original code just in case someone has problems like me.</p>
... | How to download only the selected columns in a dataframe using Colvis from DT in Shiny? | r|shiny|dt | 0 | 63 | 2 | 72,317,895 | 72,317,895 | 0 | true | 2022-05-20T10:19:26.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to download only the selected columns in a dataframe using Colvis from DT in Shiny?<p>I am using the button <code>colvis</code> from the <code>DT</code> ... |
72,301,651 | mysql FIND_IN_SET vs REGEXP performance<p>I am writing a question because I have a question while using mysql.</p>
<p>I know it's structurally wrong.
However, it is difficult to change because a lot of data and code have already been written.</p>
<p>I put multiple data in one column using typeorm set.</p>
<p>'A,B,C,D' ... | <p>Either formulation must check every row in the table; no <code>INDEX</code> is helpful. The primary cost is fetching the rows. The expression evaluation is secondary. I don't know which is faster, but I would expect the difference (for the whole query) to be under 10%, hence not worth worrying about.</p>
<p>What ... | mysql FIND_IN_SET vs REGEXP performance | mysql|regex | 0 | 63 | 1 | 72,327,280 | 72,327,280 | 0 | true | 2022-05-19T09:05:01.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mysql FIND_IN_SET vs REGEXP performance<p>I am writing a question because I have a question while using mysql.</p>
<p>I know it's structurally wrong.
However... |
72,330,141 | Jquery remove all inputs with same class except one<p>I want to remove all input labels with same class except one in div <code>#tikersDiv</code>.
I got this script but it doesn't work:</p>
<pre><code> $('#tikersDiv').children('label').each(function(i){
let removed = $('#id_' + (++i)).children('label').each(function... | <p>Ok, I've got this. If anybody want to remove all child elements with same class except one in div, just use this script. I hope I will help somebody</p>
<pre><code>var classes = $('#tikersDiv label').map(function(){
return $(this).attr('class');
}).get();
$.each(classes, function(value, index){
$('#tik... | Jquery remove all inputs with same class except one | javascript|html|jquery|input|removechild | 1 | 63 | 1 | 72,330,920 | 72,330,920 | 0 | true | 2022-05-21T13:47:55.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery remove all inputs with same class except one<p>I want to remove all input labels with same class except one in div <code>#tikersDiv</code>.
I got this... |
72,329,894 | How to use results from list widget in another class?<p>I am new to object oriented programming and need assistance getting the value from a listwidget in one class to another class. I have one listwidget called selectedVariables in the MainWindow class. I want the SecondWindow class to be able to get the variables fro... | <p>If you want to <em>copy</em> items, then you should use the <a href="https://doc.qt.io/qt-5/qlistwidgetitem.html#clone" rel="nofollow noreferrer"><code>clone()</code></a> function of QListWidgetItem.</p>
<p>Note that you should do the same also in <code>add_variable</code>: while your case is very simple, <em>clonin... | How to use results from list widget in another class? | python|pyqt5|qlistwidget | 0 | 63 | 2 | 72,332,271 | 72,332,271 | 0 | true | 2022-05-21T13:12:13.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use results from list widget in another class?<p>I am new to object oriented programming and need assistance getting the value from a listwidget in on... |
72,337,366 | Python-Matplotlib Plotting with infiniite f(x) values<p>I am trying to graph the tan function in matplotlib.
The <code>tan</code> function goes to infinity when the value inserted is <code>pi/2</code>. The problem is that I dont know how to deal with infinite numbers in Matplotlib or in turn, infinitly small ranges to... | <h2>How to plot a discontinuous function</h2>
<pre class="lang-py prettyprint-override"><code>import numpy as np
from numpy import pi, nan
import matplotlib.pyplot as plt
start, stop, num, eps = -5, 5, 200, 0.003
data = np.linspace(start, stop, num)
shift = (data + pi/2) % pi
data = data[(eps < shift) & (shift... | Python-Matplotlib Plotting with infiniite f(x) values | python|matplotlib | 2 | 63 | 1 | 72,340,637 | 72,340,637 | 0 | true | 2022-05-22T11:56:21.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python-Matplotlib Plotting with infiniite f(x) values<p>I am trying to graph the tan function in matplotlib.
The <code>tan</code> function goes to infinity w... |
72,331,893 | pubsub message is getting delivered even after configuring dead letter topic<p>I have a topic <code>topicA</code> with <code>deadLetterTopicA</code> associated with the subscription <code>subscriptionA</code> for the topic <code>topicA</code>.
Below is the configuration of the subscription <code>subscriptionA</code></p... | <p>The most likely scenario is that you didn't <a href="https://cloud.google.com/pubsub/docs/handling-failures#grant_forwarding_permissions" rel="nofollow noreferrer">grant forwarding permissions</a> to the Pub/Sub service account. You need to give the account <code>service-<project number>@gcp-sa-pubsub.iam.gser... | pubsub message is getting delivered even after configuring dead letter topic | publish-subscribe|google-cloud-pubsub | 0 | 63 | 1 | 72,351,757 | 72,351,757 | 0 | true | 2022-05-21T17:38:48.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pubsub message is getting delivered even after configuring dead letter topic<p>I have a topic <code>topicA</code> with <code>deadLetterTopicA</code> associat... |
72,358,550 | What is best practice for filtering a map in React JSX return<p>When returning the below in a component to render cards where would you put a filter on something like this?</p>
<pre><code> {state.messages.map((message, index) => (
<div key={index}>
<Center>
<Box
... | <p>Your approach is the best approach.</p>
<p>Firstly, <code>filter</code> and <code>map</code> is the clearest functions to use.</p>
<p>Secondly, it's better to use <code>filter</code> before <code>map</code> for two reasons:</p>
<ul>
<li>By removing unwanted items before mapping them, you save computations as you don... | What is best practice for filtering a map in React JSX return | reactjs | 2 | 63 | 2 | 72,358,955 | 72,358,955 | 0 | true | 2022-05-24T07:06:14.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is best practice for filtering a map in React JSX return<p>When returning the below in a component to render cards where would you put a filter on somet... |
72,361,364 | Insert data in a different table sql/ php<p>Could you please help me
i have two different tables</p>
<p><strong>table tbl_users:</strong></p>
<pre><code>CREATE TABLE `tbl_users` (
`id` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`prenom` varchar(255) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
... | <p>In your register.php, it would be way more practical to have the ids of the jobs as values instead of having the names of the jobs. Then you can just plug that number in the insert just like you're plugging in name and everything else. You can surround your input with labels instead of putting the names of the jobs ... | Insert data in a different table sql/ php | php|mysql | 0 | 63 | 1 | 72,361,645 | 72,361,645 | 0 | true | 2022-05-24T10:33:12.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Insert data in a different table sql/ php<p>Could you please help me
i have two different tables</p>
<p><strong>table tbl_users:</strong></p>
<pre><code>CREA... |
72,330,284 | table association not created One-To-Many sequelize node<p>I was creating associations for my database. But she did not create all the associations, for example, she did not link the contracts with the payroll. I tried the options from the database, but they did not help. Tell me what I can try to do and what I'm doing... | <p>You have incompatible primary key types in <code>Contracts</code> and <code>Payrolls</code>:<br />
<strong>Contracts</strong></p>
<pre class="lang-js prettyprint-override"><code> id: {
type: DataTypes.STRING,
allowNull: false,
primaryKey: true,
autoIncrement: fa... | table association not created One-To-Many sequelize node | node.js|postgresql|sequelize.js | 1 | 63 | 2 | 72,366,907 | 72,366,907 | 0 | true | 2022-05-21T14:04:51.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
table association not created One-To-Many sequelize node<p>I was creating associations for my database. But she did not create all the associations, for exam... |
72,370,765 | R chr data type to Date and Time with AM<p>In my table (over 12K lines), I have a Column named Sleep Day that comes in a chr type data with the following info template: 4/12/2016 12:00:00 AM</p>
<p>I tried to convert the chr to Date and time type, but it only shows the Date...</p>
<p>Here is my function (table´s name: ... | <p>You can use the <code>lubridate</code> package:</p>
<pre><code>lubridate::mdy_hms("4/12/2016 12:00:00 AM")
lubridate::mdy_hms("4/12/2016 12:00:01 AM")
</code></pre>
<p>But there is a gotcha that is unrelated to your conversion method. If the time is exactly midnight, then R will usually print ju... | R chr data type to Date and Time with AM | r | 2 | 63 | 1 | 72,370,913 | 72,370,913 | 0 | true | 2022-05-25T00:21:34.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R chr data type to Date and Time with AM<p>In my table (over 12K lines), I have a Column named Sleep Day that comes in a chr type data with the following inf... |
72,378,197 | Navigate to nested screen react native<p>I have a bottom tab navigator like so:</p>
<pre><code>const Tab = BottomTabNavigator()
const BottomTab = () => (
<Tab.Navigator>
<Tab.Screen name = "Feed" component = {FeedNavigator}/>
<Tab.Screen name = "Profile" component = {Pr... | <p>navigation.navigate('Feed', { screen: 'Food', params: { user: 'jane'},
});</p> | Navigate to nested screen react native | reactjs|react-native|react-navigation|react-navigation-stack|react-navigation-bottom-tab | 0 | 63 | 2 | 72,378,386 | 72,378,386 | 0 | true | 2022-05-25T13:03:59.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Navigate to nested screen react native<p>I have a bottom tab navigator like so:</p>
<pre><code>const Tab = BottomTabNavigator()
const BottomTab = () => (... |
72,379,902 | How to plot two different distributions in one graph in R?<p>I want to plot two empirical distributions in one Graph to explain the kolmogorov-smirnov Test in my paper.<br />
One ecdf with steps from a sample and one continuous distribution.<br />
So the sample could be:<br />
x = c(12.4,11.8,12.9,12.6,13,12.5,12,11.5,... | <p>another minimalist way:</p>
<pre><code>my_observations = c(12.4,11.8,12.9,12.6,13,12.5,12,11.5,13.2,12.8)
my_ecdf <- ecdf(my_observations)
curve(my_ecdf(x),
from = 10, to = 14,
frame = FALSE ## don't plot border
)
curve(pnorm(x, mean = 12),
from = 10, to = 14,
add = TRUE ## add to ... | How to plot two different distributions in one graph in R? | r|ggplot2|plot|kolmogorov-smirnov | 0 | 63 | 2 | 72,380,598 | 72,380,598 | 0 | true | 2022-05-25T14:52:51.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to plot two different distributions in one graph in R?<p>I want to plot two empirical distributions in one Graph to explain the kolmogorov-smirnov Test i... |
72,354,918 | Flask SqlAlchemy DB2 SQLALCHEMY_DATABASE_URI<p>i'm trying to figure out the Uri string to connect correctly to db2 using flask with SqlAlchemy.</p>
<p>I've tried with</p>
<blockquote>
<ul>
<li>db2:///?Server=server&;Port=50000&User=admin&Password=admin&Database=test"</li>
<li>'ibm_db_sa+pyodbc400:/... | <p>Just for the record the correct format (at least for me) is</p>
<pre><code>ibm_db_sa://{username}:{password}@{host}:{port}/{database}
</code></pre>
<p>Also you need a few libraries to install via pip in order to work with alembic+flask</p>
<ul>
<li>ibm_db</li>
<li>ibm_db_sa</li>
<li>ibm_db_alembic (<a href="https://... | Flask SqlAlchemy DB2 SQLALCHEMY_DATABASE_URI | flask-sqlalchemy | 0 | 63 | 1 | 72,384,223 | 72,384,223 | 0 | true | 2022-05-23T21:20:43.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flask SqlAlchemy DB2 SQLALCHEMY_DATABASE_URI<p>i'm trying to figure out the Uri string to connect correctly to db2 using flask with SqlAlchemy.</p>
<p>I've t... |
72,386,053 | Using a Bubble Sort Algorithm, Sort an arrayList of objects alphabetically<p>Basically I have a student class that reads a textile which takes in the name, age and student number. I have all this stored in an arraylist with the class.</p>
<pre><code> //method for ordering student accounts by last name (bubble sort) al... | <p>Please try this one:</p>
<pre><code>import java.util.ArrayList;
import java.util.List;
public class BubbleSortAlph {
public static void alphabetOrder(List<Student> users) {
int k = 0;
boolean exchangeMade = true;
while ((k < users.size() - 1) && exchangeMade) {
... | Using a Bubble Sort Algorithm, Sort an arrayList of objects alphabetically | java|arraylist|bubble-sort | 1 | 63 | 1 | 72,390,454 | 72,390,454 | 0 | true | 2022-05-26T02:29:27.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using a Bubble Sort Algorithm, Sort an arrayList of objects alphabetically<p>Basically I have a student class that reads a textile which takes in the name, a... |
72,395,389 | How to reduce loop with same condition<p>how to use only one loop with the same condition</p>
<p>thank you</p>
<p>"<" is remove the lastest character in the string</p>
<p>answer: check 2 two strings are equal.</p>
<p>Ex.
String[] a = ["a","<","b"]</p>
<p>"a"</p>... | <p>If your String arrays are of same size you can remove the two if statements:</p>
<pre><code> public static boolean Isequal(String[] input1,String[] input2)
{
StringBuilder sb = new StringBuilder();
StringBuilder sb1 = new StringBuilder();
int i=0,j=0;
int m = input1.length;
int n = input2.length;... | How to reduce loop with same condition | java | 1 | 63 | 1 | 72,396,345 | 72,396,345 | 0 | true | 2022-05-26T16:54:44.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce loop with same condition<p>how to use only one loop with the same condition</p>
<p>thank you</p>
<p>"<" is remove the lastest cha... |
72,399,704 | Is there a performance impact to re-using the same port repeatedly for all connections?<p>The standard for WebSockets/HTTPS is port 443 and every single client around the world connects on server port 443. This confused me at first because I was imagining all traffic flowing through a single entity and it would be an i... | <blockquote>
<p>My question is whether there is any performance difference at all to
having all traffic go to a single port on the server. To properly
de-multiplex incoming traffic to a socket, more information must be
needed (maybe the client hostname/port?).</p>
</blockquote>
<p>Assuming all the traffic is going to t... | Is there a performance impact to re-using the same port repeatedly for all connections? | sockets|networking|port|ipc | 0 | 63 | 1 | 72,399,904 | 72,399,904 | 0 | true | 2022-05-27T02:00:43.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a performance impact to re-using the same port repeatedly for all connections?<p>The standard for WebSockets/HTTPS is port 443 and every single clie... |
72,400,037 | ValueError when loading model that uses lambda resize layer in keras<p>So basically, I trained a model with a resize layer. Here is my model:</p>
<pre><code>model = Sequential()
model.add(keras.layers.Lambda(
lambda image: tf.image.resize(
image,
(470,470),
method = tf.image.ResizeMethod.BIC... | <p>To anyone that has this issue in the future, instead of using a lambda layer, use a keras resizing layer. Also the h5 file that wouldn't load still works on huggingface.</p> | ValueError when loading model that uses lambda resize layer in keras | python|tensorflow|machine-learning|keras|computer-vision | 0 | 63 | 1 | 72,426,332 | 72,426,332 | 0 | true | 2022-05-27T03:07:57.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ValueError when loading model that uses lambda resize layer in keras<p>So basically, I trained a model with a resize layer. Here is my model:</p>
<pre><code>... |
72,305,707 | setSlicerState() with Tuple slicer not working/supported? "filters property is invalid"<p>I can't seem to find a solid answer anywhere if setSlicerFilter() method in javascript for power bi embedded reports supports filterType 6 (tuple) - one post suggests it does not but nothing official.</p>
<p>setSlicerState() is wo... | <p>Currently the out-of-the-box hierarchy and tuple slicers aren't supported with powerbi-client.</p>
<p><strong>Reference:</strong></p>
<p><a href="https://docs.microsoft.com/javascript/api/overview/powerbi/control-report-slicers#limitations" rel="nofollow noreferrer">Use slicers when embedding a report in Power BI em... | setSlicerState() with Tuple slicer not working/supported? "filters property is invalid" | powerbi|powerbi-embedded | 0 | 63 | 1 | 72,473,773 | 72,473,773 | 0 | true | 2022-05-19T13:45:05.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
setSlicerState() with Tuple slicer not working/supported? "filters property is invalid"<p>I can't seem to find a solid answer anywhere if setSlicerFilter() m... |
72,288,527 | How to loop a model with it's belongsToMany relation in a table? Laravel Blade<p>I want to loop my Packages in a table (each Package has belongsToMany relation with Test Model)& I don't know how to loop in my blade?</p>
<pre><code>public function tests()
{
return $this->belongsToMany('App\Models\Test');
}
</cod... | <p>i create my table in this way via checking the relations:</p>
<pre><code><table>
<thead>
<tr>
<th class="tr" width="150"></th>
@foreach ($data['packages'] as $item)
<th>{{$item->title}}</th>
... | How to loop a model with it's belongsToMany relation in a table? Laravel Blade | php|laravel|laravel-8|laravel-blade | 0 | 63 | 2 | 72,492,915 | 72,492,915 | 0 | true | 2022-05-18T11:40:42.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to loop a model with it's belongsToMany relation in a table? Laravel Blade<p>I want to loop my Packages in a table (each Package has belongsToMany relati... |
72,348,858 | PwSh RegEx capture Version information - omit (surrounding) x(32|64|86) & 32|64(-)Bit<p>I'm pulling my hair, to RegEx-tract the bare version information from some filenames.
e.g. "1.2.3.4"</p>
<p>Let's assume, I have the following Filenames:</p>
<pre><code>VendorSetup-x64-1.23.4.exe
VendorSetup-1-2-3-4.exe
Ve... | <p>This could be done using a single pattern, but by splitting it up into two separate patterns and let PowerShell do some of the work, the overall solution can be much easier.</p>
<p><strong>Pattern 1</strong> matches version numbers that are separated by <code>.</code> (dot):</p>
<pre class="lang-text prettyprint-ove... | PwSh RegEx capture Version information - omit (surrounding) x(32|64|86) & 32|64(-)Bit | regex|powershell | 0 | 63 | 1 | 72,349,116 | 72,349,116 | 0 | true | 2022-05-23T12:54:32.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PwSh RegEx capture Version information - omit (surrounding) x(32|64|86) & 32|64(-)Bit<p>I'm pulling my hair, to RegEx-tract the bare version information from... |
72,357,329 | Get monday of the currentweek with linux date<p>I am writing a bash script and I need the date of the Monday of the current week.</p>
<pre><code>date -d monday
</code></pre>
<p>returns the correct date if it is Monday. And</p>
<pre><code>date -d last-monday
</code></pre>
<p>returns the correct date at Tuesday until Sun... | <pre><code>date -d "next-monday - 7 days"
date -d "$(($(date +%u) -1)) days ago"
# today
date +%Y%m%d
20220524
# Monday
$ date -d "next-monday - 7 days" +%Y%m%d
20220523
# or
$ date -d "$(($(date +%u) -1)) days ago" +%Y%m%d
20220523
</code></pre> | Get monday of the currentweek with linux date | bash|date | 0 | 63 | 2 | 72,357,891 | 72,357,891 | 0 | true | 2022-05-24T04:49:18.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get monday of the currentweek with linux date<p>I am writing a bash script and I need the date of the Monday of the current week.</p>
<pre><code>date -d mond... |
72,257,864 | How to prevent references from a constructed object back into a blueprint like source object which got assigned to the former target structure?<p>This is an example from a Pokemon-like game. I am constructing an Object, and inside it i am trying to make a new Object "en" and "to", that is two differ... | <p>Apparently the OP has/had problems with two of the design choices.</p>
<p><code>player1.push(Object.assign(temp1, randomFakemon()));</code> ... picks a random true <code>Fakemon</code> instance from the OP's fakemon collection.</p>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_... | How to prevent references from a constructed object back into a blueprint like source object which got assigned to the former target structure? | javascript|reference|clone|factory|deep-copy | 0 | 63 | 1 | 72,262,580 | 72,262,580 | 0 | true | 2022-05-16T10:36:11.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to prevent references from a constructed object back into a blueprint like source object which got assigned to the former target structure?<p>This is an ... |
72,368,338 | How can i find camera location in a stereo camera setup in python?<p>I tring to reconstruct a scene using a stereo setup and opencv. I managed to calibrate the setup and the DLT seens to work fine. I want to plot the camera position, but i having troubles. I use to think that the origin of the coord system is the image... | <p>In general camera 1 location does not <em>need</em> to be in (0,0,0) but it is usually a convention.</p>
<p>For each camera, the formula to get the camera location is:</p>
<pre><code>C = - transpose(R) . t
</code></pre>
<p>where R is the rotation matrix of that camera and t is its translation vector. It works even i... | How can i find camera location in a stereo camera setup in python? | python|opencv|camera-calibration|stereo-3d|dlt | 0 | 63 | 2 | 72,423,106 | 72,423,106 | 0 | true | 2022-05-24T19:16:30.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i find camera location in a stereo camera setup in python?<p>I tring to reconstruct a scene using a stereo setup and opencv. I managed to calibrate t... |
72,321,892 | Plotting p-value/significance symbol in between group<p>Apart from the p-value that I got from running general ANOVA (p=0.034*), which is significant and manually annotated in my bar chart. I would also like to find and include the p-values/ significance symbols within the factors ("Normal" and "High lig... | <p>Apparently, "stat_compare_means" will require the full data of the groupings in order to provide any meaningful statistical test (credit to Adam Quek for the advice). Hence, I will have to refer my raw data (annotated as "Exp1") in the "stat_compare_means" function, rather than using th... | Plotting p-value/significance symbol in between group | r|ggplot2|statistics|bar-chart|p-value | 0 | 63 | 1 | 72,425,995 | 72,425,995 | 0 | true | 2022-05-20T16:10:19.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting p-value/significance symbol in between group<p>Apart from the p-value that I got from running general ANOVA (p=0.034*), which is significant and man... |
72,391,949 | Angular input's ngModel and Value don't work together<p>I have a problem with the form in angular. My goal is to make a form that is filled with default values that can be changed. After validating the form, it sends the data to the MySQL database.</p>
<p>This is component.html code:</p>
<pre><code><form #adopt=&q... | <p>first: you are binding <code>adoptions.email</code> and <code>adoptions.animal</code> to <code>ngModel</code>, but they are empty(or even worse - <code>null</code> or <code>undefined</code>) when <code>ngOnInit</code> is fired, that is why your inputs are empty. They get value once you introduce text in inputs, that... | Angular input's ngModel and Value don't work together | html|mysql|angular|typescript | 0 | 63 | 1 | 72,392,455 | 72,392,455 | 0 | true | 2022-05-26T12:38:24.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular input's ngModel and Value don't work together<p>I have a problem with the form in angular. My goal is to make a form that is filled with default valu... |
72,285,363 | how to show the lists based on the switch case in angular<p>I need to show the dropdown lists based on the selected value from the first dropdown</p>
<p><strong>.constant.ts</strong></p>
<pre><code>export const recordConstant = {
memberContact: 'Member Contact',
about: 'About',
other: 'Other',
standarAc... | <p>Try this, not sure this is what you expect.</p>
<p><strong>.component.html</strong></p>
<pre><code> <label for="optionsList" class="cpp-required"> <b>Category</b></label>
<select class="form-control" required (change)="setActionList($event.target.value)&... | how to show the lists based on the switch case in angular | javascript|angular|typescript|switch-statement | 1 | 63 | 1 | 72,286,094 | 72,286,094 | 0 | true | 2022-05-18T08:05:48.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to show the lists based on the switch case in angular<p>I need to show the dropdown lists based on the selected value from the first dropdown</p>
<p><str... |
72,344,334 | Assign Future<var> to var<p>I have some code written in dart where I use the provider package to update the location of a pin on a map. What I would like it to do is have the initial location be equal to the user's current position and then if they drag the pin it will be updated to wherever the pin is dropped.</p>
<p>... | <p>You can simply have a method for that in provider file</p>
<pre class="lang-dart prettyprint-override"><code>class LocationProvider with ChangeNotifier {
LatLng? _location;
LatLng? get location => _location;
Future<void> initializeLocation() async {
_location = await LocationService().getLocati... | Assign Future<var> to var | flutter|dart|async-await | 0 | 63 | 2 | 72,344,766 | 72,344,766 | 0 | true | 2022-05-23T06:55:42.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign Future<var> to var<p>I have some code written in dart where I use the provider package to update the location of a pin on a map. What I would like it ... |
72,251,468 | Why does a while True loop not work in my rock paper scissors game?<p>I'm trying to make a rock paper scissors game with 3 buttons to click on on-screen with import turtle. That went well and it worked, the buttons worked and the right text showed up on screen when clicking a certain button. (I haven't added the comput... | <p>The "loop" for turtle needs no while loop - <code>turtle.done()</code> does not "end" the turtle code - it signals that you are "done" setting all up and <a href="https://docs.python.org/3/library/turtle.html#turtle.mainloop" rel="nofollow noreferrer">starts the everlasting turtle mainl... | Why does a while True loop not work in my rock paper scissors game? | python|while-loop|turtle-graphics|python-turtle | 0 | 63 | 1 | 72,251,838 | 72,251,838 | 0 | true | 2022-05-15T19:15:13.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does a while True loop not work in my rock paper scissors game?<p>I'm trying to make a rock paper scissors game with 3 buttons to click on on-screen with... |
72,353,212 | How do I redirect to a variable which contains the location of the output file<p>This is a very silly and simple thing that I am not sure how to do</p>
<p>I have defined a variable %debugloglocation% in a bat file which contains the location of the file in which I want the output to be written.</p>
<pre><code>SETLOCAL ... | <p><code>cmd</code>'s <code>set</code> does not want any spaces before or after the <code>=</code> This will result in a variable with a trailing space and value with a leading space i.e <code>set var = val</code> will result in <code>%var %</code> and <code> val</code></p>
<p>So always <code>set</code> string variable... | How do I redirect to a variable which contains the location of the output file | windows|batch-file | 0 | 63 | 2 | 72,353,657 | 72,353,657 | 0 | true | 2022-05-23T18:22:58.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I redirect to a variable which contains the location of the output file<p>This is a very silly and simple thing that I am not sure how to do</p>
<p>I ... |
72,240,029 | Python, updating variables manual while code running<p>I have a code that contains a variable that I want to change manually when I want without stopping the main loop neither pause it (with input()). I can't find a library that allows me to set manually in the run, or access the RAM memory to change that value.
for no... | <p>I guess you just want to expose API. You did it with files which works but less common. You can use common best practices such as:</p>
<ol>
<li>HTTP web-server. You can do it quickly with <a href="https://flask.palletsprojects.com/en/2.1.x/" rel="nofollow noreferrer">Flask</a>/<a href="https://bottlepy.org/docs/dev/... | Python, updating variables manual while code running | python|python-3.x | -1 | 63 | 1 | 72,240,216 | 72,240,216 | 1 | true | 2022-05-14T12:06:35.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python, updating variables manual while code running<p>I have a code that contains a variable that I want to change manually when I want without stopping the... |
72,243,484 | How can I detect long mouse clicks with tkinter?<p>I want to detect a long mouse click using tkinter.
How can I do that?
The <code><Button-1></code> doesn't help at all.</p> | <p>You can create a binding for both the button press (<code><ButtonPress-1></code>) and button release (<code><ButtonRelease-1></code>). Save the time that the press happened and then compute the delay when the release happened.</p>
<p>Or, depending on what you mean by "detect", you can schedule ... | How can I detect long mouse clicks with tkinter? | python|tkinter | 0 | 63 | 2 | 72,243,617 | 72,243,617 | 1 | true | 2022-05-14T20:00:03.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I detect long mouse clicks with tkinter?<p>I want to detect a long mouse click using tkinter.
How can I do that?
The <code><Button-1></code> do... |
72,244,542 | Using numpy.where function with multiple conditions but getting valueError<p>So I have a dataframe with multiple columns with numbers in them. It looks like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>H</th>
<th>C</th>
<th>T</th>
<th>P</th>
<th>R</th>
</tr>
</thead>
<tbody>
<tr>
<... | <p>You should use bitwise <code>&</code> and parantheses, rather than <code>and</code>.</p>
<pre><code>df['R'] = numpy.where((df['H'] > df['T']) & (df['P'] > 0),
df['C'] / df['T'] - 1, 0)
</code></pre> | Using numpy.where function with multiple conditions but getting valueError | python|pandas|numpy | 1 | 63 | 2 | 72,244,603 | 72,244,603 | 1 | true | 2022-05-14T23:34:40.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using numpy.where function with multiple conditions but getting valueError<p>So I have a dataframe with multiple columns with numbers in them. It looks like ... |
72,250,122 | Pandas: Comma Separated Excel Cells not Converting to List<p>I've joined 3 Excel tab data sets to give me my base dataframe, and then for each line I want to count the int values in the comma separated values in DUAlloc and divide Amount by the DUAlloc Count then loop through the DuAlloc list and assign individual line... | <p>Use <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.str.split.html" rel="nofollow noreferrer"><code>Series.str.split</code></a>, <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.explode.html" rel="nofollow noreferrer"><code>df.explode</code></a>, <a href="https://pandas.pyda... | Pandas: Comma Separated Excel Cells not Converting to List | python|pandas | 0 | 63 | 2 | 72,250,181 | 72,250,181 | 1 | true | 2022-05-15T16:23:39.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: Comma Separated Excel Cells not Converting to List<p>I've joined 3 Excel tab data sets to give me my base dataframe, and then for each line I want to... |
72,255,948 | Displaying modified PDF page in PDF View without saving locally<p>I am using the following code to write a text on a PDF. I need to display the modified PDF page using PDFView.I cannot find a way to display the modified PDF page on the PDF View without saving the modified PDF locally and loading it from disc. Is there ... | <p>You can create a <code>PDFDocument</code> from <code>Data</code>. Use <code>.dataRepresentation()</code> on your PDFDocument to get the data, and <code>PDFDocument(data: )</code> to create the PDFDocument from the data.</p>
<pre><code>let data = myPDFDocument.dataRepresentation()
let anotherDocument = PDFDocument(da... | Displaying modified PDF page in PDF View without saving locally | swift|macos|cocoa|pdfkit|cgcontext | 0 | 63 | 1 | 72,256,083 | 72,256,083 | 1 | true | 2022-05-16T08:05:22.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Displaying modified PDF page in PDF View without saving locally<p>I am using the following code to write a text on a PDF. I need to display the modified PDF ... |
72,254,670 | Add to cart button not working, Selenium C# element not interactable<p>I am automating below website, Add to cart button is not working:
<a href="http://automationpractice.com" rel="nofollow noreferrer">http://automationpractice.com</a></p>
<p>Please use below id pass to login:
ID : paul@xmail.com
Password : Pa... | <p>You can use action method to do it, I checked the below in <code>Java</code> and it's working for me.</p>
<pre><code>Actions action = new Actions(driver);
element = driver.FindElement(By.Xpath("//img[@title='Faded Short Sleeve T-shirts']"))
action.moveToElement(element).perform();
ele = driver.FindEleme... | Add to cart button not working, Selenium C# element not interactable | c#|selenium|automation | 0 | 63 | 1 | 72,257,444 | 72,257,444 | 1 | true | 2022-05-16T05:55:46.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add to cart button not working, Selenium C# element not interactable<p>I am automating below website, Add to cart button is not working:
<a href="http://auto... |
72,258,726 | Return a list of items and read it<p>I have a function that contains a list that gets called externally. I want to find objects that is containing within the list through the object's name. I would like to get the object's property like component it contains. How do I do this?</p>
<pre><code>public string nameOfObj;
vo... | <p>You could do this using a Where function.</p>
<pre><code>using System.Linq;
List<GameObject> objectsToSearch = new List<GameObject>();
public List<GameObject> GetObjects(string obj){
return objectsToSearch.Where(a => a.nameOfObj == obj).ToList();
}
</code></pre>
<p>As a warning, this will ... | Return a list of items and read it | c#|unity3d | 0 | 63 | 1 | 72,258,958 | 72,258,958 | 1 | true | 2022-05-16T11:48:11.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return a list of items and read it<p>I have a function that contains a list that gets called externally. I want to find objects that is containing within the... |
72,249,507 | Message bus best practices to send updates<p>I would like to understand what are the best practices when using a message bus to update several services.</p>
<p>The basic show case is to send the full object through the bus and everyone listening can immediately get the data and process it.</p>
<p>Other option is to sen... | <p>Design is always about tradeoff between options.</p>
<p>Option-1: This is preferred and simple to implement and truly decouple from producer. If require compression can be enable to reduce the size, though compression can slightly reduce the overall throughput.
This approach will require more disk space and applic... | Message bus best practices to send updates | apache-kafka|rabbitmq|messaging | 0 | 63 | 1 | 72,261,577 | 72,261,577 | 1 | true | 2022-05-15T15:06:49.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Message bus best practices to send updates<p>I would like to understand what are the best practices when using a message bus to update several services.</p>
... |
72,263,814 | Compare two columns and leave only the values that don't match<p>Question is pretty self explanatory. I have two columns (num1, num2) and I just want to return the values that do not match (and not the others):</p>
<p><a href="https://i.stack.imgur.com/lTj09.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>use:</p>
<pre><code>=FILTER(FLATTEN(A2:B), COUNTIFS(FLATTEN(A2:B), FLATTEN(A2:B))=1)
</code></pre>
<p><a href="https://i.stack.imgur.com/nWkFU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nWkFU.png" alt="enter image description here" /></a></p>
<p>or if you want it sorted:</p>
<pre><code>=SORT(... | Compare two columns and leave only the values that don't match | google-sheets|filter|count|duplicates|flatten | 1 | 63 | 2 | 72,265,788 | 72,265,788 | 1 | true | 2022-05-16T18:16:06.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare two columns and leave only the values that don't match<p>Question is pretty self explanatory. I have two columns (num1, num2) and I just want to retu... |
72,266,145 | Type narrowing for Partial doesn't seem to work<p>I have a fairly simple class named <code>Animal</code>. It can take, as a constructor argument, a plain object with matching property names/types:</p>
<pre class="lang-js prettyprint-override"><code>class Animal {
kingdom:string;
species:string;
constructor(confi... | <p>Unfortunately I don't think you can get TypeScript to narrow that variable when you reuse it in that way. However there are other constructions which will remove the error, here are a few:</p>
<hr />
<ul>
<li>Add your manual cast on the <code>push</code> line.</li>
</ul>
<p>This works since this line is where the ty... | Type narrowing for Partial doesn't seem to work | typescript | 0 | 63 | 2 | 72,266,376 | 72,266,376 | 1 | true | 2022-05-16T22:09:16.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type narrowing for Partial doesn't seem to work<p>I have a fairly simple class named <code>Animal</code>. It can take, as a constructor argument, a plain obj... |
72,269,444 | PostgreSQL: Using CTE with IN<p>Learning CTE right now, the following query is super basic and it doesn't really have any useful value but I don't understand why it doesn't work</p>
<pre><code>with cte_actors as (
select first_name from actor where first_name like 'P%' or first_name like 'E%'
)
select
first_na... | <p>You need to SELECT from the CTE:</p>
<pre><code>with cte_actors as (
select first_name
from actor
where first_name like 'P%' or first_name like 'E%'
)
select first_name
from actor
where first_name in (select first_name from cte_actors)
</code></pre> | PostgreSQL: Using CTE with IN | sql|postgresql|common-table-expression|dbeaver | 2 | 63 | 1 | 72,269,481 | 72,269,481 | 1 | true | 2022-05-17T06:59:50.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PostgreSQL: Using CTE with IN<p>Learning CTE right now, the following query is super basic and it doesn't really have any useful value but I don't understand... |
72,271,341 | C# Close window when process is started<p>i have a WPF window which should close when the process "TeamViewer" is started.</p>
<p>Unfortunately I can't manage to build a suitable loop. Can you help me?</p>
<pre><code> private void Window_Loaded(object sender, RoutedEventArgs e)
{
Process[] pname ... | <p>You should look for the process "TeamViewer" inside a loop, and on finding any instance of it, you can exit your form.
Example code, this one watches for Notepad instance , you can modify it to your needs.</p>
<pre><code> do
{
Process[] proc = Process.GetProcessesByName("notepad"... | C# Close window when process is started | c#|wpf|vb.net|for-loop | -1 | 63 | 1 | 72,272,385 | 72,272,385 | 1 | true | 2022-05-17T09:17:21.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Close window when process is started<p>i have a WPF window which should close when the process "TeamViewer" is started.</p>
<p>Unfortunately I c... |
72,275,914 | why is afterSetExtremes function being called twice highcharts using react<p>I want to implement lazy loading functionality as show here.</p>
<p><a href="https://Example" rel="nofollow noreferrer">jsfiddle.net/uf34oecg/</a></p>
<p>If you check its console, it prints <code>loadInitialData</code> once only at the time of... | <p>That's because there are different orders of action.</p>
<p>With React:</p>
<ol>
<li>Chart is created without data</li>
<li>Data is received and the chart is updated</li>
</ol>
<p>Without React:</p>
<ol>
<li>Data is received</li>
<li>Chart is created</li>
</ol>
<hr />
<p>As a solution, you can call <code>loadInitial... | why is afterSetExtremes function being called twice highcharts using react | reactjs|highcharts|react-highcharts | 0 | 63 | 1 | 72,276,898 | 72,276,898 | 1 | true | 2022-05-17T14:33:21.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is afterSetExtremes function being called twice highcharts using react<p>I want to implement lazy loading functionality as show here.</p>
<p><a href="htt... |
72,282,721 | Remove everything after a space - Pyspark<p>I have a dataframe df as follows:</p>
<pre><code> A B
21k2 b 1
2412 9 p
</code></pre>
<p>Both A and B are strings.</p>
<p>I would like for the A column elements to be trimmed as follows:</p>
<pre><code> A B
21k2 ... | <p>You can use the <code>split</code> function and <code>getItem</code> method.</p>
<pre><code>df = df.select(F.split('A', ' ').getItem(0).alias('A'), 'B')
</code></pre> | Remove everything after a space - Pyspark | python|dataframe|pyspark | 0 | 63 | 1 | 72,282,798 | 72,282,798 | 1 | true | 2022-05-18T02:55:02.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove everything after a space - Pyspark<p>I have a dataframe df as follows:</p>
<pre><code> A B
21k2 b 1
2412 9 ... |
72,292,461 | how to return a template list in C++?<p>I am learning C++ in school and in my homework, my task is to create the FooClass for these:</p>
<pre><code>int main()
{
int x[] = {3, 7, 4, 1, 2, 5, 6, 9};
FooClass<int> ui(x, sizeof(x) / sizeof(x[0]));
std::string s[] = {"Car", "Bike", &qu... | <p>Your constructor is not copying the source elements into the array that it allocates. And, you need a destructor to free the allocated array when you are done using it.</p>
<p>And, your <code>print()</code> method is not <code>static</code>, so it should act on <code>this</code> instead of taking a <code>FooClass</... | how to return a template list in C++? | c++|list|class|templates | 0 | 63 | 1 | 72,293,189 | 72,293,189 | 1 | true | 2022-05-18T15:59:08.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to return a template list in C++?<p>I am learning C++ in school and in my homework, my task is to create the FooClass for these:</p>
<pre><code>int main(... |
72,296,335 | Is it possible to retrieve tables with stored procedures?<p>It's the first time I use PostgreSQL and its most popular interface, Pgadmin4. I noticed I couldn't get tables using SELECT inside a stored procedure, but managed to do it with a function that returns a table. However, in MySQL it's possible to return queries ... | <p>You get what you are looking for by defining a <a href="https://www.postgresql.org/docs/current/xfunc-sql.html" rel="nofollow noreferrer">SQL function</a>. It winds up essentially the same as your MySql.</p>
<pre><code>create or replace function listar_ordenes_cat(in cat_name)
returns table (ordenid int)
as $$
... | Is it possible to retrieve tables with stored procedures? | sql|database|postgresql|stored-procedures|pgadmin | 0 | 63 | 1 | 72,296,768 | 72,296,768 | 1 | true | 2022-05-18T21:42:37.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to retrieve tables with stored procedures?<p>It's the first time I use PostgreSQL and its most popular interface, Pgadmin4. I noticed I couldn... |
72,304,516 | How to use focus on RichText in flutter?<p>I have a list of text span like this</p>
<pre><code>var spans = [
TextSpan(text: content, style: style),
TextSpan(text: content, style: style)
//and 100 more
]
</code></pre>
<p>I am loading this inside SingleChildScrollView like this.</p>
<pre><code> SingleChildScro... | <p>You could add a <code>WidgetSpan</code> next to each of your <code>TextSpan</code>, so you can assign it a <code>key</code> property which would be a <code>GlobalKey</code> so you can access its <code>BuildContext</code> to call the method <a href="https://api.flutter.dev/flutter/widgets/Scrollable/ensureVisible.htm... | How to use focus on RichText in flutter? | flutter|flutter-layout|singlechildscrollview|flutter-text|textspan | 0 | 63 | 1 | 72,307,290 | 72,307,290 | 1 | true | 2022-05-19T12:26:06.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use focus on RichText in flutter?<p>I have a list of text span like this</p>
<pre><code>var spans = [
TextSpan(text: content, style: style),
TextSpan(... |
72,312,624 | Which is the best approach for dynamic drawing in Android?<p>I want to make a waveform drawing for an audio recorder in Android. The usual one with lines/bars, like this one:</p>
<p><a href="https://i.stack.imgur.com/5VDbw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VDbw.png" alt="enter image de... | <p>Your basic custom view approach would be to implement <code>onDraw</code> and redraw your current data each frame. You'd probably keep some kind of circular <code>Buffer</code> holding your most recent <em>n</em> amplitude values, so each frame you'd iterate over those, and use <code>drawRect</code> to draw the bars... | Which is the best approach for dynamic drawing in Android? | android|audio|canvas|waveform | 0 | 63 | 2 | 72,313,647 | 72,313,647 | 1 | true | 2022-05-20T01:20:53.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Which is the best approach for dynamic drawing in Android?<p>I want to make a waveform drawing for an audio recorder in Android. The usual one with lines/bar... |
72,299,866 | packet socket not receiving data<p>I have the following C code that is supposed to await <strong>any</strong> packet on ethernet device <code>eth0</code>, including <code>IPv6</code> multicast messages.</p>
<p>I am using a <code>packet(7)</code> socket here, as my underlying code is handling the layers. Hence, I want t... | <p>In this line:</p>
<pre><code>sll.sll_protocol = ETH_P_ALL;
</code></pre>
<p>you forgot to use <code>htons</code></p> | packet socket not receiving data | c|linux|sockets | 0 | 63 | 1 | 72,316,441 | 72,316,441 | 1 | true | 2022-05-19T06:51:25.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
packet socket not receiving data<p>I have the following C code that is supposed to await <strong>any</strong> packet on ethernet device <code>eth0</code>, in... |
72,326,897 | Cannot create database when running docker-compose.yml<p>When running <strong>docker-compose up -d</strong>, I expect 2 databases to be created.</p>
<p>docker-compose.yml:</p>
<pre><code>version: '3.4'
volumes:
db_data:
services:
postgres:
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=Pass... | <p>In the postgres service you initiate the Database with the following config</p>
<pre><code> postgres:
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=Password123
- POSTGRES_DB=database1
ports:
- "5432:5432"
</code></pre>
<p>As a result a database with name <code>datab... | Cannot create database when running docker-compose.yml | docker|docker-compose | 0 | 63 | 1 | 72,327,206 | 72,327,206 | 1 | true | 2022-05-21T05:25:37.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot create database when running docker-compose.yml<p>When running <strong>docker-compose up -d</strong>, I expect 2 databases to be created.</p>
<p>docke... |
72,328,615 | How to increase the day in this date string '2022-05-06' in JS<p>How to increase the day in this date string '2022-05-06' in JS? It can be both native and moments solution. I checked add method in moment but looks like I am doing something wrong and it doesn't work:</p>
<p><div class="snippet" data-lang="js" data-hide=... | <p>You should parse string to moment object properly:</p>
<pre class="lang-js prettyprint-override"><code>const date = '2022-05-06'
const newDate = moment(date,'YYYY-MM-DD').add(1, 'days');
</code></pre> | How to increase the day in this date string '2022-05-06' in JS | javascript|date|momentjs | -3 | 63 | 1 | 72,328,634 | 72,328,634 | 1 | true | 2022-05-21T10:13:22.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to increase the day in this date string '2022-05-06' in JS<p>How to increase the day in this date string '2022-05-06' in JS? It can be both native and mo... |
72,335,816 | How to remove key value from the table in loop in Lua<p>So, I created a table <code>A_table</code> and my goal is to create a set of three hands <code>Hand</code> and then I wanted to remove the last two sets from the table i.e <code>key 2 and 3</code></p>
<pre><code>A_table = {}
for i = 1, 3 do
local Hand = {
... | <p>In your case...</p>
<pre><code>for i = #A_table, 2, -1 do
table.remove(A_table)
end
</code></pre>
<ol>
<li>The loop starts at last key and leaves after key number 2</li>
<li>table.remove() without positional parameter removes last key/value by default</li>
</ol> | How to remove key value from the table in loop in Lua | lua|lua-table | 1 | 63 | 1 | 72,335,929 | 72,335,929 | 1 | true | 2022-05-22T08:06:06.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove key value from the table in loop in Lua<p>So, I created a table <code>A_table</code> and my goal is to create a set of three hands <code>Hand</... |
72,341,150 | What is this err means? Argument of type '(dispatch: Dispatch<IAuthType>) => Promise<void>' is not assignable to parameter of type 'AnyAction'<p>I have faced to same issue(below link).</p>
<p>I can't explan well that issue ...so brought the link</p>
<p><a href="https://stackoverflow.com/questions/71939885/argument-of-t... | <p>The problem is that <code>const dispatch = useDispatch();</code> only knows about the basic <code>Dispatch</code> type from the <code>redux</code> core. That <code>Dispatch</code> type does not know that thunks exist - it only accepts plain action objects. So, when you try to dispatch a thunk, it (correctly) error... | What is this err means? Argument of type '(dispatch: Dispatch<IAuthType>) => Promise<void>' is not assignable to parameter of type 'AnyAction' | reactjs|typescript|redux | 0 | 63 | 1 | 72,341,344 | 72,341,344 | 1 | true | 2022-05-22T20:41:07.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is this err means? Argument of type '(dispatch: Dispatch<IAuthType>) => Promise<void>' is not assignable to parameter of type 'AnyAction'<p>I have faced... |
72,322,545 | Spacy cust entity training returns nothing<p>I have descriptions from which I want to extract colours. Hence I thought I would use NER by spacy.
I have data like this for 8000 lines</p>
<pre><code>import spacy
nlp=spacy.load('en_core_web_sm')
# Getting the pipeline component
ner=nlp.get_pipe("ner")
Train_da... | <p>There are several problems with your code.</p>
<p><strong>Where did you save your model?</strong></p>
<p>There is nothing in your code to indicate you saved and reloaded your model. When you train a model like that, you aren't modifying the existing model on disk. If you don't save the model after training it's just... | Spacy cust entity training returns nothing | python|python-3.x|spacy|spacy-3 | 1 | 63 | 2 | 72,342,981 | 72,342,981 | 1 | true | 2022-05-20T17:11:30.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spacy cust entity training returns nothing<p>I have descriptions from which I want to extract colours. Hence I thought I would use NER by spacy.
I have data ... |
72,345,082 | extract information from website using python<p>I'm trying to get the iformations about the indicator facts in this website <a href="https://otx.alienvault.com/indicator/ip/13.107.21.200" rel="nofollow noreferrer">https://otx.alienvault.com/indicator/ip/13.107.21.200</a> using this code</p>
<pre><code>from bs4 import B... | <p>You can get the necessary information from the site using the API</p>
<pre><code>import requests
def get_facts(ip):
response = requests.get(f'https://otx.alienvault.com/otxapi/indicators/ip/analysis/{ip}')
print(response.json()['facts'])
get_facts('13.107.21.200')
</code></pre> | extract information from website using python | python|web-scraping|beautifulsoup | -1 | 63 | 1 | 72,345,572 | 72,345,572 | 1 | true | 2022-05-23T07:58:55.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
extract information from website using python<p>I'm trying to get the iformations about the indicator facts in this website <a href="https://otx.alienvault.c... |
72,347,664 | Anylogic: Resource(from the pool) is not being released when its availability time ( as per certain schedule) is over<p><a href="https://i.stack.imgur.com/XGnFX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XGnFX.png" alt="enter image description here" /></a>In my ANYLOGIC model there are certain s... | <p>Define your resource-pool downtimes using a <code>Downtime</code> block. Tick it's "may preempt other tasks" as below:
<a href="https://i.stack.imgur.com/smMUw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/smMUw.png" alt="enter image description here" /></a></p>
<p>NOTE: play around wi... | Anylogic: Resource(from the pool) is not being released when its availability time ( as per certain schedule) is over | resources|release|anylogic|schedule | 0 | 63 | 1 | 72,347,787 | 72,347,787 | 1 | true | 2022-05-23T11:19:50.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Anylogic: Resource(from the pool) is not being released when its availability time ( as per certain schedule) is over<p><a href="https://i.stack.imgur.com/XG... |
72,351,224 | How to read content of txt file the values are comma separated and add it to a list?<p>I have a file that contains the following content. This is a sample of the file. The fine contains up to 1000 values.</p>
<pre><code>'1022409', '10856967', '11665741'
</code></pre>
<p>I need to read the file and create this list <cod... | <p>I found the solution thanks to <a href="https://stackoverflow.com/a/57051462/1395874">this</a>.</p>
<pre><code>with open('Pafos.txt', 'r') as f:
parcelIds_list = f.readlines()
cs_mylist = []
for y in [x.split(',') for x in parcelIds_list]:
for z in y:
cs_mylist.append(z.replace(' ', '... | How to read content of txt file the values are comma separated and add it to a list? | python|list | 0 | 63 | 4 | 72,351,504 | 72,351,504 | 1 | true | 2022-05-23T15:36:17.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read content of txt file the values are comma separated and add it to a list?<p>I have a file that contains the following content. This is a sample of... |
72,351,803 | Bulk resize folder of images to two different sizes and rename files imagemagick (Mac OS)<p>I'm looking to loop through a number of images in a folder, resize and crop them to two different sizes, then rename them. I can get one set to work with this code:</p>
<pre><code>for f in *.png; do convert "$f" -resiz... | <p>In Imagemagick, you can do it as follow, I believe (untested). the -extent will crop if needed otherwise it will pad (so you may want to set the -background color before -extent, even if it is not used)</p>
<pre><code>for f in *.png; do
convert "$f" -set filename:f "%[t]-twitter" \
\( -clone 0 -... | Bulk resize folder of images to two different sizes and rename files imagemagick (Mac OS) | image-processing|imagemagick|batch-processing|imagemagick-convert | 0 | 63 | 1 | 72,353,210 | 72,353,210 | 1 | true | 2022-05-23T16:21:16.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bulk resize folder of images to two different sizes and rename files imagemagick (Mac OS)<p>I'm looking to loop through a number of images in a folder, resiz... |
72,370,018 | Replace a string with a variable using sed<p>I have this string in my file</p>
<pre><code>$vnet_address
</code></pre>
<p>And i have in my bash run time this variable which i want to replace my string with:</p>
<pre><code>$vnet_address=10.1.0.0/16
</code></pre>
<p>I get an error when i run this command:</p>
<pre><code>s... | <p>You can use</p>
<pre class="lang-bash prettyprint-override"><code>sed -i "s,\\\$vnet_address,${vnet_address}," file
</code></pre>
<p>Note:</p>
<ul>
<li>The regex delimiter character is replaced with <code>,</code></li>
<li>The <code>$</code> is properly escaped with a literal <code>\</code> character</li>
... | Replace a string with a variable using sed | bash|sed|substitution | -1 | 63 | 1 | 72,370,057 | 72,370,057 | 1 | true | 2022-05-24T22:15:27.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace a string with a variable using sed<p>I have this string in my file</p>
<pre><code>$vnet_address
</code></pre>
<p>And i have in my bash run time this ... |
72,370,361 | Unable to use npm in VSCode<p>I have followed available tutorials and searched around for answers but cannot find them. I have just added the npm package via the extensions tab and restarted the computer. I cannot get npm to be recognized in the terminal:</p>
<pre><code>PS E:\Web Apps> npm
npm : The term 'npm' is no... | <p>To use npm on the terminal, you need to install nodejs. See <a href="https://phoenixnap.com/kb/install-node-js-npm-on-windows" rel="nofollow noreferrer">this</a> for window instruction.</p> | Unable to use npm in VSCode | visual-studio-code|npm|progressive-web-apps | -1 | 63 | 2 | 72,371,351 | 72,371,351 | 1 | true | 2022-05-24T23:09:30.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to use npm in VSCode<p>I have followed available tutorials and searched around for answers but cannot find them. I have just added the npm package via... |
72,369,593 | Does vkQueuePresentKHR prevent later commands from executing while it is waiting on the semaphore?<p>This is kind of a follow-up question for <a href="https://stackoverflow.com/questions/58630028/vulkan-what-did-vkqueuepresentkhr-do">this question</a>, and it is also based on the code provided by the <a href="https://v... | <blockquote>
<p>In the above example, will the commands in <code>cmd_buffer</code> also have to wait until semaphore is signaled?</p>
</blockquote>
<p>Only if you use the semaphore as a <code>waitSemaphore</code> for the later submit.</p>
<blockquote>
<p>This is because the vkQueuePresentKHR command waits on that semap... | Does vkQueuePresentKHR prevent later commands from executing while it is waiting on the semaphore? | c++|graphics|3d|vulkan | 0 | 63 | 1 | 72,376,158 | 72,376,158 | 1 | true | 2022-05-24T21:20:22.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does vkQueuePresentKHR prevent later commands from executing while it is waiting on the semaphore?<p>This is kind of a follow-up question for <a href="https:... |
72,376,077 | Elasticsearch range aggregation ignores negative values<p>I'm trying to bucket a range aggregation and achieve the following buckets:</p>
<pre><code><=0 - 0 including negative numbers
>=1 - 1 and above
</code></pre>
<p>field type = Integer</p>
<p>Query:</p>
<pre class="lang-json prettyprint-override"><code>GET _s... | <p>In the <code>range</code> aggregation, <code>to</code> is always exclusive, you should use <code>lte</code> and <code>gte</code> instead:</p>
<pre><code>GET _search
{
"aggs": {
"stock_ranges": {
"range": {
"field": "Facets_Integer_Stock",
&... | Elasticsearch range aggregation ignores negative values | elasticsearch|elasticsearch-aggregation | 0 | 63 | 2 | 72,377,993 | 72,377,993 | 1 | true | 2022-05-25T10:38:03.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Elasticsearch range aggregation ignores negative values<p>I'm trying to bucket a range aggregation and achieve the following buckets:</p>
<pre><code><=0 -... |
72,385,368 | Updating a variable in Python Schedule<p>With the python schedule, I am unable to feed the updated output back to the variable. Is there a smart way to achieve this?</p>
<pre><code>x = 10
from schedule import every, repeat, run_pending
import time
@repeat(every(3).seconds, x)
def yee(x):
x = x * 2
print(x)
... | <p>If you want to update a global, then you have to use the <code>global</code> statement. Right now, you set the global <code>x</code> once (to 10). The name <code>x</code> within your function is entirely local. And there's no point in returning anything.</p>
<pre><code>@repeat(every(3).seconds)
def yee():
glo... | Updating a variable in Python Schedule | python|schedule | 0 | 63 | 1 | 72,385,394 | 72,385,394 | 1 | true | 2022-05-26T00:11:29.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating a variable in Python Schedule<p>With the python schedule, I am unable to feed the updated output back to the variable. Is there a smart way to achie... |
72,385,968 | Detecting duplicates in pandas when a column contains lists<p>Is there a reasonable way to detect duplicates in a Pandas dataframe when a column contains lists or numpy nd arrays, like the example below? I know I could convert the lists into strings, but the act of converting back and forth feels... wrong. Plus, lists ... | <p>With <code>map</code> <code>tuple</code></p>
<pre><code>out = df[df.assign(rating = df['rating'].map(tuple)).duplicated(keep=False)]
Out[295]:
author date rating
0 Jefe98 1423112400 [ingredA, ingredB, ingredC]
1 Jefe98 1423112400 [ingredA, ingredB, ingredC]
</code></pre> | Detecting duplicates in pandas when a column contains lists | python|pandas|dataframe|duplicates | 0 | 63 | 1 | 72,386,010 | 72,386,010 | 1 | true | 2022-05-26T02:13:42.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detecting duplicates in pandas when a column contains lists<p>Is there a reasonable way to detect duplicates in a Pandas dataframe when a column contains lis... |
72,390,419 | Rf_allocVector only allocates and does not zero out memory<p>Original motivation behind this is that I have a dynamically sized array of floats that I want to pass to R through Rcpp without either incurring the cost of a zeroing out nor the cost of a deep copy.</p>
<p>Originally I had thought that there might be some w... | <p>Welcome to StackOverflow.</p>
<p>You marked this <code>rcpp</code> but that is a function from the C API of R -- whereas the Rcpp API offers you its constructors which <em>do</em> in fact set the memory tp zero:</p>
<pre><code>> Rcpp::cppFunction("NumericVector goodVec(int n) { return NumericVector(n); }&quo... | Rf_allocVector only allocates and does not zero out memory | r|c|rcpp|rcpp11 | 1 | 63 | 1 | 72,391,316 | 72,391,316 | 1 | true | 2022-05-26T10:33:46.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rf_allocVector only allocates and does not zero out memory<p>Original motivation behind this is that I have a dynamically sized array of floats that I want t... |
72,801,376 | Svelte unload content<p>Is it possible to unload an image? E.g. if you download a lot of images with an infinity scroll something like lazy loading in both directions.</p>
<p>And if the event <code>visibilitychange</code> is used by svelte to unload everything that isn't displayed or do I need to do that manually?</p> | <p>This is more of a general web dev question. Svelte does nothing by itself when visibility changes.</p>
<p>You can load elements manually, but it's usually a bit more complex than just adding or removing elements when visible/invisible. Keeping scroll position, pop in, etc.</p>
<p>I replace elements with empty divs w... | Svelte unload content | svelte|sveltekit | 0 | 63 | 1 | 72,801,553 | 72,801,553 | 1 | true | 2022-06-29T12:22:37.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Svelte unload content<p>Is it possible to unload an image? E.g. if you download a lot of images with an infinity scroll something like lazy loading in both d... |
72,800,824 | svelte memory management stores<p>My question is how subscribe works in a store. Does it work like a reference? Should upload data be stored in a store or is that bad for performance?</p> | <p>Data from a store is passed as a reference to subscribers, <a href="https://github.com/sveltejs/svelte/blob/master/src/runtime/store/index.ts#L68" rel="nofollow noreferrer">but it creates a copy in the store when it is set</a>. So, depending on the use case, it might not be the best solution as garbage collection do... | svelte memory management stores | svelte|sveltekit|svelte-store | 2 | 63 | 1 | 72,801,930 | 72,801,930 | 1 | true | 2022-06-29T11:41:14.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
svelte memory management stores<p>My question is how subscribe works in a store. Does it work like a reference? Should upload data be stored in a store or is... |
72,792,801 | Testing in Angular with Jasmine/Karma & 3rd party dependencies like ExcelJS<p>I'm working on tests for a project using ExcelJS, in build and in prod it works fine but in trying to add unit tests to a few components I'm noticing the TestBed fails to build for the following errors: <a href="https://i.stack.imgur.com/PkoV... | <p>You have to add 'node' to the types array in tsconfig.spec.json file and you may have to continue playing with that (maybe have to add other types) to get the other types of ExcelJS happy as well.</p> | Testing in Angular with Jasmine/Karma & 3rd party dependencies like ExcelJS | angular|unit-testing|exceljs | 0 | 63 | 1 | 72,806,875 | 72,806,875 | 1 | true | 2022-06-28T20:28:36.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Testing in Angular with Jasmine/Karma & 3rd party dependencies like ExcelJS<p>I'm working on tests for a project using ExcelJS, in build and in prod it works... |
72,800,233 | What is the difference between teams.live.com and teams.microsoft.com?<p>When I create a meeting link from my team's app, I get the URL similar to <strong>teams.live.com</strong>, but when people share the link with me, sometimes I see it as <strong>teams.microsoft.com</strong> ?</p> | <p>Microsoft introduced Teams for personal accounts some time ago.
Business accounts are <code>teams.microsoft.com</code>, personal accounts are <code>teams.live.com</code></p>
<p>Same as for Hotmail/outlook (x.live.com) vs outlook.office.com</p> | What is the difference between teams.live.com and teams.microsoft.com? | microsoft-graph-api|microsoft-teams | -1 | 63 | 1 | 72,807,772 | 72,807,772 | 1 | true | 2022-06-29T10:58:15.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the difference between teams.live.com and teams.microsoft.com?<p>When I create a meeting link from my team's app, I get the URL similar to <strong>te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.