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,803,666
Static count of JavaScript Class instances<p>Is there a way to keep a static count of instances along the lines of</p> <pre><code>class Myclass { static s = 0; // static property p = 0; // public field declaration constructor() { console.log(&quot;new instance!&quot;) this...
<p>Yes, you can use <code>static</code> but you cannot use <code>this</code> (as that refers to the specific instance). Instead use the classname.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettypri...
Static count of JavaScript Class instances
javascript|class|properties
0
39
1
72,803,736
72,803,736
2
true
2022-06-29T15:02:38.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Static count of JavaScript Class instances<p>Is there a way to keep a static count of instances along the lines of</p> <pre><code>class Myclass { static ...
72,806,140
Call a variadic function in Go<p>I have code where I am calling <code>filepath.Join</code> as described in the following program. However, I see an error</p> <p>Program:</p> <pre><code>package main import ( &quot;fmt&quot; &quot;path/filepath&quot; ) func main() { myVal := joinPath(&quot;dir1&quot;, &quot...
<p>You can't mix a slice and explicit elements for a variadic parameter, for details, see <a href="https://stackoverflow.com/questions/28625546/mixing-exploded-slices-and-regular-parameters-in-variadic-functions/28626170#28626170">mixing &quot;exploded&quot; slices and regular parameters in variadic functions</a></p> <...
Call a variadic function in Go
go|slice|variadic
-2
39
1
72,806,220
72,806,220
2
true
2022-06-29T18:20:59.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call a variadic function in Go<p>I have code where I am calling <code>filepath.Join</code> as described in the following program. However, I see an error</p>...
72,810,324
Why does Typescript Union + Mapped Types work differently with and without Generics<p>I am new to using generics. The following code has different &quot;w0&quot; and &quot;w1&quot;, but the code looks the same.</p> <p>Why they are different, and how I can get the opposite type in the opposite way.</p> <p>I've looked th...
<p>The first problem is easy to solve:</p> <pre><code>type Q1 = { [B in Base as B[&quot;type&quot;]]: { [K2 in keyof B]: B[K2] } }[Base[&quot;type&quot;]] // type Q1 = { // type: 'A'; // name: string; // flag: number; // } | { // type: 'B'; // id: number; // flag: number; // } </code></...
Why does Typescript Union + Mapped Types work differently with and without Generics
typescript|typescript-typings|typescript-generics
4
39
1
72,812,486
72,812,486
2
true
2022-06-30T04:29:57.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Typescript Union + Mapped Types work differently with and without Generics<p>I am new to using generics. The following code has different &quot;w0&q...
72,820,402
ServiceStack: How do I Serialize a nested object of Dictionary<string, object>?<pre><code>&quot;event-data&quot;: { &quot;event&quot;: &quot;opened&quot;, &quot;timestamp&quot;: 1529006854.329574, &quot;id&quot;: &quot;DACSsAdVSeGpLid7TN03WA&quot;, &quot;delivery-status&quot;: { ...
<p>You can use the late-bound generic <code>Dictionary&lt;string, object&gt;</code> and <code>List&lt;object&gt;</code>, e.g:</p> <pre class="lang-cs prettyprint-override"><code>var obj = new Dictionary&lt;string, object&gt; { [&quot;event-data&quot;] = new Dictionary&lt;string, object&gt; { [&quot;event&qu...
ServiceStack: How do I Serialize a nested object of Dictionary<string, object>?
json|serialization|servicestack
1
39
1
72,820,635
72,820,635
2
true
2022-06-30T18:22:12.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ServiceStack: How do I Serialize a nested object of Dictionary<string, object>?<pre><code>&quot;event-data&quot;: { &quot;event&quot;: &quot;open...
72,809,033
Getting empty params, query, and body from axios api call (been stuck on for 3 days, Note: just for learning as new to mern stack)<p>For some reason it only comes as empty json like:{} (as seen in the output)</p> <p>I would like if instead I could access the parameters sent from the routes somehow.</p> <p>Frontend:</p>...
<p>Turns out the answer was that you can't send information in the body when using a GET request, but it works when doing a POST request. Found out after reading API documentation here: <a href="https://www.npmjs.com/package/axios#axios-api" rel="nofollow noreferrer">https://www.npmjs.com/package/axios#axios-api</a></p...
Getting empty params, query, and body from axios api call (been stuck on for 3 days, Note: just for learning as new to mern stack)
node.js|reactjs|express|parameters|axios
0
39
1
72,821,451
72,821,451
2
true
2022-06-30T00:03:14.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting empty params, query, and body from axios api call (been stuck on for 3 days, Note: just for learning as new to mern stack)<p>For some reason it only ...
72,822,058
Sort Array of Objects Based on Numeric Value<p>I have an array like so:</p> <pre><code>[ { Orange: 5 }, { Red: 575 }, { Green: 6544 }, { Blue: 1307 } ] </code></pre> <p>The desired outcome is:</p> <pre><code>[ { Green: 6544 }, { Blue: 1307 }, { Red: 575 }, { Orange: 5 } ] </code></pre> <p>I've ...
<p>Using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" rel="nofollow noreferrer"><code>Array#sort</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Object/values" rel="nofollow noreferrer"><code>Object#values<...
Sort Array of Objects Based on Numeric Value
javascript|node.js|reactjs
0
39
1
72,822,081
72,822,081
2
true
2022-06-30T21:08:45.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort Array of Objects Based on Numeric Value<p>I have an array like so:</p> <pre><code>[ { Orange: 5 }, { Red: 575 }, { Green: 6544 }, { Blue: 13...
72,825,290
Order within and between elements of a list<p>Suppose we have the following list of characters:</p> <pre><code>mylist &lt;- list(c(&quot;I312&quot;,&quot;Z432&quot;,&quot;O115&quot;), c(&quot;S123&quot;), c(&quot;O978&quot;,&quot;T213&quot;), c(&quot;T123&quot;)) myli...
<p>If you do not mind editing your list</p> <pre><code>&gt; mylist=lapply(mylist,sort) &gt; mylist[order(unlist(lapply(mylist,&quot;[[&quot;,1)))] [[1]] [1] &quot;I312&quot; &quot;O115&quot; &quot;Z432&quot; [[2]] [1] &quot;O978&quot; &quot;T213&quot; [[3]] [1] &quot;S123&quot; [[4]] [1] &quot;T123&quot; </code></p...
Order within and between elements of a list
r|list
3
39
3
72,825,310
72,825,310
2
true
2022-07-01T06:42:33.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Order within and between elements of a list<p>Suppose we have the following list of characters:</p> <pre><code>mylist &lt;- list(c(&quot;I312&quot;,&quot;Z43...
72,824,697
How to get unicode of characters from 55296 to 56319 in Excel<p>I generated a list of letters in excel, from character codes 1 to 66535.</p> <p>I am trying to get back the unicode by using the function &quot;UNICODE&quot;. However, excel return #VALUE! for character codes from 55296 to 56319.</p> <p>Please advise if th...
<p>The range you are listing is a special range in Unicode: surrogates.</p> <p>So, they have Unicode code point, but the problem it is you cannot have them in a text: Windows uses UCS-2/UTF-16 as internal encoding, so there are no way you can put in text. Or better: you to have code points above 65535, Windows uses two...
How to get unicode of characters from 55296 to 56319 in Excel
excel|excel-formula|unicode
0
39
1
72,826,085
72,826,085
2
true
2022-07-01T05:21:16.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get unicode of characters from 55296 to 56319 in Excel<p>I generated a list of letters in excel, from character codes 1 to 66535.</p> <p>I am trying t...
72,828,164
Why does json_query return an empty string in a set_fact?<p>I tried to get metrics2 and metrics3 value like below:</p> <pre class="lang-yaml prettyprint-override"><code>- hosts: localhost tasks: - set_fact: param: - - {metrics1: A, metrics2: B, metrics3: C} - {metrics1: D, metrics2: E, m...
<p>You won't be able to access <code>param</code> in the <code>set_fact</code> that defines it.</p> <p>A way around is to declare a variable local to that task, and use it:</p> <pre class="lang-yaml prettyprint-override"><code>- set_fact: parseParam: &quot;{{ _param | json_query('[][].[metrics2, metrics3]') }}&quot...
Why does json_query return an empty string in a set_fact?
json|ansible
0
39
1
72,828,742
72,828,742
2
true
2022-07-01T10:52:33.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does json_query return an empty string in a set_fact?<p>I tried to get metrics2 and metrics3 value like below:</p> <pre class="lang-yaml prettyprint-over...
72,840,677
How can i change the Gradle Version in InteliJ?<p>I have the Error: &quot;Found invalid Gradle JVM configuration&quot; &quot;JDK 17.0.1 isn´t compatible with gradle 7.1. Please fix JAVA_HOME enviroment variable&quot;</p> <p>Im not sure why it says gradle 7.1. The gradle Version i have is 7.4.2. This version should work...
<p>Take a look at the <code>gradle-wrapper.properties</code> file in the <code>./gradle/wrapper</code> directory.</p> <p>In the file, you can define the distribution URL from which Gradle is loaded. For example:</p> <pre><code>distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip </code></pre> <...
How can i change the Gradle Version in InteliJ?
java|gradle|java-home
1
39
1
72,840,757
72,840,757
2
true
2022-07-02T16:26:30.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i change the Gradle Version in InteliJ?<p>I have the Error: &quot;Found invalid Gradle JVM configuration&quot; &quot;JDK 17.0.1 isn´t compatible with...
72,840,590
What is the application of single-precision format in the following MATLAB code?<p>I am imitating the following MATLAB code. actually, this code implement the eigenface method for face recognition.</p> <pre><code>%You are free to use, modify or distribute this code loaded_Image=load_img(); random_Index=round(400*rand(1...
<p>The <code>loaded_Image</code>, <code>rest_of_the_images</code>, <code>random_Image</code>, etc. are all stored as type <code>uint8</code> for saving space because pixel values range from <code>[0 0 0]</code> (black) to <code>[255 255 255]</code> (white) and 8-bits are sufficient for that (0:255). But some mathemati...
What is the application of single-precision format in the following MATLAB code?
matlab|single-precision
2
39
1
72,841,830
72,841,830
2
true
2022-07-02T16:12:27.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the application of single-precision format in the following MATLAB code?<p>I am imitating the following MATLAB code. actually, this code implement th...
72,842,026
Split sentences by Case change where two words are "stuck" together<p>I am attempting to clean up the following data which has been extracted from HTML.</p> <p>Some sentences haven't quite split correctly with the Capitalised word at the start of one sentence &quot;stuck&quot; to the preceding word.</p> <p>The image be...
<p>Image still looks incorrect (informationOverall is not split) but if you want to split by character transition, you can do so from the ribbon.</p> <p><a href="https://i.stack.imgur.com/b9xmD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b9xmD.png" alt="enter image description here" /></a></p>
Split sentences by Case change where two words are "stuck" together
html|excel|powerbi
0
39
1
72,842,327
72,842,327
2
true
2022-07-02T19:49:02.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split sentences by Case change where two words are "stuck" together<p>I am attempting to clean up the following data which has been extracted from HTML.</p> ...
72,842,190
swift (xcode) is it better to use optional or a temporary object?<p>When declaring an attribute that is set at the init stage, should it be set as an optional? Or as a temporary object ?</p> <p>See <code>grimoireMemento</code> attribute:</p> <p>optional example :</p> <pre><code>class Kokoro{ private var emot:String...
<blockquote> <p><a href="https://docs.swift.org/swift-book/LanguageGuide/Initialization.html" rel="nofollow noreferrer">All of a class’s stored properties—including any properties the class inherits from its superclass—must be assigned an initial value during initialization</a>.</p> </blockquote> <p>That means you don'...
swift (xcode) is it better to use optional or a temporary object?
ios|swift|xcode
-1
39
1
72,843,001
72,843,001
2
true
2022-07-02T20:20:10.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: swift (xcode) is it better to use optional or a temporary object?<p>When declaring an attribute that is set at the init stage, should it be set as an optiona...
72,846,587
Cypher multiple OPTIONAL MATCH - Pattern Comprehension - COUNT DISTINCT<p>I have read a lot of comments about OPTIONAL MATCH and Pattern Comprehesion, but I can't find a solution for my case.</p> <p>I have a node (Account) in my Neo4j Database and I'd like to count the nodes which belongs to each account. The following...
<p>The problem lies, in the <code>RETURN</code> statement, because you are calculating all the counts at the last, neo4j has to calculate the cartesian products. If you calculate each node count at each step, it will be much more optimal. Like this:</p> <pre><code>MATCH (a:Account{billingCountry: &quot;DE&quot;, isDele...
Cypher multiple OPTIONAL MATCH - Pattern Comprehension - COUNT DISTINCT
neo4j|cypher|list-comprehension
2
39
1
72,847,484
72,847,484
2
true
2022-07-03T12:40:38.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cypher multiple OPTIONAL MATCH - Pattern Comprehension - COUNT DISTINCT<p>I have read a lot of comments about OPTIONAL MATCH and Pattern Comprehesion, but I ...
72,849,982
How to keep margin top constant when Div's height changes<p>I have this strange issue, I am building a simple html and css and js popup login interface, I don't know why any time I change from Login popup to Signup/Register popup the margin top changes.</p> <p>I want to keep the margin-top constant when I change from L...
<p>It seems that the dominant property of the CSS is centering your modal. So bigger modal, less margin. Just make center it horizontally (and not vertically) by transform: translate(-50%, 0);</p>
How to keep margin top constant when Div's height changes
html|css
1
39
2
72,850,188
72,850,188
2
true
2022-07-03T21:18:34.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to keep margin top constant when Div's height changes<p>I have this strange issue, I am building a simple html and css and js popup login interface, I do...
72,852,692
Actors v.s. HTTP<p>I don’t really get if there is much of a difference between using actors and using HTTP endpoints for communication between processesses.</p> <p>Documents online say all the time “actors receive messages and can change state”… well, so do HTTP endpoint functions.</p> <p>HTTP can call async functions,...
<p>You seem to be conflating a few issues.</p> <h1>Why does Akka have its own RPC instead of HTTP.</h1> <p>The answer is routing/reliability. Akka is meant to hugely distributed systems, and when you do raw HTTP, how do you keep all the routes correct for each message? Also, with huge numbers of machines, how do you en...
Actors v.s. HTTP
actor|actor-model
1
39
2
72,853,129
72,853,129
2
true
2022-07-04T06:44:05.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Actors v.s. HTTP<p>I don’t really get if there is much of a difference between using actors and using HTTP endpoints for communication between processesses.<...
72,855,950
Why am I getting "Run-time error '1004' " When using FormulaR1C1?<p>I am creating a template for a process route card for our factory, which configures itself based on a few inputs. one section of this is a build log for serialised parts. I want to insert this formula:</p> <pre><code>=IFERROR(IF(RIGHT(K122,4)+1&lt; $E$...
<p>I just realised my error.. I didn't fully convert the formula into R1C1 notation, I had left the lone explicit Cell reference in A1 notation</p> <p><code>$E$17</code></p> <p>..Converting that to <code>R17C5</code> fixed it.</p> <p>Sorry for the long read for the elementary issue.</p> <p>Regards,</p>
Why am I getting "Run-time error '1004' " When using FormulaR1C1?
excel|vba
0
39
1
72,856,054
72,856,054
2
true
2022-07-04T11:26:27.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why am I getting "Run-time error '1004' " When using FormulaR1C1?<p>I am creating a template for a process route card for our factory, which configures itsel...
72,858,413
Trying to read an array from a file in React, but it comes up undefined<p>I'm new to React and am working on a small project. I'm trying to figure out why React won't read the data from my dataArray.js file. It comes up undefined when I console.log it. I made sure the data was being exported, the data was connected to ...
<p>You have a default export in <code>dataArray.js</code> and named import in <code>App.js</code>.</p> <p>So or do <code>export const receiptsData = ...</code> in <code>dataArray.js</code>, or import it as <code>import receiptsData from &quot;./dataArray&quot;;</code> in <code>App.js</code></p>
Trying to read an array from a file in React, but it comes up undefined
javascript|reactjs
0
39
3
72,858,480
72,858,480
2
true
2022-07-04T14:36:17.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to read an array from a file in React, but it comes up undefined<p>I'm new to React and am working on a small project. I'm trying to figure out why Re...
72,860,293
typecast GzipStream to MemoryStream<p>I need to write Gzip decompressed output to file (in binary).<br /> Here is the powershell code i'm currently using:</p> <pre><code>$out = [IO.MemoryStream]::new() $gzip = [IO.Compression.GzipStream]::new($in, [IO.Compression.CompressionMode]::Decompress) $gzip.CopyTo($out) [IO.Fil...
<p>You can't typecase <code>GzipStream</code> to <code>MemoryStream</code> but you can decompress to a file directly, without decompressing the whole input to memory first.</p> <pre class="lang-sh prettyprint-override"><code>$out = [IO.File]::Create(&quot;$PWD\out.bin&quot;) $gzip = [IO.Compression.GzipStream]::new( $i...
typecast GzipStream to MemoryStream
powershell
0
39
1
72,861,950
72,861,950
2
true
2022-07-04T17:34:35.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: typecast GzipStream to MemoryStream<p>I need to write Gzip decompressed output to file (in binary).<br /> Here is the powershell code i'm currently using:</p...
72,862,803
Dynamically merge columns except stated column(s)<p>I have the function which merges all columns as shown.</p> <p><a href="https://i.stack.imgur.com/KmBgW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KmBgW.png" alt="enter image description here" /></a></p> <p>M Code:</p> <pre><code>let Source ...
<pre><code>let Source = Excel.CurrentWorkbook(){[Name=&quot;Table1&quot;]}[Content], #&quot;Added Index&quot; = Table.AddIndexColumn(Source, &quot;Index&quot;, 0, 1, Int64.Type), Exclude={&quot;Column1&quot;, &quot;Column3&quot;}, List=List.Difference(Table.ColumnNames(Source),Exclude), MergeAllColumns= Table.AddColumn...
Dynamically merge columns except stated column(s)
excel|powerbi|powerquery
0
39
1
72,863,113
72,863,113
2
true
2022-07-04T23:39:17.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dynamically merge columns except stated column(s)<p>I have the function which merges all columns as shown.</p> <p><a href="https://i.stack.imgur.com/KmBgW.pn...
72,864,024
preorder binary tree traversal fails<p>I am having trouble with the equivalent binary trees exercise on the go tour.</p> <p>I've written a Walker() function to traverse the tree in node-left-right order, then used the Same() function to test two identical binary trees for equivalence.</p> <p>Here is a link to my code: ...
<p>I think the problem here is, you are using the <a href="https://pkg.go.dev/golang.org/x/tour/tree#New" rel="nofollow noreferrer">https://pkg.go.dev/golang.org/x/tour/tree#New</a> function which returns a random binary tree from 1k to 10k values.</p> <p>The &quot;Random&quot; word is of importance here, so you can no...
preorder binary tree traversal fails
algorithm|go
0
39
1
72,864,303
72,864,303
2
true
2022-07-05T04:28:38.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: preorder binary tree traversal fails<p>I am having trouble with the equivalent binary trees exercise on the go tour.</p> <p>I've written a Walker() function ...
72,864,777
Array element type assertion problem in TypeScript<pre class="lang-js prettyprint-override"><code>type Plan&lt;T&gt; = [T[], ...T[]]; </code></pre> <p>I declared a type named <code>Plan</code>, which includes a repetitive plan in index <code>0</code> and in the rest what to execute initially.</p> <p>example) <code>cons...
<p>Type narrowing doesn't work in all cases, as you expect.</p> <p>It does work on a single variable though, when you add type guards or type predicates to narrow down.</p> <p>This will work:</p> <pre><code>type Plan&lt;T&gt; = [T[], ...T[]]; function parsePlan&lt;T&gt;(plan: Plan&lt;T&gt;, index: number): T { con...
Array element type assertion problem in TypeScript
typescript|type-assertion
0
39
1
72,865,146
72,865,146
2
true
2022-07-05T06:21:35.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Array element type assertion problem in TypeScript<pre class="lang-js prettyprint-override"><code>type Plan&lt;T&gt; = [T[], ...T[]]; </code></pre> <p>I decl...
72,866,268
How to store user auto in database?<p>I created a form for adding products to an e-Commerce site. The form isn't working perfectly.</p> <p><strong>First issue:</strong> I want to store the user automatically by submitting the form. I actually want to store Who did add the product individually.</p> <p><strong>Second Is...
<p>You need to set the <code>.user</code> of the <code>.instance</code> wrapped in the form to the logged in user (<code>request.user</code>). Furthermore you need to pass both <code>request.POST</code> and <code>request.FILES</code> to the form to handle files.</p> <pre><code>from django.contrib.auth.decorators import...
How to store user auto in database?
django
1
39
2
72,866,435
72,866,435
2
true
2022-07-05T08:28:39.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store user auto in database?<p>I created a form for adding products to an e-Commerce site. The form isn't working perfectly.</p> <p><strong>First issu...
72,868,112
how to access and collect elements from a list in list?<p>This question is so simple, but the desired output is not clicking to me.</p> <pre><code>alist = [[0., 0., 0], [1 , 2, 3 ], [4, 5, 6 ],[7, 8, 9], [10, 11, 12], [13, 14, 15]] a = [] for i in alist: for j in i: a.append(j[0:3]) print(a) </code></pre> ...
<p>You can use <code>zip</code> like <code>zip(*alist)</code> and get what you want, but if you want correct your code. you need <code>enumerate</code>.</p> <pre><code>&gt;&gt;&gt; list(map(list, zip(*alist))) [[0.0, 1, 4, 7, 10, 13], [0.0, 2, 5, 8, 11, 14], [0, 3, 6, 9, 12, 15]] </code></pre> <p>Your code:</p> <pre><c...
how to access and collect elements from a list in list?
python|list|loops|indexing|append
1
39
2
72,868,274
72,868,274
2
true
2022-07-05T10:45:44.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to access and collect elements from a list in list?<p>This question is so simple, but the desired output is not clicking to me.</p> <pre><code>alist = [[...
72,868,502
Is PHP Memcached thread safe?<p>Should I be worried about one script modifying a &quot;Memcached&quot; entry while another is reading it?</p> <p>I didn't find nothing in the <a href="https://www.php.net/manual/en/book.memcached.php" rel="nofollow noreferrer">official documentation</a>.</p>
<p>Yes, it is threadsafe. It is <a href="https://www.php.net/manual/en/memcached.requirements.php" rel="nofollow noreferrer">based on libmemcached</a> which itself states as threadsafe in the <a href="http://docs.libmemcached.org/memcached_pool.html?highlight=thread#" rel="nofollow noreferrer">documentation</a>.</p> <b...
Is PHP Memcached thread safe?
php|multithreading|thread-safety|memcached
1
39
1
72,868,669
72,868,669
2
true
2022-07-05T11:16:13.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is PHP Memcached thread safe?<p>Should I be worried about one script modifying a &quot;Memcached&quot; entry while another is reading it?</p> <p>I didn't fin...
72,881,127
Rails method about foreign keys<p>I want to delete a company, but there is not dependent: destroy in the model. Is there an ActiveRecord method on Rails to know which tables are connected to a specific foreign key ?</p>
<p>Using <a href="https://api.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_all_associations" rel="nofollow noreferrer">ActiveRecord::reflect_on_all_associations</a> and <a href="https://ruby-doc.org/core/Array.html#method-i-reject" rel="nofollow noreferrer">Array#reject</a> you ...
Rails method about foreign keys
ruby-on-rails|ruby|database|postgresql|activerecord
0
39
1
72,881,379
72,881,379
2
true
2022-07-06T09:34:44.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails method about foreign keys<p>I want to delete a company, but there is not dependent: destroy in the model. Is there an ActiveRecord method on Rails to k...
72,882,644
SQL Get monthly values for a yearly subscription<p>I have a table with orders like this:</p> <pre><code>date, domain, total 2022-01-07, test.com, 120 </code></pre> <p>The business requirement is that these are yearly subscriptions, and I need to look at how much they will theoretically bring in every month. So the outp...
<p>You can do:</p> <pre><code>select t.date + (m.n * interval '1 month'), domain, total / 12 from t cross join generate_series(0, 11) m (n) </code></pre> <p>Result:</p> <pre><code> ?column? domain ?column? -------------------- --------- -------- 2022-01-07 00:00:00 test.com 10 2022-02-07 00...
SQL Get monthly values for a yearly subscription
sql|postgresql
0
39
2
72,882,801
72,882,801
2
true
2022-07-06T11:16:01.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Get monthly values for a yearly subscription<p>I have a table with orders like this:</p> <pre><code>date, domain, total 2022-01-07, test.com, 120 </code>...
72,887,117
Google Sheets row to array<p>I need to create an array out of google sheets columns:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>product</th> <th>feature_a</th> <th>feature_b</th> <th>feature_c</th> <th>Array</th> </tr> </thead> <tbody> <tr> <td>p1</td> <td>1</td> <td>1</td> <td>1</td> ...
<p>try:</p> <pre><code>=INDEX(IF(A2:A=&quot;&quot;;;&quot;[&quot;&amp;SUBSTITUTE(TRIM(FLATTEN(QUERY(TRANSPOSE( IF(B2:D=1; &quot;&quot;&quot;&quot;&amp;B1:D1&amp;&quot;&quot;&quot;&quot;; ));;9^9))); &quot; &quot;; &quot;,&quot;)&amp;&quot;]&quot;)) </code></pre> <p><a href="https://i.stack.imgur.com/rcuqz.png" rel="no...
Google Sheets row to array
google-sheets|concatenation|google-sheets-formula|flatten|textjoin
2
39
1
72,887,248
72,887,248
2
true
2022-07-06T16:41:08.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheets row to array<p>I need to create an array out of google sheets columns:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr>...
72,891,384
Java function interface for Supplier<T> failed to compile non-lambda<p>I've got this:</p> <pre><code>import java.util.function.*; public class FluentApi { public Integer myfunc(){ return Integer.valueOf(1); } public void fSupplier(Supplier&lt;Integer&gt; si){ System.out.println(si.get()); ...
<p>You will need to pass <code>myfunc</code> as a <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html" rel="nofollow noreferrer">method reference</a>.</p> <p>Try this:</p> <pre class="lang-java prettyprint-override"><code>public void callFunc() { fSupplier(this::myfunc); } </code></pr...
Java function interface for Supplier<T> failed to compile non-lambda
java|function|lambda|interface|supplier
0
39
2
72,891,416
72,891,416
2
true
2022-07-07T01:29:46.120Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java function interface for Supplier<T> failed to compile non-lambda<p>I've got this:</p> <pre><code>import java.util.function.*; public class FluentApi { ...
72,889,137
SwiftUI re-initialize EnvironmentObject?<p>How can I refresh an environment var in SwiftUI? It is easy to update any object that's a part of an environment object, but it seems like there should be a way to re-initialize.</p> <pre><code>struct reinitenviron: View{ @EnvironmentObject private var globalObj: GlobalCla...
<p>A possible solution is to introduce explicit method in <code>GlobalClass</code> to reset it to initial state and use that method and in <code>init</code> and externally, like</p> <pre><code>class GlobalClass: ObservableObject { @Published var value: Int = 1 init() { self.reset() } func reset() { ...
SwiftUI re-initialize EnvironmentObject?
swiftui
1
39
1
72,892,566
72,892,566
2
true
2022-07-06T19:50:17.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI re-initialize EnvironmentObject?<p>How can I refresh an environment var in SwiftUI? It is easy to update any object that's a part of an environment o...
72,894,227
Why is np nan convertible to int by `astype` (but not by `int`)?<p>This question comes from a finding that is very much not intuitive to me. If one tries the following:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np print(np.array([np.nan]).astype(int)) print(int(np.array([np.nan]))) </code></pr...
<p><a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html" rel="nofollow noreferrer"><code>.astype</code></a> has optional argument <code>casting</code> whose default value is <code>'unsafe'</code>. Following values are allowed</p> <ul> <li>‘no’ means the data types should not be cast at al...
Why is np nan convertible to int by `astype` (but not by `int`)?
python|numpy|integer|nan
0
39
1
72,894,296
72,894,296
2
true
2022-07-07T07:59:20.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is np nan convertible to int by `astype` (but not by `int`)?<p>This question comes from a finding that is very much not intuitive to me. If one tries the...
72,900,203
How to calculate Moving Average with time stamp format of YYYY-mm-dd HH:MM:SS at 24, 48, and 72 hours?<p>Below is a sample of my dataframe which has timestamps every 15 minutes:</p> <pre><code>df = structure(list(Date_Time_GMT_3 = structure(c(1625746500, 1625747400, 1625748300, 1625749200, 1625750100, 1625751000, 1625...
<p>Try this:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) library(slider) # Supplied sample data df &lt;- structure(list(Date_Time_GMT_3 = structure(c( 1625746500, 1625747400, 1625748300, 1625749200, 1625750100, 1625751000, 1625751900, 1625752800, 1625753700, 1625754600, 1625755500, 1625...
How to calculate Moving Average with time stamp format of YYYY-mm-dd HH:MM:SS at 24, 48, and 72 hours?
r|moving-average
1
39
1
72,900,553
72,900,553
2
true
2022-07-07T15:05:43.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate Moving Average with time stamp format of YYYY-mm-dd HH:MM:SS at 24, 48, and 72 hours?<p>Below is a sample of my dataframe which has timestam...
72,900,521
How to get tables of data from JupyterLab to Excel<p>I am completely new to JupyterLab and python in general so I am looking for some help today. Specifically, I am interested in getting data from JuypterLab into Excel. The data I have in JL are tables that I have pulled from the internet, using the pandas function as ...
<p>If you have a pandas dataframe getting it into excel-format is very easy:</p> <pre><code>df.to_excel(&quot;filename.xlsx&quot;) </code></pre> <p>see also the documentation: <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_excel.html" rel="nofollow noreferrer">https://pandas.pyd...
How to get tables of data from JupyterLab to Excel
python|excel|pandas|jupyter|jupyter-lab
0
39
2
72,900,770
72,900,770
2
true
2022-07-07T15:28:11.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get tables of data from JupyterLab to Excel<p>I am completely new to JupyterLab and python in general so I am looking for some help today. Specificall...
72,904,918
Typescript not seeing gaurd through a async IIFE<p>I have a definition of type <code>Payment</code> like this:</p> <p><a href="https://www.typescriptlang.org/play?#code/C4TwDgpgBACghiAthAdsKBeKBvAUFKAZwEsATALiOACdiUBzKAHyhQFcAbDgblwF9cAMzYoAxsGIB7FFFKTiwABRgEyNIUrwkqYAG0AugEoc+KCu3qAdIMnUAonFEALZap2YAfCYIFigqIqmPmZuaJY...
<p>This is currently a missing feature of TypeScript, see <a href="https://github.com/microsoft/TypeScript/issues/30625" rel="nofollow noreferrer">microsoft/TypeScript#30625</a>.</p> <hr /> <p>In general the TypeScript compiler does not have the resources to do proper <a href="https://www.typescriptlang.org/docs/handbo...
Typescript not seeing gaurd through a async IIFE
typescript
0
39
2
72,905,235
72,905,235
2
true
2022-07-07T22:36:17.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript not seeing gaurd through a async IIFE<p>I have a definition of type <code>Payment</code> like this:</p> <p><a href="https://www.typescriptlang.org...
72,915,749
How to group and sum rows by ID and subtract from group of rows with same ID? [python]<p>I have the following dataframe:</p> <pre><code> ID_A ID_B ID_C Value ID_B_Value_Sum ----------------------------------------------- 0 22 5 1 54 208 1 23 5 2 34...
<p>IIUC, you need:</p> <pre><code>df['Value_Sum_New'] = (df['ID_B_Value_Sum'] - df.groupby(['ID_B', 'ID_C'])['Value'].transform('sum') + df['Value'] ) </code></pre> <p>output:</p> <pre><code> ID_A ID_B ID_C Value ID_B_Value_Sum Value_Sum_New 0 ...
How to group and sum rows by ID and subtract from group of rows with same ID? [python]
python|pandas|dataframe
1
39
1
72,915,930
72,915,930
2
true
2022-07-08T18:44:26.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to group and sum rows by ID and subtract from group of rows with same ID? [python]<p>I have the following dataframe:</p> <pre><code> ID_A ID_B ID_...
72,917,354
get item from dict and count number of items in the list<p>I used jsondiff.diff() to compare the flattened items (as a json) from two jsons of the mapping of an Elasticsearch index. One is what I loaded, the original mapping I created, and the other is the mapping queried from Elasticsearch, so it could technically be ...
<p>It's a dictionary, but keys like <code>insert</code> and <code>replace</code> are not strings, they're instances of the <code>jsondiff.Symbol</code> class. That's why they don't have quotes around them -- this class has a custom representation that just returns the symbol name.</p> <p>So to access it I think you hav...
get item from dict and count number of items in the list
python|json|dictionary
0
39
1
72,917,548
72,917,548
2
true
2022-07-08T21:54:32.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get item from dict and count number of items in the list<p>I used jsondiff.diff() to compare the flattened items (as a json) from two jsons of the mapping of...
72,920,264
Text use minimum space in Row<p>Here is my code:</p> <pre class="lang-kotlin prettyprint-override"><code>Row { Text( text = text1, maxLines = 1, overflow = TextOverflow.Ellipsis, ) Spacer(modifier = Modifier.width(2.dp)) Text( text = text2, maxLines = 1, ) } <...
<p>You can use the parameter <code>fill = false</code>, if you don't want <code>weigth</code> to fill the remaining space.</p> <pre><code>Row { Text( text = text1, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(weight = 1f, fill = false) ) Spacer(m...
Text use minimum space in Row
android|android-jetpack-compose|android-jetpack
1
39
1
72,920,753
72,920,753
2
true
2022-07-09T09:23:14.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text use minimum space in Row<p>Here is my code:</p> <pre class="lang-kotlin prettyprint-override"><code>Row { Text( text = text1, maxLin...
72,924,453
json pointers not resolved in python module<p>I have created a json file that has some values in a central area and then a sub area that uses pointers to get values from the central area. I am trying to load the json using the <code>json</code> module from python but when I load the file it doesn't resolve the pointers...
<p>JSON references are not part of the JSON specification, but an extension. You could install a library like <a href="https://pypi.org/project/jsonref/" rel="nofollow noreferrer">jsonref</a>, then you could do:</p> <pre><code>import jsonref data = jsonref.loads(open(&quot;test.json&quot;).read()) print(data) </code></...
json pointers not resolved in python module
python|json|pointers
-1
39
1
72,924,482
72,924,482
2
true
2022-07-09T20:34:07.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: json pointers not resolved in python module<p>I have created a json file that has some values in a central area and then a sub area that uses pointers to get...
72,924,425
JQuery Scroll Limit to Span Text<p>Firstly please excuse my knowledge of JQuery im a total noob and struggline to get this code to work. I did try a search but could not find a solution for my issue.</p> <p>Ok so I have a little scroll bar which allows the user to select a tempo from 40 to 300 bpm these are the limits ...
<p>Just change the others' <code>text()</code> or <code>val()</code> on change event.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var range = $('#BPMRange') var input = $('...
JQuery Scroll Limit to Span Text
javascript|html|jquery
0
39
2
72,924,487
72,924,487
2
true
2022-07-09T20:27:20.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQuery Scroll Limit to Span Text<p>Firstly please excuse my knowledge of JQuery im a total noob and struggline to get this code to work. I did try a search b...
72,920,604
chart auto scales as you resizing the window (made with google web app)<p>I am trying to make a chart that resizes automatically when I change the size of the window. Let's say I have this code from the documentation: <a href="https://jsfiddle.net/r3ckg7ep/1/" rel="nofollow noreferrer">https://jsfiddle.net/r3ckg7ep/1/<...
<p>you have to re-draw the chart anytime there is a resize...</p> <pre><code>window.addEventListener('resize', function () { chart.draw(data, options); }); </code></pre>
chart auto scales as you resizing the window (made with google web app)
javascript|html|web-applications|google-visualization
2
39
1
72,924,515
72,924,515
2
true
2022-07-09T10:25:48.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: chart auto scales as you resizing the window (made with google web app)<p>I am trying to make a chart that resizes automatically when I change the size of th...
72,926,197
How do I write this short hand in Java?<pre class="lang-js prettyprint-override"><code>str = str.replace(fraction, replacement[1] || replacement[0]); </code></pre> <p>I want to replace with [1] if [1] is not &quot;&quot; or undefined or null, or else replace with [0] if [1] is &quot;&quot; or undefined or null. I know...
<p>Java is not a very concise language by nature. The most concise way to do what you're asking is probably something like markspace's comment:</p> <pre class="lang-java prettyprint-override"><code>str = str.replace(fraction, (replacement[1] != null &amp;&amp; !replacement[1].isBlank()) ? replacement[1] : replacement[0...
How do I write this short hand in Java?
java|conditional-operator|shorthand
1
39
2
72,926,251
72,926,251
2
true
2022-07-10T04:48:06.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I write this short hand in Java?<pre class="lang-js prettyprint-override"><code>str = str.replace(fraction, replacement[1] || replacement[0]); </code...
72,942,354
How to get the User ID of a member in Discord.py when I mention them?<p>I am trying to get the User ID when I mention them in a command.</p> <p>I have a command to warn members, and I want to keep track of a member's warnings. So I want their User ID to keep track of the same. But when I try to get a User ID when I men...
<ol> <li><p>In your definition <code>(self, ctx, member)</code> - your bot gets just text from discord and without anything library will think of <code>member</code> as a string object and thus it does not have attribute 'id', as your error says. The library's solution to this: type-hinting, if you provide type-hint li...
How to get the User ID of a member in Discord.py when I mention them?
discord|discord.py
-1
39
1
72,943,908
72,943,908
2
true
2022-07-11T17:19:31.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the User ID of a member in Discord.py when I mention them?<p>I am trying to get the User ID when I mention them in a command.</p> <p>I have a comm...
72,949,713
Why two ViewSets have identical url in DRF?<p>Why two different viewsets have identical url? How can I change it?</p> <pre><code>router = routers.DefaultRouter() router.register(r'general-worker', GeneralWorkerViewSet) router.register(r'full-info-worker', FullInfoWorkerViewSet) urlpatterns = [ path('admin/', admin...
<p>i can not solve your example, we have not enough information. I can imagine, it can help:</p> <pre><code>router.register(r'general-worker', GeneralWorkerViewSet, basename='generalWorker') router.register(r'full-info-worker', FullInfoWorkerViewSet, basename='fullInfoWorker') </code></pre> <p>try to use <code>basename...
Why two ViewSets have identical url in DRF?
django|django-rest-framework
1
39
1
72,949,809
72,949,809
2
true
2022-07-12T09:07:05.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why two ViewSets have identical url in DRF?<p>Why two different viewsets have identical url? How can I change it?</p> <pre><code>router = routers.DefaultRout...
72,952,451
Why is ref in onMounted null in vue3?<p>It is normal to write it in setup, but it prints a null in onMounted; What is the reason? Isn't onMounted between the two executed later, and the dom has been loaded, why can it be obtained in the setup instead?</p> <pre class="lang-js prettyprint-override"><code>&lt;script setup...
<p><code>ref</code> should be written at the top level</p> <pre class="lang-js prettyprint-override"><code>&lt;script setup lang=&quot;ts&quot;&gt; const refDom = ref&lt;any&gt;(null); onMounted(()=&gt;{ console.log(2, refDom.value); }) &lt;/script&gt; </code></pre>
Why is ref in onMounted null in vue3?
vuejs3|vue3-openlayers
0
39
1
72,952,495
72,952,495
2
true
2022-07-12T12:37:06.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is ref in onMounted null in vue3?<p>It is normal to write it in setup, but it prints a null in onMounted; What is the reason? Isn't onMounted between the...
72,907,501
file_put_contents(Z:/test/39361_1657094148_elicense.pdf): failed to open stream: No such file or directory in network shared drive/folder in laravel<p>I am developing a web application using laravel, and the application requires me to create a pdf file and save it to be downloaded later.I have successfully created the ...
<p>the issue was with the permission, my application had no right to write to that network shared folder The solution was to open the directory and then save the file</p> <p>I find the solution from this link <em><a href="https://www.codedwell.com/post/21/reading-file-list-from-a-mapped-windows-network-drive" rel="nofo...
file_put_contents(Z:/test/39361_1657094148_elicense.pdf): failed to open stream: No such file or directory in network shared drive/folder in laravel
php|laravel|pdf
0
39
1
72,952,694
72,952,694
2
true
2022-07-08T06:31:48.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: file_put_contents(Z:/test/39361_1657094148_elicense.pdf): failed to open stream: No such file or directory in network shared drive/folder in laravel<p>I am d...
72,955,628
(Algorand) Single atomic transactions - is there a fee for each signed transaction?<p>when grouping and sending a bunch of transactions as a single atomic transaction. Is there a fee for each signed transaction? Or 1 fee for sending them all?</p> <p>ie if i am making 10 payments from my acct to 10 different recipients,...
<p>Each transaction costs 0.001 ALGO.</p> <p>You can however pool the fees by setting fee to 0 on 9 and fee to 0.001x10 on one of them. The sum of fees must be Nx0.001 at minimum to cover the total cost of the atomic group.</p>
(Algorand) Single atomic transactions - is there a fee for each signed transaction?
algorand|pyteal
1
39
1
72,955,684
72,955,684
2
true
2022-07-12T16:35:43.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (Algorand) Single atomic transactions - is there a fee for each signed transaction?<p>when grouping and sending a bunch of transactions as a single atomic tr...
72,956,192
Edge color based on weights in Networkx<p>I am generating a graph with <code>nodes</code> and <code>edges</code>. I want the array <code>Edges</code> to take values in the array <code>Weights</code> such that <code>Edges[0]=Weights[0],Edges[1]=Weights[1], Edges[2]=Weights[2]</code> and display different colors as shown...
<p>Try this:</p> <pre><code>import networkx as nx import numpy as np import matplotlib.pyplot as plt from matplotlib.cm import ScalarMappable N = 1 def pos(): x, y = 1, N + 3 - 1 for _ in range(2 * N * (N + 1)): yield (x, y) y -= (x + 2) // (N + 3) x = (x + 2) % (N + 3) G = nx.Graph()...
Edge color based on weights in Networkx
python|numpy|networkx
0
39
1
72,956,948
72,956,948
2
true
2022-07-12T17:25:09.777Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edge color based on weights in Networkx<p>I am generating a graph with <code>nodes</code> and <code>edges</code>. I want the array <code>Edges</code> to take...
72,969,074
Show marker symbol at a timestamp on datetime axis in highcharts<p>I am looking to show marker symbol against a timestamp on datetime x axis, does highcharts have support for this?</p> <p>I am trying to mark symbol on chart load as below but that is not working as expected as we need to show the point against a timesta...
<p>As the API says, you need to pass the <em>value in terms of axis units</em>. In the case of <code>datetime</code> axis, it is a <code>timestamp</code>.</p> <p><strong>API Reference:</strong> <a href="https://api.highcharts.com/class-reference/Highcharts.Axis#toPixels" rel="nofollow noreferrer">https://api.highcharts...
Show marker symbol at a timestamp on datetime axis in highcharts
javascript|highcharts
0
39
1
72,970,294
72,970,294
2
true
2022-07-13T15:44:13.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show marker symbol at a timestamp on datetime axis in highcharts<p>I am looking to show marker symbol against a timestamp on datetime x axis, does highcharts...
72,972,399
How best to iterate prop.test across a row, ideally using purrr?<p>I have a dataframe like this:</p> <pre><code>df1 &lt;- data.frame( id_val = c('row1', 'row2', 'row3'), value_florida = c(10, 27, 16), value_illinois = c(17, 14, 22), value_vermont = c(11, 4, 29), base_florida = c(12, 44, 32), base_illinois =...
<p>This could be done after reshaping to 'long' format with <code>pivot_longer</code> and then use <code>combn</code> with <code>m = 2</code> for pairwise testing after grouping by 'id_val'</p> <pre><code>library(dplyr) library(tidyr) library(stringr) df1 %&gt;% pivot_longer(cols = -id_val, names_to = c(&quot;.value&...
How best to iterate prop.test across a row, ideally using purrr?
r|dplyr|purrr
2
39
2
72,972,482
72,972,482
2
true
2022-07-13T20:40:04.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How best to iterate prop.test across a row, ideally using purrr?<p>I have a dataframe like this:</p> <pre><code>df1 &lt;- data.frame( id_val = c('row1', 'r...
72,973,025
Django reset password email not sent<p>I'm using default django for reset my user password. Strange thing is i can send email in my code, i receive them. BUT only for the reset password from django i never receive email ...</p> <p>My django version is Django==3.1.2</p> <p>Django settings:</p> <pre><code>EMAIL_BACKEND =...
<p>You need to make a POST request, so:</p> <pre>&lt;form class=&quot;form&quot; <strong>method=&quot;post&quot;</strong>&gt; &hellip; &lt;/form&gt;</pre>
Django reset password email not sent
python|django|django-templates|django-urls|django-settings
2
39
1
72,973,052
72,973,052
2
true
2022-07-13T21:54:05.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django reset password email not sent<p>I'm using default django for reset my user password. Strange thing is i can send email in my code, i receive them. BUT...
72,987,175
Create a column indicating shared unique cluster ID in R<p>I'd like to create a column that gives a unique CoupleID if ID and PartnerID contain the same values but in any combination, i.e. not in the same columns. The existing questions and answers seem to only refer to cases when the values are duplicated within the s...
<p>Try this</p> <pre><code>library(dplyr) df |&gt; rowwise() |&gt; mutate(g = paste0(sort(c_across(ID:PartnerID)) , collapse = &quot;&quot;)) |&gt; group_by(g) |&gt; mutate(CoupleID = cur_group_id()) |&gt; ungroup() |&gt; select(-g) </code></pre> <ul> <li>output</li> </ul> <pre><code># A tibble: 6 × 3 ID PartnerI...
Create a column indicating shared unique cluster ID in R
r
3
39
3
72,987,426
72,987,426
2
true
2022-07-14T22:16:07.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a column indicating shared unique cluster ID in R<p>I'd like to create a column that gives a unique CoupleID if ID and PartnerID contain the same valu...
72,996,417
How to count inverse errors using COUNTIF<p>I am trying to clean my formulas.</p> <p>I favor using <code>FILTER</code> in my formulas. <code>FILTER</code> will return <code>#N/A</code> when it can not find any matches in a filter. And <code>COUNTA</code> includes <code>#N/A</code> errors in its count. So using this tab...
<p>You can add an <code>IFNA()</code> function to result in an empty cell, which <code>COUNTA()</code> doesn't count:</p> <pre><code>=COUNTA(ifna(FILTER(A1:A3, A1:A3 = &quot;foo&quot;),)) =COUNTA(ifna(FILTER(A1:A3, A1:A3 = &quot;bar&quot;),)) =COUNTA(ifna(FILTER(A1:A3, A1:A3 = &quot;baz&quot;),)) =COUNTA(ifna(FILTER(A1...
How to count inverse errors using COUNTIF
google-sheets|google-sheets-formula
0
39
1
72,996,578
72,996,578
2
true
2022-07-15T15:35:33.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count inverse errors using COUNTIF<p>I am trying to clean my formulas.</p> <p>I favor using <code>FILTER</code> in my formulas. <code>FILTER</code> wi...
73,006,176
Code wants a num of connected components, using Set() works but Map() seems to fail to check if a node has been visited. Output is 7, expected is 2<p>The problem is seeing how many connected components there are given an undirected graph. This is the example input.</p> <pre><code>connectedComponentsCount({ 0: [8, 1, ...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has" rel="nofollow noreferrer"><code>.has()</code></a> checks the value <strong>and</strong> the type of the key.</p> <p><a href="https://tc39.es/ecma262/multipage/keyed-collections.html#sec-map.prototype.has" rel="nofollow...
Code wants a num of connected components, using Set() works but Map() seems to fail to check if a node has been visited. Output is 7, expected is 2
javascript|traversal|undirected-graph
1
39
1
73,006,397
73,006,397
2
true
2022-07-16T17:05:29.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Code wants a num of connected components, using Set() works but Map() seems to fail to check if a node has been visited. Output is 7, expected is 2<p>The pro...
73,020,983
startswith() in Python acting unexpectedly<p>I have the following simple Python code that support to ask if a player wants to play the game again or not.</p> <pre><code>print('Do you want to play again? (yes or no)') if not input('&gt; '.lower().startswith('y')): print('no') else: print('yes') </code></pre> <p>...
<p>Your brackets are in the wrong position. You want to call <code>.lower().startswith('y')</code> on the result of <code>input('&gt; ')</code>.</p> <p>Change this:</p> <pre class="lang-py prettyprint-override"><code>if not input('&gt; '.lower().startswith('y')): </code></pre> <p>to:</p> <pre class="lang-py prettyprint...
startswith() in Python acting unexpectedly
python|string|startswith
0
39
1
73,021,023
73,021,023
2
true
2022-07-18T10:39:20.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: startswith() in Python acting unexpectedly<p>I have the following simple Python code that support to ask if a player wants to play the game again or not.</p>...
73,022,076
How to shade region between 2 functions ggplot<p>I would like to shade region between 2 functions on my plot to make my own confidence interval. Indeed, I made nls function with a Monod equation, and I traced this function with the parameters I obtained. I also made a bootstrap to obtain the values of my confidence int...
<p>Thank you Gregor, I change the way to create my confidence interval with one of the topic you shared and it works !</p> <p>I used this code for all my treatment :</p> <pre><code>new.data &lt;- data.frame(quantity=seq(0.1, 1.5, by = 0.01)) interval &lt;- as_tibble(predFit(nls1, newdata = new.data, interval = &quot;co...
How to shade region between 2 functions ggplot
r|function|ggplot2|area
1
39
1
73,022,743
73,022,743
2
true
2022-07-18T12:06:59.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to shade region between 2 functions ggplot<p>I would like to shade region between 2 functions on my plot to make my own confidence interval. Indeed, I ma...
73,023,503
Pandas data frame index setting Key value error<p>I have a data frame as shown below.</p> <p><a href="https://i.stack.imgur.com/lwNnY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lwNnY.png" alt="enter image description here" /></a></p> <p>I need to set the 'xvalues' column as the index of this dat...
<pre><code>new_header = df_thd_StepVF_funct_T.iloc[0] df_thd_StepVF_funct_T = df_thd_StepVF_funct_T[1:] df_thd_StepVF_funct_T.columns = new_header </code></pre> <p>Then try again on <code>df_thd_StepVF_funct_T</code>.</p>
Pandas data frame index setting Key value error
python|pandas|dataframe
0
39
1
73,023,577
73,023,577
2
true
2022-07-18T13:55:02.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas data frame index setting Key value error<p>I have a data frame as shown below.</p> <p><a href="https://i.stack.imgur.com/lwNnY.png" rel="nofollow nore...
73,028,972
How to get the exact path of files in a folder using bash script?<p>I have a folder wherein there are two images</p> <ol> <li>dog.jpeg</li> <li>dog2.jpeg</li> </ol> <p>and I need to send their path in the following queryImage.</p> <pre><code> #!/bin/bash for i in /Users/user/Desktop/Short/*; do curl ...
<p>Single quotes prevent the substitution at <code>$i</code>.</p> <p>Use double quotes instead:</p> <pre><code>#!/bin/bash for i in /Users/user/Desktop/Short/* do curl --location --request POST 'some_url' \ --header 'x-api-key: dummy-api-key' \ --form 'maxResults=&quot;25&quot;' \ --form 'minConfidence=...
How to get the exact path of files in a folder using bash script?
bash|shell
0
39
1
73,029,166
73,029,166
2
true
2022-07-18T21:47:54.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the exact path of files in a folder using bash script?<p>I have a folder wherein there are two images</p> <ol> <li>dog.jpeg</li> <li>dog2.jpeg</li...
72,810,454
remove only 1 type item in datafream without using groupby<div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>item ID</th> <th>type</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>A</td> </tr> <tr> <td>1</td> <td>B</td> </tr> <tr> <td>2</td> <td>A</td> </tr> <tr> <td>3</td> <td>B</td> </tr> <tr> <t...
<p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.transform.html" rel="nofollow noreferrer"><code>GroupBy.transform</code></a> with <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.nunique.html" rel="nof...
remove only 1 type item in datafream without using groupby
pandas
1
39
1
72,810,464
72,810,464
2
true
2022-06-30T04:53:10.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: remove only 1 type item in datafream without using groupby<div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>item ID</th> <th>type</th>...
72,940,049
How can I parse correctly this XML file with parameter in main TAG?<p>I have a file XML in the iSeries IFS.</p> <p>This is the initial parts of the file:</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;Document xmlns=&quot;urn:iso:std:iso:20022:tech:xsd:camt.054.001.04&quot;&gt; ...
<p>The XML sample has a default namespace.</p> <p>All XML elements are bound to that default namespace, even if you don't see it explicitly.</p> <p>So you need to add a namespace handling as a first parameter to the XMLTABLE(..) function. Without it any XPath expression will not find XML elements.</p> <p><strong>SQL</s...
How can I parse correctly this XML file with parameter in main TAG?
sql|xml|db2-400
1
39
1
72,941,247
72,941,247
2
true
2022-07-11T14:20:32.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I parse correctly this XML file with parameter in main TAG?<p>I have a file XML in the iSeries IFS.</p> <p>This is the initial parts of the file:</p>...
73,005,726
Why is the 'question' varaible inside loadQuiz() null?<p>I am trying to make a simple quiz app. The 'question' variable inside the 'loadQuiz()' function comes out to be null . Why is it so ?</p> <p>The 'question' id is given in the HTML tag and I am trying to manipulate its inner text to the questions mentioned in the...
<p>As user1599011 already stated, the <code>&lt;script&gt;</code> tag is loading before the DOM is loaded so <code>question</code> will be <code>null</code> since it doesn't exist yet. Can't reproduce the problem stated in question of course, but I did fix the last part:</p> <p>Change this string...</p> <pre><code>'&lt...
Why is the 'question' varaible inside loadQuiz() null?
javascript|html
1
39
1
73,006,122
73,006,122
2
true
2022-07-16T16:02:55.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the 'question' varaible inside loadQuiz() null?<p>I am trying to make a simple quiz app. The 'question' variable inside the 'loadQuiz()' function come...
73,018,833
html set title attribute to display line break<p>How can I display <em>line-breaks</em> for a hover event using <em>title</em> on a simple html-element? / What is the proper code to be used?</p> <p>I am trying to set the title attribute like so:</p> <pre><code>.setAttribute('title', 'line1 &amp;amp;#013; \&lt;br /&gt;-...
<p>You were close, but used a slash instead of a backslash in <code>\n</code>. HTML code, on the other hand, will not get parsed, so <code>&lt;br&gt;</code> or entities will not work from JavaScript.</p> <p>From <a href="https://html.spec.whatwg.org/multipage/dom.html#the-title-attribute" rel="nofollow noreferrer">the ...
html set title attribute to display line break
javascript|html|attributes|hover
0
39
1
73,019,907
73,019,907
2
true
2022-07-18T07:44:52.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: html set title attribute to display line break<p>How can I display <em>line-breaks</em> for a hover event using <em>title</em> on a simple html-element? / Wh...
72,997,001
Multi-line match according to specific rules<p>How do I match any line containing <code>#Test</code> and also all next lines from it as long they start with:</p> <ul> <li>any amount of space followed by a <code>;</code></li> </ul> <p>Example:</p> <pre><code> 1. ; #Test 2. ; bbbb 3. 4. ; #Tes...
<p>The problem with your RE is that <code>\s</code> also matches newlines.</p> <p>You need to use a regular expression that is explicit about newlines, since you have specific requirements about them.</p> <p>So I would use <code>[ \t]*</code> to match spaces and tabs, instead of <code>\s*</code>:</p> <pre><code>[ \t]*(...
Multi-line match according to specific rules
regex
0
39
1
72,997,160
72,997,160
2
true
2022-07-15T16:23:13.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multi-line match according to specific rules<p>How do I match any line containing <code>#Test</code> and also all next lines from it as long they start with:...
72,958,899
How to check if key exists in a list of key value array<p>I have a like that is like</p> <pre><code>[ {Key: 'FName', Value: 'John'}, {Key: 'LName', Value: 'Doe'}, {Key: 'Age', Value: '30'}, {Key: 'Person', Value: 'true'} ] </code></pre> <p>How is it possible to check if <strong>Person</strong> exists as a K...
<h1>Solution 1</h1> <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some" rel="nofollow noreferrer"><code>&lt;Array&gt;.some</code></a></p> <p>I also made the function take the key you are searching in and the value that you are seeking</p> <p><div class="s...
How to check if key exists in a list of key value array
javascript|node.js
1
39
3
72,958,936
72,958,936
2
true
2022-07-12T22:11:03.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if key exists in a list of key value array<p>I have a like that is like</p> <pre><code>[ {Key: 'FName', Value: 'John'}, {Key: 'LName', Val...
72,932,498
Query to find an entry between dates<p>I have a table containing several records associated to the same entities. Two of the fields are dates - start and end dates of a specific period.</p> <p>Example:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Start</th> <th>...
<p>you can use a <code>SELECT</code> with <code>BETWEEN</code> as <code>WHERE</code> clause</p> <p>The date format of MySQL is yyyy-mm-dd , if you keep that you wil never have problems</p> <blockquote> <pre><code>CREATE TABLE datetab ( `ID` INTEGER, `Name` VARCHAR(4), `Start` DATETIME, `End` DATETIME ); INSER...
Query to find an entry between dates
mysql|sql
1
39
2
72,932,565
72,932,565
2
true
2022-07-10T23:25:34.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query to find an entry between dates<p>I have a table containing several records associated to the same entities. Two of the fields are dates - start and end...
72,953,223
How to pass a string method in a map call?<p>I want to write this <code>[&quot;foo&quot;, &quot;bar&quot;].map {|x| x.capitalize}</code> as something like this <code>[&quot;foo&quot;, &quot;bar&quot;].map(&amp;method(:String.capitalize))</code></p> <p>To be more precise, given a list <code>L</code> of instances of <cod...
<p>What you're looking for is <code>[&quot;foo&quot;, &quot;bar&quot;].map(&amp;:capitalize)</code>.</p> <h2>How does this work?</h2> <p><code>:capitalize</code> is a just a plain ol' ruby symbol. The magic item here is the ampersand which can be used as a prefix to a method argument; the <code>&amp;</code> automatica...
How to pass a string method in a map call?
ruby
0
39
1
72,953,623
72,953,623
2
true
2022-07-12T13:36:02.603Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass a string method in a map call?<p>I want to write this <code>[&quot;foo&quot;, &quot;bar&quot;].map {|x| x.capitalize}</code> as something like th...
72,969,128
apply function to each element in dataframe in R<p>I want to run the below function which normalises a number to every element in my dataframe</p> <pre><code>norm_fn &lt;- function(raw_score, min_score, max_score){ if(raw_score &lt;= min_score){ norm_score &lt;- 1 } else if (raw_score &gt;= max_scor...
<p>A <code>tidyverse</code> approach</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) dat %&gt;% rowwise() %&gt;% mutate( across(.cols = col1:col3, norm_fn, min_score = mn, max_score = mx) ) %&gt;% ungroup() #&gt; # A tibble: 10 × 4 #&gt; ID col1 col2 col3 #&gt; &lt;i...
apply function to each element in dataframe in R
r|apply
1
39
2
72,969,313
72,969,313
2
true
2022-07-13T15:48:23.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: apply function to each element in dataframe in R<p>I want to run the below function which normalises a number to every element in my dataframe</p> <pre><code...
72,870,381
Create a new data.frame with "AsIs" elements<p>I would like to create a new object with properties similar to the example below.</p> <p>Although gas is a data frame, it contains &quot;matrix&quot; like columns with &quot;AsIs&quot; type.</p> <p>As I am a <code>tidyverse</code> user, this structure is strange to me.</p>...
<p>That &quot;AsIs&quot; means we have to use <code>I()</code> to protect data frame columns. Such protection is a must, if we want to have a matrix or a list, rather than a vector, in a data frame column.</p> <pre><code>x &lt;- 1:4 Y &lt;- matrix(5:12, nrow = 4, dimnames = list(LETTERS[1:4], letters[1:2])) Z &lt;- mat...
Create a new data.frame with "AsIs" elements
r|dataframe
1
39
1
72,870,430
72,870,430
2
true
2022-07-05T13:35:40.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a new data.frame with "AsIs" elements<p>I would like to create a new object with properties similar to the example below.</p> <p>Although gas is a dat...
72,847,111
regex - conditional check for 2nd digit based on first digit<p>I am looking up for a regular expression that checks the following:</p> <ul> <li>first digit can be 0 or 1 or 2 [012]</li> <li>if the first digit is 0, then second digit should be odd number [1379]</li> <li>if the first digit is 1, then second digit should ...
<p>The pattern <code>[0-2](?&lt;=0)[1379]</code> looks like you want to use a conditional like &quot;if the value is 0 to the left in the range of 0-2, then match one of <code>[1379]</code>&quot;</p> <p>But if you assert a 0 on the left, you are not matching it but asserting it.</p> <p>You could use a capture group in ...
regex - conditional check for 2nd digit based on first digit
regex
1
39
1
72,847,248
72,847,248
2
true
2022-07-03T14:02:45.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex - conditional check for 2nd digit based on first digit<p>I am looking up for a regular expression that checks the following:</p> <ul> <li>first digit c...
72,934,909
I am unable to import css and js files from statcfiles in root directory<p>I have tried everything suggested on the entire internet and stuck here for over 5 days Here are my settings.py</p> <pre><code>STATIC_URL = '/static/' # Add these new lines STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) STATIC_RO...
<p>From the docs, <a href="https://docs.djangoproject.com/en/4.0/howto/static-files/" rel="nofollow noreferrer">static-files</a></p> <pre><code>{% load static %} {% csrf_token %} {% load crispy_forms_tags %} &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; ...
I am unable to import css and js files from statcfiles in root directory
python|css|django|django-staticfiles
0
39
1
72,935,030
72,935,030
2
true
2022-07-11T07:12:43.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am unable to import css and js files from statcfiles in root directory<p>I have tried everything suggested on the entire internet and stuck here for over 5...
72,815,180
Send multiple strings as separated values<p>I want to make multiple emails as strings to be separated values. I'm trying something like this:</p> <pre><code>sendInquiry: function () { const id = '459875'; const inquiry = { to: 'info@user-mail.com' &amp;&amp; 'info@adm...
<p><code>'info@user-mail.com' &amp;&amp; 'info@admin-mail.com'</code> is interpreted as a boolean by javascript. Indeed, a no void string is <code>true</code>, so <code>'info@user-mail.com' &amp;&amp; 'info@admin-mail.com'</code> is true.</p> <p>To pass multiple strings the optimal data structure is an array, of course...
Send multiple strings as separated values
javascript|vue.js
0
39
1
72,815,380
72,815,380
2
true
2022-06-30T11:43:29.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send multiple strings as separated values<p>I want to make multiple emails as strings to be separated values. I'm trying something like this:</p> <pre><code>...
72,872,177
How to specify conditions for excel COUNTIFS function?<p>What I am trying to do is count the number of values in an excel column named &quot;Report Deadline&quot; that are after today, but also have no value(blank) or have the value &quot;N/A&quot; in another column named &quot;Date Report Issued&quot;</p> <p>I am unfa...
<p>You can't really have an &quot;OR&quot; condition in a <code>COUNTIFS</code>. I would suggest doing two separate <code>COUNTIFS</code>, and then adding them together. Like so:</p> <pre><code>=COUNTIFS(Table22[Report Deadline],&quot;&gt;=&quot; &amp; TODAY(),Table22[Date Report Issued], &quot;&quot;) + COUNTIFS(Table...
How to specify conditions for excel COUNTIFS function?
excel|vba|excel-formula|datatable
1
39
1
72,872,311
72,872,311
2
true
2022-07-05T15:42:49.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to specify conditions for excel COUNTIFS function?<p>What I am trying to do is count the number of values in an excel column named &quot;Report Deadline&...
72,781,501
How to return row values that match column 'id' in both df1 and df2 but not column 'text' and return NA to the mismatch in column 'text'?<p>Below are my two dataframes, df1 and df2</p> <pre><code>df1 &lt;- data.frame(id=c(&quot;632592651&quot;,&quot;633322173&quot;,&quot;634703802&quot;,&quot;634927873&quot;,&quot;6358...
<p>Using <code>dplyr</code> and only joining <code>by</code> &quot;id&quot; you can simplify it like this:</p> <pre><code>library(dplyr) inner_join(x = df1, y = df2, by = &quot;id&quot;) %&gt;% mutate_if(is.factor, as.character) %&gt;% mutate(text = ifelse(test = text.x != text.y, ...
How to return row values that match column 'id' in both df1 and df2 but not column 'text' and return NA to the mismatch in column 'text'?
r|filter|inner-join|mismatch|anti-join
2
39
1
72,781,808
72,781,808
2
true
2022-06-28T06:11:21.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return row values that match column 'id' in both df1 and df2 but not column 'text' and return NA to the mismatch in column 'text'?<p>Below are my two ...
72,941,830
Can Java Serialization UID numbering start at 1<p>The vast majority of examples of a Java <code>serialVersionUID</code> I have seen has a very long <code>long</code> value - see for example <a href="https://www.oracle.com/technical-resources/articles/java/serializationapi.html" rel="nofollow noreferrer">here</a> where ...
<p>From the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" rel="nofollow noreferrer">Serializable Interface Docs</a>:</p> <blockquote> <p>If a serializable class does not explicitly declare a serialVersionUID, then the serialization runtime will calculate a default seri...
Can Java Serialization UID numbering start at 1
java|serialization|deserialization|versioning
2
39
1
72,942,794
72,942,794
2
true
2022-07-11T16:36:44.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can Java Serialization UID numbering start at 1<p>The vast majority of examples of a Java <code>serialVersionUID</code> I have seen has a very long <code>lon...
72,794,083
How to scrape a page that is dynamicaly locaded?<p>So here's my problem. I wrote a program that is perfectly able to get all of the information I want on the first page that I load. But when I click on the <code>nextPage</code> button it runs a script that loads the next bunch of products without actually moving to ano...
<p>The issue it seems to be because you're just fetching the page 1 as shown in the next line:</p> <pre><code>driver.get(&quot;https://www.tcgplayer.com/search/magic/commander-streets-of-new-capenna?productLineName=magic&amp;setName=commander-streets-of-new-capenna&amp;page=1&amp;view=grid&quot;) </code></pre> <p>But a...
How to scrape a page that is dynamicaly locaded?
python|selenium|web-scraping|beautifulsoup
0
39
1
72,794,113
72,794,113
2
true
2022-06-28T23:07:58.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scrape a page that is dynamicaly locaded?<p>So here's my problem. I wrote a program that is perfectly able to get all of the information I want on the...
72,987,885
Hidden worksheet in protected workbook is not appearing<p>Something weird happens with a workbook that I inherited. When I go into the info tab, it says there are one or more sheets in the workbook &quot;data&quot; that have been locked. I put in the password which it accepts, however, when I go back to the workbook t...
<p>This was a case of a Sheet being set to VeryHidden in the Sheet &quot;Visible&quot; property. To my knowledge, VeryHidden can only be set and unset through VBA or the Properties window in the VBA editor. A VeryHidden sheet will Not be listed when rightclicking any Sheet Name Tab to choose the Unhide option, as oppos...
Hidden worksheet in protected workbook is not appearing
excel
1
39
1
72,988,086
72,988,086
2
true
2022-07-15T00:23:40.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hidden worksheet in protected workbook is not appearing<p>Something weird happens with a workbook that I inherited. When I go into the info tab, it says the...
72,956,580
Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried: ['topics/(?P<topic_id>[0-9]+)/\\Z']<p>I am getting this error:</p> <pre><code>Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried: ['topics/(?P&lt;topic_id&gt;[0-9]+)/\\Z'] </code></pre> <p>which I believe is stemming from my...
<p>In your <code>html</code> you need <code>topic.id</code> not <s><code>topics.id</code></s>, so:</p> <pre><code> &lt;a href = &quot;{% url 'topic' topic.id %}&quot;&gt;{{ topic }}&lt;/a&gt; </code></pre> <p>Or maybe:</p> <pre><code> &lt;a href = &quot;{% url 'topic' topic_id=topic.id %}&quot;&gt;{{ topic }}&lt;/a...
Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried: ['topics/(?P<topic_id>[0-9]+)/\\Z']
python|django|django-views|django-templates|django-urls
-1
39
1
72,956,675
72,956,675
2
true
2022-07-12T17:59:58.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried: ['topics/(?P<topic_id>[0-9]+)/\\Z']<p>I am getting this error:</p> <pre><code>Rever...
72,833,865
Contiguous operators in Python raises no error<p>Accidentally, I typed multiple contiguous <code>+</code> operators and it ran successfully. This is what I did</p> <pre><code>2 ++ 3 // returns 5 </code></pre> <p>Then i tried multiple combinations and it actually executes only the last operator</p> <pre><code>2 +++-3 //...
<p>What's happening here is that you have chosen a set of operators that work in both <em>binary</em> and <em>unary</em> use cases. The first operator in the sequence is taken as the <em>binary</em> operator and the rest are taken as <em>unary</em> operators on the right operand. The extra operators are essentially jus...
Contiguous operators in Python raises no error
python|python-3.x|operators
0
39
2
72,834,260
72,834,260
2
true
2022-07-01T19:29:20.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Contiguous operators in Python raises no error<p>Accidentally, I typed multiple contiguous <code>+</code> operators and it ran successfully. This is what I d...
72,826,212
Prevent click event for wrapper when inner link is click<p>Here is the example for UI element construct,</p> <p><strong>HTML</strong></p> <pre><code> &lt;div class='wrap'&gt; &lt;a class='inner-link' href=&quot;#&quot;&gt;Link&lt;/a&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>.w...
<p>Add <code>if</code> to check if the target does not contain class <code>inner-link</code>.</p> <p>UPDATE: Oh, the comment has a better way to solve it.</p> <pre class="lang-js prettyprint-override"><code>$(&quot;.wrap&quot;).click(function (e) { if (e.target.className !== &quot;inner-link&quot;) { // add this ...
Prevent click event for wrapper when inner link is click
javascript|jquery
0
39
2
72,826,311
72,826,311
2
true
2022-07-01T08:07:15.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent click event for wrapper when inner link is click<p>Here is the example for UI element construct,</p> <p><strong>HTML</strong></p> <pre><code> &lt;di...
72,776,307
Does dereferencing a GArray unref it?<pre><code>#include &lt;stdio.h&gt; #include &lt;stdbool.h&gt; #include &lt;stdint.h&gt; #include &lt;glib.h&gt; void transform_pointer_contents(GArray* const arr) { GArray* const tmp = g_array_new(true, true, sizeof(uint8_t)); const uint8_t example_num = 5; g_array_app...
<blockquote> <ul> <li>Why does the unref at the end of transform_pointer_contents cause a double-free?</li> </ul> </blockquote> <p>Presumably, it is not either of the <code>GArray</code> objects themselves that is doubly freed, but rather the dynamic space for the temporary object's data (<code>tmp-&gt;data</code>). T...
Does dereferencing a GArray unref it?
c|glib|reference-counting
0
39
1
72,777,014
72,777,014
2
true
2022-06-27T17:42:24.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does dereferencing a GArray unref it?<pre><code>#include &lt;stdio.h&gt; #include &lt;stdbool.h&gt; #include &lt;stdint.h&gt; #include &lt;glib.h&gt; void t...
72,981,437
How to import shapefile<p>I have installed the pyshp package in my command prompt</p> <pre><code>pip install pyshp </code></pre> <p>and it's successful (&quot;Requirement already satisfied&quot;).</p> <p>But I'm having problems importing shapefile into Jupyter Notebook with</p> <pre><code>import shapefile as sh </code>...
<p><strong>With Conda magic</strong></p> <p>As suggested by @Wayne, you can use a built-in ipython magic command:</p> <pre><code>%pip install pyshp import shapefile as sh </code></pre> <p>More information here: <a href="https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-pip" rel="nofollow noreferrer...
How to import shapefile
python|jupyter-notebook|shapefile|pyshp
1
39
1
72,981,488
72,981,488
2
true
2022-07-14T13:35:03.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import shapefile<p>I have installed the pyshp package in my command prompt</p> <pre><code>pip install pyshp </code></pre> <p>and it's successful (&quo...
72,897,753
Create new column based on condition and give new column a sum of a created value of existing column and a self created value<p>I am trying to create a new column based on a condition of another condition, creating a new column by giving it a self-determined value and (a part of) the value of an existing column. My cod...
<p>I think the major issue you made here is enclosing the resulting values in quotes. This treats them like they are literal strings. Also, use <code>NULL</code> to keep the type <code>double</code> for your <code>new_variable</code>. Try this:</p> <pre><code>Output &lt;- mutate(data, new_variable = if_else(variable...
Create new column based on condition and give new column a sum of a created value of existing column and a self created value
r|if-statement
0
39
1
72,898,188
72,898,188
2
true
2022-07-07T12:22:55.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create new column based on condition and give new column a sum of a created value of existing column and a self created value<p>I am trying to create a new c...
72,976,043
Multiprocess parent return value<p>Im wondering about the nature of the variable <code>status</code> and when its returned in a function.</p> <p>Ive set my function to get an error, but if I dont do <code>return status &gt;&gt; 8</code>(127) and instead do <code>return status</code>, I get a return value of 0.</p> <p>I...
<p>To answer your your question regarding <code>WEXITSTATUS</code>, the answer is yes; it is meant to shift the status down by 8 bits.</p> <blockquote> <pre><code> WEXITSTATUS(wstatus) returns the exit status of the child. This consists of the least significant 8 bits of the status argument that ...
Multiprocess parent return value
c|multiprocessing|return|parent-child
0
39
1
72,976,075
72,976,075
2
true
2022-07-14T06:21:38.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiprocess parent return value<p>Im wondering about the nature of the variable <code>status</code> and when its returned in a function.</p> <p>Ive set my f...
72,866,883
How to filter out certain series from a subset of timeseries?<p>We have a lot of series out of which I need to extract a subset and then filter out certain ones. How does one do it in PromQL. Would be great to be able to do it with just one regular expression, but I can't think of any, especially in such limited regex ...
<p>PromQL allows specifying multiple filters for the same label in a single <a href="https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors" rel="nofollow noreferrer">time series selector</a>. For example, the following query would find <code>up</code> series matching <code>{instance=~&quot...
How to filter out certain series from a subset of timeseries?
prometheus|promql
0
39
1
72,926,966
72,926,966
2
true
2022-07-05T09:17:20.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter out certain series from a subset of timeseries?<p>We have a lot of series out of which I need to extract a subset and then filter out certain o...
72,821,260
Java small jittering in graphical movement of an image<p>I have a buffered image (width = 66, height = 75) that seems to jitter (as if the image is shaking at a small scale) when trying to translate it when it is at an angle. This is the set up that shows the problem (A and D keys to rotate, W and S keys to translate)...
<p>I assume the image quality keeps changing as you keep rotating the image into the various angles repeatedly and each time you may perceive conversion losses.</p> <p>Probably it is better to draw the image once only by applying one AffineTransform only. This AffineTransform is a contatencation of three single transfo...
Java small jittering in graphical movement of an image
java|graphics|bufferedimage
0
39
1
72,821,628
72,821,628
2
true
2022-06-30T19:46:16.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java small jittering in graphical movement of an image<p>I have a buffered image (width = 66, height = 75) that seems to jitter (as if the image is shaking a...
72,787,732
taking the max value in columns including vectors in a dataframe<p>I have a dataframe like below:</p> <pre><code>ID Name R1 R2 R3 A1 c(&quot;Rob&quot;,&quot;Rob&quot;) 27 29 100 A2 c(&quot;Emil&quot;,&quot;Emil&quot;,&quot;Emil&quot...
<p>A <code>data.table</code> option</p> <pre><code>&gt; library(data.table) &gt; setDT(df)[, lapply(.SD, function(x) max(unlist(x))), ID] ID Name R1 R2 R3 1: A1 Rob 1000 123 100 2: A2 Emil 70 567 100 3: A3 Nick 100 93 93 </code></pre>
taking the max value in columns including vectors in a dataframe
r|max|aggregate|unique
1
39
2
72,791,596
72,791,596
3
true
2022-06-28T13:53:50.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: taking the max value in columns including vectors in a dataframe<p>I have a dataframe like below:</p> <pre><code>ID Name R1 ...
72,820,970
How to expit transfration to a pandas dataframe<p>Here's my dataset</p> <pre><code>Id B C 1 0 -1 2 2 -2 </code></pre> <p>here's the expit transformation <code>(exp(x)/(1+exp(x)))</code></p> <pre><code>Id B C 1 0.5 0.269 2 0.881 0.119...
<p>Use vectorization:</p> <pre><code>import numpy as np df.iloc[:, 1:] = np.exp(df.iloc[:, 1:])/(1+np.exp(df.iloc[:, 1:])) print(df) # Output: Id B C 0 1 0.500000 0.268941 1 2 0.880797 0.119203 </code></pre> <p>You can also define your columns explicitly:</p> <pre><code>cols = ['B', 'C'] df...
How to expit transfration to a pandas dataframe
python|pandas
0
39
3
72,821,087
72,821,087
3
true
2022-06-30T19:16:02.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to expit transfration to a pandas dataframe<p>Here's my dataset</p> <pre><code>Id B C 1 0 -1 2 2 -2 </code></pre> ...
72,834,350
Javascript Prototype changed but still accessing old methods<p>I was learning inheritance and Prototype chaining. I was stuck after seeing this behaviour of resetting the constructor function's prototype inside the function itself. On instantiating</p> <ul> <li>Case</li> </ul> <p><div class="snippet" data-lang="js" dat...
<p>At the moment you call <code>new</code>, the prototype object is taken from <code>Student.prototype</code> and used to create <code>this</code>. So at that moment the proto of <code>this</code> is the object that <code>Student.prototype</code> references.</p> <p>It is that proto reference that is later used to find ...
Javascript Prototype changed but still accessing old methods
javascript|inheritance|prototype-chain
1
39
2
72,834,462
72,834,462
3
true
2022-07-01T20:29:23.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript Prototype changed but still accessing old methods<p>I was learning inheritance and Prototype chaining. I was stuck after seeing this behaviour of ...
72,855,978
Python string split in a specific pattern<p>I am trying to split a string in this specific pattern:</p> <pre><code>'ff19shh24c' -&gt; ['f', 'f', '19s', 'h', 'h', '24c'] </code></pre> <p>I managed to get this close:</p> <pre><code>import re string = &quot;ff19shh24c&quot; parts = re.findall(r'\D+|\d+[a-z]{1}') print(...
<p>Search for anything (non-greedy) and then a letter.</p> <pre><code>import re string = &quot;ff19shh24c&quot; parts = re.findall(r'.*?[a-z]', string) print(parts) </code></pre> <p>This will give you <code>['f', 'f', '19s', 'h', 'h', '24c']</code></p>
Python string split in a specific pattern
python|python-3.x
0
39
3
72,856,028
72,856,028
3
true
2022-07-04T11:28:43.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python string split in a specific pattern<p>I am trying to split a string in this specific pattern:</p> <pre><code>'ff19shh24c' -&gt; ['f', 'f', '19s', 'h', ...
72,878,795
Unable to use io.read() to grab the user's input after already using it to grab a file's contents<p>I've got this program that starts off with the program grabbing a file's contents.</p> <pre><code>local oldprint = print local print = io.write -- this was done mainly because the newline from print() wasn't needed io.i...
<p>By calling <code>io.input(&quot;script.txt&quot;)</code> you set that file as the default input file. Any following calls to io.read() will hence read from that file.</p> <p>Either use <code>file:read</code> instead of <code>io.read</code> or reset the input to the standard input stream by calling <code>io.input(io....
Unable to use io.read() to grab the user's input after already using it to grab a file's contents
lua
1
39
2
72,879,848
72,879,848
3
true
2022-07-06T06:26:59.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to use io.read() to grab the user's input after already using it to grab a file's contents<p>I've got this program that starts off with the program gr...
72,889,196
How can I parse JSON with many level of nesting?<p>I have a JSON file to be parsed to get specific information. Here is the JSON:</p> <pre><code>{ &quot;$schema&quot; : &quot;https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.4.json&quot;, &quot;version&quot; : &quot;2.1.0&quot;, &quot;runs&quot; ...
<p>You need to loop over the nested lists in <code>runs</code> and <code>rules</code>.</p> <p>You can use a nested list comprehension to get the result you want.</p> <pre><code>result = [rule['id'] for run in fcc_data['runs'] for rule in run['tool']['driver']['rules']] </code></pre>
How can I parse JSON with many level of nesting?
python|json
0
39
2
72,889,271
72,889,271
3
true
2022-07-06T19:56:22.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I parse JSON with many level of nesting?<p>I have a JSON file to be parsed to get specific information. Here is the JSON:</p> <pre><code>{ &quot;$s...
72,897,963
Are the authentication tokens validated for every request by the ASP.NET Core Web API?<p>I have the following configuration in my ASP.NET Core Web API:</p> <pre><code>// Adds Microsoft Identity platform (AAD v2.0) support to protect this Api services.AddMicrosoftIdentityWebApiAuthentication(configuration); services.Ad...
<p>Yes, the tokens are validated by every request. But there is no &quot;Microsoft validate endpoint&quot;, it does the validation completely in-memory most of the time.</p> <p>What actually happens at runtime:</p> <ol> <li>App startup</li> <li>App downloads metadata from &quot;authority-uri/.well-known/openid-configur...
Are the authentication tokens validated for every request by the ASP.NET Core Web API?
c#|authentication|azure-active-directory|asp.net-core-webapi
0
39
2
72,898,045
72,898,045
3
true
2022-07-07T12:39:43.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are the authentication tokens validated for every request by the ASP.NET Core Web API?<p>I have the following configuration in my ASP.NET Core Web API:</p> <...
72,899,116
Why is the button colour being affected by the background?<p>I have a site with a gradient background. That works fine. But, when I add a button to it, the colour changes to the one on the background. This is my CSS:</p> <p>BTW, open the snippet on full-page, or it won't look clear</p> <p><div class="snippet" data-lang...
<p>The opacity of <code>#parent</code> is <code>30%</code> so it <strong>and everything inside it</strong> is translucent.</p> <p>If you wanted to set the <em>background</em> of <code>#parent</code> to be translucent, then use a <code>background-color</code> with an alpha channel, don't use <code>opacity</code>.</p>
Why is the button colour being affected by the background?
html|css
-1
39
1
72,899,194
72,899,194
3
true
2022-07-07T13:55:22.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the button colour being affected by the background?<p>I have a site with a gradient background. That works fine. But, when I add a button to it, the c...
72,901,460
Typescript syntax for Set of Strings similar to string[]?<p>In <a href="https://www.typescriptlang.org/static/TypeScript%20Interfaces-34f1ad12132fb463bd1dfe5b85c5b2e6.png" rel="nofollow noreferrer">Typescript</a>, you can define an Array of Strings as <code>string[]</code> or <code>Array&lt;string&gt;</code>. My team p...
<p>No shorthand syntax exists for <code>Set</code>s like there are are for <code>Array</code>s. The only option is <code>Set&lt;MyTypeHere&gt;</code>.</p>
Typescript syntax for Set of Strings similar to string[]?
typescript|set
1
39
1
72,901,496
72,901,496
3
true
2022-07-07T16:39:15.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript syntax for Set of Strings similar to string[]?<p>In <a href="https://www.typescriptlang.org/static/TypeScript%20Interfaces-34f1ad12132fb463bd1dfe5...
72,936,370
Even user can also access the APEX page need to restrict<p>I have created a application which as 4 pages</p> <ul> <li>Home</li> <li>Admin page</li> <li>Calculate BMI</li> <li>About</li> </ul> <p>Then I went into <code>-&gt; shared components -&gt; Select Authorization schema -&gt; Create</code></p> <p>I have set a name...
<p>It is not</p> <pre><code>IF :myrole = 'ADMIN' THEN </code></pre> <p>but</p> <pre><code>IF myrole = 'ADMIN' THEN </code></pre> <p>i.e. no semi-colon in front of <code>myrole</code>. It isn't a page item or anything like that; it's just a local variable.</p>
Even user can also access the APEX page need to restrict
oracle-apex
0
39
2
72,936,580
72,936,580
3
true
2022-07-11T09:30:39.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Even user can also access the APEX page need to restrict<p>I have created a application which as 4 pages</p> <ul> <li>Home</li> <li>Admin page</li> <li>Calcu...
72,944,405
Find all tags on commits that contain a specific version of a file<p>I have a rather large git repository with files that have been left unchanged for years. As such they have been part of many commits, and some of these commits have been tagged (published versions).</p> <p>How can I obtain a list of all the tags that ...
<pre><code>git for-each-ref refs/tags \ --format=$'%(objectname)^{commit}:path/to/that/file\t%(refname:short)' \ | git cat-file --batch-check=$'%(objectname)\t%(rest)' --buffer \ | awk '$1==id { print $2 }' id=`git rev-parse :path/to/that/file` </code></pre> <p>for the currently-checked-out version you mentione...
Find all tags on commits that contain a specific version of a file
git|tags
1
39
2
72,944,906
72,944,906
3
true
2022-07-11T20:37:55.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find all tags on commits that contain a specific version of a file<p>I have a rather large git repository with files that have been left unchanged for years....
72,969,549
Multiple lines on a plot using Matplotlib<p>I am generating 4 rectangles using <code>ax.add_patch</code>. I want to connect these rectangles using single lines as shown in the expected output.</p> <pre><code>import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.patches import Rectangle fig,ax = plt....
<p>Try placing vertical and horizontal lines at those positions</p> <pre class="lang-py prettyprint-override"><code>import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.patches import Rectangle fig,ax = plt.subplots(1) n=2 for i in range(0,n): for j in range(0,n): rect = mpl.patches.Rec...
Multiple lines on a plot using Matplotlib
python|matplotlib
0
39
2
72,969,666
72,969,666
3
true
2022-07-13T16:21:24.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple lines on a plot using Matplotlib<p>I am generating 4 rectangles using <code>ax.add_patch</code>. I want to connect these rectangles using single lin...
72,989,269
How to set the page color of pdf output of Rmarkdown?<p>I am searching around here to add a page color to pdf output of Rmarkdown but couldn'tfind any possible way to do. Is it possible to change the page color of pdf output of Rmarkdown? If yes, how to add color to the page? Thanks for any help.</p>
<p>If you want to change page background color, you can do this by using <code>xcolor</code> <strong>LaTex package</strong>. Before the section header, for example, here before the line <code>## R Markdown</code>, you can specify the yellow as the background color of that page using <code>\pagecolor{yellow}</code>. Als...
How to set the page color of pdf output of Rmarkdown?
r-markdown
1
39
1
72,989,933
72,989,933
3
true
2022-07-15T05:07:23.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set the page color of pdf output of Rmarkdown?<p>I am searching around here to add a page color to pdf output of Rmarkdown but couldn'tfind any possib...
72,995,816
Reorder Bars of a Stacked Barchart in R<p>I swear I have looked at many questions here to try to find this answer, but have not been able to discover it (including <a href="https://stackoverflow.com/questions/54949044/reordering-variables-in-stacked-bar-chart-according-to-value-ggplot2">here</a>, <a href="https://stack...
<p>One option would be to <code>reorder</code> your <code>Identity</code> column by a helper <code>Value</code> &quot;column&quot; where you set the values for non-<code>High</code> categories to zero and use <code>FUN=sum</code>:</p> <pre class="lang-r prettyprint-override"><code>data1$Identity &lt;- reorder(data1$Ide...
Reorder Bars of a Stacked Barchart in R
r|ggplot2
0
39
1
72,996,163
72,996,163
3
true
2022-07-15T14:49:52.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reorder Bars of a Stacked Barchart in R<p>I swear I have looked at many questions here to try to find this answer, but have not been able to discover it (inc...
73,004,196
for loop outputs functional brackets<p>At my Python code, I have the following line:</p> <pre><code>init_segment = str([init_segment for init_segment in os.listdir(job_output_root + '/' + track) if init_segment.startswith(&quot;init-&quot;)]) </code></pre> <p>If I output the variable, the &quot;[brackets]&quot; are inc...
<p>You are getting the string representation of the list. You want a single string created from the <em>elements</em> of the list only; use the <code>join</code> method to create that string.</p> <pre><code>init_segment = ''.join([x for x in os.listdir(job_output_root + '/' + track) ...
for loop outputs functional brackets
python
1
39
1
73,004,229
73,004,229
3
true
2022-07-16T12:25:56.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: for loop outputs functional brackets<p>At my Python code, I have the following line:</p> <pre><code>init_segment = str([init_segment for init_segment in os.l...
73,004,579
Working with strings, copying the content<p>He has been trying to deal with the problem for some time. More precisely, it tries to extract some information from a string:</p> <pre><code>string source = &quot;1\t\r\nFIRST\t36\t4.976.501\t3.162\t3.121\t26\r\n2\t\r\n&quot;; </code></pre> <p>I would like the end result to ...
<p>There is an overload of <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string.indexof?view=net-6.0#system-string-indexof(system-string-system-int32)" rel="nofollow noreferrer"><code>String.IndexOf</code></a> that allows to specify the position from which to search for the next occurence. After getting t...
Working with strings, copying the content
c#|string
0
39
2
73,004,628
73,004,628
3
true
2022-07-16T13:24:16.113Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Working with strings, copying the content<p>He has been trying to deal with the problem for some time. More precisely, it tries to extract some information f...