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,287,745
Assets are hiding under the map for Terrain with Labels with ArcGIS Runtime maps Xamarin.Forms<p>Assets are hiding under the map for Terrain with Labels basemap.It is not happening with other basemaptypes like Streetvector. ArcGIS Runtime 100.13.0 and Xamarin.Forms 5.0.0.2337 used.please help to solve the issue. <a hre...
<p>Thanks for reporting this. Turns out there is a bug in the Runtime SDK to do with this basemap when created from the Basemap static factory method which we'll address in the next release.</p> <p><strong>UPDATE</strong>: The <a href="https://community.esri.com/t5/arcgis-runtime-sdks-blog/arcgis-runtime-sdk-100-14-1-n...
Assets are hiding under the map for Terrain with Labels with ArcGIS Runtime maps Xamarin.Forms
xamarin.forms|esri|arcgis-runtime|arcgis-runtime-net
0
71
1
72,322,794
72,322,794
1
true
2022-05-18T10:46:37.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assets are hiding under the map for Terrain with Labels with ArcGIS Runtime maps Xamarin.Forms<p>Assets are hiding under the map for Terrain with Labels base...
72,314,756
How to style mixed django form better<p>I have theese two forms:</p> <pre><code>class InitialForm(Form): trn = IntegerField(widget=NumberInput, required = False) klient = ChoiceField(choices=KLIENTS, required = False) class SecondForm(Form): faktura = CharField(max_length = 200, required=False) </code></pr...
<p>Assuming you're using the crispy template pack for styling, you could create a model form class and give the <code>programs</code> field initial &quot;options&quot; from the database, using a query from whatever model you're storing the &quot;options&quot; on. Here's an example, using some assumptions about your dat...
How to style mixed django form better
css|django|django-forms
0
71
1
72,351,203
72,351,203
1
true
2022-05-20T06:54:59.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to style mixed django form better<p>I have theese two forms:</p> <pre><code>class InitialForm(Form): trn = IntegerField(widget=NumberInput, required ...
72,384,143
How to use properties defined in XAML in the C# code-behind<p>I have a <code>XAML</code> document with <code>C#</code> code-behind.</p> <p>In the <code>C#</code> class I define some properties, that I can then set in <code>XAML</code>:</p> <pre><code>public partial class MyClass : ContentView { public Color MyColor...
<p>The solution was to use <code>OnHandlerChanged</code>. After some experiemnts, I can confirm that <code>XAML</code> properties have been set at this stage, and that it will be called each time.</p> <p>In code, it would look like this:</p> <pre><code>protected override void OnHandlerChanged() { base.OnHandlerChan...
How to use properties defined in XAML in the C# code-behind
c#|xaml|maui
0
71
2
72,406,893
72,406,893
1
true
2022-05-25T21:03:04.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use properties defined in XAML in the C# code-behind<p>I have a <code>XAML</code> document with <code>C#</code> code-behind.</p> <p>In the <code>C#</c...
72,244,867
Check if list of string contains exact part of string<p>I have a List of strings as follows,</p> <pre><code> List&lt;string&gt; str = new List&lt;string&gt;() { &quot;7, 31&quot;, &quot;2, 4&quot;, &quot;5, 6&quot; }; </code></pre> <p>My input will be something like &quot;1, 2&quot; or &quot;1&quot;</p> <p>Is there a w...
<p><code>item</code> and <code>inputSplitted</code> are arrays of <code>string</code>, so <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any?view=net-6.0" rel="nofollow noreferrer"><code>Any</code></a> called on them is just checking if those arrays are not empty (i.e. if there are any stri...
Check if list of string contains exact part of string
c#|string|linq
0
71
2
72,244,985
72,244,985
1
true
2022-05-15T01:03:07.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if list of string contains exact part of string<p>I have a List of strings as follows,</p> <pre><code> List&lt;string&gt; str = new List&lt;string&gt;(...
72,296,748
Change position of restart option radio buttons in Finished page of Inno Setup<p>How to change the location of these controls?</p> <p>The restart radio buttons do not seem to be changing its location even when you change it using <code>.Top</code>.</p> <p>Here is the code:</p> <pre class="lang-pascal prettyprint-overri...
<p>The vertical position of the <code>YesRadio</code> and <code>NoRadio</code> are calculated just before the &quot;Finished&quot; page shows, based on the other contents of the page (particularly the height of <code>FinishedLabel</code> and <code>RunList</code>).</p> <p>If you want to override the location, you need t...
Change position of restart option radio buttons in Finished page of Inno Setup
controls|inno-setup|pascalscript
2
71
1
72,320,405
72,320,405
1
true
2022-05-18T22:42:09.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change position of restart option radio buttons in Finished page of Inno Setup<p>How to change the location of these controls?</p> <p>The restart radio butto...
72,391,555
get() returned more than one OrderProduct -- it returned 3<p>My error:</p> <pre><code>MultipleObjectsReturned at /process/ get() returned more than one OrderProduct -- it returned 3! Request Method: POST Request URL: http://127.0.0.1:8000/process/ Django Version: 4.0.4 Exception Type: MultipleObjectsReturned Excep...
<p>It's not clear what <code>OrderProduct</code> is for. There may be an underlying data model issue you need to remedy. For the purpose of this I will address only the django related concerns.</p> <h2>Use <code>.filter().first()</code></h2> <p><a href="https://docs.djangoproject.com/en/4.0/ref/models/querysets/#filter...
get() returned more than one OrderProduct -- it returned 3
python|django
0
71
1
72,391,660
72,391,660
1
true
2022-05-26T12:05:25.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get() returned more than one OrderProduct -- it returned 3<p>My error:</p> <pre><code>MultipleObjectsReturned at /process/ get() returned more than one Order...
72,337,112
How to sort a Collection of objects based on 2 properties<p>I have a class like this:</p> <pre><code> static class Transactions{ private int type; private String to; private String from; private double amount; public Transactions (int type, String to, String from, double amount) { if(type...
<p>Use Java 8 methods of the <code>Comparator</code> interface <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Comparator.html#comparing(java.util.function.Function)" rel="nofollow noreferrer"><code>comparing()</code></a> and <a href="https://docs.oracle.com/en/java/javase/17/docs/api/ja...
How to sort a Collection of objects based on 2 properties
java|list|sorting|collections
0
71
1
72,337,136
72,337,136
1
true
2022-05-22T11:21:59.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort a Collection of objects based on 2 properties<p>I have a class like this:</p> <pre><code> static class Transactions{ private int type; ...
72,257,699
Select data from one table base on selection from another table in SQL<p>I have these 3 table</p> <p>First contain the item with price on given dates</p> <p>2nd is the table of items</p> <p>3rd is the table of dates in which we want to show the price of 2nd table item on every date</p> <p>if duration is not available o...
<pre><code>IF OBJECT_ID('tempdb..#myTable', 'U') IS NOT NULL DROP TABLE #myTable; IF OBJECT_ID('tempdb..#itemTable', 'U') IS NOT NULL DROP TABLE #itemTable; IF OBJECT_ID('tempdb..#DateTable', 'U') IS NOT NULL DROP TABLE #DateTable; CREATE TABLE #myTable ( item VARCHAR(MAX) NOT NULL, startdate DATE NOT NULL,...
Select data from one table base on selection from another table in SQL
sql|sql-server
2
71
2
72,269,309
72,269,309
1
true
2022-05-16T10:23:48.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select data from one table base on selection from another table in SQL<p>I have these 3 table</p> <p>First contain the item with price on given dates</p> <p>...
72,244,705
Iterating through integers not found in a list of ranges in Python<p>So, I have a function which outputs a list of ranges, e.g. [range(1,5),range(8,13)]. I need to iterate through those integers which are not in a range in this list. For example, using the previous list I would like to be able to iterate through 5-7 in...
<p>Using Mark's template:</p> <pre><code>r = [range(1,5), range(8,13), range(20, 25), range(22, 27), range(30, 35)] def missing(r): stop = r[0].stop for a in r: yield from range(stop, a.start) stop = max(stop, a.stop) print(list(missing(r))) </code></pre> <p>Output:</p> <pre><code>[5, 6, ...
Iterating through integers not found in a list of ranges in Python
python|list|loops|range|itertools
0
71
3
72,244,803
72,244,803
2
true
2022-05-15T00:20:28.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterating through integers not found in a list of ranges in Python<p>So, I have a function which outputs a list of ranges, e.g. [range(1,5),range(8,13)]. I n...
72,246,960
Firestore array-not-contains alternative solution<h2>TL-DR</h2> <p>I have created a Flutter Firestore posts application. I want to present the user only new posts, <strong>which they didn't read yet</strong>.</p> <p><strong>How do I achieve that using Firestore query?</strong></p> <h2>The problem</h2> <p>Each time a us...
<p>You're going to have a real hard time with this because Firestore can only give you documents where you know something about the contents of that document. That's how indexes work - by recording data present in the document. Indexes don't track data <em>not</em> present in a document because that's basically an in...
Firestore array-not-contains alternative solution
flutter|google-cloud-firestore
1
71
1
72,248,719
72,248,719
2
true
2022-05-15T09:12:53.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firestore array-not-contains alternative solution<h2>TL-DR</h2> <p>I have created a Flutter Firestore posts application. I want to present the user only new ...
72,252,464
Automate mutate() and case_when() for each value in dplyr<p>I have a dataframe named &quot;data&quot; which contains the column &quot;date&quot; which gives the date of the event.</p> <p>I want to add a column that describes the &quot;winter season&quot; under consideration (in fact the period between August of one yea...
<p>You can calculate month and year from your date. Then if month &lt; 8 (before August) then the winter is from year-1 to year. Otherwise winter is year to year+1</p> <pre><code>data &lt;- data %&gt;% mutate( month=as.numeric(format(date,&quot;%m&quot;)), year=as.numeric(format(date,&quot;%Y&quo...
Automate mutate() and case_when() for each value in dplyr
r|dplyr|purrr
-1
71
2
72,253,010
72,253,010
2
true
2022-05-15T21:54:14.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automate mutate() and case_when() for each value in dplyr<p>I have a dataframe named &quot;data&quot; which contains the column &quot;date&quot; which gives ...
72,260,639
Selenium cannot click button because there is a div overlay<p>I am trying to scrap this webpage <a href="https://www.tecnocasa.es/venta/piso/barcelona/barcelona/510567.html" rel="nofollow noreferrer">https://www.tecnocasa.es/venta/piso/barcelona/barcelona/510567.html</a>, the code i use is the following, and i think is...
<p>Your code works without any problem on my computer, try this one</p> <pre><code>driver.find_element(By.CSS_SELECTOR, '#close').click() </code></pre> <p>If also this will not work, you can try this code which hides the banner. However, you should run it each time that a new page is loaded</p> <pre><code>overlay = dri...
Selenium cannot click button because there is a div overlay
python|selenium
1
71
1
72,262,892
72,262,892
2
true
2022-05-16T14:14:46.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium cannot click button because there is a div overlay<p>I am trying to scrap this webpage <a href="https://www.tecnocasa.es/venta/piso/barcelona/barcel...
72,296,562
Graphviz .dot output with Tkinter<p>I have created part of a python program which takes input from user and generates a .dot file to draw a finite automata graph corresponding to certain inputs. The GUI of the program is built on the Tkinter library.</p> <p>I would like to know if there is a way to convert the .dot fil...
<p>You can run arbitrary commands from within Python with <a href="https://docs.python.org/3/library/subprocess.html#subprocess.run" rel="nofollow noreferrer"><code>subprocess.run()</code></a>.</p>
Graphviz .dot output with Tkinter
python|tkinter|graphviz|dot
0
71
1
72,296,695
72,296,695
2
true
2022-05-18T22:11:09.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Graphviz .dot output with Tkinter<p>I have created part of a python program which takes input from user and generates a .dot file to draw a finite automata g...
72,297,827
Odd forming of XML needed from a table to XML using FOR XML PATH in SQL Server<p>I needed to find a way to create either a stored procedure or query to develop the XML from the data listed below.</p> <p>SQL Server table values</p> <p>Table name: <code>VENDORS</code></p> <ol> <li><p>Column #1</p> <p>Name: VENDOR_ID<br /...
<p>Please try the following solution.</p> <p>A <em>minimal reproducible example</em> is not provided. So, I am shooting from the hip.</p> <p>Well-formed XML supposed to have a root element. That's why composed XML has the <code>&lt;root&gt;</code> root element.</p> <p>And the <code>&lt;node&gt;</code> element is corres...
Odd forming of XML needed from a table to XML using FOR XML PATH in SQL Server
sql-server|xml|tsql|xquery
-2
71
2
72,298,045
72,298,045
2
true
2022-05-19T01:57:42.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Odd forming of XML needed from a table to XML using FOR XML PATH in SQL Server<p>I needed to find a way to create either a stored procedure or query to devel...
72,307,566
should a function return the pointer of a newly created object, or a unique_ptr of that object?<p>I remember watching Herb Sutter on conference talks, some years ago, trying to make a guideline along these lines:</p> <blockquote> <p>if a function creates a new object on the heap, then it should always return it as a un...
<p>It is covered in the C++ Core guidelines under I11:</p> <p><a href="https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i11-never-transfer-ownership-by-a-raw-pointer-t-or-reference-t" rel="nofollow noreferrer">https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i11-never-transfer-ownership-by-a-raw...
should a function return the pointer of a newly created object, or a unique_ptr of that object?
c++|c++11
0
71
2
72,308,036
72,308,036
2
true
2022-05-19T15:50:21.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: should a function return the pointer of a newly created object, or a unique_ptr of that object?<p>I remember watching Herb Sutter on conference talks, some y...
72,308,134
How to export many rrd files to xml files<p>I have set of old rrd files, so I need to convert them to xml files and again to rrd files in a new server. In order to create xml files from whole directory, I have used following simple bash script.</p> <pre><code>#!/bin/bash cd /varcacti/rra for i in ./traffic_in*; do /...
<p>You want</p> <pre class="lang-sh prettyprint-override"><code>/home/newuser/rrd_dump_xml/&quot;${i%.rrd}&quot;.xml #..........................^^^^^^^^^^^ </code></pre> <p>which removes the rrd extension from the end of the string. </p> <p>You might want to be more specific with the files you're looping over:</p> <pre...
How to export many rrd files to xml files
linux|bash|rrdtool|rrd
0
71
1
72,308,634
72,308,634
2
true
2022-05-19T16:34:41.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to export many rrd files to xml files<p>I have set of old rrd files, so I need to convert them to xml files and again to rrd files in a new server. In or...
72,321,314
How can I move an excel file using its own VBA code?<p>I have an excel file that I need to move from one folder to another at the click of the button. Currently I have the following code.</p> <pre><code>Private Sub btnReview_Click() Dim FSO Dim projectNumber As String Dim fileSource As String Dim fileDestination As Str...
<p>Based on Hiran Travassos's answer I shortened his code and made it more specific to the question.</p> <pre><code>Public Sub moveMyself() Dim oldFile As String Dim projectNumber As String oldFile = ThisWorkbook.FullName projectNumber = Range(&quot;AI6&quot;).Value ThisWorkbook.SaveAs getProjectFo...
How can I move an excel file using its own VBA code?
excel|vba
1
71
2
72,325,185
72,325,185
2
true
2022-05-20T15:20:02.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I move an excel file using its own VBA code?<p>I have an excel file that I need to move from one folder to another at the click of the button. Curren...
72,337,107
sed to ignore a pattern as well as match a pattern in same line<p>Input file</p> <pre><code>&lt;a href=&quot;perl.html&quot;&gt;perl&lt;/a&gt; &lt;a href=&quot;http://zoidberg.sourceforge.net/out.html&quot;&gt;http://zoidberg.sourceforge.net&lt;/a&gt; &lt;a href=&quot;zoiduser.html&quot;&gt;zoiduser&lt;/a&gt; &l...
<p>You can use</p> <pre class="lang-sh prettyprint-override"><code>sed -E 's/(&quot;(http|www|mailto)[^&quot;]*&quot;)|\.html/\1/g' file </code></pre> <p><em>Details</em>:</p> <ul> <li><code>-E</code> - enables POSIX ERE syntax</li> <li><code>(&quot;(http|www|mailto)[^&quot;]*&quot;)</code> - Group 1 (<code>\1</code>):...
sed to ignore a pattern as well as match a pattern in same line
sed
3
71
3
72,337,139
72,337,139
2
true
2022-05-22T11:21:11.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sed to ignore a pattern as well as match a pattern in same line<p>Input file</p> <pre><code>&lt;a href=&quot;perl.html&quot;&gt;perl&lt;/a&gt; &lt;a href...
72,369,005
S3 bucket given name versus physical name Cloudformation<p>I created a bucket with name &quot;my-bucket&quot;, cloudformation creates it as <code>&quot;StackName-my-bucket-{random text}&quot;</code>. I want to read from this bucket in the java code, what would be the right way to access provided I cannot touch anything...
<p>Assuming you cannot modify the CloudFormation template and it does not have the bucket as an output variable - You can list buckets in the current AWS account. You need the <code>s3:ListAllMyBuckets</code> permission for doing so. Then you can search for your bucket name. If you need to search in multiple accounts, ...
S3 bucket given name versus physical name Cloudformation
java|amazon-web-services|amazon-s3|amazon-cloudformation
1
71
1
72,369,429
72,369,429
2
true
2022-05-24T20:17:55.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: S3 bucket given name versus physical name Cloudformation<p>I created a bucket with name &quot;my-bucket&quot;, cloudformation creates it as <code>&quot;Stack...
72,369,761
Sending a random sound file as a response not working<p>I'm trying to make a talking ben command for my bot, and it just won't work. I want the bot to send an audio clip as a response whenever someone asks a question, and if they don't specify a question, the bot will send a &quot;ben&quot; sound effect. No response to...
<p>First, you need to make sure that the links to the sound files are valid. You're currently using links pointing to an HTML page, not the mp3 files.</p> <p>Second, you need to use an object with a <code>files</code> property to send a file. See the <a href="https://discord.js.org/#/docs/discord.js/stable/typedef/Mess...
Sending a random sound file as a response not working
javascript|node.js|discord|discord.js
1
71
2
72,371,997
72,371,997
2
true
2022-05-24T21:38:54.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending a random sound file as a response not working<p>I'm trying to make a talking ben command for my bot, and it just won't work. I want the bot to send a...
72,279,664
Flipping Views in SwiftUI<p>In my SwiftUI app, I have an Image:</p> <p><a href="https://i.stack.imgur.com/zd5v3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zd5v3.png" alt="enter image description here" /></a></p> <p>I added this image using:</p> <pre><code>Image(&quot;shoe_test&quot;) .resizable...
<p>You could use</p> <pre><code>.rotation3DEffect(.degrees(180), axis: (x: 0, y: 1, z: 0)) </code></pre> <p><a href="https://developer.apple.com/documentation/swiftui/form/rotation3deffect(_:axis:anchor:anchorz:perspective:)" rel="nofollow noreferrer">documentation</a></p> <p>With the <code>rotation3DEffect</code> you ...
Flipping Views in SwiftUI
swiftui
1
71
2
72,279,740
72,279,740
2
true
2022-05-17T19:26:58.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flipping Views in SwiftUI<p>In my SwiftUI app, I have an Image:</p> <p><a href="https://i.stack.imgur.com/zd5v3.png" rel="nofollow noreferrer"><img src="http...
72,247,117
Is it possible to store a user id as the key of a field in a Firestore document?<p>So I saw this in the <a href="https://i.stack.imgur.com/QXbHa.png" rel="nofollow noreferrer">&quot;Get to know Firestore&quot;</a> youtube series from the official Firebase channel, where they used a userId as the key of a field. However...
<p>Give this syntax a shot:</p> <pre><code>updateDoc(groupRef, { roles: { [`${userId}`]: 'member', }, }); </code></pre> <p>Might just need those square brackets as assigning the key dynamically.</p> <p>As @Frank added in comments, if you don't need to convert to string, you can just do:</p> <pre><code>...
Is it possible to store a user id as the key of a field in a Firestore document?
javascript|firebase|google-cloud-firestore
0
71
1
72,247,881
72,247,881
2
true
2022-05-15T09:41:32.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to store a user id as the key of a field in a Firestore document?<p>So I saw this in the <a href="https://i.stack.imgur.com/QXbHa.png" rel="no...
72,266,479
Form validation in flutter passes despite not meeting conditions<p>I am building a Flutter application with multiple TextFormFields. I create a reusable TextFormfield Widget to keep things modular. The problem is, when the submit button is clicked, even though the Text Form Fields are not valid, it runs like it is vali...
<p>I feel a flutter validator should return <code>null</code> if valid, not an empty String.</p> <p>So the code should be:</p> <pre><code>AndroidTextField( validator: (value) { if (value == null || value.isEmpty) { return 'Enter a valid name'; } return null; } ... </code></pre> <p>Also, try:</p> <p><cod...
Form validation in flutter passes despite not meeting conditions
flutter|dart|flutter-textformfield
0
71
1
72,266,574
72,266,574
2
true
2022-05-16T23:03:50.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Form validation in flutter passes despite not meeting conditions<p>I am building a Flutter application with multiple TextFormFields. I create a reusable Text...
72,351,793
How to access <T> from function types in following syntax<p>Below is abstracted version of types in a project I am working on</p> <pre><code>// types.ts interface Methods { request&lt;T&gt;(params: RequestParams): Promise&lt;T&gt;; } // implementation.ts public request: Methods[&quot;request&quot;] = async &lt;T&gt;...
<p>When you write an assignment with a generic type, TypeScript won't infer the type of an assigned value from the variable type. It just verifies that the type of the assigned value (<code>&lt;T&gt;(params: any): Promise&lt;T&gt;</code>) is compatible with the variable type (<code>&lt;T&gt;(params: RequestParams): Pro...
How to access <T> from function types in following syntax
typescript
1
71
1
72,352,385
72,352,385
2
true
2022-05-23T16:20:26.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access <T> from function types in following syntax<p>Below is abstracted version of types in a project I am working on</p> <pre><code>// types.ts inte...
72,268,105
Does ML.Net's AutoML normalize data?<p>I'm using the AutoML API for ML.Net, and I see from the docs that it does a bunch of data <a href="https://docs.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/how-to-use-the-automl-api" rel="nofollow noreferrer">pre-processing</a> for me. What I don't see though is if i...
<p>From my experience AutoML engine automatically adds affine normalizer to Ols regression models, all other types don't get any normalization. You can add normalizer as the preFeaturizer argument to the <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.ml.automl.experimentbase-2.execute?view=ml-dotnet-pre...
Does ML.Net's AutoML normalize data?
c#|ml.net|automl
0
71
1
72,320,189
72,320,189
2
true
2022-05-17T04:10:13.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does ML.Net's AutoML normalize data?<p>I'm using the AutoML API for ML.Net, and I see from the docs that it does a bunch of data <a href="https://docs.micros...
72,359,322
how to set the value of an array inside a loop?<p>I can't seem to figure out how to set the value of an array inside a loop...</p> <p>As you can see below, I retrieve some values from the database and loop through those.</p> <p>What I try to do here can be sum up approximately to the following:</p> <ul> <li>request_1(p...
<p>From the example, the issue looks to be that you are not awaiting the async functions from the maps.</p> <p>Without awaiting the results of <code>firstResponse.data.map(async (book, idx) =&gt; {...})</code>, JS will skip waiting for the promises to resolve and thus jump straight to <code>return singleDetail;</code><...
how to set the value of an array inside a loop?
javascript|reactjs|axios
0
71
1
72,359,420
72,359,420
2
true
2022-05-24T08:06:42.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to set the value of an array inside a loop?<p>I can't seem to figure out how to set the value of an array inside a loop...</p> <p>As you can see below, I...
72,331,758
Is there a function to get a circle object color in javafx?<p>I am working with circle objects in a gridpane and I have to check to color of the circle object by clicking it. For example if it's blue, do some stuff, if it's red, do other stuffs.</p>
<p><strong>get shape color with mouse event</strong></p> <p><a href="https://i.stack.imgur.com/jM0rO.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jM0rO.gif" alt="color shape" /></a></p> <p>you can get it with <code>getFill()</code> and change it with <code>setFill()</code> method and provide a co...
Is there a function to get a circle object color in javafx?
java|javafx
-1
71
1
72,332,117
72,332,117
2
true
2022-05-21T17:18:27.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a function to get a circle object color in javafx?<p>I am working with circle objects in a gridpane and I have to check to color of the circle objec...
72,375,080
JavaScript canvas fillRect visible border<p>I am trying to render histogram with js canvas, it works fine but I am having some troubles with visible border when using <code>fillRect</code>. I know it is caused by bucket width being floating point instead of integer but rouding my bucket width to integer would result in...
<p>How about something like this:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const data = [ 1034, 783, 700, 699, 212, 123, 300, 323, 344, 344, 434, 344, 4...
JavaScript canvas fillRect visible border
javascript|html5-canvas
1
71
1
72,382,253
72,382,253
2
true
2022-05-25T09:29:19.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript canvas fillRect visible border<p>I am trying to render histogram with js canvas, it works fine but I am having some troubles with visible border w...
72,365,236
C# - Can't get this seemingly simple web request working<p>I have the following powershell Web-Request that works correctly for sending a command to a PTZ camera:</p> <pre><code>Invoke-WebRequest -UseBasicParsing -Uri &quot;http://192.168.111.75/ajaxcom&quot; ` -Method &quot;POST&quot; ` -Headers @{ &quot;Accept&quot...
<p>Well, this part is one problem:</p> <pre><code> string stringData = &quot;{\&quot;SysCtrl\&quot;:{\&quot;PtzCtrl\&quot;:{\&quot;nChanel\&quot;:0,\&quot;szPtzCmd\&quot;:\&quot;right_start\&quot;,\&quot;byValue\&quot;:50}}}&quot;; var data = Encoding.Default.GetBytes(stringData); KeyValuePair&lt;string, string...
C# - Can't get this seemingly simple web request working
c#|dotnet-httpclient
0
71
1
72,365,376
72,365,376
3
true
2022-05-24T15:03:33.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# - Can't get this seemingly simple web request working<p>I have the following powershell Web-Request that works correctly for sending a command to a PTZ ca...
72,261,148
Checking if a JSON property exists<p>I am importing stock JSON data from Yahoo Finance to import into Google Sheets for a personal stock tracker using a custom function:</p> <pre><code>function _yahoofinance(ticker) { const url = 'https://query2.finance.yahoo.com/v10/finance/quoteSummary/' + encodeURI(ticker) ...
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining" rel="nofollow noreferrer">optional chaining</a> instead of your <code>_isEmpty()</code> function because you check if <code>quote.quoteSummary.result[0].financialData.totalRevenue</code> is empty but e...
Checking if a JSON property exists
javascript|google-sheets
0
71
1
72,261,255
72,261,255
3
true
2022-05-16T14:50:08.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checking if a JSON property exists<p>I am importing stock JSON data from Yahoo Finance to import into Google Sheets for a personal stock tracker using a cust...
72,337,168
Shift letters in object array in a certain order<p>I'm trying to create unique <a href="https://web.library.yale.edu/cataloging/hebraica/about-gematria" rel="nofollow noreferrer">gematria</a> (alphanumerical cipher) how do I achieve this?</p> <p>The form is as follows:</p> <pre><code>ABCDEFGHIJKLMNOPQRSTUVWXYZ alphab...
<p>I think you are looking for something like this:</p> <pre class="lang-py prettyprint-override"><code>from string import ascii_uppercase def gematria(n, alphabet): length = len(alphabet) ret = {} for i in range(length): j = i * n % length letter = alphabet[j] while letter in ret: ...
Shift letters in object array in a certain order
python
2
71
1
72,337,399
72,337,399
3
true
2022-05-22T11:30:32.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shift letters in object array in a certain order<p>I'm trying to create unique <a href="https://web.library.yale.edu/cataloging/hebraica/about-gematria" rel=...
72,294,517
how to reduce tertiary conditionals<p>So I have this code which works perfectly, it's just that it looks ugly and takes up alot of space. is there a way to reduce the amount of lines this code takes? Code here:</p> <blockquote> <pre><code>radius: Platform.OS === 'android' ? showMore === 1 ? andr...
<p>It's quite easy to clean this kind of condition using mapping, for instance:</p> <pre class="lang-js prettyprint-override"><code>const radiusMap = {1: 2, 2: 4, 3: 10, 4: 25, 5: 50, 6: 100}; const platformRadius = Platform.OS === 'android' ? androidRadius: iosRadius; // finally, return { radius: radiusMap[platformRa...
how to reduce tertiary conditionals
javascript|reactjs|if-statement|conditional-statements|code-cleanup
1
71
2
72,294,591
72,294,591
4
true
2022-05-18T18:48:35.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to reduce tertiary conditionals<p>So I have this code which works perfectly, it's just that it looks ugly and takes up alot of space. is there a way to r...
72,393,020
How to split a path to subpaths and store it in std::vector?<p>My question is how could I split my main path into several separate sub-paths and store it in a vector or list?</p> <p><strong>Example</strong></p> <p>I have path for example:</p> <pre><code>Assets/A/B/C </code></pre> <p>And I need to break them into separa...
<p>A std::filesystem::path is iterable, so you can simply write:</p> <pre><code>for(auto p:path) vector.push_back(p.string()); </code></pre> <p>Or even shorter:</p> <pre><code>std::vector(path.begin(),path.end()); </code></pre> <p>If you do not need strings, but a vector of subpaths is also accaptable.</p>
How to split a path to subpaths and store it in std::vector?
c++|string|filesystems
-1
71
1
72,393,091
72,393,091
4
true
2022-05-26T13:57:08.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split a path to subpaths and store it in std::vector?<p>My question is how could I split my main path into several separate sub-paths and store it in ...
72,279,026
Execution speed of code with `function` object as compared to using template functions<p>I know that <code>std::function</code> is implemented with the <em>type erasure</em> idiom. Type erasure is a handy technique, but as a drawback it needs to store on the heap a register (some kind of array) of the underlying object...
<blockquote> <p>I know that <code>std::function</code> is implemented with the type erasure idiom. Type erasure is a handy technique, but as a drawback it needs to store on the heap a register (some kind of array) of the underlying objects.</p> </blockquote> <p>Type erasure does not necessarily require heap allocations...
Execution speed of code with `function` object as compared to using template functions
c++|c++11|templates|functional-programming|function-object
0
71
1
72,279,266
72,279,266
5
true
2022-05-17T18:29:07.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Execution speed of code with `function` object as compared to using template functions<p>I know that <code>std::function</code> is implemented with the <em>t...
72,341,366
How to exit Ansible playbook when there are multiple hosts defined in the playbook<p>I have a sample Ansible playbook s.yml:</p> <pre><code>- hosts: localhost tasks: - debug: msg=&quot;{{ var }}&quot; - debug: msg=&quot;Do a INFLATE&quot; when: var == &quot;inflate&quot; - meta: end_play w...
<p>@larsks suggested to use <code>block</code> and it worked as expected. Thanks!</p>
How to exit Ansible playbook when there are multiple hosts defined in the playbook
ansible
0
71
1
72,424,670
72,424,670
-1
true
2022-05-22T21:21:11.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to exit Ansible playbook when there are multiple hosts defined in the playbook<p>I have a sample Ansible playbook s.yml:</p> <pre><code>- hosts: localhos...
72,980,361
Bluetooth 16bit UUID registrar is running out of IDs available for companies/members?<p>Out of curiosity I was inspecting the official registrar of 16bit UUIDs:</p> <pre><code>https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf </code></pre> <p>Is it me or is the...
<p>You are mistaken. This list grows downwards and the 16-bit UUID for Members <em>0xFEFF GN Netcom</em> is the first one that was registered. The latest entry is <em>0xFCDC Amazon.com Services, LLC</em>, so I assume that there is still plenty of room for the next years. And last but not least, a fee of $3,000 USD is c...
Bluetooth 16bit UUID registrar is running out of IDs available for companies/members?
bluetooth|bluetooth-gatt
0
71
1
72,980,739
72,980,739
1
true
2022-07-14T12:17:00.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bluetooth 16bit UUID registrar is running out of IDs available for companies/members?<p>Out of curiosity I was inspecting the official registrar of 16bit UUI...
72,777,585
Create Kafka topic in Active-Passive Kafka cluster architecture<p>I'm trying to figure out what is the proper way to create a topic in Active-Passive Kafka cluster architecture.</p> <p>Let's say we have two Kafka clusters (Active-Passive) in two separated availability zone. I understand that the topic mirroring happen...
<p>KMM2 (at least) does monitoring of Kafka topics in the source cluster.</p> <p>In detail take a look at how often KM does use the admin to <a href="https://github.com/apache/kafka/blob/f9201666a1216fcbe07ed4f2ba544833fced6e39/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java#L216...
Create Kafka topic in Active-Passive Kafka cluster architecture
apache-kafka|kafka-topic|apache-kafka-mirrormaker
1
71
1
72,779,236
72,779,236
1
true
2022-06-27T19:48:15.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create Kafka topic in Active-Passive Kafka cluster architecture<p>I'm trying to figure out what is the proper way to create a topic in Active-Passive Kafka ...
72,962,218
Formatting a graph with ts.plot in R<p>In R, I am trying to graph the two time series together more nicely. For the y-axis, I am trying to include the &quot;Percentage&quot; label but for some reason it isn't showing up on the graph. AlsoI am trying to get rid of the tick marks and also want to get ride of the box, but...
<p>Remove the <code>par</code> line and add the <code>gpars=</code> argument shown in this <code>ts.plot</code> call. <code>bty=&quot;n&quot;</code> removes the box and <code>tcl=0</code> removes the ticks. See <code>?par</code> for more info.</p> <pre><code>ts.plot(IOER, deposit_rate, col = c(&quot;cornflowerblue&qu...
Formatting a graph with ts.plot in R
r|time-series|data-visualization
0
71
1
72,966,978
72,966,978
1
true
2022-07-13T07:09:44.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formatting a graph with ts.plot in R<p>In R, I am trying to graph the two time series together more nicely. For the y-axis, I am trying to include the &quot;...
72,917,299
Isotope.js not filtering correctly when using multiple checkboxes<p>I have a simple filter which contains two <code>checkboxes</code>, one for <code>cake</code> another for <code>cupcake</code>.</p> <p>A user can check either option, or select both to show all results. However, even though my <code>filters</code> array...
<p>You missed 2 things:</p> <ol> <li>you transferred the values instead of the id's</li> <li>the ids of the checkboxes serve as classnames for $grid, so they have to be prepended with a dot.</li> </ol> <p>My changes can be reduced to these lines, the rest is there to demonstrate that it's running:</p> <pre><code>$check...
Isotope.js not filtering correctly when using multiple checkboxes
javascript|html|jquery|css|jquery-isotope
1
71
1
72,953,309
72,953,309
1
true
2022-07-08T21:47:22.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Isotope.js not filtering correctly when using multiple checkboxes<p>I have a simple filter which contains two <code>checkboxes</code>, one for <code>cake</co...
72,976,386
Microsoft Ads 'AccountPerformanceReportRequest' data contract. The deserializer has no knowledge of any type that maps to this contract<p>I'm trying to use the Microsoft Bing Ads' <a href="https://docs.microsoft.com/en-us/advertising/reporting-service/reporting-service-reference?view=bingads-13" rel="nofollow noreferre...
<blockquote> <h3>1. I have to request for user consent again and again as access token is short lived and refreshed token also giving unauthenticated token error.</h3> </blockquote> <p>I would like to point you to these tutorial, as reference for my code below.</p> <ul> <li><a href="https://docs.microsoft.com/en-us/adv...
Microsoft Ads 'AccountPerformanceReportRequest' data contract. The deserializer has no knowledge of any type that maps to this contract
soap|mule|soapui|bing-api|bing-ads-api
0
71
1
73,133,206
73,133,206
1
true
2022-07-14T06:54:22.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Microsoft Ads 'AccountPerformanceReportRequest' data contract. The deserializer has no knowledge of any type that maps to this contract<p>I'm trying to use t...
72,959,827
How to inter cumulative sums between two dates and period for individual days?<p>I would like to extrapolate the sums between two days into daily values. The counts represent the cumulative sums collected up to certain day: Let's say, at day X there is XX apples fallen on the ground. How many apples fell on the ground ...
<p>We can <em>inter</em>polate fairly easy using <code>spline</code>s. To <em>extra</em>polate we could use a polynomial model. Let's give the data a flag first to keep control of the results.</p> <pre><code>dd$flag &lt;- 0 </code></pre> <h2>Interpolation</h2> <p>To use the individual doy (what actually is it? was d<st...
How to inter cumulative sums between two dates and period for individual days?
r|interpolation|extrapolation
1
71
1
72,963,168
72,963,168
1
true
2022-07-13T00:58:44.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to inter cumulative sums between two dates and period for individual days?<p>I would like to extrapolate the sums between two days into daily values. The...
72,959,797
How can we optimize the adding of multiple parameters to make the feature file generic to run sql query in latest cypress version?<p>I am using the below feature file to perform the <code>sql query</code> run using <code>cy.task()</code> in latest Cypress version. This is working fine, but is there any other clear way ...
<p>One way I can think of is to have an object of properties and values you would want to validate the response against and then use the properties from this same object in your query.</p> <p>Let's assume you have an object as below.</p> <pre class="lang-js prettyprint-override"><code> const user = { FirstName...
How can we optimize the adding of multiple parameters to make the feature file generic to run sql query in latest cypress version?
cypress|cypress-cucumber-preprocessor
0
71
1
72,963,228
72,963,228
1
true
2022-07-13T00:53:11.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can we optimize the adding of multiple parameters to make the feature file generic to run sql query in latest cypress version?<p>I am using the below fea...
72,965,235
How to make Charles Proxy listen on specific ip on a windows 10 laptop with multiple ipaddresses<p>I am on windows 10 laptop which has two network interfaces (10.* and 192.<em>)( one assigned by the router and another by a VPN virtual adapter). When I start Charles Proxy, it by default starts listening on the 10</em>....
<p>I figured that changing the metric order of the nw interface allows charles to pick up the desired interface. Also, the corporate firewalls were blocking the inbound proxy connection requests on port 8888.</p> <p>The following command on windows showed me the open ports and I used one of the open ports to configure ...
How to make Charles Proxy listen on specific ip on a windows 10 laptop with multiple ipaddresses
android|charles-proxy
1
71
1
72,979,280
72,979,280
1
true
2022-07-13T11:05:48.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make Charles Proxy listen on specific ip on a windows 10 laptop with multiple ipaddresses<p>I am on windows 10 laptop which has two network interfaces...
72,832,433
Preserving constness upon a cast<p>I want a way of preserving if the type is a pointer, const, etc upon a cast. See the following.</p> <pre><code>template&lt;typename type&gt; void test(type t) { std::cout &lt;&lt; &quot;t const? = &quot; &lt;&lt; std::is_const&lt;decltype(t)&gt;() &lt;&lt; std::endl; int x = (...
<p>Your example isnt the best to illustrate the actual issue to cast a <code>void*</code>, possibly <code>const</code>, to some <code>T*</code> with same constness, because you can simply replace the line with <code>type x = t;</code> to get desired output.</p> <p>However, you can use a type trait:</p> <pre><code>#incl...
Preserving constness upon a cast
c++
0
71
1
72,832,665
72,832,665
1
true
2022-07-01T16:49:51.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Preserving constness upon a cast<p>I want a way of preserving if the type is a pointer, const, etc upon a cast. See the following.</p> <pre><code>template&lt...
72,839,903
Triggers maintaining an activation sequence according to their creation and protecting spreadsheet data on every run<p>I'm sending 5 requests to my Web App:</p> <pre class="lang-python prettyprint-override"><code>import requests backodds = &quot;3.00&quot; layteam = &quot;Flamengo&quot; layodds = &quot;1.50&quot; adva...
<p><a href="/questions/tagged/python" class="post-tag" title="show questions tagged &#39;python&#39;" rel="tag">python</a></p> <p>You can <a href="https://requests.readthedocs.io/en/latest/user/advanced/#timeouts" rel="nofollow noreferrer">force a timeout</a>.</p> <blockquote> <p>the call may not even activate the GAS ...
Triggers maintaining an activation sequence according to their creation and protecting spreadsheet data on every run
python|google-apps-script|python-requests
2
71
1
72,840,366
72,840,366
1
true
2022-07-02T14:37:53.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Triggers maintaining an activation sequence according to their creation and protecting spreadsheet data on every run<p>I'm sending 5 requests to my Web App:<...
72,865,520
Create batches of pandas dataframe based on timestamp<p>I have a dataframe of the following form:</p> <pre><code>@timestamp ISP cache_result client_ip client_request_host client_request_method client_ua client_url client_user content_type ... http_response_code major os os_name querystring reply_lengt...
<p>With the following toy dataframe:</p> <pre class="lang-py prettyprint-override"><code>import pandas as pd df = pd.DataFrame( { &quot;timestamp&quot;: [ &quot;2018-04-17T08:12:32.000Z&quot;, &quot;2018-04-17T08:11:33.000Z&quot;, &quot;2018-04-17T08:14:31.000Z&quot;, ...
Create batches of pandas dataframe based on timestamp
python|pandas|split|rolling-computation
1
71
1
72,930,038
72,930,038
1
true
2022-07-05T07:27:49.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create batches of pandas dataframe based on timestamp<p>I have a dataframe of the following form:</p> <pre><code>@timestamp ISP cache_result client_ip ...
72,978,565
How to fix the error when working with recursion and array?<p>I'm trying to solve a problem - need to return an array after entering a value to search. The depth of an array can be theoretically infinite. So I'm recursing to find suitable elements among any depth level and add them to the array and then return this arr...
<p>If I understand your updated requirements, then we can write a simple generic deep filtering function that shows all the elements that match a predicate or which have (recusively nested) descendants that match it.</p> <p>We can configure this with a function that tests whether the title matches a query string. It m...
How to fix the error when working with recursion and array?
javascript|recursion
0
71
2
72,981,837
72,981,837
1
true
2022-07-14T09:50:52.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix the error when working with recursion and array?<p>I'm trying to solve a problem - need to return an array after entering a value to search. The d...
72,859,235
Qt connect signals and slots of different windows/ mirror a lineEdit text on two windows<p>I'm new to any form of programming but have to do a project with Qt for my &quot;programming for engineers&quot; course where we simultaneously learn the basics of c++.</p> <p>I have to display a text from one lineEdit to a lineE...
<blockquote> <p>&quot;I get the error 'mainWindow' does not refer to a value&quot;</p> </blockquote> <p>I don't see you having any &quot;mainWindow&quot; named variable anywhere, but you also mentioned that the <code>MainWindow</code> is the parent, which means you could get reference anytime, like:</p> <pre><code>Main...
Qt connect signals and slots of different windows/ mirror a lineEdit text on two windows
c++|qt|signals-slots|qlineedit|qt-signals
1
71
2
72,860,428
72,860,428
1
true
2022-07-04T15:42:34.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Qt connect signals and slots of different windows/ mirror a lineEdit text on two windows<p>I'm new to any form of programming but have to do a project with Q...
72,779,148
How to compare 2 images and delete the last if they are the same<p>I am making a video recorder, The app works by taking a lot of screenshots and putting them together into one video. Also, I am trying to make something like screen motion detection. I need the app to take screenshot only when a difference in the screen...
<p>I have something that may be useful for you. The idea is save only the differences between the images and, with that, recreate later all images from starting image and saved changes.</p> <p>To do this, you only need make a XOR operation in the image bytes. This method allow you get the difference (the <code>array</c...
How to compare 2 images and delete the last if they are the same
c#|visual-studio|c#-4.0
-1
71
1
72,779,415
72,779,415
2
true
2022-06-27T23:10:37.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare 2 images and delete the last if they are the same<p>I am making a video recorder, The app works by taking a lot of screenshots and putting the...
72,788,823
Why can't Rust downgrade my lifetime but instead complains about type mismatch?<p>Consider the following struct:</p> <pre class="lang-rust prettyprint-override"><code>struct State&lt;'a&gt; { parent: Option&lt;&amp;'a mut State&lt;'a&gt;&gt;, // ... } </code></pre> <p>My state stores some values that I might ne...
<p>The error message on nightly is better (thanks to <a href="https://github.com/rust-lang/rust/pull/95565" rel="nofollow noreferrer">NLL stabilization</a> that may be removed before hitting stable, but now it is there):</p> <pre><code>error: lifetime may not live long enough --&gt; src/main.rs:10:31 | 5 | impl&l...
Why can't Rust downgrade my lifetime but instead complains about type mismatch?
rust|types|lifetime
0
71
2
72,788,929
72,788,929
2
true
2022-06-28T15:00:12.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't Rust downgrade my lifetime but instead complains about type mismatch?<p>Consider the following struct:</p> <pre class="lang-rust prettyprint-overri...
72,823,599
Get all customers whose total spendings are $1000 or more<p>I'd like to retrieve the customers (ID and name) who have spent at least $1000.</p> <p>The tables concerned have the following simplified shape :</p> <ul> <li>Sales : {<strong>SaleID</strong>, CustomerID, Amount}</li> <li>Customers : {<strong>CustomerID</stron...
<p>What you have done is not a bad approach. Another way you can do this :</p> <pre><code>SELECT * FROM (SELECT t2.CustomerID, t2.CustomerName, SUM(t1.Amount) AS total_spent FROM Sales t1 JOIN Customers t2 ON t1.CustomerID = t2.CustomerID GROUP BY t2.CustomerID, t2.CustomerName ) AS Result WHE...
Get all customers whose total spendings are $1000 or more
sql|sql-server|tsql
0
71
1
72,824,389
72,824,389
2
true
2022-07-01T01:42:03.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get all customers whose total spendings are $1000 or more<p>I'd like to retrieve the customers (ID and name) who have spent at least $1000.</p> <p>The tables...
72,835,686
How can I extract text between nth instance of forward slashes?<p>I want to extract all words between &quot;products&quot; and / (forward slash) or period (.)</p> <p>In the example below, I want to extract &quot;pants&quot; and &quot;shoes&quot;</p> <p><a href="http://www.site.com/products/pants.html" rel="nofollow nor...
<p>If <em>nth</em> occurance is e.g. two:</p> <pre><code>^(?:[^\/]*\/){2}([^.\/]+) </code></pre> <p><a href="https://regex101.com/r/i8ljNC/1" rel="nofollow noreferrer">See this demo at regex101</a></p> <ul> <li><code>^</code> start <a href="https://www.regular-expressions.info/anchors.html" rel="nofollow noreferrer">an...
How can I extract text between nth instance of forward slashes?
regex|re2
0
71
1
72,835,773
72,835,773
2
true
2022-07-02T00:36:07.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I extract text between nth instance of forward slashes?<p>I want to extract all words between &quot;products&quot; and / (forward slash) or period (....
72,847,893
Easy way to copy between simple child classes<p>I have an abstract super class with 40 attributes. I also have 2 subclasses that basically extend the super class. Now I want to convert one child class with another.</p> <pre><code>public abstract class ParentClass{ // ... many attributes } public ChildClassA extends...
<p>I would question the design decision of extending the base class with subclasses that don't add anything, especially since they have to be converted from one to another. You could use one class instead, but add an enum field that differentiates the types from one another. Then the conversion would be simply changing...
Easy way to copy between simple child classes
java|java-17
2
71
2
72,848,069
72,848,069
2
true
2022-07-03T15:47:32.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Easy way to copy between simple child classes<p>I have an abstract super class with 40 attributes. I also have 2 subclasses that basically extend the super c...
72,874,069
How would I filter a column for all dates within 1 week from today in VBA?<p>I am trying to filter all dates in a column within 1 week/7 days in the future from today using the same autofilter method in VBA shown below. My column of interest this time is Field:=53</p> <pre><code> ActiveSheet.ListObjects(&quot;Table2...
<p>From today till this day next week:</p> <pre class="lang-vb prettyprint-override"><code>.AutoFilter Field:=53, Criteria1:=&quot;&gt;=&quot; &amp; Date, Operator:=xlAnd, Criteria2:=&quot;&lt;=&quot; &amp; Date + 7 </code></pre> <p>You can also use special values to quickly set the filter to &quot;this week&quot; or &...
How would I filter a column for all dates within 1 week from today in VBA?
excel|vba|filter|excel-formula
0
71
2
72,874,319
72,874,319
2
true
2022-07-05T18:33:08.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How would I filter a column for all dates within 1 week from today in VBA?<p>I am trying to filter all dates in a column within 1 week/7 days in the future f...
72,880,578
Ranges-v3 transform limitations<p>I am trying to use <strong>ranges-v3</strong> to split an SNMP OID into parts and return them as a <code>std::deque&lt;uint32_t&gt;</code>.</p> <p>The following code works but only after I added a number of additional un-natural steps:</p> <pre><code>#include &lt;range/v3/all.hpp&gt; ...
<p>The value type of the range returned by <code>ranges::views::split</code> isn't <code>std::string_view</code>, it is a implementation detail type.</p> <p>I'm not sure why you were able to <code>| to&lt;std::vector&lt;std::string&gt;&gt;</code> at all.</p> <p>Because it uses a sentinel, you will need to convert it to...
Ranges-v3 transform limitations
c++|range-v3
0
71
1
72,881,202
72,881,202
2
true
2022-07-06T08:56:24.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ranges-v3 transform limitations<p>I am trying to use <strong>ranges-v3</strong> to split an SNMP OID into parts and return them as a <code>std::deque&lt;uint...
72,892,011
How can I make sure that my char is not a negative number<p>I want my for loop to break if -1 is entered but that doesn't seem to work in this case. I've tried it a few different ways but nothing seems to make it actually break.</p> <pre><code> struct employee{ char name[30]; float rate; float hrsWorked; };...
<p>You are storing a string of characters in <code>name</code>, so <code>-</code> and <code>1</code> are two different characters.</p> <p>This should work:</p> <pre class="lang-c prettyprint-override"><code>if (staff[i].name[0] == '-' &amp;&amp; staff[i].name[1] == '1') break; </code></pre>
How can I make sure that my char is not a negative number
c|break
1
71
3
72,892,075
72,892,075
2
true
2022-07-07T03:33:13.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make sure that my char is not a negative number<p>I want my for loop to break if -1 is entered but that doesn't seem to work in this case. I've tri...
72,915,550
How to speed up currency conversion while getting historical exchange rates<p>I need some help thinking through this:</p> <p>I have a dataset with 61K records of services. Each service gets renewed on a specific date, each service also has a cost and that cost amount is billed in one of 10 different currencies.</p> <p>...
<p>So if I understand this correctly what this package does is provide a daily fixed rate between two currencies (so one direction is the inverse of the other direction).</p> <p>And what makes things so slow is very clearly the calls to the packages methods. For me around ~4 seconds per call.</p> <p>And you always are ...
How to speed up currency conversion while getting historical exchange rates
python|pandas|dataframe|google-colaboratory
2
71
1
72,916,030
72,916,030
2
true
2022-07-08T18:25:38.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to speed up currency conversion while getting historical exchange rates<p>I need some help thinking through this:</p> <p>I have a dataset with 61K record...
72,938,998
HttpListener response is not sent before listener is stopped<p>I use the code below to get an oAuth code using a browser login, it works just fine ie. auth code is returned BUT there is some timing issue between responseOutput.WriteAsync() and http.stop().</p> <p>When in debug (breakpoint on **** below), then the respo...
<p>It seems that I have to set KeepAlive prior to http.stop()</p> <pre><code>response.KeepAlive = False </code></pre> <p>Somehow even with calling response.close and/or with a 'using' block around the response it still needed this setting.</p>
HttpListener response is not sent before listener is stopped
c#|httplistener
0
71
2
72,949,399
72,949,399
2
true
2022-07-11T12:58:10.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HttpListener response is not sent before listener is stopped<p>I use the code below to get an oAuth code using a browser login, it works just fine ie. auth c...
72,985,295
Replace Newline character, Backspace character and carriage return character in pyspark dataframe<p>I have a file with 3 columns with data in every column. The data is in format below :</p> <p>Every field is enclosed with backspaces like: BSC123BSC (here BSC is a backspace character). Columns' values contain new line a...
<p>A simple <code>[\b\n\r]</code> should work.</p> <pre><code>&gt;&gt;&gt; data = spark.createDataFrame([('086261636b73706163650d43520a4c4608',),('080d0a08',)],['hexstring']).withColumn('col',decode(unhex('hexstring'),'UTF-8')).drop('hexstring') &gt;&gt;&gt; cleansed = data.withColumn('regexed',regexp_replace('col','[\...
Replace Newline character, Backspace character and carriage return character in pyspark dataframe
apache-spark|pyspark|apache-spark-sql
0
71
1
72,986,239
72,986,239
2
true
2022-07-14T18:42:53.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace Newline character, Backspace character and carriage return character in pyspark dataframe<p>I have a file with 3 columns with data in every column. T...
72,999,401
Run multiple commands and consolidate exit codes<p>I have a script which runs multiple commands and I want to return a 0 exit code if all is well, 1 if not. In the first iteration, my script looks like this:</p> <pre class="lang-bash prettyprint-override"><code>make foo make bar </code></pre> <p>The problem is, if <cod...
<p>You can use an <code>ERR</code> trap to update the value of <code>RC</code> if a command fails.</p> <pre><code>trap 'RC=1' ERR ... exit $RC </code></pre> <p>If <code>RC</code> never gets set, making the final command <code>exit</code> with no argument, the exit status of the last command is used, but that's 0 by v...
Run multiple commands and consolidate exit codes
bash|zsh
1
71
1
73,000,327
73,000,327
2
true
2022-07-15T20:41:26.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run multiple commands and consolidate exit codes<p>I have a script which runs multiple commands and I want to return a 0 exit code if all is well, 1 if not. ...
73,013,180
Kernel stops working when an interrupt occurs<p>I have created an operating system from scratch, which accepts interruptions from the keyboard. However, when the keyboard is pressed, the kernel stops working. Any advice is appreciated.</p> <p>Here's the code:</p> <p><strong>BootLoader.asm</strong></p> <pre><code>[BITS ...
<p>Whether the below answer solves 'the keyboard problem' is unsure, but the following issues are not inviting to keep searching for more...</p> <h2>You destroy part of your kernel</h2> <p>Your kernel stretches from 0x00007E00 to 0x00014600.<br /> Because of <code>MOV ESP, 0xffff</code>, the immediately following <code...
Kernel stops working when an interrupt occurs
assembly|x86|nasm|interrupt|osdev
2
71
1
73,014,506
73,014,506
2
true
2022-07-17T15:45:54.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kernel stops working when an interrupt occurs<p>I have created an operating system from scratch, which accepts interruptions from the keyboard. However, when...
73,027,362
Sending GET Request with a JSON body<p>I am trying to consume an API that allows JSON bodies to be sent to a GET endpoint, however I cannot find a way to send a body to a GET endpoint.</p> <p>I have tried:</p> <pre><code>Http::withBody(json_encode([ 'field' =&gt; 'value', ]), 'application/json') -&gt;get('foo.bar/...
<p>You can call the <code>send</code> method, which is what <code>get</code> ends up calling to send the request:</p> <pre><code>Http::asJson()-&gt;send($method, $url, ['json' =&gt; $data]); </code></pre>
Sending GET Request with a JSON body
php|laravel|guzzle
0
71
1
73,027,989
73,027,989
2
true
2022-07-18T19:03:31.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending GET Request with a JSON body<p>I am trying to consume an API that allows JSON bodies to be sent to a GET endpoint, however I cannot find a way to sen...
72,974,656
remove repeated headers between list items react native<p>I'm using @react-native-material and I've got displayed listitems, as well as headers, like this for example</p> <pre><code>**one** pink 1 **one** purple 1 **two** blue 2 **four** aqua 4 </code></pre> <p>But I want to try and display it so that the headers aren'...
<p>Without making changes to the object layout that is in userProducts, you can create a ref variable that will keep track of previous header through each map cycle. For Example:</p> <pre><code>const prevHeader = useRef('NA') userProducts.map(userProduct =&gt; { if(prevHeader.current === userProduct.num){ ret...
remove repeated headers between list items react native
react-native
1
71
3
73,085,882
73,085,882
2
true
2022-07-14T02:50:35.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: remove repeated headers between list items react native<p>I'm using @react-native-material and I've got displayed listitems, as well as headers, like this fo...
72,820,786
Python copying files gives no output<p>I am trying to copy and automatically moves files from one directory to another. I have the basic code and after testing if it recognizes the data and it does by printing out the file names. When I use the <code>shutil.move</code> it doesn't give me an output and it does not move ...
<p>This may accomplish what you are trying to achieve:</p> <pre class="lang-py prettyprint-override"><code> import os import shutil # Path to copy or move files from source = os.getcwd() # Path to move/copy files to destination = os.path.join(source, 'images') # For loop so go through every file in the directory for ...
Python copying files gives no output
python|shutil
1
71
1
72,821,668
72,821,668
2
true
2022-06-30T18:56:02.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python copying files gives no output<p>I am trying to copy and automatically moves files from one directory to another. I have the basic code and after testi...
72,808,138
Create a report of installed packages in Ansible<p>I'm trying to make a report with installed packages and their version from a couple of machines.</p> <p>The report must be created on the machine from where the playbook is executed.</p> <p>Here is my current playbook</p> <pre class="lang-yaml prettyprint-override"><co...
<p>You have to apply a <code>default</code> filter to that fact, as you did for the other information:</p> <pre><code>hostvars[h].ansible_distribution | default('N/A') </code></pre> <p>In this case, since you want to loop over the key / value pair of a dictionary, you can default the <code>packages</code> fact to any e...
Create a report of installed packages in Ansible
ansible|jinja2|report
3
71
1
72,808,444
72,808,444
2
true
2022-06-29T21:36:04.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a report of installed packages in Ansible<p>I'm trying to make a report with installed packages and their version from a couple of machines.</p> <p>Th...
72,899,456
How can I do Many to Multiple Many relationship in Room Android?<p>I want to create a database like below. I followed the documentation but couldn't find any similar examples. Can you help me? There will be days and within these days there will be multiple Daily Meals and Daily Water tables</p> <p>A day database will b...
<p>You have 3 core tables (<strong><code>@Entity</code></strong> annotated classes defined in the entities list of the <strong><code>@Database</code></strong> annotation), Days, Meals and Water.</p> <p><strong>If</strong> (see <strong>However</strong> below) you want a many-many relationship between Days and Meals and ...
How can I do Many to Multiple Many relationship in Room Android?
java|android|database|android-room
3
71
1
72,903,717
72,903,717
2
true
2022-07-07T14:17:37.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I do Many to Multiple Many relationship in Room Android?<p>I want to create a database like below. I followed the documentation but couldn't find any...
72,888,329
Idiomatic way of handling const template arguments in function templates<p>For a framework project I'm working on, I provide an interface for users to access objects through a handle-like interface--i.e. they do not own the objects themselves, but they need to use them.</p> <p>The class the user cares about looks somet...
<p>You can just write a member comparison:</p> <pre class="lang-cpp prettyprint-override"><code>template &lt;class T&gt; struct handle { using value_type = std::remove_const_t&lt;T&gt;; using const_pointer = value_type const*; template &lt;class U&gt; friend struct handle; template &lt;class U&gt;...
Idiomatic way of handling const template arguments in function templates
c++|c++20
0
71
1
72,888,869
72,888,869
2
true
2022-07-06T18:28:00.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Idiomatic way of handling const template arguments in function templates<p>For a framework project I'm working on, I provide an interface for users to access...
72,985,886
Goreleaser did not find GITHUB_TOKEN<p>I have a <a href="https://github.com/fabelx/go-solc-select" rel="nofollow noreferrer">project</a> and I'm trying to set up <a href="https://goreleaser.com/" rel="nofollow noreferrer">goreleaser</a> using <a href="https://github.com/features/actions" rel="nofollow noreferrer">GitHu...
<p>Your <code>gorelease.yml</code> file has different indentations problems.</p> <p>I'm not familiar with GoReleaser, and the error message isn't helping, but using tools like:</p> <ul> <li><a href="http://www.yamllint.com/" rel="nofollow noreferrer">http://www.yamllint.com/</a> (this one reproduces the same error mess...
Goreleaser did not find GITHUB_TOKEN
github|github-actions|goreleaser
1
71
1
72,993,499
72,993,499
2
true
2022-07-14T19:44:11.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Goreleaser did not find GITHUB_TOKEN<p>I have a <a href="https://github.com/fabelx/go-solc-select" rel="nofollow noreferrer">project</a> and I'm trying to se...
72,810,970
How Do I Make A Checkbox Checked By Default?<p>Using PHP and sessions, how can I check a checkbox the first time the page is loaded?</p> <p>Here is a minimal sample of my code:</p> <p><strong>index.php</strong>:</p> <pre><code>&lt;?php session_start(); $_SESSION['foo'] = $_POST['foo']; ?&gt; &lt;!doctype html&gt; &lt;h...
<p>When the page will be first loaded, the <code>$_POST['submit']</code> would not be set as the page would be accessed using a <code>GET</code> Request.</p> <p>So Modify the files: <code>index.php</code></p> <pre class="lang-php prettyprint-override"><code>&lt;?php session_start(); $_SESSION['foo'] = $_POST['foo'] ?? ...
How Do I Make A Checkbox Checked By Default?
php
1
71
2
72,811,032
72,811,032
2
true
2022-06-30T06:03:13.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Do I Make A Checkbox Checked By Default?<p>Using PHP and sessions, how can I check a checkbox the first time the page is loaded?</p> <p>Here is a minimal...
72,829,890
Django WebSocket Routing "Not route for path"<p>I'm trying to get a simple Django Web App with WebSockets going, and can't get the routing to work. I have a basic Consumer, <code>ProgressConsumer</code>, that is used as base for two other Consumers.</p> <pre class="lang-py prettyprint-override"><code>class ProgressCons...
<p>In the frontend Javascript, you have to mention the django app name with full url like this. Simply you can call the ws request as below.</p> <pre><code>const socket_url_1 = `ws://${window.location.host}/analysis_generator/ws/progress/`; const socket_url_2 = `ws://${window.location.host}/function_images/ws/progress/...
Django WebSocket Routing "Not route for path"
python|django|websocket|django-urls|django-channels
0
71
1
72,830,596
72,830,596
2
true
2022-07-01T13:17:22.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django WebSocket Routing "Not route for path"<p>I'm trying to get a simple Django Web App with WebSockets going, and can't get the routing to work. I have a ...
73,015,065
Is there an equivalent to #implementedBySubclass in Java?<p>I have a design question. I have a class hierarchy:</p> <ul> <li>AbstractEntity</li> <li>NPC extends AbstractEntity implements LifeForm</li> <li>Player extends AbstractEntity implements LifeForm</li> </ul> <p>There is a method #moveTo(Target target). This meth...
<p><em>If</em> you put <code>moveTo(Target)</code> in <code>AbstractEntity</code> that would mean <strong>all</strong> <code>AbstractEntity</code>es can be moved. All of them. You can't not: That's what putting it at that level means.</p> <p>If NPC can be moved, and Player can be moved, but let's say Tree (also an <cod...
Is there an equivalent to #implementedBySubclass in Java?
java|oop|smalltalk
4
71
2
73,015,503
73,015,503
2
true
2022-07-17T20:16:54.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an equivalent to #implementedBySubclass in Java?<p>I have a design question. I have a class hierarchy:</p> <ul> <li>AbstractEntity</li> <li>NPC exte...
72,979,374
jq | use output from one command as input for another command<p>So I have the file <strong>employees.gz</strong> which is a stream of objects:</p> <pre><code>{ &quot;name&quot;: &quot;Billy&quot;, &quot;age&quot;: 43, &quot;team&quot;: &quot;Payments&quot;, &quot;id&quot;: 12345 } { &quot;name&quot;: ...
<p>You could do all of this in just one jq call. Load one file with <code>-s</code> or <code>--slurp</code> (as you already do), and the other one with <code>--slurpfile</code> to have it accessible as a variable. Then, use <code>JOIN</code> to combine by their IDs (one is a number, the other one a string, so use <code...
jq | use output from one command as input for another command
gzip|jq
0
71
1
72,981,921
72,981,921
2
true
2022-07-14T10:56:25.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jq | use output from one command as input for another command<p>So I have the file <strong>employees.gz</strong> which is a stream of objects:</p> <pre><code...
73,005,345
Plot 3d in Python<p>I wish to know how to plot a surface of type $(t,x,u=u(t,x))$ in Python. More precisely, $t,x$ are vectors and $u$ is a matrix that are initialized as np.zeros(), while the function plot does not draw the surface as I desire. Could someone help? The code is as follow:</p> <pre><code> eps=0.1 m=2000 ...
<p>You can plot that function like so:</p> <pre><code>import numpy as np import math import matplotlib.pyplot as plt from matplotlib import cm # ... your original code here ... def plot_surface_from_arrays(X, Y, Z, rotate=0): assert Y.shape + X.shape == Z.shape, &quot;X and Y shapes don't match Z&quot; X_mesh...
Plot 3d in Python
python
0
71
1
73,006,160
73,006,160
2
true
2022-07-16T15:15:30.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plot 3d in Python<p>I wish to know how to plot a surface of type $(t,x,u=u(t,x))$ in Python. More precisely, $t,x$ are vectors and $u$ is a matrix that are i...
72,884,048
Is there a way to remove trailing 0's from TimeSpan.Parse<p>I have a Timespan that is HH:mm:ss.fffffff e.g. 12:13:08.1265838 and I use this code to format the Timespan to one decimal place:</p> <pre><code>Duration = TimeSpan.Parse(stopEventOut.StopEventDateTime.Subtract(stopEventIn.StopEventDateTime).ToString(&quot;hh'...
<p>Your code seems to be subtracting two datetimes to produce a <code>TimeSpan</code>, then calling <code>.ToString()</code> to format the result, and then redundantly parsing the result back to a <code>TimeSpan</code> again. So you format the string of the internal timespan (<code>12:13:08.1265838</code>) to <code>&q...
Is there a way to remove trailing 0's from TimeSpan.Parse
c#|formatting|timespan
0
71
2
72,884,230
72,884,230
2
true
2022-07-06T13:02:01.880Z
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 remove trailing 0's from TimeSpan.Parse<p>I have a Timespan that is HH:mm:ss.fffffff e.g. 12:13:08.1265838 and I use this code to format th...
72,887,270
Reading Redis Timeseries is slower than Pandas with CSV<p>I'm using <strong>Redis Timeseries</strong> in order to read timeseries data that was previously stored in a CSV file.</p> <p><strong>The problem</strong>: Redis is far slower than Python Pandas reading the same set of data from Redis Server.</p> <p>I provide he...
<p>This is not a fair comparison!</p> <ul> <li><p>For Pandas, you are:</p> <ul> <li>writing a CSV (text file)</li> <li>reading the CSV back (text file)</li> </ul> </li> <li><p>For RedisTimeSeries, you are</p> <ul> <li>adding the samples using <a href="https://redis.io/commands/ts.add/" rel="nofollow noreferrer">TS.ADD<...
Reading Redis Timeseries is slower than Pandas with CSV
python|pandas|docker|redis
-1
71
1
72,889,086
72,889,086
2
true
2022-07-06T16:52:43.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading Redis Timeseries is slower than Pandas with CSV<p>I'm using <strong>Redis Timeseries</strong> in order to read timeseries data that was previously st...
72,801,408
Do we need two separate StandardScaler for the features and target?<p>So what I've understand is that <code>StandardScaler().fit_transform(X, y)</code> does not change the target feature (<code>y</code>). Meanwhile, for some algorithms (such as weight-based or distance-based) we also need to scale the target feature.</...
<ul> <li><em>Do we have to implement two <code>StandardScaler</code>, one for the features and another for the target feature?</em></li> </ul> <p>In general it's not necessary to scale target features. The only case it may be beneficial is in some cases of NN. Check this <a href="https://stats.stackexchange.com/questio...
Do we need two separate StandardScaler for the features and target?
python|scikit-learn
2
71
2
72,802,720
72,802,720
3
true
2022-06-29T12:24:55.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do we need two separate StandardScaler for the features and target?<p>So what I've understand is that <code>StandardScaler().fit_transform(X, y)</code> does ...
72,834,208
Parsing JSON object into a Map using Gson - JsonSyntaxException<p>I have a map property:</p> <pre><code>private Map&lt;String, Attribute&gt; attributes = new HashMap&lt;&gt;(); </code></pre> <p><code>Attribute</code> object looks like this:</p> <pre><code>public class Attribute{ private String value; private ...
<p>it is easy to check:</p> <pre><code> Map&lt;String,Attribute&gt; attributes = new HashMap&lt;&gt;(); attributes.put(&quot;key_0&quot;, new Attribute(&quot;value_0&quot;, &quot;name_0&quot;));// I added constructor and getter/setter methods to class Attribute attributes.put(&quot;key_1&quot;, new Attribute...
Parsing JSON object into a Map using Gson - JsonSyntaxException
java|json|hashmap|gson
-1
71
2
72,834,320
72,834,320
3
true
2022-07-01T20:09:48.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing JSON object into a Map using Gson - JsonSyntaxException<p>I have a map property:</p> <pre><code>private Map&lt;String, Attribute&gt; attributes = new...
72,831,629
Issue with Ibmmq docker container run<p><code>Context</code>: I have been running the NodeJS app with <a href="https://www.npmjs.com/package/ibmmq" rel="nofollow noreferrer">ibmmq</a> as an npm package. This service consumes msg with the help of ibmmq package. For running this app, I had built below docker file.</p> <p...
<p>Version 0.9.18 of the <code>ibmmq</code> package is about a year old. It had a default version of the MQ C client library to use of 9.2.3.0. IBM removes out-of-support versions of the Redist client from its download site, and with the recent release of 9.3.0, that site got cleaned up about a week ago. So the automat...
Issue with Ibmmq docker container run
node.js|docker|dockerfile|ibm-mq|message-queue
1
71
1
72,837,197
72,837,197
3
true
2022-07-01T15:38:48.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with Ibmmq docker container run<p><code>Context</code>: I have been running the NodeJS app with <a href="https://www.npmjs.com/package/ibmmq" rel="nofo...
72,916,331
Undefined behavior when reading from FIFO<p>I am trying to send data from javascript to C via a named pipe/FIFO. Everything seems to be working other than every couple messages there will be an additional iteration of the loop reading <code>0</code> bytes rather than the expected <code>256</code>. I realize I could add...
<p>A <code>read</code>or 0 bytes indicates the pipe was closed on the other end. So this is absolutely expected behavior.</p> <p>So you do have to catch that 0 and read again so the kernel waits for the next time the pipe is opened.</p> <p>Note: <code>read</code> can also return <code>-1</code> with errno set to <code>...
Undefined behavior when reading from FIFO
c++|c|ipc|named-pipes|mkfifo
1
71
2
72,917,630
72,917,630
3
true
2022-07-08T19:48:18.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Undefined behavior when reading from FIFO<p>I am trying to send data from javascript to C via a named pipe/FIFO. Everything seems to be working other than ev...
72,944,798
reassignment/move of std::future waits for existing future to complete<p>The main method below launches two <code>std::async</code>s. The future f in the main method is initially used to hold the future for the first async before being reassigned to the future of the second std::async. Both threads still appear to sti...
<p>This behavior is actually documented in <a href="https://en.cppreference.com/w/cpp/thread/future/%7Efuture" rel="nofollow noreferrer">std::future::~future</a>. Excerpt from the documentation below:</p> <blockquote> <ul> <li><p>these actions will not block for the shared state to become ready, except that it may bloc...
reassignment/move of std::future waits for existing future to complete
c++|multithreading|future|rvalue-reference
1
71
1
72,945,066
72,945,066
3
true
2022-07-11T21:22:06.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: reassignment/move of std::future waits for existing future to complete<p>The main method below launches two <code>std::async</code>s. The future f in the ma...
72,951,725
Implementing a generic interface for any type in a concrete class in C#<p>I want to do something like the following</p> <pre><code> public abstract class StaticValue : IRefDynamicValue&lt;RefT&gt; { public abstract int get(); public int get(RefT refValue) { return get(); ...
<p>Implement <code>IRefDynamicValue&lt;object&gt;</code>, and make <code>IRefDynamicValue</code> contravariant:</p> <pre><code>public abstract class StaticValue : IRefDynamicValue&lt;object&gt; // and also: public interface IRefDynamicValue&lt;in RefT&gt; </code></pre> <p>Now you can do:</p> <pre><code>IRefDynamicVal...
Implementing a generic interface for any type in a concrete class in C#
c#|generics
2
71
2
72,951,852
72,951,852
3
true
2022-07-12T11:41:23.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing a generic interface for any type in a concrete class in C#<p>I want to do something like the following</p> <pre><code> public abstract class ...
72,974,736
How can I decode and encode m%2Fs to m/s in .NET?<p>I have some units as &quot;m/s&quot;. But, in dotnet I get the value as &quot;m%2Fs&quot;. How can I decode and encode it back? I tried using the following but didn't work.</p> <pre><code>HttpUtility.HtmlDecode(&quot;m%2Fs&quot;); HttpUtility.HtmlEncode(&quot;m/s&quot...
<pre><code>using System.Web; Console.WriteLine(HttpUtility.UrlDecode(&quot;m%2Fs&quot;)); Console.WriteLine(HttpUtility.UrlEncode(@&quot;m/s&quot;)); </code></pre> <p>result</p> <pre><code>m/s m%2fs </code></pre>
How can I decode and encode m%2Fs to m/s in .NET?
c#|asp.net|.net
0
71
1
72,974,992
72,974,992
3
true
2022-07-14T03:03:54.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I decode and encode m%2Fs to m/s in .NET?<p>I have some units as &quot;m/s&quot;. But, in dotnet I get the value as &quot;m%2Fs&quot;. How can I deco...
72,841,592
Is there a logical algorithm to generate unique outputs for the given inputs?<p>I have a table of inputs that needs to output a unique formatted byte. The bytes outputted from the algorithm need to have only 1 bit on, giving 8 unique outputs. The inputs do not have to correlate with a specific output as long as each in...
<h2>18 bytes, 11 cycles</h2> <p>A small lookup table will be the smallest, fastest and don't forget most versatile solution to your question. You can easily change how these numbers map to each other.</p> <pre><code>LDX input ; 2 bytes, 3 cycles (Zero Page) LDA lookup,X ; 3 bytes, 5 cycles STA output ; 2 byt...
Is there a logical algorithm to generate unique outputs for the given inputs?
assembly|6502
2
71
3
72,929,814
72,929,814
3
true
2022-07-02T18:40:03.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a logical algorithm to generate unique outputs for the given inputs?<p>I have a table of inputs that needs to output a unique formatted byte. The by...
72,869,110
How to use stream not multiple foreach?<p>I have this two methods:</p> <pre><code>for (RuntimeProductOfferEntity productOfferEntity : eligibleOffers) { if (productOfferEntity.getSalesSubCategory().equalsIgnoreCase(nonBillable.getSubCategory()) &amp;&amp; Boolean.TRUE.equals(filterByChara...
<p>Not tested, but probably something like this :</p> <pre class="lang-java prettyprint-override"><code>private boolean filterByCharacteristcs(final RuntimeProductOfferEntity offer, final String duration) { return offer.getTemplates() .stream() .flatMap(template -&gt; template.getCharacteristics().s...
How to use stream not multiple foreach?
java
0
71
1
72,869,199
72,869,199
3
true
2022-07-05T12:01:26.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use stream not multiple foreach?<p>I have this two methods:</p> <pre><code>for (RuntimeProductOfferEntity productOfferEntity : eligibleOffers) { ...
72,788,746
NodaTime IANA TimeZone Offsets not matching in C#<p><strong>Date to convert :</strong> 12/10/2016 12:00:00 AM <strong>Time zone to convert :</strong> America/New_York</p> <p>This is my function to return offset of the date (dt) I provide.</p> <pre><code>LocalDateTime fromLocal = LocalDateTime.FromDateTime(dt); DateTime...
<blockquote> <p>When I google offset for America/New_York, I get -04 as offset.</p> </blockquote> <p>That would be true in the summer (and in particular it's the <em>current</em> offset at the time of your question), but not the winter (which would include 2016-12-10 - your &quot;12/10/2016&quot; is ambiguous in terms ...
NodaTime IANA TimeZone Offsets not matching in C#
c#|nodatime
1
71
1
72,811,111
72,811,111
3
true
2022-06-28T14:55:29.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodaTime IANA TimeZone Offsets not matching in C#<p><strong>Date to convert :</strong> 12/10/2016 12:00:00 AM <strong>Time zone to convert :</strong> America...
72,940,495
Why Tomcat server shows such a sawtooth graph even at rest?<p>Even if I didn't deploy anything under the webapps directory, my tomcat (apache-tomcat-8.5.63) server shows the heap memory usage here below.</p> <p>In my opinion 700 MB of memory seems to much for background tasks and at the same time using the <code>jstat ...
<p>700MB are allocate <em>over time</em> for background operation, because there is enough free memory to not trigger garbage collection. As it seems that all of the memory can be freed again, there's no need to worry or optimize anything: It's just doing its job, and the memory is freed when necessary (just not before...
Why Tomcat server shows such a sawtooth graph even at rest?
java|tomcat|garbage-collection|jvm|heap-memory
0
71
2
72,941,385
72,941,385
3
true
2022-07-11T14:53:38.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why Tomcat server shows such a sawtooth graph even at rest?<p>Even if I didn't deploy anything under the webapps directory, my tomcat (apache-tomcat-8.5.63) ...
72,786,658
Python merge 2 lists<pre><code>pricelist=[373, 381, 398, 402, 404, 457, 535, 550, 566] pricelist2=[97, 00, 98, 98, 98, 97, 99, 97, 98] </code></pre> <p>I would like to merge these 2 lists (strings) into the following :</p> <p><code>final_price=[373.97, 381.00, 398.98]</code> etc</p> <p>So join the prices together and a...
<p>You can use <a href="https://docs.python.org/3/library/functions.html#zip" rel="nofollow noreferrer"><code>zip</code></a> and a list comprehension:</p> <pre><code>pricelist=[373, 381, 398, 402, 404, 457, 535, 550, 566] pricelist2=[97, 0, 98, 98, 98, 97, 99, 97, 98] out = [a+b/100 for a,b in zip(pricelist, pricelist...
Python merge 2 lists
python|list
1
71
1
72,786,685
72,786,685
3
true
2022-06-28T12:42:41.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python merge 2 lists<pre><code>pricelist=[373, 381, 398, 402, 404, 457, 535, 550, 566] pricelist2=[97, 00, 98, 98, 98, 97, 99, 97, 98] </code></pre> <p>I wou...
72,806,654
dataframe to list of dictionary<p>I have the following df:</p> <pre><code>df = pd.DataFrame({&quot;year&quot;:[2020,2020,2020,2021,2021,2021,2022,2022, 2022],&quot;region&quot;:['europe','USA','africa','europe','USA','africa','europe','USA','africa'],'volume':[1,6,5,3,8,7,6,3,5]}) </code></pre> <p><a href="https://i.st...
<p>Another approach that uses pivot before <code>to_dict(orient='records')</code></p> <pre><code>df.pivot( index='year', columns='region', values='volume' ).reset_index().to_dict(orient='records') #Output: #[{'year': 2020, 'USA': 6, 'africa': 5, 'europe': 1}, # {'year': 2021, 'USA': 8, 'africa': 7, 'europe...
dataframe to list of dictionary
python|pandas|dictionary
2
71
4
72,806,823
72,806,823
4
true
2022-06-29T19:09:37.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dataframe to list of dictionary<p>I have the following df:</p> <pre><code>df = pd.DataFrame({&quot;year&quot;:[2020,2020,2020,2021,2021,2021,2022,2022, 2022]...
72,840,669
append only if item isn't already appended?<p>In my Python application, I have the following lines:</p> <pre><code>for index, codec in enumerate(codecs): for audio in filter(lambda x: x['hls']['codec_name'] == codec, job['audio']): audio['hls']['group_id'].append(index) </code></pre> <p>How can I only trigg...
<p>Simply test <code>if</code> your index <code>not in</code> your list:</p> <pre><code>for index, codec in enumerate(codecs): for audio in filter(lambda x: x['hls']['codec_name'] == codec, job['audio']): if index not in audio['hls']['group_id']: audio['hls']['group_id'].append(index) </code></p...
append only if item isn't already appended?
python
5
71
4
72,840,681
72,840,681
4
true
2022-07-02T16:26:02.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: append only if item isn't already appended?<p>In my Python application, I have the following lines:</p> <pre><code>for index, codec in enumerate(codecs): ...
72,930,365
How can one specify the value type for an OCaml map<p>I want to declare ahead of time the value type for a map type.</p> <p>The functor <code>Map.Make</code> returns a <code>Map.S</code> with two type definitions:</p> <pre><code>type key type !+'a t </code></pre> <p>Type <code>'a</code> appears to be the type of values...
<p>One way to look at this is that you're trying to impose monomorphism in the wrong place. The essence of Map.S is that it's polymorphic in the element type.</p> <p>You can easily define a type for maps from string keys to int values:</p> <pre><code># module M = Map.Make(String);; . . . # type string_int_mod = int M.t...
How can one specify the value type for an OCaml map
module|ocaml
1
71
1
72,930,740
72,930,740
4
true
2022-07-10T17:04:29.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can one specify the value type for an OCaml map<p>I want to declare ahead of time the value type for a map type.</p> <p>The functor <code>Map.Make</code>...
73,023,422
Perl upload dies when the file is compressed<p>I have a form designed for uploading multiple text files and therefore I have set the mime type in the HTML form to</p> <pre><code>enctype=&quot;multipart/form-data&quot; </code></pre> <p>I am using the following script</p> <pre><code>#!/usr/bin/env perl -wT use strict; u...
<p><code>:std</code> affects STDIN, STDOUT and STDERR, and STDIN is used to receive information from the web server.</p> <p>Either remove the encoding layer after adding it</p> <pre class="lang-perl prettyprint-override"><code>use open qw( :std :encoding(UTF-8) ); BEGIN { binmode( STDIN ); } </code></pre> <p>or avoid a...
Perl upload dies when the file is compressed
apache|perl|upload|mime-types
2
71
1
73,023,623
73,023,623
4
true
2022-07-18T13:48:47.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Perl upload dies when the file is compressed<p>I have a form designed for uploading multiple text files and therefore I have set the mime type in the HTML fo...
72,781,651
How does this discouraging Python one-liner that displays the mandlebrot set work?<p>Could you please explain how it works.</p> <p>In particular: where do <code>a</code>,<code>c</code>,<code>n</code>,<code>s</code>,<code>z</code> come from? And how to convert this to regular functions and their calls?</p> <pre><code>x=...
<p>This function <code> (lambda a: lambda z, c, n: a(a, z, c, n))</code> can be rewritten as</p> <pre><code>def apply_function_to_itself(funk): def inner(arg1, arg2, arg3): funk(funk, arg1, arg2, arg3) return inner </code></pre> <p>This is a functional thing that calls a function with itself as...
How does this discouraging Python one-liner that displays the mandlebrot set work?
python|python-3.x|one-liner
4
71
1
72,781,966
72,781,966
4
true
2022-06-28T06:29:02.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does this discouraging Python one-liner that displays the mandlebrot set work?<p>Could you please explain how it works.</p> <p>In particular: where do <c...
72,809,794
How to create an expression in C# from string?<p>There are methods in MongoDB C# driver (or any other libraries) that expect an expression only as a parameter like:</p> <pre><code>query.SortByDescending(x =&gt; x.Name) // sort by name for example </code></pre> <p>What I would like to do is to receive the field &quot;Na...
<p>This question basically has the same answer as <a href="https://stackoverflow.com/questions/72794815/how-can-i-materialize-a-string-to-the-actual-type">your question yesterday</a>.</p> <p>The reason the answer is essentially the same is simply that <code>FieldDefinition&lt;T&gt;</code> is implicitly castable from <c...
How to create an expression in C# from string?
c#|expression
0
71
1
72,809,949
72,809,949
4
true
2022-06-30T02:45:56.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create an expression in C# from string?<p>There are methods in MongoDB C# driver (or any other libraries) that expect an expression only as a paramete...
72,945,528
How to return the position of an odd number in a function?<p>Every time I try to run this code it just keeps returning <code>None</code>. It is my first time trying to implement <code>enumerate()</code> and have no clue how it functions. I have google videos on it but they don't really go in-depth as to how it really w...
<p>The problem has nothing to do with <code>enumerate</code>. Your function only returns a value if the <code>if num in seen</code> condition is <code>True</code>. In all other cases, it <em>implicitly</em> returns <code>None</code> because that's what happens in python with functions that don't explicitly return anyth...
How to return the position of an odd number in a function?
python|enumerate
-2
71
2
72,945,549
72,945,549
4
true
2022-07-11T23:13:33.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return the position of an odd number in a function?<p>Every time I try to run this code it just keeps returning <code>None</code>. It is my first time...
72,822,876
Password Regex - Identifying how a given regex works<p>I have been given a regex and I have to identify the meaning of it. I have partially understood it but using regex101 I found out it is using the positive lookahead, but I am not understanding how it's used in this specific case (since it's using the ? as well, whi...
<p>The regex engine maintains a pointer in the string. The pointer initially points to a location before the first character of the string. Later it may be moved to locations between two successive characters or to a location that follows the last character of the string.</p> <hr /> <p>The <em>anchor</em> <code>^</code...
Password Regex - Identifying how a given regex works
regex
0
71
2
72,824,677
72,824,677
4
true
2022-06-30T23:05:20.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Password Regex - Identifying how a given regex works<p>I have been given a regex and I have to identify the meaning of it. I have partially understood it but...
72,853,263
Element is disappearing from HTML<p>I have a website where I can add questions, I can add many questions and many options to every question.</p> <p>My problem is that when I try to add a 2nd option to any question, the whole webpage refreshes and all my elements are disappearing.</p> <p>I have no idea why, I have tried...
<p>If you click a <code>&lt;button&gt;</code> when inside a <code>&lt;form&gt;</code> element then the form will submit. See this example:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-overr...
Element is disappearing from HTML
javascript|html|css
5
71
1
72,853,538
72,853,538
5
true
2022-07-04T07:40:59.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Element is disappearing from HTML<p>I have a website where I can add questions, I can add many questions and many options to every question.</p> <p>My proble...
72,932,914
(Edit) I wrote same code with Swift and C lang(Find Prime number), but C lang is much faster then Swift<p>(There has some Edit in below)<br> Well, I wrote exactly the same code with Swift and C lang. It's a code to find a Prime number and show that.<br> I expect that Swift lang's Code is much faster than C lang's progr...
<h2>The fundamental cause</h2> <p>As with most of these &quot;why does this same program in 2 different languages perform differently?&quot;, the answer is almost always: &quot;because they're not the same program.&quot;</p> <p>They might be similar in high-level intent, but they're implemented differently enough that ...
(Edit) I wrote same code with Swift and C lang(Find Prime number), but C lang is much faster then Swift
c|swift|performance|calculation
3
71
2
72,933,027
72,933,027
5
true
2022-07-11T01:22:24.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (Edit) I wrote same code with Swift and C lang(Find Prime number), but C lang is much faster then Swift<p>(There has some Edit in below)<br> Well, I wrote ex...
72,945,117
async Exception swallowed in while(true) loop<p>I noticed I was not getting logging messages in my app when some new async code was throwing an error. I have an app that kicks off a small number of indefinitely-running async tasks. Each of them runs their own <code>while(true)</code> loop.</p> <p>I have some error log...
<p><code>Task.WhenAll</code> will (asynchronously) wait for all tasks to complete. If one of them completes with an exception, then it will still wait for the other tasks to complete before (re)throwing the exception.</p> <p>With the <code>while (true)</code> in place, one of the tasks has completed with an exception a...
async Exception swallowed in while(true) loop
c#|exception|async-await
2
71
1
72,945,639
72,945,639
6
true
2022-07-11T22:03:42.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: async Exception swallowed in while(true) loop<p>I noticed I was not getting logging messages in my app when some new async code was throwing an error. I have...
72,771,368
Create a pdf file with the content of a list in C#<p>I am trying to create a pdf file with the content of a list.</p> <p><strong>I created the list this way:</strong></p> <pre><code> int arrayLength = obj.records.Count; List&lt;string&gt; outPutList = new List&lt;string&gt;(); ...
<p>As I mentioned in the comments, you overwrite the value of the <code>str</code> variable. What you want to do is the following: (I added an extra variable for you to understand the difference between the <code>=</code> and the <code>+=</code> operators):</p> <pre class="lang-cs prettyprint-override"><code>int arrayL...
Create a pdf file with the content of a list in C#
c#|list|visual-studio|pdf
0
72
1
72,771,860
72,771,860
0
true
2022-06-27T11:30:41.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a pdf file with the content of a list in C#<p>I am trying to create a pdf file with the content of a list.</p> <p><strong>I created the list this way:...
72,776,820
How to filter an array of objects storing only once for each matched item<p>I'm working with Javascript, and have the following array of objects:</p> <pre><code>const offersStep = [ {a: 1, price: 67.10}, {a: 3, price: 88.20}, {a: 5, price: 88.20}, {a: 7, price: 57.10}, {a: 13, price: 57.10}, ...
<p>Use iteration to determine if previously saved prices match the current object being iterated.</p> <pre><code>const offersStep = [ {a: 1, price: 67.10}, {a: 3, price: 88.20}, {a: 5, price: 88.20}, {a: 7, price: 57.10}, {a: 13, price: 57.10}, {a: 15, price: 57.10}, {a: 29, price: 5...
How to filter an array of objects storing only once for each matched item
javascript
0
72
8
72,777,163
72,777,163
0
true
2022-06-27T18:28:29.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter an array of objects storing only once for each matched item<p>I'm working with Javascript, and have the following array of objects:</p> <pre><c...