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: Custom style material input without ng deep/!important/<p>I need to customise material input, specifically make it round with border radius. I've found a sol...
<p>I feel that there're many ways to get it, and this is not the better way, but <strong>in styles.css</strong></p> <pre><code>.search.mat-form-field-appearance-outline .mat-form-field-outline-start{ width: 50px; border-radius: 50px 0 0 50px; background:white } .search.mat-form-field-appearance-outline .mat-form-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add numpy array variables by index without using loops<p>I have this problem where I would prefer not using loops because I am working with a big data...
<p>Try this:</p> <pre><code>np.array([np_1, np_2, np_3]).transpose().flatten() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get substring from url and copy to clip board?<p>Hey i am trying some thing for my school project, i hope you can help me in it.</p> <p><strong>I want to cop...
<p>Use this it will work</p> <pre><code>const params = new Proxy(new URLSearchParams(window.location.search), { get: (searchParams, prop) =&gt; searchParams.get(prop), }); // Get the value of &quot;some_key&quot; in eg &quot;https://example.com/?some_key=some_value&quot; let value = params.some_key; /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a function that returns an integer between a min and a max value?<p>I'm pretty sure there is a function like this, I just don't know how to search f...
<p>I just found it. The method I searched for was .clamp(num lowerLimit, num upperLimit)</p> <p><a href="https://api.flutter.dev/flutter/dart-core/num/clamp.html" rel="nofollow noreferrer">https://api.flutter.dev/flutter/dart-core/num/clamp.html</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show modal before change option in select BOOTSTRAP-VUEJS<p>I want to show a modal for confirm the action when you change the selected value in a <code>b-for...
<p>Here's how i would suggest doing it. You have one data property <code>selectedOption</code> which you bind to your <code>b-select</code>, this option will be what is shown in the select.</p> <p>You then have another data property <code>actualOption</code> which is the <em>final</em> value. So when you change your ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: clean CSV column value as JSON to C# object<p>I've got some text written in a CSV column that is supposed to represent a JSON string:</p> <pre><code>{ &quot;...
<pre><code>var foils = &quot;[{\n \&quot;text\&quot;: \&quot;foil text1\&quot;,\n \&quot;image\&quot;: \&quot;existing_image_uploaded.png\&quot;,\n \&quot;score\&quot;: false\n},\n\n{\n \&quot;text\&quot;: \&quot;foil text2\&quot;,\n \&quot;image\&quot;: \&quot;existing_image_uploaded2.png\&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count transactions per day in the last 1 month on LARAVEL<p>I have data on transaction table like this:</p> <pre><code>_______________________________...
<p>Here is the code for last month chart record.</p> <pre><code>$lastMonth = CarbonPeriod::create(Carbon::now()-&gt;subDays(29), Carbon::now()); $lastMonthOrders = []; foreach ($lastMonth as $date) { $lastMonthOrders['days'][] = $date-&gt;format(&quot;l&quot;); // Here is the count part that you need $last...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asp.Net MVC Call HtmlHelper with a variable<p>I use HtmlHelper (in Asp.Net MVC 4.5) to create multiple validated fields per class property. Right now, I need...
<p>I don't think you can do this with helpers, I'm pretty sure your going to have to create an extension method instead:</p> <pre><code>public static MvcHtmlString FieldHelper&lt;TModel, TItem&gt;(this HtmlHelper&lt;TModel&gt; html, Expression&lt;Func&lt;TModel, TItem&gt;&gt; expr) { var output = html.LabelFor(expr)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bigquery - How to nest columns to prevent unwanted aggregations in 1:many relationships?<p>sales table:</p> <div class="s-table-container"> <table class="s-t...
<p>Use below approach</p> <pre><code>select * from ( select date, item_no, array_agg(struct(store_group, sales_qty)) sales from sales group by date, item_no ) join inventory using (date, item_no) </code></pre> <p>if applied to sample data in your question - output is</p> <p><a href="https://i.stack.imgu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: merge two thresholds for two 3D arrays into a list<p>I have the first 3D array of size (50,250,250) that includes data points (1,2,3,4,5). I set up a thresho...
<p>IIUC, for your second if condition, you are trying to see whether there is at least a 3 value in that array1, and then you will choose that 2D array of the same position. In that case, you should use <code>in</code> operator.</p> <pre><code>for i in range(len(array1)): if threshold in array1[i]: array2[i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KQL list of strings contains any value of list of strings<p>I have an API that executes some KQL.</p> <p>I'm executing a KQL that filters all rows such that ...
<h4>1.</h4> <p>Apparently any string has the empty string, e.g.:</p> <pre><code>print &quot;abc&quot; has &quot;&quot; </code></pre> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>print_0</th> </tr> </thead> <tbody> <tr> <td>true</td> </tr> </tbody> </table> </div> <p><a href="https://dataexpl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NixOS: how to import some configuration from GitLab? infinite recursion encountered<p>I'm trying to deploy a NixOS VM while storing its configuration on a pr...
<p>The recursion is as follows</p> <ol> <li>Compute the configuration</li> <li>Compute the <code>config</code> fixpoint of all modules</li> <li>Find all modules</li> <li>Compute <code>&quot;${repo}/my-server-name/host.nix&quot;</code></li> <li>Compute <code>repo</code> (<code>pkgs.fetch...</code>)</li> <li>Compute <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS subnet’s using terraform<p>I have a set of subnet’s how do i assign the subnets which are available automatically using terraform? Ex : [“subnet-a”,”subn...
<p>Use <a href="https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/shuffle" rel="nofollow noreferrer">random_shuffle</a>:</p> <pre><code>resource &quot;random_shuffle&quot; &quot;az&quot; { input = [“subnet-a”,”subnet-b”,”subnet-c”] result_count = 2 } </code></pre> <p>then to get ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GET request ignores my parameters in python request<p>I'm trying to send a GET request to an API endpoint with some parameters, but the parameters are ignore...
<p>I think this is happening because you're including spaces in your <code>p['fields']</code> value. try using:</p> <pre><code>p = {'fields': "Number,Guid,ContactName,Date,Status"} </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to data wrangle and barplot the proportion without undesired stripes<p>Please find the input data and expected output as screenshot below:</p> <p><img s...
<p>The key was to use distinct() after mutate() instead of summarise() Also, mean() was the wrong function used earlier instead of sum() which had resulted in incomplete barplot.</p> <pre><code>library(tidyverse) library(plotly) # Input data df &lt;- tibble( country = c(rep(c("India","USA","Germany","Africa"), each...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extend generic tuple in TypeScript<p>I am trying to create a function that decorates objects in an array and returns them. The returned type for each ...
<p>One approach is</p> <pre><code>function extendList&lt;T extends string[]&gt;( arr: [...{ [I in keyof T]: Identified&lt;T[I]&gt; }] ) { return arr.map((item) =&gt; ({ ...item, test: &quot;test&quot; })) as { [I in keyof T]: Extended&lt;T[I]&gt; }; } </code></pre> <p>The idea is to make <code>extendList()</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React native, the useEffect on a object state not working<p>Here is the code before the render</p> <pre><code>const HappyComponent = (props) =&gt; { cons...
<p><code>useEffect</code> is called after the component was rendered. So when the code reaches that line the first time around, it tries to read <code>null.from</code>.</p> <p>Maybe you'd want to move all that which is inside the <code>useEffect</code> inside <code>useState</code>, as the default value. You don't actua...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to define enum with same jsonValue() in Dart?<p>Can I define enum like this?: what is the best way to handle different type values with the sa...
<p>I don't think you got a direct way to handle this through <code>json_serializable</code> ; but that doesn't mean there aren't workarounds.</p> <p>Seeing how you got the possibility of defining functions directly in enums now (Though you could already do it before with extensions), you could have a simple enum be cre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable scrolling of a PeerComponent (GoogleMap)<p>Is it possible to disable the X and Y scrolling of a GoogleMap inside a Codename One? I'm referring to a m...
<p>To expand on Steves comment. There's no support for this in the peer component wrapping. We assume most peers are scrollable within as mixing scrolling and native peers with produce a bad experience. E.g. panning the map instead of scrolling or potential artifacts when the map and title area draw on top of each othe...
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 split Trait implementation and defenition across different modules?<p>I'd like to <strong>define</strong> a trait with <strong>many</strong...
<p>Without macro you should not be able to split a trait definition over different modules. Where you write <code>trait MyTrait { .. }</code> you need to define it.</p> <p>But you can define multiple traits and have a super trait, like this:</p> <pre class="lang-rust prettyprint-override"><code>// src/ops/a.rs pub trai...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java.Lang.IllegalArgumentException: invalid Bitmap format Intermittently on startup<p>I am doing stress testing on a variety of android devices, using Fireba...
<p>I figured it out, the bitmap format needs to be ARGB_8888 for older APIs and older phones, can be accomplished by changing the immutable bitmap via:</p> <pre><code>Bitmap bmp_Copy = bmp_Base.copy(Bitmap.Config.ARGB_8888,true); </code></pre> <p>then just recycle the old one.</p> <p>The answer came from: <a href="h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to unpack a either::Either by the contained type<p>Can I unpack a <a href="https://docs.rs/either/latest/either/" rel="nofollow noreferrer">either::Eithe...
<p>The best way I can come up with that uses only <code>std</code> is via <code>Any</code> which restricts this approach to types that are <code>'static</code>.</p> <pre><code>use either::Either::{self, *}; use std::any::Any; fn unpack_dual&lt;L: 'static, R: 'static, T: 'static&gt;(e: &amp;Either&lt;L, R&gt;) -&gt; Op...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assigning Group No. based on Rolling time window - Pandas<p>I have a dataframe with stock prices:</p> <pre><code> Dates Price 2019-02-01 52 2019-...
<p>If you have daily data for every consecutive day, you can use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.dt.to_period.html" rel="nofollow noreferrer"><code>to_period</code></a>, <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.factorize.html" re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I remove bytestrings left over from decompression from a string?<p>I have a bunch of strings which are sentences that look something like this:</p> <...
<p>I am guessing that you mistakenly assigned the above byte string “sentence” to an object of type <code>str</code>. Instead, it needs to be assigned to a <em>byte</em> string object and interpret it as a sequence of UTF-8 bytes. Compare:</p> <pre><code>b = b'... known as \xe2\x80\x9ccomorbidity\xe2\x80\x9d and ...' ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: From MongoDB convert from dictionary to row with Pandas<p>This is a test coming from MongoDB, I need to convert to MySQL. But! Sometimes there is more then o...
<p>If you've an array of dictionaries from your JSON file, try this :</p> <p><strong>JSON input :</strong></p> <pre><code>inputJSON = [{'item_type': 'Contributor', 'role': 0, 'short_bio': 'Walter Mosley (b. 1952)', 'firebrand_id': 1588, 'display_name': 'Walter Mosley', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates<pre><code>SELECT DISTINCT(CITY...
<p>Another ways:</p> <pre><code>SELECT * from STATION where FIND_IN_SET(left(CITY,1),'A,E,I,O,U')&gt;0; </code></pre> <p>And </p> <pre><code>select distinct CITY from STATION where substring(CITY,1,1) in ('A','E','I','O','U'); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Qml: How to set a property to all GridView items<p>I am trying to make a change to all items of a <code>GridView</code>.<br> I have tried to iterate through ...
<p>Your approach is in the opposite direction: Your approach is to obtain the item of the view and modify it, but the approach that Qt points out is that the view reflects the information of the model and modifies it when necessary.</p> <p>The following is a simple example where every time you press on the button with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Array combine value by date<p>I am getting data from my DB(array) and trying to arrange it ready for a chart. I need to add up all values with the same month...
<p>You should not use <code>$i</code> for the unique index, if you want put the amount in same month together, you should use the month as index, for example:</p> <pre><code>$monthInvoiced = []; foreach($results as $row) { $iterationValue = ( (int)$row['total'] - (int)$row['retention'] ); $iterationDate = new D...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When doing Java string comparison what values for ~ (tilda) hold?<p>For example:</p> <pre><code>public static void smallestWord() { String smallestWord ...
<p>All characters in Java are compared by their Unicode codepoint. <code>~</code> is U+007E (126) in Unicode, which as larger than all the standard ASCII Latin characters, but less than characters from all other scripts, or accented Latin characters. For more detailed information on how strings are compared, you can re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does "autoref" mean in rust?<p>I am seeing a compile error that says:</p> <pre><code>cannot infer an appropriate lifetime for autoref due to conflicting...
<p>Autoref happens when you attempt to use method syntax to invoke a function when you have a value, but the function takes <code>&amp;self</code> or <code>&amp;mut self</code> -- the method receiver is automatically referenced instead of given by value. For example:</p> <pre><code>struct Foo; impl Foo { pub fn b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shell script to create directory from any random directory<p>I am currently in /Desktop on my ubuntu system and I want to create a directory named vip inside...
<p>This should do the job:</p> <pre class="lang-sh prettyprint-override"><code>mkdir "$HOME/Documents/subd/vip" </code></pre> <p>You just had some minor errors in your command.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: create pivot table as numpy 2d-array from two lists<p>I have the following lists.</p> <pre><code>list_1 = [&quot;A&quot;, &quot;B&quot;, &quot;C&quot...
<p>Use numpy broadcasting:</p> <pre><code>list_1 = [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;] list_2 = [&quot;D&quot;, &quot;A&quot;, &quot;B&quot;] my_array = (np.array(list_1) == np.array(list_2)[:,None]).astype(int) </code></pre> <p>output:</p> <pre><code>array([[0, 0, 0], [1, 0, 0], [0, 1, 0]]) </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the equivalent of check-sat-using in z3py?<p>I've been trying to achieve the exact same goal as this post. <a href="https://stackoverflow.com/questi...
<p>In the SMTLib interface, <code>check-sat-using</code> is a way of telling z3 which tactics to use. When you use z3py, you directly use the tactic language and explicitly create solvers. So, in a sense, there is no corresponding call in z3py to <code>check-sat-using</code>. Instead, you get an entire tactic language,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReactJs handleAddProduct is not a function at onClick<p>I'm finishing a page with shopping cart. I have a function that adds products to the cart and that wo...
<p>The issue <em><strong>is</strong></em> with the <code>Card</code> component. React components receive only a single argument, the <code>props</code> object. In the code the <code>Card</code> component is attempting to destructure <code>handleAddProduct</code> from an undefined argument.</p> <pre><code>const Card = (...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: executing method on variable pointer moves the variable itself?<p>I'm using the <a href="https://docs.rs/rusqlite/latest/rusqlite/" rel="nofollow noreferrer"...
<p>You aren't borrowing <code>key_rows</code> then checking the count, but rather calling <code>key_rows.count()</code>, then borrowing the result.</p> <p><code>Iterator#count</code> consumes the entire iterator, returning how many elements were traversed.</p> <pre class="lang-rust prettyprint-override"><code>let mut r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add parameter as drop down list in ADF pipeline<p>I have a Copy Data task which is obtaining data from an API</p> <p>I want to add the Request Method as a pa...
<p>Unfortunately, It is not possible to create dropdown list for Request Method.</p> <p>But you can raise feature request <a href="https://feedback.azure.com/d365community/forum/1219ec2d-6c26-ec11-b6e6-000d3a4f032c" rel="nofollow noreferrer">here</a></p> <p>Refere - <a href="https://docs.microsoft.com/en-us/azure/data-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Class that can inherit from two different classes<p>So I am working on an implementation of a Dynamic Decision Network (DDN) class. This DDN is a type of Bay...
<p>You can put the class into a factory function:</p> <pre class="lang-py prettyprint-override"><code>def make_DDN(Base): class DDN(Base): def other_methods(self): ... return DDN </code></pre> <p>Now you can make new classes:</p> <p><code>DDN1 = make_DDN(BN)</code></p> <p>etc</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IndexOutOfRangeException: Index was outside the bounds of the array RandomObjectSpawner.Update () (at Assets/Scripts/RandomObjectSpawner.cs:21)<p>So i have t...
<p>I have a wild hunch. I guess your script is attached to multiple game objects and in one of them the game objects are not assigned to the array. so check all other game objects to see if <code>RandomObjectSpawner</code> is not assigned to any other <code>gameobject</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign a value to character pointer in a structure and store it in the form of queue<p>This is my code After inserting characters in the queue, If I p...
<p>The problem is in <code>Patient* newPatient(int age, char *p, char *name)</code>: You are not allocating new memory for <code>priority</code> and <code>name</code>. Either you always pass a newly allocated memory for <code>p</code> and <code>name</code> which is being pointed to by <code>priority</code> and <code>na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter : How to create textfield next to each other with an add button<p>I am new coding in flutter and I am trying to create two textfields next to each ot...
<p>You can create an index or a List of textfields and populate that list like this</p> <pre><code>class MyWidget extends StatefulWidget { @override State&lt;MyWidget&gt; createState() =&gt; _MyWidgetState(); } class _MyWidgetState extends State&lt;MyWidget&gt; { int totalTextField = 1; @override Widget buil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the disadvantage of doing git init in the desktop directory?<p>I'm using win10 and I have a folder called <code>UTM</code> putting on the desktop dire...
<p><code>git init</code> is a <em>local</em> operation, so it has no bearing on GitHub.</p> <p>Until you are a remote (<code>cd UTM; git remote add origin https://github.com/&lt;you&gt;/&lt;your_repo&gt;</code>), and actually add, command and then push, nothing will leave your PC without you knowing.</p> <p>But it sh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring: Idiomatic way to add query parameters<p>What's an idiomatic way in Spring to add additional query parameters to a given URL? The URL might already co...
<p>The URLs are a bit difficult to encode as different encoding types are mixed. For instance, spaces in the URL are encoded as <code>%20</code> while the spaces in query parameters are encoded as <code>+</code>. Therefore, I have created a method <code>encodeUtf8</code> to separately encode the query parameters:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the platform renderer for StackLayout?<p>I have been grepping through Xamarin's source all morning and can't find out what renderer / VisualElement i...
<p>Yes, StackLayoutRenderer is what everyone expects Xamarin to do the trick. However, there is no such in Xamarin. </p> <p>Xamarin handles the native conversion of certain layouts in the <code>ViewRenderer&lt;TView, TNativeView&gt;</code> itself. They are mapped to the corresponding NativeViews. As you mentioned ther...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does MongoDB takes the DBRefs inside a document as a full size document for the 16MB threshold?<p>For example, I have a document called Country that contains...
<p>Compare the two different ways to store relational data:</p> <ol> <li>Embedded data</li> <li>Referenced data</li> </ol> <h2><strong>Embedded Data:</strong></h2> <p><strong>Countries collection</strong> (city information is embedded as an array of sub documents in country document)</p> <pre><code>{ "_id" : Ob...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how add Id property on array of objects from the api?<p>the data from the API has no id when I try I add an Id property the whole of the objects take same i...
<p>You are creating a constant value for id, and setting the same for every entry of the array.</p> <p>You can change your code, for something like this:</p> <pre><code>const getTasks = () =&gt; { fetch(&quot;https://opentdb.com/api.php?amount=5&amp;type=multiple&quot;) .then((response) =&gt; response.json())...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a custom hook to show a delete message<pre><code>import React,{useState} from 'react';&lt;br&gt; import { Button, message } from 'antd';&lt;br&gt...
<ol> <li>You can't bind the hook on onClick function</li> <li>Your hook returns a function</li> </ol> <p>Use the below code:</p> <ol> <li><p>Return the function and update hook parameters</p> <pre><code> export const useDeleteMessage = () =&gt; { const openMessage = (message1, message2) =&gt; { message.loading(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Alphabet increment function by index number in js<p>I am trying to merge an array of objects into a single object and on the object key, I want the alphabet ...
<p>I suppose you need an algorithm to convert numbers to an excel sheet column. I believe this could be a solution.</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>function con...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter: How to remove the divider lines in CupertinoDatePicker?<p><a href="https://i.stack.imgur.com/omVnc.png" rel="nofollow noreferrer"><img src="https://...
<p>Since you copied the <code>CupertinoDatePicker</code> class just remove the border in the <code>_buildMagnifierScreen()</code> method in <strong>picker.dart</strong> from <strong>/src/cupertino/</strong></p> <pre><code>/// Draws the magnifier borders. Widget _buildMagnifierScreen() { final Color resolvedBorde...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure devops pipline: how to add task to PR work item with PS script (az boards work-item)<p>I am using this code in Azure Devops Pipeline:</p> <pre><code> ...
<blockquote> <p>Is there anyway to do it automatically with a script?</p> </blockquote> <p>Yes. We can use the Azure DevOps CLI: <a href="https://docs.microsoft.com/en-us/cli/azure/repos/pr/work-item?view=azure-cli-latest#az-repos-pr-work-item-add" rel="nofollow noreferrer">az repos pr work-item add</a> to add the new ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best / correct way to deal with null values in a database when you have different types of related data<p>I've have a structural database design ...
<p>Consider the following.</p> <ul> <li>My Favorite Dog Breed Is <ul> <li>Beagle</li> <li>Basset Hound</li> <li>Boxer</li> <li>Other, please specify _____________</li> </ul> </li> </ul> <p>You can have an answer to a question option which also has a value.</p> <p>Now consider that both your answer and your question opt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to avoid for loop to append dictionary values in a list<p>I have this dictionary :</p> <pre><code>Dict = { "a" : 1, "b" : 2, "c" : 3 } </cod...
<p>Probably not any more efficient in terms of running time, but more efficient in terms of code written:</p> <pre><code>List2.extend(Dict[e] for e in List1) </code></pre> <p>If you are interested in code golf, </p> <pre><code>List2.extend(map(Dict.get, List1)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI - Pass Enum as Parameter to View<p>I have an environment object (we'll call it sample for this example) with multiple enums inside. I have a view tha...
<p>With pretty amount of doubts I would suppose that you want to write a value into environment object by key path... if I'm right then it can be done as follows</p> <pre><code>struct MultipleUseView&lt;T&gt;: View { @EnvironmentObject var sample: Sample // bad practice to name vars as keywords, but if you ins...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to deal with late subscription in angular<p>Let's say I have two observables to be consumed by the template, one with the data and one as a loading indic...
<p>I think the cleanest way to handle this is to use your &quot;workaournd #4&quot;; put both pieces of data into a single object (<em>AKA a view model. This pattern is explained by Sander Elias in <a href="https://www.youtube.com/watch?v=cjdKanhckXU" rel="nofollow noreferrer">this video</a></em>):</p> <pre class="lang...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Knockout/Select2 Dropdownlist contains correct options, but now displays nothing as selected<p>So I have two dropdown lists that I'm using with knockout and ...
<p><strong>Original problem:</strong> When you select an item from the dropdown the value of "SelectedTo" correctly changes to that item's ID value. However, the dropdown options are then recomputed and that item is then removed from the list of options, causing the value of "SelectedTo" to revert back to undefined. Yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automatically plot same shapefile on multiple subplots<p>I'm trying to compare two sets of London Airbnb data. I want an elegant way to plot the London shape...
<p>I won't code it out, but I can give you some tips:</p> <ul> <li>Yes you can use loops to plot multiple subplots, all you have to do is iterate through multiple lists of variables you want to change e.g. colour and data and use them in the loop</li> <li>When you use the loop, you can easily access all the different v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IAR Linker Configuration File - Missing ".intvec" Placement<p>I'm working with an IAR project where there are ILINK Configuration Files (<code>.icf</code>) f...
<p>It seems that the answer is a lot more obvious than I thought. According to the section "Linking—an overview" in "<a href="http://ftp.iar.se/WWWfiles/arm/webic/doc/EWARM_DevelopmentGuide.ENU.pdf" rel="nofollow noreferrer">IAR C/C++ Development Guide</a>", IAR's linker software ILINK ignores duplicate sections. Thus,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ERROR TypeError: Cannot assign to read only property 'isSelected' of object '[object Object]'<p>I just want to update a property value of an array element in...
<p>Since <code>arrayElement</code> is read-only, you have to copy <em>it</em>, too:</p> <pre><code>const childArray = childArrayCopy.map(arrayElement=&gt; { if (arrayElement.id === desiredId) { arrayElement = {...arrayElement, isSelected: false}; // &lt;=== } return arrayElement; }); </code></pre> <p>That u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is App considered to be a component in React Native?<p>Here is the explanation of the App.js:</p> <pre><code>App.js the first file in any React Native app t...
<p>Yes same as react js just need to link your modules with android as well as ios if they need ,and also you can't use div span and other html attributes instead you can use react native ready made components</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Login function with Dart (Flutter) and SQFLite<p>I am new to flutter (1 month learning) and i have a doubt about how can i make a function that validates if ...
<p>Login is nothing you get from Flutter, so you won't find anything in the documentation directly. Some packages provide you this like Beamer, but with vanilla Flutter, you need to do it yourself. Basically: You can provide builders for routes in Flutter (read more <a href="https://docs.flutter.dev/cookbook/navigation...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-native naviguate between appcontainers<p>The aim is to combine a BottomBarNavigator and a TopBarNavigator. I want to put a NavigatorB (MaterialTopBarNa...
<p>I found a way using <a href="https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html" rel="nofollow noreferrer">NavigationService</a>, I created the NavigationService for the MainTabNavigator and used it as specified in ComponentB.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Firebase How to make Sequential Query<p>I am developing a forum application. There are two collections related to user information and topic informat...
<blockquote> <p>When I make a Firebase query, I want to get the data of this topic along with the data of the user corresponding to the topicAuthorUID value.</p> </blockquote> <p>There is no way you can achieve that in a single go. Queries in Firestore are shallow, can only get elements from the collection that the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to drop many columns in table in oracle when columns are very large?<p>I have a table and the table consists of 70 columns.I want to drop about 68 column...
<p>Write a script to generate the DDL to save typing.</p> <pre><code>CREATE TABLE test_drop ( a number, b number, c number, d number, e number); select 'alter table ' || owner || '.' || table_Name || ' drop column ' || listagg(column_name,',') within group ( order by column_name) || ';' drop_ddl from dba_tab_columns ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert xml to dataFrame with pandas<p>I am newly in pandas and I just start my code learning. Please, it would be great if you could help me. I have...
<p>The code below flatting the xml (region,products,product) into a single record.</p> <pre><code>import xml.etree.ElementTree as ET import pandas as pd xml = '''&lt;products_availability date="2020-01-24 06:32" &gt; &lt;region id="122"&gt; &lt;products count="45453242"&gt; &lt;product id="10...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mismatch in the count of stop-words in `Defaults.stop_words` and the ones derived from `nlp.vocab`?<p>Suppose we have <code>nlp = spacy.load('en_core_web_sm'...
<p>The actual default list of stopwords that are used for checking if any token <code>is_stop</code> is obtained with <code>nlp.Defaults.stop_words</code>, so the list contains <code>326</code> words.</p> <p>The mismatch derives from the fact that the <code>nlp.vocab</code> is a <code>Vocab</code> containing <code>Lexe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to check if the azure storage account is domain joined? because need to access files share from the account as shared path from domain joined VM<p>I am n...
<p>• You can check if the storage account is domain joined or not by <em><strong>checking the on-premises ADDS environment for a computer account or a service logon account with User Principal Name/Service Principal Name as ‘cifs/your-storage-account-name-here.file.core.windows.net’</strong></em>. For this purpose, <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get particular date with php<p>I want dates like current week dates from Monday to Wednesday and last week dates from last week Monday to last week We...
<p>You can simply fix 2 rows in your code:</p> <pre><code>$end_week = strtotime("next wednesday",$start_week); // &lt;-- "next wednesday" </code></pre> <p>And for the current dates:</p> <pre><code>$previous_week = strtotime("+1 day"); </code></pre> <p><strong><a href="https://3v4l.org/S9Gc1" rel="nofollow nore...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Here is the C# Monad, where is the problem?<p>Reading a <a href="https://stackoverflow.com/questions/35951818/why-can-the-monad-interface-not-be-declared-in-...
<blockquote> <p>it seems easy to define a C# interface for all monads. Where's the problem?</p> </blockquote> <p>Your proposal is:</p> <pre><code>interface IMonad&lt;T&gt; { IMonad&lt;T&gt; Wrap(T a); IMonad&lt;U&gt; Bind&lt;U&gt;(Func&lt;T, IMonad&lt;U&gt;&gt; map); } </code></pre> <p>I've omitted the "un...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export a 1D list in Python in one column<p>When i want to export a list in a txt file it displays the elements in one line instead i want each elements in on...
<p>With one list:</p> <pre class="lang-py prettyprint-override"><code>with open('my_file.txt', 'w') as f: f.write('\n'.join(str(x) for x in my_list)) </code></pre> <hr /> <p>WIth two lists:</p> <pre class="lang-py prettyprint-override"><code>with open('my_file.txt', 'w') as f: to_write = &quot;&quot; for i,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to create a linked list in Linux using C<p>I have written a similar piece of code in C++ for Windows where I create a basic singly linked list, add da...
<p>The <code>display()</code> function never initializes <code>n</code>. The declaration should be:</p> <pre><code>nPtr n = head; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print integer only in Kotlin Linked List<p>I'm a beginner in Kotlin and facing this issue.</p> <pre><code> data class Node(val data :Int, var next:No...
<p>Wow, I didn't understand what was happening at first, but now I understand that your code has terrible and hard to detect bug!</p> <p>The point is, you don't actually call your <code>print</code> method! You call <code>Kotlin</code>'s global generic <code>print</code> method, which simply prints <code>head.toString...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove multiple Similar Words from String - Python<p><code>description = "100 Kilogram/Kilograms"</code> I need result "100 Kilogram" Above is just an exampl...
<p>You can use <a href="https://docs.python.org/2/library/difflib.html#difflib.get_close_matches" rel="nofollow noreferrer">difflib</a></p> <p>Here is an example: </p> <pre><code>import re import difflib description = "200 mt / mts" def remove_same(string): striped = re.findall(r"[\w+.']+", string) for i i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How i can make a damage system without using Touched<p>I was trying to make a Kick system in roblox studio, but I don't know a way to make a Humanoid take da...
<p>So based on the comments, you are looking to make a damage system, understand hitboxes, and avoid using the Touched event.</p> <p>A hitbox is simply a region that you define for a limited time where you look for collisions with a player's character model. And detecting collisions is a fairly simple thing; you can ev...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install and run shadow-cljs in an existing project folder while on macOS?<p>I am trying to install <a href="https://github.com/thheller/shadow-cljs.gi...
<p>When you have an existing project like this you just run <code>npm install</code>, without any additional arguments, to install all the dependencies listed in <code>package.json</code>. <code>npm ci</code> also works, which is sort for clean-install, if you have an existing <code>package-lock.json</code> it'll ensur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adjust the shape of figures with/without colorbar<p>I have a code to plot a figure. When I run this code without adding plt.colorbar(), I can get a figure wh...
<p>Following <a href="https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/axis_equal_demo.html" rel="nofollow noreferrer">this documentation</a>, you need to add some settings to axes. Your script works for me in a right ways if I insert these rows after creation of <code>fig</code>:</p> <pre><code>ax = plt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I2C read error while getting data from sensor with pigpio<p>i have a Tkinter GUI and the acceleration sensor MMA8452Q. I set up the sensor that if a threshol...
<p>Your traceback doesn't match your code. The traceback shows the <code>i2c_read_byte_data</code> result not being saved anywhere. The I2C clock must be right, otherwise you'd get nothing at all.</p> <p>The problem is probably synchronization. When you said &quot;interrupt&quot;, that raised a red flag. If your in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to calculate a degree in css with vw?<p>I'm trying to make my Skew responsive with view-width.</p> <p><code>$SkewXBar: calc(5deg + 10vw);</co...
<p>A quick thought. The simplest way would be using a JavaScript logic. Something like the following:</p> <pre class="lang-js prettyprint-override"><code>function calculate() { const deviceWidth = screen.width; const viewportWidth = window.innerWidth; const currentRatio = viewportWidth / deviceWidth; const ang...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert integer to binary string with variable size<p>Suppose I want to get every combination of 1's and 0's with length <code>n</code>. For example, if <cod...
<p>A straightforward way: Extract each bits using bitwise shift operation.</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; int main() { int n = 3; for (int i = 0; i &lt; (1 &lt;&lt; n); i++) { for (int j = n - 1; j &gt;= 0; j--) { std::cout &lt;&lt; ((i &gt;&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output Multiple Objects to CosmosDB with Azure Function (Isolated Process)<p>I cannot seem to find any documentation on how to output multiple documents to A...
<p>Instead of using the output binding method which appears to be lacking in support in the isolated process, I was able to successfully use the SDK directly to insert the docs!</p> <p>Ref. <a href="https://github.com/Azure/azure-cosmos-dotnet-v3" rel="nofollow noreferrer">https://github.com/Azure/azure-cosmos-dotnet-v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NotePad++ regex match and replace and also keep match to convert to different markdown image reference link<p>I have the following link syntax that needs to ...
<p>I have modified your example to get it working <a href="https://regex101.com/r/wp0XGj/1" rel="nofollow noreferrer">here</a>. What you needed to do is escape the square brackets so they would be interpreted literally, since they have special meaning in regex, and you needed to use a capture group to store the matchin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert a nested for loop with a function call and appending data to a list comprehension<p>I need to convert a nested for loop with a function call and appe...
<p>On the surface, it's a trivial transformation after inlining the definition of <code>distances</code>:</p> <pre><code>predictions = [] for train_row in test_data: distances = ... predictions.append(train_tgt[distances]) </code></pre> <p>becomes</p> <pre><code>predictions = [] for train_row in test_data: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to toggle graph in streamlit?<p>I have two kind of chart to display based on user selection that can be changed by user dynamically. I have two buttons f...
<p>Since you didn't provide any code, the code below should give you the idea of how to work around it. But if this didn't solve your problem, provide some code, I am pretty sure once your question is clear someone can offer a better solution.</p> <pre class="lang-py prettyprint-override"><code>left_col, right_col = st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Statistical probability of N contiguous true-bits in a sequence of bits?<p>Let's assume I have an N-bit stream of generated bits. (In my case 64kilobits.)</p...
<p>Fix <code>X</code> and <code>N</code>, obiously with <code>X &lt; N</code>. You have <code>2^N</code> possible values of combinations of 0 and 1 in your bit number, and you have <code>N-X +1</code> possible sequences of <code>1*X</code> (in this part I'm only looking for <code>1's</code> together) contained in you b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Break out of a while loop to find a Palindrome<p><strong>This code does not work!</strong></p> <p>It causes the browser to crash;</p> <p>Can someone please h...
<p>Well, the two pointers idea is a good way to check palindrome. But in your code, you don't update the value of <code>left</code> and <code>right</code>. And if the string has even characters, the condition <code>left === middle &amp;&amp; right === middle</code> will never be true.</p> <p>We can slightly change your...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to click element with Puppeteer<p>URL : <a href="https://auto.ru/catalog/cars/all/?page_num=1" rel="nofollow noreferrer">https://auto.ru/catalog/cars/...
<p>It is working fine. You just need to wait for the navigation to complete before taking the snapshot. Also, always make sure the element appears before trying to click on it:</p> <pre class="lang-js prettyprint-override"><code>await page.waitForSelector("#confirm-button"); await Promise.all([ page.click('#confir...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using unlist on a column of strings within a data frame<p>I have a data frame with a column that contains a string with multiple names separated by commas:</...
<p><code>strsplit</code> is already vectorized, but to reduce it to a single string again, we can use <code>lapply</code> and <code>paste</code>:</p> <pre class="lang-r prettyprint-override"><code>sapply(strsplit(df$my.text, &quot;,\\s*&quot;), function(z) paste(unique(z), collapse = &quot;, &quot;)) # [1] &quot;John S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Curl Query : JSON Parser error while Querying to get session information for a given session<p>We have recently migrated to selenium 4.3.0 and observed API f...
<p>I think the issue is caused because Selenium is unable to process your request as a valid JSON information, probably as you guessed because you missed the double quotes.</p> <p>My advice would be that first try issuing the <code>curl</code> command from a terminal and see if it works.</p> <p>The <a href="https://www...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: empty result when parsing from xml into DataTable - c# .net<p>i get an empty Datatable when parsing xml file with xmlReader and import it into one DataTable ...
<p>Seems like this is going to be much easier to do with <code>XDocument</code> and LINQ</p> <pre class="lang-cs prettyprint-override"><code>var xDoc = XDocument.Load(path); var table = new DataTable { Columns = { {&quot;EventID&quot;, typeof(string)}, {&quot;Computer&quot;, typeof(string)}, {&quot;TargetU...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing nested JSON array<p>I have the following JSON: </p> <pre><code>{ "reviews": [ { "reviewId": "123", "authorName": "author", "comments":...
<p>If you are comfortable using linq then I would suggest something like this:</p> <pre><code>var ratings = appReview.Reviews .SelectMany(r =&gt; r.Comments.Select(c =&gt; c.UserComment.StarRating)); </code></pre> <p>This should get you a list of ratings. This works by selecting the <code>StarR...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is that possible to load a color from an external xcassets?<p>What I mean is this. I am creating a lot of color schemes to use. </p> <p>All schemes are like...
<p>You cannot specify an asset catalog by name. But you can specify an asset by <em><a href="https://developer.apple.com/documentation/uikit/uicolor/2877381-init" rel="nofollow noreferrer">bundle</a></em>. So you can use multiple bundles and multiple asset catalogs, one catalog per bundle. Each asset catalog in a bundl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase functions - is it possible to deploy functions:config variables without depoying all the functions?<p>I have added a new environment variable to the...
<p>What you're trying to do is not possible. The functions config env vars are essentially part of each individual function's deployment. They don't exist separately from the function - they <strong>are</strong> part of the function and are packaged up along with it when you deploy.</p> <p>To put it another way, you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this map returning an rvalue?<p>I am using the library <a href="https://github.com/nlohmann/json" rel="nofollow noreferrer">nlohmann/json</a> and wish...
<p>Your wrappers for <code>at()</code>, et. al. are returning the wrong thing.</p> <p>If you look up the <a href="https://en.cppreference.com/w/cpp/container/unordered_map/at" rel="nofollow noreferrer">reference for unordered_map::at()</a>: it returns a reference to a (const) <code>T</code>, a.k.a. <code>value_type</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift 5, make http post request<p><img src="https://i.stack.imgur.com/VltDw.png" alt="Postman"></p> <p>How can I do attached "postman operation" on Swift 5?...
<p>Below is the code for <code>Post</code> Method,using <code>URLSession</code></p> <pre><code>let Url = String(format: "http://10.10.10.53:8080/sahambl/rest/sahamblsrv/userlogin") guard let serviceUrl = URL(string: Url) else { return } let parameters: [String: Any] = [ "request": [ "xu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sas create global variable based on cell value<p>Can anybody help me with the following: I have the a dataset that I filtered to only contain one row. I now ...
<p>If you want to use it later you create it in a macro variable and reference it later with a &amp;variableName</p> <p>Let's assume:</p> <ul> <li>data set name is myDataset</li> <li>variable name is value</li> <li>Single observation/row in the data set</li> <li>Macro variable output name is myValue</li> </ul> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: swig compiled binary Python Azure import error<p>I'm trying to run an azure function app. I've created the file structure, functions, etc. as needed for my c...
<p>Figured it out. Azure functions use a linux operating system for python runtime stacks. If you use a .pyd, that is compiled on windows, and the azure runtime stack will not recognize it. You have to use a .so compiled on linux for this to work.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ElasticSearch result get HITS count based on each word in the searchquery<p>As we can see in the below simple ElasticSearch for text &quot;Baby Oil&quot; I g...
<p>You can use <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html" rel="nofollow noreferrer">Filter aggregation</a></p> <blockquote> <p>A multi-bucket aggregation where each bucket contains the documents that match a query.</p> </blockquote> <p><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Progress Bar creation in React TS - getting error implicitly has type 'any' although types are declared in interface<p>I am trying to recreate this <a href="...
<p>You have declared types only for <code>props</code>, not your local variables.</p> <pre><code>export interface Props{ previousTimestamp: number; } function App(props: Props) { props.previousTimestamp // this is typed (number) let previousTimestamp; // not this } </code></pre> <p>To type your local variabl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find all lower and upper values for a given value in a list<ul> <li>I have an array that looks like this: <code>[1,2,4,1,2,5,1,2,6]</code></li> <li>Gi...
<p>You could do something like this:</p> <pre><code>import numpy as np x = np.array([1, 2, 4, 1, 2, 5, 1, 2, 6]) x_left = x[:-1] x_right = x[1:] encapsulation = np.where((x_left &lt; 3) &amp; (x_right &gt; 3)) left_encapsulation_values = x_left[encapsulation] right_encapsulation_values = x_right[encapsulation] </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Simmer: How to apply an overflow logic to a round-robin counter selection?<p>I'm trying to simulate a queue wherein there are two counters that have a diff...
<p>A lot of tests and tries and I think I eventually figured it out. I had to use a few branches and some heuristic approaches to replicate the situation I had in mind. Here is the final solution.</p> <pre><code># LOAD LIBRARIES ---- library(simmer) library(Rcpp) library(dplyr) library(tidyr) library(&quot;simmer.plot&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are pointers in C<p>I have this task:</p> <blockquote> <p>Make corrections in the maxmin.c program so it compiles itself and works correctly (finds max ...
<p>By default arguments are passed to functions by values. It means that functions dial with copies of values of argument expressions.</p> <p>Changing a copy of the value of an object within a function does not change the value of the original object.</p> <p>To change the original object in a function you need to pass ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set random labels for images in tf.data.Dataset<p>I have a tf data dataset of images with a signature as seen below :</p> <pre><code>&lt;_UnbatchDataset elem...
<p>The problem is that using <code>dataset.map</code> runs all operations in graph mode and random numbers generated by numpy are not tracked by tensorflow and are therefore deterministic. Random tensorflow tensors, on the other hand, will be tracked. So try something like this:</p> <pre><code>import tensorflow as tf ...