input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the destination (targetline) of agents/pedestrians in anylogic?<p>Now I use pedsource to generate pedestrians in Main, and set 4 targetlines. Ped...
<p>There are various calls for pedestrians to get their target location: <a href="https://i.stack.imgur.com/DIsQh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DIsQh.png" alt="enter image description here" /></a></p> <p>If you need to get the <code>TargetLine</code> that is set when they enter a &q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort array object based on another array in javascript<p>How can i sort and rearrange an array that looks like this</p> <pre><code>fields = [ { uid: '2...
<p>You need to use <code>sort</code> method on the array. And then compare the index of <code>field</code> on the order array.</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>c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read_excel(), A column of string, but in excel format, it is date and cause error<p>My <code>data.xlsx</code> is something like this</p> <pre><code> Number ...
<p>Excel represents dates with a &quot;serial&quot; number, starting from 1 for 01.01.1900 up to 2958465 for 31.12.9999. So both Pandas and Excel complain about your values because they cannot be interpreted as date. Just change the cell format,it is simply wrong.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested generic impl<p>I don't understand why rust don't allow to use a generic inside an other generic constraint.</p> <p>It's difficult to explain with norm...
<p>What that compiler error is saying is, with that impl block definition, it would not be able to determine the appropriate type to substitute in for <code>T1</code>. Let's look at a concrete example to demonstrate this:</p> <pre class="lang-rs prettyprint-override"><code>pub trait Trait&lt;T&gt; { fn foo(&amp;sel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Built-in led won't turn on STM32F303RE Nucleo board<p>I am trying to turn the led (LD2 in schematic) inside the nucleo board on using only registers with the...
<p>I ran through your code with reference manual in hand. <a href="https://www.st.com/resource/en/reference_manual/dm00043574-stm32f303xb-c-d-e-stm32f303x6-8-stm32f328x8-stm32f358xc-stm32f398xe-advanced-arm-based-mcus-stmicroelectronics.pdf" rel="nofollow noreferrer">RM0316 STM32F303 Reference manual</a>.</p> <p>You ac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The definition of `rand()` in GCC 9.3.0<p>I come to cross <code>rand()</code> in <code>C</code> and found <code>srand()</code> could only guarantee the repro...
<p>gcc is a compiler and as such won't itself have an implementation. <code>srand</code> is part of the C standard library (libc), the implementation of which is probably glibc on your system.</p> <p>The following will use the tip of the master branch for glibc at the time of writing. The version used on your system ma...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to substring from a certian index to the end in SQL<p>I want to get the substring from e.g. START=3 to the end of the string.</p> <div class="s-table-con...
<p>You can try this query</p> <pre><code>select SUBSTR(Str,3,LENGTH(Str)-3+1) as Str; </code></pre> <p>or</p> <pre><code>select SUBSTR(Str,3) as Str; </code></pre> <p><a href="https://www.w3schools.com/sql/func_mysql_substr.asp" rel="nofollow noreferrer">substr function w3schools link</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failing to validate merkle proof on smart contract<p>I'm using a copy of Invisible Friends NFT contract (<a href="https://etherscan.io/address/0x59468516a825...
<p>I managed to fix the issue.</p> <p>So instead of</p> <pre><code>keccak256(addr.concat(&quot;5&quot;))); </code></pre> <p>I used</p> <pre><code>keccak256(ethers.utils.solidityPack([&quot;address&quot;, &quot;string&quot;], [addr, &quot;5&quot;])) </code></pre> <p>Now it works fine!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change text after button click using Bloc flutter<p>So I'm learning basics of bloc and I wanted to know how to change a text using a button without se...
<p>actually it is changed every time you press but every time the value gone to the bloc 1 and back 2 so you did not see the effection</p> <p>just change the following line</p> <pre><code>onPressed: () =&gt; BlocProvider.of&lt;SecscreenBloc&gt;(context).add(LoadSecscreenEvent( numm )),...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Input value not changing when i have preexisting value<p>I have an ArticleFields component that loads an <strong>article object</strong> (through location.st...
<p>Use defaultValue instead of value:</p> <pre><code>value={article.title} </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does the number of rules in AWS VPC security groups is calculated?<p>In my control panel I see a security group which has a count of 250 rules, but I onl...
<p>Ok, so it's not a glitch. After talking to AWS support, turns out that the number of permission entries in this case is calculated from (hold tight) sum of maximum possible entries of each Source (see the sources column on screenshot). In this case, sources were Managed Prefix Lists, and the maximum number of entrie...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PySpark Design Pattern for Combining Values Based on Criteria<p>Hi I am new to PySpark and want to create a function that takes a table of duplicate rows and...
<p>I think you can solve this using <a href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.functions.when.html" rel="nofollow noreferrer">pyspark.sql.functions.when</a> . See this <a href="https://danvatterott.com/blog/2019/02/05/complex-aggregations-in-pyspark/" rel="nofollow noreferrer">bl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS problem with the month of February in non-leap months<p>I am implementing a simple calendar, but i have a problem with all non-leap fever months.</p> <p>I...
<p>If you wait for two days the problem will be solved hehe (today is 29/06, you are iterating over, 29/07, 29/08, etc.).</p> <p>Or you could change day of the month object before incrementing the month.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="sni...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Properly set default selections with RecycleView (Python/Kivy)<p>I want to use Kivy's <code>RecycleView</code> to make a multiline scrollable selection list,...
<p>After some diggings, I drop the <code>SelectableLabel</code> approach and adopted <code>Button</code> to do the trick. I'm registering my working custom RecycleView here to others:</p> <pre><code>from kivy.app import App from kivy.lang import Builder from kivy.uix.button import Button from kivy.uix.recycleview impor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding the exact match in the values in the categorical variables<p>I wanted to find an exact match in the values between all three columns (rg1,rg2,rg3).Be...
<p>You can sort across the columns, then look for duplicates.</p> <pre class="lang-r prettyprint-override"><code>set.seed(1234) df &lt;- tibble(Userids = 1:20, rg_1 = sample(1:20, 20, TRUE), rg_2 = sample(1:20, 20, TRUE), rg_3 = sample(1:20, 20, TRUE)) df[4, -1] &lt;- rev(df[15...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text to column task in Python<pre><code>; ; ACHTUNG;Dies ist das Ergebnis einer Testversion. Alle Ergebnisse ohne Gewaehr. ;Bei Rueckfragen oder Unstimmigkei...
<p>Do you have to keep every row in your csv file? This will be a slight problem because you do not have enough delimiters per row to account for each column. This code will open your file, check how many delimiters each row needs, add the appropriate number of delimiters, save the new csv file with those delimiters, t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate a list of all possible "patterns" of letters<p>I'm trying to find a way to generate all possible &quot;patterns&quot; of length <code>N</code> out o...
<p>One of the comments, from @JacobRR, was very close to what we need. Each &quot;pattern&quot; actually corresponds to partitioning of set {1, 2, ..., N} into K subsets. Each subset (even empty!) corresponds to the positions where letter l_k should be placed (l_1 = A, l_2 = B etc.). There's a demo here. <a href="https...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is mongoose findOne guaranteed to return the latest inserted doc it finds?<p>I have the following in the database:</p> <pre><code>username: Murat1010 firstNa...
<p>No it's not guaranteed. Read <a href="https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/" rel="nofollow noreferrer">here</a> I would do:</p> <pre><code>const newestMember = await Users.findOne({city: &quot;İstanbul&quot;}).sort({createdAt: -1}) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Bootstrap should separate input fields be put inside own col or share col to keep them together, right justified<p>In Bootstrap should separate input fiel...
<h1>The solution</h1> <p>It's very easy, you were close. Do the following:</p> <ol> <li>Remove the class <code>ms-auto</code> from both <code>col-2</code> elements.</li> <li>Add classes <code>d-flex align-items-center</code> to the second <code>col-2</code> element to center the content vertically.</li> </ol> <p>See th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find only specific key from mongodb using pymongo<p>I have written this code and I want to check only for a key named <code>Virtual_Machines</code>. I have d...
<p>The first parameter in <code>find_one()</code> must be a <code>dict</code>. You are getting your error because you are passing <code>{&quot;Virtual_Machine&quot;}</code> which python interprets as a <code>set</code> <a href="https://docs.python.org/3/library/stdtypes.html#set" rel="nofollow noreferrer">https://docs....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install vim in a docker image based on mysql version 8?<p>I had been using mysql version 5.7 and this was working.</p> <p><em>Dockerfile (working)</em...
<p>If you take a look at the Tag for 8.0 you can see that the base uses a different version of Oracle linux (8 vs 7). Yum is not installed in 8. Instead, there's a minimal installer (microdnf). So this substitution should work for you:</p> <pre><code>microdnf install -y vim </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple COSMOSDB query from DataBricks problems<p>I am writing a replacement PySpark routine for a pydocumentdb library based function that no longer works du...
<p>So I have managed to find the issue.</p> <p>Looking at the first example , when you look at the container address returned its : <a href="https://i.stack.imgur.com/Q8DEO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q8DEO.png" alt="enter image description here" /></a></p> <p>You can see that the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Nuxt.js Server Side Rendering Work?<p>I mostly work with Next.js for web projects. Work demands I work on a project that uses Nuxt.js (v2).</p> <p>I...
<p>I'm working with Nuxt 3 and as far as I know you can use <code>useAsyncData()</code> and <code>useFetch()</code> in both client and server. Nuxt 3 SSR universal works fine with SEO because crawlers not cache files so every request is separate, so crawlers get every time SSR HTML file from server. You can use secrets...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prefix every line of bash script output with time since script start<p>Main question in the title: I want to prefix every line of script output with time sin...
<p>You could add a line into the top of your <code>bash</code> script like this:</p> <pre><code>#!/bin/bash exec &gt; &gt;(trap &quot;&quot; INT TERM; while read line ; do printf &quot;%d: %s\n&quot; $SECONDS &quot;$line&quot;; done ) for ((i=0;i&lt;10;i++)) ; do sleep 1 echo hello done </code></pre> <hr /> <p>If...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use a string argument whenever MDN use the term "Number" argument?<p>While reading <code>Intl.NumberFormat.prototype.format</code>, I found out that th...
<p>A <em>lot</em> of built-in objects, methods, and functions are pretty loose with their types. Often, if you pass a type that isn't, strictly speaking, sensible to use with the method, the engine will attempt to coerce it for you. That's what's happening here too.</p> <p>The behavior <a href="https://tc39.es/ecma402/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Clearing Date picker in PySimpleGUI<p>I'm having trouble with the CalendarButton in PySimpleGUI whereby when I clear user input it also clears the title of t...
<p>All the items in <code>values</code> are not only for <code>Input</code> elements, but also some other elements, like the <code>CalendarButton</code> element here. It will also update the text of <code>CalendarButton</code> if you call your function <code>clear_input</code>.</p> <p>Try to specify the condition for w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Authorization string is not same when generate with golang and JS<p>I have problem with Golang to generate the correct the correct Authorization string for A...
<p>Both the snippets have different data to sign. The JS has some env vars that are used which might be different. I have taken those values from the Go code.</p> <p>Go code: <a href="https://go.dev/play/p/gnYKM9-CNi9" rel="nofollow noreferrer">Go Playground example</a></p> <pre><code>// You can edit this code! // Clic...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bar with different color<p>I am working with matplotlib and below you can see my data and my plot.</p> <pre><code>data = { 'type_sale': ['g_1','g_2'...
<p>The <code>ax.bar()</code> method returns a list of bars that you can then manipulate, in your case with <code>.set_color()</code>:</p> <pre><code>import matplotlib.pyplot as plt f=plt.figure() ax=f.add_subplot(1,1,1) ## bar() will return a list of bars barlist = ax.bar([1,2,3,4], [1,2,3,4]) barlist[3].set_color('...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: [Heap]- after removing a node, should you run siftDown for all nodes or just the root?<p>I have seen implementations of binary heap where after removal of a ...
<p>There’s no need to run heapifyDown / siftDown on all elements after removing the minimum. That will indeed fix the heap, but it takes time O(n) to do this, which is pretty slow and defeats the purpose of having a binary heap. Instead, the traditional algorithm is to swap the last element of the heap to the top, then...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing JSON Ansible returns undefined value<p>This is the JSONcontent I registered:</p> <pre><code>results:[{ &quot;json&quot;: { &quot;item&quo...
<p>Q: <em><strong>&quot;Table where metrics2 value as column1 and metrics3 value as column2.&quot;</strong></em></p> <p>A: For example,</p> <pre class="lang-yaml prettyprint-override"><code>tab_m2_m3: &quot;{{ param|json_query('[][].[metrics2, metrics3]') }}&quot; </code></pre> <p>gives</p> <pre class="lang-yaml pretty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to connect to a Windows EC2 instance using Ansible?<p>From reading the <a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_wind...
<p>I have found you need to do the following to connect to a Windows EC2 instance using Ansible:</p> <ul> <li>You need to configure the EC2 to allow connections from Ansible using the <a href="https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" rel="nofollow noreferrer"><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does mutex lock in match cause a deadlock even in the None case?<p>The following code only reaches the &quot;Obtaining Lock...&quot; print statement, and...
<p>Obviously the configuration mutex is not released. <code>The lock()</code> function waits to get the lock. In this case, you locked it earlier and it wasn't released.</p> <p>The lock of the <a href="https://docs.rs/tokio/0.3.7/tokio/sync/struct.Mutex.html" rel="nofollow noreferrer">mutex</a> in that library</p> <bl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get value of a child based on the text of another child within the same JavaScript parent<p>so I want to be able to get &quot;Text B&quot; from the ta...
<p>To get the table containing &quot;Party B&quot;, specify the selector inside <code>.contains()</code></p> <pre class="lang-js prettyprint-override"><code>cy.contains('div.table', 'Party B') // returns the table with &quot;Party B&quot; inside somewhere .find('div.text') // find the 2nd child whi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there solution to this error "TypeError: can only concatenate str (not "NoneType") to str"?<p>My Code in Flask</p> <pre><code> print('Image List= ', im...
<p>You are building a string concatenating vars, but one of them is not a string, it is <code>None</code> instead. My guess is that the error happens in this line (next time add the full stack trace please):</p> <pre><code>filenameArr[i] = Provider_Name + '/' + Order_ID + '/' + Visit_ID + '/' + filenameArr[i] </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use Model in EditForm<p>I'm a little confused about how to reference an object in the Model attribute of EditForm. I've seen @person and simply perso...
<p><a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-6.0#component-parameters" rel="nofollow noreferrer">Microsoft recommends</a> the use of the '@' prefix for nonliterals - even when they are not strictly required.</p> <blockquote> <p>Outside of string parameters, we recommend us...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text not rendered on Safari when applied with custom SVG filter via CSS<p>I wrote a custom SVG filter to draw strokes around text and icons. The filter is th...
<p>Removing all the <code>x</code>, <code>y</code>, <code>width</code>, and <code>height</code> attributes from the filter nodes did the trick. Thanks @Kaiido for the comment!</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snip...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to have a stop value to the sequence generated by SEQUENCE() function in Google Sheets<p>I was trying to generate a descending sequence in <strong>Google...
<p>Use the following</p> <pre><code>=SEQUENCE(A1+1,1,A1,-1) </code></pre> <p>To omit the <code>0</code> values try:</p> <pre><code>=SEQUENCE(A1,1,A1,-1) </code></pre> <p><a href="https://i.stack.imgur.com/9u6hf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9u6hf.png" alt="enter image description he...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explain why Python virtual environments are “better”?<p>I have yet to come across an answer that makes me WANT to start using virtual environments. I underst...
<blockquote> <p>I'm a data scientist and sometimes I run into these things called &quot;virtual environments&quot; and I don't get what the use case is? I already have all of these packages and modules and widgets downloaded! Why should I set up a separate place where I manage all of the stuff I'm already managing glob...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to point a single spring actuator endpoint to the root ("/")<p>I have a requirement to expose a health endpoint on the root path on the specific port.</p...
<p>After conversations with multiple engineers, it seems like my solution with redirect is the only possible one.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do new variable names need to be on the left of the equals (=)?<p>I am curious as to why a certain format produces an error while the other doesn't.</p> ...
<p>Those say two entirely different things. The second one takes three objects (first_name, middle_name, last_name), then builds them into a tuple, and assigns that to <code>name</code>. That's clearly not what you want, since those three names do not exist. Your first example takes the three parts of the variable <cod...
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...
<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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trouble with creating bar & pie subplot with R plotly<p>I've created a Plotly bar and pie chart and want to combine them to form one chart.</p> <p>When I use...
<p>Pie charts and <code>plotly::subplot()</code> are notoriously challenging - though you can get around many of the issues by specifying the domain manually. Below I have changed the <code>pie</code> code by specifying the <code>domain = list(...)</code> as so:</p> <pre><code>pie &lt;- plot_ly(data = pie_tibble, label...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set the minimum TLS version as 1.2 for API Gateway<p>I have api gateway for lambda such as</p> <pre><code>https://x6c5e11xkc.execute-api.ap-northeast-1.amazo...
<p>A custom domain is the domain you own like mydomain.com and you can set on API Gateway console, on top of that, you can use ACM(AWS Certificate Manager) to be assigned to that custom domain by applying the TLS policy you want (1.0 or 1,2 is preferred ), so navigate to ACM and create a certificate for your domain, an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to covert int array to List using Arrays.asList gives wrong value<p>So I am trying to convert an (primitive) int array to a List,</p> <pre><code> ...
<p><code>Arrays.asList(arr)</code> does not creates a <code>List&lt;Integer&gt;</code> but a <code>List&lt;int[]&gt;</code> with a single element (your <code>arr</code>). You have to declare your variable as <code>Integer[] arr</code> if you have to use 'Arrays.asList'.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to center items in a div (CSS) in a grid (justify-content and align-items not working)<p>I have a div with <code>grid</code> layout, with several divs in...
<p>If I am not mistaken it should be so. Just on the &quot;card&quot; class:</p> <p>display: flex; align-items: center;</p> <p>Adding a div inside will put it in the center.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply array formula taking data from another table?<p>We have two tables in Google Sheets.</p> <p>First:</p> <div class="s-table-container"> <table cl...
<p>Use <code>VLOOKUP</code> to find the correct date row and <code>MATCH</code> to find which column the value is in:</p> <pre><code>=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A,I2:L,MATCH(C2:C,I1:L1,0))*B2:B)) </code></pre> <p><a href="https://i.stack.imgur.com/Bv9gm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to communicate between 3 nested components of blazor C# in two-way binding asp.net core (from parent to its grandchild vice versa)<p><strong>I need to co...
<p>I founded the case and came up with answer in terms of blazor. Refer below example</p> <p><strong>Child2.razor</strong></p> <pre><code>@code{//some code} </code></pre> <p><strong>Child1.razor</strong></p> <pre><code>//No UI, only methods in code behind @code{ public void Show() { // TODO ac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI macOS onDrop simple text always fails<p>Trying to implement a simple drag-drop of a text file:</p> <pre class="lang-swift prettyprint-override"><code...
<p>Just modified and tested with plain .txt file. Xcode 13.3 / macOS 12.3.1</p> <pre><code> @State private var text = &quot;Drop Here&quot; var body: some View { Text(text) .frame(width: 200, height: 200).border(.red) .onDrop(of: [&quot;public.file-url&quot;], isTargeted: $dragOve...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generating XML in specific format from SQL query<p>I need to generate XML from following table</p> <pre><code> DECLARE @tempXML AS TABLE ( ID ...
<p>Please try the following solution.</p> <p>It is using XQuery and its FLWOR expression.</p> <p>Simple and easy, almost visually crafting XML process, no guess work.</p> <p>The desired output XML is composed in two steps:</p> <ol> <li>Creating raw XML via <code>FOR XML PATH('r'), TYPE, ROOT('root')</code></li> <li>Com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot generate .pem from new .jks file<p>I want to upload a new app to Huawei App Gallery. To do so, you have to upload a .pem file. According to documentat...
<p>As Robert pointed out, Android studio now generates a .p12 file (even if you give it a jks extension like in the documentation).</p> <p>To generate a .prem, you can do:</p> <pre><code>openssl pkcs12 -in filename.jks -out filename.pem -nodes </code></pre> <p>where filename.jks is actually a .p12 file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most efficient way for process string escaping - Scala<p>I'm using these 2 ways of processing string escaping a lot in the code:</p> <p>1.</p> <pre><code>if ...
<p>The code you provided is some thing like this:</p> <blockquote> <p>Given some banned strings such as [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], if my string contains either of these string, go replace all the &quot;a&quot;s and &quot;b&quot;s and &quot;c&quot;s</p> </blockquote> <p>So actually the checking part ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Include class files and assembly names in .NET6 upgraded project<p>I'm upgrading my project from <code>.netframework</code> v4.6.2 to <code>.net6</code> via...
<p>The line at the top of your file <code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;</code> says that it should use that Sdk to build your project. This leads to importing a whole host of other files located in the versioned SDK folder of your computer (<code>%ProgramFiles%dotnet\sdk\&lt;version&gt;\Sdks\Microso...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails Apnotic OpenSSL alert certificate expired error<p>I'm trying to send Apple Push Notifications from a Rails app using the Apnotic gem.</p> <p>I get the ...
<p>Check your certificate, open it by your desktop environment and see if the date is between <code>not valid before</code> and <code>not valid after</code>.</p> <p><a href="https://i.stack.imgur.com/8RLEn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8RLEn.png" alt="paste key to file and save with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter within dplyr::summarise to make calculation<p>I need to use information from a subset of my data within a <code>dplyr::summarise</code> function.</p> ...
<p>You can try,</p> <pre><code>library(dplyr) q%&gt;% ungroup()%&gt;% group_by(type)%&gt;% summarise(Total = n(), working_at_6m = sum(case_when(!is.na(fail) &amp; interval(create,fail)/months(1) &gt;= 6 ~T, last_for_unit ==T &amp; interval(create,last)/months...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to build matrix with concentric "rings" of values<p>Say I have a vector <code>Q = [Q1 Q2 .... QN]</code>.</p> <p>I would like to create a matrix ...
<p>The logic of the code is lightly simpler if you follow the advice <a href="https://stackoverflow.com/questions/72378191/fastest-way-to-build-matrix-with-concentric-rings-of-values?noredirect=1#comment127865286_72378191">in Wolfie's comment</a>, and compute only one quadrant that you repeat:</p> <pre class="lang-matl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Boot Unittest with Junit5 Service layer response null but 201 Created<p>Can anybody help with to deal with this problem about Junit5 for SpringBoot Al...
<p>You forgot? to tell mockito what to return when a method on garbageTypeRepository is called. For example for your first test I would expect something like this:</p> <pre><code>@Test void getGarbage_typeById() throws JsonProcessingException { Garbage_type toBeReturned = new Garbage_type(); Mockito.when(garba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: blazor webassembly wasm windows authentication / negotiate+ jwt as api protection<p>im building some blazor wasm app i have to use windows autch because it i...
<p>ok so for future searchers.</p> <p>//update i created a git repo where i created sample app that use windows auth + authStateProvider + jwt for accessing api in .net 6 + swagger where we can also run getuser method, grab JWT token and paste as authorization for it.</p> <p>it is not perfect but decent. so everyone ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use dplyr::select's where with base R grepl and anonymus function<p>There is a very similar question here: <a href="https://stackoverflow.com/questions/43314...
<p>You could just use <code>grep()</code> with <code>select()</code> without the <code>where()</code> function.</p> <pre class="lang-r prettyprint-override"><code>mtcars %&gt;% select(grep(&quot;^[a-zA-Z]{3}$&quot;, names(.))) </code></pre> <p>Your initial attempt didn't work because in this code:</p> <pre class="la...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining INDEX(MATCH()) with ARRAYFORMULA() fails<p>I need a formula for the <code>VariantAttribute</code> column, which fills in the <code>ProductAttribute...
<p>Assuming the dash (&quot;-&quot;) is consistent.</p> <pre><code>=ARRAYFORMULA(IF(D2:D=&quot;&quot;,,VLOOKUP(INDEX(SPLIT(D2:D,&quot;-&quot;),,1),A:B,2,0)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: efficient way of getting unique values by comparing columns in two dataframes pandas<p>I have two dataframes, something like below:</p> <pre><code> df1: ...
<p>Use:</p> <pre><code>df2.loc[~df2['col1'].isin(df1['col1']), 'col1'].unique() </code></pre> <p>output: <code>array(['XYZ', 'PQR'], dtype=object)</code></p> <p>Or, with sets:</p> <pre><code>set(df2['col1']) - set(df1['col1']) </code></pre> <p>output: <code>{'PQR', 'XYZ'}</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node pg update multiple rows in one query (error: operator does not exist: text = integer)<p>I have the following query:</p> <pre class="lang-js prettyprint-...
<p>I had to change this part of the query:</p> <pre><code>c.id = t.id </code></pre> <p>to the following:</p> <pre><code>c.id = t.id::int </code></pre> <p>Notice the <code>::int</code> part. I'm not sure why node pg requires the cast but everything seems to be working fine now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Migrating a filter from XML to pure Java Config<p>I am trying to migrate a project from a mixed XML/Java configuration to pure Java Config (not yet Java DSL,...
<p>There is just enough to do like this:</p> <pre><code>@Filter(inputChannel = &quot;channelA&quot;, outputChannel = &quot;channelB&quot;) public boolean selector(@Header(&quot;file_name&quot;) String name, @Header(&quot;file_relativePath&quot;) String relativePath) { </code></pre> <p>See docs f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django does not create foreign key in sqlite table<p>I use sqlite in a Django project. I created a model called Employee, and then Education, but I forgot to...
<p>As Iain Shelvington pointed out, this is a mistake in code that line has extra comma. This is a frequent mistake for programmers of other languages when writing python :(</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import a dependency's .vue file<p>I encountered this line of code in a vue project here <a href="https://github.com/InfinetyEs/Nova-Filemanager/blob/c...
<p>The project relies on <code>v-viewer</code> internals, which is a dangerous thing to do because they aren't guaranteed to exist.</p> <p>This is the case here. There is loose version constraint, <code>&quot;v-viewer&quot;: &quot;^1.4.2&quot;</code>, and <code>src</code> was removed in later versions. You can either f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas Dataframe sum row based on column header<p>I have the following dataframe and want to create two columns, one will show the amount MTD and the other w...
<p>You can try <code>sum(axis=1)</code> by slicing the datetime like columns to calculate <code>YTD</code> and just use <code>loc</code> to get <code>MTD</code></p> <pre class="lang-py prettyprint-override"><code>EndDate = '31/03/2022' date_cols = df.filter(regex='\d{2}/\d{2}/\d{4}') date_cols.columns = pd.to_datetime(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgreSQL: How to truncate and group timestamps?<p>I am working with a database and am using the following query:</p> <pre><code>SELECT evt_block_time, ...
<p>The problem is you're selecting <code>evt_block_time</code> from the subquery, but the subquery no longer contains <code>evt_block_time</code>, it contains <code>date_trunc('week', evt_block_time)</code>.</p> <p>To fix this, give it a name like <code>evt_block_week</code> and select that.</p> <p>Since it's a calcula...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: str.contain "\" should only be used as an escape character outside of raw strings<p>I have a dataframe with one column and i want to know if the value of the...
<p>There is a difference between escaping the characters in python to be interpreted as a special character (e.g. <code>\n</code> is a newline and has nothing to do with <code>n</code>), and escaping the character not to be interpreted as a special symbol in the regex. Here you need both.</p> <p>Either use a raw string...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create dictionary from 3 lists - python<p>Looking for some help in creating a dictionary using 3 python lists</p> <pre><code>a = ['alpha','bravo','charlie'] ...
<p>The <code>dict</code> comprehension can <code>zip</code> all three iterables at once, and just include a <code>dict</code> literal for the sub-<code>dict</code>:</p> <pre><code>{k: {'letter': let, 'number': num} for k, let, num in zip(a, b, c)} </code></pre>
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...
<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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to draw sphere in OpenGL, Only part of the sphere is showing, seems clipped?<p>I created a minimal setup with a fragment shader setting the color to w...
<p>The <em>size</em> argument of <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferData.xhtml" rel="nofollow noreferrer"><code>glBufferData</code></a> specifies the size in bytes of the buffer object's new data store:</p> <p><s><code>glBufferData(GL_ARRAY_BUFFER, resolution, vert, GL_STATIC_DRA...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jenkins, docker and kubernetes (minikube)<p>i'm using Jenkins to deploy pipeline, so first step i did it is deploying jenkins to minikube, and it's work at f...
<p>It looks like the secret is not mounted for deployment you can do it following</p> <ol> <li><p>create secret using</p> <p><code>kubectl create secret jenkins --from-literal jenkins_password=&quot;ADD YOUR SECRET TOKEN Which you will find in jenkins pod logs&quot;</code></p> </li> </ol> <p>and mount it like this</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Weird behavior of JS function "every()"<p>Please, can someone explain me behavior of function <strong>every</strong>.</p> <p>I have an array and I want to ap...
<p><code>...arg</code> is like a passing of all the arguments that <code>.every</code> method accepts.</p> <p>i.e. An array <code>element</code>, <code>index of the element</code> and a <code>whole array</code>.</p> <p>Hence, to print values as an array. You can simply return the values in a square bracket.</p> <p>Demo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Documenting name / email of author of Go file<p>How is the author of a go file documented?</p> <p>The <a href="https://go.dev/doc/comment" rel="nofollow nore...
<p>Go doesn't have this thing. You can see the source repository from the import string though, also go.mod contains all the dependencies. Adding a readme file on the repository is your best bet.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firestore: how to specify the firestore key to be used for merge?<p>I have a function written in nodejs and another in python. They both do the same thing in...
<p>If you don't have any document reference to update to and need to query the field <code>phone_number</code> then you need to use the <code>where()</code> method with the <code>array_contains</code> operator. Use the <code>array_contains</code> operator to filter based on array values. If a document is found you can ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CloudBuild with GITLAB at module level<p>I was working on <code>GITHUB</code> and <code>GCP(Cloud Build for deployments)</code> and working good. Below are t...
<p>Personally I found GitLab being the worst in comparison to GitHub and BitBucket in terms of integration with the GCP Cloud Build (to run the deployment within GCP).</p> <p>I don't know ideal solutions, but I probably have 2 ideas. None of them is good from my point of view.</p> <p>1/ Mirror GitLab repository into GC...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get user info from Google OAuth2<p>Google is mandating an upgrade to their authentication/authorization mechanism, deprecating their existing mechanis...
<p>Yes, it is possible. I understand your frustration but your &quot;question&quot; is more about expressing your frustration instead of explaining what you've done so far so we can help you. However, let me try to provide as much help as possible.</p> <p>As you already find out, the &quot;Google Identity Services&quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to store, set or update a value inside an existing GVariant<p>I have a simple floating-point glib variant object whose value I need to update,...
<p>No, <a href="https://developer-old.gnome.org/glib/stable/glib-GVariant.html#glib-GVariant.description" rel="nofollow noreferrer"><code>GVariant</code> is immutable</a> after construction by design. This makes it safe to use across multiple threads.</p> <p>The only way to update the value of a <code>GVariant</code> i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Improve performance with Jetpack Compose (when assembling something inside a @Composable function)<p>Suppose I have two composables in my app:</p> <pr...
<p>If you have something that is expensive to compute and you want to compute it on your composable only once, simply wrap it with <code>remember</code></p> <pre><code>val keyboardKeys = remember { listOf( listOf(KeyboardKey(&quot;1&quot;), KeyboardKey(&quot;2&quot;), KeyboardKey(&quot;3&quot;)), listOf(Key...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reducing Array of Objects to a single output<p>Hi I am trying to figure out the best way to achieve something. I essentially receive a lot of data like so</...
<p>Use a helper function to record the event occurence:</p> <pre><code>const eventCountsByProgramme = {}; function recordOccurence(programme, event) { const eventCounts = (eventCountsByProgramme[programme] ??= {}); eventCounts[event] = (eventCounts[event] ?? 0) + 1; } </code></pre> <p>Then use</p> <pre><code>record...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enable stack trace output for JakartaEE/Glassfish application?<h2>Short Version</h2> <p>What's the option to make Glassfish include a stack trace in i...
<p>First you tell the web-server that you want to us a custom error page by specifying it in your <code>web.xml</code>:</p> <p><strong>web.xml</strong>:</p> <pre><code>&lt;web-app&gt; &lt;!-- Any unhandled (i.e. Throwable) errors, display the page ysod.jsp (rather than the built-in default --&gt; &lt;error-page...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bring data of each category to a row by pandas<p>Is there any simple and fast way in pandas to reach from df</p> <pre><code>d = {'points': ['P1', 'P2', 'Q1',...
<p>You could try with <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pivot.html" rel="nofollow noreferrer"><code>DataFrame.pivot</code></a>:</p> <pre><code># Add new elements (kind of point and index). df['kind'] = 'all_' + df['points'].str[0] df['idx'] = df['points'].str[1:] # Pivot and merge ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best way to store any kind of file in a database using noSQL and MongoDB<p>So I'm creating a ticket system, and what I'd like to do is to add any...
<p>If you want to upload files above 16MB you can use <a href="https://www.mongodb.com/docs/manual/core/gridfs/#:%7E:text=In%20MongoDB%2C%20use%20GridFS%20for,as%20many%20files%20as%20needed." rel="nofollow noreferrer">gridFs</a>.</p> <p><em><strong>METHOD 1</strong></em></p> <p>Other than that if you want to store fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix "code unreachable" problem in python?<p>This is the code that I am working on started coding recently:</p> <pre class="lang-py prettyprint-overrid...
<p>look at this line:</p> <pre><code>if 'Q1 = yes': </code></pre> <p>Pay attention that you are using a string for the if condition. therefore it is always a True statement.</p> <p>instead use this:</p> <pre><code>if Q1 == 'yes': </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to find unknown string from a known pattern ? python re.findall<p>I have an html text with strings such as sentence-transformers/paraphrase-MiniLM-L6-v2<...
<p>The problem with your regex is that <code>-</code> is not considered a word character, and you are only searching for word characters. The following regex works on your example:</p> <pre class="lang-py prettyprint-override"><code>text = 'sentence-transformers/paraphrase-MiniLM-L6-v2' models = re.findall(r'sentence-t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subnet flowlogs not allowed to be uploaded? but have followed instructions?<p>I am attempting to publish one of my AWS VPC Subnets flowlogs to CloudWatch.. h...
<p>Okay, so the answer was... while I had set the permissions for the IAM Role properly within my AWS Organization... the org itself did NOT have ANY permissions enabled to push flow logs.. so I had to go to my root account, edit the organizations permissions... and wipe out and redeploy the flow log.. I can now confi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to send fetch request from HTTPS to a HTTP server : Mixed Content error<p>I am using a NextJs app where I am using a simple fetch to send some POST data....
<p>Since both servers are running behind same server and you already have nginx setup.</p> <p>follow these steps</p> <ol> <li>setup reverse proxy for flask with some thing like below</li> </ol> <pre><code>events {} http { server { listen 443; location /flask_api { proxy_pass http://127.0.0.1:5000/; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create database and generate table with dotnet migration from created models<p>I'm newer to EF core and I followed an Asp.net core tutorial on Youtube (Prese...
<p>first create a database manually.</p> <p>after that create a dbContext and connect it to your database by using this <a href="https://www.entityframeworktutorial.net/efcore/entity-framework-core-dbcontext.aspx" rel="nofollow noreferrer">link</a> and this <a href="https://www.entityframeworktutorial.net/efcore/create...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Algorithm to find all combination from an array of objects<p>Recently a friend of mine proposed to solve a simple problem and I'm struggle to find the best a...
<blockquote> <p>What is the best algorithm to find <strong>all possible combination</strong> for this problem?</p> </blockquote> <p>In the worst case, where you have <code>n &gt;= 6</code> athletes, each weighing so little that the limit doesn't matter, and each able to play all roles, the number of teams grows very, v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular: select filter with pipe not working in diferent components<p>I have 2 components, one in which I have a filter with select and another component wit...
<p>Pass the <code>buscarporRegion</code> from <code>CardComponent</code> to <code>TableComponent</code> by declaring <code>Input()</code> decorator in <code>TableComponent</code>.</p> <blockquote> <p>Table.ts</p> </blockquote> <pre class="lang-js prettyprint-override"><code>import { Input } from '@angular/core'; expor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Enable disabled select input with JavScript<p>I would like to enable a select input that is disabled using JavaScript.</p> <p>I have tried doing this using:<...
<p>It looks like the options are disabled, but you are trying to enable the select itself. The queryselector modifies the object that you are selecting and not its children. They have to be referred to separately.</p> <p>Here is a javascript loop that sets the options as not disabled.</p> <p><a href="https://developer....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to join with the same table two times in jOOQ?<p>I have table which have one-to-one relation with another, but there are two of them, src and dst, how to...
<p>The easiest way (starting from jOOQ 3.17 and <a href="https://www.jooq.org/doc/latest/manual/sql-building/table-expressions/tables-as-selectfield/" rel="nofollow noreferrer">the ability of projecting table expressions as <code>SelectField</code></a>) is to just project the tables themselves, e.g.:</p> <pre class="l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling model method and passing params Rails 6<p>I am using Graphql mutation to save a <code>User</code> that looks kinda like this:</p> <pre><code>class Cr...
<p>The error was generated from <code>contact.rb</code> you have a type its <code>belongs_to</code> but you have <code>belongs to</code>.</p> <p><code>contact.rb</code></p> <pre><code>class Contact &lt; ApplicationRecord belongs to :user, optional: true end </code></pre> <p><strong>Preferred Solutions</strong></p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sass access static image for background-image url<p>I am using <code>node-sass</code> in react, and wanted to refer to a static image in my <code>public</cod...
<p>After hours of googling, The only solution I found is to use <code>~</code> to reference the very root directory and access the <code>public</code> folder from there.</p> <pre><code>background-image: url(&quot;~/public/images/icon.png&quot;); </code></pre> <p>And this is working fine for me :)</p> <p><strong>OR</str...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I specify a numeric pattern with dashes in Java<p>For this code, I'm trying to get the user to input a pattern of numbers like &quot;####-##-###&quot...
<p>The error you're getting is because you have the dashes in the string and you're calling <code>nextInt</code>. You need to read the input as a string (with e.g. <code>nextLine</code>) then apply the regex to that and convert the parts to integers as appropriate.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make an EXCLUDE constraint with date + time values? (PostgreSQL)<p>As the title suggests, what I'm trying is to create an <code>EXCLUDE</code> constra...
<p>sorry I was unable to recreate the problem. when I try SQL code above it works as expected. I'm using PostgreSQL 14.</p> <p><a href="https://i.stack.imgur.com/qGizB.png" rel="nofollow noreferrer">sample result with DBeaver</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BizTalk CSV with headers and no data rows gives error: Unexpected end of stream while looking for: ','<p>My BizTalk CSV schema works fine when there is one o...
<p>You need to set the Min Occurs on the Row Record to 0, then it validates if you only have a header row.</p> <p><a href="https://i.stack.imgur.com/zgkB4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zgkB4.png" alt="Schema properties" /></a></p> <p><a href="https://i.stack.imgur.com/hzNwq.png" rel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to verify a top level function was called with Mockk?<p>How to verify that a top level (static) function was called in a test with MockK?</p> <p>Simple a...
<p>You would mockk the same way you mockk extension functions <a href="https://mockk.io/#extension-functions" rel="nofollow noreferrer">https://mockk.io/#extension-functions</a></p> <p>In practice generally:</p> <pre><code>mockkStatic(ClassNameWhereFunctionIsLocated::class) verify { someTopLevelFunction(&quot;some...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeScript: Infer specific types of arguments and return values of functions in a mapped object<p>I'm trying to build a type-protected interface to my module...
<p>Assuming that the arg type for each key should always be the same, defining a mapping type can be useful and then deriving your types from that. In this case, <code>ParamValues</code> is an object type and we'll use the type of each property to correspond to the type of the function arg and return value:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotting X and Y variable based on grouping data by variable in separate columns<p>I'm fairly new to the Matlab community and need help with a particular plo...
<p>One approach is to combine all of the data (old and new) into a single table, then find the unique IDs and loop over them. For each ID you can identify the relevant rows and plot them.</p> <p>Note that the <code>table2array</code> usage in your current code makes your life harder, tables are nice because you can ind...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert switch statement to switch expression<p>I converted a switch statement into an expression and expected value to have the same type. However the expre...
<p>The switch expression tries to find the &quot;best&quot; result type, in the same way that an implicitly-typed array does.</p> <p>Given types <code>int</code> and <code>decimal</code>, the best result type is <code>decimal</code>, because while there's an implicit conversion from <code>int</code> to <code>decimal</c...