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: Twillio : before building the app, what is the base URL?<p>I wrote Twillio code to get phone verification in frontend.</p> <p>And here <code>PRACTICE_BASE_UR...
<p>The usual base URL for the Twilio API is:</p> <p><code>https://api.twilio.com/2010-04-01/</code></p> <p>The base URL for the Twilio Verify API is:</p> <p><code>https://verify.twilio.com/v2/</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculation not being performe properly in JavaScript<p>I have the following code that is converting characters entered in an input field into other characte...
<p>You can pass a function when replacing characters that would also count</p> <pre class="lang-js prettyprint-override"><code> let totalReplacements = 0; characters .replace(/e|E/g, () =&gt; { totalReplacements ++; return '3'; }) .replace(/t|T/g, () =&gt; { totalReplacements ++; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change data from aggregated to granular level<p>My data is in the form:</p> <p><a href="https://i.stack.imgur.com/Zhj1g.png" rel="nofollow noreferrer"><img s...
<p>A materialized <a href="https://www.google.com/search?q=calandar%20table" rel="nofollow noreferrer">calendar table</a> with the desired dates will facilitate generating the dates needed for the query. Without one, a <a href="https://www.google.com/search?q=tally%20table" rel="nofollow noreferrer">tally table</a> or ...
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...
<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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identify the second max value in hive based on condition<p>I have a table with rows that looks like that with a column that rank all rows partition by ticket...
<p>I'm going to use some sub-queries with a struct group by. This will allow us to ask questions about multiple rows without using a window. Likely will perform faster as we don't have to maintain window state.</p> <pre><code>create table theRanks (ticketID int, flag_1 int, flag_2 int, flag_3 int, flag_4 int, Timesta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any alternate way to simply the queries<p>Is there any way to combine 2 SQL queries into a single query?</p> <p>The table names used in both the SQL...
<p>Yes, it is possible to combine both of them using conditional aggregation:</p> <pre><code>WITH A AS ( SELECT * ,LEAD(create_ts) OVER (PARTITION BY ID ORDER BY CAST(pno AS INT)) AS R1 ,DATEDIFF('second',create_ts::timestamp ,LEAD::timestamp) AS time_duration FROM table_name ) SELECT ID ,SU...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python ctypes: how to define a callback having a buffer pointer and a length in argument?<p>I have a lib (in source form, if it helps) defining, among other ...
<p>In a callback, if <code>POINTER(c_char)</code> is used for data (esp. if the data contains nulls), then string slicing works to read the data as a Python byte string. It's also recommended to set <code>.argtypes</code> and <code>.restype</code> for functions called by <code>ctypes</code>, so it can convert Python-t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: multipage document pdf-lib.js with node & express<p>Im trying to create a multi-page document from templates on my file system, but I'm getting strange behav...
<p>I don't have your template file so I'm not sure excatly what you are trying to achieve.</p> <p>The <code>copyPage</code> is indeed required.</p> <p>You should save the <code>PDFDocument</code> before you change it again.</p> <p>I tried to rewrite your code, I ignored the <code>PDFName</code> and <code>PDFBool</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Eloquent - Laravel 9 - orderBy Subquery returns more than 1 row, I want 2 rows<p>I have this query</p> <pre><code> $users = User::query() -&gt;whe...
<p>I found the problem, If I delete the <code>-&gt;take(2)</code> in <code>-&gt;with('posts',...</code> relation I get all posts for each user, so, the <code>-&gt;take(2)</code> that I am using in posts, is limiting all the posts of the users and not for each user</p> <p>I tried to change that take(2) to limit(2) but I...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a vue3 component(vue.draggable.next) inside Nuxt 3 project as a plugin<p>In my recently started project, I wanted to use a <a href="https://github...
<p>have some differences between a Vue Plugin and a Nuxt Plugin. What you are trying to do is create a Nuxt Plugin to use a Vue Component. So in order to do this, you need to update your code to:</p> <pre><code>import { VueDraggableNext } from &quot;vue-draggable-next&quot;; export default defineNuxtPlugin((nuxtApp) =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex: Trying to extract all values (separated by new lines) within an XML tag<p>I have a project that demands extracting data from XML files (values inside ...
<p>finally i was able to find the right regular expression, I'll leave it below if anyone needs it:</p> <p><code>&lt;Type&gt;\d&lt;/Type&gt;\n&lt;Number&gt;(\d+\n)+(\d+&lt;/Number&gt;)</code></p> <p>Explanation:</p> <ul> <li><code>\d</code>: Shortcut for digits, same as [1-9]</li> <li><code>\n</code>: Newline.</li> <li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I remove characters from a string given in an array<p>for self development purposes I want to create a function with two parameters - string and an a...
<p>For each letter to be replaced, remove it (i.e. replace it with ''). When done, return the updated string:</p> <pre><code>function filterLetters(str, lettersToRemove) { lettersToRemove.forEach(function(letter){ str = str.replaceAll(letter, ''); }) return str } </code></pre> <p>Also see <a href="h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make the borders of a textbox circular using flutter?<p>I am making an email textfield and would love for the edges of the textbox to be circular. I...
<p>If you use <a href="https://pub.dev/packages/flutter_form_builder" rel="nofollow noreferrer">Flutter Form Builder package</a>, you can define it in decoration -&gt; border -&gt; OutlineInputBorder -&gt; borderRadius. You can play with different options. Example with borderRadius 20 below:</p> <pre><code> Form...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Express.js how to allow multiple requests to be executed without blocking them<p>I have a website made with express js that receives numerous post requests. ...
<p>I modified the code with the changes you suggested but nothing changed.</p> <p>(I also removed MachineDataAnalysis.js)</p> <p><strong>Server.js</strong></p> <pre><code>var QuerySettings = require('./SqlConfig.js'); var databaseTest = require('./lib/SQL'); databaseTest.connect(QuerySettings.configMachineDatabase()).t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import a Kotlin Library in IntelliJ<p>So i want to use the Serialization Library in my kotlin project, and from what i can gather from this <a href="h...
<p>Apparently you can indeed use IntelliJ IDEA as a build system without maven or gradle, but I don't think this is a supported way to use kotlinx-serialization.</p> <p>I'd advise to pick either maven or gradle as your build system for your project (this can be done through IntelliJ, just create a new project and pick ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the event that input range triggers?<p>I am creating a simple volume changer for my website and I am using change event to trigger the setVolume func...
<p>MDN says there is the change and the input event.</p> <p>Change is triggered, when it is commited, i guess mouseup</p> <p>The other one is triggered when the value changes</p> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event" rel="nofollow noreferrer">https://developer.mozilla.org...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to store sentences (words) wit h spaces in an single array in cpp dynamically<pre><code>int main() { key[100]; int i = 0, t = 0; cout &lt;&l...
<pre><code>#include &lt;iostream&gt; int main() { // 3 strings of 100 char max (+1 nullchar) char key[3][101]; int i = 0; std::cout &lt;&lt; &quot;Enter the Keyword :\n&quot;; while(i &lt; 3) { std::cin.getline(key[i],100); i++; } for(i = 0; i &lt; 3; ++i) { std::cout &lt;&lt; key[i]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the date for each duplicated row in SQL Server<p>I've made a query to get how many products are sold more than one time and it worked.</p> <p>Now I want ...
<p>You can use the corresponding <code>COUNT</code> window function, that will find the amount of transactions by partitioning on the &quot;<em>ProductName</em>&quot; as required:</p> <pre><code>WITH cte AS( SELECT TransactionDate, ProductName, COUNT(*) OVER(PARTITION BY ProductName)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print table in looping pyhton console<p>I want to print a table on my console. From now am using pandas how to print using tabulate</p> <p>Here is my ...
<p>If you use tabulate, you need to pass your dataframe <code>df</code> as main argument and specify its keys:</p> <pre><code>from numpy import average import pandas as pd from tabulate import tabulate z = 10119011 a = 17 c = 43 m = 499 for i in range(0, 21): LCG = ((a*z)+c) % m z = LCG u = z/m hasil ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Codename One app UI Container not rendering after programmatic update<p>I am having a problem with making the UI work properly in a Codename One application....
<p><code>repaint()</code> isn't the right method here. What you need to use is <code>revalidate()</code> or <code>animateLayout(int)</code> etc.</p> <p><code>repaint()</code> redraws the components without resizing/laying out. The new components are zero sized. You need to explicitly layout components if you add them t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a function in R that lets me create a new column with (1) the full country names and (2) the respective continent?<p>In my dataset I have only the c...
<p>Are you looking for</p> <pre><code>library(countrycode) df &lt;- data.frame(country_code = mycodes, country_name = countrycode(sourcevar = mycodes, origin = &quot;iso3c&quot;, destination = &quot;country.name&quot;), continent = countrycode(source...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tar.xz - how to check uncompressed files size without decompress whole archive<p>I have a problem with checking uncompressed size from archive <strong>tar.xz...
<p><code>tar tvfa &lt;file&gt;</code> will give you a list including file sizes. Check <code>man tar</code> for details. You should also note, that file size does not equate to disk usage, since part of a file can take a full file system block.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to mock instance methods of a class mocked with jest.mock?<p>How can the instance methods be mocked for a class that is being mocked with <code>jest.mock...
<h2>Automatic Mocking</h2> <p>Calling <code>jest.mock</code> automatically mocks all the exports from the module being mocked unless a manual mock is specified using the <code>__mocks__</code> directory.</p> <p>So, this line <code>jest.mock(&quot;./Logger&quot;)</code> has automatically replaced the <code>Logger</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it good practice to redeclare a parent class's method in a derived class, even if it doesn't override it?<p>Say I defined a method's implementation in an ...
<p>There's no point to doing that, <code>extends Foo</code> is clear that <code>Bar</code> may be inheriting features from <code>Foo</code>, and moreover it introduces a maintenance hazards:</p> <ul> <li>Suppose you decide that <code>speak</code> should return a value and edit <code>Foo</code> accordingly? Then <code>B...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make slider affect a canvas in real time?<p>Basically, I want to have a slider at the top that can affect some value in the canvas, like the radius of...
<p>This, instead of events, demonstrates a thing call &quot;the game loop&quot;. Great for animating things that moves. The <code>requestAnimationFrame</code> is like a <code>setTimeout</code> for the next animation frame (so it'll be smooth). It's about 60 times per second.</p> <p><div class="snippet" data-lang="js" d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make TikTok scraper scrape and add to CSV<p>I am building this scraper and I am trying to scrape TikTok hastags, then get the username from that ha...
<p>you were wrong in this part</p> <pre><code>for uniqueId in hashtag_json ['uniqueId']: influencer.append(uniqueId) </code></pre> <p>should be</p> <pre><code>influencer.append(hashtag_json[&quot;itemList&quot;][0]['author']['uniqueId']) </code></pre> <p>and in this part</p> <pre><code>for followerCount, bioLink in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly pass objects across multiple classes in C++<p>I am mostly self thought with C++ and I have built some large complex codes during my PhD resea...
<p>If I understand your concern correctly, you just want to make <code>class C</code> have pointers to <code>A</code> and <code>B</code>, which are the instances that the instance of <code>class C</code> is going to work on.</p> <p>I am going to explain this on example. Consider the following code</p> <pre><code>#inclu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the value from the localStorage object key? Angular<p>I need your help. In <code>localStorage</code> I have the object in the example. I am using ...
<p>LocalStorage, sessionStorage stores strings. To change it to it original type, you have to parse it like this:</p> <p>const emailLoginLinkedin = JSON.parse(localStorage.getItem('credsForJetLeadBE'));</p> <p>After that you can use any way you want to retrieve the first key,value pair.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After updating to Expo SDK 41 from Expo SDK 40, Android Studio won't start emulator<p>I go to start emulator on my mac m1 and it'll bring up the phone emulat...
<p>I just solved this issue for myself, it appears your emulator doesn't have enough storage assigned to it.<br /> <a href="https://stackoverflow.com/a/35828035">Here's how you can increase the storage on your emulator</a></p> <p>For my emulator I increased the device <code>Internal Storage</code> to <code>8GB</code> a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: adding custom record in PDF in netsuites<p>The template cannot be printed due to the following errors: Error on line 152, column 25 in template. Detail... Th...
<p>The error message is saying that your variable <code>v.custrecordserial_number_record</code> is empty, or not defined. That is, the template cannot work with the data you are asking it to work with, because it's not there. You simplest way to get past this error would be to check it with the <code>!</code> operato...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tailwind css apply order<p>I want to know tailwind css apply order. Or it can be issue of general css order.</p> <p>However, when I put 2 classes, <code>bg-g...
<p>Because in file css core of tailwind which they defind all class of tailwind, they place class <code>bg-gray-50</code> before <code>bg-gray-500</code>.So it compile the first class and ignore later class. You can imagine their order:</p> <pre><code>// tailwind.css .bg-gray-50 { background-color: #E9E6E6 } .bg-gray-5...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Codepush crashes on android when updateDialog is set to true<p>I have used the documentation at <a href="https://github.com/microsoft/react-native-code-push/...
<p>I was able to solve the answer myself. It became clear the error wasn't actually coming from codepush but rather the leakcanary debug implementation that was installed.</p> <p>It was version 2.7 which had this known issue:</p> <p><code>Stop throwing when not on main thread. While Curtains APIs should be used from th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save outlook email attachments with Python, on Virtal Desktop (VMWare)<p>The below code works on my W10 laptop, but not on my w10 or w7 virtual deskto...
<p>Oddly running this on a virtual desktop you need to reverse the order, so instead of going for GetLast, using GetFirst resolved this. Did hit another snag where Outlook brings up a message to allow an programme to emails, of either 1, 2, 5 or 10 minutes. I couldn't find a way to deactivate this on our VMWare, so hav...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data Annotation model validation for Required attribute<p>In my web api project, I have this code which uses Data Annotation Required attribute to validate. ...
<blockquote> <p>In my web api project, I have this code which uses Data Annotation Required attribute to validate. But when I test it using Postman, it can still go through?</p> </blockquote> <p>The <code>[Required]</code> attribute allows you to use <code>ModelState.IsValid</code> construct. As model binding and model...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Div in div in a tab<p>I want to use a nav bar in my page. But when I put some div in the div tab content I want them to be side by side, but they put themsel...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;style&gt; .table-side{ display:flex; flex-direction:row; justify-content:space-around; } &lt;/style&gt; &lt;div class="send...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Cloud KMS interoperability with libsodium<p>My application requires secure messaging between a server and client devices. The devices are not directly...
<p>Libsodium's crypto box uses X25519 to agree a key using one end's private key and the other's public key (and <em>vice versa</em>). It then uses the derived key and random nonce to encrypt the message to encrypt the message with a symmetrical, authenticated stream cipher (Salsa20). (This key exchange happens to give...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: display grand total sales in column<p>how to display month sales grand total in column for this query</p> <pre><code>select CONCAT(month(date),'-',YEAR(DATE)...
<p>Just use a windowed <code>SUM</code>:</p> <pre class="lang-sql prettyprint-override"><code>SUM(SUM(total)) OVER () AS GrandTotal </code></pre> <p>As the <code>OVER</code> clause doesn't have a <code>PARTITION BY</code> or <code>ORDER BY</code> clause, it'll give a <code>SUM</code> for the entire dataset.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use raw string literal with variables?<p>I know I can use format! to create a String with variables.</p> <pre><code>let name = &quot;rust&quot;; format...
<p>To work with owned strings <code>format!</code> is a great choice and a good solution. You can use it with syntax below:</p> <pre class="lang-rust prettyprint-override"><code>let name = &quot;rust&quot;; format!(&quot;Hi {name}&quot;); </code></pre> <p>Additionally, as you mentioned using JSON in your project I woul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to output a formatted string from a JSON model class<p>I want something like the following:</p> <pre class="lang-cs prettyprint-override"><code>using Sys...
<p>Yes, <strong>System.Reflection</strong> is needed to achieve your required value.</p> <ol> <li><p>Get the properties of the instance which applies the <code>JsonPropertyName</code> attribute.</p> </li> <li><p>Iterate the properties.</p> <p>2.1. Get the property name from the <code>JsonPropertyName</code> attribute.<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cannot convert from 'float?' to 'float<p>I have this code:</p> <pre><code>public float? InputCutOffFrequency { get; set; }//fc public float? InputF1 { get; ...
<p>It's a nullable float so you will need to specify you want the value.</p> <pre><code>fc1 = calcFc1(InputCutOffFrequency.Value, InputFS, InputTransitionBand); </code></pre> <p>Or you can default it if it's null</p> <pre><code>fc1 = calcFc1(InputCutOffFrequency.GetValueOrDefault(0), InputFS, InputTransitionBand); </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to Deserialize the Json-File and output it's data<p><strong>I thought I would understand Json.NET now a bit but unfortunately not. Can somebody help m...
<p><code>CObject</code> returns a List (btw naming the class <code>Todo</code> would probably be better for later understanding). You can iterate over the list and each item inside should have a title property. But a list has not.</p> <pre><code>foreach(var item in todos) { Console.WriteLine(item.title); } </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to not get errors accessing DateTime? properties in .NET with continue?<p>I have a loop that iterates over nullable <code>DateTime</code>s, <code>continu...
<p>Using <code>dateTime.GetValueOrDefault</code> or <code>dateTime.Value</code> solved the issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: REACT Duplicated Key Warning<p>I am currently get this duplicated key warning &quot;Warning: Encountered two children with the same key&quot;. However, I am ...
<p>I just wrap my model with a condition if imageId exist and it works already!</p> <pre><code>{imageId !== '' &amp;&amp; &lt;ViewImageFileModal show={showViewImageModal} toggleModal={toggleViewImageModal} imageData={imageData} key={imageId} /&gt; } </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to configure ingress controller with multiple paths for the same service?<p>I have a separate ingress-internal (manifests) for the backend and the fronte...
<p>This the backend ingress that I arrived to work successfullywith:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: mcs-thirdparty-ingress namespace: namespace spec: ingressClassName: nginx-internal rules: - host: bilels.exemple.com http: paths: - path: / ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set webcam grabbing resolution with ImageIO in Python<p>Using simple Windows/Python to read from Webcam:</p> <pre><code>camera = iio.get_reader(&quot;&lt;vid...
<p>You can set the resolution via the <a href="https://imageio.readthedocs.io/en/stable/_autosummary/imageio.plugins.ffmpeg.html#parameters-for-reading" rel="nofollow noreferrer"><code>size</code> kwarg</a>, e.g. <code>size=(1280, 720)</code></p> <p>My webcam is my third device and the resolution defaults to <code>640x...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you reference an object interface's key in its value using Typescript?<p>I'm trying to create an object interface (transforms), that has keys which ar...
<p>You just want the <code>transforms</code> property to be a <a href="https://www.typescriptlang.org/docs/handbook/2/mapped-types.html" rel="nofollow noreferrer">mapped type</a> over the properties of <code>T</code>. Writing <code>{[K in keyof T]: F&lt;K&gt;}</code> will produce a new type with the same keys as <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the minimum value between 2 conditions<p>Starts when the <code>start</code> column is <code>True</code> and ends when the <code>end</code> column ...
<p>We may need to create the <code>groupby</code> key with <code>cumsum</code> , then <code>transform</code> the <code>min</code> of each group and <code>shift</code> it</p> <pre><code>df.loc[df.end,'new'] = (df.groupby([df['start'].cumsum(),df['end'].cumsum()]). A.transform('min').shift()) df['...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how copy text from vba to windows clipbaord<p>I have an ms access vba code from which i wish to copy some text value to the Windows clipboard so that I can p...
<p>It should be as simple as you say, however Access for some reason doesn't have the same &quot;options&quot; as excel. You have to add it manually or use Cristian Buse's answer which is pretty much the same, he is skipping adding the reference. So here is the way to manually add the reference to use <code>.SetText</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android java audio player playing in background<p>I am creating a audio player, for Android mobile application, writed in Java langauge. I am struggling with...
<p>Use a <code>Service</code> and implement all your <code>Media Player</code> logic there, like for example:</p> <pre><code>public class MyService extends Service implements MediaPlayer.OnPreparedListener { private static final String ACTION_PLAY = &quot;com.example.action.PLAY&quot;; MediaPlayer media...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running Selenium Webdriver with a proxy in Python not changing IP<p>I am trying to make a proxy in python using selenium i have a list of free proxies from <...
<p>If you use Firefox browser,</p> <pre><code>... # set proxy firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX firefox_capabilities['marionette'] = True firefox_capabilities['proxy'] = { 'proxyType': &quot;MANUAL&quot;, 'httpProxy': PROXY, 'ftpProxy': PROXY, 'sslProxy': PROXY } driver = webd...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Behavior of Dataset.map in Tensorflow<p>I'm trying to take variable length tensors and split them up into tensors of length 4, discarding any extra elements ...
<p>You should use <code>tf.shape</code> to get the dynamic shape of a tensor in <code>graph</code> mode:</p> <pre><code>token_length = tf.shape(tokens)[0] </code></pre> <p>And another problem you have is using a scalar tensor as the number of splits in <code>graph</code> mode. That won't work either.</p> <p>Try this:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overlay violin plots in r<p>I am trying to plot overlaying violin plots by condition within the same variable.</p> <pre><code>Var &lt;- rnorm(100,50) Cond &l...
<p>If you don't want them to have different (flipped) x-values, set <code>x</code> to a constant instead of <code>x = factor(Cond)</code>. And if you want them filled in, set a <code>fill</code> aesthetic.</p> <pre><code>ggplot(df2)+ aes(x=0,y=Var, colour = Cond, fill = Cond)+ geom_violin(alpha=0.3,position=&quot;i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: processing multiple http outbound gateways<p>I am working on the spring integration http. Wanted to make multiple http calls and collect the response to one ...
<p>The transformer is different from other endpoints that it does not modify a <code>Message</code> we return from its method call. It is counted as transformer has a full control over the reply message creation. So, if there is a need to preserve some request message headers, it is recommended to use a <code>MessageBu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get values from nested array of objects - React JS<p>I am trying to the values from my data.json which consists of array of objects. I am trying to ge...
<p>I have created an example for you</p> <p>As mentioned in the above comment.. elements without customerName will give undefined.</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"><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dynamic variables based on condition<p>I'm trying to make the property value of an object to be dynamic based on a given condition.</p> <p>For example, the p...
<p>Use a ternary operator to do it cleaner.</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 = { apple: document.documentElement.clientWidth &lt;= 1280 ? "Red" : "Y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vulkan Storage Buffer Memory Mapping<p>I'm refactoring and re-writing the guide made by <a href="https://vkguide.dev/" rel="nofollow noreferrer">VkGuide</a> ...
<p>Your usage example only ever sets the <em>first</em> SSBO in the buffer, as <code>data</code> is <code>*t_pointer</code> and never changes. Change your code to pass <code>t_pointer</code> directly, change the type of the callback and then you can use it as</p> <pre><code>MemoryMapper::effect_mmap&lt;ObjectData&gt;(a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine if array is in order AND the last element is 0<p>how can I determine when the first X numbers of an array is in order AND the last element in 0? i....
<p>You could do something as simple as this:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const checkArray = (arr) =&gt; { if(arr[arr.length-1] != 0){ return fal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C : printf printing variables in the mixed order<p>Here is my code,</p> <pre><code>#include &lt;time.h&gt; #include &lt;pthread.h&gt; #include &lt;string.h&g...
<p>While your threads lack any kind of synchonization (which will randomly garble your output in some rare cases) this isn't even your problem.</p> <p>Here is your problem:</p> <pre><code>char download_buf[8],upload_buf[8] ; char buf[10] ; strcpy(download_buf,buf) ; strcpy(upload_buf,buf) ; </code></pre> <p>You are co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my Gitlab runner not detected? This job is stuck because you don't have any active runners online<p>I have registered Gitlab runner</p> <p><a href="ht...
<p>Can you check if the runner is not locked and shared or Specific assigned to the subjected repo/project? you check this by <code>opening your repo&gt; settings &gt; CICD&gt; Runners</code>. look for your runner and please share the result. another way to check if you have admin privileges: Admin Area &gt; Overview...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rxjs takeUntil in-depth<p>I have read about the concept of using <code>takeUntil</code> operator to manage <code>unsubscribe</code> in <code>ngDestroy</code>...
<blockquote> <p>is it the subscriber.complete which triggers the unsubscribe of the source Observable ?</p> </blockquote> <p>Yes. The subscriber will be automatically unsubscribed when its <a href="https://github.com/ReactiveX/rxjs/blob/master/src/internal/Subscriber.ts#L101" rel="nofollow noreferrer">complete</a> is t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Since nested views are seen as taboo - how else should I go about constructing an extremely verbose query?<p>Background: A webdev did not take SQL seriously ...
<p>So far I only see tiny things that I don't think will stack up to anything large.</p> <p>From holdings:</p> <pre><code> CASE WHEN POS.SECURITY_TYPE IN ('FI', 'MB', 'UI') THEN COALESCE( PRI.FACTOR * PRI.PRICE * .01, PRI.PRICE * .01 ) ELSE PRI.PRICE END AS PPU, </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change id column type already registered in the database<p>I'm trying to change my Id column type from int to bigInt because the records are too big a...
<p>Why can't you just do this?</p> <pre><code>ALTER TABLE tableName ALTER COLUMN ID bigint </code></pre> <p>I guess try it in a test environment first but this always works for me</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does "to_string" work in array of string?<p>I want to combine the first 4 characters of each line in txt file and compare it with the keyword I have, but...
<p><code>line[0]</code>, <code>line[1]</code>, and <code>line[2]</code> are <code>char</code>s, not <code>std::string</code>s. <code>char</code> is an integer type, so adding two <code>char</code>s together results in a single integer that is the sum of the two operands. It does not produce a <code>std::string</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Oracle - Sales Forecast<p>I am doing a Seles forecast in SQL Oracle. I need to figure out what revenue I can expect for next year. I should calculate for...
<blockquote> <p>I need to figure out what revenue I can expect for next year.</p> </blockquote> <p>Remove <code>revenue</code> and <code>year</code> from the <code>GROUP BY</code> clause as those are the columns you want to perform the regression on:</p> <pre class="lang-sql prettyprint-override"><code>select cust_id, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I center an image over a Bootstrap 5 Carousel?<p>I took the documentation from Bootstrap and everything works fine, but I need the logo to be in the ...
<p>So if I understood your issue correctly then you only need to use <code>display:flex</code> and center the logo both vertically and horizontally. So here is your code</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: finally: txt.close() SyntaxError in Python<p>I can not use finally:txt.close() to close a txt file. Please help me out. Thank you!</p> <pre><code>txt = open(...
<p>Your <code>try</code> and <code>except</code> blocks exist only in your <code>for loop</code> and are executed for every iteration of the loop. Because of this, your <code>finally</code> block will not work as it has no <code>try</code> or <code>except</code> part. If you want to close the file after the loop, you c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error copying folder using COPY --from from another layer<p>The Dockerfile uses the COPY --from command from the other build Node layer, but the generated di...
<p>Solved problem! The difference was that locally I used docker-compose which captures the build arguments from the .env file. The npm run command did not override the ${SCRIPT} variable as the docker command does not use the env file, required to pass through the --build-arg parameters.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checkbox styles not applying when loading data asynchronously<p>Using google apps script to build a simple tool at my school to help collect photo evidence o...
<p>It seems adding <code>fieldSet.trigger(&quot;create&quot;)</code> applies the CSS styles correctly. You can check this JSFiddle: <a href="https://jsfiddle.net/zpLbr26y/21/" rel="nofollow noreferrer">https://jsfiddle.net/zpLbr26y/21/</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I display input value in h1 in React JS<p>I have one input which divides 2 number and gives value, so I want to display that value in h1 tag</p> <pre...
<p>You forgot the <code>value</code> attribute I think, and if you use React Hooks maybe you can do something like this :</p> <pre><code>import { useState } from &quot;react&quot;; const [inputValue, setInputValue] = useState(&quot;&quot;); ... &lt;input className=&quot;input&quot; type=&quot;number&quot; placehold...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the smallest x86_64 Hello World ELF binary?<p>I tried to write the smallest possible x86_64 ELF hello world program by hand, but I receive a Segmenta...
<blockquote> <p>I tried to write the smallest possible x86_64 ELF hello world program by hand</p> </blockquote> <p>You should provide a <em>source</em> for your program, so we can fix it.</p> <blockquote> <p>gdb says: <code>During startup program terminated with signal SIGSEGV</code></p> </blockquote> <p>This is GDB te...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to verify if MFA delete is on or not on a list of bucket using Python script<p>Hello I have a list of buckets that I would like to verify if those bucket...
<pre><code>import boto3 buckets = ['...'] s3 = boto3.client('s3') for b in buckets: resp = s3.get_bucket_versioning(Bucket=b) if mfa:=resp.get('MFADelete'): print(f&quot;{b}: MFA delete is {mfa}&quot;) else: print(f&quot;{b}: MFA delete is never configured&quot;) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Power Automate (Flow) Get Cell From Excel Spreadsheet<p>I'm looking to automate a process using Power Automate:</p> <ol> <li>User opens a form (built in MS F...
<p>If you want to easily refer to any of the fields from the <code>last</code> item in the array from the Excel table, you should use a <code>Parse JSON</code> action but you should pass in an example object to set the schema.</p> <p>That will generate the dynamic content that you can refer to at any subsequent step in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursive list splitting and indexing<p>I have written the following code to split the list recursively. It first splits the left hand side recursively until...
<p>You've got the recursion down, but need to track the index as you traverse left and right. Here's a way with an additional parameter, and re-written as a generator:</p> <pre class="lang-py prettyprint-override"><code>def split(class_names, index='0'): if (n := len(class_names)) &lt; 2: return mid = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm getting this error "The operator '[]' isn't defined for the type 'Future<dynamic>'." can someone please help me fix my code? flutter/dart<p>I am getting ...
<p>Future builder takes a future. You can assign the future to Futurebuilder and check its data. Assuming ReadCache.getStringList is a future you can write it like this.</p> <pre class="lang-dart prettyprint-override"><code>FutureBuilder( future: ReadCache.getStringList(key: &quot;cahce3&quot;), builder: (...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to specify human readable name for ECS Task Definition in AWS CDK?<p>I use <code>aws-cdk-lib/aws-ecs-patterns/ApplicationLoadBalancedFargateService</code...
<p>Found, use <code>taskImageOptions.family</code> string, this will set the task definition name.</p> <pre><code> ... memoryLimitMiB: 1024, desiredCount: 2, taskImageOptions: { family: `svc-web-${this.envName}`, containerName: `svc-web-${this.envName}`, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FFMPEG change videos size<p>How do i change a video that is 1920x1080 to 1080x1920, and then &quot;shrink&quot; it so that it fills only half of the 1080x192...
<p>Use the <code>scale</code> filter, then the <code>pad</code> filter. The following command first scales the video from <code>width x height</code> to <code>height x (width/2)</code>, then adds padding at the bottom, preserving the width and duplicating the height. The <code>setsar</code> filter changes the aspect ra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to changes words in a charts title based on condition?<p>I would like the title of my plot to change based on if the supply is over or under the estimate...
<p>Im not sure if this is going to work, its always better when you provide the dataset...</p> <pre><code>labs(title = case_when( DF$Supply &gt;= 1 ~ paste(&quot;In 2021-2030 the supply is over the estimate by&quot;, DF$Supply), DF$Supply &lt; 0 ~ paste(&quot;In 2021-2030 the supply is under the estimate by...
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 ...
<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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed making field 'property' accessible; either change its visibility or write a custom TypeAdapter for its declaring type, gSON fromJson<p>I have a class ...
<p>I have fixed the problem by adding the line :</p> <pre><code>opens com.example.server.Models to com.google.gson; </code></pre> <p>to <code>module-info.java</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React hook form errors not updating when component state changes<p>Good Day,</p> <p>I have a custom component built with material-ui. Am trying to implement ...
<p>You have to use <code>Controller</code> when working with Material-UI and react-hook-form.</p> <p>References:</p> <ol> <li><a href="https://react-hook-form.com/get-started#IntegratingwithUIlibraries" rel="nofollow noreferrer">https://react-hook-form.com/get-started#IntegratingwithUIlibraries</a></li> <li><a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to map multiple query string parameters to a property of an Angular service component?<p>Question: Is it possible to retrieve a collection of ...
<p>You could make it very simple, as long as your class properties are the same name as the query string keys, you can do something like this:</p> <pre class="lang-js prettyprint-override"><code>export class SearchPageComponent { title = ''; genreId = ''; inCinemas = ''; upcomingReleases = ''; constructor(p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React.js : How to run react.js code in two ports.? each component in one port<p>how to run react.js code in two localhost ports like one &quot;component1.js&...
<p>Run your app on two ports:</p> <pre><code>npm run dev -- -p 3000 </code></pre> <p>And for the second:</p> <pre><code>npm run dev -- -p 3001 </code></pre> <p>Then get the port number and redirect to the desired component.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AttributeError: 'NoneType' object has no attribute 'group' while using googletrans library<p>everything work before but it error now when i try using googlet...
<p>your code work properly for me. make sure you have the latest googletrans version or 4.0.0-rc1.</p> <p>here for check your googletrans version</p> <pre><code>pip freeze </code></pre> <p>and here for install googletrans version 4.0.0-rc1</p> <pre><code>install googletrans==4.0.0-rc1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to add a space after input field<p>I append an <code>input</code> field into a <code>div</code>. What I want is a single space after the input field...
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/append" rel="nofollow noreferrer"><code>append</code></a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-overr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: changing return value for certain argument with guards<p>I am trying to code a Haskell function that returns the number of days in a month, given the month a...
<p>Yes, you've just got the syntax a little confused I think.</p> <pre><code>days :: Int -&gt; Int -&gt; Int days 1 _ = 31 -- January always has 31 days days 2 year | ily year = 29 -- February during a leap year | otherwise = 28 -- February otherwise days 3 _ = 31 -- March alw...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add :after and :before icon that change on click button dropdown?<p>With after and before I'm trying to change the dropdown icon when it is open or cl...
<p><code>:before</code> and <code>:after</code> aren't doing what you think they're doing in this case. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::before" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/CSS/::before</a></p> <p>However, you can actually treat Fontawesome icons as ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VS Code keyboard mapping is messed up. How to reset/change?<p>It seems that my VS Code keyboard mapping is incorrect. At first I thought it was a keybinding...
<p>It looks like you're running into this issue documented here: <a href="https://github.com/Microsoft/vscode/issues/50756" rel="nofollow noreferrer">https://github.com/Microsoft/vscode/issues/50756</a></p> <p>The relevant setting to add in your user settings.json is:</p> <p><code>keyboard.dispatch: &quot;keyCode&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript object get a list<p>I have an object like this and I want to get for exemple a simple list of all companies. After, what would be the code to filt...
<p>To get a list of all companies' names you should use the <a href="https://developer.mozilla.org/pl/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer"><strong>.map()</strong> method</a>. If you want to get specific companies' names you should first filter your data with the <a href="htt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ports used in async replication in YugabyteDB<p>[Question posted by a user on <a href="https://www.yugabyte.com/slack" rel="nofollow noreferrer">YugabyteDB C...
<p>Note that async-replication between servers doesn't work on the client api ports: <a href="https://docs.yugabyte.com/preview/reference/configuration/default-ports/#client-apis" rel="nofollow noreferrer">https://docs.yugabyte.com/preview/reference/configuration/default-ports/#client-apis</a></p> <p>But uses inter-nod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I put header parameter in a Url?<p>I want to get data from API. So first I want to get Json response from the browser. I Usually do it by specifying ...
<p>You can try to issue this request first using some rest client like postman or insomnia.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to map array having keys and values pairs dynamically added<p>Hy, My Question is how we can map an array in react js in which the array has key-value pai...
<p>From my understanding of your question, you are going to do something with the key &amp; value pairs coming from the API.</p> <pre><code>var array = [{ name: &quot;kamran&quot;, age: 25 }, { dev: &quot;kamran&quot;, hellow: &quot;kamran&quot; }, { &quot;unknown key will be add dynamically&quot;: &quot;unknown value ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace certain character inside multiple/all instances of an href attribute with javasacript?<p>I'm trying to change the character &quot;<strong>å</strong>&...
<p>By calling <code>$('.mylink').attr('href', url)</code> you are setting all <code>.myLink</code> references. You can loop and set each of them separately.</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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Render Form Elements Individually in Django<p>I'm trying to figure out how to render my form elements individually, since I think it's the best way for my fi...
<p>From <a href="https://docs.djangoproject.com/en/4.0/topics/forms/#rendering-fields-manually" rel="nofollow noreferrer"><code>Django-doc</code></a>, you can implement rendering of individual fields, their labels, and the errors as well in the following way:</p> <p>Try this:</p> <pre class="lang-py prettyprint-overrid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search for text embed<p>I use embed tag to display 1 pdf file, how do I make when I press Ctrl + F it only searches the pdf file, not the current page. I tri...
<p>You will not find a single answer on google they use two methods themselves.</p> <p>Generally it should not be possible unless the embedment has control of the pdf search function, You need to understand that a binary pdf viewer embedded in a html page cannot be controlled by the html page, it can pass options like ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Execution failed for task ':app:dexBuilderDebug'<p>When i try to run my flutter project i get the &quot;Execution failed for task ':app:dexBuilderDeb...
<p>Go to android&gt;app&gt;build.gradle and delete 'apply plugin: 'kotlin-android''</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can somebody explain the mathematics of this Color Balance formula?<p>I have found a good example of a Color Balance implementation <a href="https://stackove...
<p>This is just a linear interpolation between C1(R1, G1, B1) and C2(R2, G2, B2).</p> <p>If you imagine C1 and C2 as points in 3D space, <code>c_val</code> lets you choose a point on the line that goes from C1 to C2.</p> <ul> <li>0 is on C1</li> <li>1 is on C2</li> <li>anything in (0,1) is on the line segment between (...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Binance API entering order gives me MIN_NOTIONAL<p>I'm currently using an open source Binance API from nuget, called Binance.Net from JKrof <a href="https://...
<p>ok, my qty is too low. i just needed to increase the qty. thanks</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force the output query to shows the DB_NAME() data once<p>I've got a query that selects all indexes from a table and generate an output text to drop them ind...
<p>You can just initialize a variable with the <code>USE</code> command, and then append the <code>DROP INDEX</code> commands using string concatenation. This is easier in SQL Server 2017 (<code>STRING_AGG()</code>), but you didn't tell us what version you use, so...</p> <pre><code>DECLARE @sql nvarchar(max) = N'USE ' ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React - Catch event in sibling component<p>My parent component looks like</p> <pre class="lang-js prettyprint-override"><code>&lt;Tabs tabs={[ { ...
<p>Here is example, in this scenario, <code>Child</code> will execute some function (which focuses an input) from <code>FancyInput</code> component, when clicking the <code>div</code>.</p> <pre><code>function FancyInput(props, ref) { const inputRef = useRef(); useImperativeHandle(ref, () =&gt; ({ focusInput: ()...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pytorch gather failed with sparse_grad=True<p>With even very simple example, <code>backward()</code> cannot work if <code>sparse_grad=True</code>, please see...
<p>I think <code>torch.gather</code> does not support sparse operators:</p> <pre class="lang-py prettyprint-override"><code>torch.gather(x, 1, torch.LongTensor([[0], [1]]).to_sparse()) </code></pre> <p>Results with:</p> <blockquote> <pre><code>NotImplementedError: Could not run 'aten::gather.out' with arguments from th...