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: Copy column A3:A9-E3:A9: to A,C,E,G, I in an other sheet<p>Is it possible to copy from column A3:A9-E3:A9: and then target them to A,C,E,G,I in an other shee...
<p>use this formula:</p> <pre><code>=ARRAYFORMULA(SPLIT(TRANSPOSE(QUERY(TRANSPOSE("♦"&amp;A3:E9&amp;"♦");;999^99)); "♦")) </code></pre> <p>then copy with <KBD><strong><code>CTRL</code></strong></KBD>+<KBD><strong><code>C</code></strong></KBD> and re-paste/paste over with <KBD><strong><code>CTRL</code></strong></KBD>+...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign a random variable to each item stored in a 1D list ? Output has to be a 2D list<p>I hope you are doing well :)</p> <p>Apologies if this sounds ...
<p>The following code should work, but as @Alexey_Larionov mentionned, the r list should contain the random variables directly, or be a dictionary containing them.</p> <pre><code>import random item_code = [123, 124, 125, 126, 127, 128, 129, 130, 131, 132] r = ['P1','P2','P3','P4','P5','P6'] output_list = [[item, random...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is Realm smart when updating values or check for new values should be perfomed manually?<p>I wonder if I should create my own additional layer when updating ...
<p>Your observers will be notified if you update a property on a realm object with the same value. Realm does not care if you use a different value or not.</p> <p>I'm not sure what your use case is, but it may be a pain in the butt to check every value manually.</p> <p>You can do something like this though:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: overly-aggressive figure cropping with rmarkdown-generated PDFs only on mac<p>I'm compiling the following rmarkdown document in Rstudio:</p> <pre><code>--- t...
<p>The reason for this was that my Mac had a very old version of ghostscript installed that was being preferred to the newer version. The old version that was causing the problem was:</p> <pre><code>GPL Ghostscript 9.22 (2017-10-04) Copyright (C) 2017 Artifex Software, Inc. All rights reserved. This software comes wit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I read the second line of multiple TXT files using cat and output the results?<p>How do I read the second line of multiple files and then output the r...
<p>With your shown samples try, following <code>awk</code> code, written and tested in GNU <code>awk</code>. Simply just read only 2nd line of each file(since <code>FNR</code> is the variable which gets reset after each file's start) if its value is <code>2</code> the print that line and use <code>nextfile</code> which...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Material-UI theme.mixins.toolbar not working with Typescript<p>I am using Material-UI for a React &amp; Typescript web site I am building. It's been working...
<p>Should be fixed in the next release. See <a href="https://github.com/mui-org/material-ui/issues/19362" rel="nofollow noreferrer">https://github.com/mui-org/material-ui/issues/19362</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attribute to override generic class based form and use a custom form?<p>I have the following form in forms.py:</p> <pre><code>class JobForm(ModelForm): ...
<p>Use form_class attribute of UpdateView <a href="https://docs.djangoproject.com/en/3.0/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.form_class" rel="nofollow noreferrer">https://docs.djangoproject.com/en/3.0/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.form_cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git Pull for Multiple Repositories with Batch file<p>I am trying to run a batch file,</p> <p>which will go to grandparent folder, and do git pull for all it...
<p>You could use the output of <code>dir</code> command to iterate over the directories in your <code>%grandparent%</code> folder, something like:</p> <pre><code>FOR /F "usebackq tokens=*" %%G in (`dir /A:D-H /B "%grandparent%"`) Do ( pushd "%grandparent%%%G" git pull popd ) </code></pre> <p>Hope it helps...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: google sheet script border by color<p>I would like to have borders on rows where the first cell of a row has a specific color.</p> <p>I found this script, an...
<p>I believe your goal is as follows.</p> <ul> <li>You want to apply the borders to the cells when the background color of column &quot;A&quot; is <code>var gray = &quot;#efefef&quot;</code>.</li> </ul> <h3>Modification points:</h3> <ul> <li>From <code>The problem is that when I run this, all my cells are borderd inste...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change a Path in DataContext in Element?<p>I have a</p> <pre><code>&lt;Grid DataContext=&quot;{Binding Path=ListOFFighters[0], ...
<p>You can create a multi-value converter that takes an array or list as well as an index.</p> <pre><code>public class IndexedBindingConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { return values.Length &lt; 2 || !(values[0] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Do I Adjust Image Sizing To Stay Proportional<p>I am completely new to creating a website using Wordpress but have realized that HTML coding seems to be ...
<blockquote> <p>Ideally, there would be an image thats 100% width, the next two below would be 50% each with space in between. The next three below would be 33%. All pictures would have even spacing in between. How can I do this?</p> </blockquote> <p><strong>CSS Flexbox</strong> is the perfect tool to achieve ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: useRef value In devtools but not logged<p>I'm reluctant to add another question about useRef, though I'm yet to find a useful answer.</p> <p>For today, not r...
<p>As I suspected in my first comment, your <code>keypress</code> handler gets called <a href="https://github.com/chjj/blessed/blob/eab243fc7ad27f1d2932db6134f7382825ee3488/lib/widgets/textarea.js#L209" rel="nofollow noreferrer">before Blessed's internals</a> have a chance to act to update <code>value</code>, but by th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django static files not coming through when deployed to Heroku<p>My static files are not coming through when I am deploying to Heroku. It works fine when I r...
<p>Sorry guys - stupid mistake on my part. Turns out the problem was I gitignored my own staticfiles folder.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test if the find command found files or not<p>I have a simple script to check a file of today's date. In the below example, the else condition is ignored if ...
<p>As <a href="https://stackoverflow.com/a/73080540/7939871">Ljm Dullaart explained earlier</a>, the <code>find</code> command does not return a specific code, when no file match patterns or rules.</p> <p>Though, You may test it found a match, by checking the variable <code>filedir</code> is not empty: <code>[ -n &quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# - How to get only Date part from string 'd MM YYYY HH:mm:ss AM/PM'<p>In my C# project, there is a modal with string field which holds DateTime value.</p> ...
<p>If you need just the Date part of the DateTime, you need to use the .Date property of the DateTime.</p> <pre><code>DateTime accountDateOfBirth = DateTime.Parse(user.DateOfBirth).Date; </code></pre> <p>You might be assuming that use of DateTime.ParseExact with format provided will give you the format you need, that...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: flutter firebase storage throwing unknown error<p>edit: i notice that the code only runs till the below code and then gets out with the error. also, do note ...
<p>update: turns out, i have to use a vpn where my storage is located to access the file. everything works as it should be now</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Array manipulation error with regex - Kata 6 Codewar<p>In theory it should transform a given array to camel case. I don't understand what is wrong</p> <pre><...
<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace" rel="nofollow noreferrer"><code>.replace()</code></a> method doesn't modify the <code>word</code> variable, it instead returns a new modified string. So your code is producing new values within the loop but ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django export env error : not a valid identifier<p>I'm coding in Django ,and want to export the env in build.sh ,the env is an email attachment file type lis...
<p>In your shell script:</p> <pre><code>export PROJECT_EMAIL_FILE_TYPES=&quot;.txt,.doc,.docx,xls,xlsx,csv,.pdf,.jpg,.png,.jpeg,.html,.ppt&quot; </code></pre> <p>In your Python code:</p> <pre><code>PROJECT_EMAIL_FILE_TYPES = os.environ.get('PROJECT_EMAIL_FILE_TYPES').split(',') </code></pre> <p>(Use proper variable nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: limit django query to current session and pass it to a function view<p>So I'm trying to make a calculator of sorts where the user enters some data and then t...
<p>As suggested by @vinkomlacic, I found a way to include the id of the model instance by switching to the render method instead of redirect and it worked like a charm.</p> <pre><code> if form.is_valid(): messages.success(request, f'Successful!') item = form.save() m_data = Calculate.objects...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Narrowing fields by GROK<p>I'm trying to work with grok to parse a certain log file into fields to use on a ingest pipeline for filebeat. This is my grok pat...
<p>You can use grok with kv in this case</p> <pre><code>grok { match =&gt; {&quot;message&quot; =&gt; &quot;%{TIME:TIMESTAMP_ISO8601} \[%{WORD:device_id}\] \[%{DATA:OS}\] %{GREEDYDATA:some} \'%{GREEDYDATA:status}\' \[%{GREEDYDATA:device_details}\]&quot;} } kv { source =&gt; &quot;device_details&quot; fie...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract key , value from dictionary and store it in new list<p>I have data in the following format.</p> <pre><code>{&quot;id&quot;: 0, &quot;key1&quot;: valu...
<p>Assuming that your input data is actually in the format:</p> <pre><code>l = [{&quot;id&quot;: 0, &quot;key1&quot;: &quot;value&quot;, &quot;key2&quot;: &quot;value&quot;, &quot;imp_key&quot;: {&quot;sub_key1&quot;: None, &quot;sub_key2&quot;: None, &quot;sub_key3&quot;: None}}, {&quot;id&quot;: 1, &quot;key1&quot;: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS Photo Gallery wGrid - Gap Problem // Margin around images<p><strong>EDITED - 3x3 grid with NO GAPS solved (if images are all same size) Now, how would I...
<p>Your question is a bit confusing but is that what you are looking for?</p> <p>I simply removed the <code>width</code> and <code>height</code> of .gallery__img and removed the <code>padding</code> of figure.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "GET /store/hello/ HTTP/1.1" 405 0 with Class-Based-Views (Django)<p>I use <strong>Class-Based-Views</strong> with <strong>&quot;post&quot; method</strong> a...
<p>You need to use <strong>&quot;get&quot; method</strong> as shown below instead of <strong>&quot;post&quot; method</strong>:</p> <pre class="lang-py prettyprint-override"><code># &quot;store/views.py&quot; from django.shortcuts import render from django.views import View class Hello(View): # Here def get(se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Joining two indexes in Elastic Search like a table join<p>I am relatively new to this elastic search. So, I have an index called <strong><em>post</em></stron...
<p>For the sake of performance, Elasticsearch encourages you to denormalize your data and model your documents accordingly to the responses you wish to get from your queries. However, in your case, I would suggest defining the relation post-profile by using a Join datatype (link to <a href="https://www.elastic.co/guide...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: half circle on y axis with text svg<p>I'm trying to draw half circle on y axis without ruining my text</p> <p><div class="snippet" data-lang="js" data-hide="...
<ol> <li><p>Ive rewritten the d attribute of the path. Now it's the same path you have but reversed.</p> </li> <li><p>The text have <code>dominant-baseline=&quot;hanging&quot;</code> so that it falls inside the circle.</p> </li> <li><p>I've also added <code>textLength=&quot;125&quot;</code> to match the length of the p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the colon in ": exit 0" do?<p>I have a bash script which ends with:</p> <pre><code>: exit 0 </code></pre> <p>I understand that the colon is a bash ...
<p>The <code>:</code> builtin just ignores any arguments, so it's essentially just a way to comment except the arguments will be expanded. So in many cases the result <a href="https://superuser.com/q/423980/241386">might be different</a> from a simple comment</p> <pre><code>: whatever command arguments can follow the &...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling an asynchronous method without await recommended?<p>I wrote a small computer game where you can mine gold. The game is used to understand asynchronou...
<blockquote> <p>The game is used to understand asynchronous programming with async and await... The GoldMining method makes heavy use of the CPU.</p> </blockquote> <p>Asynchronous code is not a natural fit with CPU-bound methods. For CPU-bound methods, you want parallel code or multithreading.</p> <p>If you want to lea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Iterate over multiple DataFrames and plot histograms for each feature with each data set's feature in the same graph<p>I have two DataFrames: df1 &amp...
<p>IIUC, you could assign a new column named <code>ID</code> to both data frames that could be used for your legend to distinguish between your histograms. Then, you can concatenate your data frames row-wise using <code>pd.concat</code>. After that, you just need to define your axis and figure and iterate over all colu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ways of obtaining a similarity metric between two full text documents?<p>So imagine I have three text documents, for example (let 3 randomly generated texts)...
<p>There is no simple answer to this question. As similarities will perform better or worse depending on the particular task you want to perform. </p> <p>Having said that, you do have a couple of options regarding comparing blocks of text. <a href="https://medium.com/@adriensieg/text-similarities-da019229c894" rel="no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the '&' in 'operator++(int) &' operator overload means?<p>What does the <code>&amp;</code> after a method signature mean and do? I have this:</p> ...
<p>This is an lvalue-ref qualifier. It is explained <a href="https://en.cppreference.com/w/cpp/language/member_functions" rel="nofollow noreferrer">here</a>.</p> <blockquote> <p>During overload resolution, non-static cv-qualified member function of class X is treated as follows:</p> <ul> <li><p>[...]</p> </li> <li><p>l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test the function inside click handler - Jest, React testing Library<p>I have a button click handler in which I call another function. I need to test the fun...
<p>It depends on where <code>someFunction</code> is defined. If it's a property given to <code>&lt;SomeComponent /&gt;</code> then you could do something like this:</p> <pre class="lang-js prettyprint-override"><code>describe('Button click', () =&gt; { it('button click', async () =&gt; { const someFunction = jest...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove last , in php string<p>Hello I have this example</p> <p>I need to delete the last comma</p> <pre><code>&lt;?php $numeri = ['I', 'II', 'III', 'IV', 'V...
<p>You may use the <code>join()</code> function here:</p> <pre class="lang-php prettyprint-override"><code>$numeri = ['I', 'II', 'III', 'IV', 'V']; $output = join(&quot;,&quot;, array_reverse($numeri)); echo $output; // V,IV,III,II,I </code></pre> <p>If you want to stick with a loop approach, then use logic to prepend...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count the number of NAs in multiple columns after grouping a dataframe in R<p>I have a data frame <code>df</code> that is a date <code>Date</code>, a region ...
<p>I propose two ways:<br /> using dplyr:</p> <pre><code>df %&gt;% group_by(Region,ID) %&gt;% summarise_each(list(na_count = ~sum(is.na(.)))) </code></pre> <p>or data.table:</p> <pre><code>library(data.table) setDT(df)[, lapply(.SD, function(x) sum(is.na(x))), by = .(Region, ID)] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to change the data of an airfoil points.dat file from columns to rows<p>I am interested in developing an application that generates as output the points ...
<p>IIUC, you can use this oneline:</p> <pre><code>'|'+'|'.join([' '.join([str(y) for y in x]) for x in pd.read_csv('https://m-selig.ae.illinois.edu/ads/coord/n0009sm.dat', delim_whitespace=True).iloc[:, :-1].values]) </code></pre> <p>Output:</p> <pre><code>'|1.0 0.0|0.99572 0.00057|0.98296 0.00218|0.96194 0.00463|0.933...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a column of UTC timestamps into several different timezones?<p>I have a dataset with dates stored in the DB as UTC, however, the timezone is a...
<p>Welcome to StackOverflow. This is nice, common, and tricky problem! The following should do what you ask for:</p> <h3>Code</h3> <pre><code>mydat &lt;- data.frame(time_stamp=c(&quot;2022-08-01 05:00:00 UTC&quot;, &quot;2022-08-01 17:00:00 UTC&quot;, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replicating SAS DO loop in Oracle PL/SQL<p>I'm trying to replicate a DO loop from SAS into Oracle PL/SQL. Basically, this DO loop iterates over the table and...
<p>Here's one way. The "with" clause is called a Common Table Expression (CTE) and just sets up the test data with a unique id for each entry.</p> <p>The query uses a CONNECT BY which can be thought of as a looping mechanism for each row returned. It comes along with a variable called "level" which is incremented on...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Minimum Coin Change Leetcode problem (Dynamic Programming)<p>Here's the question: <a href="https://leetcode.com/problems/coin-change/" rel="nofollow noreferr...
<blockquote> <p>Does this second code have the same logic as &quot;testing the subsets of coins?&quot;</p> </blockquote> <p>If with subset you mean the subset of the coins that is still available for selection, then: no. The second algorithm does not reduce the problem in terms of <em>coins</em>; it reasons that at any...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: set timer inside a loop for graphql query<p>The thing I'm doing here is fetching anime characters from anilist graphql api. The reason I've added a loop is s...
<p>Something like that will work for you (Asuming all the rest was ok):</p> <pre><code>const delay = (ms) =&gt; new Promise((resolve) =&gt; setTimeout(resolve, ms)); async function fetchData() { for (let i = 1; i &lt;= number; i++) { // So in case your function is called in loop - request will be delayed awa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap 5 Form Floating Labels are always in the upper position when using flask-wtforms<p>I am using flask, jinja, and wtforms to make an account creation...
<p>Apparently the <code>placeholder</code> attribute is required (as it says in the very first paragraph of the bootstrap docs). I should read better.</p> <p>P.S.</p> <p>It turns out the unassigned value attributes had nothing to do with the issue. But, if you do ever need to change what wtforms renders, <a href="https...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export list of API Paths from OpenAPI spec using swagger ui<p>I have a bunch of APIs that are documented as OpenAPI v3 specs. </p> <p>Eg: foo.yaml, bar.yaml...
<p>The API definition is accessible via <code>ui.specSelectors.specJson()</code>. The value is an Immutable.js <a href="https://immutable-js.github.io/immutable-js/docs/#/Map" rel="nofollow noreferrer"><code>Map</code></a>.</p> <p>You can use the following code to list all the paths:</p> <pre class="lang-js prettypri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BST largest key less than k and at a depth not less than x<p>I post this question just for curiosity and it's not homework. It was a question for one of my e...
<p>Indeed, your algorithm does not use the property of binary search trees.</p> <p>The idea is to first find a candidate node without taking the depth requirement into account. If the depth of that node is fine, then return it. Otherwise look in the left-subtree of that node to find a deeper candidate node. If also tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My c# custom delegate behaves weird (No overload for <X> matches <my custom delegate>)<p>Okay, so after reading into creating custom function delegates after...
<blockquote> <p>Since my functions clearly adhere to the delegate I created</p> </blockquote> <p>Unfortunately, neither of your <code>FirstFunction</code> and <code>SecondFunction</code> is of <code>RefFunc</code> type, just because the <code>T</code> is passed by <code>ref</code> in the delegate's defintion and in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: break links into chunks with a sliding window<p>So, i'm trying to break a list up into chunks of 4 but with a caveat. The caveat is that I want the list to t...
<p>Something like this?</p> <pre><code>data = 'i ii iii iv v vi vii viii'.split() print([' '.join(data[i-2:i+2]) for i in range(2, len(data), 2)]) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Python from a XML file ,I want to get only the tags that have a value?<pre class="lang-xml prettyprint-override"><code> &lt;?xml version='1.0' e...
<p>Load xml, traverse it (eg recursively), return tags with non-empty text.</p> <p>Here as generator:</p> <pre><code>import xml.etree.ElementTree as ET def getNonemptyTagsGenerator(xml): for elem in xml: yield from getNonemptyTagsGenerator(elem) if len(xml) == 0: if xml.text and xml.text.stri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R data.table Aggregating rows by group conditionally<p>I'm currently working in data.table in R with the following data set:</p> <pre><code> id age_sta...
<p>You can use an equi-join for the first bullet; and a non-equi join for the second:</p> <pre><code>m_equi = x[.(id = unique(id), age_dn = 2, age_up = 4), on=.(id, age_start = age_dn, age_end = age_up), nomatch=0 ] m_nonequi = x[!m_equi, on=.(id)][.(id = unique(id), age_dn = 2, age_up = 4), on=.(id, age_star...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSON.Net Deserialization error, My Class definition is wrong?<p>In VB.Net program I'm getting the &quot;Cannot deserialize the current JSON array&quot; when ...
<p>you have to use list of objects, not an object</p> <pre><code>Dim oResult = JsonConvert.DeserializeObject(Of List(Of MCMusicElements))(sRB) dtDataTable.Rows(index).Item(1) = oResult(0).MIK_Energy </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter setState() function being called but not doing anything<p>Managed to create a simple reproduction of an error I've come across in my real program, an...
<p>Your <code>stateModify</code> function is not a method of <code>_MyHomePageState</code>. Also when you are accessing the <code>_MyHomePageState().textChanger()</code> in <code>stateModify</code> you are eventually creating a new object of <code>_MyHomePageState()</code> but not inserting in render tree. </p> <p>You...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent a column to be nullable when aggregating a non nullable column in PySpark<p>Is there a way (without an extra cost like <a href="https://stackoverflow...
<p>As suggested by @Andrew, we can use <code>F.coalesce</code> so that the column remains <code>nullable=False</code> even in the joined dataframe:</p> <pre class="lang-py prettyprint-override"><code>left_sum = left_sum.withColumn(&quot;left_total_count&quot;, F.coalesce(&quot;left_total_count&quot;, F.lit(0))) </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Updating boost::variant from boost 1.60 to boost 1.79<p>I have a C++ code that uses boost 1.60 and compiles fine. It is a simple math parser.</p> <p>Code is ...
<p>It was broken by <a href="https://github.com/boostorg/variant/commit/927280570a553b43846e74ddd6b3802d5a1a5f1c" rel="nofollow noreferrer">Boost.Variant change</a>, filed the issue <a href="https://github.com/boostorg/variant/issues/100" rel="nofollow noreferrer">https://github.com/boostorg/variant/issues/100</a>.</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: One Bootstrap carousel wrongly mixing photos with another bootstrap carousel from the same page<p>I added 2 bootstrap 5 carousels on the same page, added uni...
<p>because you use .carousal selector and class is present in both carousals use ids instead of class #Carousel-1 or #Carousel-2</p> <pre><code>let items = document.querySelectorAll('#Carousel-1 .carousel-item') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to install SpaCy to Raspberry Pi 4 Raspbian Buster<p>I have been stuck at installing SpaCy the entire day.</p> <pre><code>sudo pip install -U...
<h2>Disclaimer</h2> <p>The build might take a long time on a single RPi. If you have a cluster of multiple Pi's available, it may be wise to invest into setting up <code>distcc</code> on them. This will also reduce the last step (verifying the build by running the tests) as <code>pytest</code> supports distributed tes...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: php regex comma pattern not allowed<p>Hi import db file parse. insert sql query parsing always good but If there is a comma between the quotes, skip it, oth...
<p>Here is a <code>preg_match_all()</code> approach. The regex pattern used below attempts to match a CSV term in single quotes <em>first</em>, otherwise it grabs all content up until the next comma. This trick avoids the problem of matching a false flag comma inside single quotes.</p> <pre class="lang-php prettyprin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Json Response empty values<p>I've got an controller action (which I found the basis from on SO somewhere, can't find the original now) that provides a file u...
<p>This is very unconventional approach from standard C# practices point of view:</p> <pre class="lang-cs prettyprint-override"><code>var success = JsonConvert.DeserializeObject(&quot;{ 'uploaded': 1,'fileName': \&quot;&quot; + fileName + &quot;\&quot;,'url': \&quot;&quot; + url + &quot;\&quot;, 'error': { 'message': \...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use multiple statements in an Angular ES6 Observer function?<p>The original convention is to do something like this</p> <pre><code> this.produc...
<p>The way you are using it should work. Here's a stack that I created to verify.. <a href="https://stackblitz.com/edit/typescript-ug28l2" rel="nofollow noreferrer">https://stackblitz.com/edit/typescript-ug28l2</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue3 using Interface as Prop Types<p>I am having an issue using an Interface as a Vue3 Prop, the goal is to use the interface as a type check on the prop: (W...
<p>I found a 'work around' for the example that I posted above:</p> <pre><code>// IsProduct.ts export interface IsProduct { _id: string; productName: string; icon: string } </code></pre> <pre><code>// ProductDisplay.vue &lt;script lang=&quot;ts&quot; setup&gt; ... interface Props { product: {_id: string} | st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create a new object with key as one object's value and the object as the value?<p>My question is somewhat similar to <a href="https://stackoverflow....
<p>There are multiple ways to iterate over the <code>Map</code>'s keys and collect them into an object. Here's one:</p> <pre><code>const newObject = Array.from(newMap.keys()). reduce&lt;Record&lt;string, ObjectType1 | undefined&gt;&gt;( (acc, k) =&gt; ({ ...acc, [k.key]: k }), {} ); // const newObject:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm need to know how put an interface of a method inside When() mockito method<p>I'm trying to simulate a method with mockito in Android Studio, but, one of ...
<p>I copied your code into an example to verify this myself. I made a few changes, some are just for my convenience. Note that I used JUnit5 with a newer mockito version (<code>3.2.4</code>) to test it.</p> <ol> <li><p>You do not need to use both <code>@InjectMocks</code> and <code>@Before</code>, either one of them s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: add class to parent ul on sub item click javascript<p>I try to keep my menu open when a sub item with link is open. I have same class name for the parent men...
<p>When you call <code>.parent()</code> on an element it gives you the immediate parent of that specific element.</p> <p>In your case it will be the <code>&lt;li&gt;</code> element above the anchor elements. If you want to access <code>&lt;ul&gt;</code> element, you will have to get the parent of the <code>&lt;li&gt;</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jpa, linked class take main class id<p>I have a Product :</p> <pre class="lang-java prettyprint-override"><code>@Data @Entity @Table(name = &quot;products&qu...
<p>You have the mappings backwards in your model.</p> <p>By using</p> <pre><code>public class Product { @Id @GeneratedValue private int id; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name=&quot;id&quot;) private Information information; </code></pre> <p>You've told JPA to use the PRODUCT....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to know what you can import from package?<p>Let's say there is no intellisense for node packages in Visual studio code(Sometimes intellisense doesn't wor...
<p>You can search directly in the source code (in the node_modules folder there is a folder called as the package, find module.exports or export keywords) or check the documentation if there is one.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly swap numpy array<p>I am trying to swap the named columns of a numpy array as shown below, but the function is not behaving accordingly to wha...
<p>Apparently <code>copy.deepcopy()</code> does not make a deep copy of the <code>dtype</code> object attached to the numpy array. So the data inside the array was copied, but you were switching names <code>'x'</code> and <code>'y'</code> in the <code>data.dtype</code>. So printing <code>data['x']</code> gave you a dif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is using local db a good way to reduce data read/writes from Cloud Db?<p>I am using Cloud Firestore in a React Native app and I am trying to reduce the read/...
<p>I feel compelled to point out that the other (currently accepted) answer here is flat out incorrect, or at least misleading for a few reasons.</p> <p>First, Firestore doesn't use HTTP, and the results of queries are never going to be maintained by your typical browser cache. The claims the answer makes about HTTP c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide NavController & AppBarConfiguration in a fragment & activity<p>I'm using a navigation graph in my Android app (Java) and have set up a NavControl...
<p>Recently, I came across same situation for fab and toolbar. I created a BaseFragment () class and I let all my fragments extended from this. In BaseFragment, declared two variables one for fab's visibility and other for toolbar.</p> <pre><code> BaseFragment () { protected int isBottombarVisible = View...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change allowedit on statement<p>I'm trying to change allowedit value on a single field but can't get into it. This is my actuall code but I get error: Okay ...
<p>if you are working with extension try something like this</p> <pre><code>[PostHandlerFor(formStr(YourForm), formMethodStr(YourForm, YourMethod))] public static void YourForm_xxx(XppPrePostArgs args) { FormRun sender = Args.getThis(); sender.control(sender.controlId(formControlStr(YourForm, Y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SpringBoot: Where to put internal container classes<p>I have the following project structure:</p> <pre><code>app | |--&gt; config |--&gt; controller |--&gt;...
<p>One way, We can move all the <code>Class</code> which are used for Database to <code>entites</code> package and put <code>Internal</code> Classes in <code>models</code> package,</p> <pre><code>app | |--&gt; config |--&gt; controller |--&gt; dto |--&gt; exception |--&gt; models |--&gt; entities |--&gt; repository |-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to merge two lists based on object indices - keeping attributes?<p>I want to merge two lists keeping the index of each object:</p> <pre><code>mylist&lt;...
<p>Here is an option where we create a logical index with <code>lengths</code> (which will return 0 when there is <code>NULL</code>) and use to assign the elements with <code>mylist</code> unlisted</p> <pre><code>otherlist[lengths(otherlist) == 0] &lt;- unlist(mylist) otherlist #[[1]] #[1] 1 #[[2]] #[1] 2 #[[3]] #[1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to mount a memory filesystem onto a directory<p>I have a memory filesystem in Python, created in the following fashion:</p> <pre><code>import fs mem_fs ...
<p>I had the same requirement, ans i've managed it this way</p> <pre><code>from fs.tempfs import TempFS tmp = TempFS(identifier='_toto', temp_dir='tmp/ramdisk/') </code></pre> <p>it does mount create a directory, with an arbitrary name suffixed by _toto</p> <p>tmp/ramdisk ❯❯❯ ls<br /> tmpa1_4azgi_toto</p> <p>which is t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: loop in python to create folders: "The system cannot find the path specified"<p>I am using os.path.join and os.mkdir to create folders on a loop.I would like...
<p>I would need to see your file system to answer fully but it seems likely that you're trying to create multiple folders e.g. NY, inputs and b-d which os.mkdir will not handle.</p> <p>Instead I recommend swapping out os.mkdir with <a href="https://docs.python.org/3/library/os.html#os.makedirs" rel="nofollow noreferrer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort array of structs<p>Sorting array of structs on the first struct field is straightforward.</p> <pre class="lang-py prettyprint-override"><code>from pyspa...
<p><strong>Easy way</strong></p> <p>If you can achieve <em>BOTH</em> of these, you will have a simpler code:</p> <ul> <li>rearrange struct fields so that <em>fields for sorting would be placed at the beginning</em></li> <li>modify the values in fields for sorting so that <em>the order would be the same for all the sort...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript throws error when accessing payload in reducer<p>I have a reducer in which <strong>Typescript</strong> throws an error if I try to access <strong>...
<p>The issue is destructuring. When you do so <code>type</code> stops be related to <code>payload</code> and not works as union discriminant anymore. Please use <code>action.type</code> and <code>action.payload</code> directly.</p> <pre><code>switch (action.type) { // direct use case actionTypes.SUBMIT_FORM_FAILUR...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase Auth UI: Is there an UI to let user edit their profile?<p>I'm using Firebase Auth UI in an Android app.</p> <p>I've already managed to use the UI fo...
<p>As far as I know, there're no ready-made Ui for this, by this time.</p> <p>The problem I see with it, is that there are confusion on what data user want to change, he can misunderstood it as change of his google account data, if it was official Ui from Firebase.</p> <p>It's not a big deal to make it originally in yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sqlite3 DB is locked by an unknown process<p>I am trying to read an sqlite3 db into memory for further processing using python like so:</p> <pre><code> co...
<p>The stance of the SQLite developers about <a href="https://www.sqlite.org/useovernet.html" rel="nofollow noreferrer">using a database stored in a networked file system</a> is, essentially, &quot;Don't. Use a client-server database instead.&quot;</p> <blockquote> <p>This simple, &quot;remote database&quot; approach i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assembly x86 imul and div aren't doing what I expect<p>When I go to divide, it gives me some out of this world answers. This works:</p> <pre><code>mov ax, 1...
<blockquote> <p>The answer should be 0 with a remainder of 11. But the answer ends up 104 and with a remainder of 3 somehow.</p> </blockquote> <p>This means that <code>AX</code> contained the value <code>0x0F0B</code> instead of <code>0x000B</code> before the <code>div</code> instruction.</p> <p>W. Chang's comment ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Java AsyncTask executes twice after activity restarts<p>I am using some AsyncTasks in background for purposes in my Native Android Java application, ...
<p>The issue is originally from android architecture. when Activity gets destroy, automatically the activity restarts several times in same thread. in case of that single execution may run several times. the following code helps to solve this issue.</p> <pre><code>@Override protected void onDestroy() { pus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replying to Teams message in channel after a specific keyword posting<p>Trying to understand what would be the right configuration to reply to a message when...
<p>Figured this out by actually assigning the keyword to a variable as a string and then switch statement is checking that keyword, and it did well for me.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Define Iterator type of template argument<p>In function below, how to tell the compiler that Iterator is the iterator of Cont ?</p> <pre><code>template&lt;t...
<pre><code>template&lt;typename Cont, typename Pred&gt; auto find_if(const Cont &amp;c, Pred p) -&gt; decltype(std::begin(c)) // HERE { return std::find_if(std::begin(c), std::end(c), p); } </code></pre> <p>Or since version C++14:</p> <pre><code>template&lt;typename Cont, typename Pred&gt; auto find_if(const Cont...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# WPF Syncfusion Selected row doesnt highlight when row is moved to top<p>I am using Syncfusion WPF Datagrid to display some data. I have implemented featur...
<p>I managed to get it working with the help of the Syncfusion Team.</p> <p>I created a method in my Datagrid User control class:</p> <pre><code>public void MoveToTopRow() { var getSelectedIndex = 0; jobListView.SelectedIndex = getSelectedIndex; } </code></pre> <p>I then called this method on the button click i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculating last and third value difference of each same column value in a dataframe in loops<p>I am trying to calculate the difference between the last and ...
<p>The basic operation you are looking for is a one-liner:</p> <pre><code>res = df.groupby(['month','year']).last() - df.groupby(['month','year']).nth(2) print(res) ex1 ex2 month year 1 1996 30 50 12 1995 39 48 </code></pre> <p>To get this into the shape of your desired output, tr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get data attribute inside each loop?<p>I'm building a form with HTML and jQuery and need to concatenate various input fields for the Ajax request.</p>...
<p>Once inside the loop of rows, you need to use .find() on the formfields;</p> <pre><code>var formFields = $(row).find("input[data-name='formField']"); </code></pre> <p>Then use <code>rowData[$(field).attr("data-input")] = $(field).val();</code> to assign to a specific property, we wrapped <code>field</code> with <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select maximum value from all previous rows (oracle sql)<p>I have a table that looks as follows:</p> <pre><code>personid opendate fraud 1 20190105...
<p>You can use window functions:</p> <pre><code>select t.*, max(fraud) over(partition by personid order by opendate) ever_fraud from mytable t </code></pre> <p><strong><a href="https://dbfiddle.uk/?rdbms=oracle_11.2&amp;fiddle=5da25314300c7a0b9b9447956557d087" rel="nofollow noreferrer">Demo on DB Fiddle</a><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Put all opened org mode files in a list to be used eventually with helm lists<p>I am trying to put all (opened) org files in a list so I could add them to he...
<p>If you don't want to kill the buffers, I suggest not applying <code>kill-buffer</code> to each element. Other than that, you pretty much got everything done already. Here's a version that does not require any external libraries:</p> <pre class="lang-el prettyprint-override"><code>(seq-filter '(lambda (buffer) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas merge on list type rows<p>i have two dataframe. df1:</p> <pre><code>import pandas as pd values=[[1,[1,2]],[2,[2,2]],[3,[2,3]]] df=pd.DataFrame(values,...
<p>Explode the value column then map the type using common id then groupby and aggregate back to list</p> <pre><code>d = df2.set_index('id2')['type'] df['type'] = df['value'].explode().map(d).groupby(level=0).agg(list) </code></pre> <p>Alternative approach with list comp and dict lookup</p> <pre><code>d = df2.set_index...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lagging in R when a condition is matched<p>I have a dataframe with just dates of medical checkups and presence of infection (yes/no), and I want to add a thi...
<p>We can create a grouping variable based on logical vector created with 'infection' and use that to <code>lag</code> the column. Here, we load only <code>dplyr</code> and not any other packages</p> <pre><code>library(dplyr) df1 %&gt;% group_by(grp = cumsum(infection == "yes")) %&gt;% mutate(new = first(date))...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PrintWriter creates empty file<p>I have the following problem I want to read a file and shift each letter down by 3 positions in the alphabet. The caesar cip...
<p>remove <code>convert = new StringBuilder (text);</code> in your loop. It's overwriting your data in the previous loop</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiply each element of a list by an entire other list<p>I have two lists which are very large. The basic structure is : <code>a = [1,0,0,0,1,1,0,0]</code> ...
<p>You can do this using matrix multiplication, and then flattening the result.</p> <pre><code>&gt;&gt;&gt; a = np.array([1,0]).reshape(-1,1) &gt;&gt;&gt; b = np.array([1,0,1,0]) &gt;&gt;&gt; a*b array([[1, 0, 1, 0], [0, 0, 0, 0]]) &gt;&gt;&gt; (a*b).flatten() array([1, 0, 1, 0, 0, 0, 0, 0]) &gt;&gt;&gt; </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resend specific order state emails e.g. order delivery shipped in shopware 6<p>I'm wondering if there is any simpler solution in sending specific order state...
<p>Given that you don't actually want to change the state, this looks like a good solution.</p> <p>If you actually needed to programmatically change the state you could use the <code>StateMachineRegistry</code> service.</p> <pre class="lang-php prettyprint-override"><code>$transition = new Transition(OrderDeliveryDefin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to upload image within a hidden element using Selenium and Python<p>I'm trying to upload a picture inside a button, but I keep getting this error:</p> <...
<p>To upload image for conversion within the website <a href="https://easypdf.com/fr/convertir-ocr" rel="nofollow noreferrer">https://easypdf.com/fr/convertir-ocr</a> using <a href="https://stackoverflow.com/questions/54459701/what-is-selenium-and-what-is-webdriver/54482491#54482491">Selenium</a> you need to:</p> <ul>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: outline-offset animation for bouton CSS<p>How can I do this animation?</p> <p><a href="https://i.stack.imgur.com/8xIyh.gif" rel="nofollow noreferrer" title="...
<p>This should help you:</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-css lang-css prettyprint-override"><code>.orange-button { /*This is your basic style for your button*/ width: 137px; height: 35px; back...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding 25% to Column in Excel<p>I have a CSV file that I want to adjust pricing. How would I add 25% to the price column. It has 1700 products on it so doing...
<p>try:</p> <pre><code>=ARRAYFORMULA(IFERROR(IFERROR(REGEXEXTRACT(A1:A&amp;&quot;&quot;, &quot;(\[.+\])\d+(?:.\d+)?&quot;))&amp; (REGEXEXTRACT(A1:A&amp;&quot;&quot;, &quot;\d+(?:.\d+)?&quot;)+ REGEXEXTRACT(A1:A&amp;&quot;&quot;, &quot;\d+(?:.\d+)?&quot;)*0.25))) </code></pre> <p><a href="https://i.stack.imgur.com/ei...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to update vertex of mesh in three.js after rotation?<p>I'm working in 1.4.2 three.js version. I rotate mesh and want to get it updated vertexes. Here is ...
<p>Since the goal is to calculate the angle between two planes, a better solution than looking at the position attribute is to create a vector representing the plane and apply the same rotation to the vector. There is already a solid answer for this here: <a href="https://stackoverflow.com/a/45309019/4536210">https://s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the percentage of a color in an image using OpenCV and Python<p>So I have this python script that detects and print a range of HSV color in an image ...
<p>OpenCV arrays create a mask that uses the value 255. A simple way to get the percentage of green is simply implement the following code after you generate the mask.</p> <pre><code> green_perc = (mask&gt;0).mean() </code></pre> <p>A more thorough explanation was asked about why this works. When OpenCV creates ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting 'Alphabetically' (Alien Dictionary Code Problem)<p>I've started tackling coding problems to try and improve my skills.</p> <p>I'm working on the 'Ali...
<p>In order to implement the <code>getRule</code> function if there is no implicit rule for <code>{a, b}</code>, you should search for <code>{a, x} = '&gt;'</code> where <code>{x, b} = '&gt;'</code> or <code>{a, x} = '&lt;'</code> where <code>{x, b} = '&lt;'</code></p> <pre><code>// in case if a &gt; b, you search for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SonarCloud Could not import unit test report TRX Unrecognized root element <TestRun><p>I'm new to testing and i'm trying to run my unit tests and coverage fo...
<p>Turns out i had to change at <code>extraProperties</code> the <code>sonar.cs.nunit.reportsPaths</code> to <code>sonar.cs.vstest.reportsPaths</code></p>
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 add priority to plugins having translations?<p>We're using the <code>Shopware Language Pack</code> plugin to get more translations, but som...
<p>When you look at the <code>DbalKernelPluginLoader</code> you can find that plugins are sorted by the <code>installed_at</code> column of the table <code>plugin</code>. This is also the order they are loaded in. So you may change the date of that field to change the order. Unfortunately as of today there is no option...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use the reference type efficiently to access a document in Cloud Firestore?<p>So basically what I am trying is, access a document throught a reference...
<p>The value that the SDK gives you back for a <code>DocumentReference</code> field type in the database is actually a <code>DocumentReference</code> object from the SDK too. So you can just call <code>get()</code> on the value you get, to get a snapshot of the references document data.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any suggestions on how to call a method in main activity after pressing a notification button?<p>I am trying to update a recycler view, which I can update wi...
<p>You can use another broadcast to communicate with Main Activity and update notification when main activity is active</p> <pre><code> // broadcast val br: BroadcastReceiver = object:BroadcastReceiver(){ override fun onReceive(context: Context?, intent: Intent?) { if (intent?.action == UPDAT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set masked values within each group in groupby context using py-polars<p>Since <code>rank</code> does not handle null values, I want to write a <code>...
<p>I propose a solution that is minimally invasive to existing code, requires no changes to the Polars API, and allows masking for a wide variety of Expressions.</p> <h2>Decorator: Maskable</h2> <p>The decorator below is one easy way to add masking capabilities to any suitable Expression. The decorator adds two keywor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redirect to login page after logout<p>I'm kind of new to React stuff, I've been playing with it for like a week, and I'm stuck at pretty simple thing I think...
<p>Hooks are not working in the class component, if u want to use you can wrap it in a HOC.</p> <pre><code>function withNavigation(Component) { return props =&gt; &lt;Component {...props} navigate={useNavigate()} /&gt;; } </code></pre> <p>and then</p> <pre><code>class BlogPost extends React.Component { redirect(){...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xcode yarn: command not found<p>I received an error when I build the app on Xcode:</p> <pre><code>/bin/sh: yarn: command not found make: *** [LocalMediaPicke...
<p><code>yarn</code> is installed in a location that isn't in the <code>PATH</code> used by the build phase scripts. There's two ways I can think of to change the script so it should work.</p> <hr /> <p>Before calling <code>yarn</code>, add the path containing the executable to the <code>PATH</code> the script will use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add to junction table of many-to-many relationship in MVC?<p>I am having trouble adding to and accessing the junction table in my MVC project. Current...
<p>You can try the code like below:</p> <pre><code> var project = new ProjectModel { Name = Name, Description = Description, Status = Status, ClientCompany = ClientCompany, ProjectLeader = ProjectLeader }; //db.Projects.Add(project); //...