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:
There is an iframe tag covering whole page preventing interaction with the app<p>I am working on a web app which another developer has developed. Every time ... | <p>Try adding this to your CSS:</p>
<pre><code>iframe {
pointer-events: none;
}
</code></pre>
<p>The pointer-events property allows for control over how HTML elements respond to mouse/touch events – including CSS hover/active states, click/tap events in Javascript, and whether or not the cursor is visible.</p>
<p>Non... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I create a decodable struct to match JSON nest from API?<p>I am trying to create a decodable struct that will store select data from an API called Mar... | <p>There are a couple of issues. Firstly, your JSON data is an array of objects and your struct is just an object. So, first create a struct to model each object. Also, using var in structs is not very useful considering structs have to be destroyed and recreated with a changed property to be modified (energy intensive... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selecting records assuming future dates in mysql<p>I used the following <em>select statement</em> to select sum of amount assuming no future dates. How do I ... | <p>Regards your existing query, surely you'd need AND, not OR, to ensure no future dates? Say it's July 2020 and you have a date of January 2021 which is in the future. If you say <code>MONTH('jan-2021') < MONTH('jul-2020') OR YEAR('jan-2021') < YEAR('jul-2020')</code> then this will be true because jan is earlie... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make CMake's FindJava get 64 bit Java with a 32 bit Visual Studio generator<p>I apply CMake to generate a Visual Studio 2017 solution to build a 32-bi... | <p>Analysing the code of <code>FindJava.cmake</code> showed that it is currently not possible to select the Java bitness manually as requested.</p>
<p>I've filed a change request for that: <a href="https://gitlab.kitware.com/cmake/cmake/issues/20306" rel="nofollow noreferrer">https://gitlab.kitware.com/cmake/cmake/iss... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recursion in Single File Components Vue.js 3<p>How to use recursive components in Vue3?</p>
<p>Using recursive components in Vue 3 like normal components cau... | <p><a href="https://vuejs.org/api/sfc-script-setup.html#using-components" rel="nofollow noreferrer">Documentation</a>:</p>
<blockquote>
<p>An SFC can implicitly refer to itself via its filename.</p>
</blockquote>
<p>Component can be imported via its filename, but without listing in in the <code>components</code> setup ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create white space between words and keep design responsive<p>I am trying to create a box with a list of descriptive characteristics to the left and c... | <p>Use flexbox for each row, and use <code>justify-content: space-between</code> to space out the items on the far ends of each box. Then you can adjust the width of the boxes accordingly, e.g. 30%:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PowerQuery grouping dates and rows by criteria<p>I have an extract from a much larger dataset which I'm trying to group.</p>
<p>The data is shown below and a... | <p>try below</p>
<p>trick is before grouping, (a) use Date.Month() to create a date column (b) Use a replacement on Product_Type when Product=Mortgage. I added Date.Year() as well because that will eventually come up</p>
<pre><code>let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Change... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does Stripe's webhook send the same event twice at about the same time?<p>I'm building a payment system using Stripe. After making a payment with Stripe,... | <p>You should write to Stripe Support, since only them can look into the event (evt_1LP4n0BB5Q5Dr2x7QDEfWFak) here.</p>
<p>My assumption is that you may mixed up and double triggered it by:</p>
<ol>
<li>Made a payment</li>
<li>Manually calling the resend command (Why would you need to use resend in the first place?)</l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python datastructure for keys being mapped to auto-increment integer value<p>I want to store a list of strings into a dictonary data structure, where the key... | <p>A dict with setdefault will work fine:</p>
<pre><code>d = {}
d.setdefault("a", len(d))
d.setdefault("b", len(d))
d.setdefault("a", len(d))
print(d) # a=0, b=1
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I append just one value in a dictionary using python<p>This is part of a project I am working on, my question is that I don't know why are the valu... | <p>This question is a variant of the mutable default argument question: <a href="https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument">"Least Astonishment" and the Mutable Default Argument</a></p>
<p>The problem is that you two lists for <code>A</code> and <code>B</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA Countdown Timer<p>I created a countdown timer in VBA from some code I found a while back. The issue is that if I duplicate the timer to use on a differen... | <p>You can duplicate <code>timelimit</code> and <code>countdown</code> objects on each slide you need. Just make sure those objects have exactly the same names. Then, you can get the active slide in a <code>Loop</code>. On activating another slide, the <code>countdown</code> object on that slide will be updating.</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I conditionally skip other filters in Spring Cloud Gateway?<p>I set GlobalFilter whose order is -1, to check if the jwt in request header is valid.
If no... | <p>Yes you can. In your example you have to break chain by returning empty <code>Mono<Void></code>. It should look like as following:</p>
<pre class="lang-java prettyprint-override"><code>@Order(-1)
@Component
public class JwtRequestFilter implements GlobalFilter {
@Override
public Mono<Void> filte... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to validate password input without using javascript?<p>is there a way to validate passwords without using JavaScript, only html?
What i have in mind is t... | <p>you can use pattern for validation and title for a title to show user what to use.</p>
<pre><code><input type="password" id="pass" name="pass" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generating FastText multi-label format<p>I want to apply FastText for my stack over flow tag predictor.</p>
<p>I have my tags as a dataframe:</p>
<pre><cod... | <p>Try:</p>
<pre><code>tags = ['__label__' + '__label__'.join(s) for s in df['Tags']]
</code></pre>
<p>Test:</p>
<pre><code>labels = [['foo'], ['bar', 'baz']]
j = '__label__'
[j + j.join(l) for l in labels]
# out: ['__label__foo', '__label__bar__label__baz']
</code></pre>
<p>It's also worth looking at <code>resul... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call component method inside sibling component without creating a service?<p>I have an angular project in which I have 3 components: container, sidena... | <p>To communicate between two Angular components there are multiple strategies such as:</p>
<ul>
<li>@Output() and @Input()</li>
<li>Service with Observables</li>
<li>Setters and Getters</li>
<li>Third party state management libraries (NgRx)</li>
<li>Component Injection</li>
</ul>
<p>Since you are not interested in the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I remove elements from a list in a Flask/jinja2 loop?<p>I am currently making a <code>flask</code> project, where I want to display four <code>Bootstr... | <p>If your actual use case is to split things into rows, you'll just want the <a href="https://jinja.palletsprojects.com/en/2.11.x/templates/#batch" rel="nofollow noreferrer"><code>batch</code> filter</a>.</p>
<pre><code>{% for row in things|batch(4) %}
<div class="row">
{% for item in row if item %}
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert json timezone object to java TimeZone using Gson?<p>The server provides next response:</p>
<pre><code>"timezone": {
"gmtOffset": 7,
"... | <p>It is someone`s custom fields set. Only custom deserializer may help.</p>
<pre><code>public class TimeZoneDeserializer implements JsonDeserializer<TimeZone> {
@Override
public TimeZone deserialize(
JsonElement jsonElement,
Type type,
JsonDeserializationContext json... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HMR for Local Vue.js App Over HTTPS Setup Shows Cross-Origin Request Blocked<h3>1. My Caddy version (<code>caddy -version</code>):</h3>
<p><code>v2.0.0-beta... | <p>I think I found the solution.</p>
<p>I had to change the <code>public</code> of <code>devServer</code> entry in <code>vue.config.js</code> file</p>
<pre class="lang-js prettyprint-override"><code>// vue.config.js file
module.exports = {
transpileDependencies: ['vuetify'],
devServer: {
public: 'https://fro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linked lists recursive function which deletes odd values from the list. (C)<p>Considering a list like 1->2->3->4->5<br>
Tlist is made like this: </p>
<pre><... | <p>The key is defining what <code>listDeleteOdd()</code> does. It returns a pointer to a list of nodes which is either empty or contains only even values — a 'clean list'.</p>
<p>Internally, it does that in three different operations:</p>
<ol>
<li>The input list is empty (NULL); return NULL (base case).</li>
<li>The... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EF Core 3.1.1 Avoiding the exception "The data types text and varchar are incompatible in the equal to operator" just as LINQPad 6 does<p>I am trying to run ... | <p>This seems to be caused by some change in EF Core 3.x infrastructure and/or SqlServer provider. LINQPad is irrelevant because it simply delegates the LINQ query to the underlying framework (apparently EF Core 2.x in your case).</p>
<p>According to SqlServer <a href="https://docs.microsoft.com/en-us/sql/t-sql/data-t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert date time to epoch up to day only<pre><code>const myTime = Date.now()
console.log(myTime) // 1659622334878
</code></pre>
<p>Now when I use it... | <p>To truncate the date to midnight UTC, try <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours" rel="nofollow noreferrer"><code>Date.prototype.setUTCHours()</code></a>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get sum of all columns greater than 0 except the highest values<p>I have a dataframe as follows:</p>
<pre><code>Group Val1 Val2 Val3 Val4
A ... | <p>Try this:</p>
<pre><code>df = df.set_index('Group')
df.where(df.ne(df.max(axis=1), axis=0) & (df > 0)).sum(1)
</code></pre>
<p>Output:</p>
<pre><code>Group
A 16.0
B 74.0
C 24.0
D 49.0
dtype: float64
</code></pre>
<p>Details:</p>
<p>Find max on each row, look for values in that row that are not equ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Splitting a column that contains Chinese Characters MySQL<p>So I have a table that has a column 'full_name' and it stores chinese names in the format surname... | <p>Hello Please test this:</p>
<p>First create a table:</p>
<pre><code>CREATE TABLE ChineseNames (FullName VARCHAR(5));
INSERT INTO ChineseNames VALUES
('王沐宸'),
('李浩宇'),
('张沐辰'),
('刘茗泽'),
('杨奕辰'),
('黄宇泽'),
('赵浩然'),
('吴奕泽'),
('王沐');
</code></pre>
<p>Then Let's write the code:</p>
<pre><code>SELECT FullName, LEFT(FullNam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if MongoDB is connected to MongoDB Atlas<p>I want to do a text search in MongoDB. In development I use a local mongodb, and in production I use MongoDB... | <p>I would say both of your suggestions are considered anti patterns and I would personally avoid both.</p>
<p>What I would personally do is very similar to your first suggestion but instead of checking the value of the connection string I would just use the <code>process.env.NODE_ENV</code> value, this is considered c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
$arrayToObject with duplicated key<p>considering the following document</p>
<pre><code> "logs": {
"events": {
"type... | <p>Based on <a href="https://stackoverflow.com/questions/72834486/how-to-couple-items-on-a-nested-array-in-mongodb">this answer</a>,
one option is:</p>
<pre><code>db.collection.aggregate([
{$set: {
"logs.events.attributes": {
$reduce: {
input: "$logs.events.attributes",
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nodejs_Uploading videos to youtube<p>i am able to uploading videos to youtube but while uploading i have to go through google authentication to select your a... | <p>You cant the way Oauth2 works is that a user must consent to your accessing their account. To do that you must popup a consent screen for them to accept </p>
<p>There is no other way around this.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problems with ordering numbers in strings w/ 2 decimals<p>So I have a list of version numbers, eg:</p>
<p><code>["1.11", "2.0.0", "1... | <p>You want to sort such that each number in that version is compared to another one in the same position as an <code>int</code>eger, so just split by dot, map to <code>int</code>, cast to <code>tuple</code> for the sorting key, then you can <code>join</code> that list and avoid using that <code>for</code> loop you hav... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make an html table with many nested accordion elements with bootstrap in react?<p>I need to make a table with several accordions that will be nested w... | <p>Nesting so many tables inside each other makes the HTML quite unreadable. Maybe you can try to make only the <code><tr></code> elements collapse instead of using a new <code><table></code> every time.</p>
<p>You can make accordions stay open by omitting <code>data-bs-parent</code></p>
<p><a href="https:/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make the javascript map, reduce syntax shorter and more readable?<p>How can I make the javascript map, reduce syntax shorter and more readable?</p>... | <p>Without knowing what the code does, this is the best suggestion I can make that appears to be functionally equivalent to the code in question:</p>
<pre class="lang-js prettyprint-override"><code>const short = itemList.reduce((min, item) => {
end.id = item.id;
end.floorName = +item.floor.id;
item.findPath = ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UITableViewController return to next text field in Cell<p>I have a UITableViewController and a class which implements UITableView.</p>
<pre><code>@interface... | <p>I'm pretty sure the problem lies in the line:</p>
<pre><code>UIResponder* nextresponder = [textField.superview viewWithTag:nexttag];
</code></pre>
<p><code>textField.superview</code> refers to the <code>contentView</code> of the cell containing <code>textField</code>. The other textfields are not descendants of th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need help to create Confusion Matrix and Prediction Code<pre><code>model_SVC = SVC(C=1000,gamma=0.1, kernel='rbf')
model_SVC.fit(X_train,Y_train) #CASIA2
pr... | <p>I have used your code along with some random code to generate data and <a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.ConfusionMatrixDisplay.html" rel="nofollow noreferrer">ConfusionMatrixDisplay</a> to generate the confusion matrix. You can change the parameters as required to suit your ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove excess array braces due to multiple nested map function<p>I created multiple nested map function of an object array and I ended up in the kind of outp... | <p>Try <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat" rel="noreferrer"><code>Array#flat</code></a> with <code>depth</code> of <code>infinity</code>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="sni... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data not passing between components using Service<p>I want to pass values from one Components to another but my code not working. Values on next page showing... | <p>You have provided your service in the level of components.It means that each of your components have a different instance of <strong>UtilityService</strong> service.You should provide your service in the module that has included your components to its <strong>declarations</strong> array.</p>
<p>An example code:</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What will be the possible issues with this implementation of Binary Tree?<pre><code>class BTNode{
public:
int data;
BTNode left;
BTNode right;
};
</code></pr... | <p>The purpose of a node in a binary tree is to store the data and <em>point</em> to its two child nodes.</p>
<p>In your implementation, instead of <em>pointing</em> to the child nodes you have <em>stored</em> the child nodes in the parent node. So basically, the root node contains everything. But the data is replicat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interpolating NA values within group (long-format data)<p>I am trying to interpolate missing NA values within a data frame that is in "long-format,"... | <p>Group by <code>company</code> (not <code>sales</code>):</p>
<pre class="lang-r prettyprint-override"><code>df %>%
group_by(company) %>%
mutate(sales=zoo::na.approx(sales)) %>%
ungroup()
# # A tibble: 20 x 3
# day company sales
# <int> <chr> <dbl>
# 1 1 walmart 1
# ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Apim Set-AzApiManagementPolicy gives Entity with specified identifier not found<p>I'm trying to write some PowerShell that will copy an api and policy ... | <p>I needed to copy the source policy to a string rather than reference directly when assigning to the target operation.</p>
<p>The following did the trick:</p>
<pre><code>param ($tempFolder = "c:\robtemp")
Connect-AzAccount
Set-AzContext -Subscription "x"
$ctx = New-AzApiManagementContext -Resource... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the best way to store a ToDo on Firestore?<p>I recently followed the <a href="https://youtube.com/playlist?list=PLl-K7zZEsYLkTjfUJvjiPZ14F5c81uDuN" r... | <p>If you default the <code>completionDate</code> to a timestamp very far in the future, you can get all documents that were completed in the past 24h and that are not yet completed with a single query on that field.</p>
<pre><code>todoRef.whereField("completionDate", isGreaterThan: timestampOfYesterday)
</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save env variable value not definition<p>I'm working on a github actions workflow and have sent an environment variable:</p>
<pre><code>env:
rundate: $(dat... | <p>You're trying to set the value of a variable to the result of executing a shell script. You can't do that in the <code>env</code> section of a github action, which can only have static values (or references to context values, like <code>${{ github.ref }}</code>). In this case, you're simply setting the value of <cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SUM a column in SQL, based on DISTINCT values in another column, GROUP BY a third column<p>I'd appreciate some help on the following SQL problem:</p>
<p>I ha... | <p>Given what we know at the moment this is what I'm thinking...</p>
<p>The CTE/Inline view eliminate duplicates before the sum occurs.</p>
<pre><code>WITH CTE AS (SELECT DISTINCT ID, Group, Value FROM TableName)
SELECT ID, Sum(Value)
FROM CTE
GROUP BY ID
</code></pre>
<p>or</p>
<pre><code>SELECT ID, Sum(Value)
FROM (... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove a 2-tuple of int/float from a list in a loop?<p>So if I were to have a list:</p>
<pre><code>x = [(1,3.),(2,4.),(5,6), (6,6.)]
</code></pre>
<... | <p>You can use a list comprehension :</p>
<pre><code>x = [item for item in x if item[1] != 6]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to group a calculated column by multiple columns?<p>Hello I have this dataframe as listed underneath.</p>
<pre><code>import pandas as pd
db_docks = pd.... | <p>If you group your DataFrame by <em>hour</em>, <em>day</em> and <em>from_station_id</em>, then
each group will contain just <strong>one</strong> <em>from_station_id</em>, so there is no point
to count the amount of different values.</p>
<p>So maybe you want to group on <em>hour</em> and <em>day</em> <strong>only</st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS Athena V2/PrestoDB: Reference left-hand row in right-hand subquery<p>I have a usecase where I need to support recursive relationship fetching, with a pos... | <p>You can simulate this behaviour using <code>row_number</code> window function:</p>
<pre class="lang-sql prettyprint-override"><code>-- sample data
WITH artists(ArtistId,Name) AS (
VALUES (1,'AC/DC'),
(2,'Accept'),
(3,'Behemoth')
),
albums(AlbumId,Title,ArtistId) as (
VALUES (1,'For Those Abou... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to exclude a file mask from a BizTalk receive location?<p>I have a receivelocation in a folder where we pull all files, <em>.</em> </p>
<p>We... | <p>No, you can't.</p>
<p>You will have to update your original receive location so that it does not wildcard pick up everything. If you have more than one file mask that the port needs to pick up, then you will have to create a receive location on that same port for each of them.</p>
<p>And create a port with a rece... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Before asking for permissions Android application closed ? How resolve that?<p>The first time I install this application, and when I launch MapsActivity, I a... | <p>I'm not able to put comment,Thus forward my answer as post.</p>
<p>you may should describe about your problem more but do you add <code>ACCESS_FINE_LOCATION</code> and </p>
<p><code>ACCESS_COARSE_LOCATION</code> to your Manifest file?</p>
<p><strong>EDIT:</strong>
just change <code>onPause</code> to following:</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UWP ListView selected item highlight disappears if ItemContainerStyle is set<p>I am using a <code>ListView</code> to display a list of items. But when I set ... | <p>The reason for this behavior is that when you set a new <code>ItemContainerStyle</code> for the listview, it overrides the default item style that is used from the WinUI library.</p>
<p>The solution to this is that you need to give the item a style based on the style that the item is currently using. I find the defa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scrapy. find a tag by its content<p>How to find a tag by its content? This is how I find the necessary elements, but the structure on some pages is different... | <p>Check out the code sample</p>
<pre><code>In [4]: i = response.xpath('.//span[contains(text(),"Education")]')
In [5]: i
Out[5]: [<Selector xpath='.//span[contains(text(),"Education")]' data='<span class="listing-h2 h2-style">Edu...'>]
In [6]: i.xpath('following-sibling::span[1]/text()').extract()
Out[6... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Having trouble understanding how HStack content works with fluid widths<p>I've been running into a pretty consistent problem with how views inside <code>HSta... | <p>Actually you're right, but there are just default List/Form insets, which can be either changed or removed.</p>
<p>So all you need is</p>
<p><a href="https://i.stack.imgur.com/La8nf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/La8nf.png" alt="demo1" /></a></p>
<p>that gives on Xcode 13.4 / iOS ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculator app does not open in Appium Inspector in Mac when launched iOS Simulator from it<p>I have been trying to launch Calculator app in Appium Inspector... | <p>The Calculator app is unavailable on iOS Simulator. </p>
<p>If you experiment with testing, try a different app like Settings or Shortcuts (you can create shortcuts to calculate things).</p>
<p>If you need to test the Calculator app, switch to testing with real devices.</p>
<p>Good luck!</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where to store complex data in the navigation-based application<p>I have an app that has a lot of data that I need between the pages, such as:
design setting... | <p>I think that your solution is something between a session implementation (in memory or using Room) and a <code>ViewModel</code> for the parts where a screen depends on another. If it is a flow I recommend you to use a way to share the <code>ViewModel</code> between the fragments like <a href="https://developer.andro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
shaping tf.Data as input for LSTM layer fails with incompatible dimensions<p>I'm trying to build a neural network that predicts the next number from a simple... | <p>Try adding the additional dimension to your data, since a <code>LSTM</code> layer needs the input shape <code>(timesteps, features)</code> <strong>without</strong> the batch size. This layer also requires floating data and not integers. Also, if you are use <code>categorical_crossentropy</code>, your labels need to ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to combine images of different color modes using EBImage?<p>I have around 400 images which I want to combine using <code>abind</code> function of <code>E... | <p>The images all need to have the same color mode. If you convert your grayscale images to RGB, then you can use <code>abind</code> and won't lose any information in the process.</p>
<pre class="lang-r prettyprint-override"><code>library(EBImage)
img1 <- readImage(system.file("images", "sample-color... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React: Handling Events - parameter visibility<p>I am following React Doc. In '<a href="https://reactjs.org/docs/handling-events.html" rel="nofollow noreferre... | <p>This is how this.setState works, its an updater callback passed for <code>this.setState()</code>, as per react <a href="https://reactjs.org/docs/faq-state.html#what-is-the-difference-between-passing-an-object-or-a-function-in-setstate" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>Passing an up... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you divide the string in pumping lemma?<p>For example, let us prove L = {0^n1^n | n ≥ 0} is irregular.</p>
<p>To prove a language is irregular, dispr... | <p>You are using <code>n</code> for two things: in the defintion of the language as well as for the constant of the pumping lemma. Let us use <code>n_0</code> for the constant. In your condition (iii) the last statement should be <code>|uvw| \geq n_0</code> without the exponent <code>i</code>.</p>
<p>Now we can choose... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to access Instagram messages from Facebook Graph API Explorer<p>I am trying to access Instagram messages from the Facebook Graph API Explorer.</p>
<p>... | <blockquote>
<p>"message": "(#298) Reading mailbox messages requires the extended permission read_mailbox",</p>
</blockquote>
<p>That permission existed in the early days of the API, when it was still possible to read the mailbox of a user account.</p>
<p>Since you are getting that message here, thi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transform a df into individual observations<p>I want to transform a df from a "counting" approach (number of cases) to a "individual observati... | <p><code>uncount()</code> from <code>tidyr</code> can do that for you.</p>
<pre class="lang-r prettyprint-override"><code>df |> tidyr::uncount(cases)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make the number of rows after narrowing-down<p>This is my serializer.</p>
<pre><code>class MixSerializer(serializers.ModelSerializer):
pub_date = seriali... | <p>Well ID is the actual ID in the database, which you don't want to change or override in your queryset (or elsewhere such as your template) because then you would be referring to a different model object, which will cause you problems.</p>
<p>If you want to use ID as some sort of ranking then you have some options, r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign a sequence number for user correspondence. PHP5&MySQL<p>I need to assign a serial number for each existing correspondence in the database for further ... | <p>Thanks to @Chris Haas who gave me the right direction.</p>
<p>Here is the final code that worked exactly as I wanted:</p>
<pre><code>if (!function_exists('CreateTables')) {
function CreateTables(){
global $bdname,$db,$messagetable;
mysql_query("CREATE TABLE IF NOT EXISTS `message_chats` (
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel Format Painter but for Number Format Only<p>Whenever I want to make a number format of a cell same with another cell that I wanted, I always use the Fo... | <p>You can use cell styles for this. Create a new cell style and in the dialog untick all the formatting options you don't want to include, i.e. keep only the number format.</p>
<p>After that, you can have all kinds of font/fill/whatever format and apply the style to the cell. The number format will be applied, but the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sending and receiving emails with GCP<p>I'm switching from a shared hosting provider to GCP. I have a domain name (domain.com), and on the shared hosting I j... | <p>Mailgun sounds like a good option to use, if you're still planning to use it on GCP, check that you've created a firewall rule to allow outbound traffic <a href="https://cloud.google.com/compute/docs/tutorials/sending-mail#email_custom_port" rel="nofollow noreferrer">[1]</a>. This step might be the reason why you're... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: How to get a value from randomly selected key in a dictionary<p>What I'm trying to do here is to get a random choice from a list</p>
<pre><code>races... | <p>You can simply use <code>.get</code> on the dictionary.</p>
<pre><code>DEFAULT_VALUE = "default value"
subraces = {
'Dwarf': ['Hill Dwarf', 'Mountain Dwarf'],
'Elf': ['High Elf', 'Wood Elf', 'Dark Elf'],
'Halfling': ['Lightfoot', 'Stout'],
'Gnome': ['Forest Gnome', 'Rock Gnome... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove "Toggle Downloadable" from WooCommerce Variations tab<p>I used the code below and the <code>Toggle Downloadable</code> is still visible under t... | <p>Well been years not using woo, but I remember there was an option to remove them.</p>
<p>on <code>WooCommerce->Settings->Advanced</code> remove the entry for downloadable in the Account section, just leave it empty. All done, it shouldnt be displayed anymore.</p>
<p><strong>Option 2</strong></p>
<p>You can ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CannotPullContainerError: Error response from daemon: pull access denied for ECR Repo Image, repository does not exist or may require 'docker login'<p>I have... | <p>I fixed it by adding the following policy to the ECR repo in SourceAccount:</p>
<pre><code>{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowCrossAccountPull",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<TargetAccount>:root"
},
"Action": "ecr:*"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why in this case order of conditions matter?<p><strong>Hi everyone</strong></p>
<p>First of all sorry for the dumb question.</p>
<p>I'm a newbie and can't re... | <p>That's because when <code>prop</code> is <code>'tracks'</code> one of the following two conditions
will always be <code>true</code></p>
<pre><code>} else if (prop === 'tracks' && !records[id].hasOwnProperty(prop)) {
records[id][prop] = [value]
} else if (prop === 'tracks' && records[id].hasOwnPrope... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C6011 in C++ and Python project<p>I am in my third CS class online and I have done ok until now but I am really struggling with this. My code runs fine throu... | <p>OK so a big THANK YOU to @PaulMcKenzie in the comments for pointing me in the right direction...<br />
Turns out the issue was not in my <code>.cpp</code> file but in fact in the <code>.py</code> file that it was reading.</p>
<p>I had used the Python syntax :</p>
<pre class="lang-py prettyprint-override"><code>print... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why are '[' and ']' ascii codes not following each other?<p>Does anyone know why the design decision of having '[' and ']' or '{' and '}' ASCII key codes bei... | <h2>Evolution of Character Codes</h2>
<p>Have a look @ the following article: <a href="https://web.archive.org/web/20050305043226/http://www.transbay.net/~enf/ascii/ascii.pdf" rel="noreferrer">https://web.archive.org/web/20050305043226/http://www.transbay.net/~enf/ascii/ascii.pdf</a></p>
<p>I found it from the follow... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apache Camel onException Custom Error Handler is not working<p>I am new to apache camel features. So I have a problem with the <strong>DefaultErrorHandler</s... | <p>So after a deep analysis, I found that I'd to resolve this issue with the service that we called in the application by extending the RouteBuilder class like this.</p>
<pre><code> @Override
protected ErrorHandlerFactory createErrorHandlerBuilder() {
DefaultErrorHandlerBuilder errorHandlerBuilder = super.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell: variable date insertion into url strings<p>I need to dynamically alter the date part in various urls for webscraping purposes. Both the date and ... | <p>Here's a custom function that will do what you seek in a simplified manner without all of those split.</p>
<p><strong>Usage</strong></p>
<pre><code>Write-Host 'Start date only' -ForegroundColor Cyan
Get-Url -StartDate (get-date).AddDays(-1)
Write-Host 'Start date + End date' -ForegroundColor Cyan
Get-Url -StartDat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select all columns where one column has rows that end with '006'<p>I'm using dplyr and I want to select all the columns on the table but return only t... | <p>Use <code>str_ends</code> from package <code>stringr</code>:</p>
<pre><code>df %>% filter(str_ends(sample_id, "006"))
</code></pre>
<p>By default the pattern is a regular expression. You can match a fixed string with:</p>
<pre><code>df %>% filter(str_ends(sample_id, fixed("006")))
</code></... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tensorboard callback with keras fit_generator, 'Function' has no attribute 'fetch_callbacks'<p>I am trying to run a model using keras's <code>fit_generator</... | <p>I ended up using <code>tf.keras</code> fit function instead of fit generator and it worked correctly as expected:</p>
<p><code>m.fit(x=train_gen, epochs=5, steps_per_epoch=500, use_multiprocessing=True, workers=8, callbacks=[tensorboard_callback])</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make "big steps" while auto-filling Google Sheets cells?<p>If I pull down cells with <code>=A2</code>, it will be replaced by <code>=A3</code>, <code>... | <p>try this and drag down:</p>
<pre><code>=SMALL(INDIRECT("C"&66+(ROW(A1)-1)*24&":C"&89+(ROW(A1)-1)*24); 1)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a random number generator that can be used for repeatable testing in PHP?<p>Currently we are using the built in random number generator that can be ... | <p>From PHP 8.2 you are able to use the <a href="https://wiki.php.net/rfc/rng_extension" rel="nofollow noreferrer">new random extension</a>.</p>
<p>This extension was designed to address some of the types of issue you are experiencing with the current random number generators in PHP. The details of it are:</p>
<h2>It i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error TS2345: Argument of type '{ headers: HttpHeaders; }' is not assignable to parameter of type 'RequestOptionsArgs'<p>This is the result I get when I run ... | <p>You should do that import :
<code>import { Http, Headers, RequestOptions } from '@angular/http';</code>.</p>
<p>The DI Injection from http is ok. Then simply use <code>RequestOptions</code> as follow: </p>
<pre><code>sendPostRequest() {
let headers = new Headers({'Content-Type': 'application/json'});
// h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data inconsistancy: Parent table is not updated while Child table is updated<p>I have two tables: <strong>Customer</strong> (parent) and <strong>Orders</str... | <p>The effect you might see here is called the "lost update" phenomenon, which you can protect yourself from by using optimistic locking with a <code>@Version Long version</code> field. Read up on the topic on the internet and you will probably see very fast how a concurrent transaction that updates customer ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
APScheduler is not starting on runserver in django<p>I followed a particular tutorial to implement <code>APScheduler</code> in my application but when I run ... | <p>I need to ask simple question... Are you sure you include your <code>reports</code> app in <code>INSTALLED_APPS</code> under <code>settings.py</code> file?</p>
<p>You should write it this way:</p>
<pre class="lang-py prettyprint-override"><code>INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to fix a reference error when using Gulp 4, It won't watch my sass nor show the changes in the browser<p>I can't seem to figure out what the error... | <p>Change </p>
<p><code>const watch = gulp.parallel(watchFiles, initBrowsersync);</code></p>
<p>to</p>
<p><code>const watch = gulp.parallel('watchFiles', initBrowsersync);</code></p>
<p>When using the <code>gulp.task('watchFiles',...</code> way of defining tasks, then your other references to that task must be as a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
react gets stuck after i resize the browser window<p>I used react-simple-image-slider for image slider on my website, but after i resize the browser window t... | <p>You forgot a dependency list for <code>useLayoutEffect</code> so it's adding an event listener on every render. Add an empty list for one-time execution:</p>
<pre><code>useLayoutEffect(() => {
function updateTheWidthAndHeight() {
setwidthAndHeight([window.innerWidth, 600]);
}
window.addEventListener(&qu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optimizing a min/max query in Postgres on a table with hundreds of millions of rows<p>I have a query that is trying to find the max value of a column after g... | <p>I resolved this by using PL/pgSQL to iteratively process chunks of the table and update the max input_tx_time after each chunk. This seems like a really good way to process large tables and it might help others. For example:</p>
<pre class="lang-sql prettyprint-override"><code>create or replace function processed.to... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extracting the relative influence from a gbm.fit object<p>I am trying to extract the relative influence of each variable from a gbm.fit object but it is comi... | <p>I have solve this issue now myself.</p>
<p>The <code>relative.influence()</code> function can be used and works for objects created using both <code>gbm()</code> and <code>gbm.fit()</code>. However, it does not provide the plots as in the <code>summary()</code> function.</p>
<p>I hope this helps anyone else looking ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python on Windows: "Access is denied" sometimes when calling win32gui.SetForegroundWindow()<p>In Python 3.10.5 on Windows 11 using the win32gui module, I wan... | <p>This is a limitation of the operating system. Microsoft's <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow" rel="nofollow noreferrer">documentation</a> explains in detail when it prevents the foreground window from being set with <code>SetForegroundWindow</code>:</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make my player run on a floating platform?<p>I am struggling to make my player run on a floating platform that hovers horizontally from right to lef... | <p>The problem seems to be your coordinates are stored in tuples like <code>(10,15)</code> to indicate x-coordinate of 10 and y-coordinate of 15. However, <code>where_to_run</code> should contain a range of x coordinates only so you should only give the 1st element of the tuple with <code>[0]</code>. Also, you need to ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RegEx IP Adress bug<p>in my react app I have a Input that validates if the string is an IPV4 Address or not.</p>
<p>This is my RegEx:</p>
<pre><code>^(25[0-5... | <p>I used it like this in my code:</p>
<pre><code>const ipAddressValidationRegExString = '^(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])$'
</code></pre>
<p>and the problem was the <code>\\</code></p>
<p>Correct regex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
react - map is not a function<p>so i need to uplift state from <code>SingleRowComponent</code> to <code>UpdateMessageBoxComponent</code>, in which i want to ... | <p>the issue was the <code>handleRowState</code> function inside <code>UpdateMessageBoxComponent</code> wrongfully assigning the inner <code>content</code> from single <code>row</code> as the entire state</p>
<p>not working</p>
<pre><code> function handleRowState(i, data) {
let copy = state
copy[i] =... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove CSS classes without properties via regular expression<p>I have these CSS codes.</p>
<pre><code>.class-1,
.class-2,
class-3 {
}
.class-4,
class-5 ... | <p>From the comments and credits for the final pattern to @<a href="https://stackoverflow.com/users/548225/anubhava">anubhava</a>, for the example data you could use:</p>
<pre><code>^(?:[^{}\r\n]*\R)*+[^{}]+{\s*}\s*
</code></pre>
<p><strong>Explanation</strong></p>
<ul>
<li><code>^</code> Start of string</li>
<li><c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Backup of AWS ec2 root drive<p>I have an ec2 instance with one volume as root drive.</p>
<p>I've set a AWS backup of the volume, is this the best procedure ... | <blockquote>
<p>I can't work out if restoring the volume and attaching it to an
instance will bring it back, or if using ec2 backup and restoring will
also bring back the information on the volume.</p>
</blockquote>
<p>Both will work. The EC2 backup will be a little easier to recover because you won't have to ma... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert Double (number of days since Dec 30, 1899) to Date in Swift?<p>I have a double value that represents the number of days since December 30, 1899 (the ... | <p>One way is to get a <code>Date</code> representing "1899-12-30", then call <code>addingTimeInterval</code>.</p>
<pre><code>// either parse a date string...
let formatter = DateFormatter()
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.dateFormat = "yyyy-MM-dd"
let epoch = formatter.date(from: "1899-12-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mariadb json query to get parent keys of specific child value<p>I got clients with contracts stored in json format in a mariadb database (10.3.21).</p>
<p>T... | <p>Try:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT
REGEXP_REPLACE(
JSON_SEARCH(@`json`, 'all', '1', NULL, '$**.cb'),
'[$.]|[.cb]',
SPACE(0)
) `json_result`;
</code></pre>
<p>See <a href="https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=40775bbc03c72636fabbb810c14f639e" rel="nofollow... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
/etc/environment in Linux EC2<p>I wanted to set Path for JAVA_HOME for systemwide (all users) in in linux EC2 machine so i tried below</p>
<pre><code> vi /e... | <p>It appears that you have overwriten or omitted the base system path. Try this:</p>
<pre><code>PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
JAVA_HOME="/usr/local/java/jdk1.8.0_221"
PATH="$PATH:$JAVA_HOME/bin"
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unix Script Showing "Command Not Found" When Reading<pre><code>echo "Enter the current time: "
read h m s
s = `expr $n + 1`
if [ $n -eq 60 ]; then
s ... | <p>If you type <code>s = 0</code> in a bash prompt, you will get <code>bash: s: command not found</code>.</p>
<p>The correct way to assign a variable in bash is <code>s=0</code> without the spaces.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Application Insights - How to display a row with default values if the kusto query returned no results?<p>I am using the below Kusto query in the Azure... | <p>You <em>could</em> do it in various ways, like unioning with an empty row:</p>
<pre><code>let emptyRow = datatable( Values: string, ["Apdex Score"]: double, ["Apdex Interpretation"]: string, ["Satisfied Users"]:long, ["Tolerating Users"]: long, ["Frustrated Users"]: ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google App Script + Google Sheet - Fetch URL from cell (which links to separate sheet) and pull in sheet tab from linked sheet<p>I've been working/researchin... | <p>Change this line:</p>
<pre><code>var SPREADSHEET_URL_VALUE = SPREADSHEET_URL_REFERENCE_SOURCE_RANGE.getValues();
</code></pre>
<p>to this </p>
<pre><code>var SPREADSHEET_URL_VALUE = SPREADSHEET_URL_REFERENCE_SOURCE_RANGE.getValue();
</code></pre>
<p>In other words remove the s at the end. If you don't then the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update nested value in object using react hooks<p>I am trying to update the nested key and value pair using hooks.</p>
<p>I set the data in useEffect ... | <p>You have to put <code>name</code> in square brackets:</p>
<pre><code>const handleChange = (e) => {
let name = e.target.name;
let value = e.target.value;
setData({
...data,'Member':{
...data['Member'], [name]:value
}});
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can we get an average in row wise for multiple columns in Dataflow ADF?<p>Please refer the pic, I have to do that same thing but using dataflow</p>
<p><a hre... | <p>Create <code>Derived column activity</code> this activity helps you to create a new column trough data flow, give column name what you want and in expression give.</p>
<pre class="lang-sql prettyprint-override"><code>(col1+col2+col3)/3
</code></pre>
<p><a href="https://i.stack.imgur.com/HtyV1.png" rel="nofollow nore... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use CC_DENY and CC_ALLOW of the CSF firewall<p>How to use CSF Firewall features:</p>
<ul>
<li>CC_DENY</li>
</ul>
<p>and</p>
<ul>
<li>CC_ALLOW</li>
... | <p>Use <code>CC_DENY</code> to block countries in your server</p>
<p>or</p>
<p>Use <code>CC_ALLOW</code> to whitelist countries in your server</p>
<p>Allowed values are two-letter ISO Country Code(s) e.g. "US,GB,DE"</p>
<p>Caution must be taken when using this setting as you might completely block yourself or your ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simulate Kafka CommitFailedException<p>I am trying to simulate the CommitFailedException thrown by Kafka. </p>
<p>I am manually setting the "session.timeout... | <p>Kafka uses heartbeat mechanism via a <strong>separate thread</strong> to check health of a consumer. The consumer heartbeat thread must send a heartbeat to the broker before <code>session.timeout.ms</code> time expires.</p>
<blockquote>
<p><strong>heartbeat.interval.ms:</strong> The expected time between heartbea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wait until curl command has finished<p>I'm using curl to grab a list of subscribers. Once this has been downloaded the rest of my script will process the fil... | <p>As noted in the comment, curl will not return until requests is completed (or failed). I suspect you are looking for a way to identify errors in the curl, which currently are getting lost. Consider the following:</p>
<ol>
<li>If you just need error status, you can use bash pipefail option <code>set -o pipefail</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to update secrets manager secret value from lambda function?<p>I have a access token retrieved from an api and its lifetimes is 5 hours. I saw that secre... | <p>You didn't mention which AWS SDK you are using, but here is an example for AWS SDK for JS to create or update a Secret.
Additionally, it handles the case for deleted secrets (SecretsManager doesn't delete secrets immediately, it marks them as scheduled for deletion) and restores and updates them.</p>
<pre class="lan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kafka enable.auto.commit = true and commitSync() is used<p>It is recommended that <code>commitSync()</code> should only be used when <code>enable.auto.commit... | <p>If <a href="https://kafka.apache.org/documentation/#consumerconfigs" rel="nofollow noreferrer"><code>enable.auto.commit</code></a> is set to <code>True</code> then the consumer's offset are periodically committed in the background. On the other hand, <a href="https://docs.confluent.io/current/clients/consumer.html#s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Space between but its two divs inside a div inside a div (not working)<p>I'm starting with HTML,CSS and JS and I'm trying to do a weather App. I want it to h... | <p>I made this <a href="https://jsfiddle.net/pus3jmLh/7/" rel="nofollow noreferrer">JSFiddle</a> that may answer you question but I'm not 100% sure if it's what you're looking for. It should scale as I've used <code>vw</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Add youtube videos into webpage<p>I want to add a video into my website.</p>
<pre><code> <p><iframe src="https://www.youtube.com/channel/UCh... | <p>If you check your browser's developer tools, you'll see the following error:</p>
<blockquote>
<p>Refused to display '<a href="https://www.youtube.com/channel/UChgO7gy5HjRQXuj9hMJQXkw/playlists" rel="nofollow noreferrer">https://www.youtube.com/channel/UChgO7gy5HjRQXuj9hMJQXkw/playlists</a>' in a frame because it ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
show alert bootstrap when mail sended without new page<p>I would like to display an alert after sending an email as in this portfolio: <a href="https://www.m... | <p>You can achieve this using AJAX. Try this</p>
<p>contact.php file</p>
<pre><code>if(isset($_POST["send"])){
$body = $_POST['message'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail-&... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.