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: Highlight cells in a sheet based on corresponding cell values in another sheet with a macro<p>I would like to create a macro that would highlight certain cel...
<p>If you do not prefer Conditional Formatting, please use the next VBA code. It will place the range to be processed (from ) in an array, iterate between all array elements and create a <code>Union</code> Range to be colored at the end:</p> <pre><code>Sub HighlightCells() Dim shCh As Worksheet, shF As Worksheet, last...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cant grant mariadb permission to new user. Access denied for user 'root'@'localhost' (using password: YES)<p>I am attempting to grant permissions to a new us...
<p>The aspect of <code>SHOW GRANTS</code> for <code>root@localhost</code> that enumerates a list rather than showing <code>GRANT ALL PRIVILEGES ON ...</code> indicates a privilege is missing.</p> <p>By creating a new user, removing an arbitrary privilege, and comparing its <code>SHOW GRANTS</code> to the <code>root@loc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How is the output() function different than, better than, a simple printf or fprintf statement?<p>A book that I am reading [1] says something that I need hel...
<p>There is no <code>output()</code> function in standard lex, nor in Flex. So I'd suggest ignoring any book which suggests you use it.</p> <p>The functions specified by Posix which can be used in user code in the lex input file are:</p> <pre class="lang-c prettyprint-override"><code> int yylex(void); int yymore...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert an array of strings into a number?<p>I'm fetching data from an API which returns currency exchange rates like so:</p> <pre><code>{&quot;EUR_US...
<p>The example data you have supplied is an plain old Javascript object literal:</p> <pre><code>{&quot;EUR_USD&quot;:1.044136} </code></pre> <p>You just need to access the exchange rate(s) by their name. Assuming it's in a variable called <code>rates</code>, it's just</p> <pre><code>const rate = rates.EUR_USD; </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: language in microservice RESt API design<p>So im in the middle of breaking up a monolith, and i have decomposed it into services. However i came across somet...
<p>It is likely that this is a case of different bounded contexts, where the same thing might be referred to using different terms, or the other way around, where the same word might have different meanings. It is important to understand and map these contexts, so that ambiguities can be minimized and interrelationship...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: connecting localhost fastapi to react app<p>I am trying to develop a react app that connects to a python fastapi server. I am developing the frontend and the...
<pre><code>app.add_middleware( CORSMiddleware, allow_origins=[&quot;*&quot;], allow_credentials=True, allow_methods=[&quot;*&quot;], allow_headers=[&quot;*&quot;], ) </code></pre> <p>First try to allow all origins, when it works fine u can try to restrict</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ORDER A TEXT IN A COLUMN POWERQUERY<p>I would like to know if you can assist me in the following matter:</p> <p>in PowerQuery I have a column like this: inpu...
<p>From your example, it appears you only want to sort the text in a single column.</p> <p>You can do that by:</p> <ul> <li>Split each text line by the &quot;/&quot; into a List.</li> <li>Sort the List</li> <li>Recombine the List using the &quot;/&quot; delimiter.</li> </ul> <p>A line of M Code that will do that:</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mapping the data does not work for me react js/axios<p>I deleted the map in the return because it doesn't work. I get a error like: map is not a function. I ...
<p>As far as I and @Jballin can see, you are console.logging an extra &quot;data&quot;, with a &quot;response&quot; inside. Could you please try with:</p> <blockquote> <p>response.data.data.proposals.map()</p> </blockquote> <p>Please, let us know if it solves your problem!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Class cannot implement TypeScript interface when using static methods<p>TypeScript recognises <code>static</code> class methods as valid properties that adhe...
<p><a href="https://www.typescriptlang.org/docs/handbook/2/classes.html#implements-clauses" rel="nofollow noreferrer">An <code>implements</code> clause on a <code>class</code> declaration</a> tells the compiler to check that <em>instances</em> of the class are assignable to the implemented type. You use <code>implemen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract data from HTML <a> tags<p>I am trying to extract data from a web page which contains account data. With help I have managed to extract some info fro ...
<p>You need to use the <code>className</code> property of the element, rather than <code>class</code>, which is an HTML attribute. See <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/className" rel="nofollow noreferrer">MDN className docs</a>.</p> <p><div class="snippet" data-lang="js" data-hide="fals...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reverting third party merge in GitHub<p>Git gave me this reply:</p> <pre><code>$ git push -u origin master To https://github.com/xxxxxxx/yyyyyy.git ! [rejec...
<p>If you do not want that commit at all, you can simply force push your own branch (and make sure to have a word with the other contributor)</p> <pre><code>git push --force </code></pre> <p>You can also consider <code>master</code> as a <a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VBA Code To Use Macro.A In Workbook.A On Workbook.B.WorkSheet1 Without 'Opening' It<p><a href="https://1drv.ms/u/s!AsImeLMHQa7l-kzG8TxPzIXgWz-h?e=m1YEaa" rel...
<p><strong>Updated after checking the files</strong></p> <p>There is no need to use <code>Application.Run</code> to run a code from the same workbook. Just <code>Call</code> the <code>Sub</code> you need, just don't forget to activate the target workbook that needs be formatted first.</p> <pre><code>Sub Open_External_W...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to export agent population data into excel in Anylogic<p>I want to take a time snapshot of agent population within system with all the parameter. Is ther...
<p>Simplest solution, drag the text file object from the connectivity pallet to your model. Change it to write, create a new text file and link it to the file you created.</p> <p>Then have some button, event or function and you simply add the following type of code:</p> <pre><code>for (MyAgent myAgent:myAgentPopulation...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can itterows restart at each new index group?<p>I have an inventory model where I have inputs increasing the inventory and outputs decreasing the inventory e...
<p><s>You can first calculate a net change and use <code>group_by</code> and <code>cumsum</code> to calculate the result. </s></p> <p>Edit: <code>cumsum</code> doesn't seem capable to solve the problem. Here is a functional way using numpy to solve it.</p> <pre class="lang-py prettyprint-override"><code>my_df[&quot;net...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# sorting part of an array based on another array<p>I have an array of a class that is representing a user and another array of a class that is representing...
<p>Im sure there are alot of ways to do this, I have alot of LINQ left to learn but the following should get you started;</p> <pre><code>// First, get the users that are mentioned by a PinnedItem var pinnedUsers = pinnedItems.Select(x =&gt; users.FirstOrDefault(y =&gt; y.UserId == x.UserId)); // Get all the users that...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to iterate .data[[ ]] over a character vector in r?<p>I've been doing some really repetitive data analysis tasks (with lots more in the future...
<p>More in line with the <code>tidyverse</code> &quot;way&quot;, I'd use quasiquotation.</p> <pre class="lang-r prettyprint-override"><code>make_table &lt;- function(df, group.by) { df %&gt;% group_by(across({{group.by}})) %&gt;% summarize(hwy = mean(hwy), .groups = &quot;drop&quot;) } make...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Submit data into table based on certain input field in HTML form<p>I am currently creating a survey where the answers are entered into a database.</p> <p>I h...
<p>Yes it's completely possible. Just put the question ID as a hidden field in the form, and it will be submitted along with the answer data when the form is submitted. Then you can retrieve it from the <code>$_POST</code> data just like the answer, and use it in your SQL query.</p> <p>For example:</p> <p>HTML form:</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NoClassDefFoundError error with JDBCPool in vertx 4.3.2<p>I am getting error with new JDBCClient API.</p> <pre><code>java.lang.NoClassDefFoundError: io/agroa...
<p>Given that the vert.x client requires a pool, all pool implementations are marked as optional dependencies and your build tool does not pull it to your project. Which means you need to explicitly add it; otherwise you will see that error. For this case, you will need:</p> <pre><code>io.agroal:agroal-api1.16 io.agroa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeORM Entity Validators not working when E2E testing GraphQL API with SuperTest<p>Morning everybody!</p> <p><strong>Tech Stack: NestJS + GraphQL + TypeORM<...
<p>We managed to find the solution in <a href="https://github.com/nestjs/nest/issues/5264" rel="nofollow noreferrer">this PR</a> - Class Validation had to be passed manually to the e2e test file by adding <code>app.useGlobalPipes(new ValidationPipe());</code></p> <p>Fixed test setup below:</p> <pre><code>beforeEach(asy...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Open pygame window from web page with django python<p>I'm trying to have a website where you can play games. You will eventually be able to click a button an...
<p>Fundamentally, this approach won't work, because you're running the code on your server, but you want the pygame window to appear on the screen of the person who's visiting your website. Your code needs to run client-side. Your options are to move everything out of the web browser (i.e., provide a file for the user ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Slice a given txtfile and write only part of it in a newfile in python<p>This is my original .txt data:</p> <pre><code>HKEY_CURRENT_USER\SOFTWARE\7-Zip HKEY_...
<p>Try this:</p> <pre><code>## read file content as string with open(&quot;file.txt&quot;, &quot;r&quot;) as file: string = file.read() ## convert each line to list lines = string.split(&quot;\n&quot;) ## write only last part after &quot;\&quot; in each line with open(&quot;new.txt&quot;, &quot;w&quot;) as fi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find if column value reached upper limit or lower limit first in pandas<p>I have a pandas dataframe given below</p> <pre><code>id val ulim llim 1 100...
<p>You need several things to complete this task: <code>shift</code> to shift the values up, <code>np.select</code> to map the values, then <code>bfill</code> to back fill the values when needed:</p> <pre><code># first we shift the values up by 1 row shifted = df['val'].shift(-1) # temporary compare the shifted value ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SelectSingleNode with each node having different namespace<p>I have the following XML:</p> <pre><code>&lt;Invoice xmlns=&quot;urn:oasis:names:specification:u...
<p>FYI in the future if you have a &quot;default” namespace like this (notice there's no alias on this one)</p> <pre><code>&lt;Invoice xmlns=&quot;urn:oasis:names:specification:ubl:schema:xsd:Invoice-2&quot;&gt; </code></pre> <p>...then you can create a dummy alias while including it in your namespaces list:</p> <pre c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change a button onclick href based on multiple IDs<p>I have an order summary. The order summary is a collection of 5 different HTML IDs based on user select...
<p>I think what you're looking for, is something like this :</p> <pre><code>// List Shopify codes for all possible variations as a hierarchical object let variations = { // coffee &quot;BRAZIL&quot; : { // bag &quot;2 BAGS&quot; : { // delivery &quot;EVERY 4 WEEKS&quot; : { // roast type...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inline assembly array sum benchmark near-zero time for large arrays with optimization enabled, even though result is used<p>I have written two functions that...
<p>The compiler is hoisting the inline asm out of your repeat loop, and thus out of your timed region.</p> <p><strong>If your goal is performance, <a href="https://gcc.gnu.org/wiki/DontUseInlineAsm" rel="noreferrer">https://gcc.gnu.org/wiki/DontUseInlineAsm</a></strong>. The useful thing to spend your time learning fi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django - separated settings by environment. Not finding variable from base settings<p>I've split my django environment as per <a href="https://stackoverflow....
<p>You have to import the <code>.base</code> setting in your test settings to make them available in <code>test.py</code></p> <pre class="lang-py prettyprint-override"><code>from .base import * # ... your other test settings </code></pre> <p>The second thing is to choose which settings you like in the <code>__init__.py...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply PolynomialFeatures only to certain (not all) independent variables<p>I am very new to scikit-learn <code>PolynomialFeatures</code> and strugglin...
<p>You can use scikit-learn <a href="https://scikit-learn.org/stable/modules/generated/sklearn.compose.ColumnTransformer.html" rel="nofollow noreferrer"><code>ColumnTransformer</code></a> to apply the <code>PolynomialFeatures</code> transformer and the <code>OneHotEncoder</code> only to specific columns. Note that if y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating serial text output with a text<p>Hello I want to know how can I make a code like i want to input a number XXX it will output</p> <p>ChinaXXX Beijing...
<pre><code>#include &lt;iostream&gt; #include &lt;string&gt; int main() { std::string number; std::cin &gt;&gt; number; std::cout &lt;&lt; &quot;China&quot; &lt;&lt; number &lt;&lt; &quot; Beijing&quot; &lt;&lt; number &lt;&lt; &quot;-CHINA-&quot; &lt;&lt; number &lt;&lt; &quot; +180243189(&quot; &lt;&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native Noob question: How to use an JS library in React Native<p>I thought it would be pretty straightforward to use a js library that is packaged with...
<p>You need to import totp like this</p> <pre><code>import {default as hotptotp} from 'hotp-totp const {totp} = hotptotp </code></pre> <p>You can read more about it <a href="https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export" rel="nofollow noreferrer">here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix "can not fin'd bcrypt" in NestJS?<p>As found in this <a href="https://stackoverflow.com/questions/61269160/how-to-use-bcrypt-module-to-save-encryp...
<p>Import the bcrypt on the files where you use it like this:<br></p> <pre><code>import * as bcrypt from 'bcrypt'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to quit while loop after a string input<p>Trying to stop the below code from continuously requesting input after user enter q. I enter q as the first inp...
<p>Every time the loop has to run through all the way. The only way to stop is to check during the loop if it q has been typed. Eg:</p> <pre><code>while true: w = input(&quot;Enter the student's W#:&quot;) if (w == 'q') break name = input(&quot;Enter the student's name:&quot;) if (name == 'q') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetching TMYs from the NSRDB for interval size in 5 minutes<p>I am using pvlib <a href="https://pvlib-python.readthedocs.io/en/v0.9.0/generated/pvlib.iotools...
<p>Perhaps you're using an older version of pvlib? I would try updating to the latest version with <code>pip install -U pvlib</code> or similar. You can check your installed version with <code>print(pvlib.__version__)</code>.</p> <p>This snippet successfully retrieves 5-minute data for me with pvlib 0.9.1:</p> <pre c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Landoop. Kafka connect how to change worker properties<blockquote> <p>landoop/fast-data-dev:2.6</p> </blockquote> <p>I want to change default <strong><code>b...
<p>For starters, that image is very old and no longer maintained. I'd recommend you use <code>confluentinc/cp-kafka-connect</code></p> <p>In any case, for both images, you can use</p> <pre><code>environment: CONNECT_CONNECT_CLIENT_CONFIG_OVERRIDE_POLICY: 'All' CONNECT_PRODUCER_OVERRIDE_BATCH_SIZE: 65536 </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Class WebSwapCGLLayer is implemented in both Mac OS X /System and node_modules<p>I am completely new to using node and electron. I was running through the <a...
<p>This is just a warning and Electron.js should start fine, see <a href="https://github.com/electron/electron/issues/33685" rel="nofollow noreferrer">https://github.com/electron/electron/issues/33685</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove duplicate code in WPF's TabControl<p>Having trouble removing duplicated code in XAML code.</p> <p>Example:</p> <pre><code>&lt;TabControl x:Name=&quot;...
<p>If you are referring to the entire GridView content, you can create your own control just as you would a form. But instead of</p> <pre><code>&lt;Window x:Class... other xmlns stuff of window &gt; [actual content within] &lt;/Window&gt; </code></pre> <p>Just create a file with the content of your gridview such...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort alphanumeric columns in a dataframe?<p>I'm trying to get this order:</p> <pre><code>ID Q1 Q2 Q3 Q4 ...
<p>Another option, <code>dplyr</code>/base only. This relies on the assumption that there is only one such &quot;number&quot; within each value, and it is not interrupted. (For instance, <code>&quot;A1B2C&quot;</code> will sort here as <code>12</code>.)</p> <pre class="lang-r prettyprint-override"><code>dat %&gt;% ar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create Postgress view to combine multiple tables data<p>I have multiple tables with different column names like below,</p> <p><strong>customer table</strong>...
<p>just use <code>Union</code> or <code>Union All</code> depending on duplicate values. based on data</p> <pre><code>CREATE VIEW view_name AS SELECT concat('c_',c_id) AS userId, company_name AS user_Name, phone AS contact FROM customer UNION SELECT concat('e_',e_id), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error : The argument type 'Context' can't be assigned to the parameter type 'BuildContext'<p>There was a problem with my code, while I was trying to exit a s...
<p>Here in the question i have been using a <code>stateless widget</code> but I need to use a <code>stateful widget</code>, so the solution is to create a new file as a <code>stateful widget </code> and dumb all this code in it and the error was solved.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding a condition to desplay a list of values in Oracle Apex<p>I need help with putting a condition on a List Of Values in Oracle apex. So I have 2 tables:<...
<p>Presume this is page <code>P1</code>. Duljina brodice is then entered into <code>P1_DULJINA_BRODICE</code> item. Vez LoV would then reference page item as</p> <pre><code>select v.broj_vez as display_value, v.id_vez as return_value from vez v where v.max_duljina &gt; :P1_DULJINA_BRODICE </code></pre> <p>In ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get visible items bounding-box?<p>I have a scene that contains many <code>QGraphicsItem</code> items(about 25000 items) , When I hide useless items, H...
<p>I do not think there is any function for bounding getting rect of only visible items. I would use brute force, iterating over all visible items and calculating the total bounding rect. For example have a look at the implementation of <code>QGraphicsScene::itemsBoundingRect()</code> here <a href="https://code.woboq.o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Layout Weight distribution wrongly interpreted<p>I want to define a composite layout where the header and footer <code>LinearLayout</code> blocks take 10% of...
<p>Try the following code:</p> <p>(You can undo the background changes I did, it was just so I could visualize what was going on.)</p> <p>According to the following post: <a href="https://stackoverflow.com/questions/18896902/android-layout-weight-not-working-as-i-thought">Android layout weight not working as I thought<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React MUI Chip onDelete access to stopPropagation method<p>I have a Chip like:</p> <pre class="lang-js prettyprint-override"><code> const onDelete = (e) =&g...
<p>The <code>stopPropagation()</code> prevents further propagation of the current event but redirecting to links are still processed. If you want to stop those behaviors, you can use <code>preventDefault()</code> method :</p> <pre><code>const onDelete = (e) =&gt; { e.preventDefault(); // e.nativeEvent.stopProp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Routes Problem website only in production<p>I am working on my personal website and i have found a problem only happening in production, the problem do...
<p>When you use BrowserRouter you are making use of <a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API" rel="nofollow noreferrer">the History API</a> which lets you write code that says:</p> <p><em>Hey browser. I'm going to change the DOM using JavaScript now. It is going to change the page so it is ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automate user creation using google app script in Google Admin SDK<p>I want to automate user creation in google as an Admin where I use app script to do it, ...
<p>As per the <a href="https://developers.google.com/apps-script/advanced/admin-sdk-directory#add_user" rel="nofollow noreferrer">official documentation</a>, if you want to do it with Google Apps Script, you should format your code as follows:</p> <pre><code>function createUsers() { const userInfo = { &quot;prima...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: select specific rows in text file to read into two separate columns in a pandas dataframe<p>I have a text file like the following</p> <pre><code>2022-mary ['...
<p>Create one column DataFrame and then selecting even and odd values:</p> <pre><code>df = pd.read_csv(file, sep=&quot;|&quot;, names=['data']) df = pd.DataFrame({'user': df.data.iloc[::2].to_numpy(), 'fruits': df.data.iloc[1::2].to_numpy()}) </code></pre> <p>Or create list:</p> <pre><code>with open...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subquery returned more than 1 value with WHERE CASE<p>I have 3 related tables representing objects: clients, users and leads. Users have type 'User' or 'Admi...
<p>This should be done as an <code>if else</code> not as a <code>case</code>, you can do it like:</p> <pre class="lang-sql prettyprint-override"><code>if (SELECT type FROM users WHERE username='[the username]') = 'Admin' begin --The records you allow for admin to see for example (SELECT * FROM Leads where ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to explode array in php<p>i have data array, and this my array</p> <pre><code>Array ( [0] =&gt; Array ( [id] =&gt; 9,5 ...
<p>The code down below should do the job. But I didn't understand why you didn't create those items seperately in the first place.</p> <pre><code>foreach ($arr as $i =&gt; $data) { if (!str_contains($data['id'], ',')) continue; $items = explode(',', $data['item']); foreach(explode(',', $data['id']) as $i ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling a common method of tuple elements<p>Say I have a tuple of types <code>T1,...,TN</code> that implement some method, <code>apply()</code>.</p> <p>How d...
<p>There may be snazzier C++17 ways of doing it, but there is always good old-fashioned partially-specialized recursion. We'll make a <code>struct</code> that represents your recursive algorithm, and then we'll build a function wrapper around that <code>struct</code> to aid in type inference. First, we'll need some imp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java.lang.IllegalArgumentException in the program after building in jar<p>I have an exe file in a JavaFX project that I launch on a button click. Works fine ...
<p><em><strong>Preface:</strong> This answer assumes you're using the &quot;standard directory layout&quot; of Maven/Gradle, based on the presence of <code>src/main/java</code> and <code>src/main/resources</code>.</em></p> <hr /> <p>Files under <code>src/main/resources</code> are <strong>resources</strong>, not files. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edit array elements properties in editor<p>So...</p> <p>I was watching some old unity tutorial videos and saw people editing properties of the elements of an...
<p>The problem is that your Sound class inherits from Object (MonoBehaviour), and Object are always serialized as reference. Make your Sound not inherit MonoBehaviour and it should look like in example (except that you have newer version of unity with reorderable list drawer)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing JSON with escaped unicode characters displays incorrectly<p>I have downloaded JSON data from Instagram that I'm parsing in NodeJS and storing in Mong...
<p>You can try converting the unicode escape sequences to bytes before parsing the JSON; probably, the <a href="https://github.com/mathiasbynens/utf8.js/" rel="nofollow noreferrer">utf8.js</a> library can help you with that.</p> <p>Alternatively, the <a href="https://stackoverflow.com/a/66368136">solution</a> you found...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jupyter Notebook doesn't detect Python 3.7<p>I am currently trying to install <code>Tensorflow 1.15.0</code>, but my current Python version is 3.8.10 which d...
<p>You need not to uninstall <code>Python 3.8</code> from your system. If you just simply follow the steps mentioned in <a href="https://www.tensorflow.org/install/pip#step-by-step_instructions" rel="nofollow noreferrer">this</a> link, you can successfully install <code>TensorFlow 1.15</code> with <code>Python 3.7</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Twilio Flex - Getting Agent properties after change of activity<p>I need to get the agent properties that change the activity, is there a way to get the agen...
<p>The only agent that can set the activity is the logged in agent which you can get using <code>manager.workerClient</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple linking of a static library across different shared objects<p>Currently I have a setup where there is a 3rd-party supplied shared library, <code>lib...
<blockquote> <p>What are the options to deal with this, given that I can't modify the third-party library?</p> </blockquote> <p>Both you and the 3rd party developer have committed a sin -- you are <em>exposing</em> symbols from <code>ipps.a</code> in your own interface (this is the default on UNIX).</p> <p>You should h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing a custom asynchronous sequence in Swift<p>Imagine I want to create a function that, given an array of numbers, computes the square, cube, and fo...
<p>Thanks a lot to <a href="https://stackoverflow.com/users/1271826/rob">Rob</a> for providing the basic idea on how to implement something like this.</p> <p>I wrote it in the following way:</p> <pre class="lang-swift prettyprint-override"><code>func powers(of numbers: [Int]) -&gt; AsyncStream&lt;Int&gt; { return A...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I blur background image without affecting parents?<p>I want to blur <em>only</em> my background image whilst keeping the parents unaffected.</p> <p><...
<p>Added to divs with class .background and .foreground .background div has filter:blur attribute and .foreground div has backdrop-filter: blur attribute.</p> <p>Check if this works for you.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redux Toolkit: createAsyncThunk - rejectWithValue - TypeError: Cannot destructure property 'rejectWithValue' of '_ref2' as it is undefined."<p>I've been tryi...
<p>The first argument that is passed to the callback function you give to <code>createAsyncThunk</code> is the argument that you pass when you call the action. <a href="https://redux-toolkit.js.org/api/createAsyncThunk#payloadcreator" rel="nofollow noreferrer">take a look here for more information.</a> The second argum...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inject bytecode using asm before every call to a particular method<p>How can I rewrite a class (preferably using asm) such that a <code>setupSpecial()</code>...
<p>The JVM has a stack-based architecture, so you don't need to worry about the parameters to the <code>special(int)</code> call. If you simply prepend the <code>setupSpecial()</code> call to the <code>special(int)</code> call using:</p> <pre class="lang-java prettyprint-override"><code>@Override public void visitMetho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (LwIP) socket send() returns "Connection already in progress"<p>I'm maintaining an embedded system that uses LwIP. The relevant code is as follows (edited):<...
<p>Error code 119 is <code>EINPROGRESS</code>. It means the socket is operating in <strong>non-blocking mode</strong> <sup>1</sup>, and the previous <code>connect()</code> operation hasn't finished yet, which is why the <code>send()</code> fails.</p> <p><sup>1</sup>: Which means, there must be more code that you are no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum based on pattern match for multiple rows<p>I have an excel input data like below</p> <pre><code>purchase revenue FY_1920 FY_2021 FY_2122 PID21...
<p>IF your PIDs criteria a few and do not change, you may use several SUMIFS combined:</p> <p><a href="https://i.stack.imgur.com/5dsN7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5dsN7.png" alt="enter image description here" /></a></p> <p>for <code>cars</code> output formula is:</p> <pre><code>=S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Top2Vec Model Failing To Train (Following Simple PyPi Tutorial)<p>I am trying to follow this tutorial on PyPi (See Example -&gt; Train Model): <a href="https...
<p>Solved this by moving from a Jupyter notebook in favor for a typical .py file, as well as cloning the library, installing the requirements to a fresh virtualenv and running the setup.py file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paper trail version history unexpectedly contains record not matching conditional<p>As per <a href="https://github.com/paper-trail-gem/paper_trail#2b-choosin...
<p>The behavior makes kind of sense to me because when the status changed from <code>draft</code> to something else then the status is at the time of saving the record not <code>draft</code> anymore and therefore the previous version will be stored.</p> <p>If you do not want to store the last draft version then you nee...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding custom permission to Django Rest Framework Function-Based view<p>I am trying to write a custom <code>IsOwner</code> permission for a DRF function base...
<p>You can get <code>user_id</code> from <code>view.kwargs</code>.</p> <pre><code>class IsOwner(permissions.BasePermission): def has_permission(self, request, view): return request.user.id == view.kwargs['user_id'] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flowable Pipeline to Azure Container Registry: "aad access token with sp failed client id must be guid"<p>I have a Azure Devops Pipeline where i want to buil...
<p>I ended up pushing the image to the local docker repository and than use the specific Devops Task to push to the repository.</p> <p>The new pipeline looks like this:</p> <pre><code>steps: - script: | sed -i 's/&lt;dependencies&gt;/&lt;dependencies&gt;\r\n&lt;!--mssql--&gt;\r\n&lt;dependency&gt;\r\n&lt;groupId&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I push a prop and its value to objects that don't have that specific property knowing that these objects are in an array of objects<p>what I want to ...
<p><code>peopleData.push</code> is wrong. You need to update the object, not to add new objects to the array.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const peopleData =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you make npm install locally?<p>NPM will not install packages locally, update package.json, nor update package.lock. It's a very perplexing issue hone...
<p>For me, it turned out that I had modified my C:\Users{user}.npmrc file which had the setting &quot;location=global&quot; set. I deleted the setting and it all worked.</p> <p>This got set, I believe, because I did npm config set local=global earlier due to a deprecation warning I received using an older version of np...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to subtract Matrix from Vector of Matrix<p>I want to subtract a Matrix from a Vector of Matrix. For Example, In below defined variable i want to sub...
<p>First of all, <code>map</code> is not the fastest thing, loops will almost always beat it. This array comprehension is 70% faster than <code>map</code>.</p> <pre><code>@btime [[x[i]-$y[i] for i in eachindex($y)] for x in $xl]; 33.300 μs (1001 allocations: 117.31 KiB) </code></pre> <p>Now, for why multithreading is...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Elastic search un-searchable feild?<p>I have an index with a mapping field of type text, its called ean_code, but when I try to retrieve documents querying t...
<p>Since <code>product_sale_elements</code> is of type <code>nested</code> you need to use a <code>nested</code> query, like this:</p> <pre><code>POST &lt;index-name&gt;/_search { &quot;query&quot;: { &quot;nested&quot;: { &quot;path&quot;: &quot;product_sale_elements&quot;, &quot;query&quot;: { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is the time complexity of nested for-loops always of O(n^2)?<pre><code>for (i = 1; i &lt;= n; i++) { for (j = n; j &gt;= i; j--) } </code></pre> <p>I'm s...
<p>First of all, the algorithm should be something like this:</p> <pre><code>for (i = 1; i &lt;= n; i++) for (j = n; j &gt;= i; j--) DoSomeWork(i, j); // &lt;- Payload which is O(1) </code></pre> <p>To find out the time complexity, let's count how many times <code>DoSomeWork</code> will be executed:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is there Material increment/decrement Button implementation for Android?<p>is there by any chance a Material design implementation for increment/decrement bu...
<p>No, but it's quite simple to implement, you only need a linear layout with horizontal orientation, containing a button, a textview and another button. Have an internal value to count and then associate a callback to your buttons, where you add/substract your counter and update the textview, like this:</p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create Tensorflow Dataset with dataframe of images and labels<p>I want to create a dataset with tensorflow and feed this with images as array (dtype=unit8) a...
<p>You can actually pass a dataframe directly to <code>tf.data.Dataset.from_tensor_slices</code>:</p> <pre><code>import tensorflow as tf import numpy as np import pandas as pd df = pd.DataFrame(data={'images': [np.random.random((64, 64, 3)) for _ in range(100)], 'labels': ['ok', 'not ok']*50})...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Header based routing with Chi<p>I'm trying to implement two routes using the Chi router. One should be invoked only if the &quot;host&quot; header is set to ...
<p>As mentioned on comment: you cannot assign multiple handlers to one route.</p> <blockquote> <p>RouteHeaders is a neat little header-based router that allows you to direct the flow of a request through a middleware stack based on a request header.</p> </blockquote> <p><code>RouteHeaders</code> is used to put your req...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery form submit can't handle success/error notifications<p>I want to show a success notification if the submit was successful with <a href="https://github...
<p>This statement in your comment under the question clarifies the issue:</p> <blockquote> <p>I want to send the form's data then the page is just reloading immadiatelly and the notify doesn't showing up</p> </blockquote> <p>The issue is because you've not called <code>preventDefault()</code> on the event which is rais...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does only one value gets return in NodeRED function node?<p>I have a NodeRED flow which has a function node and my code is following</p> <pre><code>var l...
<p>Finally figured it out, posting if incase anyone interested!</p> <pre><code>var left = {payload : msg.payload.readResults[0].v }; var right = {payload : msg.payload.readResults[1].v }; return [[left,right]]; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Benchmark: "***WARNING*** Library was built as DEBUG. Timings may be affected."<p>In <code>~/install/benchmark</code>, I have checked out Google Bench...
<p>Try telling Bazel to compile everything in optimized mode: <code>bazel run -c opt //fast_inverse_sqr_root</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Unsupported operand while adding 2 functions output in python?<p>I am using python 3.8.8 and while running a simple program of Fibonacci it is <stron...
<p>Add a <code>return n</code> to your code</p> <pre class="lang-py prettyprint-override"><code>def fib(n): if n&lt;=1: return n else: return(fib(n-1) + fib(n-2)) for i in range(10): print(f&quot;fib({i}) = &quot; + str(fib(i))) </code></pre> <p>gives</p> <pre><code>fib(0) = 0 fib(1) = 1 f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validating json with pydantic (fastapi)<p>So I have a request that looks like this</p> <pre><code>[ { &quot;Code&quot;: &quot;EVR-T-0dsfdsdf532&q...
<p>In a FastAPI operation you can use a Pydantic model directly as a parameter. According to the <a href="https://fastapi.tiangolo.com/tutorial/body/" rel="noreferrer">FastAPI tutorial</a>:</p> <blockquote> <p>To declare a <strong>request</strong> body, you use <a href="https://pydantic-docs.helpmanual.io/" rel="norefe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nextjs - Unexpected token "export"<p>I started with NextJS, before that I used React a lot. I run the app on docker (node:18-alpine) if it makes any differen...
<p>Ok, the solution is &quot;workaround&quot;. I changed the target of my package to ES5, now it exports the old style as NextJS expects it. BUT, if you guys have some trick to make the ES6 imports work, tell me</p> <pre><code>// before export default MyClass // now module.exports = default </code></pre> <p>Have a nice...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Argument or block definition required<p>I am using <code>kubernetes_network_policy</code> resource. I have around ten network poilices and each of them is di...
<p>You can <strong>nest dynamic blocks</strong>. So I think in your case it should be:</p> <pre><code>resource &quot;kubernetes_network_policy&quot; &quot;example-policy&quot; { for_each = var.inputs metadata { name = each.value.name namespace = each.value.namespace } spec { pod_selector { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select random object from an array and change a boolean variable on the selected object<p>This code picks GameObjects with the tag &quot;Coisas&quot; and put...
<p><code>coisas[randomIndex].GetComponent&lt;ChangeSpirit&gt;().YourBooleanProperty = true</code></p> <p>replace <code>YourBooleanProperty</code> with the actual property you want to set to <code>true</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrap text on 2 lines for smallest width<p>I have a button with a flexible width. I would like to let the text wrap to 2 lines to keep the button's width as s...
<p>Yeah you can do it like this:</p> <p><strong>index.html:</strong></p> <pre><code>&lt;button&gt; Hello world! &lt;/button&gt; </code></pre> <p><strong>style.css</strong></p> <pre><code>button { width: min-content; padding: 1rem 2rem; } </code></pre> <p><a href="https://i.stack.imgur.com/oA5HZ.png" rel="nofollow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorted Observable based on another Observable - Angular<p>I have an Observable anmed &quot;History&quot; in which there is an array of elements. It is repres...
<p>Assuming two entries are the same based on the <code>SNS</code>.</p> <p>First you need to count all the entries, then you can place them in sorted order.</p> <p>Here is an implementation where <code>original$</code> is the original observable.</p> <pre class="lang-js prettyprint-override"><code> new$ = original$.pi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Testcafe: Click on checkbox inside a virtual element (#document)<p>So here is the HTML section that describes my reCAPTCHA element and the blue coloured part...
<p>So the solution for this is as follows:</p> <pre><code>import { Selector } from 'testcafe'; fixture`Starting test.` .page`https://etherscan.io/register`; test('Test', async t =&gt; { // Switch to the recaptcha iframe element and click on the checkbox await t .switchToIframe(Selector('if...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flow Emulator with Initial Accounts<p>I'm trying to initialize the flow emulator with accounts. Here's my flow config file:</p> <pre><code>{ &quot;emulat...
<p>Unfortunately, at the time it's not gonna work this way. Emulator will not create new account, based on addresses provided in your <code>flow.json</code> file.</p> <p>The reason for this is that addresses on Flow network are sequential and deterministically defined - contrary to Ethereum, where addresses are private...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to dynamically BLE advertise on ESP32 and reflect on flutter app<p>My ESP32-based custom-PCB BLE peripheral is advertising LiFP batteries dynamic physica...
<p>I finally did that, that makes my advertising being dynamic.</p> <p>I removed the <code>setScanResponseData()</code>and replaced by another call of <code>setAdvertisementData()</code> as I do in <code>advertise()</code>.</p> <p>But I still don't get what <code>setScanResponseData()</code> is for.</p> <pre><code> voi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Match JSON arrays with JOLT<p>I have JSON from REST API:</p> <pre class="lang-json prettyprint-override"><code>{ &quot;fields&quot;: [ &quot;advertiser...
<p>You can use a shift transformation spec in which</p> <ul> <li><p>go 4 levels up (traverse once<code>:</code>, and <code>{</code> triple) in order to reach fields array as picking sub-arrays of <code>data</code> array by using <code>[&amp;1]</code></p> </li> <li><p>dissipate all returning key-value pairs through use ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass multiples values as single parameter - Oracle SQL query<p>I have this query that I'm passing 2 parameters, COUNTRY_REGION parameter and COST_CENTER para...
<p>You cannot pass multiple values with a single bind variable.</p> <p>What you can do is pass in a single string that contains a delimited list and match a sub-string of the list to the value:</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM table_name WHERE ', ' || :country_region_list || ', ' LI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sum out of local area vaules in xslt<p>i have an xml with users and hours in the root</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&...
<p>Use a <a href="https://www.w3.org/TR/1999/REC-xslt-19991116/#key" rel="nofollow noreferrer"><strong>key</strong></a> to resolve cross-references:</p> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt; &lt;xsl:key nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Download files opened in an inner window with Selenium<p>I want to download files on <a href="https://aplicaciones007.jne.gob.pe/srop_publico/Consulta/Padron...
<p>The reason it is not clicking on the <code>6 links</code> after <code>clicking on ACCION POPULAR</code> is because we are specifying to click on the table data row <code>//*[@id=&quot;MiVentanaContenido&quot;]/div[2]/table/tbody/tr[1]/td</code> instead of the <code>anchor link present in the row</code> i.e <code>//...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I solve the SecurityException error in Android 12?<p>I request the ACCESS_FINE_LOCATION and ACCESS_FINE_LOCATION permission in real time</p> <p>And i...
<p>From android 12 android improve privacy just look below thread to implement the latest way of getting location permission.</p> <p><a href="https://proandroiddev.com/android-12-privacy-changes-for-location-55ffd8c016fd" rel="nofollow noreferrer">https://proandroiddev.com/android-12-privacy-changes-for-location-55ffd8...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript error when converting js to typescript in express js model<p>I am moving my express.js code to typescript. Here is a simplified version of my user...
<p>The issue is caused by using a regular expression to match the hook:</p> <pre><code>UserSchema.pre(/^find/, async function (next) { … }) </code></pre> <p>Because a regular expression can, in theory, match anything, TypeScript isn't able to infer the type of middleware (document or query).</p> <p>To solve this, use a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RTK Query: undefined extraOptions inside prepareHeaders<p>I set <code>extraOptions</code> in my endpoint like so :</p> <pre class="lang-js prettyprint-overri...
<p>That's <code>redux-thunk</code>'s <code>extra</code>, not the endpoint's <code>extraOptions</code>. It seems like <code>fetchBaseQuery</code> generally does not make use of <code>extraOption</code> - a pull request integrating that where necessary is highly welcome.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to use primeng in second Angular module<p>I've just started a new Angualr project. I've been trying to use a shared module in Angular to import and t...
<p>have a good time</p> <p>One thing I noticed was that you didn't include the ConsumerSite.module in the AppModule</p> <pre><code>You need to import the ConsumerSite Module itself into the AppModule </code></pre> <p>I hope I could help you</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enable append only ledger tables with EF core 6 code first<p>I am using EF code first to create my migrations for an azure sql DB. I would like to sta...
<p>There seems to be no support for Azure Sql Database Ledger tables in EF Core Code First at the moment.</p> <p>Even looking at the current in-development code for EF 7 (the next EF Core version at the time of writing) <a href="https://github.com/dotnet/efcore/blob/release/7.0/src/EFCore.SqlServer/Migrations/SqlServer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to send raw json in request body<p>In <strong>Flutter</strong> using <strong>retrofit</strong> package I need to send json raw object as shown in the pos...
<p>I think it caused you use camel case on your <code>UserModel</code> parameter (ex. <code>dateOfBirth</code>, <code>maritalStatus</code>) and your back end service try to parse key using underscore type (ex. <code>date_of_birth</code>, <code>marital_status</code>).</p> <p>To keep using camel case in your dart file an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vapor migrate command not found<p>I installed a swift vapor web-server and I have to run some migrations. Reading from the docs(<a href="https://docs.vapor.c...
<p>I don't really use the vapor toolbox anymore. I put the second line in <code>main.swift</code> in the <code>Sources/App/Run</code> folder:</p> <pre class="lang-swift prettyprint-override"><code>// earlier lines omitted try configure(app) try app.autoMigrate().wait() // &lt;-- this one needs to be in this position tr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I set Authorization Header for my HttpClient across all pages?<p>After contacting API in a login page with a successful login, I receive a JWT. And I ...
<p>The best approach depends a lot on your implementation details. What happens if the API key isn't available or becomes invalid? Are you managing a single API key for any calls to the client, or are you managing multiple API keys for different scopes or multiple users?</p> <p>One approach would be to build a Typed Cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React post object in an array<p>I need with fetch In react post object in an array to json file like this <code>&quot;category&quot;: [&quot;1&quot;, &quot;2...
<p>Just use an array instead of the string in the category. And append the array if checked otherwise filters the array.</p> <pre><code>const [category, setCategory] = useState([]); const handleChange = (e)=&gt;{ setCategory(state=&gt;{ if(e.target.checked){ state.push(e.target.value); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to progressively subtract the quantity of same item on different cells and keep track of it?<p>I try to better explain the problem using this ...
<p>put this in the code for the sheet (not a module)</p> <pre><code>Private Sub Worksheet_Change(ByVal Target As Range) ' Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets(&quot;Reference&quot;) Application.EnableEvents = True 'restrict to users entering data in column B and only one ce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the parent of an object in WinUI3 with C++/WinRT?<p>This is how the xaml looks like:</p> <pre><code>&lt;ListView HorizontalContentAlignment=&quot;...
<p>You need to use the <a href="https://docs.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.visualtreehelper" rel="nofollow noreferrer">VisualTreeHelper Class</a> to traverse the visual tree. Here is a C++/WinRT utility to walk the parents recursively:</p> <pre><code>template &lt;typename...