question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
73,026,261
onBlur attached to div getting called while moving from one input element to other present in the same div<p>So I have a div and inside that div I have two input fields, like:</p> <pre><code> &lt;div&gt; &lt;input placeholder=&quot;Input1&quot;/&gt; &lt;input placeholder=&quot;Input2&quot;/&gt; &lt;/div&gt; </...
<p>By passing in the <code>event</code> as a parameter to your <code>handleOnBlur</code> function, you can make use of <code>currentTarget</code> and <code>relatedTarget</code> properties, and discard events where the <code>relatedTarget</code> (<code>&lt;input&gt;</code>) is a child of the <code>currentTarget</code> (...
onBlur attached to div getting called while moving from one input element to other present in the same div
javascript|html|reactjs|dom-events|onblur
1
60
1
73,026,371
73,026,371
2
true
2022-07-18T17:24:23.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: onBlur attached to div getting called while moving from one input element to other present in the same div<p>So I have a div and inside that div I have two i...
73,030,094
How to edit element from within document.createelement?<p>I have a function where I add a row to my table whenever I click a button. Within one of the table columns is a select dropdown menu with the numbers 1-10, but I don't know how to edit it from within the function. Here's the relevant code</p> <pre><code>table_ro...
<p>Here's the HTML code that's modified by the JavaScript code with comments explaining each line.</p> <p>It doesn't need to use a <code>while()</code> loop, but it's cleaner since your original example had a <code>select</code> HTML element with incrementing number values.</p> <p><div class="snippet" data-lang="js" da...
How to edit element from within document.createelement?
javascript|html|createelement
0
60
2
73,030,343
73,030,343
2
true
2022-07-19T01:10:40.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to edit element from within document.createelement?<p>I have a function where I add a row to my table whenever I click a button. Within one of the table ...
73,005,016
Send auth context to firebase callable function in unittest<p>I have been working on a firebase project in which I created a cloud function that creates documents in firestore. This is the function -</p> <pre class="lang-js prettyprint-override"><code>export const createExpenseCategory = functions .region(&quot;europ...
<p>You can unit test your functions using the <a href="https://firebase.google.com/docs/functions/unit-testing" rel="nofollow noreferrer"><code>firebase-functions-test</code></a> SDK. The guide mentions you can mock the data within the <a href="https://firebase.google.com/docs/reference/functions/cloud_functions.eventc...
Send auth context to firebase callable function in unittest
firebase|google-cloud-functions
2
60
1
73,041,926
73,041,926
2
true
2022-07-16T14:30:42.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send auth context to firebase callable function in unittest<p>I have been working on a firebase project in which I created a cloud function that creates docu...
73,030,184
Refactoring: Converting future.get() to CompletionStage.whenComplete()?<p>I currently have some code in Java which looks something like this, but I want to refactor this.</p> <pre class="lang-java prettyprint-override"><code>List&lt;Object&gt; combinedStatus = new ArrayList(); for (List&lt;Long&gt; batch: batches){ ...
<p>You can not avoid blocking for a method that is supposed to return the final result, i.e. the <code>List&lt;Object&gt;</code>. The only way to make this method non-blocking, is by returning a future for the final result.</p> <p>Then, the most straight-forward way to deal with a list of futures, is to keep the loop, ...
Refactoring: Converting future.get() to CompletionStage.whenComplete()?
java|asynchronous|concurrency|completable-future
0
60
1
73,078,130
73,078,130
2
true
2022-07-19T01:31:28.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Refactoring: Converting future.get() to CompletionStage.whenComplete()?<p>I currently have some code in Java which looks something like this, but I want to r...
72,985,583
Get pointer type of a reflect.Type<p>Assume I only have a <a href="https://pkg.go.dev/reflect#Type" rel="nofollow noreferrer">reflect.Type</a> <code>t</code>:</p> <pre><code>fmt.Println(t) //prints lib.Counter </code></pre> <p>I would like to get pointer type to this type, such that:</p> <pre><code>fmt.Println(ptrT) //...
<p>You can use <a href="https://cs.opensource.google/go/go/+/go1.18.4:src/reflect/type.go;l=1441" rel="nofollow noreferrer">reflect.PointerTo</a>.</p> <p>To get the non-pointer type again, you can use <a href="https://cs.opensource.google/go/go/+/refs/tags/go1.18.4:src/reflect/type.go;l=947" rel="nofollow noreferrer">T...
Get pointer type of a reflect.Type
go|reflection
0
60
2
72,985,670
72,985,670
2
true
2022-07-14T19:13:28.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get pointer type of a reflect.Type<p>Assume I only have a <a href="https://pkg.go.dev/reflect#Type" rel="nofollow noreferrer">reflect.Type</a> <code>t</code>...
72,981,352
How to set an HTML Element's attribute to null?<p>Using <code>setAttribute(&lt;key&gt;, &lt;value&gt;)</code> means the null value supplied will be converted to a string, and you end up with <code>&lt;element &lt;key&gt;=&quot;null&quot;&gt;</code>.</p> <p>I would ideally like the element to appear as <code>&lt;element...
<p><strong>Edge / Chrome only:</strong></p> <p>Set the element attribute to an empty string <code>''</code> is sufficient to have the attribute value set to null (tested in Edge/Chromium). This will not lead the element to have a <code>&lt;attr&gt;=&quot;&quot;</code> in its tag. See example below.</p> <p><div class="s...
How to set an HTML Element's attribute to null?
javascript|html
0
60
2
72,982,744
72,982,744
2
true
2022-07-14T13:29:14.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set an HTML Element's attribute to null?<p>Using <code>setAttribute(&lt;key&gt;, &lt;value&gt;)</code> means the null value supplied will be converted...
72,929,287
What part of overload resolution (or more generally of the function call processing) does the value category of the argument play a role in?<p><a href="http://www.tmplbook.com/" rel="nofollow noreferrer">C++ Templates - The Complete Guide</a>, in §C.1, reads</p> <blockquote> <ul> <li>Overload resolution is performed to...
<blockquote> <p>why the value category is not mentioned at all in the points above?</p> </blockquote> <p>It is mentioned in the book as can be seen as quoted below. In particular, if you continue reading further then you'll see that the <em>section C.2.2</em> titled <strong>Refining the Perfect Match</strong> does ment...
What part of overload resolution (or more generally of the function call processing) does the value category of the argument play a role in?
c++|c++17|overload-resolution|value-categories
3
60
1
72,929,458
72,929,458
2
true
2022-07-10T14:37:29.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What part of overload resolution (or more generally of the function call processing) does the value category of the argument play a role in?<p><a href="http:...
72,930,048
Fit a 2d linear stochastic differential equation with R or python<p>I have the following linear SDE</p> <p><a href="https://i.stack.imgur.com/kQOrS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kQOrS.png" alt="enter image description here" /></a></p> <p>where all the parameters are positive. B is t...
<p>You can get the Brownian motion as in the following question: <a href="https://stackoverflow.com/questions/61701138/brownian-motion-simulation-using-r">Brownian motion simulation using R</a></p> <p>Once you have tha data, your problem turns into a optimization problem. Rewrinting your SDE (let me know if you didn't ...
Fit a 2d linear stochastic differential equation with R or python
python|r|model-fitting
-1
60
1
72,931,083
72,931,083
2
true
2022-07-10T16:20:48.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fit a 2d linear stochastic differential equation with R or python<p>I have the following linear SDE</p> <p><a href="https://i.stack.imgur.com/kQOrS.png" rel=...
72,807,069
How to trigger a specific element in a list of elements that are created using .map in React JS?<p>I'm trying to make an accordion, that opens up upon clicking the &quot;+&quot; icon. But when I click on a single element, all the other elements expand. Is there a way to just open one of the accordions? I've added the s...
<h2>Explanation</h2> <p>Basically you can't use a single variable to toggle all your elements. All the elements will act as a single element, so either all will open or all will close.</p> <p>You need something that can be checked against each element. Now <code>id</code> is a potential candidate but it has it's drawba...
How to trigger a specific element in a list of elements that are created using .map in React JS?
javascript|reactjs|react-hooks|jsx
1
60
2
72,807,325
72,807,325
2
true
2022-06-29T19:49:28.440Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trigger a specific element in a list of elements that are created using .map in React JS?<p>I'm trying to make an accordion, that opens up upon clicki...
72,991,810
how to simplify this complex query<p>This is an extract of one of my php functions. I'm struggling to get this optimized as is super slow, as I need to load all interview records, and then check if the current user is either assigned as <code>user_id</code> on the interview record, or if the <code>user-&gt;id</code> is...
<p>You should be able to query the columns in the interview query itself. You can read more about querying JSON columns <a href="https://laravel.com/docs/9.x/queries#json-where-clauses" rel="nofollow noreferrer">here</a>.</p> <p>You should also change the <code>sortBy</code> to <code>orderBy</code> since <code>sortBy</...
how to simplify this complex query
php|sql|laravel|database|eloquent
0
60
1
72,991,961
72,991,961
2
true
2022-07-15T09:23:33.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to simplify this complex query<p>This is an extract of one of my php functions. I'm struggling to get this optimized as is super slow, as I need to load ...
72,826,725
are there any functions in BLAS that can perform skew-symmetric matrix-vector products?<p>I'm thinking of performing some calculations with Intel-MKL, specifically the matrix-vector Sparse BLAS functions for a program in Fortran.</p> <p>I can express my calculations in matrices that happen to be sparse and skew-symmetr...
<p>TLDR; MKL Sparse BLAS can do matrix-vector multiplications with a sparse matrix expressed as the upper/lower triangle by the <a href="https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/blas-and-sparse-blas-routines/sparse-blas-level-2-and-level-3-routines/sparse-blas...
are there any functions in BLAS that can perform skew-symmetric matrix-vector products?
fortran|lapack|blas|intel-mkl
1
60
1
72,838,432
72,838,432
2
true
2022-07-01T08:51:03.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: are there any functions in BLAS that can perform skew-symmetric matrix-vector products?<p>I'm thinking of performing some calculations with Intel-MKL, specif...
72,802,580
How can I save current router into a state?<p>I'm trying to use 2 different headers. I just need to save the current router page into a state. so I can implement conditional styling. something like this</p> <pre class="lang-js prettyprint-override"><code> const [page, setPage] = useState(&quot;black&quot;); const da...
<p>you don't need to save current route in the state, you can make the condition on <code>router.asPath</code> base like: <code>router.asPath === &quot;/404&quot; ? &quot;white&quot; : &quot;black&quot;</code> also here you can see the example on <a href="https://nextjs.org/docs/api-reference/next/router" rel="nofollow...
How can I save current router into a state?
reactjs|typescript|next.js
0
60
1
72,802,685
72,802,685
2
true
2022-06-29T13:51:27.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I save current router into a state?<p>I'm trying to use 2 different headers. I just need to save the current router page into a state. so I can imple...
72,922,846
Why does powershell say cl.exe is not recognized?<p>I have visual studio installed, and cl.exe runs perfectly fine after vcvarsall.bat has been run in cmd but in powershell it says it is not recognized. cmd.exe</p> <pre><code>C:\Users\Ethos&gt;vcvarsall.bat x64 **********************************************************...
<p>Note:</p> <ul> <li><p>The following assumes that there isn't also a <code>vcvarsall.ps1</code> <em>PowerShell</em> script file, i.e. the PowerShell equivalent to the <code>vcvarsall.bat</code> <em>batch</em> file.</p> </li> <li><p>If <code>vcvarsall.ps1</code> exists, simply call it instead (<code>.\vcvarsall.ps1</c...
Why does powershell say cl.exe is not recognized?
windows|visual-studio|powershell|cl
2
60
1
72,923,046
72,923,046
2
true
2022-07-09T16:01:01.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does powershell say cl.exe is not recognized?<p>I have visual studio installed, and cl.exe runs perfectly fine after vcvarsall.bat has been run in cmd bu...
72,913,124
vue.js - Is there any way to render elements in two different divs using one v-for loop?<p>The goal is to make the output look like this:</p> <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;tabs&quot;&gt; &lt;div id=&quot;first&quot;&gt; &lt;a&gt;tab 1&lt;/a&gt; &lt;a&gt;tab 2&lt;...
<p>There's no problem using more than one <code>v-for</code> loops. And there's no problem using nested <code>v-for</code> loops.</p> <p>The problem I see with your current code is that it's not scalable. You're hard-coding the exact values of your tabs in <code>&lt;template /&gt;</code>(e.g: <code>first</code>, <code>...
vue.js - Is there any way to render elements in two different divs using one v-for loop?
javascript|vue.js|loops
0
60
3
72,913,778
72,913,778
2
true
2022-07-08T14:43:35.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vue.js - Is there any way to render elements in two different divs using one v-for loop?<p>The goal is to make the output look like this:</p> <pre class="lan...
72,987,914
What does {ggdist}'s stat_interval levels calculate (I thought it was confidence intervals but they're not correct)?<p>I'm using <code>ggdist</code> (which is awesome) to show variability within a sample. I have a series of means, SDs, and std.errors and I want to use the <code>stat_interval()</code> function to show t...
<p>I believe the ranges being plotted are simply the quantiles, not confidence intervals. e.g.:</p> <pre><code>&gt; quantile(rnorm(10000, 39.5, 0.5), c(0.025, 0.975 )) 2.5% 97.5% 38.49979 40.46578 </code></pre> <p>For confidence intervals, I think you are looking for Students T. e.g.:</p> <pre><code>data %&gt;%...
What does {ggdist}'s stat_interval levels calculate (I thought it was confidence intervals but they're not correct)?
r|ggplot2|distribution|confidence-interval
2
60
1
72,988,272
72,988,272
2
true
2022-07-15T00:30:13.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does {ggdist}'s stat_interval levels calculate (I thought it was confidence intervals but they're not correct)?<p>I'm using <code>ggdist</code> (which i...
72,966,797
How to debug on exceptions inside try except block?<p>The PyCharm debugger has the feature to set breakpoints at raised exceptions. However if an exception is handled inside a try except block it is not raised. How to deal with this if I want to debug within the try block? I could comment out the try except parts but t...
<p>In the breakpoints settings (Either the <a href="https://i.stack.imgur.com/yapEp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yapEp.png" alt="breakpoint symbol" /></a> icon in the debug toolbar, or <kbd>ctrl</kbd>+<kbd>shft</kbd>+<kbd>F8</kbd>), you can <a href="https://www.jetbrains.com/help/p...
How to debug on exceptions inside try except block?
python|pycharm
3
60
1
72,967,141
72,967,141
2
true
2022-07-13T13:01:57.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to debug on exceptions inside try except block?<p>The PyCharm debugger has the feature to set breakpoints at raised exceptions. However if an exception i...
72,955,286
How to change data through select input in d3 chart in svelte?<p>I'm trying to change the data to update the plot. I can do this manually by changing the <code>.data()</code> with <code>data1</code> or <code>data2</code>. But I would like to do this by using select input. I added the select input but I am unsure about ...
<p>You can use a reactive statement to do this:</p> <pre class="lang-js prettyprint-override"><code>$: selected === 'data1' ? setData (data1) : setData (data2) </code></pre> <p>EDIT: Adding Functioning REPL: <a href="https://svelte.dev/repl/02c579e1d3c54fe584f4ced130ddbf06?version=3.49.0" rel="nofollow noreferrer">http...
How to change data through select input in d3 chart in svelte?
d3.js|svelte
1
60
1
72,958,705
72,958,705
2
true
2022-07-12T16:07:31.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change data through select input in d3 chart in svelte?<p>I'm trying to change the data to update the plot. I can do this manually by changing the <co...
72,859,643
Remove all elements from a nested list<p>How can I remove all elements from a nested list.</p> <p>I have a list</p> <pre><code>exlines = ['BT--45', 'BX--W45'] </code></pre> <p>and a nested list</p> <pre><code>Node= ['BSTP12', 'F5 Inc.', '24 hours ago'], ['BX--34', 'F5 Inc.', '24 hours ago'], ['QDVPLF', 'F5 Inc.', '24 ...
<p>This seems pretty straightforward. Let's use a list comprehension to generate a <em>new</em> list <em>without</em> the sublists you want to avoid.</p> <pre><code>exlines = ['BT--45', 'BX--W45'] Node = [ ['BSTP12', 'F5 Inc.', '24 hours ago'], ['BX--34', 'F5 Inc.', '24 hours ago'], ['QDVPLF', 'F5 Inc.', '24 hours...
Remove all elements from a nested list
python
-2
60
1
72,859,716
72,859,716
2
true
2022-07-04T16:20:58.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove all elements from a nested list<p>How can I remove all elements from a nested list.</p> <p>I have a list</p> <pre><code>exlines = ['BT--45', 'BX--W45...
72,851,856
How to reference the value of data section in macro?<p>I don't know how to reference it, if I use macro, and the parameter seems to a string, and if I use addressing mode on it, then macro get the string yet, like <code>(test), $test</code>, .etc.</p> <p>Below code just for example!!</p> <pre><code>.macro newcat str ne...
<p>You can't read memory contents at assemble time, with or without macros. You can't assemble bytes into some section and then have another directive copy those bytes somewhere else.</p> <p><strong>What you can do is define a new symbol to have the <em>same address</em> as another symbol</strong>, which is obviously ...
How to reference the value of data section in macro?
assembly|x86|att|gnu-assembler
0
60
1
72,852,047
72,852,047
2
true
2022-07-04T04:43:17.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reference the value of data section in macro?<p>I don't know how to reference it, if I use macro, and the parameter seems to a string, and if I use ad...
73,020,456
How to make a sequence in google sheets which has increments in regular intervals<p>I want to create a sequence in <strong>google sheets</strong> where i have to make a sequence of this sort like if the sequence starts at 5000, it should be 5000 for the next 12 rows and then it should increment to 5500 and then it shou...
<pre><code>=ArrayFormula(vlookup(quotient(sequence(Blocklength*Blocks,1,0),Blocklength), {sequence(Blocks,1,0),Start*(1+Increment)^(sequence(Blocks,1,0))},2)) </code></pre> <p><a href="https://i.stack.imgur.com/EFdi0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EFdi0.png" alt="enter image descript...
How to make a sequence in google sheets which has increments in regular intervals
google-sheets|google-sheets-formula
1
60
3
73,021,101
73,021,101
2
true
2022-07-18T10:00:40.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a sequence in google sheets which has increments in regular intervals<p>I want to create a sequence in <strong>google sheets</strong> where i hav...
72,916,071
tidyr::complete behaves oddly depending on column class and rounding specification<p>I have a data frame of depths for a number of different stations in a lake, and I want every station to have a complete sequence of depths from the min to the max (and missing values filled with NAs).</p> <p>I am using tidyr::complete ...
<p>Indeed, <code>complete()</code> is producing extra unexplained elements.</p> <p>I think, when <code>complete()</code> matches the numbers produced by the sequence and the numbers in the original data, it evaluates (1.4 == 1.4) as <code>FALSE</code> and returns them as two different numbers. I did a small test and I ...
tidyr::complete behaves oddly depending on column class and rounding specification
r|class|numeric
2
60
1
72,918,508
72,918,508
2
true
2022-07-08T19:18:00.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tidyr::complete behaves oddly depending on column class and rounding specification<p>I have a data frame of depths for a number of different stations in a la...
72,768,215
Python -- Confusing result when combining for loop with while loop<p>Hi I'm new to programming. I tried to use for loop and a nested while loop to calculate the sum of an arithmetic sequence on condition that the sum is no bigger than 100. I wrote the code below, but the output was 100 instead of the correct sum of the...
<p>Putting a nested <code>while</code> loop in the <code>for</code> loop is not doing that you think it is.</p> <p>What you want to do is:</p> <ul> <li>Loop over the elements of the sequence, adding the current element at each iteration</li> <li>If the sum is greater than or equal to 100, stop there and keep the sum un...
Python -- Confusing result when combining for loop with while loop
python|for-loop|while-loop|nested-loops
1
60
1
72,768,359
72,768,359
2
true
2022-06-27T07:13:38.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python -- Confusing result when combining for loop with while loop<p>Hi I'm new to programming. I tried to use for loop and a nested while loop to calculate ...
72,916,420
Thymeleaf decorator problem after upgrading spring boot to greater than 2.5.4<p>I have a MVC application based on spring-boot:2.5.4.</p> <p>After migrating from spring-boot 2.5.4, to 2.5.14-2.6.7 Thymeleaf layout does'nt import header (header tag is empty) and leaves blank other inserted elements( like layouts/sidebar ...
<p>I was albe to fix my issue by reading <a href="https://ultraq.github.io/thymeleaf-layout-dialect/migrating-to-3.0/" rel="nofollow noreferrer">migration notes for Thymeleaf</a>.</p> <p>The section:</p> <blockquote> <p>This was deprecated back in 2.0 (thymeleaf-layout-dialect/issues/95) in favour of decorate as the na...
Thymeleaf decorator problem after upgrading spring boot to greater than 2.5.4
spring-boot|thymeleaf|spring-thymeleaf
0
60
1
72,923,340
72,923,340
2
true
2022-07-08T19:56:20.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Thymeleaf decorator problem after upgrading spring boot to greater than 2.5.4<p>I have a MVC application based on spring-boot:2.5.4.</p> <p>After migrating f...
73,026,907
Trying to evaluate two classes with a BenchmarkDotNet test<p>I'm trying to figure out which one of these classes below is faster, so I decided to write a BenchmarkDotNet test.</p> <pre class="lang-cs prettyprint-override"><code>public class RequestSignerBenchmark { [Benchmark] public void First() { ...
<p>As I mentioned in the comments above, I believe your assertion that the <code>RequestSigner2</code> implementation should be faster &quot;may&quot; be incorrect based on how your test is currently structured.</p> <p>You have two additional if checks in your <code>RequestSigner2</code> implementation that are having ...
Trying to evaluate two classes with a BenchmarkDotNet test
c#|.net|benchmarking|benchmarkdotnet
2
60
1
73,027,266
73,027,266
2
true
2022-07-18T18:21:44.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to evaluate two classes with a BenchmarkDotNet test<p>I'm trying to figure out which one of these classes below is faster, so I decided to write a Ben...
72,841,823
Move fontAwesome 6 icon to the right<p>I am trying to move this icon to the top right of the file, but I can't, does anyone know how? (I got this icon for free from <a href="https://fontawesome.com/" rel="nofollow noreferrer">fontAwesome</a>)</p> <p>Here's the code</p> <p><div class="snippet" data-lang="js" data-hide="...
<p>Because <code>fa-solid</code> has <code>display: inline-block</code> by default (from this rule: <code>display: var(--fa-display,inline-block)</code> the <code>text-align:right</code> by itself won't work.</p> <p>Here are a few solutions:</p> <hr /> <h3>You can set the CSS vars <code>--fa-display</code> there is bui...
Move fontAwesome 6 icon to the right
html|css|font-awesome|font-awesome-6
0
60
2
72,841,876
72,841,876
2
true
2022-07-02T19:13:08.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move fontAwesome 6 icon to the right<p>I am trying to move this icon to the top right of the file, but I can't, does anyone know how? (I got this icon for fr...
73,009,816
Javascript - Getting null when I expect number<p>I have some Javascript that hashes. msgBuffer definitely has bytes in it after the hash, but in the following code, the nonce ends up null. What do I need to do to add the first byte of msgBuffer to the nonce?</p> <pre><code> var msgBuffer = await crypto.subtle.dige...
<p><code>await crypto.subtle.digest('SHA-256', toHash)</code> would return ArrayBuffer.</p> <p>You should first convert it to proper type, and then get the value.</p> <p>e.g. do this.</p> <pre><code>var msgBuffer = await crypto.subtle.digest('SHA-256', toHash); var myArr = new Uint8Array(msgBuffer); var nonce = 0; nonc...
Javascript - Getting null when I expect number
javascript|arrays
0
60
1
73,009,900
73,009,900
2
true
2022-07-17T07:06:18.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript - Getting null when I expect number<p>I have some Javascript that hashes. msgBuffer definitely has bytes in it after the hash, but in the followi...
72,838,171
Django: Applying indexes on abstract models so that children have it<p>Can we apply indexes on abstract models so that all children inherit it?</p> <p>I have an abstract model which feeds other models :</p> <pre><code>from model_utils.models import UUIDModel from django.db import models class TimeStampedUUIDModel(UUI...
<p>Each index must have a unique name; since children inherit the index name from the parent, a collision occurs, so an explicit name containing <code>'%(class)s'</code> must be set:</p> <pre class="lang-py prettyprint-override"><code>class TimeStampedUUIDModel(UUIDModel): created_at = models.DateTimeField(auto_now_...
Django: Applying indexes on abstract models so that children have it
django
0
60
1
72,838,258
72,838,258
2
true
2022-07-02T10:00:47.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django: Applying indexes on abstract models so that children have it<p>Can we apply indexes on abstract models so that all children inherit it?</p> <p>I have...
72,770,786
NOT LIKE '%%' query on JSON data returns incorrect results<p>I have this query:</p> <pre><code>select * from t where JsonColumn like '%A%' and JsonColumn not like '%&quot;A&quot;: null%' </code></pre> <p>I can see that <code>JsonColumn</code> of several rows contains the value present in <code>not like</code>...
<p>I would use <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16" rel="nofollow noreferrer"><code>OPENJSON</code></a> to handle JSON data:</p> <pre><code>select * from t where exists ( select * from openjson(jsoncolumn) where [key] = 'A' and value is n...
NOT LIKE '%%' query on JSON data returns incorrect results
sql|json|azure-data-studio
1
60
2
72,771,802
72,771,802
2
true
2022-06-27T10:43:06.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NOT LIKE '%%' query on JSON data returns incorrect results<p>I have this query:</p> <pre><code>select * from t where JsonColumn like '%A%' and Json...
72,964,779
Use reflection to get entries from a list<p>I have a LinkedList of Strings</p> <pre><code>List&lt;String&gt; list = new LinkedList(); list.add(&quot;&quot;); </code></pre> <p>Using <strong>Reflection</strong>, how would I be able to get the <strong>Field</strong> object of list.get(0) and then set the field object with...
<h2>Annotations:</h2> <ol> <li>This is dangerous, because reflection is heavily implementation dependent.</li> <li>This does not make much sense as a real-world solution. Java's big advantage is static compile-time checks, and this completely circumvents it. (Checks on container classes and variable types)</li> <li>Als...
Use reflection to get entries from a list
java|reflection
-2
60
1
72,965,236
72,965,236
2
true
2022-07-13T10:30:25.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use reflection to get entries from a list<p>I have a LinkedList of Strings</p> <pre><code>List&lt;String&gt; list = new LinkedList(); list.add(&quot;&quot;);...
72,903,859
How to make a button show the appropriate message in Django?<p>I am trying to create asocial media type site that allows users to follow other users through a Django model. For some reason, the Follow Button says &quot;Unfollow&quot; when a user is not following the user and says &quot;Follow&quot; when the user is fol...
<p>You can do it so much simplier without <code>Follower</code> model:</p> <p>models.py</p> <pre><code>class User(AbstractUser): following = models.ManyToManyField(&quot;self&quot;, related_name=&quot;followers&quot;) def count_followers(self): return self.followers.all().count() </code></pre> <p>templ...
How to make a button show the appropriate message in Django?
django|button|django-templates
0
60
3
72,904,592
72,904,592
2
true
2022-07-07T20:27:10.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a button show the appropriate message in Django?<p>I am trying to create asocial media type site that allows users to follow other users through ...
72,793,333
@Value not Injecting ANY value<p>I'm learning how to create a RESTful API with Springboot, and the @Value tag is not injecting values from application.properties, nor is it injecting values specified in the tag itself. I have my project structured as such:</p> <ul> <li>api <ul> <li>config</li> <li>controllers</li> <li>...
<pre><code>@Autowired private final static MyService myService = new MyService(); </code></pre> <p>Three issues:</p> <p>First, you cannot have a <code>new</code> operator. Spring controls the lifecycle of your class instances. It will call <code>new</code> for you in the background. Remove the entire new operator stanz...
@Value not Injecting ANY value
java|spring-mvc|variables|spring-annotations
1
60
1
72,806,735
72,806,735
3
true
2022-06-28T21:27:33.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: @Value not Injecting ANY value<p>I'm learning how to create a RESTful API with Springboot, and the @Value tag is not injecting values from application.proper...
72,810,685
Flutter await does not await until return of function<p>I tried to find an answer but my problem is still there.</p> <p>In my asynchronous upload function I return at the and the generated name of the image, which I want to use to make my database request.</p> <p>This is my upload function:</p> <pre><code>Future&lt;Str...
<pre><code>response.stream.transform(utf8.decoder).listen((value) { createdFileName = value; print(createdFileName); }); </code></pre> <p>This part in your function is asynchronous, it uses a callback.</p> <p>But you don't wait for it to finish in any form. You just continue to return the createdFileName, that by t...
Flutter await does not await until return of function
flutter|dart|asynchronous|async-await|future
1
60
3
72,810,860
72,810,860
3
true
2022-06-30T05:28:54.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter await does not await until return of function<p>I tried to find an answer but my problem is still there.</p> <p>In my asynchronous upload function I ...
72,822,972
Overlapping delegated DNS zones with possible conflict<p>I currently experience a weird behavior regarding one of my DNS delegated zone where A records inside keep having <code>NXDOMAIN</code> statuses randomly (or after a while).</p> <p>My configuration consist of 2 delegated secondary zones in GCP from a primary zone...
<p>Your Route53 configuration for <code>dev.sub.domain.com</code> is wrong. Since you have delegated name servers for <code>sub.domain.com</code>, you cannot have another entry for <code>dev.sub.domain.com</code>. The lookup for <code>dev.sub.domain.com</code> will happen at <code>sub.domain.com</code>. The inconsiste...
Overlapping delegated DNS zones with possible conflict
amazon-web-services|google-cloud-platform|dns|overlap
0
60
1
72,823,074
72,823,074
3
true
2022-06-30T23:24:12.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overlapping delegated DNS zones with possible conflict<p>I currently experience a weird behavior regarding one of my DNS delegated zone where A records insid...
72,824,256
OpenMP: Assign threads one iteration at a time<p>Say you have a loop containing a varying number of iterations and 4 cores</p> <p>I understand that</p> <p><code>#pragma omp parallel for</code></p> <p>will basically divide the iterations in like this with chunks of size/4 length</p> <p><code>| T1 | T2 | ...
<p>What you are describing -- assuming that your heuristic is size/total threads -- is a round-robin scheduling (<em>i.e.,</em> static scheduling) with chunk_size = 1. For that you simply need :</p> <pre><code>#pragma omp parallel for schedule(static,1) </code></pre> <p>In this case, it makes no difference if the numbe...
OpenMP: Assign threads one iteration at a time
c++|multithreading|parallel-processing|openmp
3
60
1
72,824,494
72,824,494
3
true
2022-07-01T04:03:51.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenMP: Assign threads one iteration at a time<p>Say you have a loop containing a varying number of iterations and 4 cores</p> <p>I understand that</p> <p><c...
72,847,638
ggplot dodged bar chart: arrange bars by y-value per group<p>I need to plot a bar chart in R where the order of the bars is exactly like in the data_frame below, i.e. I need group 1 on the left, 2 in the middle and 3 on the right. But: I also need the bars to be arranged descending by score within the three groups and ...
<p>One option would be to use a helper column made of the interaction of <code>group</code> and <code>country</code>. To this end I first order by <code>group</code> and <code>score</code> and use <code>forcats::fct_inorder</code> to set the order of the levels of the helper column and map it on the <code>group</code> ...
ggplot dodged bar chart: arrange bars by y-value per group
r|sorting|ggplot2|geom-bar
3
60
2
72,848,268
72,848,268
3
true
2022-07-03T15:15:15.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ggplot dodged bar chart: arrange bars by y-value per group<p>I need to plot a bar chart in R where the order of the bars is exactly like in the data_frame be...
72,879,167
Get vector of column names depending on logicals of same dataframe<p>I have a named dataframe containig logicals with missings and I want to get a vector with the column names where values are <code>TRUE</code> (going down the rows and, if multiple <code>TRUE</code>s in one row, going from left to right). Here an examp...
<p>You can do in <code>base</code> R:</p> <pre><code>pos &lt;- which(t(df) == TRUE, arr.ind = TRUE) names(df)[pos[, &quot;row&quot;]] [1] &quot;b&quot; &quot;c&quot; &quot;c&quot; &quot;a&quot; &quot;a&quot; </code></pre>
Get vector of column names depending on logicals of same dataframe
r|dataframe|vector|names
3
60
5
72,879,247
72,879,247
3
true
2022-07-06T07:02:22.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get vector of column names depending on logicals of same dataframe<p>I have a named dataframe containig logicals with missings and I want to get a vector wit...
72,890,816
Cpan Install - No Bareword Allowed (windows)<p>I've inherited a project in Perl - an environment I know very little about. Nobody else knows anything about it either and nobody knows how to even get it running natively. So the project is developed by using a cloned VM of the AWS instance, and I'm getting fed up at keep...
<p><code>Docker/cpanfile;</code> divides <code>Docker</code> by <code>cpanfile</code> and discards the result. That's not very useful. That's not very correct. Silencing the error message is not the correct approach.</p> <p>I think you want</p> <pre class="lang-perl prettyprint-override"><code>use FindBin qw( $RealBin ...
Cpan Install - No Bareword Allowed (windows)
perl|cpan|cpanm
1
60
2
72,891,207
72,891,207
3
true
2022-07-06T23:24:56.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cpan Install - No Bareword Allowed (windows)<p>I've inherited a project in Perl - an environment I know very little about. Nobody else knows anything about i...
72,894,519
deparse and substitute on ellipsis to get names of parameters<p>How do I get the names of paramaters used for ellipsis in a function call, independent whether they are packed into a list or not?</p> <p>The following function works pretty fine if the parameters are passed directly into the function.</p> <pre><code>foo &...
<p>As a workaround try this</p> <pre><code>foo &lt;- function(...) { x &lt;- substitute(...()) if(class(x[[1]]) == &quot;call&quot;) sapply(x[[1]][-1] , deparse) else sapply(x , deparse) } </code></pre> <ul> <li>Output</li> </ul> <pre><code>&gt; foo(list(a, b)) [1] &quot;a&quot; &quot;b&quot; &gt; foo(a,...
deparse and substitute on ellipsis to get names of parameters
r|function|ellipsis
3
60
1
72,895,706
72,895,706
3
true
2022-07-07T08:22:51.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: deparse and substitute on ellipsis to get names of parameters<p>How do I get the names of paramaters used for ellipsis in a function call, independent whethe...
72,925,930
Adding filtered row names as labels in geom_point using geom_text (error on length of the dataset)<p>I have a dataset and I want to add specific labels (row names in this case) to my ggplot graph. However, when I use filter, an error regarding length of the data frame shows on the console. I would appreciate if anyone ...
<p>Since you are using <code>df</code> for rownames, then it would still return all rownames. So, you need to also add you filter statement inside of <code>rownames()</code> (i.e., <code>aes(label = rownames(df %&gt;% filter(x &gt; 10)))</code>).</p> <pre><code>library(tidyverse) df %&gt;% ggplot(aes(x = x, y = y)) ...
Adding filtered row names as labels in geom_point using geom_text (error on length of the dataset)
r|ggplot2|dplyr|geom-text|geom-point
3
60
2
72,925,974
72,925,974
3
true
2022-07-10T03:19:45.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding filtered row names as labels in geom_point using geom_text (error on length of the dataset)<p>I have a dataset and I want to add specific labels (row ...
72,927,630
how to pass data from a model to the url in django?<p>I have a customized user model like this:</p> <pre><code>class Utilisateur(models.Model): username = models.CharField(max_length=50) email = models.CharField(max_length=50) password = models.CharField(max_length=50) phone = models.CharField(max_lengt...
<p>Read the URL dispatcher documentation of django. It has covered most of the usage patterns.</p> <p><a href="https://docs.djangoproject.com/en/4.0/topics/http/urls/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/4.0/topics/http/urls/</a></p> <p>In your <code>urls.py</code> you have to defined the variab...
how to pass data from a model to the url in django?
python|django
0
60
2
72,927,834
72,927,834
3
true
2022-07-10T09:58:43.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to pass data from a model to the url in django?<p>I have a customized user model like this:</p> <pre><code>class Utilisateur(models.Model): username ...
72,966,287
Where is gacutil.exe? Not where it used to be<p>We have SSIS packages with custom components. Gacutil is required to load the custom components on my new computer.</p> <p>At one time, gacutil could be found here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin</p> <p>According to: <a href="https://stackoverflow.co...
<p>The gacutil.exe utility is included in the .NET Framework SDK. The latest being the .NET 4.8 SDK (aka developer pack) which can be downloaded from here:</p> <p><a href="https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48" rel="nofollow noreferrer">https://dotnet.microsoft.com/en-us/download/dotnet-fra...
Where is gacutil.exe? Not where it used to be
visual-studio|ssis
0
60
1
72,966,612
72,966,612
3
true
2022-07-13T12:27:29.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where is gacutil.exe? Not where it used to be<p>We have SSIS packages with custom components. Gacutil is required to load the custom components on my new co...
72,992,221
How do bash return values of functions<p>I am trying to understand how do bash functions return values. I have created the 4 following functions, and I do not understand how it really works:</p> <pre class="lang-bash prettyprint-override"><code>#test1.sh #!/bin/bash function a() { ls -la } function b() { _b...
<p>So here is a bit of background:</p> <ol> <li>Unlike other programming languages in shell functions return their status codes to the calling shell and that code is stored in the <code>$?</code> system variable.</li> <li><code>return</code> is a command which sends a <strong>numerical</strong> status code to the calli...
How do bash return values of functions
linux|bash|shell|sh
0
60
2
72,994,355
72,994,355
3
true
2022-07-15T09:55:15.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do bash return values of functions<p>I am trying to understand how do bash functions return values. I have created the 4 following functions, and I do no...
72,998,498
How to pass keys to ListViewBuilder?<p>I have a class containing elements</p> <pre><code>MyClass(key: ValueKey(&quot;1&quot;)), </code></pre> <p>I would like to display them on the screen in the amount I need. I tried to do this through ListViewBuilder , but I don't quite understand how I can specify the keys inside th...
<p><code>itemBuilder</code> builds element of list one by one. index is number of element is building right now (beginning from 0).</p> <p>this should work for you</p> <pre><code>ListView.builder( itemCount: 5, itemBuilder: (context, index) { return MyClass(key: ValueKey(index.to...
How to pass keys to ListViewBuilder?
flutter|dart|listview|key
0
60
1
72,998,738
72,998,738
3
true
2022-07-15T18:52:17.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass keys to ListViewBuilder?<p>I have a class containing elements</p> <pre><code>MyClass(key: ValueKey(&quot;1&quot;)), </code></pre> <p>I would like...
73,011,799
Why is this for loop looping infinitely?<pre><code>let n = 5; for (let a = 1, b = Math.pow(2, a); b &lt;= n; a++) { console.log(b); } </code></pre> <p>I don't understand why <code>b</code> doesn't increase as <code>a</code> increases. Do I have to somehow pass <code>a</code> to <code>b</code> again?</p> <p>If there...
<p>Once <code>b</code> is initialized, your code never changes it, so the loop condition is always true.</p> <p>You could use</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>le...
Why is this for loop looping infinitely?
javascript|for-loop|scope
1
60
4
73,011,837
73,011,837
3
true
2022-07-17T12:32:19.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this for loop looping infinitely?<pre><code>let n = 5; for (let a = 1, b = Math.pow(2, a); b &lt;= n; a++) { console.log(b); } </code></pre> <p>I ...
72,810,015
Python: cumulative sum of column based on unique values<p>I have a DataFrame with columns as follows</p> <pre><code>df: account PnL date 2022-01-01 1 100 2022-01-01 2 30 2022-01-02 1 -5 2022-01-02 2 10 2022-01-03 1 10 2022-01-03 2 5 </code><...
<pre><code>df['cumulative_PnL'] = df.groupby('account')['PnL'].cumsum() </code></pre>
Python: cumulative sum of column based on unique values
python|pandas|dataframe|cumulative-sum
1
60
1
72,810,102
72,810,102
3
true
2022-06-30T03:30:01.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: cumulative sum of column based on unique values<p>I have a DataFrame with columns as follows</p> <pre><code>df: account PnL date 2022-...
73,030,051
How to query multiple lines of DNS TXT data using WinAPI<p>I'm trying to get DNS TXT data:</p> <pre><code>#include &lt;Windows.h&gt; #include &lt;WinDNS.h&gt; #include &lt;winsock.h&gt; #pragma comment(lib, &quot;Ws2_32.lib&quot;) #pragma comment(lib, &quot;Dnsapi.lib&quot;) #include &lt;iostream&gt; #include &lt;strin...
<p><code>DNSQuery</code> can return multiple records, each with multiple strings. You need to enumerate the list of returned records as well as the strings within them.</p> <pre><code> DNS_RECORD* pResult = dnsRecord; while (pResult != nullptr) { if (pResult-&gt;wType == DNS_TYPE_TEXT) { ...
How to query multiple lines of DNS TXT data using WinAPI
c++|winapi|dns
0
60
1
73,030,093
73,030,093
3
true
2022-07-19T01:03:03.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query multiple lines of DNS TXT data using WinAPI<p>I'm trying to get DNS TXT data:</p> <pre><code>#include &lt;Windows.h&gt; #include &lt;WinDNS.h&gt...
72,892,205
Error while finding the running sum of an array in C++ using vectors<p>Why am i getting this error, while finding the running sum of an array in c++?</p> <pre><code>Line 1034: Char 34: runtime error: addition of unsigned offset to 0x6020000000b0 overflowed to 0x6020000000ac (stl_vector.h) SUMMARY: UndefinedBehaviorSani...
<p><code>nums[0]=temp[0]</code> is incorrect, since <code>temp[0]</code> is 0 currently. It should be the other way around.</p> <p>Also, the lower bound for the <code>for</code> loop should be <code>i=1</code>.</p> <pre><code>class Solution { public: vector&lt;int&gt; runningSum(vector&lt;int&gt;&amp; nums) { ...
Error while finding the running sum of an array in C++ using vectors
c++|arrays|algorithm|vector
0
60
1
72,892,217
72,892,217
3
true
2022-07-07T04:14:00.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error while finding the running sum of an array in C++ using vectors<p>Why am i getting this error, while finding the running sum of an array in c++?</p> <pr...
72,908,466
How fill NA by condition?<p>I have sales data by years and models. Here sales of J model in each year is missing. Now I want the following condition:</p> <p>Fill NA of J model with a maximum value of sales in each year + 100. For instance, max sale in 2015 was 984, so J has to be 984+100 in 2015</p> <pre><code>df &lt;-...
<p>You may try(<code>NA</code> is <code>&quot;NA&quot;</code> so it needed to be as <code>numeric</code>)</p> <pre><code>library(dplyr) df %&gt;% group_by(Year) %&gt;% mutate(sales = as.numeric(sales)) %&gt;% mutate(sales = ifelse(is.na(sales) &amp; (model == &quot;J&quot;), max(sales, na.rm = T) + 100, sales)) ...
How fill NA by condition?
r|loops|for-loop|dplyr
1
60
2
72,908,547
72,908,547
3
true
2022-07-08T08:08:36.890Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How fill NA by condition?<p>I have sales data by years and models. Here sales of J model in each year is missing. Now I want the following condition:</p> <p>...
72,793,495
How can I conditionally instantiate a member object to exhibit different behaviors depending on parent object?<p>I'm creating two objects of struct <code>Player</code>, each with a <code>pawn</code> container. I want this member to be defined with a different type depending on the <code>Player</code> object it is in, s...
<p>In your case, you're sure that there are only a given number of possible classes to choose from. This is called discriminated union in type systems and can be represented using a variant:</p> <p>Example code:</p> <pre><code>struct Player { using PawnType = std::variant&lt;Pawn&lt;0&gt;, Pawn&lt;1&gt;&gt;; Pa...
How can I conditionally instantiate a member object to exhibit different behaviors depending on parent object?
c++|oop|templates|template-meta-programming
1
60
1
72,793,567
72,793,567
3
true
2022-06-28T21:47:53.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I conditionally instantiate a member object to exhibit different behaviors depending on parent object?<p>I'm creating two objects of struct <code>Pla...
72,884,632
Runtime error '91' referencing a range to generate Outlook emails<p>I would like to generate four Outlook emails.</p> <p>I got this error:</p> <blockquote> <p>runtime error 91</p> </blockquote> <p>at: <code>rng = &quot;rng&quot; &amp; i</code>.</p> <pre class="lang-vb prettyprint-override"><code>Sub generate4emails() ...
<p>Declare your ranges as array instead of multiple variables so you can loop through that array:</p> <pre><code>Sub generate4emails() Dim OutApp As Object, OutMail As Object Dim i As Long Dim rng(1 To 4) As Range Set rng(1) = ThisWorkbook.Sheets(&quot;Sheet1&quot;).Range(&quot;C12:F14&quot;) S...
Runtime error '91' referencing a range to generate Outlook emails
excel|vba
2
60
2
72,884,847
72,884,847
3
true
2022-07-06T13:42:27.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Runtime error '91' referencing a range to generate Outlook emails<p>I would like to generate four Outlook emails.</p> <p>I got this error:</p> <blockquote> <...
72,845,042
Use string.format to convert a string value to a long number and meet a strange issue<p>Lua version is 5.1.4, here is the details:</p> <blockquote> <p>Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio</p> </blockquote> <pre><code>print(string.format(&quot;where id = %d&quot;, &quot;1596856742980208710&quot;)) </code>...
<p><strong>This is a Lua &quot;feature&quot; called <a href="https://www.lua.org/manual/5.1/manual.html#2.2.1" rel="nofollow noreferrer">coercion</a>: Lua will coerce strings to numbers if a number is expected and vice versa. Lua 5.1 by default uses doubles as only number type, which may lead to a loss of precision whe...
Use string.format to convert a string value to a long number and meet a strange issue
lua
3
60
1
72,845,581
72,845,581
3
true
2022-07-03T08:39:14.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use string.format to convert a string value to a long number and meet a strange issue<p>Lua version is 5.1.4, here is the details:</p> <blockquote> <p>Lua 5....
72,913,282
Python nested loops with if statements: Replacing values inside a range<p><strong>Question</strong></p> <p>Given a range from 0 to 30, output all the integers inside the range with the following requirements:</p> <p>I. Replace all the numbers that aren't divisible by 3 with <strong>Asterisk symbol(*)</strong>;</p> <p>I...
<p><a href="https://stackoverflow.com/questions/20002503/why-does-a-x-or-y-or-z-always-evaluate-to-true">You can't use <code>i not in range1 or range2</code></a>, I suggest to use set union for efficiency. Also the <code>while</code> loop is useless, a simple test is sufficient.</p> <p><em><strong>NB. trying to keep an...
Python nested loops with if statements: Replacing values inside a range
python|python-3.x|loops|nested-loops
2
60
3
72,913,361
72,913,361
3
true
2022-07-08T14:55:32.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python nested loops with if statements: Replacing values inside a range<p><strong>Question</strong></p> <p>Given a range from 0 to 30, output all the integer...
72,858,554
Isolating elements from a specific column using R<p>I've been experimenting with the TikTok Scraper tool (<a href="https://github.com/drawrowfly/tiktok-scraper/" rel="nofollow noreferrer">https://github.com/drawrowfly/tiktok-scraper/</a>) for a little while and, while I'm not a expert, I've been using R for some of the...
<p><strong>UpdateII</strong> removed previous solutions:</p> <pre><code>library(dplyr) library(tidyr) df %&gt;% mutate(id = row_number()) %&gt;% separate_rows(hashtags, sep = '\&quot;,\&quot;name\&quot;:\&quot;') %&gt;% separate_rows(hashtags, sep = '\&quot;,\&quot;title\&quot;') %&gt;% filter(str_detect(h...
Isolating elements from a specific column using R
r|dataframe|dplyr
1
60
1
72,858,879
72,858,879
3
true
2022-07-04T14:47:41.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Isolating elements from a specific column using R<p>I've been experimenting with the TikTok Scraper tool (<a href="https://github.com/drawrowfly/tiktok-scrap...
72,931,761
A different shape for points in a line chart<p>How to make a simple line graph where each line will have additional points of different shapes (geom_point). These points should be of the same color as the lines.</p> <pre><code>my_data &lt;- data.frame( TIME = c(&quot;T1-3&quot;,&quot;T3-5&quot;,&quot;T6-8&quot;,&quot...
<p>We could use <code>guide_legend(override.aes = ...</code> and set shape guide to none:</p> <p>To get filled shapes just change shape 0 and 1:</p> <p><a href="https://i.stack.imgur.com/eb1s4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eb1s4.png" alt="enter image description here" /></a></p> <p>...
A different shape for points in a line chart
r
1
60
2
72,932,221
72,932,221
3
true
2022-07-10T20:43:04.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A different shape for points in a line chart<p>How to make a simple line graph where each line will have additional points of different shapes (geom_point). ...
72,779,267
Segmentation fault when calling printf from C function called from assembly<p>I tried to implement the quicksort in x86-64 Assembler, on Linux. Since I'm not fully comfortable with it yet, I wrote the partition algorithm in C. It seems to work but something must be off, because adding a call to <code>fprintf</code> in ...
<p>You're not maintaining stack alignment. The ABI says that <code>%rsp</code> must always be a multiple of 16 right before a <code>call</code> instruction. <code>call</code> itself pushes one 8-byte quantity (the return address), so the stack pointer is always congruent to 8 (mod 16) at function entry, and it's your r...
Segmentation fault when calling printf from C function called from assembly
c|assembly|segmentation-fault|x86-64|quicksort
2
60
2
72,779,360
72,779,360
4
true
2022-06-27T23:30:01.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Segmentation fault when calling printf from C function called from assembly<p>I tried to implement the quicksort in x86-64 Assembler, on Linux. Since I'm not...
72,882,499
Typescript does not recognize callback's param type<p>I have the following function and its callback type:</p> <pre><code>type Callbacks = { onSuccess: (a: string) =&gt; void; }; function t(event: string, ...args: [...any, Callbacks]) { } </code></pre> <p>It works as expected but one thing, <code>onSuccess</code>...
<p>This is currently a missing feature in TypeScript. A function whose parameter list has <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#leadingmiddle-rest-elements-in-tuple-types" rel="nofollow noreferrer">leading or middle rest elements</a> does not seem to benefit from <a hr...
Typescript does not recognize callback's param type
typescript
5
60
1
72,889,893
72,889,893
4
true
2022-07-06T11:06:48.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript does not recognize callback's param type<p>I have the following function and its callback type:</p> <pre><code>type Callbacks = { onSuccess: (...
72,892,864
How to print out the row names instead of their indices?<p>I have a matrix m and made some calculation on it, as the result I obtained a matrix ind. In the code below ind is the constant matrix.</p> <pre><code>k=10; n = 8 m &lt;- matrix(c(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, ...
<p>You can use subsetting as follow:</p> <pre><code>rn = ind rn[] &lt;- rownames(m)[ind] [,1] [,2] [1,] &quot;A&quot; &quot;A&quot; [2,] &quot;B&quot; &quot;B&quot; [3,] &quot;C&quot; &quot;F&quot; [4,] &quot;D&quot; &quot;G&quot; [5,] &quot;E&quot; &quot;H&quot; </code></pre>
How to print out the row names instead of their indices?
r|matrix
2
60
3
72,893,165
72,893,165
4
true
2022-07-07T05:53:48.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print out the row names instead of their indices?<p>I have a matrix m and made some calculation on it, as the result I obtained a matrix ind. In the c...
72,891,421
How to print output in Visual Studio Test Explorer from F# and xUnit on success?<p>I am testing a client application that is requesting data from a database across the network. I have studied similar questions on SO, but they seem to apply several years ago before the really good nuget packages of Hedgehog and Swensen....
<p>XUnit supports writing of additional output from the tests. I agree, additional output can be useful to diagnose potential failures, data conditions (for integration tests) and can provide some additional instrumentation in the CI.</p> <p>Is there a reason why you don't want to create additional class? With such cla...
How to print output in Visual Studio Test Explorer from F# and xUnit on success?
visual-studio|f#|xunit
0
60
1
72,894,223
72,894,223
4
true
2022-07-07T01:37:40.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print output in Visual Studio Test Explorer from F# and xUnit on success?<p>I am testing a client application that is requesting data from a database ...
72,959,214
JavaScript '\n' madness<p>I'm trying to convert a string like <code>'Some\nexample\nstring'</code> into an array like <code>['Some', '\n', 'example', '\n', 'string']</code></p> <p>But it's insane that I have to do this:</p> <pre><code> let words = text.replace('\n', ' \\n ').split(/\s/); words = words.map(it =&g...
<p>Here is a string <code>match</code> approach. We can alternatively match groups of whitespace or non whitespace characters.</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>...
JavaScript '\n' madness
javascript|arrays|string|replace|newline
1
60
2
72,959,235
72,959,235
4
true
2022-07-12T23:02:49.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript '\n' madness<p>I'm trying to convert a string like <code>'Some\nexample\nstring'</code> into an array like <code>['Some', '\n', 'example', '\n', '...
72,980,771
Finding element with slash in the ID using Playwright<p>I have an element in my page with a slash (/) character in his id:</p> <p>id=A/BC</p> <p>When I try to find these element using Playwright it fails:</p> <pre><code>element_info = '#A/BC' self.page.locator(self.element_info).click() </code></pre> <p>I got this erro...
<p>You can select it by attribute:</p> <pre><code>self.page.locator('[id=\'#A/BC\']').click() </code></pre>
Finding element with slash in the ID using Playwright
python|playwright|webautomation|playwright-python
0
60
1
72,981,066
72,981,066
4
true
2022-07-14T12:47:09.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding element with slash in the ID using Playwright<p>I have an element in my page with a slash (/) character in his id:</p> <p>id=A/BC</p> <p>When I try t...
72,869,301
Regex remove whole block whoch contain this words<pre><code>myzol+\s+(.*)-[0-9]+\s\{[\mrzulf\](.*?)\} </code></pre> <pre><code>The lines here is me you are there my fav gvt hjk hlkjhf c myzol 123gbhj { test check myself/mrzulf/.com } myzol 123gbhj { test check myself/mrzulf/.com } myzol 1f...
<p>There is no <code>-</code> in the example strings, and not all the examples end on a digit before the curly like in this part of the pattern <code>[0-9]+\s\{</code></p> <p>You can match:</p> <pre><code>\bmyzol\s+[^{]*{[^{}]*\bmrzulf\b[^{}]*} </code></pre> <p>And replace with an empty string.</p> <p><a href="https://...
Regex remove whole block whoch contain this words
php|regex|preg-replace|preg-match
0
60
1
72,869,382
72,869,382
4
true
2022-07-05T12:17:42.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex remove whole block whoch contain this words<pre><code>myzol+\s+(.*)-[0-9]+\s\{[\mrzulf\](.*?)\} </code></pre> <pre><code>The lines here is me you are t...
72,967,527
Reflection and Nullable<T><p>Whenever I call PropertyInfo.GetValue on a Nullable property, I obtain the nullable struct's actual value, not the struct itself. Why is it? Is it baked into the language and only available to the Nullable type or custom classes can have the same thing with other types.</p>
<p>It's because <code>PropertyInfo.GetValue</code>'s return type is <code>object</code>, which means that all value types are <em>boxed</em>.</p> <p>Now, <a href="https://stackoverflow.com/a/3775643/87698">nullable types are boxed differently than other types</a>:</p> <ul> <li>a nullable value with <code>HasValue == fa...
Reflection and Nullable<T>
c#
2
60
1
72,967,621
72,967,621
4
true
2022-07-13T13:54:57.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reflection and Nullable<T><p>Whenever I call PropertyInfo.GetValue on a Nullable property, I obtain the nullable struct's actual value, not the struct itself...
72,863,712
Convert unicode array to string in bash<p>I have an array of unicode points that i want to be able to convert back into characters and store it inside a variable as a string. In the example below it's just the &quot;Hello World!&quot; code point array but I could have any unicode number (up to 16 bits).</p> <pre class=...
<p>The thing that's messing you up is that your array is full of the <em>decimal</em> numbers of the codepoints, but the <code>\U</code> notation takes <em>hexidecimal</em> numbers. So for example, the first element in the array is &quot;72&quot; -- in decimal, that's the code for &quot;H&quot;, but in hex it's equival...
Convert unicode array to string in bash
arrays|string|bash|unicode
0
60
3
72,863,913
72,863,913
4
true
2022-07-05T03:30:27.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert unicode array to string in bash<p>I have an array of unicode points that i want to be able to convert back into characters and store it inside a vari...
72,850,429
How to write a `sed` script that replaces the text enclosed between two markers with the contents of another file<p>I'm trying to write a <code>sed</code> script that replaces the text enclosed between two markers with the contents of another file.</p> <p>Say I have the following file with the markers <code>&lt;!-- Sta...
<p>All that you need to do to your code is add <code>//!</code> before the <code>d</code>:</p> <pre><code>cat snippet | sed -e '/&lt;\!-- Start --&gt;/,/&lt;\!-- End --&gt;/ { r /dev/stdin' -e '; //!d }' file </code></pre> <p><code>//</code> is shorthand for &quot;last match&quot; ... so in the case of <code>/START/,/E...
How to write a `sed` script that replaces the text enclosed between two markers with the contents of another file
sed
2
60
3
72,858,701
72,858,701
4
true
2022-07-03T22:56:32.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write a `sed` script that replaces the text enclosed between two markers with the contents of another file<p>I'm trying to write a <code>sed</code> sc...
72,812,520
C++ unordered_map implementation problem previous values in map get forgotten<p>In the below code why map size is always 1, it is not saving previous values of <code>root-&gt;val</code> in the map as I can see in stdout. I was expecting that it should remember all the values put in the map.</p> <pre><code>/** * Defini...
<p>Your code looks like you make an recursive call, to make a depth first search on the tree, but in fact it does not.</p> <p>Because you are not using a normal member function, but the constructor, and a constructor can not be called recursive.</p> <p>The syntax that look like recursion is instead the creation of addi...
C++ unordered_map implementation problem previous values in map get forgotten
c++|algorithm|language-implementation
1
60
1
72,812,655
72,812,655
5
true
2022-06-30T08:23:58.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ unordered_map implementation problem previous values in map get forgotten<p>In the below code why map size is always 1, it is not saving previous values ...
72,963,697
Combine conditions in table expression?<p>I am using the <code>line_index</code> function and would like to search for two values, not only for <code>carrid</code> but also for <code>connid</code>. Is it possible? If so, in what way?</p> <p>Because right now, this works:</p> <pre><code>lv_index = line_index( lt[ carrid...
<p>All fields (conditions) just one after the other inside one bracket:</p> <pre><code>lv_index = line_index( lt[ carrid = 'LH' connid = '2407' ] ). </code></pre>
Combine conditions in table expression?
abap|sap-data-dictionary
2
60
2
72,963,866
72,963,866
5
true
2022-07-13T09:11:49.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine conditions in table expression?<p>I am using the <code>line_index</code> function and would like to search for two values, not only for <code>carrid<...
73,011,787
Bash: replace spaces with new line and prepend with dash<p>I'm trying to replace a space-separated string of categories with the categories on new lines prepended with a dash</p> <p>I've got as far as to replace new lines with a dash</p> <pre><code>categories=&quot;cat1 cat2 cat3 cat4 cat5&quot; mod_categories=&quot;$...
<p>With bash parameter expansion and ANSI-C quoting</p> <pre class="lang-bash prettyprint-override"><code>echo &quot;- ${categories// /$'\n- '}&quot; </code></pre>
Bash: replace spaces with new line and prepend with dash
bash|sed
2
60
3
73,012,169
73,012,169
5
true
2022-07-17T12:31:16.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash: replace spaces with new line and prepend with dash<p>I'm trying to replace a space-separated string of categories with the categories on new lines prep...
72,922,438
How do I determine where a variable/function was imported from?<p>Let's say I open up a large source file and see this:</p> <pre><code>print(x) </code></pre> <p><code>x</code> isn't defined in this file and there are a dozen import statements. How do I determine <em>where</em> <code>x</code> was imported from?</p>
<p>If <code>x</code> is a primitive type (<code>int</code>, <code>float</code>, <code>complex</code>, <code>str</code>, <code>bytes</code>, etc.) you don't really have a good way of checking it. I guess this serves as a good reminder of avoiding things such as <code>from somemodule import *</code>.</p> <p>If <code>x</c...
How do I determine where a variable/function was imported from?
python|python-3.x
0
60
3
72,922,482
72,922,482
5
true
2022-07-09T15:02:39.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I determine where a variable/function was imported from?<p>Let's say I open up a large source file and see this:</p> <pre><code>print(x) </code></pre>...
72,910,589
Sort a nested List on two elements<p>I have a <em>nested list</em>, named <code>outputToStore</code> whose contents are given below:</p> <pre><code>[[Final, 331, M, 22/03/2020 00:00:00], [Initial, 335, M, 22/06/2022 00:00:00], [Exception, 335, M, 22/05/2022 00:00:00], [Final, 335, M, 20/06/2022 00:00:00], [Keep...
<h1>Use the Power of Objects</h1> <p>The way you're representing your data is inconvenient and error-prone.</p> <p>It clearly has to be an <strong>object</strong> having attributes of appropriate types, and not a list of strings. It's misuse of collections</p> <p>Using <code>String</code> as a type for numbers, dates, ...
Sort a nested List on two elements
java|list|sorting|nested-lists|comparator
1
60
3
72,910,898
72,910,898
5
true
2022-07-08T11:15:59.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort a nested List on two elements<p>I have a <em>nested list</em>, named <code>outputToStore</code> whose contents are given below:</p> <pre><code>[[Final, ...
72,793,867
Sum each single element in a list with other individual elements in R?<p>Similar questions have been asked before about summing elements of a list. But my problem is a little different than the other questions.</p> <p>I have a list of vectors. I am trying to sum the 1st element of the 1st vector with each single elemen...
<p>So you aim to compute <code>a[i] + b[j] + c[k]</code>. To match your specific order, we can do</p> <pre><code>## the reason for using rev(l) instead of l is explained below c(Reduce(function (u, v) outer(u, v, &quot;+&quot;), rev(l))) # [1] 19 16 13 10 20 17 14 11 21 18 15 12 </code></pre> <hr /> <p>The difference b...
Sum each single element in a list with other individual elements in R?
r
3
60
2
72,793,912
72,793,912
7
true
2022-06-28T22:37:54.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum each single element in a list with other individual elements in R?<p>Similar questions have been asked before about summing elements of a list. But my pr...
73,011,202
Understanding singleton use for global variable use C#<p>It was suggested to me to use a singleton in my application and I am wondering if this is the correct approach.</p> <p>I have a windows gaming handled tool app I am developing. It consists of two windows. A main window and a quick access menu window. These window...
<blockquote> <ol> <li>Would a singleton with an initialization in both windows serve the same function?</li> </ol> </blockquote> <p>A correctly implemented Singleton is initialized the first time it is accessed in an Application session and retains its value for the duration of the session.</p> <blockquote> <ol start="...
Understanding singleton use for global variable use C#
c#|wpf|singleton
-2
60
1
73,011,429
73,011,429
-1
true
2022-07-17T11:01:12.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding singleton use for global variable use C#<p>It was suggested to me to use a singleton in my application and I am wondering if this is the correc...
72,853,278
I want to set color Red,Green,Yellow base on data received<p><strong>Understanding</strong> lets say i will receive data A. so when A==='High' i want to set color Red and when its 'Normal' i want to set green and when its 'Low' i want to set yellow</p> <p><strong>Date i received</strong></p> <pre><code>{ &quot;expire...
<p>To solve <code>&quot;map is not a function.&quot;</code> error be sure you imported <strong><code>map</code></strong> function from rxjs. It should be like below:</p> <pre><code>import { map } from 'rxjs/operators'; </code></pre> <p>If you have imported map function and still you are getting error. Be sure the array...
I want to set color Red,Green,Yellow base on data received
angular
0
60
1
72,854,958
72,854,958
-1
true
2022-07-04T07:42:47.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to set color Red,Green,Yellow base on data received<p><strong>Understanding</strong> lets say i will receive data A. so when A==='High' i want to set ...
72,769,798
CloudKit subscription not working in production<p>Using a <a href="https://developer.apple.com/documentation/cloudkit/cksubscription" rel="nofollow noreferrer">CKSubscription</a> from CloudKit to listen for updates and changes on the database and receiving silent notifications works fine on <strong>Development</strong>...
<p>Reading more comments on forums folks mention you can only see subscriptions on CloudKit dashboard created by the active account logged on the dashboard, I'm using a Sandbox Account for testing.</p> <p>There is a button on CloudKit Dashboard to help with this: <code>Act As iCloud Account…</code>. But the functionali...
CloudKit subscription not working in production
ios|swift|push-notification|cloudkit|cksubscription
0
61
1
72,769,799
72,769,799
0
true
2022-06-27T09:27:22.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CloudKit subscription not working in production<p>Using a <a href="https://developer.apple.com/documentation/cloudkit/cksubscription" rel="nofollow noreferre...
72,770,660
required attribute in <textarea> doesn't work in chrome. It is a chrome's bug or I missed something?<p>this is a test code :</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-html lang-html prettyprint-override"><code...
<p>The main purpose of <code>required</code> attribute is to run a validation when submitting, which works fine in both browsers.</p> <p><a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1339750&amp;q=required%20textarea%20hover&amp;can=2" rel="nofollow noreferrer">Chrome not showing the tooltip for <code>...
required attribute in <textarea> doesn't work in chrome. It is a chrome's bug or I missed something?
html|google-chrome|attributes|textarea|required
-1
61
1
72,771,655
72,771,655
0
true
2022-06-27T10:34:57.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: required attribute in <textarea> doesn't work in chrome. It is a chrome's bug or I missed something?<p>this is a test code :</p> <p><div class="snippet" data...
72,774,888
Adding new values to a dictionary key with for loop<p>I'm having a hard time understanding why my dictionary is storing only the last values after a for loop to scrap multiple pages on a website with the same structure.</p> <pre><code>pages = ['https://example.com/page1.html', 'https://example.com/page2.html']...
<p>I managed to solve my problem with <code>setdefault</code>. So this is my final code:</p> <pre><code>pages = ['https://example.com/page1.html', 'https://example.com/page2.html'] label_filter = [] label_data = [] for i in pages: url = i r = requests.get(url) soup = BeautifulSoup(r.conten...
Adding new values to a dictionary key with for loop
python
0
61
1
72,778,168
72,778,168
0
true
2022-06-27T15:47:45.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding new values to a dictionary key with for loop<p>I'm having a hard time understanding why my dictionary is storing only the last values after a for loop...
72,778,407
what is the use of git remote set-head<p>What is the use of setting the origin/HEAD using the <code>git remote set-head</code> command, if it is only a local reference? I read somewhere that it is the branch checked out by default when we clone, but how does that work if it's only local?</p>
<p><a href="https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-headem" rel="nofollow noreferrer">Docs</a>:</p> <blockquote> <p>Having a default branch for a remote is not required, but allows the name of the remote to be specified in lieu of a specific branch. For example, if the default branch for ...
what is the use of git remote set-head
git|github
0
61
1
72,779,127
72,779,127
0
true
2022-06-27T21:19:06.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what is the use of git remote set-head<p>What is the use of setting the origin/HEAD using the <code>git remote set-head</code> command, if it is only a local...
72,780,972
How do I post the row id in a custom built ASP.NET Core Razor Pages editable Grid?<p>I have tried several approaches, and as I'm new to Razor Pages in ASP.NET Core I'm blocked. Could anybody help me please? It must be something trivial but I googled quite a lot and I can't find a suitable way. I don't want to use jquer...
<p>IF you want to click each <code>save</code> button to send the Id of that row, You can just follow below simple demo without any jquery or any other javascript library.</p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt; Text 1 &lt;...
How do I post the row id in a custom built ASP.NET Core Razor Pages editable Grid?
c#|asp.net-core|gridview|razor-pages
0
61
1
72,781,150
72,781,150
0
true
2022-06-28T05:05:47.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I post the row id in a custom built ASP.NET Core Razor Pages editable Grid?<p>I have tried several approaches, and as I'm new to Razor Pages in ASP.NE...
72,780,973
Separate string column into number and C/D (credit/debit)<p>I have the below data:</p> <pre class="lang-none prettyprint-override"><code>+-----+--------------------+-----------+ |Sr No| User Id|Transaction| +-----+--------------------+-----------+ |1 |paytm 111002203@p...| 100D| |2 |paytm 111002...
<p>you can use regexp_extract and when otherwise</p> <pre><code>&gt;&gt;&gt; from pyspark.sql.functions import when &gt;&gt;&gt; from pyspark.sql.functions import col &gt;&gt;&gt; df1=df.withColumn(&quot;Transaction_type&quot;,when(col(&quot;Transaction&quot;).contains(&quot;D&quot;),&quot;D&quot;).otherwise(&quot;C&qu...
Separate string column into number and C/D (credit/debit)
dataframe|apache-spark|pyspark|substring
1
61
3
72,783,268
72,783,268
0
true
2022-06-28T05:06:10.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Separate string column into number and C/D (credit/debit)<p>I have the below data:</p> <pre class="lang-none prettyprint-override"><code>+-----+-------------...
72,783,734
Using variable from one method in another method<p>What I am trying to do is use the second method to create a pattern so that in the first method I only have to write the second method name with a parameter, in order to extract different values from a response body by passing the key-name as parameter.</p> <p>The resp...
<p><em>Aside: This is a java specific question, not an object-oriented question.</em></p> <p>The crux of your question is about java scopes. The variable <code>response</code> is defined in the <code>GetActivityById</code> method. That method has a <code>{</code> and a <code>}</code>. That is the scope of the variable....
Using variable from one method in another method
class|oop|variables|methods|local
0
61
1
72,787,283
72,787,283
0
true
2022-06-28T09:13:12.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using variable from one method in another method<p>What I am trying to do is use the second method to create a pattern so that in the first method I only hav...
72,788,194
How fix memory limit problem in laravel migration?<pre><code>\Rpn\Services\Onv\Models\OnvForm\EmissionsStationarySource::select(&quot;onvos_request_emissions_stationary_sources.*&quot;) -&gt;join('onvs', function ($join) { $join-&gt;on('onvs.service_request_id', '=', 'onvos_request_emissions...
<p>If you're asking more about how to fix the memory limit, this is semi-answered <a href="https://stackoverflow.com/a/65819568/2373382">here in this answer</a>. Depending on what OS it's running on, you'll just to adjust the location accordingly.</p> <p>If you're asking what's happening internally, there could be mult...
How fix memory limit problem in laravel migration?
php|laravel|postgresql
-1
61
1
72,788,345
72,788,345
0
true
2022-06-28T14:21:17.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How fix memory limit problem in laravel migration?<pre><code>\Rpn\Services\Onv\Models\OnvForm\EmissionsStationarySource::select(&quot;onvos_request_emissions...
72,780,162
Can't invoke function when changing Date property in DatePicker - Xamarin.Forms<p>I have a date picker in my view:</p> <pre><code>&lt;DatePicker MinimumDate=&quot;{Binding Today}&quot; Date=&quot;{Binding SelectedDate, Mode=TwoWay}&quot;/&gt; </code></pre> <p>And in my viewModel class i have these two properties:</p> <...
<p>Now that you have isolated the problem, a better fix is to change ExecuteFunction so it copes with a bad date. OR don't call ExecuteFunction when the date is bad.</p> <p>Several possible ways to fix:</p> <ol> <li><p>Try-catch inside ExecuteFunction.</p> </li> <li><p>set a breakpoint, find out what value that bad dat...
Can't invoke function when changing Date property in DatePicker - Xamarin.Forms
c#|android|xaml|xamarin.forms
0
61
2
72,793,093
72,793,093
0
true
2022-06-28T02:36:15.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't invoke function when changing Date property in DatePicker - Xamarin.Forms<p>I have a date picker in my view:</p> <pre><code>&lt;DatePicker MinimumDate=...
72,792,593
React not Rendering Imported Component<p>I'm just starting out trying to build a react webpage and having issues getting my first component to render successfully. I've tried many json solutions and am wondering if it's just a syntax error in my code at this point. Any help would be appreciated.</p> <p>index.js</p> <pr...
<p>This was due to having installed dependencies accidently outside of the project folder. Set up a brand new project and installed everything successfully and was able to get it working successfully.</p> <p><a href="https://i.stack.imgur.com/qIfsU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qIfs...
React not Rendering Imported Component
javascript|reactjs
0
61
2
72,793,431
72,793,431
0
true
2022-06-28T20:10:34.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React not Rendering Imported Component<p>I'm just starting out trying to build a react webpage and having issues getting my first component to render success...
72,800,423
Create view in one controller and store data in other controller laravel<p>I'm new to Laravel and I'm trying to store a form. I created the view with the House controller but now I want to store the data in the view with the Booking controller. But when I click the button nothing happens.</p> <p>My question is if it is...
<p>First of all, nothing happens when you click the form submit button because it is currently <code>type=&quot;button&quot;</code> and in order this button to play role of submission button it must be <code>type=&quot;submit&quot;</code>. You can do whatever you want with Laravel. If you want your form to hit another ...
Create view in one controller and store data in other controller laravel
php|laravel|model-view-controller|controller|laravel-9
0
61
1
72,800,786
72,800,786
0
true
2022-06-29T11:12:29.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create view in one controller and store data in other controller laravel<p>I'm new to Laravel and I'm trying to store a form. I created the view with the Hou...
72,787,032
Unknown error sequelize when adding new table column<p>I have the following models.js:</p> <pre><code>const sequelize = require('../db') const {DataTypes} = require('sequelize') const User = sequelize.define('user', { id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true}, email: {type: DataTypes...
<p>Fixed, needed rename 'count', because it is sql keyword</p>
Unknown error sequelize when adding new table column
node.js|express|sequelize.js
0
61
1
72,801,384
72,801,384
0
true
2022-06-28T13:08:17.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unknown error sequelize when adding new table column<p>I have the following models.js:</p> <pre><code>const sequelize = require('../db') const {DataTypes} = ...
72,810,010
How to iterate a coordinate conversion trough several text files<p>I am quite new to python. I need to transform the coordinate system of a set of squares from WGS84 to JDG2000. I could solve how to change the coordinates. However, my problem is the iteration of the operation among thousands of .txt files. The coordina...
<p>Assuming your problem is only <strong>Iterating</strong> over files. You can use os.listdir(), as show in below code. You change end <strong>PRINT</strong> statement with your <strong>np.savetext</strong>, also in below example files are in same directory as of code, if that is not the case please update directory i...
How to iterate a coordinate conversion trough several text files
python|pandas|numpy
-1
61
2
72,811,485
72,811,485
0
true
2022-06-30T03:29:05.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to iterate a coordinate conversion trough several text files<p>I am quite new to python. I need to transform the coordinate system of a set of squares fr...
72,811,477
React useEffect delayed only with file upload<p>My file upload feature involves two components, <code>ViewProjectAttachment</code> to view list of attachments related to the project and <code>AddAttachment</code>, a form for uploading files. My files are stored in server side, <code>public/images</code> folder.</p> <p>...
<p>You all, it was a very silly mistake. I should not have included <code>if(result.length &gt; 0)</code> in my back-end code. So it should have been like this:</p> <pre><code>app.get(&quot;/:projectId/attachment&quot;, function(req, res){ const projectId = req.params.projectId; try{ const findProject...
React useEffect delayed only with file upload
javascript|reactjs|use-effect
1
61
1
72,811,727
72,811,727
0
true
2022-06-30T06:57:42.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React useEffect delayed only with file upload<p>My file upload feature involves two components, <code>ViewProjectAttachment</code> to view list of attachment...
72,813,665
MYSQL REGEXP_REPLACE after numbers<p>I want to replace data after numbers with '' using regex_replace.</p> <p>For example:</p> <p>input --&gt; output<br> <code>MA0244891-D</code> --&gt; <code>MA0244891</code><br> <code>MA0244891</code> --&gt; <code>MA0244891</code><br> <code>MA0244891D</code> --&gt; <code>...
<p>You can remove any non-alphanumeric in the string and any letters at the end of string:</p> <pre><code>REGEXP_REPLACE(rk.mystring, '[^0-9A-Za-z]|[a-zA-Z]+$', '') </code></pre> <p>See the <a href="https://regex101.com/r/3mWRQR/1" rel="nofollow noreferrer">regex demo</a>.</p> <p><em>Details</em>:</p> <ul> <li><code>[^...
MYSQL REGEXP_REPLACE after numbers
mysql|regex|replace
3
61
2
72,813,766
72,813,766
0
true
2022-06-30T09:48:17.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MYSQL REGEXP_REPLACE after numbers<p>I want to replace data after numbers with '' using regex_replace.</p> <p>For example:</p> <p>input --&gt; output<...
72,817,251
Trying to Use Process.Start() to automate executing an exe file<p>I am trying to Use Process.Start() to automate executing an exe file.</p> <p>I will first elaborate how to execute the exe file manually:</p> <p>first, load the exe file by double click it, and after loading, the terminal will show entry info and the las...
<p>It's not clear if StandardInput is ever exiting. Also <code>EnableRaisingEvents = true</code> should be specified. It's not necessary to read the output in order to send input. The code below shows how to provide input using StandardInput. In the code below, the first prompt will be <code>i = 0</code>. If a second p...
Trying to Use Process.Start() to automate executing an exe file
c#
-2
61
1
72,818,271
72,818,271
0
true
2022-06-30T14:07:16.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to Use Process.Start() to automate executing an exe file<p>I am trying to Use Process.Start() to automate executing an exe file.</p> <p>I will first e...
72,811,935
alias argument in hierarchy in system verilog<p>Is there way to make this <code>alias</code> statement work , as <code>iob</code> is bidirectional we cannot use <code>assign</code> statement. out of all the available <code>iob</code> pins only specific pins are connected to ddr memory dq bus. the other way we are doing...
<p>I am not sure which problem you saw. Alias statements only work with 'nets', so declaring <em>iob</em> as just <em>logic</em>, meaning <code>var logic</code> prevents it from being compiled. I did modify your code to make it compilable:</p> <pre><code>parameter NUM_HB = 24; module top( input [63:0] ddr_dq ...
alias argument in hierarchy in system verilog
multidimensional-array|alias|system-verilog
0
61
1
72,821,177
72,821,177
0
true
2022-06-30T07:35:53.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: alias argument in hierarchy in system verilog<p>Is there way to make this <code>alias</code> statement work , as <code>iob</code> is bidirectional we cannot ...
72,784,010
How do I recursively extract the elements of my expression with the chevrotain parser?<p>I write a parser with Chevrotain in Typescript.</p> <p>I have an expression of this form:</p> <p>TERM:MATCH_TERM <strong>AND</strong> TERM:MATCH_TERM <strong>OR</strong> TERM:MATCH_TERM <strong>AND</strong> TERM:MATCH_TERM <strong>...
<p>As I put it in the edit of the question, the solution to have a recursive structure in the result of my parser is to write my rules in the following way in this case:</p> <pre><code> public extractExpressions = this.RULE(RULES.extractExpressions, () =&gt; { this.SUBRULE(this.extractParentExpression); ...
How do I recursively extract the elements of my expression with the chevrotain parser?
typescript|parsing|recursion|token|grammar
0
61
1
72,825,883
72,825,883
0
true
2022-06-28T09:32:48.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I recursively extract the elements of my expression with the chevrotain parser?<p>I write a parser with Chevrotain in Typescript.</p> <p>I have an exp...
72,829,448
How to loop through 3d array with if statement python?<p>I am trying to loop through a array with an if statement.</p> <p>For example:</p> <pre><code>arr = np.arrange(125).reshape(5,5,5) arr[0][1][:3] </code></pre> <p>I am trying to loop through the array and multiply by 0.1, if the values are <code>arr[0][1][:3]</code...
<p>Are you trying to do:</p> <pre><code>out = np.where(np.isin(arr, arr[0][1][:3]), arr*0.1, arr) </code></pre> <p>or:</p> <pre><code>arr = arr.astype(float) arr[np.where(np.isin(arr, arr[0][1][:3]))] *= 0.1 </code></pre> <p>output:</p> <pre><code>array([[[ 0. , 1. , 2. , 3. , 4. ], [ 0.5, 0.6, 0....
How to loop through 3d array with if statement python?
python|arrays|pandas|loops
1
61
1
72,829,638
72,829,638
0
true
2022-07-01T12:43:44.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to loop through 3d array with if statement python?<p>I am trying to loop through a array with an if statement.</p> <p>For example:</p> <pre><code>arr = n...
72,810,194
Swift: Selectively prevent auto screen rotation with SpriteKit scenes<p>I have an iOS application that will have a number of SpriteKit scenes. These scenes should remain in the same orientation on the screen in both portrait and landscape. For example one scene will have a dual carriageway road running lengthways on th...
<p>here is a way to allow device rotation at top level, while simulating no rotation at SKScene level. you can receive device rotation events in SwiftUI and then pass that information down to your scene</p> <pre><code>struct GameSceneView: View { @State private var scene = TestScene() var body: some View { ...
Swift: Selectively prevent auto screen rotation with SpriteKit scenes
ios|swift|sprite-kit|device-orientation|screen-rotation
0
61
1
72,830,601
72,830,601
0
true
2022-06-30T04:07:48.550Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift: Selectively prevent auto screen rotation with SpriteKit scenes<p>I have an iOS application that will have a number of SpriteKit scenes. These scenes s...
72,838,722
Why is my SequenceGenerator skipping id values?<p>I have the artistId set in the following code:</p> <pre><code> @Id @SequenceGenerator( name = &quot;artist_sequence&quot;, sequenceName = &quot;artist_sequence&quot;, allocationSize = 1 ) @GeneratedValue( st...
<p>This is pretty much normal behavior.</p> <p>The sole responsibility of the sequence generator is to produce distinct integer values, nothing more.</p>
Why is my SequenceGenerator skipping id values?
java|mysql|spring|spring-boot|spring-data
0
61
3
72,838,885
72,838,885
0
true
2022-07-02T11:34:27.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my SequenceGenerator skipping id values?<p>I have the artistId set in the following code:</p> <pre><code> @Id @SequenceGenerator( n...
72,840,807
Retrieve JSON from sql<p>My json format in one of the sql columns &quot;jsoncol&quot; in the table &quot;jsontable&quot; is like below. Kindly help me to get this data using <strong>JSON_QUERY</strong> or <strong>JSON_VALUE</strong></p> <p>Please pay attention to the brackets and double quotes in the key value pairs......
<p>You can use:</p> <pre class="lang-sql prettyprint-override"><code>SELECT j.name FROM table_name t CROSS APPLY JSON_TABLE( t.value, '$.Company[*]' COLUMNS( name VARCHAR2(200) PATH '$.Name' ) ) j </code></pre> <p>Which, for the sample data:</p> <pre class=...
Retrieve JSON from sql
json|oracle
0
61
2
72,841,546
72,841,546
0
true
2022-07-02T16:45:44.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve JSON from sql<p>My json format in one of the sql columns &quot;jsoncol&quot; in the table &quot;jsontable&quot; is like below. Kindly help me to get...
72,844,185
Upgrading python and its packages to a newer version for my project<p>For some context, my project uses python version 3.8 and has some packages in a requirements.txt file. I'm trying to upgrade the python version to 3.10 and also all the packages in my requirements.txt file to the latest possible version such that the...
<p>It is a bit hard to say what will work best for you since you've given no info on your OS, and that thing you need is done differently on macOS and Windows.</p> <p>If you're on macOS (this one could also work for Linux I guess), the best way to manage <code>python</code> versions is with <code>pyenv</code> and to up...
Upgrading python and its packages to a newer version for my project
python|requirements.txt
1
61
5
72,844,682
72,844,682
0
true
2022-07-03T05:49:47.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Upgrading python and its packages to a newer version for my project<p>For some context, my project uses python version 3.8 and has some packages in a require...
72,845,361
Check if Compiler supports optional C feature in the source<p>I have a simple program (a VERY simplistic malloc/free implementation, originally written for a university assignment), which has to check the &quot;validity&quot; of the pointers in the free, for which I need to dereference it. To avoid Segfaults when a use...
<blockquote> <p>I would be willing to just leave it out when compiling with a compiler that doesn't support uintptr_t with some kind of preprocessor magic.</p> </blockquote> <p>As pointed out by <a href="https://stackoverflow.com/users/775806/n-1-8e9-wheres-my-share-m"> n. 1.8e9-where's-my-share m</a>, you can use <cod...
Check if Compiler supports optional C feature in the source
c|gcc|clang|c11
0
61
2
72,845,534
72,845,534
0
true
2022-07-03T09:25:27.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if Compiler supports optional C feature in the source<p>I have a simple program (a VERY simplistic malloc/free implementation, originally written for a...
72,850,133
Get largest int from object inside of array that's under a limit<p>I'm currently building a Discord.js bot were I wanna give role rewards depending on what level you reach.</p> <p>This is my main part of the code to figure out what role to give, which works perfectly when your role rewards only have a 1 level differenc...
<p>After some tinkering with the edited part of my post I've finally managed to do it!</p> <pre><code>let prevLvl = levelUpRoles.filter(object =&gt; object.level &lt;= memberData.level).sort(function (a, b) {return a.level - b.level}).slice(0,-1).slice(-1); let newLvl = levelUpRoles.find(object =&gt...
Get largest int from object inside of array that's under a limit
javascript|arrays|object|discord.js
-1
61
2
72,857,846
72,857,846
0
true
2022-07-03T21:46:04.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get largest int from object inside of array that's under a limit<p>I'm currently building a Discord.js bot were I wanna give role rewards depending on what l...
72,856,691
modeling database; user, marker, category, fields<p>I'm currently working on a mobile application.</p> <p>The principle is simple, a user can add a marker on a map. The marker belongs to a category and each category has different fields.</p> <p>Example : A user adds a marker on the map, chooses the category (point of i...
<p>If Hunters, POIs, and Obstacles are never reused, it seems quite wasteful to have separate tables.</p> <pre><code>markers (id, name, latitude, longitude, type, description, title -- optional, radius -- only for type='Hunter' ) </code></pre> <p>Yes, I still have two NULLable columns. But th...
modeling database; user, marker, category, fields
mysql|sql|database|database-design
-2
61
2
72,858,442
72,858,442
0
true
2022-07-04T12:22:06.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: modeling database; user, marker, category, fields<p>I'm currently working on a mobile application.</p> <p>The principle is simple, a user can add a marker on...
72,845,512
Room livedata : crash on launch<p>Recently I've decided to start using <code>LiveData</code> in my Room database by adding it to ado methods and then observing them in <code>ViewModel</code>, then even though I updated DB version after making all the changes and made a migration, it throws this error on emulator launch...
<p>As per my comment, I suspect that the issue is within the callback (DatabaseCallback) and probably in the overidden <code>onOpen</code> method.</p> <p>The reasoning is that the trace shows:-</p> <ul> <li>that you have issued a query as per <code>at androidx.room.RoomDatabase.query(RoomDatabase.java:526)</code></li> ...
Room livedata : crash on launch
android|kotlin|android-room|android-livedata
3
61
1
72,862,340
72,862,340
0
true
2022-07-03T09:52:41.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Room livedata : crash on launch<p>Recently I've decided to start using <code>LiveData</code> in my Room database by adding it to ado methods and then observi...
72,863,562
Why is "onclick" only working once and fails to update?<p>I am trying to understand why this onclick button is only working once. Basically I am testing to see if the &quot;heart&quot; or &quot;wishlist&quot; button is clicked on. When clicked, console.log the name of the product so I can confirm it. But it only picks ...
<p>I seem to have found my problem. The issue was with one of my products having quotations inside of it for some reason but once removed the onclick worked multiple times while sending the product name to a function to keep track.</p> <p>The problem with the answers given was also that I didnt want to display the name...
Why is "onclick" only working once and fails to update?
javascript
0
61
3
72,871,243
72,871,243
0
true
2022-07-05T02:58:07.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is "onclick" only working once and fails to update?<p>I am trying to understand why this onclick button is only working once. Basically I am testing to s...