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: Combining different data frames with ID column<p>I have the follwing data frames Data1 region 1</p> <pre><code>SID chr beta pval Rs500 21 0.45 0.005 </code>...
<p>First label your regions so that you can tell which region the data comes from.</p> <pre><code>data1$region &lt;- 'Region 1' data2$region &lt;- 'Region 2' data3$region &lt;- 'Region 3' </code></pre> <p>Then combine:</p> <pre><code>rbind(data1, data2, data3) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a regular expression that replaces strings in quotes with empty strings<p>How can I create a regular expression that finds the text wrapped in <code...
<p>Use <code>&quot;&quot;&quot;|'''</code> as delimiters (with a <code>\1</code> back-reference for the closing one), a non-greedy match-all (<code>.*?</code>) and the <code>s</code> (dot-all) and <code>g</code> (global) flags.</p> <p>Remove leading and trailing white-space with <code>trim()</code>.</p> <p><div class="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Array to dataframe with Longitude, Lattitude coordinates<p>Imported Libraries</p> <pre><code>import pandas as pd import numpy as np import matplotlib...
<p>The error means that Pandas can't organize your data into a table. By definition, tables have 2 dimensions (rows and columns), but the data you passed has 3 dimensions: 1000, 1000 and 4.</p> <p>To make it work, you should reshape the data to 2 dimensions.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine the number of terms by year in Google Sheets<p>I have two tabs in my Google Sheets file. One of these tabs contains our guests' data.</p> <p><img s...
<p>Use this formula in cell B3 and expand over the other cells:</p> <pre><code>=count(filter(Adatok!$C:$C;year(Adatok!$D:$D)=B$2;Adatok!$E:$E=$A3)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retry only requests that resulted in 500 and did it below given time threshold?<p><strong>Tech stack</strong>: <code>rx-java</code> 1.1.x, <code>retro...
<p>I have been able to implement a working solution. To measure the Observable's time I chose Spring's <code>StopWatch</code>, started counting in <code>doOnSubscribe()</code> and stopped in <code>doOnTerminate()</code>.</p> <p>I create the StopWatch and pass it to my custom retry function used in <code>retryWhen()</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenCV imshow fails with src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow'<p>Code for operating my camera is giving me images as signed ...
<p>I added your error message for you. It says:</p> <p><code>/opencv/modules/highgui/src/precomp.hpp:155: error: (-215:Assertion failed) src_depth != CV_16F &amp;&amp; src_depth != CV_32S in function 'convertToShow'</code></p> <p>That means <code>imshow</code> <em>does not</em> accept 32 bit signed integers (nor does i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extend nonlinear curve beyond supplied data in google sheets<p>I have a plotted spectral curve in google sheets. All points are real coordinates. As y...
<p>I understand that you want The curve should be increased beyond the given data in a mathematically sound fashion until it approaches 0, In what follows, I'm going to show how it's done with the <strong>last 2</strong> data points which make the filled data <strong>linear</strong> it might help, like this: take a loo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CollectionSizeQuota and DocumentQuota in Cosmos DB SDK v3<p>I am currently working on migrate Azure Cosmos DB sdk v2 to v3. In my previous codes, there are s...
<p>These are available as part of headers with container operation. You will need to enable <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.containerrequestoptions.populatequotainfo?view=azure-dotnet" rel="nofollow noreferrer">PopulateQuotaInfo</a> in the request and use the header values li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the minimum, maximum and average value of all property of array of objects<p>I have an array of objects with different values in it, I want to fi...
<p>I have followed a two step process -</p> <ol> <li>Group the values of each property (using <code>reduce</code> for this)</li> <li>Loop through all the properties and compute the required result.</li> </ol> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="sn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: model form has no attribute 'cleaned_data'<p>I want to sign in to be able to use the site. However, I'm having a problem: 'LoginForm' object has no attribute...
<p>is_valid is a function. <a href="https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.is_valid" rel="nofollow noreferrer">https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.is_valid</a></p> <p>You should call it.</p> <pre><code>if form.is_valid(): </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I edit my code to concurrency using in Go?<p>I have a function <strong>getIPSetInfo</strong> that makes HTTP requests as many times as there are elem...
<p>Maybe this could help</p> <pre><code>func getIPSetInfo(ipsetIds []string) []IpsetInfo { mu := &amp;sync.Mutex{} var wg sync.WaitGroup var result []IpsetInfo call := func(val string){ defer wg.Done() url := &quot;https://api-cloud-platform.com/cloudapi/1.0.0/firewall...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple JWT Usage<p>I have my Django backend authentication working (tested using curl and postman), but something eludes me. When sending test requests, the ...
<p>I think you define the two fields when you create your custom user model by inheriting from the <code>AbstractUser</code> model.</p> <pre><code>class CustomUser(AbstractUser): USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['email'] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enable HTTPS with certobot/letsencrypt on Amazon Linux 2 with nginx<p>Install certbot/letsencrypt on Amazon Linux 2 and enable HTTPS on nginx (similar...
<h2>Install certbot</h2> <pre><code>sudo yum update sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum-config-manager --enable epel sudo yum install certbot python3-certbot-nginx certbot --version </code></pre> <hr /> <h2>Generate certification</h2> <p>Use the following com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KafkaConsumer loses some alarms which are in others environments<p>I have facing and issue related whit a KafkaConsumer, our scenario is the following we hav...
<p>Please, learn in details what is really a Consumer Group. In few words: it means that one instance in the group is going to consume from a subset of topic-partitions at a time. All other instances may consume from the same topic, but only will read from different partitions - partitions do not overlap.</p> <p>So, si...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Pass Variables to Javascript from C# using Invoke?<pre><code>private void WebBrowser_Clicked(object sender, RoutedEventArgs e) { wb.Navigate(&quot;C...
<p>It takes some time until the <code>WebBrowser</code> control has loaded the page so that it knows the Javascript function. Instead of calling the function directly after the load, use a handler for the <code>LoadCompleted</code> event to run the function, e.g.:</p> <pre><code>public MyForm() // This is the construct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating dummy variables as counts using tidyverse/dplyr<p>Let's say I have some data as follows:</p> <pre><code>ID FRUIT 001 apple 002 grape 001 ban...
<p>using <code>reshape2</code> but you could pretty much use any package that lets you reformat from long to wide</p> <pre><code> library(reshape2) df = dcast(fruitData,ID~FRUIT,length) &gt; df ID apple banana grape 1 1 2 1 0 2 2 1 0 1 3 3 1 0 0 </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the difference between "int x = (int) x" and "x = (int) x" in java if I assign "double x = 2.3"?<p>if I assign &quot;double x = 2.3&quot;, what is th...
<p>You're re-declaring <code>x</code>, so in the line</p> <pre><code>int x = (int)x </code></pre> <p>The <code>x</code> on the right is not the same <code>x</code> you previously declared. So its value defaults to 0 so <code>(int)x</code> is 0. You normally wouldn't be able to have two <code>x</code> variables. That's ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to append subdirectories to a list in python<p>I would like to know how I can only append sub-directories of a given directory to a list in Python.</p> <...
<p>Just use the dirs variable instead the files variable, like this:</p> <pre class="lang-py prettyprint-override"><code>dirs_list = [] for root, dirs, files in os.walk('test'): for dir in dirs: dirs_list.append(os.path.join(root, dir)) print(dirs_list) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get useEffect to run on array sort?<p>I have an object like this</p> <pre><code>const example = [{medicineName : &quot;Some name&quot; medicineI...
<p>The following line changes the <code>filteredMedicineList</code> directly and still React sees the old reference to the array which does not make trigger the React rerendering.</p> <pre><code>filteredMedicineList.sort(compareFunction); </code></pre> <p>You need to use <code>setFilteredMedicineList</code> to make cha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avalonia SaveFileDialog freezes app, but OpenFileDialog works fine<p>I'm trying to open a <code>SaveFileDialog</code> from a ReactiveCommand in Avalonia.</p>...
<p>I think freezing in your code is caused by <code>Result</code>. Try to switch to <code>async/await</code> for both dialogs:</p> <pre><code>var dlg = new SaveFileDialog(); var result = await dlg.ShowAsync(this); </code></pre> <p>You'll probably need to use <code>CreateFromTask()</code> instead of sync <code>Create()<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Usage of __setattr__ to rewrite whole method of library class issue: missing 1 required positional argument: 'self'<p>I've got some imported packages with tr...
<p>Both your snippets and question are quite messy, almost to the point of being unreadable.</p> <p>Anyway, if you wantt to replace <code>method1</code> with another function, say <code>new_method1</code> in an specific instance, just do that. Your call to <code>.__setattr__</code> does that, but it is not needed at al...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get all inherited classes<p>Let's imagine that we have a class called <code>A</code>, and this class is inherited from class <code>B</code>, and also ...
<p>Try this code:</p> <pre><code> Type type = typeof(C); while (type.BaseType!=null) { type = type.BaseType; Console.WriteLine(type.Name); } // C // B // A // Object </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Terraform Invalid for_each argument local will be known only after apply<p>I would like to create an AWS account with SSO Account Assignments in the same fir...
<p>The important thing about a map for <code>for_each</code> is that all of the keys must be made only of values that Terraform can &quot;see&quot; during the planning step.</p> <p>You defined <code>local.assignment_map</code> this way in your example:</p> <pre><code> assignment_map = { for a in var.account_assign...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I target a specific RDS instance within a cloudwatch alarm using Terraform?<p>I'm trying to create a CloudWatch alarm for CPUUtilization on an RDS Ins...
<p>You're missing the <code>dimensions</code> attribute on your <code>aws_cloudwatch_metric_alarm</code> resource. You would most likely get an alarm that is perpetually in &quot;Insufficient Data&quot; status from that.</p> <p>You need to add the <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/dimensio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How typing objects inside a iterable?<p>I want to type a list of objects in a function, but the list dont has a fixed length. For now, I type the list:</p> <...
<ul> <li>If you want all list elements to be the same type, use <code>(var: List[MyModel])</code></li> <li>If you need it to have multiple types inside, use <a href="https://docs.python.org/3/library/typing.html#typing.Union" rel="nofollow noreferrer">Unions</a></li> <li>If you don't know all types that will appear ins...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Databricks - Writing CSV as a Parquet folder even when specified as a CSV file<p>I have some code performing some ETL which is working perfectly fine with Da...
<ul> <li><p>Using Pyspark <code>DataFrame.write()</code> <strong>always creates a folder</strong> and within are the required files. Your data (when large) is often repartitioned and written as multiple files inside this folder and these are called <code>part files</code>.</p> </li> <li><p>So, to write data as a single...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I coalesce Pandas columns only where the beginnings of the columns don't match?<p>I have a table with some company information that we're trying to cl...
<p>You can start by creating another column that contains the length of your <code>Name</code> column. This is really straight-forward. Let us call the new column <code>Slicers</code>. What you can then do is to create a function that slices a string by a certain number and map this function to your columns <code>Info<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error with linking containers in docker-compose<p>I am trying to build an image and a container of a application with docker compose. However when i try to l...
<p>Compose <code>links:</code> are an obsolete feature. In even vaguely modern Compose – any Compose file with a top-level <code>services:</code> block – Compose will automatically create a Docker network for you and attach all of the services to it. You can almost always safely delete <code>links:</code> without los...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get my character to stick on walls<p>I'm fairly new to programming and am currently working on an 2D Android game using Unity. I want my character t...
<p>You could use the oncollisionenter or ontriggerenter method to know when you are in contact with a wall.<br /> At that point it depends on how you created the movement and jump system: for example if you used rigidbody, you can set its property on iskinematic to true.</p> <p>For the methods and properties I mentione...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse flat-file (positional text-file) to read the wavelength<p>I have the next txt with data:</p> <pre><code>FI R 83.0000m 34.960 1.1262 Fe ...
<p>I think you are better off using regex</p> <p>Example:</p> <pre><code>import re text = '''FI R 83.0000m 34.960 1.1262 Fe 2 1.32055m 33.626 0.0522 N 2 5754.61A 33.290 0.0241 TI R 1800.00m 33.092 0.0153 Fe 2 1.24854m 32.645 0.0054 N 2 9...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calcuate item quantiy from array of object if the itemid is same and how to sum up those quantity whose date are same too<p>I have data in this format...
<p>This can be done efficiently using a map, and a new output array. In the map, we will store the key as itemId and value as its index in the output array. Then we will loop through the data, and see if the itemId has an index in the map, if it is we will look up that item value from output array, and update the curre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas delete rows after condition in column "A" until confition in column "B"<p>How do you remove each row after each &quot;close_condition&quot; == 1 until...
<p>You could create a &quot;running close flag&quot; that resets to <code>0</code> every time it encounters an <code>open_condition</code></p> <pre class="lang-py prettyprint-override"><code>df['rcf'] = [c if o else np.nan for (o, c) in zip(df['open_condition'], df['close_condition'])] df['rcf'] = df['rcf'].fillna(meth...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NetworkXError: Adjacency matrix not square: nx,ny=(737, 39)<p>How can I solve this error?</p> <pre><code>import networkx as nx df=pd.read_excel('peso-ao-nasc...
<p>Adjacency matrices must be square because the &quot;index&quot; of the rows and columns are from the same set, the set of the nodes in the graph.</p> <p><a href="https://en.wikipedia.org/wiki/Adjacency_matrix#:%7E:text=Adjacency%20matrix,-From%20Wikipedia%2C%20the" rel="nofollow noreferrer">From Wikipedia:</a></p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java Streams - How to preserve the initial Order of elements while using Collector groupingBy()<p>I'm trying to convert a <em>list</em> of objects into a <em...
<blockquote> <p><code>groupingBy()</code>, the return value is a map and that map output a different order of values list</p> </blockquote> <p>You can use another flavor of <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/Collectors.html#groupingBy(java.util.function.Function,java....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in upset_data : unused argument (nsets = 5) What could be causing this and how coul I fix the issue?<p>I am very new to R and I would like to make UpSe...
<p>It looks like you might be mixing up packages. You are trying to use <code>upset_data</code> function from <code>ComplexUpset</code> package, but passing <code>nsets</code> argument which works with <code>upset</code> from <code>UpSetR</code> package. I would recommend taking a closer look at which functions you use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why couldn't I encrypt and decrypt a photo file using increments?<p>I made a very simple encryption and decryption program to encrypt files by incrementing a...
<p>This part needs to be changed to a <code>else</code> :</p> <pre class="lang-py prettyprint-override"><code>if btAr[n] &lt;= 249: btAr[n] = btAr[n] + increment if 249 &lt; btAr[n] &lt;= 255: btAr[n] = btAr[n] - 250 </code></pre> <p>Like this :</p> <pre class="lang-py prettyprint-override"><code>if btAr[n] &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Snapshot identifiers in git?<p>I'm a bit confused. Is there a way to put down some dedicated snapshots, labels on a branch in git? I know, every commit is sn...
<p>I would suggest that you use <code>git tag</code> during the creation of specific code that is linked to some feature.</p> <p>You can read more about this at <a href="https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag" rel="nofollow noreferrer">https://www.atlassian.com/git/tutorials/inspecting-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheet SUMIF across range of cells<p>I am trying to use a formula in google sheets to find averages based on the contents of a different cell.</p> <p>B...
<p>Try</p> <pre><code>=AVERAGEIF($E$2:$H$2,B$1,$E3:$H3) </code></pre> <p><a href="https://i.stack.imgur.com/pOz8g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pOz8g.png" alt="enter image description here" /></a></p> <p><a href="https://support.google.com/docs/answer/3256529" rel="nofollow noreferr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Upload image file with Sweetalert2 and Expressjs<p>I want to upload image to my server with SweetAlert2 and Expressjs.</p> <p>When I use HTML input with name...
<p>Your backend expects an file named <code>file</code></p> <p>You can use <code>FormData</code></p> <pre><code>let formdata = new FormData() formdata.append('file', file) </code></pre> <p>Then you send it. Also to note here, your request isnt <code>application/json</code>.</p> <p>make sure not to set the Content-Type ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a dataframe from existing data frame where few column are appended as rows?<p>I have a data frame like below:</p> <pre><code>data = {'Age': [20...
<p>You can use <a href="https://pandas.pydata.org/docs/reference/api/pandas.wide_to_long.html" rel="nofollow noreferrer"><code>wide_to_long</code></a>:</p> <pre><code>(pd .wide_to_long(df1.reset_index(), stubnames=['city', 'country'], i=['index', 'Age'], j='id') .droplevel(-1) .reset_index('Age') ) </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get columnName from first occurrence in range<p>I have a project that includes monthly usage data in 12 columns. The column names are dates (2014-01-01) and ...
<p>I ended up figuring this out on my own and thought I'd put the answer here in case this can help anyone in the future.</p> <p>This returns the index of any cell in the range with a value &gt;0 (Note: The index returned here is for the array defined in the get() call <em>not</em> the column index for the project as a...
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 dynamically negate the List in Python<p>I require to generate two reports (Report 1 and Report 2) both are similar in every way except the ...
<p>Sure. Add an additional flag as your &quot;some parameter&quot; and compare the result of the is-in-list test to that:</p> <pre><code>must_be_in_list = True ... is_in_list = (x in [p1, p2]) check_passes = (is_in_list == must_be_in_list) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Serialization Exception in Apache Spark and Java<p>I had a task for creating a POC for Apache Spark w/Springboot. I created a controller for getting my data ...
<p>Please add <code>implements Serializable</code> in the classes that you are serializing. Here, Profile is a sub-object for the Member, so you need to Serialize both classes to make your code executable. I am illustrating this for the member class below:</p> <pre><code>public Member implements Serializable{ ... }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I display my HTTP response in a list view flutter/dart<p>How do I display my response which is currently separated by commas in like a list view and p...
<pre><code>ListView.builder( itemCount:message.length, itemBuilder:(context,index){ return Text(message[index]); } </code></pre> <p><strong>this is how you can show the data is listview</strong></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an easy way to multiply each element with each other in array / list - Kotlin?<p>I have got <code>{1,2,3}</code> / or it might be a <code>list&lt;In...
<p>This should work, given that you probably don't want to include the duplicates like <code>items[i] * items[j]</code> and <code>items[j] * items[i]</code></p> <pre class="lang-kotlin prettyprint-override"><code>val items = listOf(1, 2, 3, 4) val result = items.flatMapIndexed { index, a -&gt; items.subList(inde...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetching String Value in React from a Spring Boot backend<p>I am trying to fetch a string value from a spring boot api which is hosted on localhost:8080 usin...
<p>Your JavaScript client is expecting JSON format, but your Spring Boot backend is just returning a String &quot;Hello World!&quot;. That is the reason JSON parse Syntax error.</p> <p>Try returning a String, which contains JSON format.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shiny - updateTabsetPanel - Change the selected tab on the client<p>On home page of the app we have 2 valueBox. What I need is to make them clickable(work as...
<p><em>EDIT: I did not properly read your question. I've modified the code to fit your request about updating the inner tab of tab 1 to summary.</em></p> <p>In the <code>ui</code> object, you can wrap an output in a <code>actionLink</code> and then attach a observer to the link that updates the tab using <code>updateTa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use p5/js serial library in google Colab<p>I am trying to use p5.SerialPort in google colab. Using p5(link ahead) everything works fine, I think my pr...
<p>You will need to include p5.js and p5.serialport.js first.</p> <p>After that it will take a bit of time until the scripts are loaded and ready to use. Athough it's a bit hacky, checking with <code>setInterval()</code> should do the trick.</p> <p>Here's a basic colab Python script to test:</p> <pre class="lang-py pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting Elements in a List Based on Values<p>I have a dictionary and I need the keys to be sorted according to their corresponding values. But the keys shoul...
<p>I don't think the heap is necessary here:</p> <pre><code>lookup_set = set(sorted(val.keys(), key=lambda x: val[x], reverse=True)[:3]) [i for i in val if i in lookup_set] </code></pre> <p>First creating a set of wanted keys, then filtering val.keys() to get the correct order.</p> <p>yields:</p> <pre><code>['c', 'd', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does the inline assembly in this compare-exchange function work? (%H modifier on ARM)<pre><code>static inline unsigned long long __cmpxchg64(unsigned lon...
<blockquote> <p>I find in gnu manual(extend extended-asm) that 'H' in '%H1' means 'Add 8 bytes to an offsettable memory reference'.</p> </blockquote> <p><a href="https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86-Operand-Modifiers" rel="nofollow noreferrer">That table of template modifiers</a> is for x86 only. I...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CUDA optimise number of blocks for grid stride loop<p>I have started implementing a simple 1D array calculation using CUDA. Following the documentation I hav...
<p>Conventional wisdom is that the number of threads in the grid for a grid-stride loop should be sized to roughly match the thread-carrying capacity of the GPU in question. The reason for this is to maximize the exposed parallelism, which is one of the 2 most important objectives for any CUDA programmer. This gives t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is this correct use of pointer and memory allocation<p>so This is my code that allocate 0th and 2ed string in 2-d array (list of strings, or a bucket) So I l...
<p>In general the code is unsafe because the second element stays uninitialized.</p> <p>At least you should write</p> <pre><code>a[1] = NULL; </code></pre> <p>For example this allows to free the allocated memory in a loop.</p> <pre><code>for ( size_t i = 0; i &lt; 3; i++ ) { free( a[i] ); } free( a ); </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to change the color<p>I want help in modifying this code, as I want to add a color to these three names <strong>TIME</strong> &amp; <strong>Date</stro...
<pre><code>&lt;?php date_default_timezone_set(&quot;Africa/Cairo&quot;); // فرق التوقيت Tunis echo &quot;&lt;span style='color:red;'&gt;TIME&lt;/span&gt; : &quot; . date(&quot;h:i:sa&quot;). &quot;&lt;br&gt;&quot;; // مسافه echo &quot;&lt;span style='color:purple;'&gt;Date&lt;/span&gt; : &quot; . ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace every non letter or number character in a string with another<p><strong>Context</strong></p> <p>I am designing a code that runs a bunch of calculatio...
<p>Your point (1) is opinion based so you might get a variety of answers, but I think a common convention is to at least start the name with a reverse-order date string so that sorting alphabetically is the same as sorting chronologically (i.e. <code>yymmddHHMMSS</code>).</p> <p>To answer your main question directly, y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to auth into AppSync GraphQL api from Lambda using IAM and AppSyncClient<p>I'm using an amplify stack and need to perform some actions to my graphql a...
<p>Found the solution, there seems to be an issue with triggering a rebuild of the resolvers on the api after permitting a function to access the graphql api. However there is a distinction to note:</p> <ol> <li><p>If the graphql api is part of an amplify app stack, then only functions created through the amplify cli f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mapping canvas LinearGradient to an image<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet...
<p>A simplistic way of getting rid of the gradient bar across the top once it is no longer needed is to overwrite it with white when you have finished using it.</p> <p>The size of the final image is set with w and h variables and this snippet increases them from 50 to 300 so the image is still within the canvas.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why TypeScript doesn't support Type.property in addtion to Type['property']<p>why TypeScript doesn't support <code>Type.property</code> in addtion to <a href...
<p>According to Typescript maintainer Ryan Cavanaugh, this is working as intended.</p> <p>See this GitHub issue: <a href="https://github.com/microsoft/TypeScript/issues/30815" rel="nofollow noreferrer">https://github.com/microsoft/TypeScript/issues/30815</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding datatables/dataframes in an excel(to different sheets) dynamically in R<p>Please let me know if there are any methods in R to add Datatables/Dataframe...
<p>Try this:</p> <pre class="lang-r prettyprint-override"><code>library(openxlsx) mywb &lt;- createWorkbook(&quot;Fred&quot;) found &lt;- Filter(exists, c(&quot;df1&quot;, &quot;df2&quot;, &quot;df3&quot;)) for (nm in found) { addWorksheet(mywb, nm) writeData(mywb, sheet = nm, get(nm)) } saveWorkbook(mywb, &quot;my...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How should I programmatically change only certain NA values to a specified string of my choosing in R?<p>So for part of the internal R&amp;D project I'm work...
<p>We may use a group by approach - grouped by 'SSID', loop over all the columns (<code>everything()</code>) in <code>across</code>, then check <code>if</code>, <code>all</code> the values are <code>NA</code>, then replace with <code>&quot;BMNDITS&quot;</code> or <code>else</code> return the character converted value (...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python Path from pathlib module doesn't add path separator<p>I have the following issue using Path from the pathlib library:</p> <pre><code>from pathlib impo...
<p><code>Path</code> cannot assume how the result will be used further, so it constructs the path object from the input data as is.</p> <p>I will demonstrate with examples.</p> <p>To begin with, prepare the directories in <code>/tmp</code>:</p> <pre class="lang-bash prettyprint-override"><code>zyzop@localhost:~$ cd /tm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have a problem with Blazor with authentication,<p>I have a problem with Blazor with authentication, I created a new Blazor WebAssembly project, Authenticat...
<p>replace</p> <pre><code>builder.Services.AddHttpClient(&quot;BlazorApp6.ServerAPI&quot;, client =&gt; client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)) .AddHttpMessageHandler&lt;BaseAddressAuthorizationMessageHandler&gt;(); </code></pre> <p>with</p> <pre><code>builder.Services.AddScoped(sp =&gt; new ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get elements randomly retrieve from another table B with data table<p>I have a table A of data.table type which contains a set of elements, I would like to a...
<p>Here's one way,</p> <pre class="lang-r prettyprint-override"><code>set.seed(42) tableA[tableB[, list(mass = list(mass)), by = element], mass := sapply(i.mass, sample, size = 1), on = .(element)] tableA # element mass # &lt;char&gt; &lt;num&gt; # 1: silver 0.3 # 2: chlorine 1.2 # 3: silver 0.3 # 4...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In bootstrap want table to be same width when displaying with/without collapsible elements<p>In bootstrap 5 I would like table to be displayed same width whe...
<p>Similar to the answer by @Cervus, you are having this issue as uncollapsing changes the width of the element which has no constraints reshifting things around, to fix this you'd want to set a forced width to the column to do this with bootstrap you can use rows and cols as shown:</p> <p><a href="https://codepen.io/r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: executable do not run after static linking with library<p>In my Makefile, I have tried build a code static linking with a library from another project I have...
<p>The issue was in fact in the way I was building the library. I change the Makefile from this:</p> <pre><code>libnetpbm: ${obj_dir}/netpbm.o ${obj_dir}/bitmap.o ${obj_dir}/graymap.o ${obj_dir}/pixmap.o g++ -g -shared -o ${release_dir}/libnetpbm.so ${obj_dir}/netpbm.o ${obj_dir}/bitmap.o ${obj_dir}/graymap.o ${obj...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is something wrong with my tasks.json settings?<p>I've been trying to use VSCode's tasks.json settings to automate the compiling process of my code. When I r...
<pre class="lang-json prettyprint-override"><code>&quot;executable&quot;: &quot;C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/LaunchDevCmd.bat&quot; </code></pre> <p>This above launches cmd.exe in the terminal of Visual Studio Code. Since <code>LaunchDevCmd.bat</code> never finishes, the queued ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making a function in a struct template<p>So i made a template struct cause i want to be able to decide what type i give to my <code>val</code>. But when crea...
<p>A template function is a way to operate with generic types (you may consider the type as an argument). Your template parameter <code>T</code> allows to pass different types to a function when you invoke the function (which means, simply said, you may replace <code>T</code> with some other types <code>int, double</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix a URL colon error that changes colon to %3a<p>I have a URL as below</p> <blockquote> <p>components.host = &quot;37.143.66.25:9875&quot;</p> </bloc...
<p>Add host and port separately, like (assuming <code>components</code> is <code>URLComponents</code>)</p> <pre><code>components.host = &quot;37.143.66.25&quot; components.port = 9875 </code></pre> <p>otherwise it thinks that your port is part of host name</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If a player doesn't own a gamepass, then prompt it via ScreenGUI not working?<p>I'm trying to make a localscript for a <strong>TextButton</strong> so that wh...
<p>You've made a simple mistake of calling <a href="https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PromptGamePassPurchase" rel="nofollow noreferrer">PromptGamePassPurchase(player, gamePassId)</a> the same way as <a href="https://developer.roblox.com/en-us/api-reference/function/Marketplace...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chain of RxJava calls<p>I am new to RxJava. I am struggling with chaining multiple API calls. The class structures are as follows:</p> <pre><code>Location(lo...
<p>You would need to use few RxJava operators in order to accomplish it, you can nest them in order to keep track of the values that you will need in order to create the HubItem</p> <pre><code> val hubItems: Single&lt;List&lt;HubItem&gt;&gt; = Observable.fromIterable(locations) .flatMap { location -&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: T-test of gridded (3-D) data in Python<p>I have two sets of gridded (NetCDF) data with dimensions: <strong>Time</strong>, <strong>S-N</strong>, <strong>W-E</...
<p>You can perform paired t-test using <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_rel.html" rel="nofollow noreferrer"><code>scipy.stats.ttest_rel</code></a>. It takes in two <code>numpy</code> arrays (to which <code>xarray</code> <code>DataArrays</code> natively converts) and compar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why isn't this code working? It works when I use dot operator, instead of ->operator and pointers<pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt...
<p>The definition <code>struct stack * s;</code> is an uninitialized pointer. You follow this definition immediately by assignments to the memory it points to, which can literally be anywhere. As a result it's undefined behavior. It's very likely your program will crash, but other strange things can happen too. It mig...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tableview cell extra swift<p>I have an tableview with array</p> <pre><code>var scheduledShootsArray = [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;e&quot...
<p>This is because although they are not filled with data by default <code>UITableView</code> wil always show separators. You can solve this in a few ways</p> <p><strong>Solution 1</strong>: Add clear footer to your tableview</p> <pre><code>func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Binding click event with multiple css style in Angular<p>How do I bind <strong>multiple css class</strong> to the click <strong>event</strong> of Submit butt...
<p>You can define two different state objects :</p> <pre><code>export class AppComponent { baseState = { style1: true, style2: true } activeState = { style1: false, style2: false } active = false; } </code></pre> <p>HTML</p> <pre><code>&lt;div class=&quot;mainbody&quot; [ngClass]=&quot;active ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return a Cell from a Pandas Dataframe based on other values<p>I have the following dataset in a Pandas Dataframe:</p> <div class="s-table-container"> <table ...
<p>You can use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html" rel="nofollow noreferrer"><code>.loc[]</code></a>:</p> <pre><code>df.loc[(df['Year'] == 2021) &amp; (df['Month'] == 1), 'Total'] </code></pre> <p>Which will give you:</p> <pre><code>0 1875.1 Name: Total, dty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keyboard event fires twice even when using !event.repeat<p>I've been making an online piano that uses the keyboard as input. Sometimes when you press a key, ...
<p>I am preeeeeeeety sure this is a severe javascript bug, I was able to reproduce the problem, for example you press and keep holding Q and then you press and keep holding W, then you release only Q while still holding W, it will fire a W event.</p> <p>Here's what I did, I create an array of pressed keys, and the resp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert numpy.ndarray to string and then find substring from each element of the array using a delimiter<p>Code Snippet: Year_Start_End = data_copy.Ye...
<p>I think your problem is to extract the actual string value from you raw string, so first you have to do it with regex (suppose your raw string exactly the same as in your question). And then since this you can then just do the basic string split-recombine method.</p> <pre class="lang-py prettyprint-override"><code> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the seven segment output side by side in python?<p>I have written a code to display the seven segment output. Whereas I need to display the output...
<p>Try the following:</p> <pre class="lang-py prettyprint-override"><code>dict = {0:('###','# #','# #','# #','###'), 1:(' #',' #',' #',' #',' #'), 2:('###',' #','###','# ','###'), 3:('###',' #','###',' #','###'), 4:('# ','# ','###',' #',' #'), 5:('###','# ','###',' ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate handling time per user for every ticket based on timestamps and status changes<p>I have one table.</p> <pre><code>user_id | ticket_id | status | t...
<p>I have used similar query to wht is posted in question, with a few additions - Used qualify to select top row for each user_id Ignore rows with NULL timestamp difference. Used TO_TIME to convert integer value returned by timestampdiff back to time value.</p> <pre><code>with data_cte (user_id,ticket_id,status,timest...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to change Flutter's AutoComplete order in VS code?<p>I have a question. Is it possible to change Flutter's AutoComplete order in VS code?</p> ...
<p>If you have not typed any prefix and are seeing the &quot;full list&quot; of code completion, then the ordering is determined by the Dart analysis server. They should be sorted with &quot;relevant&quot; items at the top (where &quot;relevant&quot; is a computed score that takes into account a number of things).</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: flux query: filter out all records related to one matching the condition<p>I'm trying to filter an influx DB query (using the nodeJS influxdb-client library)...
<p>Ended up doing it in two queries. Still confused about the Strings vs Integers, but casting the value as an Int and printing out the array of <code>r[&quot;session&quot;]</code> within the query seems to work like this:</p> <p><code>'|&gt; filter(fn:(r) =&gt; not contains(value: int(v: r[&quot;session&quot;]), set: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML image is not displayed<p>My picture is not displayed. I've tried several browsers and different image formats. Unfortunately it doesn't always show up f...
<p>You need to open your body tag and the image needs a src attribute, not scr <a href="https://www.w3schools.com/tags/att_img_src.asp" rel="nofollow noreferrer">https://www.w3schools.com/tags/att_img_src.asp</a></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en &quot;&gt; &lt;head&gt; &lt;me...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't save computed values result in DataFrame<p>I'm building a dataframe which contains trading data from Yahoo Finance.</p> <p>When I'm trying to compute R...
<p>You need to slice the dataframe when assigning values</p> <pre><code>trading_df.loc[trading_df['Symbol'] == stock, 'Return'] = trading_df[trading_df['Symbol'] == stock]['Adj Close'].pct_change(1) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with `` within .replace() tags<p>How can I edit my current code to work with <code>``</code> within replace. As of current because it's inside a loop <...
<p>I'm guessing that your HTML looks something like this...</p> <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;pstad-descrptn-mirror&quot;&gt; &lt;div&gt; &lt;div&gt; &lt;div&gt; Take-away located in Brisbane, and comes with free chips &lt;/div&gt; &lt;/div&gt; &lt;/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio Flutter auto-suggestion does not show up for override methods<p>I am not able to override initState() or any other methods by simply typing it...
<p>This was a bug in Flutter 3.0.0 and fixed in Flutter version 3.0.2:</p> <p><a href="https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#302-june-10-2022" rel="nofollow noreferrer">https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#302-june-10-2022</a></p> <p>But there is still ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rolling Quarter Calculation by Month While Using Another Column to group by<p>I am trying to calculate rolling percentages for quarterly time periods. Sample...
<p>You can achieve that using <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/analytic-functions-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">Ordered Analytical Function</a>. The idea is to find cumulative sum.</p> <p>For Pivoting the data from row to column, you can use <code>CASE</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: install random module of Chicken Scheme<p>chicken-install random</p> <p>returns following errors.</p> <p>Server error:</p> <p>Error: [Server] no such extensi...
<p>There's no egg called &quot;random&quot;. See the <a href="https://eggs.call-cc.org/5/" rel="nofollow noreferrer">egg index</a>.</p> <p>However, there is a <a href="https://wiki.call-cc.org/man/5/Module%20(chicken%20random)" rel="nofollow noreferrer">(chicken random)</a> module that's included in the distribution (y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to switch from different instructions/rules in an elegant way<p>hoping for your help! I'm doing a java project that reproduces the logo language and im c...
<p>If a switch would work but you don't want the method to have too many lines, you could try using a map, either from String to method calls (for which you could use lambdas), or from Enum values to the same.</p> <pre><code>Map&lt;String, Runnable&gt; operations = Map.ofEntries( Map.entry(&quot;FORWARD&quot;, () -...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB Performance Issue with arrays<br /> I'm looking for some advice on how to improve the performance of my query. <p>I have this user model in mongoose ...
<p>Mongoose optimization:</p> <blockquote> <p>By default, Mongoose queries return an instance of the Mongoose Document class. Documents are much heavier than vanilla JavaScript objects, because they have a lot of internal state for change tracking. Enabling the lean option tells Mongoose to skip instantiating a full Mo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compiling CSV's dependent on Date<p>this is my first post so sorry about any mistakes.</p> <p>I'm currently trying to use Powershell to combine folders of cs...
<p>You're looking to <em>filter by</em> instead of <em>group by</em>, hence you would be using <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.2" rel="nofollow noreferrer"><code>Where-Object</code></a> instead of <a href="https://docs.microsoft.com/en...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mix 2 strings that do not have the same length?<p>I'm trying to mix two strings like this:</p> <pre class="lang-cs prettyprint-override"><code>string a1 = &q...
<pre><code> int maxIndex = a1.Length &gt; a2.Length ? a1.Length : a2.Length; for (int i = 0; i &lt; maxIndex; i++) { if(a1.Length &gt; i) builder.Append(a1[i]); if(a2.Length &gt; i) builder.Append(a2[i]); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Chat API. Can’t create space. Method not found<p>I'm trying to create a google chat space via making a post request to <em><a href="https://chat.googl...
<p>The <code>spaces.create</code> <a href="https://developers.google.com/chat/api/reference/rest/v1/spaces/create" rel="nofollow noreferrer">documentation</a> explains this at the top of the page:</p> <blockquote> <p>Developer Preview: Available as part of the Google Workspace Developer Preview Program, which grants ea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: modifying elements of getElementsByClass results in NaN<p>I am running into trouble with this script below, as I take a collection based on a class name and ...
<ul> <li><p>The main logic for below code is <code>toggle1.classList.contains(&quot;white&quot;)</code> this statement return true if toggle has class <code>white</code> else return false.</p> </li> <li><p>WIth DOM elements you can use this <code>classList</code> methods <code>classList.add()</code>,<code>classList.rem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I count the number of people speek in an audio file<p>I'm working in an audio project. My goal is to count the number of people who spokes in an audi...
<p>If I am correct you are looking for <code>speaker diarization</code>. In this thread someone listed a few options for python. <a href="https://stackoverflow.com/questions/7309219/python-speaker-recognition">Python Speaker Recognition</a></p> <p>Otherwise if you want to take the easier way, you can let google do it f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to skip loginScreen and passwordScreen after launch the app<p><strong>Hello i would like to know How to skip the loginScreen and the passwordScreen and m...
<p>In your <code>fun Nav()</code> you should check if you have credentials stored and then based on that you should set <code>startDestination</code></p> <p>for example:</p> <pre><code>@Composable fun Nav() { val context = LocalContext.current val navController = rememberNavController() val isLoginRequired = /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: [Vue warn]: Invalid prop: type check failed for prop "page". Expected Number with value 0, got String with value ""<p>Currently, I am doing a filter and rese...
<p>You need to make sure that the <code>props - :page</code> you are passing in the <code>VDataTable</code> has the matching type (in your case it should be <code>Number</code>.</p> <p>The root problem is you have defined the type as <code>Number</code> for the prop value but somehow a <code>String</code> is being pass...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check multiple rows in one dataframe present on another dataframe using python<p>My requirement is to check whether all the rows in one dataframe present on ...
<p><strong>Guess No. 1:</strong> You want a new row that identifies whether it occurs in another data frame. Then, you could do something like this:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np import pandas as pd df = pd.DataFrame({ 'NAME': ['AAA', 'BBB', 'CCC', 'CCC', 'DDD', 'AAA'], ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract text using regular expression<p>I'm trying to extract a case id from the string, Could someone help me with this</p> <p>https://looney-tunes/review/c...
<pre><code>import re s='https://looney-tunes/review/case/CAAAAAAAAR-hw7QEAAAAMf___-A?caseGroup=12&amp;queueId=52' x=re.search(&quot;(?s)(?&lt;=case/).*?(?=\\?)&quot;,s) </code></pre> <hr /> <pre><code>&lt;re.Match object; span=(33, 60), match='CAAAAAAAAR-hw7QEAAAAMf___-A'&gt; </code></pre> <p>In general, If you want a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prefetch with few filters for one related model<p>There is a table <code>Order</code>, which is connected to table <code>Signal</code> through <code>FK</code...
<p>You can use <a href="https://docs.djangoproject.com/en/4.0/ref/models/querysets/#django.db.models.Prefetch" rel="nofollow noreferrer"><code>Prefetch</code></a> objects to add additional attributes to the returned instances that contained custom prefetched querysets by passing the <code>to_attr</code> argument</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursion python - counting vowels in a string<p>The following code is from geeks for geeks - <a href="https://www.geeksforgeeks.org/program-count-vowels-str...
<p>Take a look at how these functions are evaluated:</p> <pre class="lang-py prettyprint-override"><code>countVowels(&quot;abc&quot;, 3) = countVowels(&quot;abc&quot;, 2) + isVowel(&quot;abc&quot;[2]) = (countVowels(&quot;abc&quot;, 1) + isVowel(&quot;abc&quot;[1])) + isVowel(&quot;abc&quot;[2]) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I use HTTP Basic Auth with http-client?<p>I want to use <a href="https://wiki.call-cc.org/eggref/5/http-client" rel="nofollow noreferrer">http-client<...
<pre><code>(define user &quot;user&quot;) (define pass &quot;pass&quot;) (determine-username/password (lambda (uri realm) (values user pass))) </code></pre> <p>See <a href="https://wiki.call-cc.org/eggref/5/http-client#authentication-support" rel="nofollow noreferrer">https://wiki.call-cc.org/eggref/5/http-client#...