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,372,844
how to avoid multiple joins in a single query in CodeIgniter<p>this is my code</p> <pre><code>$this-&gt;db-&gt;select('custome_module.id, custome_module.name, min(l1.nmark_completed) as call_waiter, min(l2.nmark_completed) as bill,min(l3.nmark_completed) as tray,min(l4.nmark_completed) as ordera'); $this-&gt;db-&gt;fro...
<p>EAV is a clumsy and inefficient schema pattern. Condolences.</p> <p>This will help performance <em>some</em>:</p> <pre><code>INDEX(nmodule_id, ntype) </code></pre>
how to avoid multiple joins in a single query in CodeIgniter
php|mysql|codeigniter|codeigniter-3|entity-attribute-value
0
60
1
72,384,009
72,384,009
0
true
2022-05-25T06:30:06.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to avoid multiple joins in a single query in CodeIgniter<p>this is my code</p> <pre><code>$this-&gt;db-&gt;select('custome_module.id, custome_module.name...
72,374,710
Xamarin NullReferenceException when calling 'Finish()' on activity<p>I created a biometric authentication service that starts an activity and registers a callback to a static <code>EventHandler</code> for the result.</p> <p>The handler:</p> <pre><code>public class BiometricHandler : IBiometricHandler { private Task...
<p>Well, it seems like the issue is an asynchronous race condition. <code>Finish()</code> takes a bit longer to complete than the service to return the data.</p> <p>Then the content page tries to perform a UI event, and since <code>Finish()</code> hasn't finished yet, the activity is still &quot;visible&quot; and the c...
Xamarin NullReferenceException when calling 'Finish()' on activity
xamarin|xamarin.android
0
60
1
72,392,590
72,392,590
0
true
2022-05-25T09:02:21.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xamarin NullReferenceException when calling 'Finish()' on activity<p>I created a biometric authentication service that starts an activity and registers a cal...
72,385,464
Skyfield returning incorrect latitude and longitude coordinates?<p>I'm trying to make a program which takes latitude and longitude coordinates of the ISS (from the <a href="https://rhodesmill.org/skyfield/" rel="nofollow noreferrer">Skyfield API</a>) and plots it onto a scatterplot (using matplotlib) to show its estima...
<p>Happily, Skyfield makes decimal degrees directly available for longitude and latitude, so there is no need for you to parse a string. Both longitude and latitude are instances of the <code>Angle</code> class, according to the documentation here:</p> <p><a href="https://rhodesmill.org/skyfield/api-topos.html#skyfield...
Skyfield returning incorrect latitude and longitude coordinates?
python|matplotlib|math|coordinates|skyfield
0
60
1
72,396,159
72,396,159
0
true
2022-05-26T00:32:47.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Skyfield returning incorrect latitude and longitude coordinates?<p>I'm trying to make a program which takes latitude and longitude coordinates of the ISS (fr...
72,398,064
Understanding .NET compilation<p>As far as I understand .NET concepts, the source code is first translated into an Assembly (IL code+meta data), which is compiled to machine code on the target machine with the CLR's JIT compiler. However I cannot really match these concepts to what I see when working on a C# project. W...
<p>There is no assembly code in .net assemblies.</p> <p>.Net programs are converted to a .NET Assembly, which is an .exe or .dll that contains intermediate bytecode. See CIL</p> <p>Visual Studio will place the .NET Assemblies in your project's /bin or /bin/Release). You can change this path.</p> <p>The dll or .exe are...
Understanding .NET compilation
c#|.net|compilation|jit
-2
60
2
72,398,327
72,398,327
0
true
2022-05-26T21:13:29.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding .NET compilation<p>As far as I understand .NET concepts, the source code is first translated into an Assembly (IL code+meta data), which is com...
72,397,441
Is there another way to click on a menu item with Capybara<p>Friends try anyway but it is not being possible to click on the Gestão de Materiais Menu item. One situation I need is to scroll this menu to view and click on the item menu. But I'm not sure why he is clicking on the menu item below I tried using SitePrism a...
<p>There is no point in trying Capybara and SitePrism, SitePrism uses capybara so if capybaras click doesn't work for you then SitePrism isn't going to either.</p> <p>It's very hard to tell what is going on here because your screen shots have popups over the structure of the page, also screen shots make it much harder ...
Is there another way to click on a menu item with Capybara
ruby|capybara
0
60
1
72,411,536
72,411,536
0
true
2022-05-26T20:03:07.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there another way to click on a menu item with Capybara<p>Friends try anyway but it is not being possible to click on the Gestão de Materiais Menu item. O...
72,379,845
Passing parcelized Kotlin data class from activity to activity does not persits data<p>I tried to pass a class between activities using parcelize. For this I got A class which has other classes as members:</p> <pre><code>@Parcelize class Entry(var uid_sensor: String = &quot;No-Id&quot;, val firstConfig: fConfig= fConfi...
<p>From - <a href="https://developer.android.com/kotlin/parcelize" rel="nofollow noreferrer">developer.android.com</a></p> <blockquote> <p>@Parcelize requires all serialized properties to be declared in the primary constructor. The plugin issues a warning on each property with a backing field declared in the class body...
Passing parcelized Kotlin data class from activity to activity does not persits data
android|kotlin|parcelable
0
60
1
72,430,017
72,430,017
0
true
2022-05-25T14:49:13.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing parcelized Kotlin data class from activity to activity does not persits data<p>I tried to pass a class between activities using parcelize. For this I...
72,337,723
I just started c++ and made a calculator. What or how can I improve my code/ learn more?<p>So I tried making a simple calculator that can input 2 floats and do basic operations (addition, subtraction, division, multiplication). This is the first time I'm writing a code without copying the entire thing from a tutorial. ...
<ul> <li><p>function don't need to return <code>0</code>, simply declare those as <code>void</code> return.</p> <ul> <li>except <code>int main()</code></li> </ul> </li> <li><p>the <code>cin&gt;&gt;num; while(!cin){cin&gt;&gt;num;}</code> can be merged as <code>while(!(cin&gt;&gt;num))</code></p> </li> <li><p>ignore <co...
I just started c++ and made a calculator. What or how can I improve my code/ learn more?
c++|function|calculator
1
60
2
72,338,137
72,338,137
0
true
2022-05-22T12:48:00.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I just started c++ and made a calculator. What or how can I improve my code/ learn more?<p>So I tried making a simple calculator that can input 2 floats and ...
72,297,708
How to stop/start css animation<h1>How to stop/start CSS animation</h1> <h2>Background-Info</h2> <p>I'm trying to make a loader for my website where when someone makes a search to my API it will popup the loader then after the table gets built it will stop the loading animation. I'm not good with javascript and I'm jus...
<p>Your question is not very clear on when you want to start and stop the loader but from my understanding you have an api and you want the loader to show when someone calls your api so in this particular case you want to work with DOM event listeners <em>(at least when you start your search by a click of a button or ...
How to stop/start css animation
javascript|html|css
0
60
2
72,297,956
72,297,956
0
true
2022-05-19T01:36:20.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to stop/start css animation<h1>How to stop/start CSS animation</h1> <h2>Background-Info</h2> <p>I'm trying to make a loader for my website where when som...
72,250,305
python normalizing fixing string<p>I have a log file that contain unstructured entries like this</p> <pre><code>[roomID=19, description=ZZZZ, requesterCode=20, result=-1, errors=[[code=1, text=XXXXXXrequestID=/1540], flow=10:1] [remote=0.0.0.0, host=xxx] [roomID=19, description=ZZZZ, requesterCode=20, result=-1, errors...
<p>Using the <a href="https://docs.python.org/3.9/library/re.html" rel="nofollow noreferrer"><code>re</code></a> from the standard library you can perform more complex text manipulations.</p> <p>The important is to identify properly your patterns.</p> <ul> <li><code>=[[</code> --&gt; <code>={</code></li> <li><code> [</...
python normalizing fixing string
python|string|parsing
0
60
1
72,250,544
72,250,544
0
true
2022-05-15T16:48:17.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python normalizing fixing string<p>I have a log file that contain unstructured entries like this</p> <pre><code>[roomID=19, description=ZZZZ, requesterCode=2...
72,345,760
How to establish the connection to SAP Solution Manager using Azure data factory<p>I have a requirement to extract the data SAP solution manager to azure blob using ADF as ETL tool. I do not find any direct connector to create a linked services on source(SAP SOLUTION MANAGER).</p> <p>Please advice me how to create link...
<p>Here is a <a href="https://docs.microsoft.com/en-us/azure/data-factory/copy-activity-overview#supported-data-stores-and-formats" rel="nofollow noreferrer">list</a> of supported data stores and formats in Azure Data Factory</p> <blockquote> <p>How to create linked services to SAP solution manager using ADF</p> </bloc...
How to establish the connection to SAP Solution Manager using Azure data factory
azure-data-factory|sap-solution-manager
0
60
1
72,348,110
72,348,110
0
true
2022-05-23T08:53:55.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to establish the connection to SAP Solution Manager using Azure data factory<p>I have a requirement to extract the data SAP solution manager to azure blo...
72,385,262
Press a button from popup window with selenium<pre><code>import time from selenium import webdriver from selenium.webdriver.common.by import By chrome_options = webdriver.ChromeOptions() prefs = {&quot;profile.default_content_setting_values.notifications&quot;: 2} chrome_options.add_experimental_option(&quot;prefs&quo...
<p>Right-click on the element and go to Copy &gt; Copy (full) xpath.</p> <p>Then use:</p> <pre><code>from selenium.webdriver.common.by import By driver.find_elements(By.XPATH, 'xpath_value_here') </code></pre> <p>Edited to reflect the difference between 'copy xpath' and 'copy full xpath'; indeed, copy full xpath i...
Press a button from popup window with selenium
python|selenium
0
60
1
72,385,423
72,385,423
0
true
2022-05-25T23:54:41.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Press a button from popup window with selenium<pre><code>import time from selenium import webdriver from selenium.webdriver.common.by import By chrome_optio...
72,337,135
why link doesn't work when I use getStaticProps?<p>I'm new in next js and I'm working on project using NextJS. I have some lots in my items page that shows lots currently(<code>pagination/items.tsx</code>) and I also have <code>lotDetails</code> page that I want it to show details of each lot using dynamic route(<code>...
<p>Finally, I solved problem in two steps:</p> <p>1-I'm using google chrome browser, so I configured chrome and added my localhost port:</p> <p>I used this link: chrome://inspect/, clicked configure button and added my localhost port(in my case localhost:3000)</p> <p>2-I added this code to lotDetails page(the page whic...
why link doesn't work when I use getStaticProps?
reactjs|next.js
0
60
1
72,357,438
72,357,438
0
true
2022-05-22T11:25:40.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why link doesn't work when I use getStaticProps?<p>I'm new in next js and I'm working on project using NextJS. I have some lots in my items page that shows l...
72,257,871
Issues with an Array.forEach<p>Hope someone here would be able to help me out.</p> <p>I am trying to build an Owl-Carousel from an array of objects. but for some reason the array is not been recognized, would appreciate if someone could help to find the mistake I have made here.</p> <p>The error messages I am getting i...
<p>Any expression Javascript should be inside curly brackets &quot;{}&quot; and replace forEach by map cause forEach doesn't return anything and I notice that you use a function and doesn't return anything to fix this you can add return before OwlCarousel component or use arrow function with parentheses.</p> <pre><code...
Issues with an Array.forEach
javascript|reactjs|foreach|owl-carousel
0
60
2
72,257,972
72,257,972
0
true
2022-05-16T10:36:58.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issues with an Array.forEach<p>Hope someone here would be able to help me out.</p> <p>I am trying to build an Owl-Carousel from an array of objects. but for ...
72,243,858
Delete empty lines in file<p>I'm trying to delete empty lines from a file. Currently it deletes all except for the one I add at line 35:<code>out_file &lt;&lt; data_vector[i] &lt;&lt; &quot;\n&quot;;</code></p> <p>How do I exclude the last <code>&quot;\n&quot;</code> so it doesn't add a new line?</p> <p>Here's the full...
<p>It's best practice (on most Operating Systems), and expected by a lot of file processing tools, to have a newline at the end of every line in a file, so you normally wouldn't want to remove the final newline... consider it a line termination character with no line after it, rather than a line separator with an impli...
Delete empty lines in file
c++
0
60
2
72,244,312
72,244,312
0
true
2022-05-14T21:06:21.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete empty lines in file<p>I'm trying to delete empty lines from a file. Currently it deletes all except for the one I add at line 35:<code>out_file &lt;&l...
72,277,312
Is there a way to change the Business Date through BLC code?<p>Can I change the business date through BLC code? I know it's in the AccessInfo DAC (AccessInfo.businessDate).</p> <p>Thanks...</p>
<p>The static <code>PXContext</code> has a public static method called <code>SetBusinessDate</code>, You can use that method to change the Business Date.</p> <pre><code>public static void SetBusinessDate(DateTime? date) { PXContext.PXIdentity.BusinessDate = date; } </code></pre> <p>You can simply call PXContext.Set...
Is there a way to change the Business Date through BLC code?
acumatica
0
60
1
72,282,814
72,282,814
0
true
2022-05-17T16:04:12.613Z
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 change the Business Date through BLC code?<p>Can I change the business date through BLC code? I know it's in the AccessInfo DAC (AccessInf...
72,339,495
Convert strings with a "-" (En Dashes) into a floats<p>I would like to convert strings of a Pandas DataFrame into floats. The strings contain &quot;-&quot; (En Dashes), which I believe have prevented me from performing this task.</p> <p>My DataFrame (df) looks like:</p> <pre><code>Name LONGITUDE LATITUDE 0 alta ...
<p>How i thought the string should be made to floats.</p> <pre class="lang-py prettyprint-override"><code>import pandas as pd df = pd.DataFrame( { &quot;Name&quot;: [&quot;alta floresta d'oeste&quot;, &quot;ariquemes&quot;], &quot;LONGITUDE&quot; : [&quot;-61.999.824&quot;, &quot;-1.193.554&quot;],...
Convert strings with a "-" (En Dashes) into a floats
python
0
60
1
72,339,856
72,339,856
0
true
2022-05-22T16:42:52.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert strings with a "-" (En Dashes) into a floats<p>I would like to convert strings of a Pandas DataFrame into floats. The strings contain &quot;-&quot; (...
72,244,749
I want to combine the objects in the array, how should I change them?<pre class="lang-js prettyprint-override"><code>const data = [ { productId: 6, productName: &quot;pouch&quot;, productPrice: 29000, discountRate: 19, optionName: &quot;13inch&quot;, optionPrice: 0, qty: 2, }, { pr...
<p>One method is to convert array into object, and use <code>productId</code> as key:</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 = [ { productId: 6, p...
I want to combine the objects in the array, how should I change them?
javascript|arrays|object|reduce
-5
60
3
72,244,890
72,244,890
0
true
2022-05-15T00:30:47.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to combine the objects in the array, how should I change them?<pre class="lang-js prettyprint-override"><code>const data = [ { productId: 6, ...
72,316,340
Unable to replace an existing column basis on another column<p>Below are two dataframes. The dataframe df1 is a cleanfile which has to be used as the mapping file to another dataframe df2 which has uncleaned information.</p> <pre class="lang-py prettyprint-override"><code> df1=pd.DataFrame({'Make': {0: 'ASHOK LEYLAN...
<p>You could use a regular expression to match a given set of &quot;allowed&quot; names to the the defective values and extract only the matched part. Note that following solution will only cover the situation in which the defective names have correct prefixes.</p> <pre><code>import re def clean_col(correct_names_expr...
Unable to replace an existing column basis on another column
python|regex
1
60
2
72,316,466
72,316,466
0
true
2022-05-20T09:09:00.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to replace an existing column basis on another column<p>Below are two dataframes. The dataframe df1 is a cleanfile which has to be used as the mapping...
72,349,827
create and save dataframes from other dataframe<p>An extract from my df (35k rows in total):</p> <pre><code>stop_id time 7909 2022-04-06T03:47:00+03:00 7909 2022-04-06T04:07:00+03:00 1009413 2022-04-06T04:10:00+03:00 1002246 2022-04-06T04:19:00+03:00 1009896 2022-04-06T04:20:00+03:00 </code><...
<p>You can use a <code>group_by</code> on both <code>stop_id</code> and <code>time</code> and use the <code>size()</code> aggregation to get what will be the <code>number</code> column in each Data Frame. After that, you can filter all the unique <code>stop_id</code> and iterate over each group to construct the single ...
create and save dataframes from other dataframe
python|pandas|dataframe
2
60
1
72,352,040
72,352,040
0
true
2022-05-23T13:58:25.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create and save dataframes from other dataframe<p>An extract from my df (35k rows in total):</p> <pre><code>stop_id time 7909 2022-04...
72,388,413
Sort a list based on a condition<p>I take a string as an input example:</p> <pre><code>ansible-playbook foo.yml -i bar.ini -e flags=valuea,valueb </code></pre> <p>i have a dict as a var</p> <pre><code>sample_dict: { 1: [&quot;valuea&quot;], 2: [&quot;valueb&quot;, &quot;valuec&quot;] } </code></pre> <p>I want to so...
<p>Let me rephrase your question. Given the dictionary</p> <pre class="lang-yaml prettyprint-override"><code>sample_dict: 1: [C] 2: [B, X] 3: [A] </code></pre> <p>sort a comma-separated string according to the values of the dictionary. For example, given the string <em><code>flags='X,C'</code></em>, the expected ...
Sort a list based on a condition
ansible
0
60
1
72,390,599
72,390,599
0
true
2022-05-26T07:43:37.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort a list based on a condition<p>I take a string as an input example:</p> <pre><code>ansible-playbook foo.yml -i bar.ini -e flags=valuea,valueb </code></pr...
72,316,965
gnupg fingerprint not identified as valid recipient for encryption<p>gnupg fingerprint of key is not identified as valid recipient for encryption. According to this doc <a href="https://pythonhosted.org/python-gnupg/#encryption" rel="nofollow noreferrer">https://pythonhosted.org/python-gnupg/#encryption</a> we can use ...
<p>If you were to attempt the same process from the command line, you would see the following error when attempting to encrypt a message to the recipient (<code>gpg -ea -r &lt;fingerprint&gt;</code>):</p> <pre><code>It is NOT certain that the key belongs to the person named in the user ID. If you *really* know what yo...
gnupg fingerprint not identified as valid recipient for encryption
python|gnupg|python-gnupgp
0
60
1
72,318,162
72,318,162
0
true
2022-05-20T09:57:28.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gnupg fingerprint not identified as valid recipient for encryption<p>gnupg fingerprint of key is not identified as valid recipient for encryption. According ...
72,360,500
How to create a prepared statement to replace mysqli_query?<p>I am trying to turn this section of SQL query into a prepared statement but it has related functions calling its results so am having a hard time tying it all up so here is</p> <p>This is the SQL statement:</p> <pre><code>{ $name = explode(' ', $key, 2);...
<p>You can simplify the whole process if you start by loading 2 vars before starting the query with the right values from your <code>$name</code> array.</p> <p>Then a simple change to the query to make it parameterised and bindable will allow you to prepare, bind and execute the query</p> <p>Then a small change to the ...
How to create a prepared statement to replace mysqli_query?
php|mysql|mysqli
1
60
2
72,360,685
72,360,685
0
true
2022-05-24T09:31:19.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a prepared statement to replace mysqli_query?<p>I am trying to turn this section of SQL query into a prepared statement but it has related func...
72,313,390
The method 'setState' isn't defined for the type 'NasabahDataTableSource'<p>I want to use setState method in class &quot;NasabahDataTableSource&quot; but when i use setState in this class cannot work and Error: The method 'setState' isn't defined for the class 'NasabahDataTableSource'.</p> <ul> <li>'NasabahDataTableSou...
<p>You can not use <code>setState()</code> without <code>StatefulWidget</code>. I suggest you to use <code>Function</code> to pass your action and notify to rebuild UI using <code>setState()</code>. Need little bit modification on your code.</p> <ol> <li>Add <code>Function</code> parameter to your <code>NasabahDataTabl...
The method 'setState' isn't defined for the type 'NasabahDataTableSource'
flutter|setstate
0
60
2
72,313,569
72,313,569
0
true
2022-05-20T03:50:50.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The method 'setState' isn't defined for the type 'NasabahDataTableSource'<p>I want to use setState method in class &quot;NasabahDataTableSource&quot; but whe...
72,296,645
send data from a fragment to an activity xamarin android<p>I'm sorry I'm using google translate.</p> <p>I am trying to send data from a Fragment to an Activity with no success, the purpose of this is to update a TextView. I can't validate that the Intent brings the data and if I eliminate the validation they have a nul...
<p>I was able to solve it on my own, although my solution does not completely convince me, I'll post it in case someone has the same problem as me.</p> <p>Fragment</p> <pre><code>//add the activity reference to the fragment using static GumisaAPP.Activities.BaseActivity; //we create the procedure that will be in char...
send data from a fragment to an activity xamarin android
android|xamarin|android-intent|android-activity|fragment
1
60
2
72,311,352
72,311,352
0
true
2022-05-18T22:24:40.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: send data from a fragment to an activity xamarin android<p>I'm sorry I'm using google translate.</p> <p>I am trying to send data from a Fragment to an Activi...
72,388,690
Multiple Counters in XSLT<p>I need to maintain 2 counters in my xslt - EntryID and RowID. I have a xml which contains Name and Certifications the person holds. Now I need to maintain one counter for each person (EntryID) and one for each certification (RowID). And on top of the certifications, I need to add one more ce...
<p>The XML result you show can be produced quite easily using:</p> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:wd=&quot;urn:com.workday.report/bsvc&quot; exclude-result-prefixes=&quot;wd&quot;&gt; &lt;xsl:output...
Multiple Counters in XSLT
xslt|counter|xslt-3.0
0
60
2
72,390,911
72,390,911
0
true
2022-05-26T08:06:15.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple Counters in XSLT<p>I need to maintain 2 counters in my xslt - EntryID and RowID. I have a xml which contains Name and Certifications the person hold...
72,240,325
Returning the SelHeight Property Value of a subform<p>I have a subform in a form and I want to pick up the value of one field in a user selected record in the subform and populate a field in my form using that value.</p> <p>I am using .Selheight to determine the number of records selected in the subform. The code goes ...
<p>The selected records will be deselected as soon as you leave the subform.</p> <p>This works for me with a main form to display the count of selected records:</p> <pre class="lang-vb prettyprint-override"><code>Option Compare Database Option Explicit Private Sub Form_Current() Me!txtSelected.Value = Me.SelHeig...
Returning the SelHeight Property Value of a subform
vba|forms|ms-access
2
60
1
72,241,470
72,241,470
1
true
2022-05-14T12:44:22.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Returning the SelHeight Property Value of a subform<p>I have a subform in a form and I want to pick up the value of one field in a user selected record in th...
72,249,652
Relation in sqlalchemy<p>I Use sqlalchemy ORM and pydantic<br /> I have the following simple table</p> <pre><code>class Parent(Base): __tablename__ = 'parents' id = Column(Integer, primary_key=True, nullable=False) children = relationship( &quot;Child&quot;, backref=&quot;parent&quot;, ...
<p>You need to do a join between your parent table and your child table to do a filter on the child.</p> <pre class="lang-py prettyprint-override"><code>parents = db.query(Parent).join(Child, Child.parent.id == Parent.id).filter(Child.age &lt; 18).all() </code></pre>
Relation in sqlalchemy
python|sqlalchemy|fastapi|pydantic
2
60
1
72,251,007
72,251,007
1
true
2022-05-15T15:26:14.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Relation in sqlalchemy<p>I Use sqlalchemy ORM and pydantic<br /> I have the following simple table</p> <pre><code>class Parent(Base): __tablename__ = 'pa...
72,242,822
Set "selected" tag in responsive dropdown and select using Flask and jinja2<p>I have a flask server which sends a dictionary of options to a dropdown or selection (in form).</p> <p>Here is the Python code:</p> <pre class="lang-py prettyprint-override"><code>@app.route(&quot;/&quot;, methods=['GET']) def index_get(): ...
<p>Once you have passed your desired options to the view, via</p> <pre class="lang-py prettyprint-override"><code>return flask.render_template(&quot;index.html&quot;, options=options, selected='o2') </code></pre> <p>You just have to make a condition that would assert if the <code>selected</code> variable is the same as...
Set "selected" tag in responsive dropdown and select using Flask and jinja2
python|html|python-3.x|flask|jinja2
1
60
1
72,251,369
72,251,369
1
true
2022-05-14T18:12:50.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set "selected" tag in responsive dropdown and select using Flask and jinja2<p>I have a flask server which sends a dictionary of options to a dropdown or sele...
72,254,751
How can I join two tables using JPA?<p>I have two entity classes <strong>Medicine</strong> and <strong>Medicine Group</strong>. A medicine belongs to a group . A group has more than one medicine. The relationship from medicine to group is <strong>one to one</strong> from group to medicine is <strong>one to many</strong...
<p>Simple join on the attribute:</p> <pre><code>SELECT m.medicineId ,m.medicineName ,m.inStock ,m.lifetimeSupply, m.lifetimeSales, m.howToUse, m.sideSffects , mg.groupName FROM medicine m join m.medicineGroup mg; </code></pre> <p>and use attribute names, not column names</p>
How can I join two tables using JPA?
java|mysql|spring-boot|jpa
1
60
2
72,254,782
72,254,782
1
true
2022-05-16T06:07:59.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I join two tables using JPA?<p>I have two entity classes <strong>Medicine</strong> and <strong>Medicine Group</strong>. A medicine belongs to a group...
72,261,587
Error with different versions of the same package Flutter<p>How to fix this error?</p> <pre><code>Because syncfusion_flutter_charts &gt;=20.1.55 depends on syncfusion_flutter_core ^20.1.55 and syncfusion_flutter_pdfviewer 19.4.56-beta depends on syncfusion_flutter_core ^19.4.56, syncfusion_flutter_charts &gt;=20.1.55 i...
<p>Best way is update your <code>syncfusion_flutter_pdfviewer</code> to <code>20.1.55-beta</code>, but if you still need to use current version, you can override in pubspec.yaml file :</p> <pre><code>dependency_overrides: syncfusion_flutter_core: ^20.1.55 </code></pre>
Error with different versions of the same package Flutter
flutter|dart
0
60
1
72,261,673
72,261,673
1
true
2022-05-16T15:19:04.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error with different versions of the same package Flutter<p>How to fix this error?</p> <pre><code>Because syncfusion_flutter_charts &gt;=20.1.55 depends on s...
72,265,343
Algorithm for calculating primes in an interval not working<p>I am trying to come up with an algorithm that can find all primes from a starting to an ending number, without starting at 2 and using the Sieve of Eratosthenes to calculate all primes to the ending number and cutting out the interval I want. And not brutefo...
<p>For your specific use case, 19 was getting overwritten by False. I've added a little fallback / sanity check before the second loop starts. You can see what's happening via my <code>print</code> logs:</p> <pre><code>def m(n: int, l: list): # set i to its max value broke_out = False for i, v in enumerate(...
Algorithm for calculating primes in an interval not working
python|primes|sieve-of-eratosthenes
2
60
1
72,265,548
72,265,548
1
true
2022-05-16T20:37:01.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Algorithm for calculating primes in an interval not working<p>I am trying to come up with an algorithm that can find all primes from a starting to an ending ...
72,261,762
Find local maxima index of element not surrounded by zeros<p>I am trying to identify the indexes of local maxima not surrounded by zeros of a 1D numpy array.</p> <p>The original code is:</p> <pre><code>max_idx = [ i for i in range(1, len(elem_array) - 1) if ((elem_array[i - 1] &lt; elem_array[i]) and (elem_arra...
<p>A loop like this is pretty straightforward to vectorize:</p> <pre class="lang-python prettyprint-override"><code>mask = ( (elem_array[:-2] &lt; elem_array[1:-1]) &amp; (elem_array[2:] &lt;= elem_array[1:-1]) &amp; ((elem_array[:-2] != 0) | (elem_array[2:] != 0)) ) max_idx = np.nonzero(mask)[0] + 1 </code...
Find local maxima index of element not surrounded by zeros
python|numpy|scipy
1
60
2
72,267,038
72,267,038
1
true
2022-05-16T15:31:10.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find local maxima index of element not surrounded by zeros<p>I am trying to identify the indexes of local maxima not surrounded by zeros of a 1D numpy array....
72,267,944
how to wrap buttons and expand to parent width on wrap<p>I want a responsive expanded buttons when wrapped from a small screen.</p> <p>This is how the 'emergency contact' and 'book again' button should look like when it can fit on the screen: (Ex: iPhone 13 Pro Max):</p> <p><img src="https://i.stack.imgur.com/Js69k.png...
<p>I usually use <code>LayoutBuilder</code> with the const sizes found on the internet to make it responsive.</p> <p>Example:</p> <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart'; const i13w = 1284.0; // Big screen (Iphone 13 promax width) const i8w = 750.0; // Small screen (Iph...
how to wrap buttons and expand to parent width on wrap
flutter|dart
0
60
2
72,268,269
72,268,269
1
true
2022-05-17T03:39:44.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to wrap buttons and expand to parent width on wrap<p>I want a responsive expanded buttons when wrapped from a small screen.</p> <p>This is how the 'emerg...
72,268,675
Replacing zeros with mean of each customer<p>I want to write a function that replace all zeros with the mean of each customer category.</p> <p>for example (before):</p> <p><a href="https://i.stack.imgur.com/Y6wQo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y6wQo.png" alt="enter image description ...
<p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.transform.html" rel="nofollow noreferrer"><code>GroupBy.transform</code></a> for means per groups and replace missing values by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFr...
Replacing zeros with mean of each customer
python|pandas|for-loop
1
60
3
72,269,513
72,269,513
1
true
2022-05-17T05:39:06.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing zeros with mean of each customer<p>I want to write a function that replace all zeros with the mean of each customer category.</p> <p>for example (b...
72,260,962
How to add Buttons in Title Bar in PWA (Web Apps)<p>How do I add these buttons (<code>Back</code> and <code>Refresh</code>) in PWA? Note: I am not looking to add these buttons in my UI. it's in the title bar, which is controlled by browser.</p> <p><a href="https://i.stack.imgur.com/oJunA.png" rel="nofollow noreferrer">...
<p>In manifest.json. Update the display property like this</p> <pre><code>&quot;display&quot;: &quot;minimal-ui&quot;, </code></pre> <p>Earlier it could have been <code>standalone</code>.</p>
How to add Buttons in Title Bar in PWA (Web Apps)
user-interface|browser|web-applications|progressive-web-apps
2
60
1
72,270,016
72,270,016
1
true
2022-05-16T14:37:09.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add Buttons in Title Bar in PWA (Web Apps)<p>How do I add these buttons (<code>Back</code> and <code>Refresh</code>) in PWA? Note: I am not looking to...
72,270,157
I want to validate if the created topic name is in the specified format like [a-z]*_[1-2]* in kafka when creating in terminal, how to achieve this?<p><code>bin/kafka-topics.sh --create --topic topic name --bootstrap-server localhost:9092</code> in here, I wanted to check if the topic name is in the format -[a-z]<em>_[0...
<p><code>kafka-topics.sh</code> is just a wrapper to the class <code>kafka.admin.TopicCommand</code>. I don't think you can pass any parameter to <code>kafka-topics.sh</code> to achieve what you want, but you can create your own <code>kafka-topics.sh</code> that parses the arguments and checks the topic argument format...
I want to validate if the created topic name is in the specified format like [a-z]*_[1-2]* in kafka when creating in terminal, how to achieve this?
apache-kafka|kafka-topic
0
60
1
72,272,113
72,272,113
1
true
2022-05-17T07:55:55.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to validate if the created topic name is in the specified format like [a-z]*_[1-2]* in kafka when creating in terminal, how to achieve this?<p><code>b...
72,272,604
How to remove duplicate dict from list in python<p>I have list of dicts where sometime there are duplicate dict. For ex:</p> <pre><code>objList = [{ 'Name': 'plate', 'StartTime': '2022-05-17T10:26:05.738101', }, { 'Name': 'bezel', 'StartTime': '2022-05-17T10:26:09.922667', }, { 'Name': 'chrome', ...
<p>As @mugiseyebrows said, we use the <code>'Name'</code> of each dictionary (this statement is not very rigorous.) as the key and the dictionary itself as the value to create a new dictionary so that you can ensure that a dictionary with the same <code>'Name'</code> appears once, and then use its <code>values</code> t...
How to remove duplicate dict from list in python
python|list|dictionary
0
60
2
72,272,978
72,272,978
1
true
2022-05-17T10:43:08.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove duplicate dict from list in python<p>I have list of dicts where sometime there are duplicate dict. For ex:</p> <pre><code>objList = [{ 'Na...
72,273,107
Table borders html css<p>I have a frame div and inside of this frame is a table with several columns and rows. For some reason, some of the borders are merging with each other.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="sni...
<p>This is due to <code>border-collapse</code> and the fact you are adding border on all cells.</p> <p>To avoid the problem you should adapt your cell border to get only 1 border:</p> <pre class="lang-css prettyprint-override"><code>/*ADDED*/ table{ border:0px; border-collapse: initial; border-spacing: 0px; } td{...
Table borders html css
html|css
-3
60
2
72,273,541
72,273,541
1
true
2022-05-17T11:18:05.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Table borders html css<p>I have a frame div and inside of this frame is a table with several columns and rows. For some reason, some of the borders are mergi...
72,278,250
Is it possible to manage mysql threads(stuck queries) from tomcat?<p>For some context, we have a really big application running on a tomcat, we have lots of ways to build custom filters, and some of them may be too slow.</p> <p>The question is, there is a way i can control/kill a mysql thread directly or via tomcat(may...
<p>Very likely you want to work with a connection pool. If this is managed by Tomcat, your entry point is a datasource. See the <a href="https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html" rel="nofollow noreferrer">https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html</a...
Is it possible to manage mysql threads(stuck queries) from tomcat?
java|mysql|tomcat9
0
60
1
72,278,822
72,278,822
1
true
2022-05-17T17:20:37.810Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to manage mysql threads(stuck queries) from tomcat?<p>For some context, we have a really big application running on a tomcat, we have lots of ...
72,280,169
How to split char pointer array into two char pointer arrays<p>My question is how can I split <code>argv</code> into two parts and store the parts in two variables.</p> <p>I want my program to get parameters then a delimiter and then again parameters like this:</p> <pre><code>./program parameter1 parameter2 \: paramete...
<p>Don't! These are all pointers. Instead, use pointers - start pointer and end pointer or start pointer and count of element - to represent a &quot;range&quot; inside the source array.</p> <pre><code>char **arr1 = &amp;argv[1]; char **arr1end = arr1; while (*arr1end != NULL) { if (strcmp(*arr1end, &quot;:&quot;) =...
How to split char pointer array into two char pointer arrays
arrays|c|string|split
0
60
1
72,280,490
72,280,490
1
true
2022-05-17T20:17:15.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split char pointer array into two char pointer arrays<p>My question is how can I split <code>argv</code> into two parts and store the parts in two var...
72,273,550
How to select all the checkbox in python selenium?<p>When I try to select all the items in filter, it is selected only when I scroll it manually if not only few options which is visible without scrolling is getting selected, How to select all the options in swiggy filter in cuisine?<a href="https://i.stack.imgur.com/FA...
<p>This code loops over the list of filters and scrolls down when necessary using javascript.</p> <pre><code>from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service driver = webdriver.Chrome(service=Service(chromedriver_path)) ...do something an...
How to select all the checkbox in python selenium?
python|selenium|automation
2
60
1
72,280,777
72,280,777
1
true
2022-05-17T11:50:53.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select all the checkbox in python selenium?<p>When I try to select all the items in filter, it is selected only when I scroll it manually if not only ...
72,270,952
Which parameters of welch do determin the length of the output? (python)<p>I am using welch in python. Which parameter in welch does define the length of the output array? Based on my trials, the output length is related to nperseg/2; but I cannot understand its reason and mathematics. And, I am not sure about the effe...
<p>Parsing the sentence from the documents</p> <blockquote> <p>Welch’s method [1] computes an estimate of the power spectral density by dividing the data into overlapping segments, computing a modified periodogram for each segment and averaging the periodograms.</p> </blockquote> <pre><code>def periodogram(x, Ts=1.0): ...
Which parameters of welch do determin the length of the output? (python)
python|scipy|signal-processing
0
60
1
72,281,188
72,281,188
1
true
2022-05-17T08:51:23.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which parameters of welch do determin the length of the output? (python)<p>I am using welch in python. Which parameter in welch does define the length of the...
72,293,847
Using sed in order to change a specific character in a specific line<p>I'm a beginner in bash and here is my problem. I have a file just like this one:</p> <pre><code>Azzzezzzezzzezzz... Bzzzezzzezzzezzz... Czzzezzzezzzezzz... </code></pre> <p>I try in a script to edit this file.<code>ABC</code> letters are unique in a...
<p>Just apply <code>s</code> command on the line that matches <code>A</code>.</p> <pre><code>sed ' /^A/{ s/e/$1/; } /^B/{ s/e/$2/; } # or shorter /^C/s/e/$3/ ' </code></pre> <p><code>s</code> command by default replaces the first occurrence. You can do for example <code>s/s/$1/2</code> to replace the second occ...
Using sed in order to change a specific character in a specific line
bash
0
60
2
72,295,957
72,295,957
1
true
2022-05-18T17:52:07.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using sed in order to change a specific character in a specific line<p>I'm a beginner in bash and here is my problem. I have a file just like this one:</p> <...
72,296,598
How to create a list with several lists python<p><strong>I have these 3 lists :</strong></p> <p><strong>list1</strong> (question):</p> <pre><code>['Which of the following would best describe the meaning of value in a shippable increment?(choose the best two answers)', 'The Scrum Team consists of: (choose all that apply...
<p>I would say the best solution is:</p> <pre class="lang-py prettyprint-override"><code>lol = [{'question': x[0], 'correct': x[1], 'incorrect': x[2]} for x in zip(list1, list2, list3)] </code></pre> <p>The idea is to <code>zip()</code> the list, it's a function that takes a couple (1+) of iterables/containers and join...
How to create a list with several lists python
python|list
1
60
3
72,296,633
72,296,633
1
true
2022-05-18T22:15:52.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a list with several lists python<p><strong>I have these 3 lists :</strong></p> <p><strong>list1</strong> (question):</p> <pre><code>['Which of ...
72,305,025
How to concat distinct values over multiple columns in MS SQL?<p>I have a table like this</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>id</th> <th>type 1</th> <th>type 2</th> <th>type 3</th> <th>type 4</th> <th>type 5</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>a</td> <td>b</td> <td>...
<p>You can use CROSS APPLY</p> <pre><code>select id, string_agg(s.tp, ',') as types from t cross apply ( select type1 union select type2 union select type3 union select type4 union select type5 ) s(tp) group by id order by id; </code></pre> <p><a href="https://dbfiddle.uk/?rdbms=sqlserver_2019&amp;fidd...
How to concat distinct values over multiple columns in MS SQL?
mysql|sql|concatenation|distinct
0
60
2
72,305,700
72,305,700
1
true
2022-05-19T12:59:07.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to concat distinct values over multiple columns in MS SQL?<p>I have a table like this</p> <div class="s-table-container"> <table class="s-table"> <thead>...
72,310,776
Negative year value in date type column in Oracle<p>We have a table in Oracle with a date type column proto_date. When I run the following query :-</p> <p><code>Select EXTRACT(YEAR from proto_date) from tablename; </code></p> <p>I get result as -3832. Can Oracle store such date values where year is negative?</p>
<blockquote> <p>Can Oracle store such date values where year is negative?</p> </blockquote> <p>Oracle dates can range in year from 4712 BC to 9999 AD. Extracting the year from a BC date will yield a negative number.</p>
Negative year value in date type column in Oracle
oracle
0
60
1
72,311,048
72,311,048
1
true
2022-05-19T20:34:18.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Negative year value in date type column in Oracle<p>We have a table in Oracle with a date type column proto_date. When I run the following query :-</p> <p><c...
72,317,883
Match specific letter from group N Regex<p>I have the following log message:</p> <pre><code>Aug 25 03:07:19 localhost.localdomainASM:unit_hostname=&quot;bigip1&quot;,management_ip_address=&quot;192.168.41.200&quot;,management_ip_address_2=&quot;N/A&quot;,http_class_name=&quot;/Common/log_to_elk_policy&quot;,web_applica...
<p>You can use</p> <pre class="lang-none prettyprint-override"><code>request=&quot;(?&lt;Flag1&gt;[A-Z]+\s+(?&lt;Flag2&gt;\/\S+='[^']*')[^&quot;]*)&quot; </code></pre> <p>See the <a href="https://regex101.com/r/XzENqP/3" rel="nofollow noreferrer">regex demo</a>.</p> <p><em>Details</em>:</p> <ul> <li><code>(?&lt;Flag1&g...
Match specific letter from group N Regex
regex|regex-lookarounds|regex-group|regex-negation|nsregularexpression
1
60
2
72,318,852
72,318,852
1
true
2022-05-20T11:04:26.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Match specific letter from group N Regex<p>I have the following log message:</p> <pre><code>Aug 25 03:07:19 localhost.localdomainASM:unit_hostname=&quot;bigi...
72,316,566
Calculate tax per sessionID<p>I have the following table &quot;Customer_Trans&quot; and contains the following columns:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Date</th> <th>CustomerID</th> <th>SessionID</th> <th>Amount</th> </tr> </thead> <tbody> <tr> <td>9/9/2020</td> <td>485789</...
<p>Try running this</p> <pre><code>DROP TABLE IF EXISTS #Customer_Trans CREATE TABLE #Customer_Trans ( [Date] date NULL, CustomerID int NULL, SessionID INT NULL, Amount DECIMAL(18,4) NULL, Tier1 DECIMAL(18,4) NULL, Tier2 DECIMAL(18,4) NULL ) INSERT INTO #Customer_Trans (Date,CustomerID,SessionID,Amount) VALUES('9/9/2...
Calculate tax per sessionID
sql|sql-server
0
60
1
72,323,555
72,323,555
1
true
2022-05-20T09:25:08.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate tax per sessionID<p>I have the following table &quot;Customer_Trans&quot; and contains the following columns:</p> <div class="s-table-container"> <...
72,325,960
Using a for loop to display HTML element using JavaScript<p>I'm currently working on a project where I have a gallery (Gallery.php) containing a carousel of images, if an image is clicked on, the ImageID (I have set) and the Image URL are added to a 2D array in the localStorage. I am attempting to retrieve the array fr...
<p>Loop through the images, and for each element, create a card and append it to the destination (assume to be <code>#target</code>):</p> <pre><code>images.forEach(function(image) { $('#target').append( `&lt;div class=&quot;col-md-4 col-12 mb-3&quot;&gt; &lt;div class=&quot;card border&quot;&gt; ...
Using a for loop to display HTML element using JavaScript
javascript|php|html|jquery|css
2
60
1
72,326,191
72,326,191
1
true
2022-05-21T01:04:10.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using a for loop to display HTML element using JavaScript<p>I'm currently working on a project where I have a gallery (Gallery.php) containing a carousel of ...
72,340,344
How to transform 2D tuple [x][y] to [y][x] and call variadic function for each result set<p>I want to &quot;rotate&quot; the axis of a 2D tuple and call a variadic function for each of the result sets.</p> <p>All tuple elements have the same type, but the element items/attributes might have different type.</p> <p>Start...
<p>Use nested lambdas, one to expand the index and one to expand the <code>tuple</code></p> <pre><code>constexpr auto someData = std::make_tuple( std::make_tuple(1, 2, 3.0), std::make_tuple(4, 5, 6.0), std::make_tuple(7, 8, 9.0) ); // someFunction(1, 4, 7); // someFunction(2, 5, 8); // someFunction(3.0, 6.0, 9.0...
How to transform 2D tuple [x][y] to [y][x] and call variadic function for each result set
c++|lambda|tuples|c++20|variadic-functions
2
60
1
72,340,486
72,340,486
1
true
2022-05-22T18:37:07.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to transform 2D tuple [x][y] to [y][x] and call variadic function for each result set<p>I want to &quot;rotate&quot; the axis of a 2D tuple and call a va...
72,333,760
Converting time to another timezone JS<p>I'm obtaining <code>data.value</code> which is a time in the format: <code>hh:mm a</code> - for example <code>12:30 am</code>.</p> <p>I also know:</p> <ol> <li>the local timezone of the user (<code>userTimeZone</code>)</li> <li>the timezone of the venue (<code>venueTimeZone</cod...
<p>Consider using <a href="https://moment.github.io/luxon/#/" rel="nofollow noreferrer">Luxon</a> - the successor to Moment. (See <a href="https://momentjs.com/docs/#/-project-status/" rel="nofollow noreferrer">Moment's project status</a>.)</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="tru...
Converting time to another timezone JS
javascript|date|time|timezone|momentjs
0
60
1
72,342,608
72,342,608
1
true
2022-05-21T23:00:00.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting time to another timezone JS<p>I'm obtaining <code>data.value</code> which is a time in the format: <code>hh:mm a</code> - for example <code>12:30 ...
72,340,278
JMeter slow with "Retrieve all embedded resources" - how do I scale?<p><strong>TLDR:</strong></p> <ul> <li>JMeter crawls with just 1 test user if I select &quot;Retrieve all embedded resources&quot;.</li> <li>JMeter throws <code>Uncaught Exception java.lang.OutOfMemoryError: Java heap space in thread Thread</code> if I...
<ol> <li><p>If JMeter &quot;hangs&quot; for 10 minutes retrieving an embedded resource there is a problem with this specific resource, you can see the response times for each resource using i.e. <a href="https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree" rel="nofollow noreferrer">View Resu...
JMeter slow with "Retrieve all embedded resources" - how do I scale?
java|web-applications|jmeter|load-testing|blazemeter
0
60
1
72,344,451
72,344,451
1
true
2022-05-22T18:27:21.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JMeter slow with "Retrieve all embedded resources" - how do I scale?<p><strong>TLDR:</strong></p> <ul> <li>JMeter crawls with just 1 test user if I select &q...
72,349,732
How to index nullable fields on azure search<p>I'm using nodejs to create the index on azure search,</p> <pre><code> { &quot;name&quot;: &quot;price_positioning&quot;, &quot;type&quot;: &quot;Edm.ComplexType&quot;, &quot;fields&quot;: [ { &quot;name&quot;: &quot;...
<p>If you don't have a value for <code>price_positioning</code>, you can either leave that attribute out of the request completely or mark it as <code>null</code>.</p> <p>For example, setting the value to null like this will work:</p> <pre class="lang-json prettyprint-override"><code>&quot;price_positioning&quot;: null...
How to index nullable fields on azure search
node.js|azure-cognitive-search
0
60
1
72,351,541
72,351,541
1
true
2022-05-23T13:51:18.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to index nullable fields on azure search<p>I'm using nodejs to create the index on azure search,</p> <pre><code> { &quot;name&quot;: &quot;price...
72,367,077
How to pass props onClick from one component to another in React JS<p><strong>I have a component which gathers an array of ingredients from a user input. <br> I am trying to send this state array as props to another component, onclick, when I click a 'search' button.<br> However, I cannot get the props to pass and don'...
<p>You would have to move your state to the parent component of both child components.</p> <pre><code>import React from 'react' import MultiSearch from '../../components/MultiSearch' import SearchBar from '../../components/SearchBar' function Search() { const [ingredients, setIngredients] = useState() return ( ...
How to pass props onClick from one component to another in React JS
javascript|reactjs|react-props
0
60
1
72,367,255
72,367,255
1
true
2022-05-24T17:27:45.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass props onClick from one component to another in React JS<p><strong>I have a component which gathers an array of ingredients from a user input. <br...
72,368,044
How to use "this" inside within writable.write function<p>I need to access some class instance data within a writable.write function. Here is a short snippit of typescript code that illustrates what I'm trying to do:</p> <pre><code>import * as socketio from 'socket.io' import { Writable } from 'stream' export class D...
<p>You should use an arrow function to represent the <strong>write</strong> method, then this will refer to the DataClient instance:</p> <pre class="lang-js prettyprint-override"><code>import * as socketio from &quot;socket.io&quot;; import { Writable } from &quot;stream&quot;; export class DataClient { public socke...
How to use "this" inside within writable.write function
typescript|this
0
60
1
72,368,254
72,368,254
1
true
2022-05-24T18:49:18.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use "this" inside within writable.write function<p>I need to access some class instance data within a writable.write function. Here is a short snippi...
72,376,335
MySQL - How to store multiple combinations of colors for one product?<p>I am searching for the best solution for the following issue:</p> <p>I have three tables:</p> <ol> <li>Product</li> </ol> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>id</th> <th>productName</th> </tr> </thead> <tbody> <...
<p>You have to create tables like below to store generated combinations.</p> <ol> <li><p>selected_products</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>id</th> <th>product_id</th> <th>user_id</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>2</td> <td>2</t...
MySQL - How to store multiple combinations of colors for one product?
mysql|database|join|combinations
0
60
2
72,378,801
72,378,801
1
true
2022-05-25T10:56:07.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL - How to store multiple combinations of colors for one product?<p>I am searching for the best solution for the following issue:</p> <p>I have three tab...
72,378,882
Extract only text of a certain font type from a .docx file using Python<p>I want to extract all text of type 'Arial' from my .docx file. This is currently what I have but it's not producing any output (most of the text in the document is of type 'Arial').</p> <pre><code>from docx import * document = Document('word.doc...
<p><em>Style</em> is distinct from <em>font</em> in documents. Style in word means the application of a <em>named style</em> (like 'heading'). Sadly most people don't use styles, but just grab a region of text and change the font.</p> <p>From a bit of digging with a test document, it seems that the <code>font</code> ...
Extract only text of a certain font type from a .docx file using Python
python|docx
2
60
1
72,379,213
72,379,213
1
true
2022-05-25T13:49:44.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract only text of a certain font type from a .docx file using Python<p>I want to extract all text of type 'Arial' from my .docx file. This is currently wh...
72,384,353
How to get value from a vector by value from another vector?<p>I have two vectors:</p> <p>one contains numbers and names of things;</p> <p>second collects numbers that have already been showed to the user;</p> <p>I'm trying to make a history list of all objects that have been shown.</p> <p>Here is my code:</p> <pre><co...
<p><code>for_each</code> and lambda are just making your life difficult. The simpler code is explicit iteration:</p> <pre><code>void history() { for (auto i : choosen) { auto tempPair = paletts[i]; std::cout &lt;&lt; tempPair.first &lt;&lt; &quot; &quot; &lt;&lt; tempPair.second; ...
How to get value from a vector by value from another vector?
c++|c++11|lambda|this
1
60
2
72,384,703
72,384,703
1
true
2022-05-25T21:25:56.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get value from a vector by value from another vector?<p>I have two vectors:</p> <p>one contains numbers and names of things;</p> <p>second collects nu...
72,393,102
Azure function - Setting CloudBlockBlob metadata on a new blob<p>I've created an Azure function in which I'd like to retrieve information from an input blob and set metadata on a newly created output blob. I don't think I'm setting the metadata correctly however, as I am unable to retrieve it in another part of my appl...
<p>There's nothing wrong with your code for setting the metadata, it is being set properly. The issue is with the code for fetching the list of blobs. When you list the blobs, by default the metadata for the blob is not fetched.</p> <p>Please use <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.stor...
Azure function - Setting CloudBlockBlob metadata on a new blob
c#|azure|azure-functions|metadata
0
60
1
72,393,335
72,393,335
1
true
2022-05-26T14:03:27.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure function - Setting CloudBlockBlob metadata on a new blob<p>I've created an Azure function in which I'd like to retrieve information from an input blob ...
72,793,898
Excel VBA Class Module: Is it possible to create a "personalized" Range Object?<p>Is it possible to create a class module in Excel VBA, called, say, myRange, which behave exactly like an Excel.Range object, but in which we can add new methods and properties?</p> <p>For example</p> <pre><code>dim rg1 as Excel.Range, rg2...
<p>You can't really &quot;extend&quot; <code>Range</code> - you can create a &quot;wrapper&quot; class which holds an internal reference to a range, but if you wanted all existing Range methods exposed via that class you'd need to replicate them in your class. Or have your class expose the contained range via its own R...
Excel VBA Class Module: Is it possible to create a "personalized" Range Object?
excel|vba
1
60
1
72,794,472
72,794,472
1
true
2022-06-28T22:42:09.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel VBA Class Module: Is it possible to create a "personalized" Range Object?<p>Is it possible to create a class module in Excel VBA, called, say, myRange,...
72,797,385
Preventing The Entire List Re-Render on Item Addition in React Without Using memo<p>Please consider the following code: <a href="https://codepen.io/kyxey/pen/XWEWBRY" rel="nofollow noreferrer">https://codepen.io/kyxey/pen/XWEWBRY</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data...
<p>You've said:</p> <blockquote> <p>This question was asked from me in a coding interview. They explicitly mentioned that I'm not allowed to use <code>memo</code> or <code>useMemo</code> in the sense that these are considered <em>cheating</em>! Now I don't know exactly why they think in such way but I'm sure there's an...
Preventing The Entire List Re-Render on Item Addition in React Without Using memo
javascript|reactjs|arraylist|rerender|memo
-1
60
1
72,798,943
72,798,943
1
true
2022-06-29T07:27:19.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Preventing The Entire List Re-Render on Item Addition in React Without Using memo<p>Please consider the following code: <a href="https://codepen.io/kyxey/pen...
72,791,266
How to delete object Redis list item?<p>I am using delete function in a scenario for cache deleting data from mongodb but<a href="https://i.stack.imgur.com/o3RhQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o3RhQ.png" alt="enter image description here" /></a> how can i delete data which is specifi...
<p>Do you have control over the code that inserts the JSON? If so, you'll need to make sure they generate the same strings. <a href="https://redis.io/commands/lrem/" rel="nofollow noreferrer">LREM</a> requires an <em>exact</em> match to work. That said, you might want to consider a different data structure or maybe a c...
How to delete object Redis list item?
javascript|express|caching|redis
0
60
1
72,801,636
72,801,636
1
true
2022-06-28T18:08:17.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete object Redis list item?<p>I am using delete function in a scenario for cache deleting data from mongodb but<a href="https://i.stack.imgur.com/o...
72,802,092
is there any solution to curses library problem?<p>so I was programing a snake game with curses and it's already there but python tells me that it doesn't exist</p> <pre><code>import random import curses screen = curses.initscr() sh, sw = screen.getmaxyx() curses.curs_set(0) window = curses.newwin(sh, sw, 0, 0) window...
<p>Try entering this:</p> <pre><code>pip install windows-curses </code></pre> <p>into your terminal that should fix it</p>
is there any solution to curses library problem?
python|windows|python-curses
0
60
1
72,802,197
72,802,197
1
true
2022-06-29T13:16:55.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is there any solution to curses library problem?<p>so I was programing a snake game with curses and it's already there but python tells me that it doesn't ex...
72,801,358
Shell script failing on mkdir in Dockerfile<p>Have a Shell script as follows</p> <pre><code>ENV HOME=/home RUN mkdir $HOME </code></pre> <p>Above script is in a Docker file and getting exception as follows [91mmkdir: missing operand Try <code>'mkdir --help'</code> for more information. Build step 'Docker Build and Publ...
<p>I just tried with a Dockerfile like this:</p> <pre><code>FROM scratch ENV HOME=/home RUN mkdir $HOME </code></pre> <p>and got that:</p> <pre><code>$ docker build . Sending build context to Docker daemon 2.048kB Step 1/3 : FROM scratch ---&gt; Step 2/3 : ENV HOME=/home ---&gt; Running in e9d03ee00aa7 Removing int...
Shell script failing on mkdir in Dockerfile
docker|shell
0
60
1
72,806,718
72,806,718
1
true
2022-06-29T12:21:24.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shell script failing on mkdir in Dockerfile<p>Have a Shell script as follows</p> <pre><code>ENV HOME=/home RUN mkdir $HOME </code></pre> <p>Above script is i...
72,814,248
How to get single value from request response<p>I started writing a program that will automate user actions, by now it's meant to be an easier menu to make faster actions by just sending requests to the official website by clicks on my own page. (something like web-bot but not exactly). My problem is when i send <stron...
<p>It looks like you're using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Response/text" rel="nofollow noreferrer">text()</a> method on the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Response" rel="nofollow noreferrer">Response</a> object returned from <code>fetch()</code>, which will g...
How to get single value from request response
javascript|request|response
1
60
2
72,814,462
72,814,462
1
true
2022-06-30T10:28:44.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get single value from request response<p>I started writing a program that will automate user actions, by now it's meant to be an easier menu to make f...
72,796,957
how to preview video and upload that video file to firebase in android kotlin<p>I am trying to upload a video file to firebase.:-</p> <p>this is the code:-</p> <pre><code>lateinit var file: Any private fun selectingVideo() { val videoPickIntent = Intent(Intent.ACTION_PICK) videoPickIntent.type = &quot;video/*...
<p>Make these changes to the code:-</p> <pre><code> val pickedVideoUrl = data.data feedVideoSelect.setVideoPath(pickedVideoUrl.toString()) </code></pre>
how to preview video and upload that video file to firebase in android kotlin
android|firebase|kotlin|firebase-storage|android-videoview
1
60
1
72,814,937
72,814,937
1
true
2022-06-29T06:52:58.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to preview video and upload that video file to firebase in android kotlin<p>I am trying to upload a video file to firebase.:-</p> <p>this is the code:-</...
72,818,693
I need to throttle the amount of requests this for loop sends<p>I'm fetching requests but I am getting the 'sent to many requests error', how can I throttle the amount of requests this loop is sending to 10 requests a second?</p> <pre><code>let accesstoken = token2.access_token; const promises = []; for(var i = 0; i &...
<p>Make sure you call throttledRequest in the scope that is invoking all of the request and not for each character/accessToken/slug so it will take all the request into count</p> <pre><code>// a function that throttled the request up to 10 requests a second const throttledRequest = () =&gt; { const requestCount = 0; ...
I need to throttle the amount of requests this for loop sends
node.js|fetch|throttling
0
60
1
72,819,469
72,819,469
1
true
2022-06-30T15:51:17.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to throttle the amount of requests this for loop sends<p>I'm fetching requests but I am getting the 'sent to many requests error', how can I throttle ...
72,818,707
How to align text of Tkinter ttk widgets to the top? Resp. how to prevent the text from moving after rescaling?<p>Everytime I rescale my window, the text starts to &quot;move to the bottom&quot; of the widget. How can I stop this behaviour? Here are 2 screenshots:</p> <p>This is how it is not supposed to look like: <a ...
<p>I don't know why the <code>ttk.Label</code> adjusts automatically whenever the <code>tkFont.Font</code>'s size is changed, but the <code>tkk.Combobox</code> doesn't. Fortunately a fairly simple workaround for that anomaly is to update the <code>font</code> option of the combobox <em>manually</em> whenever the font i...
How to align text of Tkinter ttk widgets to the top? Resp. how to prevent the text from moving after rescaling?
python|tkinter|alignment|font-size|ttk
2
60
1
72,823,338
72,823,338
1
true
2022-06-30T15:52:08.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to align text of Tkinter ttk widgets to the top? Resp. how to prevent the text from moving after rescaling?<p>Everytime I rescale my window, the text sta...
72,823,484
Error socket: too many open files while benchmarking api in golang<p>I'm building a system where I have implemented APIs with rest(HTTP) and gRPC - mostly in golang - in order to compare both alternatives as a study. But, when I'm benchmarking the rest APIs i'm getting a <code>socket: too many open files</code> error. ...
<p>As for benchmarking, you might need to increase maximum number of open file descriptors.</p> <p>Try to edit this file <code>/etc/security/limits.conf</code> and update following lines:</p> <pre><code>* hard nofile 1048576 * soft nofile 1048576 </code></pre> <p>You can change to a grea...
Error socket: too many open files while benchmarking api in golang
go
0
60
1
72,823,586
72,823,586
1
true
2022-07-01T01:13:31.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error socket: too many open files while benchmarking api in golang<p>I'm building a system where I have implemented APIs with rest(HTTP) and gRPC - mostly in...
72,815,480
How to intersect maps using Tigris (and keeping all maps boundaries)?<p>Sorry for this very basic question but I'm new using Tigris. I would like create a shapefile (and then plot it) of county boundaries + places boundaries for the state of Minnesota.</p> <p>Here is my code to get the counties:</p> <pre><code>mn_count...
<p>If I am understanding you correctly, you want places and counties in the same dataset. This is accomplished with <code>dplyr::bind_rows()</code>:</p> <pre><code>library(tigris) library(dplyr) library(tmap) mn_counties_and_places &lt;- counties(state = &quot;MN&quot;, cb = TRUE) %&gt;% bind_rows( places(state...
How to intersect maps using Tigris (and keeping all maps boundaries)?
r|shapefile|sf|tigris
0
60
1
72,830,124
72,830,124
1
true
2022-06-30T12:03:14.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to intersect maps using Tigris (and keeping all maps boundaries)?<p>Sorry for this very basic question but I'm new using Tigris. I would like create a sh...
72,830,170
Unhandled Exception: Converting object to an encodable object failed: Instance of 'Mesure'<p>hello i have the class mesure when i read data i use it ass a model then i save it on my database getstorage getX . it works perfectly , but when i add this test if mode = display i 'm going to add more data on my model and do ...
<p>There are 2 things:</p> <ol> <li>You have to initialize <code>debut</code> to make it write to JSON (<a href="https://pub.dev/packages/get_storage" rel="nofollow noreferrer">get_storage</a>);</li> <li>And, you have to default the values of <code>debut</code> and <code>fin</code> to something when reading from JSON (...
Unhandled Exception: Converting object to an encodable object failed: Instance of 'Mesure'
flutter
0
60
1
72,832,170
72,832,170
1
true
2022-07-01T13:38:45.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unhandled Exception: Converting object to an encodable object failed: Instance of 'Mesure'<p>hello i have the class mesure when i read data i use it ass a mo...
72,834,389
dafny sequence to multiset<p>While trying to make some assertions about sequences and subsequences I came to realize that dafny does not seem to prove this statement. I don't know how it could not be true. Should I just make this an axiom and move on or this there a way to prove this to dafny?</p> <pre><code>lemma mult...
<p>I think you're going down a rabbit hole. The issue is simply sequence extentionality on <code>nums</code>:</p> <p>This verifies for me:</p> <pre><code>lemma multisetSequence(nums: seq&lt;int&gt;, ms: multiset&lt;int&gt;) requires |nums| &gt; 0 requires multiset(nums[1..]) == ms; ensures multiset(nums) =...
dafny sequence to multiset
proof|dafny|multiset
1
60
1
72,834,681
72,834,681
1
true
2022-07-01T20:34:39.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dafny sequence to multiset<p>While trying to make some assertions about sequences and subsequences I came to realize that dafny does not seem to prove this s...
72,842,694
trying to resize a grid of divs for the etch-a-sketch assignment from the odinproject<p>first off, <strong>I already know that a lot of this JavaScript could have been done in the HTML</strong>.</p> <p>Anyways, my issue is that I can create my initial 16x16 grid of divs <em>(thanks stackoverflow!)</em> but I can't resi...
<p>I made three changes to get the More button working as you'll see below. One issue was that <code>moreDivs()</code> was being called without passing in the <code>event</code> object. The other issue was that <code>moreDivs()</code> was expecting <code>num</code> to be passed as a second argument whereas I think you ...
trying to resize a grid of divs for the etch-a-sketch assignment from the odinproject
javascript
2
60
1
72,842,822
72,842,822
1
true
2022-07-02T21:59:39.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: trying to resize a grid of divs for the etch-a-sketch assignment from the odinproject<p>first off, <strong>I already know that a lot of this JavaScript could...
72,843,116
Writing a command parser in Godot - How can I make it recognize a word anywhere in a sentence?<p>I'm creating an app in Godot where the user inputs text in a LineEdit node. The code checks what they have typed, and responds differently depending on the words that were entered.</p> <p>So far I have it working so that it...
<p>You already have an <code>Array</code> of words:</p> <pre><code>var words = _input.split(&quot; &quot;, false) </code></pre> <p>Let us be explicit with the type for illustration:</p> <pre><code>var words:Array = _input.split(&quot; &quot;, false) </code></pre> <p>Then we can check if that <code>Array</code> has a va...
Writing a command parser in Godot - How can I make it recognize a word anywhere in a sentence?
godot|gdscript
1
60
1
72,848,649
72,848,649
1
true
2022-07-02T23:46:25.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Writing a command parser in Godot - How can I make it recognize a word anywhere in a sentence?<p>I'm creating an app in Godot where the user inputs text in a...
72,848,910
How to check if an object is in another queryset<p>I need to check if a user has liked a post on a page that displays all posts, I am passing the posts and user's likes below</p> <pre><code>def index(request): if request.method == &quot;POST&quot;: text = request.POST[&quot;post-text&quot;] Post.objects.create(...
<p>Please <em>don't</em>. While this can be done with such condition, it would result in a <em>lot</em> of extra queries. You can work with a <a href="https://docs.djangoproject.com/en/dev/ref/models/expressions/#exists-subqueries" rel="nofollow noreferrer"><strong><code>Exists</code></strong> subquery <sup>[Django-doc...
How to check if an object is in another queryset
python|django|django-models|django-views|django-templates
1
60
2
72,848,962
72,848,962
1
true
2022-07-03T18:19:25.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if an object is in another queryset<p>I need to check if a user has liked a post on a page that displays all posts, I am passing the posts and u...
72,852,252
How to control the size of <label> element in React?<p>I want to make element to be the same size of box, but the size of label is shorter than I expected. Also, &quot;width&quot; is not working in the React.</p> <p>How can I solve this problem?</p> <pre><code>const DragDrop = () =&gt; { ... return ( &lt;div ...
<blockquote> <p>Make forcefully take the label width 100% via width 100% in the label</p> </blockquote> <pre><code> .DragDrop { width: 100%; height: 20vh; @include alignCenter(); label{ width:100%; } } </code></pre>
How to control the size of <label> element in React?
css|reactjs|typescript|label
0
60
2
72,852,364
72,852,364
1
true
2022-07-04T05:49:58.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to control the size of <label> element in React?<p>I want to make element to be the same size of box, but the size of label is shorter than I expected. ...
72,843,859
How kubelet knows what to do?<p>I'm trying to understand how kubelet watches changes from api server. I found a note over <code>syncLoop</code> function</p> <pre><code>// kubernetes/pkg/kubelet/kubelet.go // syncLoop is the main loop for processing changes. It watches for changes from // three channels (file, apiserver...
<p>The kubelet is <strong>the primary &quot;node agent&quot; that runs on each node</strong>. It can register the node with the apiserver using one of: the hostname; a flag to override the hostname; or specific logic for a cloud provider.</p> <p>On the Kubelet polling: The API server pushes events to kubelet. Actually,...
How kubelet knows what to do?
kubernetes|kubelet
0
60
1
72,853,070
72,853,070
1
true
2022-07-03T04:08:00.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How kubelet knows what to do?<p>I'm trying to understand how kubelet watches changes from api server. I found a note over <code>syncLoop</code> function</p> ...
72,851,287
Expanding animation from center of grid<p>I am making an app where when it opens it expands. But it is expanding from the side of the grid but I want it to expand from the center. Here is the xaml code</p> <pre><code> &lt;Window.Resources&gt; &lt;Storyboard x:Key=&quot;ExpandingAnimation&quot;&gt; ...
<p>You could use a <code>ScaleTransform</code> and animate its <code>ScaleX</code> and <code>ScaleY</code> properties:</p> <pre><code>&lt;Storyboard x:Key=&quot;ExpandingAnimation&quot;&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Storyboard.TargetName=&quot;MyScaleTransform&quot; Stor...
Expanding animation from center of grid
c#|wpf|xaml
0
60
1
72,857,097
72,857,097
1
true
2022-07-04T02:40:00.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expanding animation from center of grid<p>I am making an app where when it opens it expands. But it is expanding from the side of the grid but I want it to e...
72,857,161
How to reshape and padding zeros in tf.Tensor<p>The following code is trying to convert the tensor into (x,y) dimension arrays in Tensorflow.</p> <p>The &quot;a&quot; can be convert to &quot;b&quot; by using this code, but the &quot;c&quot; can't.</p> <p>Here is the test code:</p> <pre><code>def reshape_array(old_array...
<p>You a working with a 1D tensor in your second example, so try:</p> <pre><code>import tensorflow as tf def reshape_array(old_array, x, y): new_array = tf.reshape(old_array, [-1]) current_size = tf.size(new_array) reshape_size = tf.math.multiply(x, y) diff = tf.math.subtract(reshape_size, cu...
How to reshape and padding zeros in tf.Tensor
python|tensorflow|tensor
2
60
1
72,857,380
72,857,380
1
true
2022-07-04T12:58:26.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reshape and padding zeros in tf.Tensor<p>The following code is trying to convert the tensor into (x,y) dimension arrays in Tensorflow.</p> <p>The &quo...
72,860,903
Scroll to Bottom of Page Not Working (Python Selenium)<p>Why doesn't <code>driver.execute_script(&quot;window.scrollTo(0, document.body.scrollHeight)&quot;)</code> work on <a href="https://music.apple.com/ca/playlist/christmas-songs/pl.3597190614364be9a39a6011cfdfd7f3" rel="nofollow noreferrer">this apple music playlis...
<p>Try to use any interactable node like below:</p> <pre><code>driver.find_element(By.CLASS_NAME, 'play-button').send_keys(Keys.END) </code></pre>
Scroll to Bottom of Page Not Working (Python Selenium)
python|selenium|selenium-webdriver|selenium-chromedriver
1
60
1
72,861,624
72,861,624
1
true
2022-07-04T18:44:11.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scroll to Bottom of Page Not Working (Python Selenium)<p>Why doesn't <code>driver.execute_script(&quot;window.scrollTo(0, document.body.scrollHeight)&quot;)<...
72,863,729
Github optional status check<p>Does github support optional status check in the pull request? I'm using mono repo in my github. Thus there are many circle-ci checks with different workflow deployments. Every time when I create a new pull request I need to approve and pass all of the checks which most of them are not re...
<p>There is one possible solution or workaround (Feb. 2021):</p> <blockquote> <h2><a href="https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/" rel="nofollow noreferrer">GitHub Actions: Skip pull request and push workflows with <code>[skip ci]</code></a></h2> <p>Gi...
Github optional status check
github|circleci
1
60
1
72,863,998
72,863,998
1
true
2022-07-05T03:34:04.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Github optional status check<p>Does github support optional status check in the pull request? I'm using mono repo in my github. Thus there are many circle-ci...
72,815,845
Cloud Composer - Fixes for deprecated beta API's on Kubernetes<p>We are currently running &quot;composer-2.0.7-airflow-2.2.3&quot; on GKE v1.21.x.</p> <p>Looking to upgrade to GKE v1.22.x there are warnings of deprecated API's no longer available in v1.22 being used.</p> <p>Can you advise if Cloud Composer will fix / o...
<p>This message seems to be occurring due to the deprecated APIs in Kubernetes where Beta APIs have since graduated from Beta (v1beta1) to GA (v1) as given in this <a href="https://cloud.google.com/kubernetes-engine/docs/deprecations/apis-1-22#removed_apis_in_122" rel="nofollow noreferrer">documentation.</a></p> <p>A...
Cloud Composer - Fixes for deprecated beta API's on Kubernetes
google-cloud-composer
0
60
1
72,865,074
72,865,074
1
true
2022-06-30T12:27:43.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cloud Composer - Fixes for deprecated beta API's on Kubernetes<p>We are currently running &quot;composer-2.0.7-airflow-2.2.3&quot; on GKE v1.21.x.</p> <p>Loo...
72,861,974
How do I cut off one half of a PDF page?<p>I want to print a DHL label using a label printer.</p> <p>The DHL label consists of 2 parts: The left half of the image is just info that I can keep to myself. The right part of the PDF is what should actually be printed.</p> <p>I would therefore like to cut away the left part...
<p>You essentially want to cut away one half of the PDF page; looking at you screenshot most likely the lower half.</p> <p>Using iTextSharp 5.5.13.3 you can do that like this:</p> <pre class="lang-csharp prettyprint-override"><code>var testFile = @&quot;new pdf1.pdf&quot;; var resultFile = @&quot;new pdf1-Cut.pdf&quot;...
How do I cut off one half of a PDF page?
itext
2
60
1
72,868,106
72,868,106
1
true
2022-07-04T20:59:23.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I cut off one half of a PDF page?<p>I want to print a DHL label using a label printer.</p> <p>The DHL label consists of 2 parts: The left half of the ...
72,853,035
Activate SQL-Logging via Spring Boot and Hibernate via Environment variables (casing problem)<p>I want to log all SQL-Statements in SpringBoot 2.7.0. In <a href="https://www.baeldung.com/sql-logging-spring-boot#2-via-loggers" rel="nofollow noreferrer">https://www.baeldung.com/sql-logging-spring-boot#2-via-loggers</a> i...
<p>Use name : <strong>logging.level.org.hibernate.SQL</strong></p> <p><a href="https://i.stack.imgur.com/HLO8n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HLO8n.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/WeoR8.png" rel="nofollow noreferrer"><img src="...
Activate SQL-Logging via Spring Boot and Hibernate via Environment variables (casing problem)
java|spring|spring-boot|hibernate|naming-conventions
0
60
1
72,868,760
72,868,760
1
true
2022-07-04T07:20:44.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Activate SQL-Logging via Spring Boot and Hibernate via Environment variables (casing problem)<p>I want to log all SQL-Statements in SpringBoot 2.7.0. In <a h...
72,860,457
Attempt to invoke virtual method 'void androidx.lifecycle.MutableLiveData.setValue(java.lang.Object)' on a null object reference (Android Kotlin)<p>Sorry for the long title, however, I am unsure where this error is at in my code, however, I do suspect the error lies in the implementation of the <code>liveData</code> an...
<p>Initialization in Kotlin happens in the order written (top to bottom). Because your <code>init</code> block is listed <em>before</em> you initialize <code>_currentScrambledWord</code>, it is null when you try to use it in <code>init</code>. You should move the <code>init</code> block to the end of the class definiti...
Attempt to invoke virtual method 'void androidx.lifecycle.MutableLiveData.setValue(java.lang.Object)' on a null object reference (Android Kotlin)
android|kotlin|android-livedata
0
60
1
72,869,538
72,869,538
1
true
2022-07-04T17:52:56.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attempt to invoke virtual method 'void androidx.lifecycle.MutableLiveData.setValue(java.lang.Object)' on a null object reference (Android Kotlin)<p>Sorry for...
72,870,529
How do I apply a function over a column?<p>I have created a function I would like to apply over a given dataframe column. Is there an apply function so that I can create a new column and apply my created function? Example code:</p> <pre><code>dat = pd.DataFrame({'title': ['cat', 'dog', 'lion','turtle']}) </code></pre> ...
<p>It sounds like you are having difficulty applying a function while passing additional keyword arguments. Here's how you can execute that:</p> <pre class="lang-py prettyprint-override"><code># By default, function will use values for first arg. # You can specify kwargs in the apply method though df['similarity'] = df...
How do I apply a function over a column?
python|pandas
1
60
1
72,875,468
72,875,468
1
true
2022-07-05T13:45:56.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I apply a function over a column?<p>I have created a function I would like to apply over a given dataframe column. Is there an apply function so that ...
72,875,324
SwiftUI toggle State bool onTapGesture using main tread<p>I wrote the following to attempt to display a &quot;arrow.down.circle.fill&quot; and then when tapped display a progress view until tasks are done on the main tread. I then want to display the down arrow image again. I noticed it works fine when using a backgrou...
<p>You are doing things on the wrong queues.</p> <pre><code> DispatchQueue.global(qos: .background).async { isLoading = true // NO!!!! This needs to be on the main queue. DispatchQueue.main.async { sleep(3) // NO!!! This should be off the main queue. } ...
SwiftUI toggle State bool onTapGesture using main tread
swiftui
0
60
3
72,875,548
72,875,548
1
true
2022-07-05T20:45:34.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI toggle State bool onTapGesture using main tread<p>I wrote the following to attempt to display a &quot;arrow.down.circle.fill&quot; and then when tapp...
72,876,289
How do I format XML in SQL Server from parameters?<p>I am trying to make a wrapper parameterised stored procedure to execute another stored procedure which takes XML as its input (for use with SSRS).</p> <p>This is how the XML stored procedure is currently run (the <code>@Xml</code> parameter is actually text type):</p...
<p>I have no idea why you are using XML to pass parameters (in the deprecated <code>text</code> datatype no less), but it looks like you just need <code>FOR XML PATH</code> along with a XQuery path for each column name</p> <pre class="lang-sql prettyprint-override"><code>DECLARE @myXmlStr nvarchar(max) = ( SELECT ...
How do I format XML in SQL Server from parameters?
sql-server|xml|tsql|xml-namespaces|for-xml
0
60
1
72,876,652
72,876,652
1
true
2022-07-05T22:46:35.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I format XML in SQL Server from parameters?<p>I am trying to make a wrapper parameterised stored procedure to execute another stored procedure which t...
72,857,029
Add signed APT repo using Puppet<p>I want to install Telegraf using Puppet 6, and I'm finding it really difficult to do so by using the <code>apt</code> module. I'm using the module so I can import the GPG key and add the corresponding source.</p> <p>My manifest looks something like this:</p> <pre class="lang-rb pretty...
<blockquote> <p>What am I missing?</p> </blockquote> <p>You are probably missing at least that your repository works (do check), which will confirm that the needed key is in fact installed.</p> <p>You may be missing that the <code>signed-by</code> option is not needed or intended for marking or using a signed repositor...
Add signed APT repo using Puppet
ubuntu|devops|puppet|apt
1
60
1
72,876,758
72,876,758
1
true
2022-07-04T12:47:14.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add signed APT repo using Puppet<p>I want to install Telegraf using Puppet 6, and I'm finding it really difficult to do so by using the <code>apt</code> modu...
72,882,262
Laravel Request validation for 4 digits which is also not requried parameter<p>I want to validate a pin code that is just for 4 digits and it should not be required. means pin code is only 4 digits. like 1234, 8675, or if the user does not enter any digits to Pincode input type let the user submit the form. I want to ...
<p>You can validate the request (or use a form request) that allows <code>pin</code> to be <code>null</code> otherwise validates it is a 4 digit number. You can then get the <code>pin</code> from the input or fallback to the default value of <code>1111.</code></p> <pre class="lang-php prettyprint-override"><code>$reque...
Laravel Request validation for 4 digits which is also not requried parameter
laravel|validation
1
60
2
72,882,466
72,882,466
1
true
2022-07-06T10:51:00.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Request validation for 4 digits which is also not requried parameter<p>I want to validate a pin code that is just for 4 digits and it should not be r...
72,882,744
prevent parent element from to disappear focus when input is clicked<p>I have an input in div. When this input is clicked, the focus of the div is disappear. How can I prevent this?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class...
<p>You just have to use <code>:focus-within</code> pseudo-class. This matches an element if the element or any of its descendants are focused.</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-css lang-css prettyprint...
prevent parent element from to disappear focus when input is clicked
javascript|html|css
0
60
1
72,882,786
72,882,786
1
true
2022-07-06T11:23:06.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: prevent parent element from to disappear focus when input is clicked<p>I have an input in div. When this input is clicked, the focus of the div is disappear....
72,882,470
How to reference the value of an environment variable with using another environment variable value in variable name?<p>I know that similar questions have been asked before and I have seen them but neither does <code>!var[%Z%]!</code> nor <code>%var[!Z!]%</code> work here:</p> <pre><code>@echo off set Z=0 setlocal enab...
<p>I'm assuming that this was your intention, <em>(small modifications included)</em>. i.e. to be able to two way cycle through the data items using the <Kbd>Q</Kbd> and <Kbd>E</Kbd> keys.</p> <p><em>Code as per the suggestion in my comment:</em></p> <pre class="lang-bash prettyprint-override"><code>@Echo Off SetLocal ...
How to reference the value of an environment variable with using another environment variable value in variable name?
batch-file|variables
0
60
1
72,883,358
72,883,358
1
true
2022-07-06T11:04:41.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reference the value of an environment variable with using another environment variable value in variable name?<p>I know that similar questions have be...
72,883,635
How do I create a cumulative sum graph in Palantir Foundry Workshop?<p>I have some objects that represent maintenance jobs, each with a time column like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Due On</th> </tr> </thead> <tbody> <tr> <td>2021-12-01</td> </tr> <tr> <td>2022-06-1...
<p>You can do this using a Foundry Function. Create a TypeScript functions repository and use the following code (see comments inline for an explanation):</p> <pre class="lang-js prettyprint-override"><code>import { Function, Double, ThreeDimensionalAggregation, IRange, IRangeable, Timestamp, BucketKey, BucketValue } f...
How do I create a cumulative sum graph in Palantir Foundry Workshop?
palantir-foundry|foundry-code-repositories|foundry-workshop|foundry-functions
2
60
1
72,883,636
72,883,636
1
true
2022-07-06T12:32:57.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create a cumulative sum graph in Palantir Foundry Workshop?<p>I have some objects that represent maintenance jobs, each with a time column like this...
72,883,356
Is it possible to use FyTest in Microsoft Visual Studio without CMake?<p>I am developing on an old legacy code in Fortran, and I am trying to implement unit testing to enable a more secure development environment. From all the options given in the Fortran Wiki on <a href="https://fortranwiki.org/fortran/show/Unit+testi...
<p>There is no native support for <strong>FyTest</strong> is VS2010, nor in any other VS version. Your best option would be bundeling the <strong>FyTest</strong> <code>CMakeLists.txt</code> into your CMake project (there is no direct dependency between your selected IDE and the CMake project for that matter).</p>
Is it possible to use FyTest in Microsoft Visual Studio without CMake?
visual-studio|cmake|fortran
1
60
1
72,884,812
72,884,812
1
true
2022-07-06T12:11:56.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to use FyTest in Microsoft Visual Studio without CMake?<p>I am developing on an old legacy code in Fortran, and I am trying to implement unit ...
72,888,136
Trying to parse xml line for specific values associated with a tag using element tree in python<p>I am currently struggling trying to figure out how to parse out specific information from a specific tag that is in a xml file.</p> <p>The xml file is structured as such</p> <pre><code>&lt;?xml version=&quot;1.0&quot; enco...
<p>Does this help?</p> <pre><code> import xml.etree.ElementTree as ET someXML = '''&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;configuration&gt; &lt;configSections&gt; | | &lt;/configSections&gt; &lt;connectionStrings&gt; &lt;clear /&gt; &lt;add name=&...
Trying to parse xml line for specific values associated with a tag using element tree in python
python|python-3.x|xml|elementtree
0
60
1
72,888,855
72,888,855
1
true
2022-07-06T18:09:10.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to parse xml line for specific values associated with a tag using element tree in python<p>I am currently struggling trying to figure out how to parse...
72,896,822
How do I create a compound dtype numpy array from existing individual vectors?<p>I am learning about <code>dtypes</code> in numpy and I have the following doubt.</p> <p>I can define a compound type as follows:</p> <pre><code>myrecord = np.dtype([ ('col1', 'u4'), ('col2', 'f8') ]) </code></pre> <p>If I have two ...
<p>You're almost there! You have to zip the <code>a</code> and <code>b</code> columns together when creating <code>c</code>:</p> <pre><code>import numpy as np myrecord = np.dtype([ ('col1', 'u4'), ('col2', 'f8') ]) a=np.array([1,2,3,4]) b=np.array([10.1,20.1,30.1,40.1]) c = np.array(list(zip(a, b)), dtype=my...
How do I create a compound dtype numpy array from existing individual vectors?
python|numpy|numpy-ndarray|dtype
0
60
1
72,897,031
72,897,031
1
true
2022-07-07T11:13:41.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create a compound dtype numpy array from existing individual vectors?<p>I am learning about <code>dtypes</code> in numpy and I have the following do...
72,895,475
Cascading delete on tables with composite primary key that are also foreign keys of multiple tables, in SQLite and SQLAlchemy<p>I am trying to cascade delete records from a table where the primary key is made up of two foreign keys pointing to two different tables. The database I am using is SQLite using a reflection o...
<p>In the end, I solved it by adding NOT NULL to the foreign key fields.</p> <pre><code>&quot;id_execution&quot; INTEGER NOT NULL, &quot;id_individual&quot; INTEGER NOT NULL, </code></pre>
Cascading delete on tables with composite primary key that are also foreign keys of multiple tables, in SQLite and SQLAlchemy
sqlite|sqlalchemy|key|cascade|automap
1
60
1
72,898,851
72,898,851
1
true
2022-07-07T09:31:53.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cascading delete on tables with composite primary key that are also foreign keys of multiple tables, in SQLite and SQLAlchemy<p>I am trying to cascade delete...
72,899,390
Is there syntactic sugar for calling a function on each element of a list in JavaScript?<p>Let's say I had the following code:</p> <pre><code>let array = [1, 2, 3] array.forEach(x =&gt; someFunc(x)) </code></pre> <p>In Java, I know the second line could be simpler using <code>Stream</code>s (at least for static methods...
<p>In the simplest case, you can replace</p> <pre><code>array.forEach(x =&gt; someFunc(x)) </code></pre> <p>with just</p> <pre><code>array.forEach(someFunc) </code></pre> <p>but there's some fine print you should be aware of:</p> <ul> <li><p>this generally doesn't work with object methods: <code>.forEach(someObj.someMe...
Is there syntactic sugar for calling a function on each element of a list in JavaScript?
javascript|foreach|stream|syntactic-sugar
0
60
2
72,899,671
72,899,671
1
true
2022-07-07T14:14:03.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there syntactic sugar for calling a function on each element of a list in JavaScript?<p>Let's say I had the following code:</p> <pre><code>let array = [1,...
72,903,826
FizzBuzz in Ruby with without 3 && 5<p>Ok so I'm trying to hash this out for practice. So my thought is that we could prevent an extra check from the <code>num % 3 == 0 &amp;&amp; num % 5 == 0</code></p> <p>1 2 -Fizz +3 4 Buzz -Fizz +6 7 8 -Fizz +9 Buzz 11 -Fizz +12 13 14 FizzBuzz</p> <p>With this attempt we are missin...
<p>A method in Ruby returns the value of its last expression unless you explicitly <code>return</code>.</p> <p>Your last expression is:</p> <pre><code> if num % 5 == 0 result &lt;&lt; &quot;Buzz&quot; else num end </code></pre> <p>In this case, if the number is not divisible by <code>5</code>, you just ret...
FizzBuzz in Ruby with without 3 && 5
ruby|conditional-statements|fizzbuzz
0
60
3
72,903,943
72,903,943
1
true
2022-07-07T20:24:36.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FizzBuzz in Ruby with without 3 && 5<p>Ok so I'm trying to hash this out for practice. So my thought is that we could prevent an extra check from the <code>n...
72,886,578
How to turn the Vega timeline example of the first five US Presidents into one of the first five Canadian Prime Ministers?<p><a href="https://vega.github.io/vega/examples/timelines/" rel="nofollow noreferrer">https://vega.github.io/vega/examples/timelines/</a> shows a timeline visualization of the lifespans of the firs...
<p>To have unlimited terms for each president, have a dataset &quot;terms&quot; with each record being a president's term of office:</p> <pre><code> &quot;data&quot;: [ { &quot;name&quot;: &quot;people&quot;, &quot;values&quot;: [ {&quot;label&quot;: &quot;Washington&quot;, &quot;born&quot;: -7...
How to turn the Vega timeline example of the first five US Presidents into one of the first five Canadian Prime Ministers?
timeline|vega
-1
60
2
72,914,325
72,914,325
1
true
2022-07-06T15:53:05.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to turn the Vega timeline example of the first five US Presidents into one of the first five Canadian Prime Ministers?<p><a href="https://vega.github.io/...