question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,848,224
Iot.Device.MotorHat and Raspberry Pi4<p>I have A problem using Iot.Device.MotorHat on Raspberry Pi 4 with Debian-bullseye 11. I am trying run a DcMotor from the raspberry through motor hat pca9685 . My code is:</p> <pre><code>public class DCMotorController : BaseClass { public void StartMotor() { ...
<p>It appears the library behaves incorrectly when the current MotorHat configuration is not within the values it would set itself at startup. And the MotorHat binding has no way of correcting this. The following workaround might help (until the behavior is fixed):</p> <pre class="lang-cs prettyprint-override"><code> p...
Iot.Device.MotorHat and Raspberry Pi4
c#|raspberry-pi|iot|i2c|raspberry-pi4
0
74
1
72,923,954
72,923,954
2
true
2022-07-03T16:34:10.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iot.Device.MotorHat and Raspberry Pi4<p>I have A problem using Iot.Device.MotorHat on Raspberry Pi 4 with Debian-bullseye 11. I am trying run a DcMotor from ...
72,954,093
Find max value in multiple columns and add column name<p>I would like to find the max value in each row for a data frame and add it in a new column. I have tried this code:</p> <pre><code>#create data frame df &lt;- data.frame(player=c('A', 'B', 'C', 'D', 'E', 'F', 'G'), points=c(28, 17, 3, 14, 3, 26, ...
<pre><code>library(tidyverse) df &lt;- data.frame(player=c('A', 'B', 'C', 'D', 'E', 'F', 'G'), points=c(28, 17, 3, 14, 3, 26, 5), rebounds=c(5, 6, 4, 7, 14, 12, 9), assists=c(10, 13, 7, 8, 4, 5, 8)) df %&gt;% pivot_longer(-player, names_to = &quo...
Find max value in multiple columns and add column name
r
0
74
1
72,954,192
72,954,192
2
true
2022-07-12T14:36:51.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find max value in multiple columns and add column name<p>I would like to find the max value in each row for a data frame and add it in a new column. I have t...
72,886,724
SQL - Get per column count of differences when comparing two tables<p>I have 2 similar tables as shown below with minor difference between some cells</p> <h3>Table A</h3> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Roll_ID</th> <th style="text-align: center;">First...
<p>First you have to join the tables</p> <pre><code> SELECT * FROM table1 JOIN table2 on table1.ROLL_ID = table2.ROLL_ID </code></pre> <p>Now just add the counts</p> <pre><code> SELECT SUM(CASE WHEN table1.FirstName &lt;&gt; table2.FirstName THEN 1 ELSE 0 END) as FirstNameDiff, SUM(CASE WHEN tabl...
SQL - Get per column count of differences when comparing two tables
sql|teradata
0
74
2
72,886,853
72,886,853
2
true
2022-07-06T16:05:05.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - Get per column count of differences when comparing two tables<p>I have 2 similar tables as shown below with minor difference between some cells</p> <h3...
73,024,675
how to use awk in bash -c do the ' ' in awk ' ' doesn't break the bash -c ' ' bash?<p>At the begining i have this scipt that put the stdout in a file.txt :</p> <pre><code>find .. -type f -not \( -path '/dev/*' -or -path '/proc/*' -or -path '/sys/devices/*' \) -print0 | xargs -0 bash -c 'paste -d &quot;;&quot; &lt;(md...
<p>In your second command, you used backtick &quot;quotes&quot; for <code>xargs -0 bash -c `...` bash</code>. Those behave like <code>$(...)</code> so the command string was executed before <code>find | xargs</code> even started.<br /> And in that command string, bash replaced <code>$1</code> before <code>awk</code> ev...
how to use awk in bash -c do the ' ' in awk ' ' doesn't break the bash -c ' ' bash?
bash|awk|find|paste|xargs
0
74
1
73,025,264
73,025,264
2
true
2022-07-18T15:15:31.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to use awk in bash -c do the ' ' in awk ' ' doesn't break the bash -c ' ' bash?<p>At the begining i have this scipt that put the stdout in a file.txt :</...
73,013,568
How useState works with eventListener in react<p>In the below sandbox project, I was trying to use a custom hook to attach event listener.</p> <p>In the useEventListener.js file, If I pass the savedHandler.current function directly to the event listener (line no: 21) I do not get the updated state value during state up...
<p>This is the best I can explain:</p> <p>For the context, when you click the <strong>toggle flag</strong> button, only your first <code>useEffect(callback,[handler])</code> runs after EVERY rendering and your second <code>useEffect(callback,[eventName,element])</code> runs ONLY ONCE after the initial rendering.</p> <o...
How useState works with eventListener in react
reactjs|react-hooks|this
3
74
1
73,014,454
73,014,454
2
true
2022-07-17T16:36:09.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How useState works with eventListener in react<p>In the below sandbox project, I was trying to use a custom hook to attach event listener.</p> <p>In the useE...
72,902,740
Why can't I call any hardware methods in SwiftUI<p>I am trying to turn the torch of the iOS device on and off in my Swift app.</p> <p>By looking at the documentation, I can see that <code>lockForConfiguration()</code>, <code>setTorchModeOn(1.0)</code>, and <code>unlockForConfiguration()</code>are what I need to call.</...
<p>You need an <code>AVCaptureDevice</code> instance to call the methods on.</p> <pre class="lang-swift prettyprint-override"><code>import SwiftUI import Combine import AVKit class CaptureSession: ObservableObject { lazy var device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back) } ...
Why can't I call any hardware methods in SwiftUI
ios|swift|light
0
74
1
72,903,134
72,903,134
2
true
2022-07-07T18:37:39.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I call any hardware methods in SwiftUI<p>I am trying to turn the torch of the iOS device on and off in my Swift app.</p> <p>By looking at the docum...
72,770,890
Redshift Result size exceeds LISTAGG limit on svl_statementtext<p>Trying to reconstruct my query history from svl_statementtext using listagg.<br> Getting error :</p> <blockquote> <p>Result size exceeds LISTAGG limit (limit: 65535)</p> </blockquote> <p>However, I cannot see how or where I have exceeded limit.<br></p> ...
<p>The longest string that Redshift can hold is 64K bytes. Listagg() is likely generating a string longer than this. The &quot;text&quot; column in svl_statementtext is 200 characters so if you have more than 319 segments you can overflow this string size.</p> <p>The other issue I see is that your query will combine m...
Redshift Result size exceeds LISTAGG limit on svl_statementtext
amazon-web-services|amazon-redshift|listagg
1
74
1
72,775,653
72,775,653
3
true
2022-06-27T10:51:13.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redshift Result size exceeds LISTAGG limit on svl_statementtext<p>Trying to reconstruct my query history from svl_statementtext using listagg.<br> Getting e...
72,781,839
C++17 alternative to C++20 "requires" keyword<p>C++20 introduced many improvements like <code>requires</code>, <code>concept</code>s, constraints, <code>modules</code> and much more - functionality you really miss in C++17.</p> <p>How can a scenario having conditional constructors be implemented in C++17, that could lo...
<p>Using <a href="https://en.cppreference.com/w/cpp/language/sfinae" rel="nofollow noreferrer"><em>SFINAE</em></a></p> <pre class="lang-cpp prettyprint-override"><code>template &lt;typename, typename = std::void_t&lt;&gt;&gt; struct HasTypeT : std::false_type {}; template &lt;typename T&gt; struct HasTypeT&lt;T, std::...
C++17 alternative to C++20 "requires" keyword
c++17|metaprogramming
1
74
1
72,783,540
72,783,540
3
true
2022-06-28T06:47:41.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++17 alternative to C++20 "requires" keyword<p>C++20 introduced many improvements like <code>requires</code>, <code>concept</code>s, constraints, <code>modu...
72,808,249
What are the differences between my for loop variations in Rust?<p>I am teaching myself Rust by reading through &quot;the book&quot;. When I was working on the first exercise from this link: <a href="https://doc.rust-lang.org/book/ch08-03-hash-maps.html" rel="nofollow noreferrer">https://doc.rust-lang.org/book/ch08-03-...
<p>There are few building blocks here.</p> <p>When you iterate over <code>&amp;Vec</code>, you get back shared references to its contents. That is, iterating over <code>&amp;Vec&lt;i32&gt;</code> will give you elements of type <code>&amp;i32</code>. When you iterate over <code>&amp;mut Vec</code>, you get back mutable ...
What are the differences between my for loop variations in Rust?
for-loop|rust|compiler-errors
2
74
1
72,808,467
72,808,467
3
true
2022-06-29T21:51:58.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are the differences between my for loop variations in Rust?<p>I am teaching myself Rust by reading through &quot;the book&quot;. When I was working on t...
72,879,987
How to add percentage in pie chart of chart js without importing plugins scripts<p>I want to show the percentage distribution in pie chart. My current chart is perfect, except it does not have percentage labels. How to add percentage. my code looks like;</p> <p><div class="snippet" data-lang="js" data-hide="false" data...
<p>You just need to import some <code>&lt;script&gt;</code> from chart js. and then just modify little your code as below;</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>&...
How to add percentage in pie chart of chart js without importing plugins scripts
javascript|html|css|charts
2
74
1
72,882,864
72,882,864
3
true
2022-07-06T08:12:58.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add percentage in pie chart of chart js without importing plugins scripts<p>I want to show the percentage distribution in pie chart. My current chart ...
72,898,426
Get last two rows from a row_number() window function in snowflake<p>Hopefully, someone can help me...</p> <p>I'm trying to get the last two values from a <code>row_number()</code> window function. Let's say my results contain row numbers up to 6, for example. How would it be possible to get the rows where the row numb...
<p>Using <code>QUALIFY</code>:</p> <pre><code>SELECT * FROM tab QUALIFY ROW_NUMBER() OVER(ORDER BY ... DESC) &lt;= 2; </code></pre> <p>This approach could be further extended to get two rows per each partition:</p> <pre><code>SELECT * FROM tab QUALIFY ROW_NUMBER() OVER(PARTITION BY ... ORDER BY ... DESC) &lt;= 2; </co...
Get last two rows from a row_number() window function in snowflake
sql|snowflake-cloud-data-platform|window-functions
0
74
2
72,899,218
72,899,218
3
true
2022-07-07T13:10:19.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get last two rows from a row_number() window function in snowflake<p>Hopefully, someone can help me...</p> <p>I'm trying to get the last two values from a <c...
72,907,254
Sort List According To The Numbers in Each Element<p>I tried to solve a problem few days ago and almost solved with the help of <strong>SO</strong>. Unfortunately stuck into a situation that am unable to sort out. Here's the scenario:</p> <p><strong>Input</strong>:</p> <pre><code>[7, &quot;aaa&quot;, &quot;a&quot;, &qu...
<p>The key here is to check the type of the object. If is a string, use the string's length for the order, otherwise assume it is an <code>int</code> and use the value itself for the order.</p> <p>This will throw an exception if there are something else in the object list, for example an instance of some random class.<...
Sort List According To The Numbers in Each Element
c#|linq
2
74
3
72,907,350
72,907,350
3
true
2022-07-08T06:04:27.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort List According To The Numbers in Each Element<p>I tried to solve a problem few days ago and almost solved with the help of <strong>SO</strong>. Unfortun...
72,970,051
cv2.VideoCapture(0) takes 20seconds<p>Is it normal that cv2.VideoCapture takes 20 seconds?</p> <pre><code>import numpy as np import cv2 as cv cap = cv.VideoCapture(0) #takes long if not cap.isOpened(): print(&quot;Cannot open camera&quot;) exit() while True: # Capture frame-by-frame ret, frame = cap...
<p>Here is the trick</p> <pre class="lang-py prettyprint-override"><code>cap= cv2.VideoCapture(0, cv2.CAP_DSHOW) </code></pre>
cv2.VideoCapture(0) takes 20seconds
python|opencv|ms-media-foundation
1
74
1
72,974,998
72,974,998
3
true
2022-07-13T17:03:22.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cv2.VideoCapture(0) takes 20seconds<p>Is it normal that cv2.VideoCapture takes 20 seconds?</p> <pre><code>import numpy as np import cv2 as cv cap = cv.Video...
73,013,131
How can I groupby on the Year or Weekday of a date column in Polars Rust<p>I am trying to group a dataframe by year of the date column. First, let's create a dataframe:</p> <pre><code>let s0 = Series::new(&quot;date&quot;, &amp;[&quot;2021-01-14&quot;,&quot;2022-04-09&quot;,&quot;2021-06-24&quot;,&quot;2022-12-04&quot;...
<p>We can go to the date namespace for our <code>&quot;date&quot;</code> column by calling <code>col(&quot;date&quot;).dt()</code>.</p> <p>This makes the <code>year()</code> function available. In your case the correct code would be</p> <pre class="lang-rust prettyprint-override"><code>lf.groupby([col(&quot;date&quot;)...
How can I groupby on the Year or Weekday of a date column in Polars Rust
rust|rust-polars
3
74
1
73,013,263
73,013,263
3
true
2022-07-17T15:39:53.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I groupby on the Year or Weekday of a date column in Polars Rust<p>I am trying to group a dataframe by year of the date column. First, let's create a...
72,962,482
Is there a way to cast the vaadin UI class to some class inheriting from it?<p>My problem is that when I call <code>(SsoUI) UI.getCurrent()</code>, where <code>SsoUI</code> inherits from <code>UI</code>, I get a <code>ClassCastException</code> at runtime saying that <code>UI cannot be cast to SsoUI</code>.</p> <p>Just ...
<blockquote> <p>Am I missing something or are there differences between UI in vaadin 7 and UI in vaadin 14 which render this approach unusable?</p> </blockquote> <p>Yes, there is a difference. You're not expected to extend the <code>UI</code> class in Vaadin 10 or later.</p> <p>To <a href="https://github.com/vaadin/flo...
Is there a way to cast the vaadin UI class to some class inheriting from it?
java|user-interface|vaadin
2
74
1
72,966,910
72,966,910
3
true
2022-07-13T07:31:57.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to cast the vaadin UI class to some class inheriting from it?<p>My problem is that when I call <code>(SsoUI) UI.getCurrent()</code>, where <co...
72,879,174
What exactly does it mean that a component unmounts in React? Does it disappear after it's unmounted?<p>let say I have a functional <code>Home</code> component:</p> <pre><code>const Home = () =&gt; { console.log('outside useEffect') useEffect(() =&gt; { console.log('inside useEffect') // cleanup functi...
<p>Normally a component gets <code>unmounted</code> when for example it's rendered conditionally and the conditional become <code>false</code>. <code>DummyComponent</code> below gets <code>unmounted</code> every time <code>state</code> become <code>false</code>. And when a component is <code>unmounted</code>, it's rem...
What exactly does it mean that a component unmounts in React? Does it disappear after it's unmounted?
javascript|reactjs
4
74
2
72,879,415
72,879,415
3
true
2022-07-06T07:02:42.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What exactly does it mean that a component unmounts in React? Does it disappear after it's unmounted?<p>let say I have a functional <code>Home</code> compone...
72,816,481
Why does my palindrome checker doesn't find any result?<pre><code>words = ['Anna', 'Alexey', 'Alla', 'Kazak', 'Dom'] def palindrome(): filtered_2 = list(filter(lambda x: x == x[::-1], words)) print(filtered_2) palindrome() </code></pre> <p>The code should return palindrome words, but it gives me an output lik...
<p>You need to normalize the input before comparisons. Basically you are checking if <code>'A' == 'a'</code> which will fail.</p> <p>Try this example where I normalize to lowercase using <code>str.lower()</code>:</p> <pre><code>words = ['Anna', 'alexey', 'Alla', 'kazak', 'dom'] def palindrome(): filtered_2 = list(...
Why does my palindrome checker doesn't find any result?
python|palindrome
0
74
3
72,816,591
72,816,591
3
true
2022-06-30T13:13:53.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does my palindrome checker doesn't find any result?<pre><code>words = ['Anna', 'Alexey', 'Alla', 'Kazak', 'Dom'] def palindrome(): filtered_2 = list...
72,869,792
How to create a looping counter in javascript?<p>I have two buttons, one increases the counter and one decreases. Each time the counter changes, the component is to change. I have tried to create both functions so I can click either button and loop through each available component (3 components).</p> <p>The expected fu...
<p>you can do something like this</p> <pre><code>export default function App() { let [counter, setCounter] = useState(0); const increase = () =&gt; { setCounter(c =&gt; (c + 1) % 3) }; const decrease = () =&gt; { setCounter(c =&gt; (c - 1 + 3) % 3) }; return ( &lt;div&gt; &lt;button onC...
How to create a looping counter in javascript?
javascript|reactjs
0
74
2
72,870,000
72,870,000
3
true
2022-07-05T12:54:21.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a looping counter in javascript?<p>I have two buttons, one increases the counter and one decreases. Each time the counter changes, the componen...
73,014,481
How to create map of a map as a key in C++ like in Java<p>In java, I can create a Map of a Map as following:</p> <pre><code>Map&lt;Map&lt;String, Integer&gt;, List&lt;String&gt;&gt; m = new HashMap&lt;&gt;(); </code></pre> <p>Can I and if yes, How can I do similar in C++?</p> <p>I tried doing</p> <pre><code> unordere...
<p>In order to be used as a key in an unordered container, the key class must meet two requirements:</p> <ol> <li><p>The key must have an equality operator defined</p> </li> <li><p>The key must have a hash function defined.</p> </li> </ol> <p>Unordered maps, themselves, have a default <code>==</code> overload, which sa...
How to create map of a map as a key in C++ like in Java
java|c++|c++11|c++17|c++14
1
74
1
73,014,548
73,014,548
3
true
2022-07-17T18:48:47.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create map of a map as a key in C++ like in Java<p>In java, I can create a Map of a Map as following:</p> <pre><code>Map&lt;Map&lt;String, Integer&gt;...
72,776,613
Struct property as key and the struct itself as value in HashMaps - Rust<p>The following is a snippet of a more complicated code, the idea is loading a SQL table and setting a hashmap with one of the table struct fields as the key and keeping the structure as the value (implementation details are not important since th...
<p>There are at least two problems here: First, the resulting <code>HashMap&lt;K, V&gt;</code> would be a self-referential struct, as the <code>K</code> borrows <code>V</code>; there are <a href="https://stackoverflow.com/questions/32300132/why-cant-i-store-a-value-and-a-reference-to-that-value-in-the-same-struct">many...
Struct property as key and the struct itself as value in HashMaps - Rust
rust|struct
2
74
1
72,778,152
72,778,152
3
true
2022-06-27T18:07:58.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Struct property as key and the struct itself as value in HashMaps - Rust<p>The following is a snippet of a more complicated code, the idea is loading a SQL t...
72,794,131
Issue while overloading the short-circuit && operator in C#<p>I am overloading the &amp;&amp; and The code meets all the requirements for it.</p> <p>I have two classes:</p> <pre><code>//the class with the Main method Four f1 = new(); Four f2 = new(); Four hh = f1 &amp;&amp; f2; Console.WriteLine(hh.j + &quot; &quot;...
<p>There is no new object created here, <code>hh</code> points to the already created instance referenced by <code>f1</code>.</p> <p>From <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/expressions#11133-user-defined-conditional-logical-operators" rel="nofollow noreferr...
Issue while overloading the short-circuit && operator in C#
c#
1
74
1
72,794,276
72,794,276
3
true
2022-06-28T23:15:02.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue while overloading the short-circuit && operator in C#<p>I am overloading the &amp;&amp; and The code meets all the requirements for it.</p> <p>I have t...
72,852,115
csharp_prefer_simple_using_statement / IDE0063 Not Appearing When Expected<p>I am not seeing the code analysis rule <code>csharp_prefer_simple_using_statement</code> aka &quot;Use simple 'using' statement (IDE0063)&quot; produce output when expected. I added some dummy code to a method in my project, like so:</p> <pre...
<p><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using" rel="nofollow noreferrer"><code>using</code> declaration</a> works based on scope, resource will be disposed at the end of the scope, so the next one:</p> <pre class="lang-cs prettyprint-override"><code>public Stre...
csharp_prefer_simple_using_statement / IDE0063 Not Appearing When Expected
c#|code-analysis|visual-studio-2022|roslyn-code-analysis|c#-10.0
1
74
1
72,853,808
72,853,808
3
true
2022-07-04T05:28:47.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: csharp_prefer_simple_using_statement / IDE0063 Not Appearing When Expected<p>I am not seeing the code analysis rule <code>csharp_prefer_simple_using_statemen...
72,847,109
Windows GDI Differences between Win98 and WinXP (or Later)<p>I have a game (of which I don't have the source code) that runs well on Win98, but on WinXP or later (i.e. WinXP/7/8/10), the text in certain scenarios is missing. BTW: This has nothing to do with language or locale, since I set them to the same values on bot...
<p>Anyway, I finally found out the root cause myself.</p> <p>On Win98, When calling StretchDIBits() with SRCPAINT mode, the [xSrc,ySrc] of a source DIB always treats the lower-left as source origin.</p> <p>However, on WinXP or later, when calling StretchDIBits() with SRCPAINT mode, the [xSrc,ySrc] of the source DIB tre...
Windows GDI Differences between Win98 and WinXP (or Later)
windows|gdi
0
74
2
72,850,449
72,850,449
3
true
2022-07-03T14:02:04.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows GDI Differences between Win98 and WinXP (or Later)<p>I have a game (of which I don't have the source code) that runs well on Win98, but on WinXP or l...
72,905,359
Is it safe to read the value of numpy.empty or jax.numpy.empty?<p>In Flax, we typically initialize a model by passing in a random vector and let the library figure the correct shape for the parameters via shape inference. For example, this is what <a href="https://flax.readthedocs.io/en/latest/notebooks/annotated_mnist...
<p>Because XLA does not provide a mechanism to create uninitialized memory, in JAX <code>jnp.empty</code> is currently (v0.3.14) equivalent to <code>jnp.zeros</code> (see <a href="https://github.com/google/jax/blob/jax-v0.3.14/jax/_src/numpy/lax_numpy.py#L2007-L2009" rel="nofollow noreferrer">https://github.com/google/...
Is it safe to read the value of numpy.empty or jax.numpy.empty?
c|numpy|memory|language-lawyer|jax
4
74
1
72,915,742
72,915,742
3
true
2022-07-07T23:55:42.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it safe to read the value of numpy.empty or jax.numpy.empty?<p>In Flax, we typically initialize a model by passing in a random vector and let the library ...
72,851,622
Why do have to use "use" before custom hook in react?<p>why do we have to use <code>use</code> before custom hook. Is this just a naming convention or there is something that React is doing internally to do something special?</p> <p><a href="https://codesandbox.io/s/headless-feather-n3q5tm?file=/src/App.js" rel="nofoll...
<p>It's just a naming convention.</p> <p>The docs are very slightly misleading though:</p> <blockquote> <p>In other words, it’s just like a normal function.</p> </blockquote> <p>It's <em>like</em> a normal function, but with the extra baggage that, unlike in a normal function, inside a function meant as a custom hook, ...
Why do have to use "use" before custom hook in react?
javascript|reactjs|eslint
2
74
3
72,851,694
72,851,694
4
true
2022-07-04T03:55:38.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do have to use "use" before custom hook in react?<p>why do we have to use <code>use</code> before custom hook. Is this just a naming convention or there ...
73,013,200
ffmpeg with python subprocess Popen<p>I'm trying to record webcam video from python using ffmpeg. The following ffmpeg works properly when run from the cmd</p> <pre><code>ffmpeg -f dshow -rtbufsize 2000M -i video=&quot;HP HD Camera&quot;:audio=&quot;Headset (realme Buds Wireless 2 Neo Hands-Free AG Audio)&quot; -y -vco...
<p>We may add double quotes for letting Python <code>subprocess</code> know the string is one argument, and we have to close FFmpeg gracefully.</p> <p>Adding double quotes:<br /> Replace the following part <code>video=&quot;HP HD Camera&quot;:audio=&quot;Headset (realme Buds Wireless 2 Neo Hands-Free AG Audio)&quot;</c...
ffmpeg with python subprocess Popen
audio|video|ffmpeg|subprocess
2
74
1
73,014,752
73,014,752
4
true
2022-07-17T15:48:51.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ffmpeg with python subprocess Popen<p>I'm trying to record webcam video from python using ffmpeg. The following ffmpeg works properly when run from the cmd</...
73,014,898
numba and slurm submission with multiple nodes<p>I want to make a python script which includes many numba njitted functions with parallel=True to use all the cores I request on a cluster.</p> <p>On the cluster, I can only request the number of cores I want to use, via <code>#SBATCH -n no_of_cores_you_want</code>.</p> <...
<p>A computing cluster is not just a bag of cores. It is far more complex. To begin with, a modern mainstream cluster is basically a set of computing nodes (interconnected with a network). Each node contains one or multiple microprocessors. Each microprocessor has many cores (typically dozens nowadays). Each cores can ...
numba and slurm submission with multiple nodes
python|performance|parallel-processing|numba|slurm
0
74
1
73,015,840
73,015,840
4
true
2022-07-17T19:50:39.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: numba and slurm submission with multiple nodes<p>I want to make a python script which includes many numba njitted functions with parallel=True to use all the...
72,793,631
Getting the startime and endtime of the day in epochmillis for different timezones - java<p>I am trying to get the start time (00:00:00) and the end time (23:59:59) of a day in the PST time zone. I have tried the following code, but for some reason, I am only getting the start and end times in UTC. I have tried changin...
<h1><em>java.time</em></h1> <p>The modern approach uses the <em>java.time</em> classes only.</p> <p>No need to ever use <code>SimpleDateFormat</code>, <code>Date</code>, <code>Calendar</code>, and the other terrible legacy date-time classes. If need be, you can convert to and fro via new conversion methods added to the...
Getting the startime and endtime of the day in epochmillis for different timezones - java
java|datetime|timezone
-1
74
2
72,794,474
72,794,474
4
true
2022-06-28T22:05:47.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the startime and endtime of the day in epochmillis for different timezones - java<p>I am trying to get the start time (00:00:00) and the end time (23...
72,878,015
Why do you use '$" (the dollar sign) while adding multiple conditions in an R code?<p>I was doing a course on R and I came across this line of code:</p> <pre><code>onlineta_city_hotels &lt;- filter(hotel_bookings, (hotel==&quot;City Hotel&quot; &amp; hotel_booki...
<p>Most of the <code>tidyverse</code> (and <code>tidyverse</code> includes <code>dplyr</code>) functions use <strong>Data masking</strong>. To <a href="https://dplyr.tidyverse.org/reference/dplyr_data_masking.html" rel="nofollow noreferrer">quote</a> from package authors-</p> <blockquote> <p>.. provides data masking, ...
Why do you use '$" (the dollar sign) while adding multiple conditions in an R code?
r|dplyr|filter
4
74
1
72,878,190
72,878,190
4
true
2022-07-06T04:37:03.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do you use '$" (the dollar sign) while adding multiple conditions in an R code?<p>I was doing a course on R and I came across this line of code:</p> <pre...
72,772,709
How to add a instance of class into a variable c#?<p>How to add a instance of class into a variable c#?</p> <pre><code>for (int i = 0; i &lt; 8; i++) { var msg = new Param { type = &quot;text&quot;, text = $&quot;{ message[i].VlrParam.Replace(&quot;\n&quot;, &quot;&quot;).Replace(&quot;\r&quot;, &...
<p>Append the object to a list that exists outside of the loop, instead of just to a variable that only exists inside the loop. For example:</p> <pre><code>var msgs = new List&lt;Param&gt;(); for (int i = 0; i &lt; 8; i++) { msgs.Add(new Param { type = &quot;text&quot;, text = $&quot;{ message[i]...
How to add a instance of class into a variable c#?
c#|.net
0
74
3
72,772,748
72,772,748
5
true
2022-06-27T13:12:22.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a instance of class into a variable c#?<p>How to add a instance of class into a variable c#?</p> <pre><code>for (int i = 0; i &lt; 8; i++) { v...
72,928,231
Python compare Dictionary Key on condition<p>I have the following python dictionary which I made sorted in order to find their difference</p> <pre><code>k={0: 2, 1: 1, 3: 2, 4: 1, 5: 1, 6: 1} </code></pre> <p>Now I want to compare dictionary keys in such a way that, if the dictionary key difference is equal to 1, I wan...
<p>If I understand the question correctly:</p> <pre class="lang-py prettyprint-override"><code>k={0: 2, 4: 1, 1: 1, 6: 1, 3: 2, 5: 1} keys = sorted(k.keys()) # [0, 1, 3, 4, 5, 6] result = [] for i in range(1, len(keys)): if keys[i] - keys[i-1] == 1: result.append(k[keys[i]] + k[keys[i-1]]) print(result) ...
Python compare Dictionary Key on condition
python
1
74
1
72,928,479
72,928,479
5
true
2022-07-10T11:43:44.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python compare Dictionary Key on condition<p>I have the following python dictionary which I made sorted in order to find their difference</p> <pre><code>k={0...
72,904,741
Can I make separate definitions of function template members of a class template?<p>Here's a minimal code example to show what I'm attempting that works, but not how I'd like it to:</p> <pre><code>#include &lt;string&gt; #include &lt;type_traits&gt; #include &lt;iostream&gt; struct string_tag { using R=const std::s...
<p>I gave it a thought, read language specs etc. and the following things come to my mind:</p> <ol> <li><p>Class template has to be specialized in order to specialize member function template. Period. This cannot be overcome with concepts, or at least I haven't found a way. I guess you don't want to replicate the code ...
Can I make separate definitions of function template members of a class template?
c++|templates|template-specialization|specialization|function-templates
3
74
1
72,905,097
72,905,097
5
true
2022-07-07T22:08:48.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I make separate definitions of function template members of a class template?<p>Here's a minimal code example to show what I'm attempting that works, but...
72,905,736
Why a CPU can't do FLOPs performance equivalent to it's Ghz in a simple loop?<p>I was wondering why a simple loop such as this one can't hit my CPU clock speed (4,2Ghz):</p> <pre><code>float sum = 0; for (int i = 0; i &lt; 1000000; i+=1) { sum = sum * 1 + 1; } </code></pre> <p>Intuitively I would expect to achi...
<p>It is typical that a current processor can issue one or more floating-point additions in each processor cycle and can issue one or more floating-point multiplications in each cycle. It is also typical that a floating-point addition or multiplication will take four cycles to complete. This means, once you have starte...
Why a CPU can't do FLOPs performance equivalent to it's Ghz in a simple loop?
c|assembly|cpu
3
74
1
72,905,815
72,905,815
6
true
2022-07-08T01:19:07.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why a CPU can't do FLOPs performance equivalent to it's Ghz in a simple loop?<p>I was wondering why a simple loop such as this one can't hit my CPU clock spe...
72,915,330
List comprehension in python with multiple if statements<p>I am trying to build list similar to this</p> <pre><code>Position = [1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8...
<p>No need for even a single if; just use integer division</p> <pre><code>[1+i//7 for i in range (7*15)] </code></pre>
List comprehension in python with multiple if statements
python|list|if-statement|list-comprehension
0
74
3
72,915,366
72,915,366
6
true
2022-07-08T18:03:19.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List comprehension in python with multiple if statements<p>I am trying to build list similar to this</p> <pre><code>Position = [1, 1, 1, 1, 1, 1, 1, 2...
72,989,019
How are the hash values in git not exhausted?<p>The total possible no of unique git commit hash values are - <strong>16^40</strong>, 16 possible hexadecimal digits and 40 total digits in the SHA value.</p> <p>This approximates to ~<strong>10^48</strong> (more than that, but just an approximation).</p> <p>My question is...
<p>Pay attention to what that &quot;48&quot; is counting. That's how many zeroes after the leading &quot;1&quot;.</p> <p>Say there's ten billion people on earth. That's 1e10. Say all ten billion people on earth are using Git and generating ten billion hash codes each, every second, non stop. That's 1e20 hash codes use...
How are the hash values in git not exhausted?
git|github|hash|git-commit|sha
1
74
1
72,989,117
72,989,117
6
true
2022-07-15T04:22:53.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How are the hash values in git not exhausted?<p>The total possible no of unique git commit hash values are - <strong>16^40</strong>, 16 possible hexadecimal ...
72,945,055
Can python date/time/datetime objects have a boolean value of False?<p>I ran into some code recently that was checking datetime objects and figured it could be cleaned up a little:</p> <pre class="lang-py prettyprint-override"><code># original if (datetime1 and (datetime2 is None)): do_things() # slightly cleaner ve...
<p>Unless the class implements a <code>__bool__()</code> or <code>__len__()</code> method that customizes it, all class instances are truthy by default. If <code>__bool__()</code> is defined, it's used. If not, the default <code>object.__bool__()</code> calls <code>__len__()</code>; if it returns non-zero, the object i...
Can python date/time/datetime objects have a boolean value of False?
python|python-datetime|truthiness
2
74
1
72,945,128
72,945,128
7
true
2022-07-11T21:57:55.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can python date/time/datetime objects have a boolean value of False?<p>I ran into some code recently that was checking datetime objects and figured it could ...
72,866,785
Delete Directory which fails because of opend PDF file<p>Hey guys I'm new here,</p> <p><strong>Program explanation:</strong> I'm currently working on a python program that unzips folders which include PDFs to an &quot;temp&quot; folder. It then splits the pages of the PDFs to single page PDFs and sorts them into folder...
<p>Here's a clean code that does the same. Tested on my machine.</p> <pre><code>import os import shutil import time from pathlib import Path from pikepdf import Pdf # assuming team and geo are present in your project dir temp_path = Path(&quot;.&quot;).joinpath(&quot;temp&quot;) geo_path = Path(&quot;.&quot;).joinpat...
Delete Directory which fails because of opend PDF file
python|pdf|shutil|pypdf2
0
74
1
72,873,156
72,873,156
-1
true
2022-07-05T09:09:11.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete Directory which fails because of opend PDF file<p>Hey guys I'm new here,</p> <p><strong>Program explanation:</strong> I'm currently working on a pytho...
72,916,116
Remove fields from a json array in Python<p>Currently I have a function returning json via jsonify.</p> <pre><code>[ { &quot;hostname&quot;: &quot;bla&quot;, &quot;ipaddress&quot;: &quot;192.168.1.10&quot;, &quot;subnetmask&quot;: &quot;255.255.255.0&quot;, &quot;iloip&quot;: &quot;192.168.1.11&quot; ...
<p>If I understand you correctly:</p> <pre class="lang-py prettyprint-override"><code>import json response = [ { &quot;hostname&quot;: &quot;bla&quot;, &quot;ipaddress&quot;: &quot;192.168.1.10&quot;, &quot;subnetmask&quot;: &quot;255.255.255.0&quot;, &quot;iloip&quot;: &quot;192.1...
Remove fields from a json array in Python
python|json
-2
74
3
72,916,156
72,916,156
-1
true
2022-07-08T19:22:24.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove fields from a json array in Python<p>Currently I have a function returning json via jsonify.</p> <pre><code>[ { &quot;hostname&quot;: &quot;bla&...
72,780,907
Image uploaded but database not updated (Update data with image in Laravel 8)<p>I have make feature to update profile. The table is User HasOne DetailUser so every single user have 1 detail user. Everything works fine, except the photo update. When i was trying to update the photo, photo was succesfully update into sto...
<p>You are not storing image value on database, update this:</p> <pre><code>if (isset($data_detail_user['photo'])) { $data_detail_user['photo'] = $request_detail_user-&gt;file('photo')-&gt;store( 'assets/photo', 'public' ); $detail_user-&gt;photo = $data_detail_user['photo']; //or som...
Image uploaded but database not updated (Update data with image in Laravel 8)
php|laravel|laravel-8
1
75
3
72,781,205
72,781,205
0
true
2022-06-28T04:55:23.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Image uploaded but database not updated (Update data with image in Laravel 8)<p>I have make feature to update profile. The table is User HasOne DetailUser so...
72,807,743
How to get properly userId from strapi when login?<p>I am migrating from strapi 3.6.8 (mongodb-mongo cluster) to 4.2 (mysql -azuremysql) with React native Expo CLI, I am testing this new version locally but I have this error when i login and try to get auth data from user i dont receive <code>idUser</code> only <code>t...
<p>Your <code>setUser(response);</code> call takes in a response from the Strapi User Permissions provider which looks something like this:</p> <pre><code>data : { user: { ... }, jwt: ... } </code></pre> <p><a href="https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#login" rel="nofoll...
How to get properly userId from strapi when login?
reactjs|react-native|strapi
1
75
1
72,810,236
72,810,236
0
true
2022-06-29T20:54:28.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get properly userId from strapi when login?<p>I am migrating from strapi 3.6.8 (mongodb-mongo cluster) to 4.2 (mysql -azuremysql) with React native Ex...
72,800,167
Login screen rendering twice after logout on React Navigation 6<p>When signing out of my app the <strong>signin screen is getting rendered twice</strong>. This only happens when i navigate to another screen and then go back to the initialroute. If i do not leave the initialroute after login and logout right away it onl...
<p>It appeared that both navigators were mounted and affected by the login so i finally solved it by wrapping both Navigators inside a parent stack container like below.</p> <p><strong>Loading screen.js</strong></p> <pre><code> const RootStack = createStackNavigator(); const RootStackScreen = () =&gt; ( &lt;Root...
Login screen rendering twice after logout on React Navigation 6
reactjs|react-native|react-redux
2
75
1
72,813,820
72,813,820
0
true
2022-06-29T10:53:01.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Login screen rendering twice after logout on React Navigation 6<p>When signing out of my app the <strong>signin screen is getting rendered twice</strong>. Th...
72,811,478
ClickHouse replicated table block-level deduplication with buffer table<p>The documentation regarding the buffer table engine for a replicated destination table contains the following warning:</p> <p><a href="https://clickhouse.com/docs/en/engines/table-engines/special/buffer/" rel="nofollow noreferrer">https://clickho...
<p>You lose two things with buffer tables -- one is &quot;automatic&quot; deduplication when the client inserts exactly the same block more than once. This allows for the possibility of duplicate data if the client believes a write has failed when it was in fact successful and attempts to rewrite the same batch. That...
ClickHouse replicated table block-level deduplication with buffer table
clickhouse
0
75
1
72,813,828
72,813,828
0
true
2022-06-30T06:57:43.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ClickHouse replicated table block-level deduplication with buffer table<p>The documentation regarding the buffer table engine for a replicated destination ta...
72,815,491
Gradle - Customize Classpath in Manifest<p>I want to create a more general Classpath, than what is generated from this snippet of my build.gradle file:</p> <pre><code>jar { manifest { attributes ( &quot;Main-Class&quot;: &quot;x.y.z.main&quot;, &quot;Specification-Title&quot; : &quot;Oh how specific...
<p>Could you try:</p> <pre><code>'Class-Path': configurations.runtime.files.collect{ &quot;lib/external/&quot; + it.getName() }.join(' ') </code></pre>
Gradle - Customize Classpath in Manifest
java|gradle|groovy|manifest
0
75
1
72,816,256
72,816,256
0
true
2022-06-30T12:03:46.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gradle - Customize Classpath in Manifest<p>I want to create a more general Classpath, than what is generated from this snippet of my build.gradle file:</p> <...
72,804,594
It's possible wait for a variable in Ruby, (without sleep)?<p>I’m trying to get data from an ssh server, but this action takes some time to run, so I need to wait for them, once I have them, I’ll use this data to send them through my Bot to Slack.</p> <p>Here my code:</p> <pre><code>def sshPingRequest() Net::SSH.st...
<p>What about promises? Could it be what you are looking for?</p> <p><a href="https://ruby-concurrency.github.io/concurrent-ruby/1.1.5/Concurrent/Promise.html" rel="nofollow noreferrer">https://ruby-concurrency.github.io/concurrent-ruby/1.1.5/Concurrent/Promise.html</a></p> <p>From the docs:</p> <blockquote> <p>Promise...
It's possible wait for a variable in Ruby, (without sleep)?
ruby|ssh
1
75
2
72,817,450
72,817,450
0
true
2022-06-29T16:06:12.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: It's possible wait for a variable in Ruby, (without sleep)?<p>I’m trying to get data from an ssh server, but this action takes some time to run, so I need to...
72,817,224
Vue3 JS - How to access/print values stored in an object onto document <template><p>New to Vue, JS and Firebase been taking tutorials for weeks and now trying to build a test project. Embarrassed to say I have been stuck on this particular problem for several days. Trying to write this question as best I can given my...
<p>Aside from getLastEvent being asynchronous (make sure you await your database call before returning lastEvent), what you're returning from the function is an array, while in your Vue file you're using it as if it's an object. Either set lastEvent.value equal to desired element in your array (preferred)</p> <pre><cod...
Vue3 JS - How to access/print values stored in an object onto document <template>
javascript|firebase|vue.js|google-cloud-firestore|vuejs3
0
75
1
72,820,242
72,820,242
0
true
2022-06-30T14:05:28.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue3 JS - How to access/print values stored in an object onto document <template><p>New to Vue, JS and Firebase been taking tutorials for weeks and now tryin...
72,820,671
Flutter button calls setState of other widget<p>I'm getting serious about communication between the widgets in my app.</p> <p>I have a bar that has three states: Information, copy mode and options. When in info, only the date is displayed with DateFormat(). When in options, the information is changed by two buttons: co...
<p>To fix the code you should remove the <code>setState</code> in the build of <code>OptionsBarButton</code> and reverse or forward the animation depending on the <code>EditorState</code>. To listen for dependency changes, like the provider <code>EditorState</code>, override the <a href="https://api.flutter.dev/flutter...
Flutter button calls setState of other widget
flutter|dart|setstate
1
75
1
72,821,746
72,821,746
0
true
2022-06-30T18:46:44.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter button calls setState of other widget<p>I'm getting serious about communication between the widgets in my app.</p> <p>I have a bar that has three sta...
72,811,068
Is there any way to set TTL (expiration) for Room record in Android?<p>I'm trying to implement an offline cache using Room instead of OkHttp Cache. The cache result of each request is only valid for short time like 30 mins.</p> <p>Here is the flow:</p> <ol> <li>The app first load data from database</li> <li>If the data...
<p>There is <strong>NO</strong> automated or an in-built way to handle the time expiration in Room Persistence Library(Room Database). One has to handle it manually.</p> <p>One way to do that is create two columns in the table:</p> <ol> <li><code>createdDate</code></li> <li><code>lastUpDatedDate</code></li> </ol> <p>Wh...
Is there any way to set TTL (expiration) for Room record in Android?
android|android-room
1
75
1
72,823,658
72,823,658
0
true
2022-06-30T06:13:59.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to set TTL (expiration) for Room record in Android?<p>I'm trying to implement an offline cache using Room instead of OkHttp Cache. The cache...
72,792,680
ZSH Completions based on a directory, works after only after 'exec zsh'<p>for example, when i start terminal and type <code>brew install spot</code></p> <p>and press TAB - nothing, only dir like a <code>Desktop/</code>, but when i <code>exec zsh</code> everything magically starts working</p>
<p>Add it to your <code>.zshrc</code>:</p> <pre><code>if type brew &amp;&gt;/dev/null then FPATH=&quot;$(brew --prefix)/share/zsh/site-functions:${FPATH}&quot; autoload -Uz compinit compinit fi </code></pre>
ZSH Completions based on a directory, works after only after 'exec zsh'
zsh|oh-my-zsh|zshrc|zsh-completion
-1
75
1
72,840,705
72,840,705
0
true
2022-06-28T20:18:26.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ZSH Completions based on a directory, works after only after 'exec zsh'<p>for example, when i start terminal and type <code>brew install spot</code></p> <p>a...
72,848,454
Two different login system in Laravel 9<p>In my case, I will create a login system with two different users. a) Voters and b) Administrators. Where &quot;Voters&quot; login using the ID Number and password. That password generated by the Administrator (ID Number is taken from the &quot;voters&quot; table), and the Admi...
<p>You need a multi guard authentication. Read this how to. It works with two tables. <a href="https://codecheef.org/article/laravel-9-multiple-authentication-example-using-guard" rel="nofollow noreferrer">https://codecheef.org/article/laravel-9-multiple-authentication-example-using-guard</a></p>
Two different login system in Laravel 9
php|laravel|authentication|middleware
0
75
2
72,849,372
72,849,372
0
true
2022-07-03T17:09:07.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Two different login system in Laravel 9<p>In my case, I will create a login system with two different users. a) Voters and b) Administrators. Where &quot;Vot...
72,849,593
How to log UUID of api request payload on every log messages with python?<p>I'm working on a micro services where i need to log the uuid recieved on a payload to the cloud based logger. But i've one module calling another module, so for every submodule functions to log the messages with uuid, i need to pass uuid to eve...
<p>The logger component of <a href="https://awslabs.github.io/aws-lambda-powertools-python/latest/core/logger/" rel="nofollow noreferrer">Lambda Power tools</a> does this for us on AWS. the code setup is pretty minimal:</p> <pre><code>from aws_lambda_powertools import Logger logger = Logger() def flask_view(): re...
How to log UUID of api request payload on every log messages with python?
python|logging|module|microservices
0
75
1
72,850,617
72,850,617
0
true
2022-07-03T20:12:20.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to log UUID of api request payload on every log messages with python?<p>I'm working on a micro services where i need to log the uuid recieved on a payloa...
72,857,348
Currency Converter js<p>I have a problem with the currency converter, it does not calculate the default rate, only if I press the swap button to change the exchange rates, then it calculates, but how to make it count both times, I see in the console that it complains about the rate I understand why , How to solve this ...
<p>UAH (default) currency does not exist on API. If you switch currency to any other it works as intended.</p> <p>just swtich this line:</p> <pre><code> &lt;select id=&quot;currency-two&quot;&gt; &lt;option class=&quot;select-placeholder&quot;&gt;Виберите&lt;/option&gt; &lt;!-- &lt;option value=&quo...
Currency Converter js
javascript|html|css
1
75
1
72,870,457
72,870,457
0
true
2022-07-04T13:12:57.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Currency Converter js<p>I have a problem with the currency converter, it does not calculate the default rate, only if I press the swap button to change the e...
72,857,781
VHDL - access to 2D array of std_logic_vectors gives unexpected bus conflict<p><strong>Background:</strong> I'm working on a generic systolic array. I created an entity called &quot;systolic_row&quot; to create one row of the systolic array. The data is handed from one row to the next using an array of std_logic_vector...
<p>I was about to post an little toy example where the same mistake occurs, when I realized the problem.</p> <p>The cause of the bus conflict was not in the design files, but in the testbench, which I hastily created for quick compilation checking. The problem was that I was pushing values into the signals that were co...
VHDL - access to 2D array of std_logic_vectors gives unexpected bus conflict
vhdl|fpga|modelsim
0
75
1
72,881,992
72,881,992
0
true
2022-07-04T13:47:23.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VHDL - access to 2D array of std_logic_vectors gives unexpected bus conflict<p><strong>Background:</strong> I'm working on a generic systolic array. I create...
72,831,593
How do you reference a function with the same name as a property?<h2>Question</h2> <p>How can I reference this top-level function from within the data class? Or is Java's encapsulation of a class restrictive to the point that you cannot reach beyond the current class?</p> <h2>Code</h2> <pre><code> def String branchName...
<p>So I solved the problem for myself, but it's arguably a less than ideal solution to the problem. Basically, here's what I had to do:</p> <p>First, I created a getter <code>getGetBranchName</code> and setter <code>setGetBranchName</code> on the class of type <code>Closure&lt;String&gt;</code> and it had a backing fie...
How do you reference a function with the same name as a property?
java|jenkins|groovy
0
75
1
72,890,073
72,890,073
0
true
2022-07-01T15:36:00.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you reference a function with the same name as a property?<h2>Question</h2> <p>How can I reference this top-level function from within the data class?...
72,904,839
(DOM cannot be used) Javascript regular expressions match text and filter HTML tags<p>I need to use a regular expression to replace &quot;text&quot; in the text, but not the HTML tag attribute value &quot;text&quot;.</p> <p>Note: I know the various DOM manipulations, but my needs don't fit the DOM, so I can only use re...
<p>You can use this regex:</p> <pre><code>/(?&lt;=(^|&gt;)[^&lt;&gt;]*)\btext\b/g </code></pre> <p><strong>Explanation</strong>:</p> <p><code>(?&lt;=</code> - look behind</p> <p><code>(^|&gt;)</code> - for start of text OR a greater than sign <code>&gt;</code></p> <p><code>[^&lt;&gt;]*</code> - followed by zero or more...
(DOM cannot be used) Javascript regular expressions match text and filter HTML tags
javascript|regex|typescript
-1
75
2
72,905,057
72,905,057
0
true
2022-07-07T22:23:02.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (DOM cannot be used) Javascript regular expressions match text and filter HTML tags<p>I need to use a regular expression to replace &quot;text&quot; in the t...
72,891,607
Referencing global dynamodb table from the secondary region in CloudFormation template<p>We are using CloudFormation for defining our infrastructure. A global dynamodb table is used that is defined and created in one region (the primary region), but has replicas in another region. How do I reference this same table in ...
<blockquote> <p>I need to get the global table name and stream ARN for the stack in secondary region.</p> </blockquote> <p>You need a <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html" rel="nofollow noreferrer">custom resource</a> for that. So it will be a lambda fun...
Referencing global dynamodb table from the secondary region in CloudFormation template
amazon-web-services|amazon-dynamodb|amazon-cloudformation
2
75
2
72,905,362
72,905,362
0
true
2022-07-07T02:17:11.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Referencing global dynamodb table from the secondary region in CloudFormation template<p>We are using CloudFormation for defining our infrastructure. A globa...
72,882,557
How to make a singleton smtp client thread-safe in Python?<p>I'm unsure if I'm even asking the correct question, so please bear with me.</p> <p>I have an Azure Function App that runs python code. It receives a JSON payload, does some transformations, and sends an email.</p> <p>Everything worked fine until the function ...
<p>I ended up using <code>queue.Queue</code>:</p> <pre class="lang-py prettyprint-override"><code>class Singleton(type): _instance = None _lock = Lock() def __call__(cls, *args, **kwargs): if not cls._instance: with cls._lock: # another thread could have created the inst...
How to make a singleton smtp client thread-safe in Python?
python|azure-functions|thread-safety|smtplib
1
75
1
72,912,251
72,912,251
0
true
2022-07-06T11:10:51.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a singleton smtp client thread-safe in Python?<p>I'm unsure if I'm even asking the correct question, so please bear with me.</p> <p>I have an Azu...
72,913,882
How to use navigation component when Hilt changes the names of the fragments<p>I'm creating an Android app (Java) and using Navigation Components and Hilt for the first time. In the Navigation Editor I'm creating destinations and see that the fragments I created that have been annotated with @AndroidEntryPoint now show...
<p>&quot;Hilt_HomeFragment&quot; is a class generated for Hilt purposes, you should not care about it. Just make the <code>Build</code> -&gt; <code>Clean Project</code>. Then go to your graph, clear the wrong <code>name</code> and write the proper one with the full package path. For example:</p> <pre><code>android:name...
How to use navigation component when Hilt changes the names of the fragments
java|android|android-fragments|android-architecture-navigation|dagger-hilt
1
75
1
72,914,780
72,914,780
0
true
2022-07-08T15:42:23.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use navigation component when Hilt changes the names of the fragments<p>I'm creating an Android app (Java) and using Navigation Components and Hilt fo...
72,919,268
Problem with check if bar is last of session with TradingView Pine Script<p>I want to detect last bar of custom session. I'm using code from here: <a href="https://www.tradingcode.net/tradingview/last-session-bar/" rel="nofollow noreferrer">https://www.tradingcode.net/tradingview/last-session-bar/</a></p> <p>Overall, t...
<p>The code was checking the closing time of previous day and using it in current day to find close But since previous day candle closed at 14:15, it used that to plot the same I have corrected it as below</p> <pre><code>//@version=5 indicator(&quot;last session bar&quot;,overlay = true,max_labels_count=500) // IsLast...
Problem with check if bar is last of session with TradingView Pine Script
pine-script|pinescript-v5
0
75
1
72,919,618
72,919,618
0
true
2022-07-09T05:49:38.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with check if bar is last of session with TradingView Pine Script<p>I want to detect last bar of custom session. I'm using code from here: <a href="h...
72,877,770
How to configure databricks to use correct connection string for dev and prod environments<p>I have 2 environments dev and prod in databricks. All my dev work is completed and I deployed to prod through devops but is showing my dev connection string to my sql database in the notebook. How do I configure my databricks c...
<p>I figured out a way to do this. I created separate jobs in databricks on both dev and prod, and added the parameters for each environment to the jobs, this way, if I run my dev job, it should use my dev connection strings and my prod job should use my prod connection strings in the widgets. This way I don't need to ...
How to configure databricks to use correct connection string for dev and prod environments
azure-devops|azure-pipelines|databricks|azure-databricks
0
75
2
72,924,290
72,924,290
0
true
2022-07-06T03:51:33.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to configure databricks to use correct connection string for dev and prod environments<p>I have 2 environments dev and prod in databricks. All my dev wor...
72,931,842
Laravel Mail attach method - Attached file not opening after downloading<p>I have used the Laravel Mail attach method to specify file attachment for the mail being sent. The file attached successfully but cannot be viewed.</p> <p><code>-&gt;attach(route('download_attachment', 'file=' . $attachment-&gt;name));</code></...
<p>I have solved this still with help from Stackoverflow though. I first get the actual file from the storage, then I attached it as shown below.</p> <p><code>$getThisFile = storage_path('app/' . $attachment-&gt;name);</code></p> <pre><code> return (new MailMessage) -&gt;subject('Download Ready...
Laravel Mail attach method - Attached file not opening after downloading
php|laravel|laravel-mail
0
75
1
72,932,181
72,932,181
0
true
2022-07-10T20:56:40.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Mail attach method - Attached file not opening after downloading<p>I have used the Laravel Mail attach method to specify file attachment for the mail...
72,936,696
Plotting ax.bar_label on sns does not iterate through hue appropriately<p>I have this table</p> <pre><code>print(tmp.head()) tumor_type tumor_or_normal call size cancer_n % 0 ACC Tumor Amplification 2 ACC\nn=5 40.0 1 ACC Tumor Deletion 1 ACC\n...
<p>The issue is that you give the whole <code>size</code> column for each hue. You need to provide the <code>size</code> values for 'Amplification', 'Deletion', and 'Diploid' separately.</p> <pre><code>plt.figure(figsize = (20,8)) palette = {'Amplification': 'red', 'Deletion': 'blue', 'Diploid': 'grey'} ax = sns.barplo...
Plotting ax.bar_label on sns does not iterate through hue appropriately
python|matplotlib|seaborn|bar-chart
-1
75
1
72,937,391
72,937,391
0
true
2022-07-11T09:54:58.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotting ax.bar_label on sns does not iterate through hue appropriately<p>I have this table</p> <pre><code>print(tmp.head()) tumor_type tumor_or_normal ...
72,941,886
Android NFC tag record not read-able<p>I have a little project to write data to Ntag 213, 215, and 216.</p> <p>I success write the data using the MifareUltraLight method. The problem is when I scan using NfcTools, the data format is different than I expected.</p> <p>Here's the format that I expected.</p> <p><a href="ht...
<p>Yes you used the wrong method to write, an Ntag213 is not an Ultralight C tag (though for some basic stuff they do share similar commands)</p> <p>As you want the Android OS to automatically launch the URL, the first Ndef Record in the Ndef message must of the right type of Ndef message.</p> <p>On Android you don't n...
Android NFC tag record not read-able
android|kotlin|nfc|mifare
1
75
2
72,942,400
72,942,400
0
true
2022-07-11T16:40:54.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android NFC tag record not read-able<p>I have a little project to write data to Ntag 213, 215, and 216.</p> <p>I success write the data using the MifareUltra...
72,862,037
Running flyway to migrate db to Azure SQL db: Unable to obtain connection from database<p>I have a flyway script that I run to migrate my db to Azure SQL db. Looks something like this:</p> <pre><code>flyway.url=jdbc:sqlserver://myazuresqlserver.database.windows.net/myazuresqldatabase;ssl=request;integratedSecurity=fals...
<p>The problem was in the line <code>flyway.url=jdbc:sqlserver://myazuresqlserver.database.windows.net/myazuresqldatabase</code> This is what I had in my other flyway migration file (which worked perfectly) so I thought there shouldn't be any problem with this line. But I had to change it to</p> <pre><code>flyway.url=j...
Running flyway to migrate db to Azure SQL db: Unable to obtain connection from database
azure-sql-database|database-migration|flyway|azure-sql-server|azure-elasticpool
0
75
1
72,943,283
72,943,283
0
true
2022-07-04T21:08:04.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running flyway to migrate db to Azure SQL db: Unable to obtain connection from database<p>I have a flyway script that I run to migrate my db to Azure SQL db....
72,944,516
Flutter - Can't build apk. Execution failed for task ':app:minifyReleaseWithR8'<p>I'm trying to build the release apk of my project and stumbled on this error today:</p> <p>R8: Type io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebViewClientHostApiCodec is defined multiple times</p> <ul> <li>What went wrong...
<p>Sadly I didn't find the answer to solve this problem and decided to use another plugin for the same purpose: <a href="https://github.com/pichillilorenzo/flutter_inappwebview" rel="nofollow noreferrer">https://github.com/pichillilorenzo/flutter_inappwebview</a></p>
Flutter - Can't build apk. Execution failed for task ':app:minifyReleaseWithR8'
android|flutter|mobile
0
75
1
72,952,201
72,952,201
0
true
2022-07-11T20:49:04.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter - Can't build apk. Execution failed for task ':app:minifyReleaseWithR8'<p>I'm trying to build the release apk of my project and stumbled on this erro...
72,923,045
Cloud Firestore QuerySnapshot Where function field not supported<p>I am using Cloud Firebase on my android app and I want to filter my documents using where function to avoid unnecessary billing cost, my problem is instead of using document field inside my where function I prefer model to filter my data due to multiple...
<p>From the code you provided, I see that you want to filter data using <code>where</code> and a formatter function <code>formatPhoneNo</code>, but this is not how it works according to the <a href="https://firebase.google.com/docs/firestore/query-data/queries#dart_1" rel="nofollow noreferrer">official documentation</a...
Cloud Firestore QuerySnapshot Where function field not supported
flutter|firebase|google-cloud-firestore
1
75
1
72,958,985
72,958,985
0
true
2022-07-09T16:31:16.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cloud Firestore QuerySnapshot Where function field not supported<p>I am using Cloud Firebase on my android app and I want to filter my documents using where ...
72,876,685
Apigee errorcode: steps.servicecallout.ExecutionFailed - Reason: ResponseCode 400 is treated as error<p><strong>The Problem</strong></p> <p>The Apigee proxy is transforming the true API response of (Status Code 400 with empty JSON) to Status Code 500 and a canned Apigee error response.</p> <p><strong>API Response Witho...
<p>By default, any non 2xx response from a service callout policy is treated as an error as you see from the response. There are two ways to override this behavior.</p> <ol> <li>Set the <code>continueOnError</code> flag in your service callout policy to true. This would ignore all errors arising out of the policy and c...
Apigee errorcode: steps.servicecallout.ExecutionFailed - Reason: ResponseCode 400 is treated as error
apigee
0
75
1
72,961,066
72,961,066
0
true
2022-07-06T00:08:10.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apigee errorcode: steps.servicecallout.ExecutionFailed - Reason: ResponseCode 400 is treated as error<p><strong>The Problem</strong></p> <p>The Apigee proxy ...
72,957,659
How to get the background color of the current view in SwiftUI?<p>I'd like to set the gradient second color to the color of the background.</p> <p>I tried to set <code>.clear</code>, but for some reason it becomes dark. If I use <code>.white</code> the radient is as expected in light mode. The best for me is to use the...
<p>We can use system background, like</p> <pre><code>LinearGradient( gradient: Gradient(colors: [ Color(graphColor), Color(uiColor: UIColor.systemBackground) // &lt;&lt; here !! ]), startPoint: .top, endPoint: .bottom ) </code></pre>
How to get the background color of the current view in SwiftUI?
swiftui|gradient|background-color
0
75
1
72,961,337
72,961,337
0
true
2022-07-12T19:48:35.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the background color of the current view in SwiftUI?<p>I'd like to set the gradient second color to the color of the background.</p> <p>I tried to...
72,969,599
How to find the minimum, maximum and average value of all property of array of objects<p>I have an array of objects with different values in it, I want to find the min, max, and average of the properties in that array</p> <p>for eg if I have an array</p> <p><div class="snippet" data-lang="js" data-hide="false" data-con...
<p>I have followed a two step process -</p> <ol> <li>Group the values of each property (using <code>reduce</code> for this)</li> <li>Loop through all the properties and compute the required result.</li> </ol> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="sn...
How to find the minimum, maximum and average value of all property of array of objects
javascript|node.js|reactjs|arrays|json
1
75
6
72,969,867
72,969,867
0
true
2022-07-13T16:24:43.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the minimum, maximum and average value of all property of array of objects<p>I have an array of objects with different values in it, I want to fi...
72,970,437
How to reassign the type object to string in TypeScript<p>I have tried to reassign the property type to string, but if I reassign the property &quot;type&quot; to string, TypeScript throws an error</p> <blockquote> <p>Type 'string' is not assignable to type '{ title: { value: string; }; }'.</p> </blockquote> <pre><code...
<p>Since you did not define a type for this object, Typescript has inferred the type and prevented you from changing it. If you want to be able to change that property's type to anything, you can declare it as type <code>any</code>.</p> <pre class="lang-js prettyprint-override"><code>const temp: { type: any } = { typ...
How to reassign the type object to string in TypeScript
javascript|typescript|object|oop
-1
75
3
72,974,831
72,974,831
0
true
2022-07-13T17:36:31.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reassign the type object to string in TypeScript<p>I have tried to reassign the property type to string, but if I reassign the property &quot;type&quo...
72,977,674
JEST- some of the tests are not running when I run "npm run jest" in async methods<p>I am testing a service that saves data in REDIS, in my describe I have several &quot;it&quot; tests , the &quot;it&quot; tests are testing a variable that is given a value by an async function, I noticed that when I run the tests the &...
<p>Asynchronous code is hard to think about. A common gotcha is not realizing that the moment you call anything asynchronous, the function you are in immediately goes to the next line of code. Then, at some future and indeterminate time, the callback is invoked. Maybe.</p> <p>This is what's happening in you code when y...
JEST- some of the tests are not running when I run "npm run jest" in async methods
node.js|asynchronous|testing|redis|jestjs
0
75
1
72,979,850
72,979,850
0
true
2022-07-14T08:40:52.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JEST- some of the tests are not running when I run "npm run jest" in async methods<p>I am testing a service that saves data in REDIS, in my describe I have s...
72,842,967
Link a Webapp to a Google Sheet<p>I need some help/advice. I have a simple Webapp for teachers at my school that lets them quickly record points for groups on their device. The interface looks something like this:</p> <p><a href="https://i.stack.imgur.com/oUTEJ.png" rel="nofollow noreferrer"><img src="https://i.stack.i...
<p>I figured it out! I used e param to pass the Sheet URL to the webapp.</p>
Link a Webapp to a Google Sheet
google-apps-script
0
75
1
72,986,912
72,986,912
0
true
2022-07-02T23:06:49.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Link a Webapp to a Google Sheet<p>I need some help/advice. I have a simple Webapp for teachers at my school that lets them quickly record points for groups o...
72,973,907
Is it possible to modularize C functions with different argument types?<p>I'm building a bTree to deal with 2 different file types.</p> <pre><code>struct bNode { char nodeType; int numKeys; Key key[MAX_KEYS+1]; int desc[MAX_DESC+1]; }; struct bNode2 { char nodeType; int numKeys; Key2 key[MA...
<p>You can merge the two structs by using an embedded <code>union</code> then using the <code>nodeType</code> as a tag to figure out which of the two keys you are interested for a given instance of the <code>struct</code>:</p> <pre><code>struct bNode { char nodeType; int numKeys; union { Key key[MAX_...
Is it possible to modularize C functions with different argument types?
c|file|b-tree|modularity
0
75
3
72,987,861
72,987,861
0
true
2022-07-14T00:08:53.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to modularize C functions with different argument types?<p>I'm building a bTree to deal with 2 different file types.</p> <pre><code>struct bNo...
72,985,229
Pine Script - Using Swing High greater than entry for Short Trade Stop Loss<p>I'm working on a strategy that uses the recent Swing High as Stop Loss points for my Short trades. However on some trades the current Swing High is lower than the close price of the candle I want to enter on, forcing the trade to stop out ins...
<p>You can calculate the barssince manually using for loop like below, where you can compare current close to previous swinghighs</p> <pre><code>barssinc=0 for i=0 to 100 barssinc:=barssinc+1 if swingHigh[i] &lt; close break </code></pre>
Pine Script - Using Swing High greater than entry for Short Trade Stop Loss
pine-script
0
75
2
72,990,857
72,990,857
0
true
2022-07-14T18:35:49.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pine Script - Using Swing High greater than entry for Short Trade Stop Loss<p>I'm working on a strategy that uses the recent Swing High as Stop Loss points f...
72,982,397
DBContext fail No suitable constructor was found for entity type 'FolderNamespace'<p>I have a large Project with an DBContext create with great EFCore PowerTool and mySql</p> <p>On Debugging fails on load the EntitiesContext with</p> <blockquote> <p>System.InvalidOperationException: &quot;No suitable constructor was fo...
<p>I have found the answer !</p> <p>on a partial class from MimeKit Mail i've forget the</p> <pre><code> [NotMapped] public ImapClient IC { get; set; } </code></pre> <p>to ignore on Entity Model...</p>
DBContext fail No suitable constructor was found for entity type 'FolderNamespace'
c#|mysql|entity-framework|.net-6.0|dbcontext
0
75
1
72,991,246
72,991,246
0
true
2022-07-14T14:42:41.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DBContext fail No suitable constructor was found for entity type 'FolderNamespace'<p>I have a large Project with an DBContext create with great EFCore PowerT...
73,002,160
How to combine column data which have same column headers<p>I am trying to combine columns' data having the same column header inside the same data frame.</p> <p>Current version</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th><strong>FIDB</strong></th> <th>RECOM</th> <th>HDBAS</th> <th>ADFD...
<pre><code>import pandas as pd from io import StringIO data ='''\ FIDB,RECOM,HDBAS,ADFDS,RECOM,ADFDS,HDBAS,HDBAS ISIN,INE0212,INE752,INE862,INE943,INE004,INE035,INE143 MDat,6/30 2,6/29 22,6/28 22,6/16 2,6/1222,6/15222,6/14 ''' file = StringIO(data) df = pd.read_csv(file, index_col=0, header=None).T.set_index('FIDB') ...
How to combine column data which have same column headers
python
1
75
1
73,003,944
73,003,944
0
true
2022-07-16T06:53:59.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine column data which have same column headers<p>I am trying to combine columns' data having the same column header inside the same data frame.</p...
72,929,431
How to create a portal to a child component?<p>I would like to create a portal to insert a content in a child component but I can't make it work. I tried to use a callback ref as shown <a href="https://stackoverflow.com/a/59515159/9718056">on this answer</a> but it doesn't work (the content of the portal is not display...
<p>I managed to make it work by storing the selector in a state using <code>useEffect</code>:</p> <pre><code>const Parent = () =&gt; { const childRef = useRef(); const [titleContainer, setTitleContainer] = useState(null); useEffect(() =&gt; { const titleContainerSelector = childRef.current.querySelector(&quo...
How to create a portal to a child component?
reactjs
0
75
2
73,005,291
73,005,291
0
true
2022-07-10T14:56:18.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a portal to a child component?<p>I would like to create a portal to insert a content in a child component but I can't make it work. I tried to ...
73,019,920
How can I make it so that I can only type once per day?<p>I want to save and manage a bool value in userDefaults so that I cannot input the exercise time again until the date is changed after the first exercise time is entered.</p> <pre class="lang-swift prettyprint-override"><code> func nextDate(){ var compoen...
<p>With the sparse information you provided it seems way easier to store the date whenever the <code>pushProfileGraphVC</code> func is executed and check it before execution.</p> <p>Change this:</p> <pre><code>func saveInputDateAvailable() { UserDefaults.standard.set(Calendar.current.startOfDay(for: Date()), forKey...
How can I make it so that I can only type once per day?
swift|userdefaults
0
75
1
73,020,847
73,020,847
0
true
2022-07-18T09:16:11.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make it so that I can only type once per day?<p>I want to save and manage a bool value in userDefaults so that I cannot input the exercise time aga...
72,976,368
Why does Step Functions task fails after submission?<p>I have just started out with steps functions so feel free to ask for details if my question is ambiguous!</p> <p><strong>What I am trying to achieve:-</strong> I am trying to upload a file which triggers lambda function as a task invoked by the step function.</p> ...
<p>I figured out the solution, it's not the step functions, in my case, the problem was with file decompression, which led the step function to fail.</p> <p>In such cases, if other files are working good with step functions, it is better to check for file contents.</p>
Why does Step Functions task fails after submission?
typescript|amazon-web-services|aws-lambda|aws-cdk|aws-step-functions
0
75
2
73,074,704
73,074,704
0
true
2022-07-14T06:52:58.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Step Functions task fails after submission?<p>I have just started out with steps functions so feel free to ask for details if my question is ambiguo...
72,988,563
How do you add an error alert then return to main function within same loop<p>How do you return to user input to try again in tkinter after the user searches for a value in excel that is not found whereby an error pop up is displayed?</p> <p>In my submit function below it works for valid entries (values in the excel fi...
<p>I now realise what is wrong I needed a second if statement outside of the for loop also without needing a break statement as well</p>
How do you add an error alert then return to main function within same loop
python|tkinter|messagebox
0
75
2
73,215,979
73,215,979
0
true
2022-07-15T02:49:28.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you add an error alert then return to main function within same loop<p>How do you return to user input to try again in tkinter after the user searches...
72,926,732
C# StreamReader.Readline() in while loop giving me nullable to non nullable warning<p>So my question is i'm getting a warning from visual studio stating that</p> <blockquote> <p>&quot;null literal or possible null value to non-nullable type&quot;</p> </blockquote> <p>and the code works and executes as expected, however...
<p>Change the function to this:</p> <pre><code>private void ReadFiles() { string path = &quot;your path&quot;; using StreamReader streamReader = File.OpenText(path ); if (streamReader == null) throw new Exception(&quot;An error occured with stream reader&quot;); var line = &quot;&quot;; while (( l...
C# StreamReader.Readline() in while loop giving me nullable to non nullable warning
c#|file|streamreader|nullable-reference-types
0
75
1
72,926,828
72,926,828
0
true
2022-07-10T07:07:14.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# StreamReader.Readline() in while loop giving me nullable to non nullable warning<p>So my question is i'm getting a warning from visual studio stating that...
72,961,493
How to show numbers for each paragraph in Swift label<p>I am getting string from server is like below, Due to privacy policy I have added some static text.</p> <blockquote> <p>&quot;\n1. You are Lorem ipsum doller sit amen Lorem ipsum doller sit amen Lorem ipsum doller sit amen . \n2. You are Lorem ipsum doller sit ame...
<p>First, the <code>\n</code> character is a newline character, so it will be handled by the <code>UILabel</code> for you. So, all you need to do is to set the <code>foregroundColor</code> for matches of the number at the start of each line. E.g.</p> <pre class="lang-swift prettyprint-override"><code>let string = &quot...
How to show numbers for each paragraph in Swift label
ios|swift|uilabel|nsattributedstring|paragraph
1
75
1
72,961,880
72,961,880
0
true
2022-07-13T05:49:55Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show numbers for each paragraph in Swift label<p>I am getting string from server is like below, Due to privacy policy I have added some static text.</...
72,979,798
conda build: ResolvePackageNotFound depending on machine<p>I'm building a custom conda package with that depends on four other packages from a custom channel. When I try <code>conda build .</code> on machine A, these packages are reported as unsatifiable (see below). On machine B, with the same commit, <code>conda buil...
<p>I found out what the problem was. It has to do with my employer's network set-up. We normally use VPN and when in that VPN, the user home directory (i.e. the <code>$HOME</code> environment variable) is set to the network drive <code>H:</code>. The other day, I couldn't connect to VPN. This means that a) the user hom...
conda build: ResolvePackageNotFound depending on machine
python|conda|conda-build
0
75
1
72,991,221
72,991,221
0
true
2022-07-14T11:29:25.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: conda build: ResolvePackageNotFound depending on machine<p>I'm building a custom conda package with that depends on four other packages from a custom channel...
72,952,395
Powershell: Using Test-Path in combination with OlderThan. Could someone please take a look and tell me where my mistake is, thanks<p>I create a file in a folder. Every 6 months the file needs updating. I would like the script to tell me if the file is:</p> <ul> <li>less than 6 months old (in Green)</li> <li>over 6 m...
<p>There is a lot to do with your script. I don't love <code>$arg[0]</code> but I don't know enough about what you are doing to help with that.</p> <p>Please look at the comments in the script below and above. Also please read <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/...
Powershell: Using Test-Path in combination with OlderThan. Could someone please take a look and tell me where my mistake is, thanks
powershell
0
75
1
72,954,873
72,954,873
0
true
2022-07-12T12:33:24.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell: Using Test-Path in combination with OlderThan. Could someone please take a look and tell me where my mistake is, thanks<p>I create a file in a fo...
73,008,296
Attaching scrollbar to listbox in tkinter window python<p>Need help in attaching the scrollbar to the listbox.I have tried several things &amp; obviously I am not doing something correct. Any help/guidance will be really appreciated. I have attached a snapshot of how the tkinter window looks like.</p> <pre><code>from t...
<p>With the following small changes the scrollbar 'sticks' to the listbox:</p> <p><code>scrollbar.grid(row=20, column =3, rowspan=6, sticky=(W+N+S))</code> puts the scrollbar to the left side of the grid.</p> <p><code>output_list.grid(row=20, column=0, columnspan=3, rowspan=6)</code> let the scrollbar 'stick' to the li...
Attaching scrollbar to listbox in tkinter window python
python-3.x|tkinter|pycharm
0
75
2
73,008,512
73,008,512
0
true
2022-07-16T23:29:13.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attaching scrollbar to listbox in tkinter window python<p>Need help in attaching the scrollbar to the listbox.I have tried several things &amp; obviously I a...
72,976,355
How to push objects in php?<p>I have this empty array:</p> <pre class="lang-php prettyprint-override"><code>$newRow = []; </code></pre> <p>I need somehow push this object into <code>$newRow</code>:</p> <pre class="lang-php prettyprint-override"><code>$newRow = $this-&gt;db-&gt;table(self::TABLE_NAME)-&gt;where(array('s...
<p>Your code does have several issues. I will now try to explain to you what improvements you can make to your code to avoid errors during execution.</p> <h2>It 's all about return types</h2> <p>The first big issue in your code are return types. Your <code>filter</code> function returns either an array or the result of...
How to push objects in php?
php
-1
75
2
72,977,384
72,977,384
0
true
2022-07-14T06:52:11.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to push objects in php?<p>I have this empty array:</p> <pre class="lang-php prettyprint-override"><code>$newRow = []; </code></pre> <p>I need somehow pus...
73,001,628
Migrate multiple gitlab repositories to github - how to do it all at once (instead of manually)<p>I have 45 projects/repositories on Gitlab. I want to move it to my Github.</p> <p>I know there is a way to do it on the UI one by one by import repository.</p> <p>But how to do it all at once?</p>
<p>Here is a python based solution assuming we are referencing only repos inside your projects list (not within sub-groups, though this can be modified to work for that case).</p> <p>These steps will walk you through the hard part of this problem, getting the repositories to exist on GitHub (with added bonus of copying...
Migrate multiple gitlab repositories to github - how to do it all at once (instead of manually)
git|github|gitlab|migration|repository
2
75
1
73,046,366
73,046,366
0
true
2022-07-16T04:55:23.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Migrate multiple gitlab repositories to github - how to do it all at once (instead of manually)<p>I have 45 projects/repositories on Gitlab. I want to move i...
72,925,764
Selenium does not recognize pop up as existing<p>Original code credit: Omer Sakarya and Ken Jee.</p> <pre><code>try: WebDriverWait(driver, 30).until(EC.alert_is_present()) obj = driver.switch_to.alert obj.dismiss() except NoSuchElementException: pass </code></pre> <p>Unfortunately, the pop-up stays on t...
<pre><code>try: driver.find_element(By.XPATH,('.//div[@id=&quot;JAModal&quot;]//span[@alt=&quot;Close&quot;]')).click() except NoSuchElementException: pass </code></pre> <p>I was able to solve this one through a lot of trial and error, thank you to everyone that helped!</p>
Selenium does not recognize pop up as existing
python|selenium|web-scraping
0
75
1
72,943,622
72,943,622
0
true
2022-07-10T02:21:28.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium does not recognize pop up as existing<p>Original code credit: Omer Sakarya and Ken Jee.</p> <pre><code>try: WebDriverWait(driver, 30).until(EC.a...
72,994,451
How to extract specific words from a string?<p>I have to extract two things from a string: A list that contains stop-words, and another list that contains the rest of the string.</p> <pre><code>text = 'he is the best when people in our life' stopwords = ['he', 'the', 'our'] contains_stopwords = [] normal_words = [] f...
<p>One answer could be:</p> <pre class="lang-py prettyprint-override"><code>text = 'he is the best when people in our life' stopwords = ['he', 'the', 'our'] contains_stopwords = set() # The set data structure guarantees there won't be any duplicate normal_words = [] for word in text.split(): if word in stopwords...
How to extract specific words from a string?
python|python-3.x|string
0
75
5
72,994,511
72,994,511
0
true
2022-07-15T13:04:42.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract specific words from a string?<p>I have to extract two things from a string: A list that contains stop-words, and another list that contains th...
73,015,417
How to understand what is wrong with my Python loop code<p>I have written this code to extract only digits from a text file and then calculate sum of those values extracted . But I am getting 0 as answer which should 285701 in actual. I don't understand what I am doing wrong even after working on it for long, I am not ...
<p>You can't open web urls with <code>open()</code> you need to use <code>urllib.request.urlopen()</code>:</p> <pre class="lang-py prettyprint-override"><code>import urllib.request import re fname = urllib.request.urlopen(&quot;http://py4e-data.dr-chuck.net/regex_sum_1501185.txt&quot;) data = fname.read().decode() data...
How to understand what is wrong with my Python loop code
python|import|sum|extract
0
75
1
73,015,443
73,015,443
0
true
2022-07-17T21:15:52.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to understand what is wrong with my Python loop code<p>I have written this code to extract only digits from a text file and then calculate sum of those v...
72,823,972
I want to use LazyVerticalGrid<p>Wow! This is my first question in stackoverflow. And my english is not good yet. I want to use LazyVerticalGrid. So I try to change compose_version to '1.1.1'.</p> <pre><code>e: This version (1.1.1) of the Compose Compiler requires Kotlin version 1.6.10 but you appear to be using Kotlin...
<pre><code>buildscript { ext { compose_version = '1.1.1' kotlin_verison='1.6.4' &gt;&gt;&gt;&gt; Typo } }// Top-level build file where you can add configuration options common to all sub-projects/modules. </code></pre> <p>you have a typo on <code>kotlin_version</code></p> <...
I want to use LazyVerticalGrid
android|android-studio|kotlin
0
75
1
72,826,406
72,826,406
0
true
2022-07-01T03:04:01.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to use LazyVerticalGrid<p>Wow! This is my first question in stackoverflow. And my english is not good yet. I want to use LazyVerticalGrid. So I try to...
72,915,665
How do you send out from SignalR Hub from another class in the same project?<p>Background: I'm on .Net 6 running the latest and greatest from the built-in SignalR package. I installed @microsoft/signalr and the JS side of things works fine for Client -&gt; Server communications. The issue is my Server -&gt; Hub comm...
<p>I figured out how to accomplish this. What I did was add <a href="https://docs.microsoft.com/en-us/aspnet/core/signalr/dotnet-client?view=aspnetcore-6.0&amp;tabs=visual-studio" rel="nofollow noreferrer">the SignalR client package</a> to my project and created a hub connection. I added it to the IoC container we use...
How do you send out from SignalR Hub from another class in the same project?
c#|.net-6.0|signalr-hub
0
75
1
73,004,348
73,004,348
0
true
2022-07-08T18:36:47.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you send out from SignalR Hub from another class in the same project?<p>Background: I'm on .Net 6 running the latest and greatest from the built-in S...
72,941,501
Fill the CALayer with different color when timer reaches to 5 seconds swift ios<p>In my app i am using a third party library which does circular animation just like in the appstore app download animation. i am using the external file which i have placed in my project. it works but when the timer reaches to 5 seconds th...
<p>You can achieve that with <code>CAKeyframeAnimation</code> on the <code>StrokePath</code>.</p> <p>I've Update the code in <code>CircleTimer</code> View as below. You can modified fill color and time as per your need.</p> <pre><code> @objc func updateGamePlayTime() { if Constants.totalGamePlayTime &gt; 0 ...
Fill the CALayer with different color when timer reaches to 5 seconds swift ios
swift|animation|uikit|core-animation|calayer
0
75
1
72,942,651
72,942,651
0
true
2022-07-11T16:06:43.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fill the CALayer with different color when timer reaches to 5 seconds swift ios<p>In my app i am using a third party library which does circular animation ju...
72,865,993
Can we use @Autowired annotation as a constructor argument?<p>In my case I am trying to use <code>Environment</code> class to read properties. I tried two options.</p> <p><strong>Option 1 - I tried to use <code>@Autowired</code> the <code>Enviornment</code> class as shown in the following example.</strong></p> <pre><c...
<p>Try:</p> <pre><code>@Service(&quot;idmHelper&quot;) public class IdmHelper { @Autowired Environment env; private var prop = null ; @PostConstruct public init() { prop = env.getProperty('property-name'); } } </code></pre> <p>Other solution :</p> <pre><code>@Service(&quot;idmHelper&quo...
Can we use @Autowired annotation as a constructor argument?
java|spring|constructor|nullpointerexception|autowired
0
75
1
72,866,926
72,866,926
0
true
2022-07-05T08:05:05.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we use @Autowired annotation as a constructor argument?<p>In my case I am trying to use <code>Environment</code> class to read properties. I tried two op...
73,013,408
IndexError: list assignment index out of range [python + json]<p>The error in the title is given to me when i try to use a command in discord.py the command is !sell my code:</p> <pre><code>if &quot;!sell&quot; in message.content: Rndm_mon = (random.randrange(1000,5000)) with open('income.json', 'r') as f:...
<p>It's probably easier to work this out via an answer.</p> <p>This works for a JSON file where your values are numeric. In your version they're strings but that would make the solution a little more difficult to work with since you'd have to convert strings to numbers in order to do math on them.</p> <p>For example, t...
IndexError: list assignment index out of range [python + json]
python|json|discord.py
-1
75
1
73,013,698
73,013,698
0
true
2022-07-17T16:14:13.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IndexError: list assignment index out of range [python + json]<p>The error in the title is given to me when i try to use a command in discord.py the command ...
73,028,520
Why does the docker container exits immediately? on PLC<p>I am running docker on a WAGO-PFC 8204 device and successfully able to install an image for node-red flow based editor. However, when i am trying to run the image, it creates a container but automatically exits. I am not running this image on a linux machine its...
<p>This is because version 3.0.0 of the Node-RED Docker container will not run on old versions of Docker that do not support 64bit time on a 32bit OS.</p> <p>You can try adding <code>--security-opt=seccomp=unconfined</code> to the <code>docker run</code> command or upgrade docker/libseccom to a supported version of the...
Why does the docker container exits immediately? on PLC
linux|docker|node-red|wago
0
75
1
73,029,262
73,029,262
0
true
2022-07-18T20:54:20.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the docker container exits immediately? on PLC<p>I am running docker on a WAGO-PFC 8204 device and successfully able to install an image for node-re...
72,847,841
Regression plot with ggplot and model output with lm do not match in R<p>I am trying to run and plot a model pretty much in the same way the following link does but I get a completely different output : <a href="https://rpubs.com/phle/r_tutorial_regression_discontinuity_design" rel="nofollow noreferrer">https://rpubs...
<p>I don't think there is a contradiction here. Presumably there is a negative coefficient for the <code>+ I(Date - as.Date(&quot;2012-02-08&quot;))</code> term (which applies to both sections), and there is a smaller positive coefficient for the treated condition. Thus the slope for the treated portion is a little les...
Regression plot with ggplot and model output with lm do not match in R
r|ggplot2
0
75
1
72,848,660
72,848,660
0
true
2022-07-03T15:40:45.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regression plot with ggplot and model output with lm do not match in R<p>I am trying to run and plot a model pretty much in the same way the following link...
72,773,815
Trying to manipulate state array in React<p>I need to write two functions, one for updating the shopping cart with new products (reserves) and another one to remove products from the cart. I have many product suppliers, so I want to divide my &quot;cart&quot; array into sections like this:</p> <pre class="lang-js prett...
<ul> <li>Fist point. You can not assign key value like you did to array. but you can push objects as items of array. each object considered as a unique supplier. So your array should be like this:</li> </ul> <pre class="lang-js prettyprint-override"><code>[ { supplierName: 'supplie name 1', products: [ {...
Trying to manipulate state array in React
javascript|reactjs|setstate
1
75
1
72,774,712
72,774,712
1
true
2022-06-27T14:31:16.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to manipulate state array in React<p>I need to write two functions, one for updating the shopping cart with new products (reserves) and another one to...
72,775,528
How can I aggregate fields based on the value of another field?<p>I have an Azure hosted application in which some of our users have been complaining of difficulty logging-in. So I added some logs which show up in Application Insights. A sample of the data is shown below:</p> <p><a href="https://i.stack.imgur.com/9WCdv...
<p>I would start from analyzing the data in the session level.<br /> It's very easy to take it from there and summarize it to the user level etc.</p> <pre><code>// Data sample generation. Not part of the solution // Setup let p_event_num = 30; let p_identifiers_num = 3; let p_max_dista...
How can I aggregate fields based on the value of another field?
azure-data-explorer|kql|kusto-explorer
2
75
2
72,777,285
72,777,285
1
true
2022-06-27T16:36:15.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I aggregate fields based on the value of another field?<p>I have an Azure hosted application in which some of our users have been complaining of diff...
72,780,776
Tomcat Embed Not Working in pom.xml (SpringBoot 3.0.0 M3)<p>I'm following a Udemy Course on learning SpringBoot, but I can't seem to get one of the dependencies installed. The tutorial asks to import a Tomcat dependency into pom.xml (in order to utilize JSP pages from resources), but after trying to import it:</p> <pre...
<p>Can you remove the <code>&lt;repositories&gt;</code> section in pom.xml and try to build. Looks like the jar is not available in Spring repository. It will get downloaded from maven central if none mentioned.</p>
Tomcat Embed Not Working in pom.xml (SpringBoot 3.0.0 M3)
java|spring-boot|tomcat
0
75
1
72,781,176
72,781,176
1
true
2022-06-28T04:33:07.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tomcat Embed Not Working in pom.xml (SpringBoot 3.0.0 M3)<p>I'm following a Udemy Course on learning SpringBoot, but I can't seem to get one of the dependenc...
72,781,489
Django throwing UNIQUE Constraint failed even after adding unique = False<p>I am developing a custom usermodel for my application in django, by using AbstractUser. But I am getting a UNIQUE constraint failed error while using <code>add user +</code> from django admin. I have also tried to add <code>unique = False</code...
<p>in the above code, there should not be any problem with migrations. i think your old migrations are creating problem here. check your old migrations and delete them.</p>
Django throwing UNIQUE Constraint failed even after adding unique = False
python|django|django-models|django-forms
1
75
1
72,781,759
72,781,759
1
true
2022-06-28T06:09:26.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django throwing UNIQUE Constraint failed even after adding unique = False<p>I am developing a custom usermodel for my application in django, by using Abstrac...