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:
OnEdit only triggering when manually editing a cell<p>I'm now able to only have an email sent when a cell in one sheet has something added to it and not when... | <p>With AppSheet 'edits' you will have to use <code>onChange()</code>.</p>
<h2>Try:</h2>
<pre><code>function onChange(e) {
if (e.source.getActiveSheet().getName() === `Trigger`) {
if (e.source.getActiveRange().getRow() >= 1 && e.source.getActiveRange().getColumn() >= 1) {
if (e.source.getAct... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does it change all values for me every time I add an element to the array?<p>Every time I add an element it automatically replaces all the others but thi... | <p>You can assign the response in an object inside the iteration and pass that in the <code>this.ar</code>. Try this way <strong>:</strong></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-over... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Translate this Java method to JavaScript<p>I have this Java code below, that I am trying to write its JavaScript equivalent. The code uses a priority queue w... | <p>Apart from the lacking priority queue, there are also these issues:</p>
<ul>
<li><p>The argument to <code>queue.push</code> is wrong. It should be <code>[endTime, index]</code> instead of <code>[endTime, counter[index]]</code></p>
</li>
<li><p>The comparator passed to <code>sort</code> is not correct. It should be <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I declare two different configurations to .stylelint<p>I use Stylelint on my project to check styles.
I'm using a plugin that should only run on one ... | <p>You can use the <a href="https://stylelint.io/user-guide/configure/#overrides" rel="nofollow noreferrer"><code>overrides</code> configuration property</a> to modify a Stylelint config for a specified set of files.</p>
<p>For example, to additionally run the stylelint-no-px plugin on the <code>*.scss</code> files in ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to loop and save values in new matrix<p>I have the following code which identifies the velocity values at different values of <code>KK</code>.</p>
<pre><... | <p>The following code is greatly simplified. The main idea is that you find the indices (<code>inds</code>) of <code>kh</code> values that are between <code>KK</code> and <code>KK+1</code> using <code>find</code> builtin function and sum the corresponding <code>ft</code> values at the same indices. You repeat this algo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing a string as a prop and using it to make a class name in Svelte<p>I have this BigButton component where I want to pass a bgColor prop :</p>
<pre class... | <p>You are using Tailwind, this relies heavily on post-processing of the code. My guess would be that if you do not include the full class name, the corresponding CSS will not be included in the output, because including every possible Tailwind class would create a massive file.</p>
<p>If you know what classes will be ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue 2 package inside Vue 3 project (this.$set is not a function inside package)<p>I'm having some issues with a package that uses Vue 2 inside my Vue 3 proje... | <p>You can't use Vue 2 packages with Vue 3. You may fork it and make compatible by yourself.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ansible - How to run tasks on specific host only and not on all 'inventory_hosts'?<p>I have 3 applications hosted on three separate hosts and mentioned in th... | <p>As already mentioned in the comments the proper approach would be to <a href="https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#example-group-by-function" rel="nofollow noreferrer">group the inventory by function</a> ...</p>
<hr />
<p>Given an inventory of</p>
<pre class="lang-ini prettyprint-o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I configure launch.json so it could type automatic response?<p>'python manage.py collectstatic' almost always requires typing 'yes' or 'no'(<a href="... | <p>The problem is solved by adding '--noinput' in the "args":[] in tasks.json</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to upload multiple csv files to a SQL server Database using R<p>I have a number folders that store >50 different csv files in each folder, each with d... | <p>Like @r2evans I do this using DBI, rather than dbplyr (I often use the two packages together).</p>
<p>Below is a cut down version of the custom function I use. You can find the full version <a href="https://github.com/simon-anasta/dbplyr_helpers/blob/master/dbplyr_helper_functions.R" rel="nofollow noreferrer">here</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Copy html from multiple <pre> tags to clipboard<p>I have several pieces of HTML within [pre] tags that I want to associate to a copy button with class 'bla'.... | <h4>Select by index</h4>
<p>Use the index of the button to selected your pre elem like so :</p>
<pre><code><pre>
any html here
</pre>
</code></pre>
<pre class="lang-js prettyprint-override"><code>function addListeners() {
const btns = document.getElementsByClassName("bla");
for(var i = 0; ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add a missing closing parenthesis to a string in R?<p>I would like to add a closing parenthesis to strings that have an open parenthesis but are missi... | <p>Try this</p>
<pre><code>stringr::str_replace_all(text, '\\([A-Z]+(?!\\))\\b', '\\0\\)')
</code></pre>
<ul>
<li>output</li>
</ul>
<pre><code>"The dog walked (ABC) in the park"
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS: menu icon animation<p>Why this code doesn't work for me totally?
No animation or effect when I press it on the browser.</p>
<p>This is HTML snippet:</p>... | <p>It is <strong>getElementById</strong>, not <strong>getElementsById</strong>, like</p>
<pre><code>const menuBars = document.getElementById("menu-bars");
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cocoapods error when Initializing react-native app on Mac mini (Apple M1, 2020) running Monterey<p>I'm on a Mac mini with Monterey OS trying to init a react-... | <p>Using that processor does bring some issues with installing pods. Please try <code>arch -x86_64 pod install</code> and see what it brings.
Link to some older post:
<a href="https://stackoverflow.com/questions/67526954/react-native-ios-builds-failing-suddenly/71026262#71026262">React Native ios builds failing suddenl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a dataframe with multiple columns to a two-columns avoiding duplicates with pandas<p>I have a datframe like this</p>
<pre><code> c1 c2 ... | <p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.melt.html" rel="nofollow noreferrer"><code>DataFrame.melt</code></a> with <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_index.html" rel="nofollow noreferrer"><code>DataFrame.sort_index</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
On click of search button send user to new tab showing results from another site?<p>I am trying to create a search box on my site. However when someone click... | <p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-target" rel="nofollow noreferrer">target attribute</a> on the form tag.</p>
<p>Don’t forget to inform your users, including screen reader users, that the action will open a new tab.</p>
<p>If you use the GET method, input na... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I find the dba datafile on the server where the database is?<p>This query give the list of the different datafile:</p>
<pre><code>SELECT fil.FILE_N... | <p>to get the server name. replace TERMINAL by SERVER_HOST</p>
<pre><code> select sys_context('USERENV','SERVER_HOST') from dual
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Value of type 'Int' has no member 'seconds'<p>I have tried many ways, but I still can't convert the timestamp to date (year month day..), now I have this pro... | <p>You have converted something from a network response into an <code>Int</code>. You have then called <code><int>.seconds</code>. The error message is telling you that there is no such thing as <code>.seconds</code> on an Int.</p>
<p>The timestamp that the <code>Date</code> class is expecting is simply a <code>D... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my simple script tag break the following script tag?<p>I am tearing my hair out over this. Why is foo() undefined when I click the button in this sc... | <p>Auto closing tags are used in React JSX and not in vanilla HTML
Replace</p>
<pre><code><script type="text/javascript" src="./app2.js"/>
</code></pre>
<p>with</p>
<pre><code><script type="text/javascript" src="./app2.js" ></script>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Get Last Item in a Python Generator<p><strong>Question</strong>: how can I get the last item in a python generator in a fast and memory-efficient way?... | <p>The last item of a generator cannot (always) be determined.</p>
<p>Of some generators you cannot predict if they'll ever end (or the last element is uncertain):</p>
<pre><code>import random
def random_series():
while x := random.randint(1, 10) > 1:
yield x
# print random numbers from generator unti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subclassing UserControl gives "Unsupported type argument" error<p>I am trying to subclass UserControl like so:</p>
<pre><code>public class BaseUserControl : ... | <p>The issue related to a clash/ambiguity of the named class (BaseUserControl). Once I found the duplicate class of BaseUserControl and made sure that there was no ambiguity (i.e. removed unnecessary 'using' statements), the problem was resolved.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to correctly write the path(useNavigate)?<p>please help. I have such a route, how to correctly specify the path in the navigate before it</p>
<pre><code>... | <p>I believe you don't need to pass braces in <code>navigate</code>, try this:</p>
<pre><code>if (data) { navigate(`MainPage/repos/users:${inputValue}/page/`); }
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI - Error - Initializer 'init(_:rowContent:)' requires that 'CustomDataModel' conform to 'Identifiable'<p>In my watch app, I wish to display list of ev... | <p>Give your type an id and make it identifiable and if you don’t need decidable don’t add it.</p>
<pre><code>struct MyType: Encodable, Identifiable {
let id = UUID()
// other properties
}
</code></pre>
<p>Using <code>Codable</code> is just shorthand for adding <code>Encodable</code> and <code>Decodable</code>. So... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reshaping output of MultiHeadAttention - Tensorflow<p>We know that MultiHeadAttention's Keras API offers an <code>output_shape</code> argument, where you can... | <p>The core issue with your reshaping attempt is that you are trying to flatten the batch dimension. All of the standard layers in Keras would keep it constant and reshape rest of the tensor.</p>
<p>For example, when you do <code>reshape = layers.Reshape((15,5))</code> you get,</p>
<blockquote>
<p>Input to reshape is a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change the dropdown backgroundColor of an MUI 5 TextField select?<p><a href="https://i.stack.imgur.com/ZCVpw.png" rel="nofollow noreferrer"><img src="... | <p>If you want to style the underlying menu you can pass in <code>SelectProps</code> to the <code>TextField</code>.</p>
<pre><code><TextField
select
id="version"
label="Version"
variant="outlined"
SelectProps={{
MenuProps: {
sx: styles.textField,
},
}}
>
</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
flutter run -d windows - Showing error Nuget is not installed<p>When I Run the<code> flutter run -d windows</code> command it shows nuget is not installed er... | <p>I <a href="https://docs.flutter.dev/get-started/install/windows" rel="nofollow noreferrer">updated</a> flutter again and updated the VS C++ package (windows version), the application worked successfully, but the error <em>Nuget is not installed</em> remains but has not affected the construction process.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React - Share state between child and hook<p>I have a screen <code>A</code>, a component <code>B</code> and a hook <code>C</code>.</p>
<p>The screen <code>A<... | <p>Having the main view for a particular state be somewhat separated from the functionality that manipulates and changes that state is fine and normal, especially when the state needs to be shared among other components too.</p>
<p>One approach you can use for this situation to make it clear that a state is directly ti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Quarto table cross-reference gt<pre><code> ---
title: "example"
format:
pdf:
documentclass: article
editor: visual
---
</code></pre>
<p>Hel... | <p>This was an issue in Quarto that has been fixed now
<a href="https://github.com/quarto-dev/quarto-cli/issues/924" rel="nofollow noreferrer">https://github.com/quarto-dev/quarto-cli/issues/924</a></p>
<p>Using <strong>gt</strong> with caption and cross reference should work as espected now if you use Quarto version a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass JSON into function and read back its JSON value<p>Tried below codes to get back the JSON values from the function but receive error => SyntaxE... | <p>You can process data by passing in parameters or global variables.</p>
<p>In addition, there is no need to use <code>JSON.parse()</code> because <code>data</code> is already a json object.</p>
<h2>Pass data to method</h2>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to improve the Java Stream method?<p>I would like to improve the following Java Stream method and to understand better how does anyMatch in Stream work.<... | <p>Will this be considered as improvement?</p>
<pre><code>private boolean containsSelectedTag(Resource resource) {
Stream<String> tagStream = Arrays.stream(resource.getValueMap().get(blogContext.getBlogContextEnum().getTagName(), new String[0]));
boolean containsSelectedTag =
tagStream.anyMatch(t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i iterate through a python dict and reach easily the leaves?<p>I am trying to iterate a graph-dict object and reach every time the leave nodes, and i... | <p>You can use recursion in this case.
Below is a sample code.</p>
<pre class="lang-py prettyprint-override"><code>graph={'Node': [0, 0, 0],
'children': [{'Node': [1, 0, 0],
'children': [{'Node': [2, 0, 0], 'children': []},
{'Node': [1, 1, 0], 'children': []},
{'Node': [1, 0, 1], 'children': []}]},
{'Node... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to access any objects or functions from within the browser console, yet everything works as intended?<p>I am using "classses" with a bunch o... | <p>Your <code>import</code>s show that you are working with <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules" rel="nofollow noreferrer">ECMAScript modules</a>.</p>
<p>One of the main motivations behind using modules is to not pollute the global name space, which means that any variables de... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS NLB - not able to assign Elastic IP to Network Load Balancer<p>Am trying to assign Elastic IP (recently disassociated from EC2 instance ) to an Internet ... | <p>You <strong>can't change existing IP address</strong> assocciation. You already have assigned all your NLB nodes to AWS provided IP. You can only add Elastic IP for new AZ association in an existing NLB. If you used all associations, you have to create new NLB.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel seeding date and foreign key<p>I have some struggles to seed foreign key at this table:</p>
<p><a href="https://i.stack.imgur.com/owndU.png" rel="nof... | <p>Set <code>asText</code> for <code>paragraphs</code> and <code>words</code> to true:</p>
<pre><code>$this->faker->paragraphs(3, true)
</code></pre>
<p>These are methods' signatures:</p>
<pre><code>@method array|string words($nb = 3, $asText = false)
@method array|string paragraphs($nb = 3, $asText = false)
</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
githooks(5): what is the Git "null-ref"<p>On the documentation for the <a href="https://git-scm.com/docs/githooks#_post_checkout" rel="nofollow noreferrer"><... | <p>It is the commit ID consisting of all zeros.</p>
<p>I added the following line to <code>~/.config/git/template/hooks/post-checkout</code>:</p>
<pre><code>echo "post-checkout" "$@" 1>&2
</code></pre>
<p>and then cloned a new repository, getting the following output:</p>
<pre><code>post-chec... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pylance: wont find stubs for native library with submodules<p>Edit: I also posted this question as an <a href="https://github.com/microsoft/pylance-release/i... | <p>I'm answering my own question since I had an answer from the pylance team in the meantime.</p>
<p><a href="https://peps.python.org/pep-0484/#stub-files" rel="nofollow noreferrer">https://peps.python.org/pep-0484/#stub-files</a> specifies that</p>
<blockquote>
<p>Modules and variables imported into the stub are not c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract extension from email address in SQL<p>I wanted to extract the extension from email address.</p>
<p><strong>Input:</strong> test@work.com<br />
<stron... | <p>It seems you want to <em>remove</em> any characters prior to and including the first period (<code>.</code>) after the at symbol (<code>@</code>). I would use <code>CHARINDEX</code> and <code>STUFF</code> for this:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT STUFF(V.Email,1,CHARINDEX('.',V.Email,CHAR... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Read Data from CSV row by row and store in database<p>I have a csv file with 20 records that need to stored in a table inside a database. I am trying ... | <h3>Example: pandas</h3>
<p>ref: <a href="https://www.listendata.com/2019/06/pandas-read-csv.html" rel="nofollow noreferrer">https://www.listendata.com/2019/06/pandas-read-csv.html</a></p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
# read csv
data = pd.read_csv("your-file.csv")
# read... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert auxiliary coordinates to dimension coordinates in a cube in iris?<p>I am pretty new to using NetCDF Jules output files. I am trying to write a... | <p>some functions to which helped my specific problem.</p>
<p><a href="https://code.metoffice.gov.uk/trac/utils/browser/smstress_jpeg/trunk/jules.py#L629" rel="nofollow noreferrer">https://code.metoffice.gov.uk/trac/utils/browser/smstress_jpeg/trunk/jules.py#L629</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Script Getting Stuck While Sorting Files Using Grep<p>So I currently am working on a matching script that does a few things:</p>
<ol>
<li>Takes a list of key... | <p><code>xargs</code> is probably the culprit; you should add the <code>--no-run-if-empty</code> (aka <code>-r</code>) option and specify the delimiter to be <code>\0</code> (in combination with <code>pdfgrep -lZ</code>):</p>
<pre class="lang-bash prettyprint-override"><code>#!/bin/bash
keywords=(
"Keyword1&q... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter: How to run remote db transactions in the background<p>I have an e-commerce app. When user add/remove items I need to have them logged into my remote... | <p>you can try <a href="https://pub.dev/packages/workmanager" rel="nofollow noreferrer">workmanager</a></p>
<pre><code>void callbackDispatcher() {
Workmanager.executeTask((task) {
//Write codes to perform required tasks
return Future.value(true);
});
}
Workmanager.initialize(
callbackDispatcher, //the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing strings from Delphi to Labview DLL<p>I have a simple Labview dll that takes a PascalString then returns the pascal string with no changes. This is ju... | <p>You say that the DLL function is taking in a Pascal String. According to Labview's documentation:</p>
<blockquote>
<p><strong>Pascal String Pointer</strong> is a pointer to the string, preceded by a length byte.</p>
</blockquote>
<blockquote>
<p><strong>Pascal-Style Strings (PStr)</strong><br />
A Pascal-style stri... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I concatenate an array on strings in ADF Data Flow to a simple string?<p>I am building an Azure Data Factory. Inside a Data Flow I have an array of st... | <p>Does toString(myArray) do what you are looking for?</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular running on local adress uses https for files<p>I am running my angular project on my local network with this command: <code>ng serve --host=<ip_ad... | <p>Found the answer/found my own mistake.</p>
<p>I still had the meta tag <code><meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"></code> in my index.html head.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I can't decide which model fits perfectly for these tasks:<p><a href="https://i.stack.imgur.com/ug5FF.jpg" rel="nofollow noreferrer"><img src="https://i.stac... | <p><strong>Predict what the condition of these trucks will be in 2020</strong></p>
<ul>
<li>You should probably start by looking at the data and afterwards start simple. Instead of trying LSTMs on these kind of datasets, try to fit some standard regression models and look at the general errors you get.</li>
</ul>
<p><s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change state using componentDidUpdate()<p>Hi i'm trying to change a state using componentDidUpdate() but I get an infinite loop.</p>
<pre><code>componentDidU... | <p>The <a href="https://reactjs.org/docs/react-component.html#componentdidupdate" rel="nofollow noreferrer">componentDidUpdate</a> function uses 3 parameters:</p>
<ol>
<li>previous properties</li>
<li>previous state</li>
<li>snapshot (for when <code>getSnapshotBeforeUpdate()</code> is used.</li>
</ol>
<p>You are treati... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Pandas CSV to nested dictionary for uploading data in mongodb<p>I have a DataFrame like this and I want a result shown below:</p>
<pre><code>Country, ... | <p>Try:</p>
<pre class="lang-py prettyprint-override"><code>out = [
{
**row[["Country", "Last Updated"]].to_dict(),
**{row["Series"]: row.filter(regex=r"\d{4}").to_dict()},
}
for _, row in df.iterrows()
]
print(out)
</code></pre>
<p>Prints:</p>
<pre c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I read just one field in MongoDB C#?<p>Im trying to read just one field from the MongoDB with a given ID, but its giving me all the object... How can... | <p>In order to return only the list of surveys, you can change your method like this:</p>
<pre><code>public async Task<List<string>> ReadSurveysHall(string hallId)
{
var filter = Builders<Hall>.Filter.(x => x.Id, hallId);
var halls = await _mongoManager.Find(filter, MongoConstants.HallCollectio... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to re-render and run useEffect when router change (React js)<p>I have a <code>ChartPage</code> function that gets called three times inside three differe... | <p>Add <code>type</code> to the dependencies array of <a href="https://reactjs.org/docs/hooks-effect.html" rel="nofollow noreferrer"><code>useEffect</code></a>:</p>
<pre><code>useEffect(() => {
getCoin(type)
.then((response) => {
setValues(response);
})
.catch((error) => {
console.log... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom Retry strategy for Spring WebClient<p>I'm using a fixedRetry in order to repeat HTTP calls using WebClient.
I want the first retry to be called after ... | <p>You would need to implement custom <code>Retry</code> to achieve this. Here is an example</p>
<pre><code>private static class CustomRetrySpec extends Retry {
private final int retries;
private final Duration firstTime;
private final Duration secondTime;
private final Duration restTime;
public Cu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I show a of list elements of an array?<p>I have a large array of 465 items, with each item having five elements. E.g.</p>
<pre><code>const fixture = {... | <p>Try this outputting to console</p>
<pre><code>this.state.fixtures.forEach(fixture => console.log(fixture.competition));
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subtract two timestamptz values and insert the result into a third column<p>I have the following table:</p>
<pre><code>CREATE TABLE duration
(
departure_time... | <p>Use a generated column</p>
<pre><code>CREATE TABLE duration
(
departure_time TIME WITH TIME ZONE,
arrival_time TIME WITH TIME ZONE,
scheduled_duration INT,
flight_id INT,
duration2 TIME GENERATED ALWAYS AS ("arrival_time"::time - "departure_time"::time) STORED,
CHECK (scheduled_duration > 0)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is an algorithm for displaying rpm on set of LEDs?<p>So I have an Arduino that is reading the rpm from my car. I also have a 15-pixel neopixel strip con... | <p>Does this code help? This has the code to calculate the last pixel - and the brightness of that pixel.</p>
<pre><code>#define NUM_LEDS 15
#define NUM_BRIGHTNESS_LEVELS 256
#define MAX_REVS 8000
void setup()
{
Serial.begin(9600);
}
void loop()
{
for ( int revs = 0 ; revs <= MAX_REVS ; revs += 500 )
{
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How setState affects setInterval?<p>I've coded simple timer, but when I try to <code>console.log(time)</code>(It is in <code>handleStart</code>), I get the s... | <p><code>time</code> is a local <code>const</code>, which your interval function closes over. As a <code>const</code>, it can never change, so you're always logging out the original value. Even if you used <code>let</code> the behavior would be the same, because calling <code>setTime</code> does <strong>not</strong> ch... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Blobs shader GLSL<p>I want to create a similar background with a shader to these images:
<a href="https://i.stack.imgur.com/y0buy.png" rel="nofollow noreferr... | <p>For each blob, you can multiply it's color by a a noise function and then a 2D gaussian curve centered in a random point. Then add all the blobs together. I only added the ones of the adjacent cells to make it scrollable and the numbers in the for loops might be increased for bigger blobs.</p>
<p>here is my code :</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Datetime creation in Python for humans<p>Could you please recommend a Python library which can creates datetime from strings like these?</p>
<p>Sunday, 17 Ju... | <p>If you already know all the date format you'll encounter, you can store them in a list and loop over it.</p>
<pre class="lang-py prettyprint-override"><code>from datetime import datetime
FORMATS = ["%A, %d %B %Y - %H:%M %Z", "%m/%d/%Y %I:%M:%S %p"]
def try_formats(date_str: str) -> datetime:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my fetch request returning "...doesn't work without JavaScript enabled..."?<p>I have a sample project at <a href="https://github.com/ericg-vue-questio... | <p>In order for <code>fetch( "./TheCloud.svg" )</code> to work, it should be static file, which is located in <code>/public</code> folder in Vue CLI projects. Also relative URL paths may give problems, while absolute paths like <code>fetch( "/TheCloud.svg" )</code> are unambiguous.</p>
<p>Otherwise ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is there a way in R to mutate a cumulative subtraction to update the same mutated var?<p>This is straightforward but for whatever reason I'm having difficult... | <p>There's no cumulative subtraction, but you can do a cumulative sum and then subtract it.</p>
<pre><code>library(dplyr)
data %>%
group_by(group) %>%
mutate(want = ifelse(!is.na(n3), n3, first(n3) - lag(cumsum(n1)))) %>%
ungroup()
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rename files recursively with Bash<p>I am trying to make a bash script that should replace any occurrence of a given <code>pattern</code> with an othe... | <p><strong>Edit</strong>: leave only the 1-pass solution that apparently works as well as the 2-passes.</p>
<p>You'll probably have to explore the hierarchy depth first. Example with <code>find</code> and a <code>bash</code> exec script:</p>
<pre class="lang-bash prettyprint-override"><code>$ find . -depth -name '*patt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
strange python error where the compiler-error changes the case of a letter<p>I got a python error where it shows the logger object as Logger, changing the lo... | <p>As @Jhon Gordon mentioned:</p>
<blockquote>
<p><code>Logger</code> is the <em>type</em> of object, not its <em>name</em>.</p>
</blockquote>
<p>The <code>logger = logging.getLogger(__name__)</code> uses the <code>getLogger()</code> method which has the same name as my variable explaining why it appeared like the comp... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.NET 6 web api project needs to export XML and JSON<p>I have a web api project that has some actions (most) that need to export JSON, and some (only a few) t... | <p>Have you changed the order of your formats in OutputFormatters?</p>
<p>Accroding to the offcial document :Formatters are evaluated in the order they're inserted, where the first one takes precedence.
:
<a href="https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/custom-formatters?view=aspnetcore-6.0#config... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can i keep the element visible when linking to it with a top navbar<p>i am using bootstrap here and i was trying to make a nav bar with some content and ... | <p>Add <code>position: relative;</code> to the style of the first <code><div></code> with class of <code>.container</code> (The one on top of <code><h1>website</h1></code>),</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where would I fetch Data from my database to update a Chart Using react-chartjs-2?<p>I'm trying to create a Bar Chart with data I'm getting from my database.... | <p><code>setChartData</code>/<code>setChartOptions</code> are being called before the fetch request gathering the needed data has finished. Try to move this logic into the success callback of your <code>fetch</code> call.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.lang.NoSuchMethodError: 'void org.yaml.snakeyaml.LoaderOptions.setMaxAliasesForCollections(int)'<p>Im my project we are using spring boot 2.6.6 version.... | <p>Issue resolved when adding snakeyaml latest dependency in pom and removed the old one in m2 folder and exclude snakeyaml from javafaker dependency.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why this fading slideshow animation is not fully working?<p>I cannot get this slideshow to work fine in every img.</p>
<p>After tweaking it for hours I reach... | <ol>
<li>You currently have two elements with <code>fade-in</code> and one with <code>fade-out</code> - take a look at the console. So you probably want to swap those in js to have something like this:</li>
</ol>
<pre><code> slides[slideIndexCurr].classList.add("fade-out");
slides[slideIndexCurr].class... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reverse first and last name?<p>Using an input to prompt the user, how can I reverse the first and last names, capitalize the first letter and add a co... | <p>Do something like this:</p>
<pre class="lang-py prettyprint-override"><code>names = input("What is your name: ").split(" ")
print(', '.join([names[1].capitalize(), names[0].capitalize()]))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you bind the default network interface of the host into the container to read network stats?<p>I have a project where I read system information from the ... | <p>There is a way to enter the host network namespace after starting the container. This can be used to run one process in the container in the container network namespace and another process in the host network namespace. Communication between the processes can be done using a unix domain socket.</p>
<p>Alternatively ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set content for template in JavaScript<p>From the below code not able to get the id for template. Trying to set content for template using id. But not... | <p>That is not how <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots" rel="nofollow noreferrer">templates</a> are to be used. You get the template content and THEN manipulate the content and then insert the (cloned) manipulated content into the page DOM</p>
<p><div class="sn... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to deal with month grouping and sum of hours of these months in Google Sheets?<p>I'm having trouble filtering a column by month/year and counting the uni... | <p>try:</p>
<pre><code>=ARRAYFORMULA(QUERY({TEXT(A3:A; "mm/e")\
IF(COUNTIFS(A3:A; A3:A; ROW(A3:A); "<="&ROW(A3:A))=1; 1; 0)\ C3:C-B3:B};
"select Col1,sum(Col2),sum(Col3) where Col3>0
group by Col1 label sum(Col2)'',sum(Col3)''
format sum(Col3)'[h]\hmm\min'"))
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace First Two Characters of XML Tag Value Match with Static Value<p>I am trying to replace the first two characters of an XML tag <code><LineStyle>... | <p>Use this Perl one-liner:</p>
<pre><code>perl -i.bak -0777 -pe 's{( <LineStyle> \s* <color> ) .. }{${1}00}gxms' in_file
</code></pre>
<p>The Perl one-liner uses these command line flags:<br />
<code>-e</code> : Tells Perl to look for code in-line, instead of in a file.<br />
<code>-p</code> : Loop over th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I return a key value when a specific column value is NOT present?<p>Here's a simplified example of my SALESORDERLINES table:</p>
<div class="s-table-c... | <p>Just a guess since you don't specify what resultset you desire. And surely there is another table that you did not include that represents "orders" - perhaps named SALESORDERS?</p>
<p>Assuming that, then I suggest:</p>
<pre><code>select ord."ORDER" -- a terrible idea to use reserved words as name... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
loading classes from custom dependency in a custom gradle plugin<p>I have a custom Gradle plugin, that works well, I have published a couple of versions alre... | <p>Finally was able to solve this, thanks to the help I got on <a href="https://discuss.gradle.org/t/class-loaded-through-configuration-is-not-found-when-task-runs/42945/3" rel="nofollow noreferrer">https://discuss.gradle.org/t/class-loaded-through-configuration-is-not-found-when-task-runs/42945/3</a></p>
<p>I am quite... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(Flask) Why doesn't the Jinja block in my HTML get all the table entries passed from a SQLAlchemy query?<p>I'm trying to send table entries to display on HTM... | <p>Final solution:</p>
<pre><code>@app.route('/<int:product_id>/product_details', methods=['GET'])
def product_details(product_id):
orders = []
order_list = Order.query.all()
product = Products.query.filter_by(product_id=product_id).first()
for order_to_process in order_list:
product_list ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why strategy.openprofit only shows for the previous candle?<p>I'm using version 5 and trying to display a label that shows the current live unrealized loss/p... | <p>By default strategies are calculated on bars' closes. If you really want real-time data, you should set <code>calc_on_every_tick</code> property of your <code>strategy()</code> to <code>true</code>.</p>
<p><strong>Note:</strong> Instead of creating and deleting labels all the time, you can have one label for each an... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GTK4 ApplicationWindow that is also a ScrolledWindow?<p>Here is a minimal GTK 4 app written using the Python bindings, based on <a href="https://github.com/T... | <p>A <code>Gtk.ScrolledWindow</code> isn't really a "window" per se as most people know it (it used to map to the very specific concept of a X11 Window). It's a widget that allows you to scroll through its child widget.</p>
<p>In other words, if you want an application window where you can scroll through the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to choose and use subclass of an object (MemoryType) based on subclass of another object (FractalType) outside of it's skope<p>I'm doing some factal calc... | <p>Solved this by adding one more layer of abstraction between TypeX and Type.</p>
<p>And made specific MemX methods in new TypeAbstracX classes.</p>
<p>No Generics, No interfaces. Problem solved.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks?<p>Here is my code:</p>
<pre><code>impo... | <p>What you're doing should be OK. Though it's perfectly OK to set up a single listener for your entire app at the global level (without a hook). That listener doesn't really "leak" anything. It just keeps getting called whenever the user's state changes, so you can decide what you want to do for your enti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subset multiple row values into new table and and count string pattren occurences<p>I have the following table for processing (Table1):</p>
<pre><code>Fuse ... | <h5>count the aggregated occurrences</h5>
<pre><code>out = (df
# extract BLU/RED as col (other methods are possible)
.assign(group=df['Ident'].str[:3])
.groupby(['Fuse', 'group'])['Grade'].agg(';'.join) # aggregate multiple occurrences
.unstack().value_counts() # count values
.reset_index(name='count')
)
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement AntiForgery Token in Angular with NET 6<p>I'm working with several but obsolete documentation about implementing antiforgery token with angu... | <p>Finally did it. There is a lot of changes (and not) but there is a lot of considerations you have to take in order to implement this with security.</p>
<p>I'll enumerates and made a tutorial because I lost a lot of time to resolve this request/issue.</p>
<p><code>The question itself I made is fine, so you can the co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to locate element having dynamic ids?<p>I want to locate this element:</p>
<pre><code><tr class=" category-2 saleproductname " id="21&... | <p>Since <code>id="21"</code> is unique, query for that and use <code>.find()</code> (which will find within the parent) to access the input</p>
<pre class="lang-js prettyprint-override"><code>cy.get('tr#21')
.find('input')
</code></pre>
<p>In case there's several inputs in the same row</p>
<pre class="lang... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Blazor List of components, shift values from components when removed from list<p>I'm trying to understand this issue I'm having in blazor 3.1 and appreciate ... | <p>use <code>@key</code> on your component inside the loop. This helps the render engine know what elements have been updated.</p>
<pre><code><MyComponent @key=@item ThisItem="@item" Close="close" />
</code></pre>
<p><code>Index.razor</code></p>
<pre><code><h1>List Component Issue</h1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recursively unzipping a folder with ZipFile/Python<p>I am trying to write a script which can unzip something like this:</p>
<ul>
<li>Great grandfather.zip
<u... | <p>Replace <code>extractor(path)</code> by these two lines:</p>
<ul>
<li><code>os.chdir(path)</code></li>
<li><code>extractor('.')</code></li>
</ul>
<p>So your code becomes:</p>
<pre><code>from os import listdir
import os
from zipfile import ZipFile, is_zipfile
#Current Directory
mypath = '.'
def extractor(path):
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pyspark dataframe drop last element in list column<p>I have a pyspark dataframe with an email column, and I want to get two things: domain (gmail, hotmail, .... | <p>If you just want to remove last element from array column of spark you can try below code where I have used array except</p>
<pre><code>from pyspark.sql import functions as F
testdf=spark.createDataFrame([("abc@gmail.com",),("faden@domain.domain2.com",),("fba@a.org",)],"id string&q... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ScrollViewer conflicts with Grid ColumnDefinition if content is too big<p>This is more of a general question to figure out if this is intentional behavior or... | <p>This behavior is related to the <code>ScrollViewer</code>. <code>ScrollViewer</code> allows an infinite width, which obviously does not work well when measuring the spanning column width, where at least one column is dynamic (<code>*</code> or <code>Auto</code>).</p>
<p><code>Grid</code> will always try to stretch t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Colspan and rowspan working in some places not in all places<p>I have the following html code :</p>
<pre><code><!doctype html>
<html>
<body>... | <p><code>j block</code> and <code>k block</code> are both 2 columns wide, but the right column is 0px wide. Same for <code>l block</code>: the lower row is 0px tall.</p>
<p>Add 3 more cells with stuff in them to the first row and you'll see that j/k blocks stretch across 2 columns.</p>
<p>Also, Edge and Chrome use the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot set headers after they are sent to the client in express<p>i registered successfully which inserting record in my mongodb but when i try to login erro... | <p>You need to end the execution of the function when you call res.status().json(), otherwise it will just proceed and you will again set res.status().json(). This is causing the error.</p>
<p>Modify to something like:</p>
<pre><code>const router = require('express').Router();
const User = require("../models/User&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get same random number using Math.random at different places?<p><code>randomNum</code> function returns the different values to <code>diceNum.innerTex... | <p>You can pass the random generated number to the drawPlayer function, here's a sample</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 randomNum = () => {
return ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scraping multiple tables in python efficiently<p>I am currently trying to scrape data from the <a href="https://essentialoils.org/db#" rel="nofollow noreferr... | <p>You can do this much faster using Requests and BeautifulSoup. I'm not going to post my cookie information, however if you go to the network tab on your browser, you can see what headers are being used for the request.</p>
<pre><code>from bs4 import BeautifulSoup as bs
import requests
import json
cookies = {
'X... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use the WHERE method to replace all numbers in a Numpy array with a - 1<p>I'm trying to use the where method to replace all odd numbers from the below array ... | <p><code>where</code> method only returns indices</p>
<pre><code>arr = np.array([0, 1, 0, 3, 0, 5, 0, 7, 0, 9])
arr[np.where(arr%2!=0)] = -1
print(arr)
</code></pre>
<p>output:</p>
<pre><code>[ 0 -1 0 -1 0 -1 0 -1 0 -1]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to stop Dataproc Job from airflow<p>From Airflow we can submit dataproc jobs via DataprocSubmitJobOperator.</p>
<p>We can stop dataproc jobs in developme... | <p>At the moment there is no operator for this action but <code>DataprocHook</code> has <a href="https://github.com/apache/airflow/blob/3f6d5eef427f3ea33d0cd342143983f54226bf05/airflow/providers/google/cloud/hooks/dataproc.py#L770" rel="nofollow noreferrer"><code>cancel_job</code></a> function so you can create a custo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
should a function return the pointer of a newly created object, or a unique_ptr of that object?<p>I remember watching Herb Sutter on conference talks, some y... | <p>It is covered in the C++ Core guidelines under I11:</p>
<p><a href="https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i11-never-transfer-ownership-by-a-raw-pointer-t-or-reference-t" rel="nofollow noreferrer">https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i11-never-transfer-ownership-by-a-raw... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get attributes of annotations in Java using reflection?<p>I have several data classes in java of which I want to know - using reflection - which field... | <p>You should be able to get the instance of that annotation (including your values) using</p>
<pre><code>Column fieldAnnotation = attr.getAnnotation(Column.class);
</code></pre>
<p>If the field is not annotated with <code>@Column</code>, <code>getAnnotation</code> returns null. That means you don't need to iterate ove... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filled area in 3d in gnuplot<p>I am plotting a 3D heat map in gnuplot. I would like to plot a filled area on top of it.
The datafile looks the following</p>
... | <p>The plot style <code>with polygons</code> works in both 2D and 3D plots. You can provide a constant z value of zero or some other value to make sure the polygon sits in front of or behind whatever else is in the plot.</p>
<pre><code>$Data << EOD
118.01363 0.31794
139.62999 0.31216
173.51509 0.30177
210.9... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does NASM system call number perform 2 different operations despite specifying the same call number<p>I have the following 'hello world' code written in ... | <p>You are not specifying the same system call number.</p>
<p><code>eax</code>, not <code>ebx</code>, is used to specify system call numbers.</p>
<p><code>mov ebx, 1</code> sets the value of <code>ebx</code> and doesn't set the value of <code>eax</code>.</p>
<p>The system call number is set to <code>4</code> via <code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript nullish coalescing chained with "or"<p>I'm making use of Javascript's "??" operator to assign a default value when the variable is undef... | <p>According to the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator#no_chaining_with_and_or_or_operators" rel="nofollow noreferrer">documentation</a>, you can't chain the nullish coalescing operator with AND or OR:</p>
<p>MDN:</p>
<blockquote>
<p>It is no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create and run two or more (multiple) servers in python asyncio with asyncio.Protocol<p>I would like to run two simple TCP servers in one script using... | <p>I've made some simple rearrangements to make the server work on two ports:</p>
<pre class="lang-py prettyprint-override"><code>###############################################################################
# echoserver.py
# Simple code to run EchoServer on two ports simultaneously
##################################... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Successfully authenticated B2B user can't query Microsoft Graph API<p>I have an AAD registered enterprise application set up as single tenant, allowing exter... | <p>I've solved the problem, so thought I'd provide an answer for anybody else that comes across this.</p>
<p>Basically, a B2B external user is only able to query the Microsoft Graph API about itself if I add the User.ReadBasic.All delegated permission to the registered application and grant it admin consent. With this ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to use different CSS libraries for different components in our react website?<p><strong>For example</strong>, I have 3 components==> <em>Ho... | <p>Sure you can, <em>I think the better question is if you should.</em><br />
Mixing frameworks would likely lead to in inconsistent UX. That's something normally avoided for non-technical reasons.</p>
<p>Still, sometimes you need to transition things slowly, and might have different parts of your software look differe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to subtract the last value from the first value for the same time<p>I have a csv file that looks like</p>
<div class="s-table-container">
<table class="s... | <p>You can use <code>groupby</code>.<a href="https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.GroupBy.first.html" rel="nofollow noreferrer"><code>first</code></a>/<a href="https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.GroupBy.last.html" rel="nofollow noreferrer"><code>last</code></a>:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails path for images with bootstrap<p>Hello i want to use a boostrap (in my rails app) Heroes with an image and to use it i need to use img and not image_ta... | <p>You can use <code>image_path</code> :</p>
<pre><code><img src="<%= image_path('test2.png') %>" class="img-fluid border rounded-3 shadow-lg mb-4" alt="Example image" width="700" height="500" loading="lazy">
</code></pre>
<p>Note that you can also... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.