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:
make the input value change without clicking button<p>I'm trying to make it give me the value that I put in at "summe:" when changing the numbers w... | <p>Use <code>querySelectorAll</code> to get references to both fields. And then <code>forEach</code> to apply event listener to both. Also as any points out the event you are looking for is <code>change</code>.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div cla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the appropriate strategy for using @MainActor to update UI?<p>Suppose you have a method that executes asynchronously in a global context. Depending o... | <p>Option 2 is logical, as you are letting functions that must run on the main queue, declare themselves as such. Then the compiler can warn you if you incorrectly call them. Even simpler, you can declare the class that has these functions to be <code>@MainActor</code>, itself, and then you don't have to declare the in... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
laravel heroku Vite manifest not found at: /app/public/build/manifest.jso<p>after uploading my project Laravel in Heroku say "Vite manifest not found at... | <p>okay , the solution is to add both nodejs and php buildpacks to the project before deployment (you can do this also after deployment but you have to redeploy the project)</p>
<pre><code>heroku buildpacks:set heroku/php
heroku buildpacks:set heroku/nodejs
</code></pre>
<p>and make sure you have the two buildpacks (ph... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Property 'prop' does not exist on type 'IntrinsicAttributes & CustomComponentProps'<p>I have a custom module in which I have an interface for <code>props</co... | <p>The issue was that <code>SharedProps</code> were being exported from a file called <code>SharedProps.ts</code>. Moving them to an <code>index.ts</code> file and making them the default export resolved the issue. My new folder structure now looks like this:</p>
<pre><code>├─example
│ └─src
│ └─App.tsx
├─lib
│ ├... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fillna with the average 3 values, based on several columns<p>I have a dataframe like the one below:</p>
<pre><code>month country prod sales units ... | <p>Try this</p>
<pre class="lang-py prettyprint-override"><code># average of the last 3 values for each country-prod pair with same index as df
filler = df.groupby(['country', 'prod'])['$/unit'].transform(lambda x: x.dropna().tail(3).mean())
# fill missing values by filler
df['$/unit'].fillna(filler, inplace=True)
df
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Insert query within for loop in PLSQL using implicit cursor<p>I have an existing table and I want to add some entry in another table for each row ... | <p>There is no need for you to use dynamic sql here - you know all the columns and tables you're inserting/selecting from, so you can simply use the PL/SQL variables directly in the SQL statement.</p>
<p>Also, when you're writing SQL inside PL/SQL, for performance reasons (as well as easy to read, maintain and debug) y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add the entry, which has foreign key, from frontend having only the pk of fk<p>Probably not the best heading, but I will try my best to explain the qu... | <p>I think you need to set the additional fields for uploading author id and the category id.</p>
<pre><code>class PostSerializer(ModelSerializer):
category_id = serializers.IntegerField(write_only = True)
author_id = serializers.IntegerField(write_only = True)
category = CategorySerializer(read_only = True... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to only download updated CSV files via Python requests?<p>I am trying to download CSV files from: <br />
<a href="https://fixturedownload.com/" rel="nofo... | <p>Have you tried to pull the json feed instead of the download csv? Requires a slight change to your csv_file_names list. (Which if you need me to, we can work off your original list and just use regex to grab the relevant parts to place in the url).</p>
<pre><code>import requests
import pandas as pd
import re
csv_f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing the button name without changing all buttons names<p>I have a button <code>Name</code>, by clicking on it the name changes to <code>Stop</code>. For... | <p>You are trying to use only one single boolean value to control multiple buttons' states, which is absolutely impossible.</p>
<p>One way to achieve this is to have a state storing the name of the button that is playing.</p>
<p>Try something like this:</p>
<pre class="lang-js prettyprint-override"><code>const [playing... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Elasticsearch java client api composite aggregation<p>I want to implement this json query using ES java client:</p>
<pre><code>{
"query": {
... | <p>You need to use terms query and below is way to add aggregation in my_bucket:</p>
<pre class="lang-java prettyprint-override"><code>List<FieldValue> values = new ArrayList<>();
values.add(FieldValue.of(1));
values.add(FieldValue.of(2));
Query byReveredTransactionType = TermsQuery.of(t -> t.field(&qu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JButtons not showing up after initialisation [Java Swing]<p>I know there are super many questions here on stack overflow about JElements not showing up, all ... | <p>You can't override <code>getX</code> and <code>getY</code> like this, these properties are used by the layout managers to layout the components.</p>
<p>Instead, maybe make use of <code>Point</code> to store the virtual or "cell" position</p>
<pre><code>public static abstract class Piece extends JButton {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert FILETIME to DATETIME in PowerShell?<p><a href="https://stackoverflow.com/questions/72857213/get-crl-expiration-date-from-command-line/72969184... | <p>You can avoid the challenges of converting your <code>FILETIME</code> struct instances to <code>[long]</code> values, as required by the <a href="https://docs.microsoft.com/en-US/dotnet/api/System.DateTime.FromFileTimeUtc" rel="nofollow noreferrer"><code>System.DateTime.FromFileTimeUtc</code></a> method, <em>in Powe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to mock HttpClient.newHttpClient() in Junit<pre><code> public String sendAPICall(String portalApiUrl, String reviewAppsAuthKey) {
try {
Http... | <p>As per your comment:</p>
<blockquote>
<p>how can we test this method for success if we can't mock</p>
</blockquote>
<p>you can use <code>spy</code> for that :</p>
<pre><code>@Test
public void sendAPICallTest() throws IOException, InterruptedException {
Checkorg test = getCheckOrg();
String portalApiUrl = JU... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP - how to get mime type from getimagesize instead of a number<p>I am using PHP's <a href="https://www.php.net/manual/en/function.getimagesize.php" rel="no... | <p>The <a href="https://www.php.net/manual/en/function.getimagesize.php" rel="nofollow noreferrer">documentation</a> is pretty clear about what the function returns. Looks like you need to assign the entire return value into a local variable (e.g. <code>$size = getimagesize(...)</code>, and then get the mime type from ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VS 2022 Preview 3 Breaks MAUI Apps on IPhone That Use Azure REST Services<p>I just updated Visual Studio from 2022 Preview 2 to Preview 3. My MAUI app calls... | <p>I'm answering this because I think it's likely that other people may hit this same error. In researching the Exception type (EntryPointNotFoundException), it described scenarios such as a mismatched DLL assembly. So to fix this, I did the following:</p>
<ol>
<li>Clean the solution</li>
<li>Delete everything out of... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What do the colors in `yarn list` mean?<p>When I run <a href="https://classic.yarnpkg.com/lang/en/docs/cli/list/" rel="nofollow noreferrer"><code>yarn list</... | <p>This has been raised as a <a href="https://github.com/yarnpkg/yarn/issues/7118" rel="nofollow noreferrer">GitHub issue</a>. In my perspective, it's a contrast between bold and non-bold rather than a color issue. In a nutshell,</p>
<ul>
<li><strong>'bold</strong>' (white) refers to non-hoisted dependents.</li>
<li>Th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
socket.io origin set but anyways getting errors<p>i'm making a website for a school project where there is a live updating table with data about how many rou... | <p>You will need to do one of two things to either enable CORS support or bypass CORS restrictions.</p>
<p><strong>Option #1:</strong> Change the client-side to skip socket.io http polling by changing the client-side connection code to add an option like this:</p>
<pre><code>const socket = io("https://example.com&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my redirect fail to load the expected component?<p>I have an Angular application with a redirect in place within the routing module to handle old ur... | <p>Use parameters: instead of</p>
<pre><code> {
path: 'old',
redirectTo: '..',
},
</code></pre>
<p>go</p>
<pre><code> {
path: 'old/:child',
redirectTo: ':child',
},
</code></pre>
<p><a href="https://stackblitz.com/edit/angular-e1gt7c-twawde?file=src%2Fapp%2Fapp-routing.modu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print dictionary to sheet<p>I have the below code that prints the dictionary to the watch window but how can I get this exact same format printed to a sheet?... | <p>One option is to create an array and then dumpy the array to the sheet:</p>
<pre><code>Dim arr As Variant
ReDim arr(1 To dict.Count, 1 To 3)
Dim i As Long
For i = LBound(dict.Items) To UBound(dict.Items)
arr(i + 1, 1) = dict.Items(i).name
arr(i + 1, 2) = dict.Items(i).rate
arr(i + 1, 3) = dict.Items(i).... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Paste a table from Excel into Word then transform it<p>I am beginner at coding with VBA. So, although the following code works very well, I am looking for a ... | <p>For example:</p>
<pre><code>Sub TablePasteAndFormat()
Application.ScreenUpdating = False
With ActiveDocument
With Selection
.Collapse (wdCollapseStart)
With .Range
.PasteAndFormat wdFormatOriginalFormatting
'or
' .PasteExcelTable False, False, False
With .Tables(1)
.AutoFitB... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get ScopeContext properties in AsyncTaskTarget<p>I am implementing a custom <strong>NLog</strong> <code>AsyncTaskTarget</code>, and I need to retrieve values... | <p>In your Target-constructor enable the option:</p>
<ul>
<li><a href="https://nlog-project.org/documentation/v5.0.0/html/P_NLog_Targets_TargetWithContext_IncludeScopeProperties.htm" rel="nofollow noreferrer">IncludeScopeProperties</a> = true;</li>
</ul>
<p>And then you can use <a href="https://nlog-project.org/docume... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Fix: Related jump out of range by 0007h bytes<p>How do I fix: "Related jump out of range by 0007h bytes" in this code? Using notepad++ to ex... | <p>Range of <strong>short jump</strong> x86 instruction is limited to -128..+127. If the target is further away, it has to be encoded differently, using near jump bypassed by short conditional jump with inverted condition code. Either move the target subprocedures closer to <code>cmp logic</code>, or replace</p>
<pre><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing elements with conditions from an array of objects<p>Let's call reversed what {"src":"A", "target":"B"} is to... | <p>In the <code>reduce()</code> callback, you can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex" rel="nofollow noreferrer"><code>findIndex()</code></a> to check if you have already accumulated the reverse element, and <a href="https://developer.mozilla.org... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter display DropDown Widget multiple times in different classes<p>I want to display the same dropdown on a different page.
Now I get the error:
There sho... | <p>You need to create the stateful widget for dropdown. You need to pass the data to the dropdown class from the first class. I have created the demo, manage the className as your desire.</p>
<p>Try as follows:</p>
<pre><code> class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is possible create a css class name with numbers "from-to"?<p>I need to have 3 classes as follow:</p>
<pre class="lang-css prettyprint-override"><code>.class... | <p>There is nothing in pure CSS which will do this, but you could use JavaScript to create a stylesheet for you which has all that tedious repetition created automatically.</p>
<p>In this snippet you say what the ends of the class ranges are and what styling is to be put in each of the ranges.</p>
<p>If there is a rang... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Class implements interface and expose it as property<p>Do you think the following code create some circular reference?</p>
<pre><code>public interface IMyInt... | <p>The way you done it using Interface is the right way to do it. No circular reference will occur.</p>
<p>Here's another similar question answered here on OS <a href="https://stackoverflow.com/questions/6928387/how-to-solve-circular-reference">here</a></p>
<p>Furthermore, here's another detailed example from <a href="... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoid Division by Zero in Sigmoid function<p>With : <a href="https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-F... | <blockquote>
<p>I wonder how is division by zero avoided in the sigmoid function.</p>
</blockquote>
<p>For <code>1 + exp(-Z)</code> to be zero, <code>exp(-Z)</code> would need to be <code>-1</code> which won't happen because <code>exp</code> is always positive for all real numbers. <code>Z</code> is a real number in th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why my tkinter title bar is not changing?<p>I don't understand why the title bar is not changing:</p>
<pre class="lang-py prettyprint-override"><code>from tk... | <p>There are two errors the first is in the syntax of Initialization it's</p>
<pre><code>__init__ Not _init_
</code></pre>
<p>Second you should enter the root as an input.</p>
<p>And finally you change it up a little to separate the initialization from the other method .</p>
<pre><code>from tkinter import*
from... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python dictionary list unique items<p>I have below input</p>
<pre><code> [{"ip": "1.2.3.4", "bytes": 10},
{"ip": &... | <p>Using a simple loop:</p>
<pre><code>out = {}
for d in logs_json:
if d['ip'] in out:
out[d['ip']]['bytes'] += d['bytes']
else:
out[d['ip']] = d.copy()
result = list(out.values())
</code></pre>
<p>Output:</p>
<pre><code>[{'ip': '1.2.3.4', 'bytes': 35},
{'ip': '2.3.4.10', 'bytes': 17},
{'ip':... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
make canvas image repeat scrolling upwards<p>So I've got a 600x2400 image I'm trying to make scroll upwards (character will be autorunning down the screen) a... | <p>You could draw the map image twice and reset the <code>roadMovement</code> any time it gets larger than the image height. That's when you know the whole image is outside of the canvas view.</p>
<p>Technically, you only need to draw the second image when <code>imageHeight - roadMovement < canvasHeight</code>, but ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mean function always returns NULL in R<p>The mean function is always returning NULL, no matter what I input. For example, <code>mean(1)</code> and <code>mean... | <p>You probably have redefined the <code>mean</code> function and this new definition as been saved as part of the <a href="https://support.rstudio.com/hc/en-us/articles/200711843-Working-Directories-and-Workspaces-in-the-RStudio-IDE" rel="nofollow noreferrer">workspace</a>. This workspace is loaded again when you star... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parse data from one format to another Typescript<p>I need to parse some data got from BE from one format to another to can inject it into a table component. ... | <p>Nice challenge ! Here is a solution with a recursive function that creates a new object and adds to it recursively by going through each child of the initial object and calling itself for that child and the child in that position in the new object:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does typescript break in components with spread?<p>Why does typescript break if you send props to a component with a spread statement?</p>
<p>Example cod... | <p>This is a behaviour present with TS without React too.</p>
<p>Take the below example:</p>
<pre><code>const split = { a : 1 , b : 2};
const func = ({a } :{ a : number}) => {
console.log(a);
};
func(split)
</code></pre>
<p>TS will not complain about the above. You might be passing extra keys into the object, b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the month, day and year from Calendar.get_date separately in python?<p>I need the year, month and day separately, or simply convert it in datetime... | <pre class="lang-py prettyprint-override"><code>from datetime import datetime
date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(date)
</code></pre>
<p>Y-year,
m-month,
d-day,
H-hours,
M-minutes,
S-seconds</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to combine multiple columns with missing data into one?<p>I have a (very messy) dataset that is the product of the merging of a few datasets. It currentl... | <p>Assuming we <em>know</em> that know patient will have more than one column (meaning we can safely ignore everything after the first column with non-<code>NA</code> data), then we can <code>coalesce</code> it.</p>
<p>However ... your data has literal <code>"NA"</code> strings instead of the reserveds symbol... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to resolve: Google cloud function TypeError: main() takes 0 positional arguments but 1 was given?<p>I have made a small Twitter bot that I can successful... | <p>When Cloud Functions activate your code - they automatically pass through some arguments so that you can do things like change code behaviour based on the parameters of the URL you activate.</p>
<p>In short - the last line of the error message is pointing you in the right direction;</p>
<blockquote>
<p>TypeError: ma... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setter/Getter not running on second decorator of property<p>I have 2 decorators, and when I attach them to a property, only the first one defined executes it... | <p>According to the <a href="https://www.typescriptlang.org/docs/handbook/decorators.html#accessor-decorators" rel="nofollow noreferrer">TypeScript documentation for accessor decorators</a>, when such a decorator returns a value, it replaces the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to resolve service for type 'Microsoft.FeatureManagement.IFeatureManager' while attempting to activate 'Startup'<p>I have asp.net core 3.1 web api pro... | <p>You cannot inject <code>IFeatureManager</code> in to the constructor of <code>Startup</code> because it's not yet registered. Once registered you can get it using <code>app.ApplicationServices.GetRequiredService</code></p>
<p>With <code>using Microsoft.Extensions.DependencyInjection</code> at the top of your file it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make a simplexml_load_file readable?<p>Hello everyone I'm using simplexml_load_file to load a url so I can get a catalog from a another company. Ho... | <p>What you're looking for is:</p>
<pre class="lang-php prettyprint-override"><code>
$xml->preserveWhiteSpace = false;
$xml->formatOutput = true;
$xml->saveXML();
</code></pre>
<p>and then for viewing:</p>
<pre class="lang-php prettyprint-override"><code>
echo '<pre>'. print_r($product, true). '</pre&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Auto Start Script<p>So I am making a script that can run these commands whenever a server boot/reboot:</p>
<pre><code>sudo bash
su - erp
cd frappe-bench/
ben... | <p>Because you are using systemd, you already have all the features from your script available, and better. So you don't even need the script anymore:</p>
<pre><code>[Unit]
Description=...
[Service]
# Run as user erp.
User=erp
# You probably also want to run as group erp, if it exists.
Group=erp
# Change to this dir... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run Flask on 127.0.0.2, get error "Can't assign requested address"<p>I heard that all the 127.x.x.x are loopback IPs. So I try to run Flask on 127.0.0.2 but ... | <p>Looks like your OS is a MacOS. MacOS using only <code>127.0.0.1</code> for loopback interface</p>
<p>But it is possible to assign <code>127.0.0.XX</code> aliases manually</p>
<p><a href="https://superuser.com/questions/458875/how-do-you-get-loopback-addresses-other-than-127-0-0-1-to-work-on-os-x">This article</a> ha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GitHub Actions: How to trigger a workflow on a pull_request event filtered on the name of the merging branch<p>OK I've seen at least 1 solution on this but i... | <p>It's only possible using the conditional on the job.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unity AR Animation doesn't convert to GameObject<p>Hello i'm coding an AR application but i have this type of error in Unity so i'm confused what i'm need to... | <p>This part right here:</p>
<pre><code>Animation w1WindowAnimation;
Animation w2WindowAnimation;
Animation w3WindowAnimation;
// Start is called before the first frame update
void Start()
{
w1Window = w1Window.GetComponent<Animation>();
w2Window = w1Window.GetComponent<Animation>();
w3Window = w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding new array to object without deleting the previous array<p>I have an array obj, and I am and Im adding another object links and I am creating a serie a... | <p>you can do something like this</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const obj = {
projectId: 0,
gridId: 0,
createValues: [{
field: "string",
value: ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Want to restrict a part of my indicator to certain timeframes than other parts<p>I was just making a combination of indicators i use - vwap, 50ema and imbala... | <p>You can do it in two ways, first one is to check if the timeframe is intraday and multiplier is 5 or less, like this:</p>
<pre><code>vwap = ta.vwap(close)
ema_50 = ta.ema(close, 50)
plot(timeframe.isintraday and timeframe.multiplier <= 5 ? vwap: na,
color=color.red)
plot(timeframe.isintraday and timeframe.multi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Cognitive Search analyzer vs. normalizer, when you should you use each<p>I am learning Azure Cognitive Search and got a bit confused about Analizer and... | <p>The simplest explanation is to use an analyzer for properties containing blocks of text. The normalizer is more suitable for properties with short content that you typically would use for filtering or sorting like City, Country, Name, etc.</p>
<p>A block of text will have content in a specific language. A language-s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does diff.time Return NA values, console shows no error.?<p>I am here trying to calculate the time difference between two date formats, first, I have bee... | <p>Make sure to use the correct date format, <code>as.numeric</code> isn't needed either:</p>
<pre><code>Rides <- data.frame(started_at="6/4/21 7:45",ended_at="6/4/21 7:46")
Rides %>%
drop_na() %>%
distinct() %>%
mutate(rideduration=difftime(as.POSIXct(ended_at,format = "%... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Variables in Google Test Fixtures<p>Why TEST_F can access the member variable in a <code>class</code> without using any scopes? e.g.,</p>
<pre><code>class AB... | <p>TEST_F is a macro which defines a new class publicly inheriting from the first argument (in this case, 'ABC'). So it has access to all public and protected members of the test fixture class.</p>
<p>You can inspect the source for this macro in the header file to get a better idea of what it's doing.</p>
<p><a href="h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Surprising: Java wildcard codes cannot turn to Kotlin<p>It is a question about using wildcards in Kotlin as the same in Java and my description will comes wi... | <p>What you try to do in <code>B2</code> is breaking the type safety and this is why Kotlin does not allow it. You are correct <code>T</code> in <code>A1</code> is covariant (<code>out</code>), so <code>A1<B2></code> is a subtype of <code>A1<B1></code>. However, <code>A1<B1></code> is used as a parame... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to resolve "Could not get unknown property 'shadow' for project of type org.gradle.api.Project."<p>plugin used : id 'com.github.johnrengelman.shadow' ver... | <p>It is still a little difficult to say without the complete build file. But I assume the <code>subproject</code> variable is exactly that - a subproject. In that case, you are configuring a publication on a subproject that uses the <code>shadow</code> extension from itself.</p>
<p>This means to <code>shadow</code> pl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my animation jumping to the last keyframe when set in script?<p>I am trying to rotate a gameObject by scripting it. This gameObject is a bone added in... | <p>I guess your problem starts in the last line:</p>
<pre><code>GetComponent<Animation>().Play("rotateyo");
</code></pre>
<p>This will play the animation, but the 2nd (optional) parameter defaults to <code>PlayMode mode = PlayMode.StopSameLayer</code> - I guess the continuous calling of "Play"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell - Should take only set of numbers from file name<p>I have a script that read a file name from path location and then he takes only the numbers and... | <p>You can use</p>
<pre><code>$PatchNumber = $file.Name -replace '.*[-_](\d+).*', '$1'
</code></pre>
<p>See the <a href="https://regex101.com/r/rSqkXq/1" rel="nofollow noreferrer">regex demo</a>.</p>
<p><strong>Details</strong>:</p>
<ul>
<li><code>.*</code> - any chars other than newline char as many as possible</li>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to have one element in a horizontal StackPanel dictate the height of another element in the StackPanel<p>In a StackPanel, I would like the Height of the ... | <p>The solution to this issue came from a rather subtle direction. I was initially trying to bind to the ActualHeight value of the TextBlock. During the layout process, the ActualHeight value was apparently not yet determined when it was referenced by the Image Height attribute. I then thought about using the size of t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting nodes recursively<p>I have created this function to recursively delete nodes from a doubly linked list. The issue here is that based on the call sta... | <p>First: Don't use a leading <code>_</code>.</p>
<p>You modify <code>_curr</code> in the function so by the time you end up at the <code>delete</code> the original pointer is gone. So don't do that, just call the function wiht the next value without modifying the local vbariable:</p>
<pre><code>RecursiveClear(_curr-&g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot implement CRUD operations through Neo4j in Spring Boot<p>I have a problem about implementing <strong>CRUD</strong> operations through the <strong>Neo4... | <p>Third update:
There is a problem with the custom save query.
With the <code>CREATE....</code> in place, Neo4j will always create new entities. The safest way to create a new relationship with at least one existing node is to match on the existing node and then use it by naming reference in the <code>MERGE</code> sta... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Building overlay on top of screen<p>I have method to show progress indicator on the top of screen.</p>
<p>It works but when <code>Navigator.of(context).pop()... | <p>Because you are using the <code>context</code> of the main screen to pop.
So try to move the pop function like below.</p>
<pre class="lang-dart prettyprint-override"><code>myShowDialog() async{
ShowDialog(
context: context,
builder: (context) {
Future.delayed(const Duration(seconds: 5)).then(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Chainlink node can't make requests to Chainlink external adapter (on localhost)<p>I have a chainlink Node which is running on port 6688. I'm running it with ... | <p>If you're External Adapter (EA) is running on <code>http://localhost:8080</code> and you're trying to reach that EA from a Chainlink node running inside Docker, then you can't use <code>localhost</code>, you need to get out of the Docker container and onto the host running the Docker engine (your Windows or Mac mach... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
x86, amd64: Why SIGTRAP' ucontext instruction pointer does not point to related int3<p>As the title says - <code>rip</code> from <code>ucontext_t</code> does... | <blockquote>
<p>Why is instruction pointer adjusted in SIGTRAP context to not retry related int3?</p>
</blockquote>
<p>It's not adjusted by the kernel; the exception-return address pushed by hardware is the one after an <code>int</code> instruction, including <code>int3</code>.</p>
<p>Keep in mind that <code>int3</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
significance of insert overwrite query at the end of snowflake query in teradata to snowflake conversion<p>query in teradata:</p>
<pre><code>create table dat... | <p>The Teradata command and the Snowflake commands may or may not result in the same rows in the table. Even if they result in the same rows, whether or not the 2-step approach written for Snowflake is the most efficient approach is another matter. It probably isn't, but here' what's happening:</p>
<pre><code>CREATE ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Launch template mtc should not specify an instance profile. The noderole in your request will be used to construct an instance profile<p>My launch template s... | <p>In this case, there are multiple points to take care of starting with [1]:</p>
<blockquote>
<p>An object representing a node group launch template specification. The launch template cannot include <code>SubnetId</code>, <code>IamInstanceProfile</code>, <code>RequestSpotInstances</code>, <code>HibernationOptions</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to include array of struct defined in another header in C?<p>I have the below files:</p>
<ul>
<li><code>swaps.c</code>:</li>
</ul>
<pre><code>#include &q... | <p>Simply add</p>
<pre><code>#include "./poolutils.h"
</code></pre>
<p>to your <code>swaps.h</code> too, if <code>swaps.h</code> needs the <code>Pool</code> struct definition.</p>
<p>Since you've dutifully put include guards in <code>poolutils.h</code>, you can use the header multiple times in a single compil... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: column with list of pairs<p>Suppose I have a pandas dataframe that <strong>looks like this</strong>:</p>
<pre><code> Name Values
... | <p>Use <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.explode.html" rel="nofollow noreferrer"><code>df.explode</code></a> with <a href="https://pandas.pydata.org/docs/reference/api/pandas.concat.html" rel="nofollow noreferrer"><code>pd.concat</code></a>:</p>
<pre><code>In [253]: df = df.explode(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rebuild flutter Widget on Singleton value change<p>I am trying to rebuild a stateful widget every time a value in my global Singelton is changed but I... | <p>When using <code>ChangeNotifier</code> you need to call <code>notifyListeners</code> when the value changes. You also need to have your widget listen to the <code>ChangeNotifier</code>, so that it knows when to rebuild.</p>
<p>The most common way to go about that is to use the <a href="https://pub.dev/packages/provi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return two design elements in builder<pre><code> Widget build(BuildContext context) {
super.build(context);
return Scaffold(
...
...
...
build... | <p>Did you try <code>Column</code> ??</p>
<pre><code>Widget build(BuildContext context) {
super.build(context);
return Scaffold(
...
...
...
builder: (BuildContext context) { //BuildContext context
final innerScrollController = PrimaryScrollController.of(context);
return Column(
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should I use null or an empty Container when I don't want to render a widget according to the app platform?<p>I want to use a FloatingActionButton only if th... | <p><strong>Not</strong> bad convention to use null widgets.</p>
<p>Check from Flutter's source code, you could see the following:</p>
<pre><code>
class Scaffold extends StatefulWidget {
/// Creates a visual scaffold for material design widgets.
const Scaffold({
Key? key,
this.appBar,
this.body,
this... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Could you give me some guidance on how to efficiently design an assembly language program?<p>I'm a CS student at university, and I'm supposed to develop a MI... | <p>MIPS is a very unique language compared to other high level languages like Java OR Python, so it takes some time to get used to it. The way I would recommend about going with program development in MIPS is by doing the following:</p>
<ol>
<li>Make sure you understand and memorize each MIPS instruction that your prof... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping through data and displaying only last set of items in Angular<p>From the API I am fetching the list of categories with name and ID and then inside th... | <p>This is a problem with the how you're managing your <code>allLectures</code> variable. Either convert it to a map or object to store mapping of <code>id</code> to the <code>result</code>, or, concatenate to the existing <code>allLectures</code> so that it doesn't override the previous result with new API call data.<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DataGridView selected row to check a checkbox<p>I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview... | <p>There are several things I will assume and apply a certain logic that may not necessarily be what you want. However, it should be trivial to alter the code to meet your needs.</p>
<p>It appears the columns in the grids <code>DataSource</code> are “text/string” columns containing a “Yes/No” values or possibly no valu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot list projectsV2 with GitHub Cli due to missing scopes<p>When running a GraphQL query with the GitHub CLI that uses the <a href="https://docs.github.co... | <p>By default, GitHub's CLI only requests a few scopes when authenticating via <code>gh auth login</code>. However, the new projectsV2 requires <code>read:project</code> as well.</p>
<p>This can be solved by requesting an additional scope during login, like so:</p>
<pre class="lang-bash 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 build/tag an existing Docker image in Cloud Builder<p>I currently use Cloud Build to build my app as a Docker image based on a Dockerfile. All this wo... | <p>You can do it directly by pulling the image, add the new tag and push it to the new registry in one step:</p>
<pre class="lang-yaml prettyprint-override"><code>steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-eEuo'
- 'pipefail'
- '-c'
- |-
docker pull quay.io/soketi/soketi:1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wix Harvest - Flatten Subfolders using XSLT<p>Assume the following folder structure:</p>
<pre><code>rootfolder
\_A
\_myfile.txt
\_myfile2.txt
... | <p>Your template:</p>
<pre><code><xsl:template match="wix:Directory[@Name='A']">
<xsl:copy-of select="node()"/>
</xsl:template>
</code></pre>
<p>seems to be the problem. It only copies the complete context. I suppose you need to use apply-templates like this:</p>
<pre><code><x... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating entity relationship using a jdl in jhipster<p>I have the below JDL that I am using to create the jhipster application.</p>
<pre><code>entity AuthCli... | <p>Defining a <code>clientId</code> field as you did has no impact on the relationship, these are two separate things.</p>
<p>When you define a relationship, a field is automatically created in the entity and its type is of the related class: it's a reference to an object in the java entity and a foreign key column in ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
enable or disable field. Reactive Form Angular<p>I tried to enable and disabled the repassword field in a reactive form with [angular version:13] when the pa... | <p>I'd use something along these lines:</p>
<pre class="lang-js prettyprint-override"><code>export class AppComponent {
// just a simple form definition with some basic validation I used
// to test this solution with
form = new FormGroup({
password: new FormControl(undefined, Validators.pattern('^[a-zA-Z0-9]{... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Command for querying Redis Timeseries MRANGE<p>I am trying to work out how to write the command in python to query a redis timerseries from python.</p>
<p>Wh... | <p>There's a good example in the redis-py <a href="https://github.com/redis/redis-py/blob/428510b5786c70a26a8797b8eb33b89777132884/tests/test_timeseries.py#L268" rel="nofollow noreferrer">test cases</a> for testMultiRange.</p>
<p>In short it looks like you might like something like the following:</p>
<pre><code>r = red... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inverse Affine Transform - Rasterio<p>Is there a build in way in rasterio to compute the inverse affine transform of an <code>rasterio.transform.Affine</code... | <p>The <code>Affine</code> class is defined in the <code>affine</code> package which is also managed by the rasterio organization. The <code>Affine</code> class implements the <code>__invert__</code> dunder method. This means that it implements the ability to use the <code>~</code> operator. As it happens the implement... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple Index Array - Ruby<p>i have a project of a game, in it i need to impress the letter selected if the letter selected is present in the secret word, b... | <p>In your code, <code>total_encontrado</code> is <code>2</code>, which is greater than or equal to <code>1</code>. As a result, the condition you give to <code>#select</code> is always true, so it selects every character with its index. You then map that to just the indices.</p>
<p>Instead, you likely want to select o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a plain non-component class using a razor file<p>Is it possible to create a plain non-component class using a razor file? The idea is to take advan... | <p>Your problem comes form <code>@inherits object</code>.<br />
That does indeed make a "non-component class", but why?</p>
<p>Just leave that out and make your helpers <code>static</code>:</p>
<h3>Whatever.razor</h3>
<pre><code>@inherits ComponentBase
@code {
// some other stuff
internal static Rend... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How Do You "dotnet lambda package-ci" for arm64?<h3>Describe the issue</h3>
<p>We are trying to use <code>dotnet lambda package-ci</code> to package for arm6... | <p>The architecture comes from whatever is specified in your temlate file when you specify the architecture for the AWS::Serverless::Function.</p>
<p><a href="https://github.com/aws/aws-extensions-for-dotnet-cli" rel="nofollow noreferrer">Taken from the GitHub repo:</a></p>
<h5>Package CI</h5>
<pre><code>dotnet lambda ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom Form-Request dosen't work as expected- Backpack<p>I'm creating a user management in Laravel using Backpack package, the main functionallity works well... | <p>If you call <code>setupCreateOperation()</code> at the end of your <code>setupUpdateOperation()</code> then the CreateRequest will override the UpdateRequest. What you can do instead is do that first:</p>
<pre class="lang-php prettyprint-override"><code> protected function setupUpdateOperation()
{
$th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count without duplicates in Excel?<p>I am trying to count the "iso3" items (in column A) with different combinations without duplicates. For... | <p>This formula should work for you, in cell D2 and copied down:</p>
<pre><code>=SUMPRODUCT(--($A$2:$A$13=A2),1/COUNTIFS($A$2:$A$13,$A$2:$A$13,$B$2:$B$13,$B$2:$B$13,$C$2:$C$13,$C$2:$C$13))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any objective reason to prefer a particular form of left anti-semi join?<p>I've seen a great many different forms of left anti-semi join. Allow me t... | <p>I don't think that any of the answers have covered everything, so here's my attempt to put all of the answers and comments together:</p>
<ul>
<li>Examples 1 through 5, i.e. the <code>EXISTS</code> examples, are all the same. This is not easy to prove (you might find KumarHarsh's example convincing) and relies on you... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LDAPS: Using .NET 4.7.2 System.DirectoryServices.dll<p>I am trying to update my code to get user information from an AD that must use LDAPS calls, not LDAP.<... | <p>You need to specify the LDAPS port (636) in your LDAP path, like this:</p>
<pre><code>LDAP://XXXXXX:636
</code></pre>
<p>That's all.</p>
<p>However, all the same rules for SSL apply here. This will only work if:</p>
<ol>
<li>The domain name on the SSL certificate matches the domain name you're using. So if you use <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to reduce verbosity of specific loggers in NLog<p>I upgraded from NLog 4. to NLog v5 a couple of days ago in an ASP.Net / .Net 6 environment. As soon ... | <p>You are hit by this breaking change <a href="https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html#nlogextensionslogging-without-any-filter" rel="nofollow noreferrer">NLog.Extensions.Logging without any filter</a> in NLog 5.0.</p>
<p>The recommend solution is to update your NLog.config to perform the filt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The position does not match while overlapping the image on the map using folium<p>This code is draft</p>
<pre><code>bounds_lat = np.array([34.884427, 35.3890... | <p>Reading <a href="https://python-visualization.github.io/folium/modules.html" rel="nofollow noreferrer">the docs</a> yielded the following:</p>
<blockquote>
<p>image (string, file or array-like object) – The data you want to draw on the map. * If string, it will be written directly in the output file. * If file, it’s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to create a SimpleListFilter in django<p>I don't succeed to write a query filter.
I have 3 models: Patient, Prescription and User</p>
<p>I write you only... | <p>You are trying to get a key from the prescription object in <code>print(mydict['file_extention'])</code> which I believe is causing the issue - you would instead access that property via <code>mydict.file_extention</code> - though I should add that mydict is not an accurate variable name for a model object as it isn... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use the %T>% pipe after ggplot?<p>Let's take a look at the following two pieces of code:</p>
<pre><code>mtcars %>%
ggplot(aes(x = cyl, y = mpg)... | <p>You need to wrap the <code>ggplot</code> call in a <code>print</code> so you get both calls. You can use the following code:</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.1.2
#> Warning: package 'tibble' was built under R version... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to embed order by string in hql in grails for sorting?<p>In grails 2 i used to use the following hql</p>
<pre><code>def sortp = ""
if(params.s... | <p>thanks to Prudius from grails.slack.com</p>
<p>I had to change slightly how i form the string.</p>
<pre><code>def sortp = ""
if(params.sort){
sortp = "order by r.${params.sort} ${params.order}"
}
def q = "select r.id, r.bibLabelPrinted, r.raceParticipant.bibNumber, r.bibLabelCollected... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Swing - Cant add scrollbar to my panel<p>Im trying to create a small client where I can paint coordinates onto a map.
I want to start by loading a map i... | <p>Your problem is due to the JPanel's preferred size -- it needs to match the size of the image. I recommend overriding the <code>public Dimension getPreferredSize()</code> method and return a dimension that matches the size of the image.</p>
<p>Side issue: Do <em>not</em> read in an image in a painting method such as... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
For Next.js Dynamic Routes, it is possible to combine a string with a [slug]?<p>I've tried to check through the official documentation, various issues, and i... | <p>While Next.js doesn't provide built-in support for partial dynamic routes (like <code>something-[slug]</code>), you can work around it by setting up an actual dynamic route and use <a href="https://nextjs.org/docs/api-reference/next.config.js/rewrites" rel="nofollow noreferrer"><code>rewrites</code></a> to map the i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to spy on an object that is instantiated with Callable<T> arg and implements Closeable with Mockito?<p>I am trying to figure out how to skip a non-static... | <p>You wrote</p>
<pre><code>spy( new CallableExecutor<>( any(), any() ) );
</code></pre>
<p>You can't do this. You need to make an actual <code>CallableExecutor</code> object before you can spy it. And that means passing actual values into its constructor, not passing the output of matcher methods.</p>
<p>The m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Chrome dev tools, unusual behavior, shows variables as undefined but still accesses the members<p>I might need some help with better explaining and defining ... | <p>It probably was parcel, or the tools used internally by parcel (swc/babel/tsc, depending on your setup). (Although this a guess - hard to know for sure without a full repro that I could debug). Parcel is responsible for generating the source maps, and bugs in source maps can easily cause the kinds of issues you saw ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to merge complex data frames in pandas/dataframe-js/etc<p>I would imagine what I'm trying to do is fairly simple in pandas but I just can't get it.
Reall... | <p>Ok I combined @onyambu's answer with the <code>merge</code> function, which now accepts dataframes of different sizes</p>
<pre><code># create an initial empty df
t = pd.DataFrame(columns=['uuid'])
# reduce list of dataframes into one
df = reduce(lambda x,y: x.merge(pd.DataFrame(y[1:], columns=y[0]), how='outer'), d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I select arbitrary windows from the last dimension of a numpy array?<p>I'd like to write a numpy function that takes an MxN array <code>A</code>, a windo... | <p>I got it! I was almost there:</p>
<pre class="lang-py prettyprint-override"><code>def magical_routine(A, idxs, window_len=2000):
col_idxs = np.add.outer(idxs, np.arange(window_len))
return np.take_along_axis(A[..., np.newaxis, :], col_idxs, axis=-1)
</code></pre>
<p>I just needed to always add the new axis t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: Cannot use method 'nlargest' with dtype object<p>I have this data:</p>
<pre><code> ID Date_utc Upvotes Number of Comments ... | <p>You can try <a href="https://pandas.pydata.org/docs/reference/api/pandas.to_numeric.html" rel="nofollow noreferrer"><code>pandas.to_numeric</code></a></p>
<pre class="lang-py prettyprint-override"><code>df['Upvotes'] = pd.to_numeric(df['Upvotes'], errors='coerce')
filelar = df.nlargest(10, "Upvotes" )
</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm having a problem with HTML in Google Sites<p>Because I don't understand Google Scripts, I use Google Sites, and when ever I try put this code in, nothing... | <p>Your issue is that you are unable to use alert dialogs in Google Sites. Google Scripts can be confusing. It's usually good to open up the web console as these errors should give you some idea of what is going on.</p>
<p>This change will add your text into a new DIV within the site. I imagine you want it to do much m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parse list of tuples/maps into structs with serde-yaml<p>I would like to parse the following part of a <code>.yaml</code>-file:</p>
<pre><code>networks:
fo... | <p>Implementing a custom deserializer and using it with <code>#[serde(deserialize_with = "network_tuples")] networks: Vec<Network></code> is one way of doing it:</p>
<pre><code>fn network_tuples<'de, D>(des: D) -> Result<Vec<Network>, D::Error>
where
D: serde::Deserializer<'d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to adjust (not 100% override) existing eslint rule's configuration coming from config I extend?<p>My project's eslint config extends from airbnb:</p>
<pr... | <p>Looks like configurations of the single rule from different configs do not get somehow merged. So, if the last config which configured <code>import/no-extraneous-dependencies</code> rule was <code>airbnb-typescript/base</code>, then I just need to import it and adjust it as needed.</p>
<p>Below is the solution for m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting rows based on multiple columns conditions<p>Given the following table <code>have</code>, I would like to delete the records that satisfy the conditi... | <p>You can use <code>except from</code> to compute difference set of two sets:</p>
<pre><code>proc sql;
create table want as
select * from have except select * from to_delete
;
quit;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optional parameters in typescript<p>I have a type that needs to feed in optional parameters.</p>
<pre><code>export type Dep = {
createRole: boolean;
... | <p>So if you want to use a variable that is <code>string | undefined</code> where a string is needed, say for a function <code>f(s: string)</code>, you need to either A) conditionally call the function with that variable only if you're sure it's not undefined, or B) assert that you are sure it's not undefined</p>
<p>A)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to run `npm run build`<p>I am working in a VueJS application. I would like to deploy the application in a cPanel. I am trying to run <code>npm run build<... | <p>Your app doesn't <em>have</em> a <code>build</code> command.</p>
<p>Looks like you've got a Laravel app; by default, it has <em>two</em> build commands, <code>npm run dev</code> (plus <code>npm run watch</code>, which is like <code>npm run dev</code> except it keeps running and re-building when your code changes, an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.