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: Problem with classification, POST to classifications results in error<p>If I try to start a classification I receive the error message:</p> <p><code>"messag...
<p>The <code>basedOnProperties</code> should indeed be op dataType text, like the error message mentions. (This is required for the vectorization of the field for the classification).</p> <p>The best thing to do is this to mention a property that has the correct dataType (<code>text</code>). Is there is none in this c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I conditionally run YAML tasks based on path filters?<p>I have a number of solutions, each of which have a mixture of applications and libraries. Ge...
<blockquote> <p>It seems we can only have one pipeline set up for CI</p> </blockquote> <p>My issue was that this was an erroneous conclusion. It appeared to me that, out of the box, a Pipeline is created for a repo with a YAML file in it, and that you can change which file the Pipeline uses, but you can't add a list o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: On Hyperledger Fabric Context<p>I would appreciate some help with this small issue. According to the <a href="https://github.com/hyperledger/fabric-samples/b...
<p>A Custom context has the same scope as a non custom context, it is the context for the currently executing transaction only. It is not able to span across multiple transaction requests. If the documentation implies this then I would suggest that there is something wrong with the documentation and a jira should be ra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reduce my object array into a single depth in javascript?<p>Good day, I would like to bind a drop down to values that comes from an object array? I ha...
<p>You could take <code>flatMap</code> for the outer array and map the new object with the inner arrays.</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 = [{ typ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save generated pdf as blob in Java<p>In my Spring Boot app, I am generating pdf file from html string and save it a temp location by using the followi...
<p>The type matching databases blob storages in java are simply bytes array.</p> <p>From your filepath, you have to get your pdf binaries from filepath and then send it to your persistance storage like you want :</p> <pre><code>String filePath = request.getDownloadPath()+ &quot;/&quot; + request.getItemUuid()+ &quot;.p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: if else conditions in pandas dataframe and extract column value<p>I have this dataframe(df), that looks like </p> <pre><code>+-----------------+-----------+...
<p>Try:</p> <pre><code>df.groupby(['Gene name','Level'], as_index=False)['Cell type'].agg(', '.join) </code></pre> <p>Output:</p> <pre><code>| | Gene name | Level | Cell type | |---:|:------------|:-----...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: import modin.pandas causes ERROR: AttributeError: type object 'pyarrow.lib.Message' has no attribute '__reduce_cython__'<p><strong>Issue</strong></p> <ul> <l...
<p><a href="https://github.com/modin-project/modin/issues/4719#issuecomment-1196039768" rel="nofollow noreferrer">LINK</a></p> <h1>Have not worked</h1> <p>The following gives me error:</p> <p>1.code</p> <pre><code>conda create --name py37-install-4719 python=3.7 conda activate py37-install-4719 conda install modin modi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio 2022 - Modules (Intellisense errors)<p>I have 3 files, namely engineering.cpp, engineering.ixx and system.ixx. Contents briefly are:</p> <p><em...
<p>Two module units cannot use the same module partition name. As such, <code>sys:engineering</code> cannot be used in two module units. No diagnostic is required, which is why you don't get a compile error.</p> <p>Also, if engineering.cpp is going to be a module implementation <em>partition</em>, then it must explicit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R bootstrap continue execution<p>I would like to use bootstrapping using the boot library. Since calculating the statistics from each sample is a length proc...
<p>Maybe you can combine results for the bootstrap replicates:</p> <pre><code>#simulating R=10000 results_list &lt;- lapply(1:00, function(x) { return(boot(data=data, statistic=my_slow_function, R=100, parallel='snow', ncpus=4)$t) }) results_t &lt;- unlist(results_list) hist(results_t) t0 = mean(results_t) </code></...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort array based on order value within second array<p>I have two Arrays:</p> <pre><code>const dropdownOptions = [ { text: 'NuxtJS', sortOrder: 1 }, { tex...
<p>You can first convert your <code>dropdownOptions</code> into a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="nofollow noreferrer">Map</a> that associates each <code>text</code>/item with an order for quick and easy lookup. Below I've done that by creating a <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference in creating a struct using malloc and without malloc<p>Could someone please explain to me the difference between creating a structure with and wit...
<p>If we assume both examples occur inside a function, then in:</p> <pre><code>struct person p = {.name="apple"}; </code></pre> <p>the C implementation automatically allocates memory for <code>p</code> and releases it when execution of the function ends (or, if the statement is inside a block nested in the function, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Please how to make the list observable in Flutter using the getx package?<p>I wanna make a shopping cart, so for that purpose I want to add products to a an ...
<p>I am sharing a bettter solution for you to achieve this functionality :</p> <p>let us assume your cart data be :</p> <pre><code>{ &quot;product&quot; : { &quot;ProductID&quot;: &quot;10000&quot;, &quot;ItemGroup&quot;: &quot;&quot;, &quot;ItemCode&quot;: &quot;10000&quot;, &quot;ProductName&quot;: &...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Google Apps Script's UrlFetchApp return HTML instead of csv file (requesting Facebook API)?<h2>Background</h2> <p><a href="https://developers.googl...
<p>Posting an answer as I finally found out what was wrong.</p> <p>The problem is that I made an asynchronous request to create the report and wanted to download it before the job was completed.</p> <p>From <a href="https://developers.facebook.com/docs/marketing-api/insights/best-practices#asynchronous" rel="nofollow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel - How to find the max value of a row that has text, and the text corresponds to a number in a different table?<p>So if I need to find the lead time for...
<p>Nested Max(IF())</p> <pre><code>=MAX(IF(($A$2:$A$5=B8)+($A$2:$A$5=C8),$B$2:$B$5)) </code></pre> <p>This is an array formula and must be confirmed with Ctrl+Shift+Enter in versions of Excel that don't have the new Dynamic Arrays.</p> <p><a href="https://i.stack.imgur.com/cpH9q.png" rel="nofollow noreferrer"><img ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django cors headers not working (yes ik a 100th people asked before but their solutions didn't work)<p>my settings.py</p> <pre class="lang-py prettyprint-ove...
<p>You use the wrong syntax for setting a variable value. Change the line</p> <pre class="lang-py prettyprint-override"><code>CORS_ALLOW_ALL_ORIGINS: True </code></pre> <p>to</p> <pre class="lang-py prettyprint-override"><code>CORS_ALLOW_ALL_ORIGINS = True </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dynamic routing in ASP.NET Core 3.1 when part of the url is already another route<p>I'm trying to use <code>DynamicRouteValueTransformer</code> with <code>IE...
<p>It was a bug and a fix is planned. See <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-3.1#conventional-routing-order" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-3.1#conventional-routing-order</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: trouble rearranging my 2x2 matrix in a simple way in R<p>I'm trying to turn </p> <pre><code>df&lt;-matrix(1:4,nrow = 2,ncol = 2) df [,1] [,2] [1,] ...
<p>Here is another way. Without the call to <code>matrix</code> it returns a vector, not a matrix.</p> <pre><code>df &lt;- matrix(1:4, 2) matrix(c(t(df[nrow(df):1,])), 1) # [,1] [,2] [,3] [,4] #[1,] 2 4 1 3 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: On MacOS, launching Quasar-Framework/Capacitor dev command targeting Android or iOs fall back to prompt with nothing<p>Using Quasar following commands fallba...
<p>I got same behavior when I copy my project from Windows to make some tests on iOS. So you have to give execution permision to the folowinf files : <strong>src-capacitor/node_modules/@capacitor/cli/bin/capacitor</strong> and <strong>src-capacitor/ios/App/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh</stro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: grid columns wrap after upgrading to bootstrap 4<p>I have a table like display made using the bootstrap grid classes. The body rows of which are populated dy...
<p>The way I got it to work in the end was to add another set of row and col classes like this...</p> <pre><code> &lt;div id="myDynamicList" style="display:none;" class="row"&gt; &lt;div class="col-sm-12"&gt; &lt;div class="row"&gt; &lt;div class="col-sm-4 tabledHeader"&gt;Service Id&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is mean by Developing a model to predict the target variable minimizing 'Root Mean Squared Error' function?<p>So, it's a regression problem and I have t...
<p>I think you will have better luck in cross validation: <a href="https://stats.stackexchange.com/">https://stats.stackexchange.com/</a></p> <p>However regarding the programming part, <code>MSE</code> or <code>RMSE</code> is a measure of distance between the predicted values and the real values. If you are using an a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas .drop Function for unnamed columns does not work<p>Trying to drop a unnamed column from a dataframe created from a Xlsx but it won't drop.</p> <pre><c...
<p>You can try this:</p> <pre><code> def create_final_table(self): self.raw_data_tables[&quot;sales_codes&quot;] = self.raw_data_tables[&quot;sales_codes&quot;].drop('Unnamed: 0', axis='columns') self.raw_data_tables[&quot;vehicle_hash&quot;] = self.raw_data_tables[&quot;vehicle_hash&quot;].drop(['Unnam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What controls user locale when performing handover to phone<p>I'm currently working on an action using the Actions on Google SDK together with Microsoft's Bo...
<p>My understanding is that the locale is based on the locale of the device that has sent the request. </p> <p><a href="https://developers.google.com/assistant/console/languages-locales" rel="nofollow noreferrer">This page on "languages and locales"</a> (emphasis mine) says:</p> <blockquote> <p>Locales are construc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotting of the mean in boxplot before axis log transformation in R<p>I want to include the mean inside the boxplot but apparently, the mean is not located a...
<p>The mean calculated by <code>stat_summary</code> is the mean of <code>log10(value)</code>, not of <code>value</code>.<br> Below I propose to define a new function <code>my_mean</code> for a correct calculation of the average value.</p> <pre><code>library(ggplot2) library(dplyr) library(tibble) library(scales) df &l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a coroutine be destroyed during evaluation of an inner await expression?<p>According to the standard, a coroutine shall be destroyed only when it is susp...
<p>The standard in <a href="http://eel.is/c++draft/dcl.fct.def.coroutine#11" rel="nofollow noreferrer">dcl.fct.def.coroutine#11</a> says</p> <blockquote> <p>The coroutine state is destroyed when ... the <code>destroy</code> member function of a coroutine handle that refers to the coroutine is invoked... If <code>destro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I convert int to boolean in entityframework core?<p>Here are two tables,one named <code>State</code>, the other named <code>WorkingOn</code>. </p> <...
<p>Finally, I found this way:</p> <pre><code>var workerInQuestion = state.Select(X =&gt; new { name = X.name, busy = workingon.Any(Y =&gt; Y.name == X.name) }) ; </code></pre> <p>All works well now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Global Audio in unity using photon<p>Im trying to make a multiplayer game using photon in unity . I created a room and joined with my friend. I want to make ...
<p>You need to play the audio in an RPC in order for other people to hear the audio. I can't test the code out right now, but I'm sure this will work.</p> <pre><code>public class PlaySound : MonoBehaviourPunCallbacks { public KeyCode buton; public AudioSource sunet; void Update() { if (Inpu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I copy a JSON block to another file?<p>I have two JSON files with the following content:</p> <p>foo.json:</p> <pre class="lang-json prettyprint-overr...
<p>The <code>+</code> operator can be used to combine multiple objects together. Having the object enclosed with <code>{}</code> selects the whole object for inclusion.</p> <pre class="lang-bash prettyprint-override"><code>jq ' . + ( input | {block} )' bar.json foo.json | sponge bar.json </code></pre> <p><strong>Note</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get div to scroll text horizontally when overflow instead of breaking into new line<p>This is common on mobile apps. There is a navbar of selectable t...
<p>You must set to your div</p> <pre><code>white-space: nowrap //To prevent word breaking overflow: auto;// To appear scroll </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: insert data from while loop into database php<p>I am trying to post data into my database from these while loop. It helps me get the monthly periods within a...
<p>Assuming that you are using <code>mysqli</code> then I hope this might help. In keeping with comments made regarding the 2 disconnected loops you can/should combine into a single loop where the date value is calculated and used as input for the sql statement. As you posted a snippet of code rather than the full thin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unity Raycasthit.Point Acting Weird<p>I'm trying to transport positions of a gameObject according to mouse position in 3D. However, When I do that with Rayca...
<p>Are you sure your building blocks are not on the <code>floorLayer</code> mask? It seems that the raycast is hitting the edge of the building schematic and returning that point.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't strip remove the space in this string?<pre><code>s = '种草 ​' print(len(s)) s = s.strip() print(len(s)) </code></pre> <p>And the output for both is ...
<p>It's not a usual unicode space. you can remove it like this.</p> <pre><code>s = '种草 ​' print(len(s)) s = s.strip(u'\u200b').strip() print(len(s)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run both functions simultaneaously not working (Google Sheets Script)<p>I've been trying to get these two functions together, so that the script runs as the ...
<p>I only see one function, but I assume you are trying to merge two onEdits() into a single one? If so, replace the script you have with</p> <pre><code>function onEdit(e) { var ss, watchedSheets, startRows, watchedCols, stampCols, sheetInd; ss = e.source.getActiveSheet(); watchedSheets = ['To Do List', 'Updates']; st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change underscore behind word within column in R<p>Hi I have a data frame like this, with two columns (A and B):</p> <pre><code> A B x_1234 rs4566 x_15...
<p>We may need to switch the characters after capturing as a group (<code>(.*)</code>- captures characters before the <code>_</code> and the second capture group as one or more digits (<code>\\d+</code>), then switch those in the replacement with the backreferences (<code>\\2</code> followed by <code>\\1</code> separat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (Python) Convert CSV file to JSON<p>I've tried to convert a csv file to Json. The dataframe looks like below.</p> <p>But when I loaded a Json file, I see '\u...
<p>Your current code builds a dict where the values are already json strings. Once this has been done, it is no longer possible to easily build a nice and clean json string.</p> <p>You should instead build a plain dict where the keys are the index values, and the values are lists of dicts representing the records. Long...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I increase the size of the status bar on visual studio code?<p>The status bar shown on the bottom of VSCode is too small as it's hard for me to read v...
<p>AFAIK there is no setting to adjust the height of the status bar. A common practice is to set the zoom level and decrease the editor and terminal font size, but this will also increase the activity bar icons and other areas.</p> <p>In your <strong>settings.json</strong> add</p> <pre class="lang-json prettyprint-over...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Python Click within a class<p>I've got an old flashcards app that I made that I've repurposed for some aws cert study. I wrote this years ago and overh...
<p>Click isn't naturally designed to work this way, see for example <a href="https://github.com/pallets/click/issues/601" rel="nofollow noreferrer">this issue</a> which also includes some workarounds by folks in the comments if you want to go that route. </p> <p>In your case, you could just yoink <code>main</code> out...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can not enter password in Shell Script<p>I can not enter my pass word. My shell script is here.</p> <pre><code>#!/bin/bash expect -c " set timeout 2 spawn ...
<p>you have to prompt password and send it to variable </p> <p><br>echo -n "Enter Password:" read PASS</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass python function to another function with flag<p>I have created verbose_on (it shows output if used) and verbose_off fuction. In verbose_on(fn), f...
<p>Use lambda functions:</p> <pre><code>def test(verbose, flag2): if verbose: print('Verbose mode = On.') helper.verbose_on(lambda: sample(flag2)) </code></pre> <p>or <a href="https://docs.python.org/3/library/functools.html#functools.partial" rel="nofollow noreferrer"><code>functools.partial</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making a dictionary for my calculated value<p>I have a txt file contain a list of 2 phone numbers and the duration between the two like this:</p> <pre class...
<p>In dict, if you want the keys to be numbers you have to convert them to numbers from string. Since you want the first number as key in the dict, assign it as the key while pushing it in the dict.</p> <p>try this...</p> <pre><code>def getSec(time): #change minute to second min, sec = time.split(':') ret...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to divide an array into different arrays in c++<p>I have written this code in c++ to read a signal as an array and now I need to segment this array for 4...
<p>To create a <code>vector</code> with a subrange of another vector you can use the <a href="https://en.cppreference.com/w/cpp/container/vector/vector" rel="nofollow noreferrer">constructor that takes two iterators</a>( (5) in the link):</p> <pre><code>std::vector&lt;float&gt; x(100); std::vector&lt;flaot&gt; y(x.beg...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript - Property does not exist on extended generic interface<p><strong>Scenario</strong>: I am attempting to create a base method I can reuse (<code>wo...
<p>The type restriction in <code>doesNotWork&lt;T extends IBaseEntity&gt;</code> doesn't seem to propagate down to the method <code>defaults</code>. This seems to cause Typescript to think that the generic T could be anything, despite it being constrained to <code>IBaseEntity</code>. See this <a href="https://stackover...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ORDER BY not working correctly on calculated column?<p>I need to create a table with the Top 1000 entities by a certain value. I am trying to create the tabl...
<p>Your issue is that you are checking the data using:</p> <pre><code>select * from [db].[TopThousandEntities]; </code></pre> <p><strong>SQL tables represent unordered sets.</strong> There is no ordering unless you specify an <code>ORDER BY</code> clause.</p> <p>So, if you want to see them in order:</p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongoose Populate() not populating array of ObjectIds<p>I have just started with Mongoose and am trying to get populate() to work using a very basic example....
<p>The first issue was likely related to the ObjectIds being wrong. So I removed everything from MongoDB and started over (I did not change anything in the schemas so the issue didn't lie here). With the DB being empty, I created a new Owner, and pushed two Car ids to the "cars" array. Then I ran populate() again and i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: @vue/test-utils Unknown custom element: <router-view><p>I've added the solution from question <a href="https://stackoverflow.com/questions/49681546/vue-test-...
<p>I found in vue test utils <a href="https://vue-test-utils.vuejs.org/guides/using-with-vue-router.html#using-stubs" rel="noreferrer">documentation</a> an example how to stub <code>router-view</code> and <code>router-link</code>:</p> <pre><code>import { shallowMount } from '@vue/test-utils' shallowMount(Component, {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass a date as a get request on postman however i can't find data from database in laravel<p>I like to get my value when I pass the date in get a request. Bu...
<p>Check your route in <code>api.php</code> it should be as:</p> <pre><code>Route::get('/news/search/{dates}', [NewsController::class, 'getNewsDate']); </code></pre> <p>You have two slashes after <code>api</code> by the way)</p> <pre><code>api//news/search </code></pre> <p>remove one of them.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hide option menu when UITextField text is selected<p>Simply how do we prevent this pop up menu when UITextField text is selected.</p> <p><a href="https://i....
<p>Found the response:</p> <p><a href="https://stackoverflow.com/a/21716228/2129911">https://stackoverflow.com/a/21716228/2129911</a></p> <p>When using textField.selectAll(), passing the textField's delegate makes the pop up menu appear.</p> <p>For no popup menu use textField.selectAll(nil)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Word conversion<p>How do i convert the original verse to the converted verse? </p> <p>It should convert <code>cubits</code> to <code>feet</code></p> <p>Ori...
<p>you could match a regular expression, and use a replacement function to adjust units (and change unit name)</p> <pre><code>import re r = re.compile("(\d+) cubits") s = "So make yourself an ark of cypress wood; make rooms in it and coat it with pitch inside and out. This is how you are to build it: The ark is to b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read remote image to a base64 data url<p>actually there are many answers for this question. But my problem is, i want to generate pdf dynamically with...
<p>The contents of the remote image can first be fetched with an HTTP request, for example using the ubiquitous <code>request</code> npm module. The image string contents can then be transformed to a <code>buffer</code> and finally converted to a base64 string. To complete the transformation, add the proper <a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Receiving 403 Forbidden error when running Cypress test, but receiving no error when manually navigating to the app<p>Below is a step in my Cypress test:</p>...
<p>In your cypress.json config file write this:</p> <pre><code>{ &quot;baseUrl&quot;: &quot;https://dealerportal-test.santanderconsumerusa.com&quot;, &quot;chromeWebSecurity&quot;: false } </code></pre> <p>Then in yor test try this:</p> <pre><code> cy.visit('/', { headers: { 'accept': 'applica...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript | Map to object by dot notation<p>I currently have a string which is like the following <code>author.id</code>.</p> <p>Essentially what I want to...
<p>You can <code>reduce</code> and create an object with the key-value pair by splitting <code>key</code> in relationship 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"><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: groupby with apply: ffill(), bfill<p>I have a large dataframe where I want to use bfill().ffill(). From other questions and answers I know bfill()/ffill() do...
<p>I found a solution myself</p> <p>selecting the required column [i] after groupby works</p> <pre><code>for i in temp.columns: temp.loc[temp['group']==1, i ] = temp.sort_values(by =['order'], ascending = [True]).groupby('group')[i].apply(lambda x: x.bfill().ffill()) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem to update a value in Access Database<p>I'm coding a small program with C# to watch my organization's cars and I use code below to update value but it...
<p>The update statement is not correct because there is a comma before the <code>where</code> keyword.</p> <p>Change the SQL like this:</p> <p><code>UPDATE Mqar SET [Car_Type] = @Car_Type,[Model] = @Model,[chase_nu] = @chase_nu,[Engin_Nu] = @Engin_Nu,[Car_nu] = @Car_nu,[Car_State] = @Car_State,[Draiver_Name] = @Draiver...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: r loop optimisation (getMinBBox with sf and data.table)<p>I have some question how to speed up my code.</p> <p>I have a shp with more than 100000 polygons a...
<p>The example code is so small that some approaches might only be faster if you were looking at larger data.tables. It seems to me that you could shave some time off by doing a split-combine approach, which, in principle, you could run in parallel, e.g. by using <code>mclapply</code> instead of <code>lapply</code> (on...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Invalid date from ISO format JS<p>I am getting the ISO date from an API call and this is the format</p> <blockquote> <p>&quot;2022-07-19T00:00:00.0000000Z&qu...
<p>As per comment answer: just remove JSON.stringify.</p> <pre><code>const dateString = &quot;2022-07-19T00:00:00.0000000Z&quot;; // Valid: const d = new Date(dateString); // Tue Jul 19 2022 03:00:00 GMT+0300 ... // Invalid: const jsonDate = JSON.stringify(dateString); // &quot;&quot;2022-07-19T00:00:00.0000000Z&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to exclude Optional unset values from a Pydantic model using FastAPI?<p>I have this model:</p> <pre><code>class Text(BaseModel): id: str text: st...
<p>You can use <code>exclude_none</code> param of Pydantic's <a href="https://pydantic-docs.helpmanual.io/usage/exporting_models/#modeldict" rel="nofollow noreferrer">model.dict(...)</a>:</p> <pre><code>class Text(BaseModel): id: str text: str = None class TextsRequest(BaseModel): data: list[Text] n_p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validating Python data transforms with parameter for expected result<p>I'm writing a library of Python functions to transform a dataset, and for each one I n...
<p>You can use a class as a decorator, so that you can define instance variables that you can change at runtime. Example implementation <a href="https://stackoverflow.com/a/11855607/1016128">here</a></p> <p>in your case you would have a <code>ratio</code> instance variable so that before each call to the decorated fun...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to createElement tag with html attributes in Javascript<p>I inserted an input tag after a certain element of my html source code, it seems to work, but w...
<p>You can just assign the a value to the attribute after creating the element like bellow:</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>var inputCheckBox = document.createE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create dataframe from json object not wrapped in a key with Python<p>I am looking to write an API response do a pandas data frame using Python where the JSON...
<p>You can create <code>pandas.Series</code></p> <pre><code>s = pd.Series(data['1.2.3.4'], name='1.2.3.4') </code></pre> <p>and append it to existing <code>df</code> as new row</p> <pre><code>df.append(s) </code></pre> <p>Because <code>append()</code> is deprecated so you can use <code>concat()</code> for this</p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get inner part of Array PHP<p>How do I get inner part of a long array in PHP : Example:</p> <p>print_r($array) gives:</p> <pre><code>Razorpay\Api\Collectio...
<p>Finally Got:</p> <pre><code>$payment = $api-&gt;order-&gt;fetch($_POST["razorpayorderid"])-&gt;payments(); $payid = $payment["items"][0]["id"]; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read an HTML Input Field from an XML file in SAP Ui5?<p>Below is the code snippet of the view in XML, I am able to read the id "Name1" but unable to r...
<p>Since I want to access the HTML Div ID, I simply used the below code to set the value and it works:</p> <pre><code>document.getElementById("Name2").value = _fullName; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting 'human' date string of different language to date object in JavaScript<p>I am trying to convert the following set of strings:</p> <p><code>juin 2...
<p>Unfortunately there is no native API for this.</p> <p>If you know the format, it is easy to convert, without a massive library:</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"><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Seaside redirect for render not working on physical iOS devices<p>We're having a problem with physical <em>iOS</em> devices (works fine on Chrome virtual dev...
<p>Problem is caused by a seven year old method that used a <code>window.location.href=</code> to gather device characteristics, like screen size and touch support. Removing that <code>href</code> fixes the problem with iOS. Lots of other &amp; cleaner ways to get the data. Quick fix is to wrap the <code>href</code> wi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I send a django model to javascipt?<p>How do I pass a django model to javascript? Specifically, I want to pass a django Movie model to javascript. In ...
<p>You can send model data by just returning <code>JsonResponse</code> from the view (and for example creating JSON dict by forlooping QuerySet, or using <code>model_to_dict</code> Django built-in method) or by preserving your logic and sending html you need to override - even better - you can do both ways at the same ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expand an integer value into a range in SQL<p>I have data from a PostgreSQL query in this basic shape:</p> <pre><code>CREATE TABLE Table1 (`Group` varchar(1)...
<p>You don't need to use a CTE and you don't need to use a CROSS JOIN.</p> <p>This will do:</p> <pre><code>SELECT t.&quot;Group&quot;, m.mnth AS &quot;Months&quot;, t.&quot;Value&quot; FROM Table1 t INNER JOIN GENERATE_SERIES(1,12) AS m(mnth) ON t.&quot;Months&quot; &gt;= m.mnth ORDER BY t.&quot;Group&quot;, m.mnth; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: store url in same list with id php sql<p>hi i want to store the url in the list loop that comes from db using primary key and foreign key but I don't know ho...
<p>You're replacing <code>$arr</code> each time through the loop, you need to add to the <code>url</code> element.</p> <pre><code>&lt;?php $select_list_movies = select(&quot;SELECT * from list_movies&quot;); $arr =['name' =&gt; 'test', 'detail' =&gt; 'detail', 'url' =&gt; []]; $i =0; while($rows = mysqli_fetch_assoc($...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React.js with fetch api and console.log()<p>I can't log or display data in this barebones React component. I am trying to just simply fetch my repos using th...
<p>Create an async function that handles the api call. Then call the function in the useEffect. Since Repos is an empty array, nothing will be logged. Once your api call resolves and the repos state has been updated, react will do it's thing and re render causing the repos.map to run again and log out the repos</p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i set a default value of input with React hook form?<pre><code>const { register, handleSubmit, watch } = useForm(); </code></pre> <pre><code>&lt;inpu...
<p>From the <a href="https://react-hook-form.com/api/useform/" rel="nofollow noreferrer">docs</a>:</p> <pre><code>useForm({ mode: 'onSubmit', reValidateMode: 'onChange', defaultValues: {}, resolver: undefined, context: undefined, criteriaMode: &quot;firstError&quot;, shouldFocusError: true, shouldUnregi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why does it need cluster:monitor/main permission<p>ES 7.17 cloud is hosted in <a href="https://xxx.elastic-cloud.com:9243%5D" rel="nofollow noreferrer">https...
<p>It's because the client pings the cluster using the <code>/</code> endpoint and it's actually why the <a href="https://github.com/elastic/elasticsearch/issues/83179" rel="nofollow noreferrer"><code>cluster:monitor/main</code> privilege</a> is required.</p> <p>I believe this was added after the 7.10.2 Opensearch fork...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storyboard animation does not animate<p>I have created a custom control, its purpose is to display current status of a task, the part of changing the selecti...
<h1><strong>The Problem</strong></h1> <p>The problem was, when trying to animate one storyboard, the last one didn't stop, therefore the storyboard which was supposed to start did not</p> <h1><strong>The Solution</strong></h1> <p>For another storyboard to animate we need to stop last animated storyboard, to do this,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have done all the things but I am not able to solve this problem<p><a href="https://i.stack.imgur.com/bLr5n.png" rel="nofollow noreferrer"><img src="https:...
<p>First of all, in the future I would suggest to post your code as text and not as an image. Next to that a bit of explenation could be usefull and kind. Also this is Javascript code, not java code.</p> <p>Here you have a working version of your code: <a href="https://jsfiddle.net/r4anp9xq/1/" rel="nofollow noreferrer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I split a record of text into text file in C++<p>So I'm working on a simple file manipulating project where I need to append a new text on a single li...
<pre><code>#include &lt;iostream&gt; #include &lt;fstream&gt; using namespace std; int main() { // we have only 1 column in this example and also we have only 2 rows of data int columnCount = 1, dataRows = 2; string newColumnName; int data1, data2; cout &lt;&lt; &quot;enter the column name: &quot;;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: reconf map 3 level in Groovy 2.4.7<p>Need to convert map in Groovy 2.4.7:</p> <pre><code>[ 1:[ Par1:[ Podpar1:[s:str1, time:16], Podpar2:[s...
<p>What a confusing example </p> <p>I think this should do what you want though:</p> <pre><code>def res = [ 1:[ Par1:[ Podpar1:[s:'str1', time:16], Podpar2:[s:'str2', time:17] ], Par2:[ Podpar1:[s:0, time:18], Podpar2:[s:0, time:19] ] ], 2:[ Par1:[ Podpar1:[s:'st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing dbcontext at runtime depending on the project taken from the database<p>i'm trying to change the context at runtime depending on the project that i ...
<p>Here is what I did:</p> <p>My connection string is given AFTER the identification of the company, user and password, because each user has his own company/database. I store the connection string so I can retrieve it latter and also a boolean variable to check if it is logged or not (static class called MainData).</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get closest value in array to variable value<p>I have an array of <code>int</code> I'd like to create a function which retrieves from this array the closest ...
<p>You could loop through the array and check closeness for each element. E.g. in pseudo-code:</p> <pre><code>closest = myArray[0] best_closeness = abs(myArray[0] - randomInt) for (element in myArray) { closeness = abs(element - randomInt) if (closeness &lt; best_closeness) { closest = element best_closenes...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add a Stroke / Outline to a Custom Scrollbar<p>I have a custom scrollbar that I would like to add a stroke/outline to. I have not found any articles on how t...
<blockquote> <p>If i was not wrong you need outline around thumb of scroll bar please check the solution below</p> </blockquote> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas datetime with time format as 0:00:00 (h:mm:ss)<p>I`m looking to create a new row for a date with the following formatting:</p> <pre><code>2022-07-20 0...
<p>If your dataframe is df, try:</p> <pre class="lang-py prettyprint-override"><code>from datetime import datetime df['time'] = datetime.(year= ..., month= ..., day= ...) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare dynamically in .NET Core<p>This is the conditional rule configured in the database. The rules configured for each user are as follows。</p> <pr...
<p>If you can store your data like this :</p> <ul> <li><strong>x</strong>&gt;=500 <strong>&amp;&amp;</strong> x&lt;=600</li> <li><strong>x</strong>&gt;600</li> <li><strong>x</strong>==600</li> <li><strong>x</strong>!=600</li> </ul> <p>And then iterate foreach line replacing each time x by &quot;item.TotalDaySam&quot;.<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sum a few colums of html table created dynamicaly<p>I have created an HTML table from c# the data is being fetched from sql, I want to sum a few colum...
<p>You can write a jQuery function to calculate this to process the textNode.</p> <pre><code>function setTotal() { var trs = $('#DyanmicTable3 tr:not(:first-child):not(:last-child)'); var lastTotalElement = $('#DyanmicTable3 tr:last-child'); console.log(trs.length) const total = Array.from(trs) .reduce((acc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Will a procedure be considered as a predicate, <p> , when the special form cond is missing the key word else?<p>I accidentally forgot to put the <code>else</...
<p><strong>Sequencing</strong>: <a href="https://docs.racket-lang.org/guide/begin.html" rel="noreferrer"><code>begin</code></a> form in Racket allows you to sequence multiple expressions. It evaluates each expression from left to right and the final result is the last expression.</p> <p><strong>Syntax</strong>: The sy...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm trying to scrap a table web-site with different table option values<p>I'm trying to scrap a table web-sites (an example is in this url: <a href="https://...
<p>To select the <code>&lt;option&gt;</code> with text as <strong>Q1 2022 13F Filings</strong> you need to induce <a href="https://stackoverflow.com/a/59130336/7429447">WebDriverWait</a> for the <a href="https://stackoverflow.com/a/54194511/7429447"><em>element_to_be_clickable()</em></a> and you can use either of the f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove and delete pointers that match a condition in a vector<p>I have a <code>std::vector</code> that I would like to remove pointers from the vector that m...
<p><code>std::unique_ptr</code> does the deletion for free:</p> <pre><code>std::vector&lt;std::unique_ptr&lt;GameObject&gt;&gt; gameObjects; // Remove objects from vector gameObjects.erase( std::remove_if( gameObjects.begin(), gameObjects.end(), [](const auto&amp; p) { return p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tkinter: how to get the result from a button and use it in a function?<p>I want the user to click a button called "choose a folder" and it allows them to cho...
<p>I see a few things here.</p> <ol> <li><p>you are using global in a class. Use a class attribute instead.</p></li> <li><p><code>self.askopenfilename</code> is wrong it is just <code>askopenfilename</code>. self. will make the program look for a class attribute called <code>self.askopenfilename</code> and that does n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I included <winuser.h>, but compiler throws "was not declared" at MonitorFromWindow<p>There is already a <a href="https://stackoverflow.com/questions/2070901...
<p>Assuming your copy of <code>&lt;winuser.h&gt;</code> actually supports <code>MonitorFromWindow()</code>, then make sure that you have <code>WINVER</code> set to <code>0x0500</code> or higher to enable <code>MonitorFromWindow()</code>. See the following for more details:</p> <p><a href="https://docs.microsoft.com/en...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: definition of linux perf cache-misses event?<p>I am trying to use linux perf to profile cache performance. </p> <p>perf list shows there is a cache-misses e...
<p>The <code>cache-misses</code> event corresponds to the misses in the last level cache (LLC). Note that this is an architectural performance monitoring event, that is supposed to behave consistently across microarchitectures.</p> <p>This can be verified from the source code - <a href="https://github.com/torvalds/lin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - fill missing lat long cordinates by interpolation<p>With dataframe like below</p> <pre><code>Time Lat Long 19:24:52.135 35.61067 139.63...
<p>Tried <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.interpolate.html" rel="nofollow noreferrer">df.interpolate()</a> as suggested in comments - that works!!</p> <pre><code>(Pdb) df["Long"].interpolate(method='linear') 0 139.630228 1 139.630278 2 139.630328 3 139.63...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to interpret Amazon ActiveMQ's EnqueueTime?<p>I'm trying to design an autoscaling policy to scale out/in the number of consumers listening to a queue. My...
<p><code>EnqueueTime</code> does represent how long messages &quot;wait&quot; in the queue until they are consumed, but it is important to note that it is an <em>average</em>. Therefore, it is unlikely to fit your use-case because the relative &quot;weight&quot; of each message's individual <code>EnqueueTime</code> wil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI does not evaluate elseif correctly?<p>I am creating a SwiftUI view where I have three possible conditions, and want to show different content based o...
<p>Well, actually if to add buttons and switch states on buttons then all works, so this is something with delayed updates (maybe racing, maybe bug... did not dig further)</p> <p>Here is actually solution, which works (tested with Xcode 11.2 /iOS 13.2) ... separate those conditional dependent views into dedicated view...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pointer pointing to a class object created from template for later use?<p><strong>Edit 1:</strong> I am not allowed to modify the class bar atm, aschepler’s ...
<p>As comments have pointed out, you can't use a pointer to a variable declared in a block after the end of that block. You could fix this with a <code>std::unique_ptr</code>, or possibly <code>std::optional</code>.</p> <p>Here are two possible solutions.</p> <p>#1: A <code>std::variant&lt;foo&lt;bar_1&gt;, foo&lt;bar_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to have the navigation fully displayed in full screen and hamburger in phone width<p>I am not sure how to look for this information online, so I want ...
<p>Heres one example <a href="https://codepen.io/alvarotrigo/pen/MWEJEWG" rel="nofollow noreferrer">https://codepen.io/alvarotrigo/pen/MWEJEWG</a></p> <pre><code> &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt; &lt;section class=&quot;top-nav&quot;&gt; &lt;div&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are LLVM "fatal errors" really fatal?<p>I'm wondering if LLVM fatal errors are really "fatal" - ie. they invalidate the entire state of the system and are no...
<p>Ok, after reading through the LLVM source for 10+ hours and enlisting the help of a friendly LLVM dev, the answer here is that this is not in fact a fatal error, after all! </p> <p>The functions called above in the C interface are deprecated and should have been removed; LLVM used to have a notion of "global conte...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this the Time Complexity of this For Loop O(N)?<p>Is there a way to understand why the time complexity of the following is O(N), either(or both) from ...
<p>An important insight is that the last entry in <code>firstSmallLeft</code> that received a value (at index <code>i-1</code>) represents the <strong>top of a stack</strong>, which is implemented as a linked list. An entry in <code>firstSmallLeft</code> represents an input value (as the index where it occurs is the in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting cURL to Python with Requests<p>I'm having trouble accessing an API with Python. Here's my Python:</p> <pre><code>import requests url = 'https://...
<p>Your problem is that the content passed on the cURL line is an assigned to <code>conf</code> of a JSON object, but you're passing in a Python dict to <code>data</code>.</p> <p>This should work:</p> <pre><code>import requests url = 'https://bigjpg.com/api/task/' payload = 'conf={"style": "photo", "noise": "3", "x2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Loop Through FileList and Display<p>I am trying to loop through a FileList in React and not having any luck.</p> <p><a href="https://i.stack.imgur.com/...
<p>If you want to capture or render the output you should use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer">map</a> instead of <code>forEach</code>.</p> <p><code>forEach</code> executes a function for each element but it doesn't do anythin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fill in a partiiton field with current date in PartitonRecord processor in Apache NiFi<p>I need to partition records comes from Kafka based on date. For this...
<p>Use a <code>UpdateAttribute</code> processor:</p> <ul> <li><code>partition_date</code> (dynamic property): <code>${created_at:isNull():ifElse(${now()}, ${created_at})}</code></li> </ul>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reverse the data stack using loops<p>I'm trying to reverse the stack using two loops one to send items from the data stack to return stack. And another to ge...
<p>The trouble you've got here is that <code>DO ... LOOP</code> keeps the loop parameters (index and termination value) on the return stack and discards them at the end of the loop. That's why <code>&gt;R</code> and <code>R&gt;</code> <em>must</em> be in balanced pairs during a loop.</p> <p>Your code puts a value on t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a data frame selecting shiny app in R?<p>I have a data frame with three columns:</p> <pre><code>x = data.frame(group=c("group1", "group2", "grou...
<p>Here's a start:</p> <pre><code>library(shiny) library(dplyr) x = data.frame(group=c("group1", "group2", "group3","group1","group3", "group4", "group2"), user=c("user1", "user3", "user5", "user9", "user14", "user18", "user24"), erro=c("error1", "error2", "error4", "error3", "error2", "...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to decode Piexif XPKeywords?<p>I've been using Piexif to add tags to Jpeg images and that has been going fine. Now I wanted to read the tags an image has...
<p>Might've been overthinking it. We can simply use something like this to return the numbers to ASCII characters.</p> <pre><code>tags = "" for num in exif_dict["0th"][piexif.ImageIFD.XPKeywords]: tags += chr(num) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Data Studio - Running Weighted Average (based on % of total relative to corresponding data)<p>I'm trying to create a scorecard to show a 'running' wei...
<p>The <a href="https://docs.google.com/spreadsheets/d/1ds7s6FQbV4Ekiw_aIJshDLbxdY9xyYBgIeHWINhy_X4/edit#gid=454395457" rel="nofollow noreferrer">expected output</a> fields can be recreated by first adding a fixed <code>SUM(# Orders)</code> field (titled <code>Total Orders</code> below), where values in all rows are th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get contributions and squared cosines in sklearn PCA?<p>Working primarily based on <a href="https://wires.onlinelibrary.wiley.com/doi/abs/10.1002/wic...
<p>This paper does not play well with sklearn as far as definitions are concerned.</p> <p>The <code>pca.components_</code> are the two principal components of your data after your data is centered. And <code>pca.fit_transform(df)</code> gives you the components of your centered data set w.r.t. those two principal compo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetching data from memory, how is it done?<p>What part of the computer program fetches the relevant data from memory?</p> <p>For example:</p> <pre><code>let ...
<p>The processor has an address generator, and a read &amp; write interface.  This is true across all processors but the details vary.</p> <p>Simple, educational and older processors have an MAR, memory address register, and MBR, memory buffer register, and some control signals. That constitutes the cpu to memory inte...