question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,976,228
How to imply a specific number of bytes to a string slice<p>Might seem like a dumb question, however, I've been trying to restrict a string slice (that comes as parameter to a function) to a number of bytes.</p> <p>This is what I've tried</p> <pre><code>fn padd_address(addr: &amp;str) -&gt; Result&lt;web3::types::H256,...
<blockquote> <p>I get 40 bytes in return instead of 20 which is the actual size of a contract address.</p> </blockquote> <p>No, your address is</p> <pre><code>dAC17F958D2ee523a2206206994597C13D831ec7 </code></pre> <p>which is in fact 40 bytes. <code>as_bytes()</code> simply returns the bytes data underlying the string,...
How to imply a specific number of bytes to a string slice
string|rust
0
48
1
72,976,286
72,976,286
1
true
2022-07-14T06:40:54.440Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to imply a specific number of bytes to a string slice<p>Might seem like a dumb question, however, I've been trying to restrict a string slice (that comes...
72,976,808
Multithread share 2 variable problem with nonlock<p>I have a question about multithread share variable problem. the two variable is like:</p> <pre><code>{ void* a; uint64_t b; } </code></pre> <p>only one thread can modify the two variable, other thread will frequently read these two variable. I want to change a...
<p><strong>You're looking for a <a href="https://en.wikipedia.org/wiki/Seqlock" rel="nofollow noreferrer">SeqLock</a>.</strong></p> <p>It's ideal for this use-case, especially with infrequently-changed data. (e.g. like a time variable updated by a timer interrupt, read all over the place.)</p> <ul> <li><a href="https:/...
Multithread share 2 variable problem with nonlock
c++|multithreading|concurrency|memory-barriers|lockless
1
48
1
72,977,444
72,977,444
1
true
2022-07-14T07:32:11.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multithread share 2 variable problem with nonlock<p>I have a question about multithread share variable problem. the two variable is like:</p> <pre><code>{ ...
72,922,180
Author and address relationship with EF Core<p>I have a .NET application written with EF Core as ORM.</p> <p>I don't know the relationship between an <code>Author</code> and <code>Address</code>.</p> <ul> <li>Is it possible to have addresses related to many authors?</li> <li>Is it a many-to-many / one-to-one / one-to-m...
<blockquote> <p>Is it possible to have addresses related to many authors?</p> </blockquote> <p>This is up to you to decide whether there are multiple authors living in the same house or not or, an author could have multiple houses. But you may build such type of relationship in EF Core.</p> <blockquote> <p>Is it a many...
Author and address relationship with EF Core
.net|sql-server|entity-framework-core|foreign-keys|relationship
-1
48
1
72,978,062
72,978,062
1
true
2022-07-09T14:28:11.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Author and address relationship with EF Core<p>I have a .NET application written with EF Core as ORM.</p> <p>I don't know the relationship between an <code>A...
72,977,805
How to checkout a specific repo tag?<p>I've created a repo in Databricks. I would like to work on a specific tagged version of the repo, however, I can't see options in the UI to specify the branch.</p> <p>Next I created a notebook and attempted to run</p> <pre class="lang-bash prettyprint-override"><code>%sh git tag f...
<p>You can check out a specific tag with <a href="https://docs.databricks.com/dev-tools/cli/repos-cli.html#update-a-repo-to-the-most-recent-commit-of-a-remote-branch-or-to-a-tag" rel="nofollow noreferrer">Databricks CLI</a>:</p> <pre><code>$ databricks repos create --url https://github.com/databricks-academy/data-engin...
How to checkout a specific repo tag?
databricks|databricks-repos
2
48
1
72,980,484
72,980,484
1
true
2022-07-14T08:52:19.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to checkout a specific repo tag?<p>I've created a repo in Databricks. I would like to work on a specific tagged version of the repo, however, I can't see...
72,951,542
Inheritance with dataclasses for GridLayout of Kivy Python 3<p>I would like to do that:</p> <pre class="lang-py prettyprint-override"><code>import kivy from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from dataclasses import d...
<p>Here is a simple way to do what you want:</p> <pre><code>class MyApp(App): def build(self): root = MyGrid() root.cols = 2 pseudo = TextInput(multiline=False) root.add_widget(Label(text=&quot;Pseudo: &quot;)) root.add_widget(pseudo) return root </code></p...
Inheritance with dataclasses for GridLayout of Kivy Python 3
python|inheritance|methods|kivy|python-dataclasses
0
48
2
72,980,962
72,980,962
1
true
2022-07-12T11:25:01.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inheritance with dataclasses for GridLayout of Kivy Python 3<p>I would like to do that:</p> <pre class="lang-py prettyprint-override"><code>import kivy from...
72,982,976
What does the phrase "created at runtime mean?"<p>My supervisor asked me the other day if a log file in a Python script is created at runtime or not. Is that another way of asking: is a new log file created every time the script is run? Because to me everything happens &quot;at runtime&quot; and it can be no other way....
<p>The phrase is usually used when you cannot figure out the content of some variable/data by just analyzing the code and other associated files (such as configs). The easiest example I can think of is</p> <pre><code>x = 'hi' print(x) </code></pre> <p>versus</p> <pre><code>x = input() print(x) </code></pre> <p>In the s...
What does the phrase "created at runtime mean?"
python|runtime
1
48
3
72,983,180
72,983,180
1
true
2022-07-14T15:24:16.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the phrase "created at runtime mean?"<p>My supervisor asked me the other day if a log file in a Python script is created at runtime or not. Is that...
72,983,917
Prevent overlapping edges on AWS Neptune<p>I have a Tinkerpop graph database on AWS Neptune.</p> <p>In some cases, I have more than one edge connecting two nodes.</p> <p>In the screenshot below, there is a node for 'Gary Barlow' and there is a node for 'All That I've Given Away'. Two edges connect these nodes, but thos...
<p>There is a <a href="https://github.com/aws/graph-notebook/issues/157" rel="nofollow noreferrer">description of how to do this</a> in that Git Issue for the graph-notebook project.</p> <p>In summary, you just have to change the layout option used by the underlying renderer. By default all graph diagrams are drawn usi...
Prevent overlapping edges on AWS Neptune
amazon-web-services|gremlin|tinkerpop|amazon-neptune|graph-notebook
0
48
1
72,984,481
72,984,481
1
true
2022-07-14T16:38:18.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent overlapping edges on AWS Neptune<p>I have a Tinkerpop graph database on AWS Neptune.</p> <p>In some cases, I have more than one edge connecting two n...
72,985,625
password input show/hide problem with img tag<p>I want to make show and hide for password input, but I don't know how! please help me! so, I have one input and after that, I have an img tag and I put img tag into the input password please help me to show and hide password with the img tag.</p> <p>my code:</p> <pre><cod...
<p>You can try this by adding event directly to img itself.</p> <pre><code> &lt;img class = &quot;password-show-icon&quot; src = &quot;Eye-slash.svg&quot; alt = &quot;&quot; onClick = &quot;togglePasswordView()&quot;&gt; function togglePasswordView() { let type = document.getElementById(&quot;password-input&quot;)...
password input show/hide problem with img tag
javascript|html|css
-1
48
3
72,986,010
72,986,010
1
true
2022-07-14T19:18:40.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: password input show/hide problem with img tag<p>I want to make show and hide for password input, but I don't know how! please help me! so, I have one input a...
72,988,112
Why I can't access Jenkins by server_ip:8080?<p>I tried to install Jenkins on my gcp instance. This log shows that jenkins service active</p> <pre><code>● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Active: activ...
<p>I had to set allow targets to all instances in the network rather specified target tags in the gcp firewall panel</p>
Why I can't access Jenkins by server_ip:8080?
jenkins|google-cloud-platform
0
48
1
72,988,402
72,988,402
1
true
2022-07-15T01:14:15.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I can't access Jenkins by server_ip:8080?<p>I tried to install Jenkins on my gcp instance. This log shows that jenkins service active</p> <pre><code>● je...
72,981,669
Cannot clone GIT repository using SSH<p><strong>In Windows</strong>:</p> <p>When cloning GIT repository, I can do this successfully:</p> <pre><code>git clone https://user@gitlab.example.com/clientes/sample/project.git </code></pre> <p>However, when I do:</p> <pre><code>git clone ssh://user@gitlab.example.com:17177/clie...
<blockquote> <p>the problem was that I was using my Git user. Git was installed using git user so I changed to git user and the repository error was gone</p> </blockquote> <p>Any GitLab instance (on-premise or SaaS <code>gitlab.com</code>) never allows user SSH access.<br /> It only allows one account, the '<code>git</...
Cannot clone GIT repository using SSH
git|gitlab
0
48
2
72,989,226
72,989,226
1
true
2022-07-14T13:52:58.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot clone GIT repository using SSH<p><strong>In Windows</strong>:</p> <p>When cloning GIT repository, I can do this successfully:</p> <pre><code>git clone...
72,989,324
How to optimize this code to calculate YoY average by group_by in R?<p>I have this code:</p> <pre><code>df&lt;-structure(list(YEAR = c(2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020), Country = c(&quot;Brazil&quot;, &quo...
<p>This is a bit tricky but can be done.</p> <p>First, let's declare the 'Years' like this so that it can scale in a better way:</p> <pre><code>Y1 &lt;- min(df$YEAR) Y2 &lt;- max(df$YEAR) </code></pre> <pre><code>#Calculate the YoY and save it in a different Data frame df %&gt;% group_by(Country) %&gt;% mutate(YoY...
How to optimize this code to calculate YoY average by group_by in R?
r
0
48
1
72,990,432
72,990,432
1
true
2022-07-15T05:16:31.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to optimize this code to calculate YoY average by group_by in R?<p>I have this code:</p> <pre><code>df&lt;-structure(list(YEAR = c(2013, 2014, 2015, 2016...
72,990,143
Allocate elements in python list with specific probobility<p>Assume, I have a specific proportions of slots <code>proportion = [30,30,20,10,10]</code>and I want to feed it with <code>1</code> element and get it allocated one by one. For example, we start with <code>[0,0,0,0,0]</code> and add <code>1</code> we get <code...
<p>This simple code gives a slot filling sequence without reallocations:</p> <pre><code>slots = 5 dist = np.array([0]*slots) proportion = np.array([30,30,20,10,10]) for i in range(0,30): total = max(dist.sum(),1) prop = dist/total*100 error = proportion - prop idx = np.argmax(error) dist[idx] += 1 ...
Allocate elements in python list with specific probobility
python|loops|iterator|distribution
0
48
1
72,990,695
72,990,695
1
true
2022-07-15T07:01:22.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Allocate elements in python list with specific probobility<p>Assume, I have a specific proportions of slots <code>proportion = [30,30,20,10,10]</code>and I w...
72,992,940
How do I get Vertex AI pipelines to see cloudshell files?<p>I am running a vertex AI pipeline, from Cloudshell:</p> <pre><code> if __name__ == '__main__': sfile= open(&quot;/path/to/keyfile.json&quot;, &quot;r&quot;) compile() trigger_pipeline() </code></pre> <p>I have declared <code>sfile</code> here beca...
<p>you cannot use the cloudshell as a regular filesystem for datastorage, you need to store your file in a cloud storage bucket and access it with the <a href="https://cloud.google.com/storage/docs/reference/libraries#client-libraries-install-python" rel="nofollow noreferrer">cloud storage api</a></p> <p>here is the py...
How do I get Vertex AI pipelines to see cloudshell files?
python|google-cloud-platform
1
48
1
72,993,279
72,993,279
1
true
2022-07-15T10:58:13.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get Vertex AI pipelines to see cloudshell files?<p>I am running a vertex AI pipeline, from Cloudshell:</p> <pre><code> if __name__ == '__main__': ...
72,995,577
python filter function on a list of dictionaries<p>suppose that I have following result from the api :</p> <pre><code>[ { &quot;id&quot;:&quot;1234&quot;, &quot;views&quot;:132624, &quot;rate&quot;:&quot;4.43&quot;, &quot;url&quot;:&quot;someurl.com&quot;, &quot;add...
<p>You need <code>map</code> instead of <code>filter</code></p>
python filter function on a list of dictionaries
python|json|api|filter|built-in
0
48
2
72,995,607
72,995,607
1
true
2022-07-15T14:29:00.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python filter function on a list of dictionaries<p>suppose that I have following result from the api :</p> <pre><code>[ { &quot;id&quot;:&quot;...
72,997,638
How can optimize below code for counting repeat of each elements in nested of nested list<p>The code I wrote counts the frequency of each element in a nested list. I have a lot of repeated code. How can I optimize it? I don't want to use built-in function or lib.</p> <p><strong>Input</strong>:</p> <pre><code>items = [1...
<p>You can use recursion to <em>flatten</em> the list and then count specific items:</p> <pre class="lang-py prettyprint-override"><code>items = [ 10, &quot;ninety nine&quot;, [99, 250, [90, &quot;fifty&quot;], 4.5, [50, 80], 90, &quot;ninety nine&quot;], [&quot;fifty&quot;], ] def get_items(v): i...
How can optimize below code for counting repeat of each elements in nested of nested list
python|python-3.x|list|dictionary|optimization
1
48
1
72,997,683
72,997,683
1
true
2022-07-15T17:19:44.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can optimize below code for counting repeat of each elements in nested of nested list<p>The code I wrote counts the frequency of each element in a nested...
72,997,305
rust: Define a generic function that will accept a borrow to any iterable of things that implement a certain trait<p>I have a trait and a thing that implements that trait:</p> <pre><code>trait HasPosition2D { fn x(&amp;self) -&gt; &amp;i32; fn y(&amp;self) -&gt; &amp;i32; fn x_mut(&amp;mut self) -&gt; &amp;...
<p><a href="https://doc.rust-lang.org/std/iter/index.html#iterating-by-reference" rel="nofollow noreferrer"><code>into_iter</code></a> takes <code>self</code> by value (not reference), so if you are wanting to avoid a move, then that won't fix your problem. <code>Vec</code> can <a href="https://doc.rust-lang.org/std/ve...
rust: Define a generic function that will accept a borrow to any iterable of things that implement a certain trait
generics|rust|traits
0
48
1
72,997,873
72,997,873
1
true
2022-07-15T16:49:18.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rust: Define a generic function that will accept a borrow to any iterable of things that implement a certain trait<p>I have a trait and a thing that implemen...
72,999,138
Add a value as a new row to a dataframe but keep all other columns NA<p>Here is my sample dataset:</p> <pre><code>mydata = data.frame (ID =c(1,2,3,4,5), subject = c(&quot;His&quot;,&quot;Geo&quot;,&quot;Geo&quot;,&quot;His&quot;,&quot;Geo&quot;), age = c(21,24,26,23,26)) </code></pre> <p>I would like to add a row at t...
<p>A possible solution, based on <code>dplyr</code>. We first need to convert <code>ID</code> from <code>numeric</code> to <code>character</code>.</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) mydata %&gt;% mutate(ID = as.character(ID)) %&gt;% bind_rows(list(ID = &quot;School 1&quot;), .) #&...
Add a value as a new row to a dataframe but keep all other columns NA
r|row|data-manipulation
2
48
2
72,999,156
72,999,156
1
true
2022-07-15T20:09:15.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add a value as a new row to a dataframe but keep all other columns NA<p>Here is my sample dataset:</p> <pre><code>mydata = data.frame (ID =c(1,2,3,4,5), subj...
73,000,567
Acknowledge and Exception but continue anyway<p>Simple script where you import a txt file to sum together all the number values. In the txt file there is one letter (incorrectly entered) instead of a number.</p> <p><a href="https://i.stack.imgur.com/w7abQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.c...
<p>Since this is for learning, I would recommend using TryParse rather than Parse and rather than placing code in the form, use a class as shown next where return information is done with tuples and <a href="https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/deconstruct" rel="nofollow noreferrer">de...
Acknowledge and Exception but continue anyway
c#
-1
48
2
73,002,836
73,002,836
1
true
2022-07-15T23:53:21.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Acknowledge and Exception but continue anyway<p>Simple script where you import a txt file to sum together all the number values. In the txt file there is one...
72,986,400
Finding first and last occurrence of an element using binary search and effects in scala<p>I've got functions with following signatures:</p> <pre class="lang-scala prettyprint-override"><code>case class Sth(index: Long, str: String) def fetch(n: Long): F[Sth] = ??? //implemented def findFirstAndLast(min: Long, max: L...
<p>Start by envisioning your algorithm as a recursive one, where there is some initial &quot;state&quot;, and the algorithm can choose at each step to either update the state and recurse, or finish with a result.</p> <p>You could represent your state as</p> <pre class="lang-scala prettyprint-override"><code>case class ...
Finding first and last occurrence of an element using binary search and effects in scala
scala|cats-effect
1
48
1
73,005,283
73,005,283
1
true
2022-07-14T20:37:20.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding first and last occurrence of an element using binary search and effects in scala<p>I've got functions with following signatures:</p> <pre class="lang...
73,005,764
How to order the dataframe'columns names the same way of another dataframe<p>I have a dataframe like this: <strong>DF1</strong></p> <pre><code>text yellow blue red orange dfsfs 0 1 1 0 sdfsdf 0 0 1 1 asdasd 1 1 1 1 </code></pre> <p>and Another d...
<p>You can do:</p> <pre><code>df2[df1.columns.append(df2.columns.drop(df1.columns))] </code></pre> <p>output:</p> <pre><code> text yellow blue red orange pink black 0 dfsfs 1 0 0 1 1 0 1 sdfsdf 1 0 1 0 1 0 2 asdasd 0 1 1 1 1 ...
How to order the dataframe'columns names the same way of another dataframe
python-3.x|pandas
0
48
2
73,006,041
73,006,041
1
true
2022-07-16T16:08:49.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to order the dataframe'columns names the same way of another dataframe<p>I have a dataframe like this: <strong>DF1</strong></p> <pre><code>text yellow...
73,002,968
Changing Locale for One Unit Test Class<p>I am testing functions which involve calculations with decimal points. I made separate Unit Test Case Classes. One is for testing the comma decimal point &quot;,&quot; commonly used in European countries. The other is used for testing calculations with the period decimal point ...
<p>This is more of a comment, but too big to post as a comment. I think your actual problem is a lack of testability of the actual code. So instead of looking for the way for tests to find a workaround for a testability issue, refactor the actual functions to have locale as an argument, with the default set to <code>Lo...
Changing Locale for One Unit Test Class
swift|unit-testing|testing|xctest
0
48
1
73,006,693
73,006,693
1
true
2022-07-16T09:14:30.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing Locale for One Unit Test Class<p>I am testing functions which involve calculations with decimal points. I made separate Unit Test Case Classes. One ...
73,010,290
Is there an R function for finding common between two files according to two numeric columns with a range of differences?<p>I have two big data with start and end positions and I want to find the common between them according to these positions. But I do not want just find rows that are exactly similar in positions. fo...
<p>Another solution also based on <code>data.table</code>.</p> <pre><code>cols = c(&quot;S&quot;, &quot;E&quot;) df1[, (cols) := .(START, END)] # useful to keep START/END columns unaltered while joining. df2[, (cols) := .(START, END)] df1[df2, on=.(name, E&gt;=S, S&lt;=E), nomatch=NULL][, (cols) := NULL] name S...
Is there an R function for finding common between two files according to two numeric columns with a range of differences?
r|data.table|bioinformatics
0
48
2
73,010,807
73,010,807
1
true
2022-07-17T08:29:58.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an R function for finding common between two files according to two numeric columns with a range of differences?<p>I have two big data with start an...
73,014,014
How to add a dot break in between words in flutter<p>I'm working on a project and I need to know how to break words with a dot similar to how youtube adds dots in between elements, such as.<a href="https://i.stack.imgur.com/sYKMg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYKMg.png" alt="Example...
<p>You can copy the dot and use it directly in a string like this</p> <pre><code>String finalString = &quot;$string1 • $string2&quot;; </code></pre>
How to add a dot break in between words in flutter
flutter|dart|text
0
48
3
73,014,072
73,014,072
1
true
2022-07-17T17:41:36.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a dot break in between words in flutter<p>I'm working on a project and I need to know how to break words with a dot similar to how youtube adds do...
73,017,140
Using Autofac in .NET 6 to register ILogger<p>I am using .NET 6 and the latest version of Autofac for DI in an App Services Worker. So far my Program.cs looks like this:</p> <pre><code>var builder = new HostBuilder(); builder.UseEnvironment(Environments.Development); builder.UseServiceProviderFactory(new AutofacServic...
<p>Framework does not register non-generic <code>ILogger</code>, to resolve logger you need to provide generic type parameter for which the logger is used. For top-level statement file it can be generated <code>Program</code> class:</p> <pre class="lang-cs prettyprint-override"><code>var logger = app.Services.GetRequir...
Using Autofac in .NET 6 to register ILogger
.net|autofac|.net-6.0
0
48
2
73,019,173
73,019,173
1
true
2022-07-18T03:53:25.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Autofac in .NET 6 to register ILogger<p>I am using .NET 6 and the latest version of Autofac for DI in an App Services Worker. So far my Program.cs look...
73,018,424
How to select maximum records from timestamp and do the operation using LISTAGG<pre><code>CREATE TABLE test ( e_id NUMBER(10), f_name VARCHAR2(50), created_on TIMESTAMP, created_by VARCHAR2(50) ); INSERT INTO test VALUES(11,'a','18-07-22 12:06:19.566000000 PM','aa'); INSERT INTO test VALU...
<p>I have added one more row to the demo table to demonstrate situation you mentioned: &quot;Need to use DISTINCT in LISTAGG because there may be same records present for an e_id&quot;.</p> <p>I do not see why you need something like this but here is my try to do it:</p> <pre><code>with cte as (select distinct e_id, f_...
How to select maximum records from timestamp and do the operation using LISTAGG
sql|oracle|oracle18c
-1
48
2
73,019,217
73,019,217
1
true
2022-07-18T07:05:25.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select maximum records from timestamp and do the operation using LISTAGG<pre><code>CREATE TABLE test ( e_id NUMBER(10), f_name VAR...
73,019,947
Cypress: Get all elements that have some specific attribute equal to any value<p>I am trying to get all elements that just have a specific attribute, doesn't matter what the attribute value is, and count the number of elements found.</p> <p>for example get all attribute that has &quot;row-index&quot; attribute:</p> <pr...
<p>You can also directly use <code>row-index</code> for this:</p> <pre class="lang-js prettyprint-override"><code>cy.get('[row-index]').should('have.length', 3); </code></pre> <p>Another way to assert length:</p> <pre class="lang-js prettyprint-override"><code>cy.get('[row-index]').its('length').should('eq', 3); </code...
Cypress: Get all elements that have some specific attribute equal to any value
testing|automation|cypress
0
48
2
73,019,982
73,019,982
1
true
2022-07-18T09:17:56.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cypress: Get all elements that have some specific attribute equal to any value<p>I am trying to get all elements that just have a specific attribute, doesn't...
73,008,646
Insert a piece of code in the text of a Label that involves variables inside kv lang<p>I need to <strong>insert a piece of code in the text of a Label that involves variables inside kv lang</strong> as shown below:</p> <pre><code>import kivy from kivy.app import App from kivy.uix.widget import Widget from kivy.lang.bui...
<p>If you want Label text to change without a Button press, then you probably want to use a Property. You can reference a Property in <code>kv</code> and any changes to that Property will trigger evaluation where that Property is used. So, here is a modified version of your code that uses a Property named <code>follow_...
Insert a piece of code in the text of a Label that involves variables inside kv lang
python|kivy|kivy-language
1
48
2
73,022,466
73,022,466
1
true
2022-07-17T01:12:38.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert a piece of code in the text of a Label that involves variables inside kv lang<p>I need to <strong>insert a piece of code in the text of a Label that i...
73,020,950
significance of insert overwrite query at the end of snowflake query in teradata to snowflake conversion<p>query in teradata:</p> <pre><code>create table databasename.tablename, no fallback, no before journal, no after journal as ( select a, b from databasename2.tablename2 ...
<p>The Teradata command and the Snowflake commands may or may not result in the same rows in the table. Even if they result in the same rows, whether or not the 2-step approach written for Snowflake is the most efficient approach is another matter. It probably isn't, but here' what's happening:</p> <pre><code>CREATE ...
significance of insert overwrite query at the end of snowflake query in teradata to snowflake conversion
snowflake-cloud-data-platform|teradata|data-migration
0
48
1
73,022,490
73,022,490
1
true
2022-07-18T10:35:54.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: significance of insert overwrite query at the end of snowflake query in teradata to snowflake conversion<p>query in teradata:</p> <pre><code>create table dat...
72,962,902
Apply function on list of tables in database<p>I was wondering how I could automate a treatment on a list of tables stored in a database.</p> <p>Here is my failed attempt:</p> <pre><code>#Listing and storing database tables in a list : db_tbls &lt;- dbListTables(pool) tbl_list &lt;- lapply(db_tbls, dbReadTable, con...
<p>I eventually came up with this solution:</p> <pre><code>db_tbls &lt;- dbListTables(pool) tbl_list &lt;- lapply(db_tbls, dbReadTable, conn = pool) tbl_list &lt;- setNames(tbl_list, db_tbls) pimped_tables =list() for (i in 1:length(tbl_list)) { #1. converting &quot;year&quot; column into integer t...
Apply function on list of tables in database
r
0
48
1
73,035,553
73,035,553
1
true
2022-07-13T08:08:57.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply function on list of tables in database<p>I was wondering how I could automate a treatment on a list of tables stored in a database.</p> <p>Here is my f...
73,014,837
Nginx not serving application to the internet<p>My Nginx and Node.js application is not serving my application to the internet. When I try to access <code>http://helloworld.example.com</code> in my browser it cannot connecf.</p> <p>Here is my helloworld.conf file:</p> <pre><code>upstream backend { server localh...
<p>To expose your application to the Internet, to host it from home, you need to make changes to systems outside your local machine.</p> <p>In a typical setup your local computer is not connected to the internet directly. Instead it goes via a router, which is directly connected to the internet.</p> <p>To the internet...
Nginx not serving application to the internet
node.js|nginx
1
48
2
73,041,148
73,041,148
1
true
2022-07-17T19:39:24.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nginx not serving application to the internet<p>My Nginx and Node.js application is not serving my application to the internet. When I try to access <code>ht...
72,934,244
Writing dbf file with custom encoding (DBF Package)<p>I have some Characters in Farsi and I want to write them to a dbf file with my custom codepage which is 1 byte per character. I think this problem can be solved in one of these two ways:</p> <p>1- Passing my custom codepage to the dbf table.</p> <p>2- Writing binary...
<p>After trying to register my codec I ended up translating my data from utf8 to &quot;Custom Farsi codec&quot; and then to equivalent character of windows-1256 that has the same decimal codepoint. So when the user reads the data with the custom codec, the windows-1256 characters will point to the right decimal in cust...
Writing dbf file with custom encoding (DBF Package)
python|encoding|dbf
1
48
2
73,045,823
73,045,823
1
true
2022-07-11T05:54:11.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Writing dbf file with custom encoding (DBF Package)<p>I have some Characters in Farsi and I want to write them to a dbf file with my custom codepage which is...
72,950,015
A Database Error Occurred Error Number: 1096 No tables used SELECT *<p>I am getting this Error</p> <blockquote> <p>1096 No tables used SELECT *</p> </blockquote> <p>my code is below not getting what is wrong in that.</p> <pre><code>public function getH20StockDevelopmentGraph($recStart,$recEnd){ $sql = &quot;SELECT ...
<p>No need using <code>get()</code></p> <pre><code>$this-&gt;db-&gt;query($sql); return $this-&gt;db-&gt;result(); </code></pre>
A Database Error Occurred Error Number: 1096 No tables used SELECT *
php|mysql|codeigniter
0
48
1
73,244,377
73,244,377
1
true
2022-07-12T09:26:26.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A Database Error Occurred Error Number: 1096 No tables used SELECT *<p>I am getting this Error</p> <blockquote> <p>1096 No tables used SELECT *</p> </blockqu...
72,882,258
Is there a lower bound of 15 mins for the Tomcat <session-timeout> value?<p>Is there a lower bound for the Tomcat server configuration property <code>&lt;session-timeout&gt;</code> ? Because, if I set it to 5 minutes the sessions always expires after 15 minutes. I also tried 1 minute and it was the same.</p> <p>This is...
<p>There is indeed no lower bound on this value. On a &quot;hello world&quot; web application deployed to Tomcat, you can observe that expiration works properly by looking at how often the <code>JSESSIONID</code> cookie value is refreshed in the browser.</p> <p>If you set <code>session-timeout</code> to 1 minute and re...
Is there a lower bound of 15 mins for the Tomcat <session-timeout> value?
session|tomcat|timeout|config|web.xml
1
48
1
72,883,133
72,883,133
1
true
2022-07-06T10:50:30.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a lower bound of 15 mins for the Tomcat <session-timeout> value?<p>Is there a lower bound for the Tomcat server configuration property <code>&lt;ses...
72,805,124
*Not Iterate* Rows in Dataframe and insert column based on values in list of dictionaries<p>I have a DataFrame and a list of dictionaries. The DataFrame has 84k rows. Each row is an account for a specific client.</p> <p>Each dict in the list belongs to a specific client. They can have up to 50 keys and as few as 2 keys...
<p>EDIT:</p> <p>Based on your comments, I'd first create a mapping <code>ClientID -&gt; List of Dictionaries</code>:</p> <pre class="lang-py prettyprint-override"><code>lst = [ { &quot;client&quot;: &quot;Client #1&quot;, &quot;Billing Code&quot;: &quot;TNL&quot;, &quot;Bank&quot;: 1, ...
*Not Iterate* Rows in Dataframe and insert column based on values in list of dictionaries
python|pandas|list|dictionary|list-comprehension
4
48
1
72,805,405
72,805,405
1
true
2022-06-29T16:50:10.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: *Not Iterate* Rows in Dataframe and insert column based on values in list of dictionaries<p>I have a DataFrame and a list of dictionaries. The DataFrame has ...
72,972,034
Get and update XML value with a certain attribute<p>I have a SQL table with an xml column that has values like this, across multiple rows:</p> <pre class="lang-xml prettyprint-override"><code>&lt;array&gt; &lt;foo&gt; &lt;property name=&quot;Name&quot;&gt;Foo 1&lt;/property&gt; &lt;property name=&quot;Gender&...
<p>Unfortunately, MS SQL Server XQuery implementation is not fully conformant with the XQuery standards. That's why XQuery <code>.modify()</code> method makes one update at a time.</p> <p>So we can update XML in a loop by using the XQuery <code>.exist()</code> method until there is nothing to update.</p> <p>Please up-v...
Get and update XML value with a certain attribute
sql|sql-server|xml|xquery
1
48
2
72,972,404
72,972,404
1
true
2022-07-13T20:05:52.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get and update XML value with a certain attribute<p>I have a SQL table with an xml column that has values like this, across multiple rows:</p> <pre class="la...
72,892,007
Python3 list remove string is too much time,i need efficient way<p><strong>This is my data list</strong></p> <pre><code>data_list = [ 'https://img2.doubanio.com/view/photo/s_ratio_poster/public/p2372307693.jpg', 'https://img2.doubanio.com/view/photo/s_ratio_poster/public/p2616355133.jpg', 'http://42.194.197.95:8001/po...
<p>use list comprehension to keep items not equal to x</p> <pre><code>def make_url(data_list, remove_str): data_list[:] = [x for x in data_list if remove_str != x] # this will change the original list </code></pre> <p>if you want to return a new list then use return statement inside your function.</p> <pre><...
Python3 list remove string is too much time,i need efficient way
python-3.x|list
1
48
2
72,892,027
72,892,027
1
true
2022-07-07T03:32:14.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python3 list remove string is too much time,i need efficient way<p><strong>This is my data list</strong></p> <pre><code>data_list = [ 'https://img2.doubanio....
72,793,812
Change the background color of a Navigation View in Swift 5<p>I have a Navigation View that looks like this:</p> <pre><code>NavigationView { VStack { Text(&quot;Choose ingredients&quot;) .font(.title) Text(&quot;to search for, &quot;) .font(.title) ...
<p>try this approach, works very well for me:</p> <pre><code>NavigationView { ZStack { // &lt;-- here Color.green.ignoresSafeArea() // &lt;-- here VStack { //... } } } </code></pre>
Change the background color of a Navigation View in Swift 5
swift|swiftui
0
48
1
72,794,095
72,794,095
1
true
2022-06-28T22:29:52.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the background color of a Navigation View in Swift 5<p>I have a Navigation View that looks like this:</p> <pre><code>NavigationView { VStack {...
72,973,451
How to scrape a website with many sibling elements, of which the number of them is uncertain? BeautifulSoup Python<p>I want to scrape video game's release information. The structure of all relevant tags is shown in this picture (the specific case is from this link: <a href="https://www.mobygames.com/game/ps2/007-nightf...
<p>To get siblings elements, you can follow the next example. So far so good,getting the desired output.</p> <pre><code>import requests from bs4 import BeautifulSoup headers={&quot;User-Agent&quot;: &quot;Mozilla/5.0&quot;} url = requests.get(&quot;https://www.mobygames.com/game/ps2/007-nightfire/release-info&quot;,he...
How to scrape a website with many sibling elements, of which the number of them is uncertain? BeautifulSoup Python
python|web-scraping|beautifulsoup|siblings
0
48
1
72,974,096
72,974,096
1
true
2022-07-13T22:49:32.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scrape a website with many sibling elements, of which the number of them is uncertain? BeautifulSoup Python<p>I want to scrape video game's release in...
72,794,835
What makes Outlook/Exchange able to resolve a recipient or not?<p>I am trying to test whether staff are still employed in the organization.</p> <p>The best approach I have found so far has to try send them an email.</p> <p>So, using Outlook, Exchange and Python, I put the email addresses into a new email and try &quot;...
<p>Firstly, there is no need to create a message and send it - use <code>Application.Session.CreateRecipient</code> / <code>Recipient.Resolve</code>. If <code>Recipient.Resolve</code> returns true, check <code>Recipient.AddressEntry.Type</code>, If it is <code>&quot;EX&quot;</code>, the name was resolved to a GAL user....
What makes Outlook/Exchange able to resolve a recipient or not?
python-3.x|email|outlook|exchange-server
0
48
1
72,795,470
72,795,470
1
true
2022-06-29T01:34:18.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What makes Outlook/Exchange able to resolve a recipient or not?<p>I am trying to test whether staff are still employed in the organization.</p> <p>The best a...
72,882,154
pickle dump method add wierd binary data<p>everyone!</p> <p>I write some binary data using pickle.dump() in a file, and read the file as below code.</p> <pre><code>import numpy as np import pickle save_file = open('test.rdb','wb') save_data = np.array([1, 2, 3]) pickle.dump(np.ndarray.tobytes(save_data),save_file) sav...
<p>I suggest instead of using pickle to dump file, use python default open function to open file in wb and then dump the file. It will not add any extra binary bytes when dumping.</p> <pre><code>binary_file = open('test.rdb', &quot;wb&quot;) binary_file.write(np.ndarray.tobytes(save_data)) binary_file.close() </code></...
pickle dump method add wierd binary data
python|binary|pickle|dump
0
48
1
72,997,068
72,997,068
1
true
2022-07-06T10:43:59.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pickle dump method add wierd binary data<p>everyone!</p> <p>I write some binary data using pickle.dump() in a file, and read the file as below code.</p> <pre...
72,861,428
red line after BufferedImage rotate<p>Why after orientation i have red line on image?</p> <pre><code>public class TestOrienationImg { public static void main(String[] args) throws IOException { BufferedImage bi = ImageIO.read(new File(&quot;D:\\IMG_7282.jpg&quot;)); ByteArrayOutputStream baos = new...
<p>The call <code>g2d.drawRect(0, 0, newWidth - 1, newHeight - 1);</code> uses the new image dimensions with the affine transform (orig-&gt;new) so you are not drawing a red box around the new image shape. One way to fix is to pass in the original dimensions:</p> <pre><code>g2d.drawRect(0, 0, w - 1, h - 1); </code></pr...
red line after BufferedImage rotate
java
0
48
1
72,861,762
72,861,762
1
true
2022-07-04T19:51:12.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: red line after BufferedImage rotate<p>Why after orientation i have red line on image?</p> <pre><code>public class TestOrienationImg { public static void ...
72,917,556
gcloud CLI application logs to bucket<p>There are Scala application Spark jobs that run daily in GCP. I am trying to set up a notification to be sent when run is compeleted. So, one way I thought of doing that was to get the logs and <code>grep</code> for a specific completion message from it (not sure if there's a bet...
<p>By default, Dataproc job driver logs are saved in GCS at the Dataproc-generated <code>driverOutputResourceUri</code> of the job. See this <a href="https://cloud.google.com/dataproc/docs/guides/dataproc-job-output#job_driver_output" rel="nofollow noreferrer">doc</a> for more details.</p> <p>But IMHO, a better way to ...
gcloud CLI application logs to bucket
scala|apache-spark|google-cloud-platform|log4j|google-cloud-dataproc
2
48
1
72,918,595
72,918,595
1
true
2022-07-08T22:22:39.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gcloud CLI application logs to bucket<p>There are Scala application Spark jobs that run daily in GCP. I am trying to set up a notification to be sent when ru...
72,914,617
Flutter - How to add two background color for same listtile<p>How to make a listtile like this. The trailing needs a different background color and must expand upto right extreme of the display. Can anyone help and show an example code to make similar to this.</p> <p><a href="https://i.stack.imgur.com/W1WXj.png" rel="n...
<p>It is simple,<br></p> <ul> <li>In trailing, Add <code>Container</code> and provide <code>decoration</code> for the circular border and backgroundColor.</li> <li>Add <code>Row</code> as a child to <code>Container</code> and set <code>mainAxisSize: MainAxisSize.min</code>.<br></li> </ul> <p>Code:</p> <pre><code>ListTi...
Flutter - How to add two background color for same listtile
flutter|dart|flutter-layout
0
48
2
72,914,961
72,914,961
1
true
2022-07-08T16:52:42.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter - How to add two background color for same listtile<p>How to make a listtile like this. The trailing needs a different background color and must expa...
72,954,488
gMock Visual Studio test crashes when using EXPECT_CALL<p>When running my test from the Test Explorer in Visual Studio 2022 [17.2.0], testhost.exe crashes when my unit test has a gMock EXPECT_CALL call in it. What am I doing wrong?</p> <p>Minimal code:</p> <pre><code>#include &lt;CppUnitTest.h&gt; #include &lt;CppUnitT...
<ol> <li>You mix the very different test frameworks.</li> <li>The more important thing is that you do not initialize Google test framework.</li> <li><code>TEST_CLASS</code>, <code>TEST_METHOD</code> are of another test framework, do not perform required pre and post stuff, Google mock is not supposed to work there.</li...
gMock Visual Studio test crashes when using EXPECT_CALL
c++|visual-studio|googlemock
-2
48
1
72,954,672
72,954,672
1
true
2022-07-12T15:04:51.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gMock Visual Studio test crashes when using EXPECT_CALL<p>When running my test from the Test Explorer in Visual Studio 2022 [17.2.0], testhost.exe crashes wh...
72,975,107
useRef is getting cleared when filtering array of objects<p>I've created one Demo Application where I've been able to add comments while clicking on the chat icon textarea will be expanded, currently, the functionality is I've created a reference using useRef of that particular text area using unique id, and I'm saving...
<p>Your comment ref should only contains comments, not includes textarea element. So you should create a component to handle textarea value</p> <pre><code>const TextArea = ({ value, handleSaveComment }) =&gt; { const ref = useRef(null); return ( &lt;&gt; &lt;textarea placeholder=&quot;Enter Here&q...
useRef is getting cleared when filtering array of objects
reactjs|react-hooks
0
48
1
72,975,277
72,975,277
1
true
2022-07-14T04:11:05.120Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: useRef is getting cleared when filtering array of objects<p>I've created one Demo Application where I've been able to add comments while clicking on the chat...
72,983,042
SQL to show lower limit provided the upper limit<p>I have sample dataset like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>rank</th> <th>Upper_limit</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>2.11</td> </tr> <tr> <td>2</td> <td>3</td> </tr> <tr> <td>3</td> <td>4.5</td> </tr> <...
<p>Using the <code>LAG()</code> analytic function we can try:</p> <pre class="lang-sql prettyprint-override"><code>SELECT [rank], LAG(Upper_limit, 1, 0) OVER (ORDER BY [rank]) AS Lower_limit, Upper_limit FROM yourTable ORDER BY [rank]; </code></pre>
SQL to show lower limit provided the upper limit
sql|sql-server|tsql
-1
48
2
72,983,127
72,983,127
1
true
2022-07-14T15:28:19.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL to show lower limit provided the upper limit<p>I have sample dataset like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> ...
72,884,053
Why quantile does not shows different results?<p>I am trying to use this solution here</p> <p><a href="https://stackoverflow.com/questions/70217551/how-to-rank-based-on-ecdf-in-r">How to rank based on ecdf in r?</a></p> <pre><code> dat[, .(quant = quants, val = ecdf(dist)(quantile(dist, quants))), by = rowval] </code><...
<p>&quot;Distance of distributions (dataset) from a reference dataset&quot;</p> <p>Sum-of-squares seems easiest:</p> <pre class="lang-r prettyprint-override"><code>quants &lt;- seq(0, 1, length.out = 51) ref &lt;- quantile(tt, quants) sumsq &lt;- sapply(list(gg=gg, ff=ff, ps=ps), function(z) sum( (quantile(z, quants) -...
Why quantile does not shows different results?
r
-1
48
1
72,885,241
72,885,241
1
true
2022-07-06T13:02:13.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why quantile does not shows different results?<p>I am trying to use this solution here</p> <p><a href="https://stackoverflow.com/questions/70217551/how-to-ra...
72,856,346
Smart slicer to filter out already selected value<p>I am looking for a way to build smart Slicer [Slice_2] that options out already selected option in Slicer [Slicer_1]. For instance if proj_short_name = NBA-UC-02 is selected on Slicer 1, Slicer 2 should display rest all except NBA-UC-02 as shown below.</p> <p><a href=...
<p>As user @Mik said in a comment:</p> <p>Hardly believe that this can be possible even in theory. The purpose of a slicer - filtering, so, If you have 2 slicers that contradicts each other nothing will be filtered. It's better to find an other idea for a data manipulation.</p>
Smart slicer to filter out already selected value
powerbi|dax|powerquery|powerbi-desktop
1
48
1
72,866,726
72,866,726
1
true
2022-07-04T11:59:02.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Smart slicer to filter out already selected value<p>I am looking for a way to build smart Slicer [Slice_2] that options out already selected option in Slicer...
72,927,160
React component's internal state is not updating when it is inside a context<p>I have a simple React component named <code>Child</code> which increments its count when clicked. Also, an outside state is saved which get updated when the <code>Child</code> component is incremented.</p> <pre><code>const Child = ({ onChang...
<p>First, the creation of a context should be outside of a Component, which means this line:</p> <pre><code>const AppContext = React.createContext() </code></pre> <p>should be outside of <code>App</code>. Second, a context setup can be simpler, as below (I separated each component in its own file, so it resembles to co...
React component's internal state is not updating when it is inside a context
javascript|reactjs|react-context
2
48
1
72,927,259
72,927,259
1
true
2022-07-10T08:31:30.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React component's internal state is not updating when it is inside a context<p>I have a simple React component named <code>Child</code> which increments its ...
72,839,590
E2015 Ambiguity between __fastcall IdGlobal::Sleep(unsigned int) and __stdcall Sleep(unsigned long)<p>I have a couple of problems compiling a very old application developed using C++ Builder 6 Pro. Both are in the same code block I copied above.</p> <ol> <li>E2015 Ambiguity between __fastcall IdGlobal::Sleep(unsigned i...
<p><code>IdGlobal</code> is a unit in the Indy package. It has its own <code>Sleep()</code> function declared in <code>IdGlobal.hpp</code> in the <code>Idglobal</code> namespace.</p> <p>The Win32 API also has its own <code>Sleep()</code> function declared in the global namespace.</p> <p>Since you are not qualifying whi...
E2015 Ambiguity between __fastcall IdGlobal::Sleep(unsigned int) and __stdcall Sleep(unsigned long)
c++builder
0
48
1
72,841,782
72,841,782
1
true
2022-07-02T13:58:10.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: E2015 Ambiguity between __fastcall IdGlobal::Sleep(unsigned int) and __stdcall Sleep(unsigned long)<p>I have a couple of problems compiling a very old applic...
72,910,825
Saving data from DB and then using it in body for API in cypress<p>I am trying to save a token from DB and pass the token in the next API request in the body I have written the below code but it's not working, please help.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fals...
<p>You have the wrong syntax for <code>cy.task()</code></p> <p>Instead of</p> <pre class="lang-js prettyprint-override"><code>const resetoken = cy.task(...) </code></pre> <p>it should be</p> <pre class="lang-js prettyprint-override"><code>cy.task(...).then(resetoken =&gt; { </code></pre> <p>Full test:</p> <pre class="l...
Saving data from DB and then using it in body for API in cypress
javascript|testing|cypress|web-api-testing|cypress-task
1
48
3
72,917,129
72,917,129
1
true
2022-07-08T11:37:59.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving data from DB and then using it in body for API in cypress<p>I am trying to save a token from DB and pass the token in the next API request in the body...
72,915,327
perform custom summarise function by group in R<p>this is my first time posting a question here so be easy on me, let me know if you have tips for making my questions clearer.</p> <p>I'm trying to initiate a function that will summarize given columns by group (&quot;c&quot;, &quot;e&quot;), which I've initialized as sh...
<pre class="lang-r prettyprint-override"><code>library(dplyr) library(rlang) dexadf &lt;- data.frame( stringsAsFactors = FALSE, participant = c(&quot;pt04&quot;,&quot;pt75&quot;,&quot;pt21&quot;,&quot;pt73&quot;, &quot;pt27&quot;,&quot;pt39&quot;,&quot;pt43&quot;,&quot;pt52&quot;,&quot;pt69&quot...
perform custom summarise function by group in R
r|group-by
0
48
1
72,915,565
72,915,565
1
true
2022-07-08T18:02:57.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: perform custom summarise function by group in R<p>this is my first time posting a question here so be easy on me, let me know if you have tips for making my ...
72,851,966
List items of each order in one row in SQL<p>I have a table of orders. I want to obtain table 2 from table 1.</p> <p>Table1:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">OrderID</th> <th style="text-align: left;">ItemId</th> </tr> </thead> <tbody> <tr> <td style...
<p>In the following code, I use <code>FOR JSON</code> to format <code>SELECT</code> result as JSON. The <code>FOR JSON</code> clause format the query results as JSON, instead of table.</p> <p>Here is the code:</p> <pre><code>SELECT T1.[OrderID], (SELECT T2.ItemId FROM OrderTable T2 WHERE T1.OrderID=T2.OrderID FOR ...
List items of each order in one row in SQL
json|sql-server|tsql
0
48
2
72,852,070
72,852,070
1
true
2022-07-04T05:03:24.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List items of each order in one row in SQL<p>I have a table of orders. I want to obtain table 2 from table 1.</p> <p>Table1:</p> <div class="s-table-containe...
72,868,396
Conditional statement to check if you are in a git repository in shell<p>I'm trying to edit my git bash terminal on Windows in the <code>C:/Program Files/Git/etc/profile.d/git-prompt.sh</code> directory and I want to check if my current working directory is a Git repository.</p> <p>Below is my current code:</p> <pre cl...
<p>How about</p> <pre><code>if git status -s 1&gt;&amp;2 2&gt;/dev/null then : You are in a git repo else : You are not fi </code></pre> <p><strong>UPDATE</strong> : A faster alternative to <code>git status -s</code> would be</p> <pre><code>git rev-parse -q --short HEAD </code></pre>
Conditional statement to check if you are in a git repository in shell
bash|git
0
48
1
72,868,590
72,868,590
1
true
2022-07-05T11:07:44.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional statement to check if you are in a git repository in shell<p>I'm trying to edit my git bash terminal on Windows in the <code>C:/Program Files/Git...
72,970,788
How to capture optional lines between matches using Regex?<p>I have this expression: <code>(?&gt;Division: (\d+))(?&gt;.*?\&quot;)?(.*?(?=\&quot;))?</code></p> <p>I would like to capture optional lines (you can see them under &quot;Division: 8&quot;) to a group 3 in matches. I haven't got the faintest idea how to captu...
<p>You might use:</p> <pre><code>\bDivision: (\d+)\b(?:[^\r\n\&quot;]*\&quot;([^\&quot;\r\n]*)\&quot;)?((?:\r?\n(?!Division:).*)*) </code></pre> <p>The pattern matches:</p> <ul> <li><code>\bDivision: </code></li> <li><code>(\d+)\b</code> Capture <strong>group 1</strong>, match 1+ digits followed by a word boundary</li>...
How to capture optional lines between matches using Regex?
c#|regex
0
48
1
72,971,959
72,971,959
1
true
2022-07-13T18:09:47.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to capture optional lines between matches using Regex?<p>I have this expression: <code>(?&gt;Division: (\d+))(?&gt;.*?\&quot;)?(.*?(?=\&quot;))?</code></...
72,812,467
How do I get functions from two different classes in two different files to communicate with each other?<p>I'm trying to make a text-based RPG. I have some code like:</p> <p>heroes.py:</p> <pre><code>class Hero(): def __init__(self): pass def Attack(self, target): # ... def TakeDamage(self, amount)...
<p><strong>Broadly speaking, classes don't have methods; instances do. The purpose of a class is to define a data type. You don't need to see that definition, in Python, in order to use instances.</strong></p> <p>Consider the code in the <code>Monster</code> class:</p> <pre><code> def TakeDamage(self, amount, target:...
How do I get functions from two different classes in two different files to communicate with each other?
python|class|methods
2
48
2
72,813,031
72,813,031
1
true
2022-06-30T08:19:31.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get functions from two different classes in two different files to communicate with each other?<p>I'm trying to make a text-based RPG. I have some c...
73,027,331
How do I make side row with pictures followed by texts in the bottom?<p>I'm doing a portfolio project and I'd like to do something similar to this, but it happens that when I'm doing the responsive part, the row pops out of the div. So i would like to know what do I do (or change) to make it decrease alongside the div...
<p>You can use <a href="https://www.w3schools.com/css/css3_flexbox.asp" rel="nofollow noreferrer">Flexbox</a> here's an example: <div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-css lang-css prettyp...
How do I make side row with pictures followed by texts in the bottom?
html|css
0
48
2
73,027,510
73,027,510
1
true
2022-07-18T19:00:50.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make side row with pictures followed by texts in the bottom?<p>I'm doing a portfolio project and I'd like to do something similar to this, but it h...
72,918,745
How to perform certain logics if a column matches regular expression in pandas dataframe?<p>I am struggling with mixed data type provided to me in Excel by my team members. The column contains text, whole number and decimals. This is pandas dataframe and contains more columns too. Below is the example.</p> <div class="...
<p>There are other ways than regex to do this, but this is a regex-y way.</p> <pre class="lang-py prettyprint-override"><code>import re def modify_value(x): # Doesn't start with a number if re.match('\D', x): return x # Starts with number leading with % elif re.match('\d+[%]',x): retur...
How to perform certain logics if a column matches regular expression in pandas dataframe?
python-3.x|regex|pandas|dataframe
-1
48
2
72,918,834
72,918,834
1
true
2022-07-09T03:33:10.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to perform certain logics if a column matches regular expression in pandas dataframe?<p>I am struggling with mixed data type provided to me in Excel by m...
72,820,368
Unsure why conditional column transform is not identifying values to update (Text.Contains)<p>I have a table of people records with various demographic information (Race, Ethnicity, Gender etc.).</p> <p>For <code>null</code> values in [Ethnicity] (i.e., Hispanic Y/N), I want to search the corresponding [Race] value for...
<p>Its the Replacer.ReplaceText which should be Replacer.ReplaceValue</p> <pre><code>cleanData = Table.ReplaceValue(rawData, each [Ethnicity], each if [Ethnicity] = null then if (Text.Contains([Race],&quot;non-Hispanic&quot;, Comparer.OrdinalIgnoreCase) or Text.Contains([Race],&quot;not Hispanic&quot;, ...
Unsure why conditional column transform is not identifying values to update (Text.Contains)
if-statement|powerbi|powerquery
0
48
2
72,820,792
72,820,792
1
true
2022-06-30T18:18:07.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unsure why conditional column transform is not identifying values to update (Text.Contains)<p>I have a table of people records with various demographic infor...
72,888,613
I don't understand how returning a number using the function processing it is able to work<p>Here is the code (python):</p> <pre><code>def is_integer(num): if isinstance(num, float): return num.is_integer() elif isinstance(num, int): return True else: return F...
<p><code>float.is_integer</code> quite literally just checks if <code>floor(num) == num</code>. In other words, it checks if rounding <code>num</code> down changes its value.</p> <p>Python3 source code from <a href="https://github.com/python/cpython/blob/main/Objects/floatobject.c" rel="nofollow noreferrer">Github</a>:...
I don't understand how returning a number using the function processing it is able to work
python|function|floating-point|integer
0
48
1
72,888,900
72,888,900
1
true
2022-07-06T18:56:23.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I don't understand how returning a number using the function processing it is able to work<p>Here is the code (python):</p> <pre><code>def is_integer(num): ...
72,918,022
How to use setState when finding intersection of list of lists in Flutter (Dart)<p>I have the following code. This is just created for being able to reproduce the problem, and I will explain what it does down below...</p> <pre><code>import 'package:flutter/material.dart'; class TestFile extends StatefulWidget { cons...
<p>In your intersection logic, you are intersecting between sets <code>[1, 2, 3, 4, 5], [4, 5, 6, 7, 8], and []</code> when buttons 0 and 1 are pressed. The common value between the three sets is the empty set. Change your intersection logic to filter out list elements that are empty:</p> <pre><code> final non...
How to use setState when finding intersection of list of lists in Flutter (Dart)
flutter|dart|flutter-layout
1
48
1
72,918,411
72,918,411
1
true
2022-07-09T00:06:12.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use setState when finding intersection of list of lists in Flutter (Dart)<p>I have the following code. This is just created for being able to reproduc...
72,818,515
Code works for "Today's Date" but I need to figure out for "This Week"<p>I loop through on my Razor page and turn the displayed row Tan if it meets the criteria of &quot;Today&quot;. How do I test to see if the date falls inside of &quot;This Week&quot;? I know it has something to do with the &quot;Between&quot; syntax...
<p>The notion of &quot;same week&quot; is particular to the type of calendar. So first you have to get a calendar that represents the culture you're interested in.</p> <p>From there, you can use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.globalization.calendar.getweekofyear?view=netframework-4.7.2" rel...
Code works for "Today's Date" but I need to figure out for "This Week"
c#|datetime|razor
1
48
1
72,818,891
72,818,891
1
true
2022-06-30T15:37:23.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Code works for "Today's Date" but I need to figure out for "This Week"<p>I loop through on my Razor page and turn the displayed row Tan if it meets the crite...
72,973,440
Understanding how a try except logic works within two while loops<p>I'm having trouble understanding the mechanism of my code. I want to retrieve the realtime price data of a crypto from an exchange and print it every second, while creating a retry mechanism that catches an exception when it occurs.</p> <pre><code>whil...
<p>I think that you are understanding everything just fine, but the code itself is a little silly and redundant. For example, setting <code>try_cnt</code> to <code>0</code> and then following that with <code>break</code> is pointless - both lines do the same thing. And unless there is some significance to the variable ...
Understanding how a try except logic works within two while loops
python|python-3.x|while-loop|try-catch
0
48
1
72,973,506
72,973,506
1
true
2022-07-13T22:47:53.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding how a try except logic works within two while loops<p>I'm having trouble understanding the mechanism of my code. I want to retrieve the realtim...
72,769,879
How to get / set the correct (formatted) yticks of a colorbar in matplotlib without whitespace in the colorbar?<p>How to get the correct yticks of a colorbar in matplotlib without whitespace in the colorbar?</p> <p>This is my code, note that the colors of the colorbar are misaligned if I apply .set_ticks() using the (f...
<p>By manually setting the ticks and tick labels, you create a fixed locator and a corresponding function formatter. Using a fixed locator is seldom the optimal solution due to the possible pitfalls outlined in the comments.</p> <p>If you just want to add a <code>%</code> sign and/or change the number of decimals, you ...
How to get / set the correct (formatted) yticks of a colorbar in matplotlib without whitespace in the colorbar?
python-3.x|matplotlib|geopandas|colorbar
1
48
1
72,772,520
72,772,520
1
true
2022-06-27T09:32:26.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get / set the correct (formatted) yticks of a colorbar in matplotlib without whitespace in the colorbar?<p>How to get the correct yticks of a colorbar...
72,804,348
React selectbox number value is passed as string<p>I have a controlled select in React with the values <code>0, 1, 2, 3, 4, 5, '5+', 'unknown'</code>. When selecting or changing the value I'm getting a string for every value instead of a number for the values 0, 1, 2, 3, 4 and 5.</p> <p>I was searching on Stackoverflow...
<p>With <code>isNaN</code> you can check if the value contains string. (ex: '5+') if isNan is true, value not parse number.</p> <pre><code>const handleChange = (e) =&gt; { .... .... var value = !isNaN(e.target.value) &amp;&amp; parseInt(e.target.value) ? parseInt(e.target.value) : e.target.value...
React selectbox number value is passed as string
reactjs
2
48
2
72,804,761
72,804,761
1
true
2022-06-29T15:48:23.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React selectbox number value is passed as string<p>I have a controlled select in React with the values <code>0, 1, 2, 3, 4, 5, '5+', 'unknown'</code>. When s...
72,962,554
How to disable field from View on Django?<p>I am struggling trying to disable it, but I am using the same <code>form</code> for two different views, and on one view I need to disable or readonly a field, how can I reach this?</p> <p>I reach this so far on <strong>VIEWS.py</strong></p> <pre><code>obj = ModelUpdate.objec...
<p>I presume you want to re-use a form in two separate views but have one version have a readonly field? If so, you could either have two versions of the form in your <code>forms.py</code> file, if the form code is not particularly long, or you could add some sort of check in the <code>def __init__</code> of the form t...
How to disable field from View on Django?
python-3.x|django
0
48
2
72,963,274
72,963,274
1
true
2022-07-13T07:38:27.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable field from View on Django?<p>I am struggling trying to disable it, but I am using the same <code>form</code> for two different views, and on o...
72,917,468
Convert SDO_ORDINATE_ARRAY to built-in VARRAY (to create function-based index)<p><em>Oracle 18c:</em></p> <p>I can get <code>SDO_ORDINATE_ARRAY</code> values from <code>SDO_GEOMETRY</code> objects:</p> <pre><code>create table test_table (shape sdo_geometry); insert into test_table (shape) values (sdo_geometry('linestr...
<p>You state:</p> <blockquote> <p>the definition of the <code>MDSYS.SDO_ORDINATE_ARRAY</code> type looks like in SQL Developer:</p> <pre class="lang-sql prettyprint-override"><code>create or replace TYPE SDO_ORDINATE_ARRAY AS VARRAY(1048576) OF NUMBER </code></pre> </blockquote> <p>and then ask:</p> <blockquote> <p>Is ...
Convert SDO_ORDINATE_ARRAY to built-in VARRAY (to create function-based index)
sql|oracle|indexing|oracle18c|varray
0
48
1
72,917,673
72,917,673
1
true
2022-07-08T22:09:49.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert SDO_ORDINATE_ARRAY to built-in VARRAY (to create function-based index)<p><em>Oracle 18c:</em></p> <p>I can get <code>SDO_ORDINATE_ARRAY</code> values...
72,862,457
While loops continues until specific user input is triggered<p>This program takes a String followed by an integer as input and then outputs a sentence using the inputs. The program repeats until the string &quot;quit&quot; is typed. It appears the problem is with the nextLine() and nextInt() but I cannot wrap my head a...
<p>You are using the scanner only in the beginning and then saving the values in variables. So you only use the values in your loop. Therefore you need to let the user enter new inputs every iteration of the loop.</p> <p>Move <code>inputStr</code> and <code>inputInt</code> inside your loop:</p> <pre><code>String inputS...
While loops continues until specific user input is triggered
java|while-loop|java.util.scanner
0
48
2
72,862,501
72,862,501
1
true
2022-07-04T22:17:38.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: While loops continues until specific user input is triggered<p>This program takes a String followed by an integer as input and then outputs a sentence using ...
73,008,841
How to upload to S3 bucket with public policy<p>I created an S3 bucket with the policy below and have set &quot;Block all public access&quot; to &quot;off&quot; and am currently able to download some CSV files I have stored in the bucket into my Jupyter Notebook. That works great but I'm not able to upload to the bucke...
<p>You need to add &quot;s3:PutObject&quot; to the bucket policy so you can upload the objects.</p> <p>To get credentials for a federated user, you can go to AWS console and choose &quot;Command line or programmatic access&quot; and then get &quot;aws_access_key_id&quot;, &quot;aws_secret_access_key&quot; and &quot;aws...
How to upload to S3 bucket with public policy
amazon-web-services|amazon-s3
1
48
1
73,008,981
73,008,981
1
true
2022-07-17T02:17:16.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to upload to S3 bucket with public policy<p>I created an S3 bucket with the policy below and have set &quot;Block all public access&quot; to &quot;off&qu...
73,011,862
How to save video to phone gallery - Dio/Flutter<p>I'm trying to save the video in the phone gallery (downloaded using dio package) To get the path, I'm using path provider package but unable to save it in the phone gallery</p> <p>Here is my code</p> <pre><code>void downloadVideo() async { var dir = await getExterna...
<p>So you already have the saving directory. You can use plugins like <a href="https://pub.dev/packages/image_gallery_saver" rel="nofollow noreferrer">image_gallery_saver</a> and <a href="https://pub.dev/packages/gallery_saver" rel="nofollow noreferrer">gallery_saver</a> to save your downloaded video to the gallery.</p...
How to save video to phone gallery - Dio/Flutter
flutter|dart|dio
1
48
1
73,012,025
73,012,025
1
true
2022-07-17T12:40:45.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save video to phone gallery - Dio/Flutter<p>I'm trying to save the video in the phone gallery (downloaded using dio package) To get the path, I'm usin...
73,006,263
Pods in differents Nodes can't talk each other - Kubernetes<p><strong>Context:</strong></p> <p>I am building an application and now I am on the infrastructure step.</p> <p>The application is built with Java and persistence layer is MongoDB.</p> <p><strong>Problem:</strong></p> <p>If the application is running in same N...
<p>I was using calico as CNI.</p> <p>I removed calico and let kube-proxy take care of everything.</p> <p>Now everything is working fine.</p>
Pods in differents Nodes can't talk each other - Kubernetes
mongodb|kubernetes|quarkus
0
48
1
73,012,504
73,012,504
1
true
2022-07-16T17:17:39.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pods in differents Nodes can't talk each other - Kubernetes<p><strong>Context:</strong></p> <p>I am building an application and now I am on the infrastructur...
72,925,188
How to use data from inside of a function out side of the function in Python?<p>So I am new to python, I'm taking classes online, self learning, but I need to know how to pull information out of one function and use it elsewhere in my code.</p> <p>for example:</p> <pre><code>def yes_responce(): print(&quot;Good! I'...
<p>When you define a variable inside of a function, it's called a local variable and is only accessible within that function unless you include it in the return statement. So, if you want a variable to be accessible globally, then you could write:</p> <pre class="lang-py prettyprint-override"><code> def greeting(): ...
How to use data from inside of a function out side of the function in Python?
python|function
-1
48
1
72,925,243
72,925,243
1
true
2022-07-09T23:10:52.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use data from inside of a function out side of the function in Python?<p>So I am new to python, I'm taking classes online, self learning, but I need t...
72,934,302
How to use material ui props with media queries<p>I just need to know that how to use material ui props with media queries? As an example, let's say I have a typography component and I assigned variant prop to h1 and then I need variant prop to change h5 at the screen size less than 600px.</p> <p>How to do that?</p> <p...
<p>You can use <code>useTheme</code> and <code>useMediaQuery</code> like below:</p> <pre><code>function Test() { const theme = useTheme(); const matches = useMediaQuery(theme.breakpoints.up(&quot;sm&quot;)); return ( &lt;Typography variant={matches ? &quot;h1&quot; : &quot;h5&quot;}&gt; my text ... ...
How to use material ui props with media queries
material-ui
1
48
1
72,936,817
72,936,817
1
true
2022-07-11T06:03:18.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use material ui props with media queries<p>I just need to know that how to use material ui props with media queries? As an example, let's say I have a...
72,997,280
Xamarin Forms Shell flyoutitem tittle color<p>I want to change the color of option titles and selected option how can i do that?</p> <p><a href="https://i.stack.imgur.com/7A4kf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7A4kf.png" alt="output" /></a></p>
<p>The default Xamarin.Forms Project template is going to put <em>styles</em> like <code>FlyoutItemLabelStyle</code>, <code>FlyoutItemLayoutStyle</code> and <code>MenuItemLayoutStyle</code> in the <code>Shell.Resources</code> element of <strong>AppShell.xaml</strong>. These styles, in turn, will have many references t...
Xamarin Forms Shell flyoutitem tittle color
c#|xamarin|xamarin.forms
0
48
1
73,007,159
73,007,159
1
true
2022-07-15T16:46:29.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xamarin Forms Shell flyoutitem tittle color<p>I want to change the color of option titles and selected option how can i do that?</p> <p><a href="https://i.st...
72,785,737
Worksheet_Change module preventing sheet protection<p>I have a Worksheet_Change module in a worksheet, which allows me to select multiple, comma separated, non-repeatable numbers from a dropdown list, displayed in a single cell, e.g $C$4 will read &quot;00004, 00006, 00009&quot; etc. This is the code (which I copied ve...
<p>EDIT: added &quot;remove item on re-selection&quot;</p> <p>This will work on a protected sheet, since it doesn't use <code>SpecialCells</code>:</p> <pre class="lang-vb prettyprint-override"><code>Private Sub Worksheet_Change(ByVal Target As Range) Const SEP As String = &quot;, &quot; Dim Oldvalue As String, ...
Worksheet_Change module preventing sheet protection
excel|vba
0
48
1
72,789,759
72,789,759
1
true
2022-06-28T11:40:00.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Worksheet_Change module preventing sheet protection<p>I have a Worksheet_Change module in a worksheet, which allows me to select multiple, comma separated, n...
72,965,765
Create a regular expression that continues to extract information if and only if the following pattern is met using it as a condition<pre class="lang-py prettyprint-override"><code>import re def fun(x): match=re.search(r&quot;(?&lt;=hay que) ([\w\s,]+) ([\w\s]+)&quot;,x) if match: for i in re.split(',|...
<p>I would suggest first find what should be writen:</p> <pre><code>x = 'hay que trabajar, escalar y no temer si quieres llegar a la meta' s = re.search(r'( las .*)|( los .*)|( para .*)|( si .*)', x) content = s.group(0) </code></pre> <p>Then remove what you not want from you string:</p> <pre><code>x = x.replace('hay q...
Create a regular expression that continues to extract information if and only if the following pattern is met using it as a condition
python|python-3.x|regex|file|python-re
0
48
1
72,967,150
72,967,150
1
true
2022-07-13T11:48:40.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a regular expression that continues to extract information if and only if the following pattern is met using it as a condition<pre class="lang-py pret...
72,847,471
How to fix public route in react router v6 showing the login for a spli second<p>I have a problem with public and private route. In which when the user is already authenticated the private and public routes work. But for some reason when I refresh to the homepage it shows the login page for a split second.</p> <p>How d...
<p>You should ensure that your &quot;unauthenticated&quot; state value doesn't match the &quot;I don't know the authentication status&quot; state value. What this means for example, if <code>auth.user</code> being <code>true</code> or some defined user object equals a user being considered &quot;authenticated&quot; and...
How to fix public route in react router v6 showing the login for a spli second
reactjs|firebase-authentication|routes|react-router|react-router-dom
1
48
1
72,849,314
72,849,314
1
true
2022-07-03T14:50:47.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix public route in react router v6 showing the login for a spli second<p>I have a problem with public and private route. In which when the user is al...
72,989,668
Svelte selection based master/detail not updating correctly<p>Bear with me, Svelte newbie question coming.</p> <p>I have a selection based Master/Detail view like the following simplified version:</p> <pre><code>&lt;script&gt; let data = [{ x: 10},{ x: 20},{ x:30}] let selected = data[1]; &lt;/script&gt; &lt;ta...
<p>Svelte does not know that <code>row.x</code> and <code>selected.x</code> might be referring to the same thing, which is why the first version of the code does not work as expected.</p> <p>The second version only works because of this reactive statement:</p> <pre class="lang-js prettyprint-override"><code>$: selected...
Svelte selection based master/detail not updating correctly
svelte
3
48
1
72,989,835
72,989,835
1
true
2022-07-15T06:05:23.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Svelte selection based master/detail not updating correctly<p>Bear with me, Svelte newbie question coming.</p> <p>I have a selection based Master/Detail view...
72,856,388
JavaScript skip await on pending fetch<p>I have an API fetch await code that fetches list of nodes in an array. The problem is, some of the nodes don't respond for whatever reason (being offline, wrong port, being programmed NOT to respond, ... ) and my code is stuck awaiting a reply from that node.</p> <p>Is there any...
<p>try this</p> <pre><code> async function fetchWithTimeout(resource, options = {}) { const { timeout = 8000 } = options; const controller = new AbortController(); const id = setTimeout(() =&gt; controller.abort(), timeout); const response = await fetch(resource, { ...options, signal: controller.sign...
JavaScript skip await on pending fetch
javascript|asynchronous|async-await
2
48
1
72,856,525
72,856,525
1
true
2022-07-04T12:01:35.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript skip await on pending fetch<p>I have an API fetch await code that fetches list of nodes in an array. The problem is, some of the nodes don't respo...
72,392,774
Conv 1d and its input<p>I have a numpy array of array with shape (273, 168) so 273 sample and every sample has 168 observation.</p> <p>I want as output 273 array of 24 observations.</p> <p>Why my code give me a problem of dim differences?</p> <pre><code>x = np.random.randint(0,1,(273,168)) y = np.random.randint(0,1,(27...
<p>If you check the error message that you get, you can see that the required number of dimensions is 3, you are passing just 2 (n_samples, n_features), you need to reshape you data using <code>.reshape(n_samples, 1, n_features)</code> your <code>input_shape</code> is also incorrect.</p> <p>Finally, you need to set <co...
Conv 1d and its input
python|tensorflow|keras|conv-neural-network|keras-layer
0
48
1
72,395,312
72,395,312
1
true
2022-05-26T13:39:01.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conv 1d and its input<p>I have a numpy array of array with shape (273, 168) so 273 sample and every sample has 168 observation.</p> <p>I want as output 273 a...
72,386,100
Typescript generics for type A is a Class and B is a class that implements Interface<A><p>I would like to have a type safe register function that registers a WorkerOf with two arguments and two generic types so that consumers have to register a ClassA with the corresponding WorkerOfA.</p> <pre class="lang-js prettyprin...
<p>Your <a href="https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints" rel="nofollow noreferrer">generic constraints</a> of the form <code>T extends Constructor&lt;T&gt;</code> don't mean what you want them to mean. If you need <code>T</code> to be a constructor type, <code>T extends Constr...
Typescript generics for type A is a Class and B is a class that implements Interface<A>
typescript|generics|typescript-generics
1
48
1
72,396,978
72,396,978
1
true
2022-05-26T02:37:18.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript generics for type A is a Class and B is a class that implements Interface<A><p>I would like to have a type safe register function that registers a...
72,397,221
I made my navbar fixed and now it's transparent no matter what I style the background color to be. How can I fix this?<p>I tried to create a fixed bar with this code, but after I created it, it became transparent even after I added a background color.</p> <pre><code>.header-nav{ width: 100%; display: flex; justif...
<p>I'm not entirely sure what you mean by transparent but it sounds like you might be seeing content <em>on top of</em> the header, not underneath it. Try setting a <code>z-index</code> on your header to force it to the top of the stack.</p> <pre class="lang-css prettyprint-override"><code>.header-nav{ width: 100%; ...
I made my navbar fixed and now it's transparent no matter what I style the background color to be. How can I fix this?
html|css|navbar|background-color
-1
48
1
72,397,503
72,397,503
1
true
2022-05-26T19:43:16.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I made my navbar fixed and now it's transparent no matter what I style the background color to be. How can I fix this?<p>I tried to create a fixed bar with t...
72,400,312
How do I filter my web scraping result to not have /n or tab<p>I am scraping data from a job market website. My scrape return the result that I want but it is full of /n, /t or a lot of spacing. How do I filter the result to get just the contents?</p> <p>This is my code:</p> <p><div class="snippet" data-lang="js" data-...
<p>You can use the regex <code>\s+</code> to match all whitespace (space, tab and newline) in your string and remove it with <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace" rel="nofollow noreferrer"><code>replace</code></a>. You can then either <a href="https://...
How do I filter my web scraping result to not have /n or tab
javascript|node.js|web-scraping|web-crawler|puppeteer
0
48
1
72,400,362
72,400,362
1
true
2022-05-27T03:56:30.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I filter my web scraping result to not have /n or tab<p>I am scraping data from a job market website. My scrape return the result that I want but it i...
72,382,261
Hibernate Validator: Method constraints not evaluated<p>I have a simple class, which I'd like to validate:</p> <pre><code>public class Model { @NotNull private String someField; @AssertTrue public boolean methodConstraint() { ... } } </code></pre> <p>This class is validated as part of the inputs of a s...
<p>Assuming you have something like</p> <pre><code>@Controller class ModelController { ... public Result mappedMethod(@Valid Model model) { ... } } </code></pre> <p>then the model will be validated as a JavaBean. Meaning only fields and getters will be considered.</p> <p>If a model class is modified...
Hibernate Validator: Method constraints not evaluated
java|hibernate-validator|spring-validator
0
48
1
72,402,015
72,402,015
1
true
2022-05-25T17:58:02.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hibernate Validator: Method constraints not evaluated<p>I have a simple class, which I'd like to validate:</p> <pre><code>public class Model { @NotNull ...
72,387,722
Has there been a fix for this issue related to celery? https://github.com/celery/celery/issues/3519<p>Celery seems to be picking both my old code and new code. I have tried clearing cache, clearing the broker queue(redis), restarting celery etc. But none of them seem to be fixing this issue.</p> <p>For context, we have...
<p>OP, the problem is almost invariably that your servers include old code on them. There are two possible issues:</p> <ol> <li>the <code>checkout</code> command fails. <code>checkout</code> can fail to switch branches if there are local changes on a directory. In addition, the deployment script doesn't <code>pull</...
Has there been a fix for this issue related to celery? https://github.com/celery/celery/issues/3519
celery|django-celery|celery-task
-1
48
1
72,425,610
72,425,610
1
true
2022-05-26T06:37:38.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Has there been a fix for this issue related to celery? https://github.com/celery/celery/issues/3519<p>Celery seems to be picking both my old code and new cod...
72,371,742
Fixing coin change Backtracking solution(bruteforce)<p>I know the optimal problem for this solution is using dynamic programming. However, I wanted to try this bruteforce backtracking approach where I subtract the coin from the amount and try to find combinations that match that amount and find the minimum of the lengt...
<pre class="lang-py prettyprint-override"><code>class Solution: def coinChange(self, coins: List[int], amount: int) -&gt; int: if amount == 0: return 0 output = amount+1 def backtrack(cur,arr): if cur == 0: nonlocal output output = m...
Fixing coin change Backtracking solution(bruteforce)
python|backtracking|recursive-backtracking
0
48
1
72,384,517
72,384,517
1
true
2022-05-25T03:45:23.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fixing coin change Backtracking solution(bruteforce)<p>I know the optimal problem for this solution is using dynamic programming. However, I wanted to try th...
72,301,113
does mkl_vml_serv_threader in the gprofile means MKL is not running sequentially<p>We're running an application that's in the process of being MKL BLAS enhaced. We've been told not to hyperthread.</p> <p>In order for multithreaded (so-called parallel?) version to not be considered during compilation, i.e. to disable hy...
<p>By default, Intel® oneAPI Math Kernel Library uses the number of OpenMP threads equal to the number of physical cores on the system and it runs on all the available physical cores until and unless we mention some options which are mentioned below.</p> <p>Intel compilers like icc(latest) have a compiler option -qmkl=...
does mkl_vml_serv_threader in the gprofile means MKL is not running sequentially
c++|intel|icc|xeon-phi|intel-oneapi
0
48
1
72,302,798
72,302,798
1
true
2022-05-19T08:27:36.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: does mkl_vml_serv_threader in the gprofile means MKL is not running sequentially<p>We're running an application that's in the process of being MKL BLAS enhac...
72,380,459
Symmetric random tensor with high dimension numpy/pytorch<p>I wish to create a random symmetric tensor such that for each permutation of indices <code>i1, i2,...,ik</code> i will have:</p> <pre><code>a[i1][i2]...[ik] = a[pi(i1)][pi(i2)]...[pi(ik)] </code></pre> <p>Where <code>pi</code> is a permutation function. For ex...
<p>AFAIK there is no function for that in either <code>torch</code> nor <code>numpy</code>, but one might add all dimensionality permutated tensors to make it symmetric across every dimension.</p> <p>This has:</p> <ul> <li><code>O(size^dims)</code> - memory complexity (as generators are used)</li> <li><code>O(dims! * s...
Symmetric random tensor with high dimension numpy/pytorch
python|numpy|pytorch
0
48
1
72,385,084
72,385,084
1
true
2022-05-25T15:30:23.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symmetric random tensor with high dimension numpy/pytorch<p>I wish to create a random symmetric tensor such that for each permutation of indices <code>i1, i2...
72,255,032
Servicestack AutoQuery -> System.TypeLoadException Error<p>I'm trying to servicify an existing RDBMS with C# AutoQuery, but getting this error:</p> <pre><code> HResult=0x80131522 Message=Type 'WebApplication1.ServiceModel.CreateCurrency' from assembly 'tmpCrudAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToke...
<p>You can control the tables that <a href="https://docs.servicestack.net/autoquery-autogen" rel="nofollow noreferrer">AutoGen</a> generates the data models and APIs for when configuring the <code>GenerateCrudServices</code> instruction, e.g you can exclude a specific table with:</p> <pre class="lang-cs prettyprint-ove...
Servicestack AutoQuery -> System.TypeLoadException Error
c#|servicestack|ormlite-servicestack|servicestack-autoquery
1
48
1
72,284,578
72,284,578
1
true
2022-05-16T06:41:26.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Servicestack AutoQuery -> System.TypeLoadException Error<p>I'm trying to servicify an existing RDBMS with C# AutoQuery, but getting this error:</p> <pre><cod...
72,318,792
What is the correct way to pass an object as prop in React?<p>I want to pass an object of image URL's as a prop to a child component and use it in the src attribute of an image component. However I keep getting an error saying that my object key (image1,2 or 3) is undefined. I tried it without destructuring and the sam...
<p>I suggest you to pass an array of images into the <code>&lt;ProjectPreview /&gt;</code>component. Then, iterate throught it to display <code>&lt;Image /&gt;</code> component.</p> <p>ProjectSection.js:</p> <pre><code>const images = Object.values(imgUrls); return ( &lt;div className=&quot;col-md-6 col-lg-4 px-0&quo...
What is the correct way to pass an object as prop in React?
javascript|node.js|reactjs
-3
48
2
72,320,291
72,320,291
1
true
2022-05-20T12:18:09.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the correct way to pass an object as prop in React?<p>I want to pass an object of image URL's as a prop to a child component and use it in the src at...
72,289,714
How to validate Hugging Face organization token?<p><code>/whoami-2</code> endpoint returns <code>Unauthorized</code> for organization tokens, the ones that start with <code>api_...</code>.</p> <pre><code>$ curl https://huggingface.co/api/whoami-2 -H &quot;Authorization: Bearer api_&lt;token&gt;&quot; &gt; { &quot;error...
<p>you are requesting to the wrong endpoint. It seems the endpoint is updated and I got a similar error with sending requests to the older endpoint (<code>whoami</code>).</p> <p>just send the request to <code>whoami-v2</code> like:</p> <pre><code>$ curl https://huggingface.co/api/whoami-v2 -H &quot;Authorization: Beare...
How to validate Hugging Face organization token?
curl|huggingface-transformers|huggingface
1
48
1
72,297,034
72,297,034
1
true
2022-05-18T13:00:33.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to validate Hugging Face organization token?<p><code>/whoami-2</code> endpoint returns <code>Unauthorized</code> for organization tokens, the ones that s...
72,266,366
Vertically stack 4 tables in matplotlib<p>I need to recreate this structure in matplotlib <a href="https://i.stack.imgur.com/uUMSn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uUMSn.png" alt="enter image description here" /></a></p> <pre><code>import matplotlib.pyplot as plt fig, (ax1, ax2, ax3, ...
<p>The problem you're running into is that <code>subplots</code> assumes that all of your tables will be the same size. Since this is not the case, you end up with tables that are larger the the underlying <code>Axes</code> objects.</p> <p>If your case you have your tables in advance so you can estimate their sizes bas...
Vertically stack 4 tables in matplotlib
python|matplotlib
1
48
1
72,266,578
72,266,578
1
true
2022-05-16T22:44:41.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vertically stack 4 tables in matplotlib<p>I need to recreate this structure in matplotlib <a href="https://i.stack.imgur.com/uUMSn.png" rel="nofollow norefer...
72,306,804
How to run a set of functions over given list of variable names and write the output to a table?<p>What I'm seeking to do is run a mean/standard deviation calculation, as well as a statistical test, along a set of variables. What seems right to do is build the function such that one can pass the list of column names th...
<p>You can write a function <code>f()</code> that takes the data, the group variable, and the variable of interest, and return the statistics.. You would need to modify the below example for survey data, but this might give you starting point.</p> <pre><code>f &lt;- function(df, g, v) { v_string = quo_name(enquo(v...
How to run a set of functions over given list of variable names and write the output to a table?
r|function|statistics|tibble
1
48
1
72,307,813
72,307,813
1
true
2022-05-19T14:55:53.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run a set of functions over given list of variable names and write the output to a table?<p>What I'm seeking to do is run a mean/standard deviation ca...
72,307,331
Function starts when page charges and outerHTML error<p>I'm trying to make an Excel Sheet with a javascript function in React, but when I try to enter to the page, and the button which has the onClick is not working.</p> <pre><code> export default function DescargaExcelHTML() { const descargaExcel = (tableID, filenam...
<p>Try changing: <br/> <em>onClick={descargaExcel(&quot;prueba&quot;, &quot;pruebaDescarga&quot;)}</em> <br/> By: <br/> onClick={() =&gt; descargaExcel(&quot;prueba&quot;, &quot;pruebaDescarga&quot;)} <br/></p>
Function starts when page charges and outerHTML error
javascript|reactjs|excel
0
48
1
72,307,572
72,307,572
1
true
2022-05-19T15:33:46.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function starts when page charges and outerHTML error<p>I'm trying to make an Excel Sheet with a javascript function in React, but when I try to enter to the...
72,391,461
I want to make my program tell the user that there input is invalid for a multiple choice question<p>I have a multiple choice question but I want the code to tell the user that there input is wrong if they have inputted an invalid answer:</p> <p><a href="https://i.stack.imgur.com/fCtz8.png" rel="nofollow noreferrer">ht...
<pre class="lang-py prettyprint-override"><code>while True: deliveryselect=input('Do you want delivery? \n Yes: Delivery\n No: No delivery \n \n') if deliveryselect=='Yes'or deliveryselect=='yes': print('Thank You') break elif deliveryselect =='No' or deliveryselect=='no': print('Tha...
I want to make my program tell the user that there input is invalid for a multiple choice question
python
-1
48
2
72,391,713
72,391,713
1
true
2022-05-26T11:58:50.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to make my program tell the user that there input is invalid for a multiple choice question<p>I have a multiple choice question but I want the code to...
72,377,683
WPF Control Style of Button not detecting IsMouseOver<p>So I am trying to create button style (background opacity to black with 20% alpha and default colour of text changes to clear white) with using <code>ResourceDictionary</code>. I do include file into <code>App.xaml</code> like:</p> <pre><code> &lt;ResourceD...
<p>Setting</p> <pre><code>&lt;Button ... Background=&quot;Transparent&quot;/&gt; </code></pre> <p>directly on the Button sets a so-called <em>local value</em>, which takes higher precedence than a value set by a Style Setter or a Setter in a Style Trigger.</p> <p>Any value that should be changed by a Style Trigger can ...
WPF Control Style of Button not detecting IsMouseOver
wpf|xaml
-1
48
1
72,378,052
72,378,052
1
true
2022-05-25T12:29:39.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF Control Style of Button not detecting IsMouseOver<p>So I am trying to create button style (background opacity to black with 20% alpha and default colour ...
72,317,656
Passing an CSVExport function to a handler Gin<p>I have created a CSV export function for my to-do list application. The function is working, the handler is returning a written file but I get a strange panic in the console from the Gin framework:</p> <blockquote> <p>http: wrote more than the declared Content-Length</p>...
<p>Your code has some error:</p> <ul> <li>You need to return on error</li> <li>You can't return JSON after returning your file with fileAttachment (it already does this stuff)</li> </ul> <pre class="lang-golang prettyprint-override"><code>func CSVExport(data model.ListOperations) gin.HandlerFunc { return func(c *gi...
Passing an CSVExport function to a handler Gin
go
2
48
1
72,319,769
72,319,769
1
true
2022-05-20T10:48:48.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing an CSVExport function to a handler Gin<p>I have created a CSV export function for my to-do list application. The function is working, the handler is ...
72,309,380
Filter dataframe in R<p>I'm trying to see the change of occupations in the industry over time, so I have the occupations IDs like an engineer, teacher, and lawyer, and several IDs that correspond to the sector like construction, education, mineral extraction, fishing... I would like to extract, from each occupation -an...
<pre><code>library(dplyr) x %&gt;% arrange(desc(Change_occ_2000_2022)) %&gt;% slice(c(1:3, (nrow(.) - 2):nrow(.))) </code></pre> <p><strong>Output</strong></p> <pre><code> occ_id Ind_id Change_occ_2000_2022 1 4321 1112 50 2 1234 1112 30 3 4321 52417 ...
Filter dataframe in R
r|dataframe|filter|nest
0
48
4
72,309,463
72,309,463
1
true
2022-05-19T18:18:07.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter dataframe in R<p>I'm trying to see the change of occupations in the industry over time, so I have the occupations IDs like an engineer, teacher, and l...
72,397,613
Rolling sum across subsets<p>I have a data set with values ('ee') of interest by quarter, and multiple fields which indicate the amount of ee in various subsets of the population, as follows:</p> <pre><code>test=pd.DataFrame(data={'cyq':['2018Q1']*3+['2018Q2']*3+['2018Q3']*3+['2018Q4']*3, 'species':[...
<p><strong>EDIT2</strong> Again, regarding to the comments, here a possible solution? Please try it on your real data and validate it.</p> <pre><code>test['cyq']= pd.to_datetime(test['cyq']) test=test.set_index('cyq').groupby(['species','group']).rolling('100D',min_periods=2).sum() </code></pre> <p><strong>EDIT</stron...
Rolling sum across subsets
python|python-3.x|pandas
1
48
2
72,397,943
72,397,943
1
true
2022-05-26T20:19:36.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rolling sum across subsets<p>I have a data set with values ('ee') of interest by quarter, and multiple fields which indicate the amount of ee in various subs...
72,278,141
Using std::async with a method receiving a cv::OutputArray in order to assign it doesn't work<p>I have the following function:</p> <pre class="lang-c++ prettyprint-override"><code>void MyClass::myFunc(cv::OutputArray dst) const { cv::Mat result; ... dst.assign(result); } </code></pre> <p>If I run it like th...
<p><strong>The root cause</strong> is that passing arguments by reference (&amp;) to a function to run via <a href="https://en.cppreference.com/w/cpp/thread/async" rel="nofollow noreferrer"><code>std::async</code></a> is problematic. You can read about it here: <a href="https://stackoverflow.com/questions/18359864/pass...
Using std::async with a method receiving a cv::OutputArray in order to assign it doesn't work
c++|opencv|concurrency|future|stdasync
1
48
1
72,278,653
72,278,653
1
true
2022-05-17T17:11:17.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using std::async with a method receiving a cv::OutputArray in order to assign it doesn't work<p>I have the following function:</p> <pre class="lang-c++ prett...