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:
Whats the correct way of declaring folder path in python?<p>I Need to know whats the correct way of declaring folder path , suppose I have a <strong>dummy.py... | <p>The use of './' is not obligatory if you're requesting files from a folder that is on the current path.</p>
<p>So, in this example you don't need to use './' :</p>
<pre><code>images/image22.img
</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 way to show KeyBindings with the JMenuBar similar to how is natively shown on MacOS?<p>I'm using Java Swing to try and build an application that f... | <p>See <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/menu.html" rel="nofollow noreferrer">How to Use Menus</a></p>
<p><a href="https://i.stack.imgur.com/PQUBV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PQUBV.png" alt="enter image description here" /></a></p>
<pre><code>impo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle sql Order By number and char inside<p>I'm quite new to sql so I don't fully understand what I'm doing. My question is, how can I order by this data, t... | <p>The immediate problem is that you are incrementing the positionas well as the occurrence; so</p>
<pre><code>REGEXP_SUBSTR(string, '\d', 2, 2)
</code></pre>
<p>should be</p>
<pre><code>REGEXP_SUBSTR(string, '\d', 1, 2)
</code></pre>
<p>But you're overcomplicating it, and not handling multiple-digit elements, either w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Solve Catastrophic Backtracking in my regex detecting Email<p>I have regex</p>
<pre><code>/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,4})+$/
</code></pre>
<p>for ... | <p>A good place to start is this: <a href="https://stackoverflow.com/questions/12841970/how-can-i-recognize-an-evil-regex">How can I recognize an evil regex?</a></p>
<p>As one of the answers there says, the key is to avoid "repetition of a repetition". For instance, given <code>(\w+)*</code> and the input <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
docker nginx does't serve static files through upstream Next.JS<p>I couldn't find an answer to my question from other similar questions.</p>
<p>So, I have tw... | <p>So, the problem was in a wrong path for <code>mime.types</code> file in nginx.conf and default location paths in <code>includes/general.conf</code> file.
After I changed it from: <code>mime.types</code> to <code>/etc/nginx/mime.types</code> it start working again.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Application gets 404 error on TomCat<p>how are u?</p>
<p>I'm doing a Spring Boot Application and i'm getting the 404 error on TomCat. I'm using Maven ... | <p>I changed the JRE_HOME (was running java 8) to the same path of JAVA_HOME which is with Java 11, and it worked. Tomcat was on Java 8 and my project was running Java 11.</p>
<p>Log:
<code>Using JRE_HOME: "C:\Program Files\Java\jre1.8.0_333"</code></p>
<p>My POM.xml:
<code><java.version>11</j... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
regex convert to object<p>I'm trying to get the value as regex as follow:</p>
<pre><code>from textx import metamodel_from_str
def test_get_hosts2():
gr... | <p>The easiest way is to use textX's <a href="http://textx.github.io/textX/latest/grammar/#repetition-modifiers" rel="nofollow noreferrer">repetition modifiers</a> for matching a sequence of comma-separated values. Basically, whenever you match zero-or-more or one-or-more etc. you can add modifier in the square bracket... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to dynamically config prometheus scrape config<p>origin file is :</p>
<pre><code>global:
scrape_interval: 5s
evaluation_interval: 5s
alerting:
ale... | <p>Indeed, job name should be declared beforehand:</p>
<pre><code>scrape_configs:
- job_name: 'node'
file_sd_configs:
- files:
- 'targets.json'
</code></pre>
<p>See <a href="https://prometheus.io/docs/guides/file-sd/" rel="nofollow noreferrer">https://prometheus.io/docs/guides/file-sd/</a></p>
<blockquote>
<p>B... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why must display be initialized when setting palette?<p>I want to manually create and save a color-indexed image (palette) as a PNG file, using pygame :</p>
... | <p>The reason is because the pygame source says so :)</p>
<p>But I couldn’t find any reason it was necessary, so I recently removed that check in <a href="https://github.com/pygame/pygame/pull/3259" rel="nofollow noreferrer">https://github.com/pygame/pygame/pull/3259</a>.</p>
<p>So this will not be the case in the next... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My List that auto calculates prices by amount of product wont accept amount of product<p>I am trying to make a list where u can put in the amount of product ... | <p>Change id of <strong>Rasierschaum</strong> to <strong>RasierschaumAmount</strong>. It will work!</p>
<pre><code> <!DOCTYPE html>
<html>
<body>
<table>
<tr>
<th>Kosmetikartikel</th>
<th>Menge</th>
</tr>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transpose specified columns columns to rows with grouped data<p>I have a dataframe like this:</p>
<pre><code> household person R01 R02 R03 R04 R05
1 ... | <p>Referring to my <a href="https://stackoverflow.com/a/72230856/10068985">previous answer</a>, you can transpose the matrx within <code>group_modify()</code>:</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
df %>%
group_by(household) %>%
group_modify(~ {
mat <- t(.x[-1][1:nrow(.x)])... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to separate column content in mysql?<p>I have this mysql table:</p>
<pre><code>QA_CONTACT_NAME
'ARAJKONWAR'
'BOONKUAN/CHEECHENG'
'CHEECHENGLAM/KFC'
</cod... | <p>To produce an additional row, you need to join to say if you should be looking at the left or right:</p>
<pre><code>select
QA_CONTACT_NAME,
substring_index(QA_CONTACT_NAME,'/',if(left_side,1,-1)) QA_EMAIL
from (select 1 left_side union all select 0) left_or_right
join yourtablename on instr(QA_CONTACT_NAME,'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL - Split SELECT query (WHERE IN) into two rows<p>So, I am using MySQL to do a query and have a database like this:</p>
<p><a href="https://i.stack.imgur... | <pre><code>SELECT
M.merk AS 'Merk',
COUNT( T.amount ) AS 'Jumlah Transaksi',
SUM( T.amount ) AS 'Total Amount'
FROM
tb_transaksiatm T
INNER JOIN tb_issuer I ON
T.nomor_kartu LIKE CONCAT(I.prefix, '%')
INNER JOIN tb_terminalatm M ON
T.terminal = M.nomor_terminal
WHERE
I.bank IN ('A', 'C') # D... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Listview.Builder inside bottom sheet widget not loading data on load<p>The below code does not display any data when the bottomsheet loads. Once the ... | <p>I don't prefer using <code>FutureBuilder</code> inside <code>StatefulWidget</code>., it will recall the API(<code>future</code>) on every <code>setState</code>. As for comment it is missing <code>setState</code> after initializing the data.</p>
<pre class="lang-dart prettyprint-override"><code> @override
void in... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make sql sequelize query with nested relations where clause<p>Im currently working on a budget tracking web app that has the corresponding database se... | <p>Assuming that you have associations look like this:</p>
<pre class="lang-js prettyprint-override"><code>// these definitions are simplified for demonstration purposes
User.hasMany(Account);
Account.hasMany(Transaction);
Account.belongsTo(User);
Transaction.belongsTo(Account);
</code></pre>
<p>We can get all user's t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a dynamic map in Terraform?<p>I have created 2 modules. One for SQS and another for SSM. My SQS creates 4 queues and i am trying to create corr... | <p>As the error msg writes, you <strong>can't have dynamic</strong> variables. <a href="https://www.terraform.io/language/values/locals" rel="nofollow noreferrer">locals</a> should be used instead.</p>
<pre><code>locals {
Queues = {
"FirstStandardSQSQueueUrl" = aws_sqs_queue.FirstStandardSQSQueue.url
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Script calls newDate and adds 5 days. I am looking to format the output to just date<p>Script for current date + 5 sends an email with exact 5 days from now.... | <p>Try it this way:</p>
<pre><code>function findEmailAddress() {
var ss = SpreadsheetApp.getActive();
var sh1 = ss.getSheetByName('Working');
var vs1 = sh1.getRange('H1:H' + sh1.getLastRow()).getValues().flat();
var sh2 = ss.getSheetByName('Match');
var vs2 = sh2.getRange('A2:B' + sh2.getLastRow()).getValues(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Class X cannot be cast to class Boolean (X is in unnamed module of loader 'app'; Boolean is in module java.base of loader 'bootstrap<p>I noticed that when ot... | <p><code>find…</code> methods return an instance of the type that has been found. In the case of your <code>SkillGroupRepo</code>, it will return a <code>SkillGroup</code>. If you want to return <code>boolean</code> that indicates whether or not something can be found in the database, you should use an <code>exists…</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
arrow validation more then 10 fields<p>all I have a question how can I validate more then 10 values with arrow in kotlin.</p>
<pre><code>fun CreateEventDTO.v... | <p>Kotlin requires all functions to be explicitly defined, and we cannot define an infinite amount of methods. Therefore Arrow made the decision to limit to 9 arguments.</p>
<p>However, you can easily combine different <code>zip</code> methods with each-other using tuples. For reaching 10 arguments, you can combine <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display localStorage value in a table header?<p>I have the following js function that is used to get the saved value of an input field:</p>
<pre><code... | <blockquote>
<p>How can I use this function to grab the paymentMonth value and display it in a table column header?:
You can try to add an id to the <code><th></th></code>:</p>
</blockquote>
<pre><code><th id="monthHR_PaymentMonth"></th>
</code></pre>
<p>and then use the following code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to manage multiple 'executable and datadir profile' for parallelizing the launch of scrappers?<p>I am using , and have difficulties to launch 4 scripts a... | <p>Since you are using playwright, you can use <a href="https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context" rel="nofollow noreferrer">persistent contexts</a>.</p>
<p>You do not need to create your own data directories or executables by copying them, simply pass location of an empty... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hey i try to build a game in UWP(c#) and i cant make my player move<p>i search in the internt and only found WPF tutorials to how make objects move and it is... | <p>So you can use the CoreWindow.KeyDown event to handle keys:</p>
<pre><code>public MainPage()
{
this.InitializeComponent();
Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
}
private void CoreWindow_KeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs args)
{
switch (args.Virtu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
assigning letters numbers values from the field<p>assigned letter number</p>
<p>I have this program that is used to assign numbers to letters.</p>
<p>I have ... | <pre class="lang-py prettyprint-override"><code>import itertools
alphabet = {"A": 1, "B": 2, "C": 3, "D": 4}
alphabet1 = {"AA": 1,"AB": 2, "BB": 3, "BC": 4}
def word_permutations(word):
'''Returns all word permutations'''
return [... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Some Cloud Functions formats are not deployed<p>I guess it must be a silly reason but I don't understand why from these 2 Cloud Functions, only the first one... | <p>The second function <code>test2</code> which receives data from Pub/Sub is triggered by a Pub/Sub topic. Cloud Functions for Firebase with Pub/Sub trigger which you can find <a href="https://firebase.google.com/docs/functions/pubsub-events#trigger_a_pubsub_function" rel="nofollow noreferrer">here</a>. As per the li... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How create a random answers in quiz, android studio(java)?<p>I am tring to do a quiz app, there is a random flag and random 4 answers, one of them should be ... | <h2>Assumptions</h2>
<ol>
<li>The correct answer for a <code>flags</code> array is equal to the same index in the <code>answers</code> array.</li>
<li>The random options (for an answer) also comes from the <code>answers</code> array.</li>
</ol>
<h2>Requirement</h2>
<ol>
<li>For a given question, show 4 options. Out of ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a size limitation to chan pipe on commande line?<p>This is probably a very stupid question but why does this freeze on the CLI if the size of the fi... | <p>When writing to a non-blocking channel, if you try to write more data than it can currently accept, tcl buffers the rest and tries to write it later. The maximum internal buffer size is 1,000,000 bytes. So on large input files, it's better to do the copying incrementally, say using the event loop (Especially when yo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to solve component overlapping in React<p>I am trying to write a web application's front end using React.js. And I accomplish a Navigate bar component &a... | <p>It seems that your nav tag has position fixed. You should to give padding from top (height of your nav) to tag that wraps your pages. If it will not work, can you provide some css related to nav or what css library is used.</p>
<p>PS. Sry for my english.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieve data from a dialog in the calling window<p>I am struggling to retrieve results from a QDialog window and pass them back to the previous window. I wa... | <p>What you need to do is connect a slot to the <code>accepted</code> signal of the dialog, and then retrieve the variables via a dedicated method of the dialog when that signal is emitted.</p>
<p>Here are all the relevant changes (fully tested as working):</p>
<pre><code>class ProcUnivariateVariables(QDialog):
...... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Leetcode question Most Common Word in javascript. I am unable to set properties in my object<p>I am taking the LeetCode challenge <a href="https://leetcode.c... | <p>The problem is that the <code>split(" ")</code> call will leave the punctuation in, so you'll have both "ball," and "ball" in the resulting array. Obviously this will make your code miss some equalities.</p>
<p>To resolve this, change this line:</p>
<pre><code>let words = paragraph.toLo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do you know how to visualize a DXF files in React js?<p>I want to display DXF files (2D mechanical drawings) in my react app. I cant find the way to do it. T... | <p>Here is the package i used once for this <a href="https://www.npmjs.com/package/dxf-viewer" rel="nofollow noreferrer">https://www.npmjs.com/package/dxf-viewer</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return a boolean mask for a Pandas index wrt a subset of the index<p>I have a df like this:</p>
<p><code>df = pd.DataFrame(index=["a", "b"... | <p>If list of assigned values is same like list of indexes use:</p>
<pre><code>df.loc[s, "col"] = [10, 11]
print (df)
col
a 10
b 11
c 3
</code></pre>
<p>If use boolean mask by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.isin.html" rel="nofollow noreferrer"><code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sort a confusion matrix by the diagonal value<p>I have this confusion matrix:</p>
<pre><code>import pandas as pd
import seaborn as sn
import matplotli... | <p>You can use <a href="https://numpy.org/doc/stable/reference/generated/numpy.argsort.html" rel="nofollow noreferrer"><code>numpy.argsort</code></a> on the diagonal (opposite values for descending order) and reindex:</p>
<pre><code>import numpy as np
order = np.argsort(-confusion_matrix.to_numpy().diagonal())
# array(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML, on click event, how to get the button text<p>How to get the button text or its innerHTML and use it inside the page, by not using its "name"<... | <p>The function in the <code>onclick</code> attribute can pass the element to the function as an argument using <code>this</code>. The <code>innerText</code> or <code>innerHTML</code> property of that element is then referenced directly from it as shown in the snippet.</p>
<p><div class="snippet" data-lang="js" data-hi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove square brackets from wiki markup<p>I'm looking for the way to remove some markup from wikitext.</p>
<p><strong>Example:</strong></p>
<pre><code>Mexico... | <p>Modify the pattern to replace the text <strong>between</strong> the open and close tags.</p>
<pre><code>$markup = 'Mexico, officially the United Mexican States, is a [wiki=1c1ff8db21cf79377f9930e6e6ff8247]country[/wiki] in the southern portion of [wiki=5ffec2d87ab548202f8b549af380913a]North America[/wiki].';
$plain ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define extension for SectionedFetchResults with Key (String) and Result (NSFetchRequestResult)<p>I have <strong>SectionedFetchResults</strong> defined... | <p>I assume it can be like</p>
<ol>
<li>for Grand Total for response:</li>
</ol>
<pre><code>extension SectionedFetchResults where Result == MedicationConsumption {
var totalQuantity: Double {
self.reduce(0) { sum, section in
section.reduce(into: sum) { $0 += $1.quantity }
}
}
}
</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Powershell to replace text in Word which is in single line and different line?<p>So I want to edit a .docx file using PowerShell: First Name, Last... | <p>Found a workaround seems to be working now perfectly well.
Hope this helps to someone</p>
<pre><code>$objWord = New-Object -ComObject word.application
$objWord.Visible = $True
$objDoc = $objWord.Documents.Open("Path")
$objSelection = $objWord.Selection
function wordSearch($currentValue, $replaceValue){
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reduce fastText memory usage for big models<p>I trained a machine learning sentence classification model that uses, among other features, also the vectors ob... | <p>There is no easy solution for my specific problem: if you are using a fastText embedding as a feature extractor, and then you want to use a compressed version of this embedding, you have to retrain the final classifier, since produced vectors are somewhat different.</p>
<p>Anyway, I want to give a general answer for... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The argument type 'Object?' can't be assigned to the parameter type 'int'<pre><code> RadioListTile(
value: 1,
groupVal... | <p>Instead of passing whole Object just pass the id of selectedRadio Object</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get JS object and pass it back?<p>I would like to call JS function from Blazor (this is factory method) and then pass the obtained object back to JS (... | <p><strong>Demo and workaround</strong></p>
<p>I've created this simple <a href="https://blazorfiddle.com/s/iqf2o3tb" rel="nofollow noreferrer">Blazor Fiddle</a> (WASM 3.1) that reads a JavaScript object and then writes it back. And if you view the output in the browser console you can see the object is passed back and... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SailsJS - Waterline - add column to many to many relationship<p>I'm trying to create a many to many realtionship between the following object and I'd like to... | <p>What you are looking for is a "through" model. Essentially, right now, you are using the automatically generated model (something like "item_categories" or "categories_item"). But, if you need to know more data about a relationship, you'll want to create a "through" model, whe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple types of a class within a class<p>I'm making a simple game to learn some kotlin, and I'm a little confused on the best way to change this around usi... | <p>That's basically the idea! If your <code>BackPack</code> class (it should start with a capital by convention) handles <code>Item</code>s, then any class that has that type will work. You have two options - inheritance, and composition.</p>
<p>Inheritance is where you build a hierarchy of classes, e.g.:</p>
<pre><cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extend QTableView parent widget height when window is resized<p>I would like to extend the height of <code>ruleWhiteListWidget_2</code> if <code>rulesWhiteLi... | <p>Your current design is has several redundant container widgets and layouts that are complicating things unnecessarily. Basically, you just want the table to expand to take up any extra height whenever the dialog is resized larger than the combined minimum heights of the table and the editor; and when the dialog is r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change /wp-login.php?action=logout URL for WordPress to /logout<p>I've been googling for 20 mins plus and still couldn't find the answer. I saw <a href="http... | <p>Maybe something like this would work</p>
<pre><code>add_filter('parse_request', 'custom_logout');
function custom_logout($request){
if ( $request->query_vars['pagename']=='logout'){
wp_logout();
wp_set_current_user(0);
}
}
</code></pre>
<p>Probably you should create a page with slug 'log... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UseEffect only works after refresh the page<p>I am using an useEffect inside a Context. I think the useEffect should run after load the page, but it does not... | <p>It seems like your token is not set by the time the component mounts and calls this useEffect().</p>
<p>I can think of 2 options:</p>
<ol>
<li>store your session data in an outer context state and get the token from there. Then you can add <code>token</code> as a dependency in useEffect():</li>
</ol>
<pre class="lan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Batch probblem: Cant iterate through string variable<p>I'm going crazy for 2 days with this simple task: iterate through a 5 line string with delimiters (or ... | <p>The subroutine <code>split_supplied_line</code> in the following batch code snippet should do the trick for (<em>almost</em>) any number of substrings and (<em>almost</em>) any delimiter. No matter whether there is a trailing delimiter.</p>
<pre><code>@ECHO OFF
SETLOCAL EnableExtensions DisableDelayedExpansion
set &... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding subdomain in Laravel 9<p>For some reason adding subdomain route isn't working and keeps on returning my homepage instead of the page I need. I'm using... | <p>I had to manually add the routes in my etc/hosts file on windows and restart the entire machine for it to take effect.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use middlewares conditionally - Cannot set headers after they are sent to the client<p>I'm trying to make a POST request where I need to switch between two m... | <p>Your current code executes <code>res.json('done')</code> after calling the authentication middleware so that <em>two</em> responses are sent in case of failed authentication, leading to the observed error. You want to execute <code>res.json('done')</code> only when the authentication middleware calls <code>next()</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass struct containing matrices in Cuda<p>As the titles says , i'm trying to pass a struct containing 4 matrices to a Cuda Kernel. The problem is tha... | <p>There (at least) are 2 errors in your code.</p>
<ol>
<li><p>You have not allocated a correct size for the device struct:</p>
<pre><code>cudaMalloc((void**)&dev_data, sizeof(data));
^
</code></pre>
<p>just like you did in your <code>calloc</code> call, that should be <code>siz... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return image uri to main react component<p>I'm adding a camera to an already developed react native project. I want to return the imageUri (set by takePictur... | <p>The best way to do this is by passing parameters to image routes, you can see the documentation <a href="https://reactnavigation.org/docs/params/" rel="nofollow noreferrer">here</a>.</p>
<p>So, you can pass object in <code>navigation.navigate</code> second parameter like this:</p>
<pre><code>navigation.navigate(&quo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intellij Flutter: ld: can't write output file for architecture x86_64<p>Intellij Flutter: ld: can't write output file: /Users/myname/IdeaProjects/flutter_ssi... | <p>You have rights problematics on your build directory.
You can reset it without fear.</p>
<p><code>sudo rm -rf build</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Thread synchronisation And Isolation levels<p>I am learning about the isolation levels at db. I have a doubt, for example with JAVA if we made sure that only... | <p>With databases, you can have connections from different processes on the same machine or even from different machines.</p>
<p>Because a synchronized block only has meaning in a single process, a synchronized block doesn't work with multiple processes from the same machine and therefore also not from processes of dif... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If i wil change background colour of input type check box is checked use CSS only? it is possible or not?<p><strong>change background colour type one line cs... | <p>I doubt this could work, some sort of JavaScript would be needed for this to work.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get All TextField values from loop in Next.js when I press Submit button<p>first of all look at these below screenshots:
<a href="https://i.stack.imgur.com/E... | <ol>
<li>The <code>wordsCount</code> state is shared between both questions, which means that when you go to the next question the state remains unchanged and shows the <code>wordsCount</code> from the first question. To solve it, each question needs to have it's own state which you can do by creating a <code>Question<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple if_all() in dplyr::filter not working<p>I have this dataframe:</p>
<pre><code>df <- data.frame("dim" = c(1,1,1,1), "pub" = c(... | <p>The comparison should be included inside <code>if_all</code>. When using external vectors as column names it is good practice to use <code>all_of</code>.</p>
<pre><code>library(dplyr)
df %>% filter(if_all(all_of(yes), ~. == 1) & if_all(all_of(no), ~. == 0))
# dim pub sco wos
#1 1 0 0 1
#2 1 0 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is the sequence of palette color in dyRibbon?<p>Consider these questions around a reprex using <code>dyRibbon</code> function of <code>dygraphs</code> p... | <p>I got the answer in rstudio community. The solution is the sequence has to be explicitly defined.</p>
<pre><code>data_arg <- dt1 %>%
mutate(flagn = case_when(
flag1 == "low" ~ 0,
flag1 == "med" ~ 0.5,
flag1 == "high" ~ 1)) %>%
pull(flagn)
</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
exporting a Record<K,T> as a named type or interface in ts<p>I am pretty new to TypeScript so bear with me. I am aware of using Record<K, T> Utility Ty... | <pre><code>// Create and export custom types using Record
export type SomeKeyValue = Record<string, boolean>;
// Use it in another file
// import SomeKeyValue from ...
const something: SomeKeyValue = {
'first': true,
'second': false,
};
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The spinner does not remove after fetch api<p>I have this song lyrics app, the problem is the spinner does not remove after the api fetch. it is like javascr... | <p>I think it's a bad practice to use out-of-scope variables inside classes. It looks like the variable <code>spinnerHtml</code> is not accessible to the <code>class function consultApi</code>. Try selecting the element inside the <code>class function consultApi</code> with the query again.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix my Python code to look for occurrences across multiple URLs and not just one<p>So, first time doing anything in Python, and any coding language fo... | <p>You could consider building a dictionary keyed on the search phrases then build the whole thing into a loop like this:</p>
<pre><code>import requests
from bs4 import BeautifulSoup
urls = ['https://www.mannheimerswartling.se/medarbetare/', 'https://www.mannheimerswartling.se/medarbetare/hanne-aarsheim/', 'https://ww... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prolog remove elements which have the same value as the index from the list<p>I have a task to remove all elements which have the same value as the index fro... | <p>In addition to the modifications already pointed out by Gusbro, you also need to invert the conditions used to include/exclude elements from the input list:</p>
<pre><code>remove(_, [], []).
remove(Position, [H|T1], [H|T2]) :-
H =\= Position, % include element if it is different from its index
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error in using tf.Variable for 1 dimensional tensor in tensorflow<p>I am trying to make a deep neural network model on Tensorflow. The <code>tf.Variable</cod... | <p>Your 1D input shape still needs a comma:</p>
<pre><code>import tensorflow as tf
b_init = tf.random_normal_initializer()
print(b_init)
bias = tf.Variable(initial_value=b_init(shape=(2, )),trainable=True)
bias
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Provide SSL certificate to SQL Server via JDBC<p>The <a href="https://docs.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-serve... | <p>Since version 6.3.3 the Microsoft JDBC Driver for SQL allows, to specify a custom implementation of <code>javax.net.ssl.TrustManager</code> through connection <a href="https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver16#properties" rel="nofollow noreferrer">prope... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use recursion to get all children when each parent has an array of children?<p>I have a dictionary <code>d</code> of <code>parent:list(children)</code... | <p>You can do a depth first search. Just keep track of which items you've seen in a set. Then yield each one you haven't seen and yield from the result of recursive call:</p>
<pre><code>def get_all_descendants(t, d, seen=None):
if seen is None:
seen = set([t])
for item in d[t]:
if item not in se... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bootstrap media object issue on css<p>Trying to use Bootstrap to display media(<a href="https://getbootstrap.com/docs/4.0/layout/media-object/" rel="nofollow... | <p>Problem fixed.The error was code provided in Github.Anyone who wants isolated Bootstrap 4.1.0 can use this link:</p>
<pre><code><link rel="stylesheet" href="https://toert.github.io/Isolated-Bootstrap/versions/4.1.0/iso_bootstrap4.1.0min.css">
</code></pre>
<p>Others work same as written her... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
remove line between two container flutter<p>I have 2 containers, but in the middle of 2 containers there are unwanted lines, how can I remove them?
<a href="... | <p>You can include border decoration to it.</p>
<pre class="lang-dart prettyprint-override"><code>decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width: 0,
color: Colors.white,
),
),
</code></pre>
<p>You can check <a href="https://github.com/flutter/flutter/issues/14288" rel="nofollow ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In R, what is the best way to save this type of list as a permanent file?<p>My question is straightforward: I have generated this type of object in R, that l... | <p><strong>1) adply</strong> This will convert a 3d array to a data frame and then you can use write.csv and import it into Excel or transfer it using other R packages.</p>
<pre><code># test input
a <- array(1:24, 2:4, dimnames =
list(dim1 = c("a", "b"), dim2 = c("A", "B", ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find the index of every instance of n in ndarray using numpy<p>I have an 2d array, and I'd like to invert 0 to 1 and vice versa, but <strong>only on the firs... | <p>Simply Use:</p>
<pre><code>In [1753]: a[0] = 1 - a[0]
In [1754]: a
Out[1754]:
array([[1, 0, 1, 0],
[1, 0, 0, 1]])
</code></pre>
<p>OR</p>
<pre><code>In [1738]: a[0] = np.where((a==0)|(a==1), a^1, a)[0]
In [1739]: a
Out[1739]:
array([[1, 0, 1, 0],
[1, 0, 0, 1]])
</code></pre>
<p>OR use <code>np.logi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change of pictures over and over by using setInterval<p>Below is a program that is to loop pictures with fade-in effect.</p>
<p>It includes this statement:</... | <p>The difference is not related to the <em>variable</em> <code>opacity</code>: you are right; it's value is never used after that assignment and is therefore unnecessary.</p>
<p>However, the call of <code>getComputedStyle(abc).getPropertyValue("opacity")</code> still makes the difference -- you can omit the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyCryptodome- Hex values change when put into a byte array for encryption<p>I'm trying to encrypt hex values as an input for an AES encryption. However, to u... | <p>What you have observed pertains to <em>display</em> of bytes in python consider that</p>
<pre><code>print(b'"' == b'\x22')
</code></pre>
<p>gives output</p>
<pre><code>True
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to connect to MySQL databas using GitHub Actions?<p>In my GitHub Action, I am using a Linux runner (Ubuntu 18.04 and 20.04) and I want to use a MySQL dat... | <p>The source of the confusion is that when using GitHub Actions (or more specifically: one of the GitHub-hosted runners) you get a Linux image in which MySQL is already installed on. Thus, when executing <code>sudo apt install mysql-server</code>, no actual installation is triggered.</p>
<p>Thus, the default setup tha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel Encryption/Decryption issue<p>I am storing users credentials for a 3rd party service in my database. When storing, these are cast to <code>encrypted<... | <p>Depending on what you're encrypting, 191 can be too short. 255 is probably standard, but to make sure you never hit the limit, you would be better off changing the column to a text column. Using Crypt::encrypt with a simple string, a 200 character string has the encrypted length of 568 characters. Here is what I tes... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
chartJS - Line Chart - DataLabels Formatting Function not working<p>I have the following HTML/JS code as follows which takes two lists:</p>
<ul>
<li>labels</... | <p>The following <code>formatter</code> works fine for me.</p>
<pre><code>formatter: v => '£' + v + 'm'
</code></pre>
<p>Please take a look at your amended and runnable code below.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre cla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter Key from a hashmap Map<String, List<String>> when a string matches one of the elements in the list<p>I'm fairly new to java in general so help is very... | <p>You may want to use <code>findAny()</code>:</p>
<pre class="lang-java prettyprint-override"><code>public String getKey(String id) {
return campaign
.entrySet()
.stream()
.filter(map -> map
.getValue()
.stream()
.anyMatch(list -> list.contains(id))... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can AWS Glue connect to Elasticsearch using IAM authentication?<p>Followed this tutorial: <a href="https://docs.aws.amazon.com/glue/latest/ug/tutorial-elasti... | <blockquote>
<p>is it possible to use IAM authentication</p>
</blockquote>
<p>No, unfortunately.</p>
<p>The <a href="https://aws.amazon.com/marketplace/pp/prodview-v5ygernwn2gb6" rel="nofollow noreferrer">Elasticsearch Connector for AWS Glue</a> does not currently support IAM authentication & only supports username... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use node:fs inside of a vue app to save images into source directory<p>I'm building a personal portfolio website using Vue.js, and I'm attempting to b... | <p>As pointed out by the comments on your answer, the Node.js-<code>fs</code>-module is cannot be used in the frontend. Here is why:</p>
<ol>
<li>While developing your <code>vue.js</code>-app, you should remember that you always have to run a development server in order for the app to compile to a browser-readable form... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the first element of a array?<p>The command <code>pm2 id <name></code> returns an array (e.g <code>[2]</code>), how would I get the first e... | <p>I'm not familiar with <code>pm2</code>, but if the array is JSON-compatible (which it looks like it is), you can use <a href="https://stedolan.github.io/jq/#" rel="nofollow noreferrer"><code>jq</code></a>, for example:</p>
<pre><code>$ echo '[2]' | jq '.[0]'
2
$ echo '[3, 2]' | jq '.[0]'
3
</code></pre>
<p>Here's a ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to move a scrollbar together with the left position of its <div> (possibly with React)<p>I have an horizontal slider with lots of "cards".</p>
... | <p>After pursuing this quest for another couple of days, I haven't been able to find examples of React hooks that are able to detect/manage the scroll of individual components in page, let alone horizontal scroll.</p>
<p>I have solved my problem by leaving CSS aside and putting in place a JS/DOM-based solution, caterin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to execute more than one javascript in one script tag?<p>I am trying to run three different functions when the submit button is clicked before... | <p>You don't need to put the <code>fetch()</code> call inside another <code>load</code> and <code>submit</code> event listeners. You're already inside the <code>submit</code> event listener. Just call <code>fetch()</code> directly.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-ba... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
getting N values from getline(cin) for different data types<p>I have created a program, which requires user to define at least 2 arguments(3rd is optional). ... | <blockquote>
<p>But unfortunately, <code>Date date = arguments[1];</code> doesn't work.</p>
</blockquote>
<p>Correct, because <code>arguments[1]</code> is a <code>std::string</code>, but <code>Date</code> does not have a constructor that accepts a <code>std::string</code>. So add one, eg:</p>
<pre><code>class Date {
p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate sumproduct in pandas by column?<p>I have a dataframe:</p>
<pre><code>ID 2000-01 2000-02 2000-03 2000-04 2000-05 val
1 2847 2861 287... | <p>You can do this, assuming ID is not in the index:</p>
<pre><code> df.loc[5, :] = df.iloc[:,1:-1].mul(df['val'], axis=0).sum()
</code></pre>
<p>Output:</p>
<pre><code> ID 2000-01 2000-02 2000-03 2000-04 2000-05 val
0 1.0 2847.0 2861.0 2875.0 2890.0 2904.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to easily debug flutter end-to-end tests, such as time traveling, action logs, and screenshots?<p>When doing end-to-end testing for Flutter, I find it ve... | <p>Here it goes: <a href="https://github.com/fzyzcjy/flutter_convenient_test" rel="nofollow noreferrer">https://github.com/fzyzcjy/flutter_convenient_test</a> - Write and debug tests easily, with full action history, time travel, screenshots, rapid re-execution, video records, interactivity, isolation and more. (With a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to store my firestore value as boolean but it is being stored as string<p>I have a form in reactjs when i submit it it stores value in firestore datab... | <p><code>option</code> doesn't accept boolean type of data but there are many ways to convert string into boolean but the most simplest way is to assign the value of <strong><code>True</code></strong> as <strong><code>1</code></strong> and <strong><code>False</code></strong> as <strong><code>0</code></strong>. See exam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Non-exhaustive patterns in function with tuples HASKELL<pre><code>regiuleishon :: (Bool, Integer) -> Integer
regiuleishon (True, _) = 0
reguleishon (False... | <p>Because <code>regiuleishon</code> is not <code>reguleishon</code>, so <code>reguleishon (False, x) ...</code> is a new function declaration leading to the code having 2 different functions neither of which have exhaustive patterns.</p>
<p>Name the second pattern correctly:</p>
<pre class="lang-hs prettyprint-overrid... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel: Conditional formatting of whole row based on column value does not work<p>Suppose I have a simple dataset in Excel:</p>
<pre><code>Column 1 Column ... | <p>Change <code>=$B2>3</code> to <code>=$B1>3</code> which should work for you.</p>
<p>Your formula start range and apply start range must be same. Otherwise CF will highlight different cells.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Refresh a webpage written in ASP.NET Core 6<p>I'm searching for hours but could not find a solution for my problem.
I have made lots of "hobby" pro... | <p>JHBonarius is right saying you cannot update a page as you want from the server, you need to use technologies like ajax, using javascript</p>
<p>in this case with jQuery</p>
<pre><code><script type="text/javascript">
function InvokeAction(param){
$.ajax({
type: "GET",
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin: Generic types in Kotlin<p>To get the class definition to be used for example for json deserialization the following can be used in Kotlin:</p>
<pre><... | <p><code>Class<T></code> (in Java) or <code>KClass<T></code> (in Kotlin) can only represent <em>classes</em>, not all types. If the API you're using only uses <code>Class<T></code> or <code>KClass<T></code>, it simply doesn't support generic types (at least in those functions).</p>
<p>Instead, <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
page of FLASK app is not changing after uploading a file, progress bar works fine<p>I want to perform some analysis on a text file. Once file is uploaded in ... | <p>If you use JavaScript/AJAX to send <code>request</code> then <code>response</code> is send to this JavaScript code - and JavaScript's request is redirected to <code>/dummyroute</code> and JavaScript gets response from <code>/dummyroute</code> but browser will not try to use this <code>response</code> to <code>redire... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spread operator with one exclusion to merge objects<p>I am merging data from two arrays of objects based on a common property <code>URL</code> and <code>url<... | <p>Well, why don't you just remove the URL -field from the outcome?</p>
<pre class="lang-js prettyprint-override"><code>const res = data2.map(obj => {
const otherData = data1.find(({ url }) => url === obj.URL)
const result = {
...obj,
...otherData
};
delete result.URL;
return result;
})
</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change on rax register during debug session with gdb does not affect code execution<p>I'm planning to participate to some of the Capture the flags (CTF) chal... | <p>The string is only temporarily in <code>rax</code>+<code>rdx</code>. In the following lines it is placed on the stack and the address goes to <code>rdi</code>, that is used by <code>puts</code>.</p>
<p>What's important here is to understand that one line of source code is translated to multiple lines of assembly. Wh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to force variant selection withResolvedConfiguration.getResolvedArtifacts?<p>I'm working with a large, multi-module Android application, and I'm trying t... | <p>There may be a better way to handle this, but I ultimately managed to resolve my problem by taking inspiration from <a href="https://github.com/sonatype-nexus-community/scan-gradle-plugin" rel="nofollow noreferrer">Sonatype's open source Nexus scanning plugin</a>. The code looks like (this is in Kotlin, but can be m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Fonts not loading in Next.js when deployed to Vercel<p>When running the app in <code>http://localhost:3000</code> everything works and looks great. Bu... | <p>Many hours and many deployments later, I found a solution that works for now. I removed all the Google Fonts references from the <code>Head</code> component and instead downloaded the <code>css</code> file it refers to. I copied it to <code>/styles/fonts.css</code> and it's now imported in <code>_app.tsx</code>.</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can not copy local directory to remote container with docker using docker context<p>I have been working on my local machine with no issue using the <code>Dok... | <p>The <code>volumes:</code> are always interpreted by the Docker daemon running the container. If you're using contexts to point at a remote Docker daemon, the <code>volumes:</code> named volumes and file paths are interpreted by that remote daemon, and point at files on the remote host.</p>
<p>While <code>docker bui... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell string to unix time with correct timezone<p>I'm collecting a timestamp value and trying to transform it to a Unix format.</p>
<p>To do that, I'm u... | <p>Ok, so here's one way to do it (borrowing from <a href="https://stackoverflow.com/a/246529/3156906">https://stackoverflow.com/a/246529/3156906</a>).</p>
<p>The key is to find the TimeZoneInfo for the timezone the <code>$FILETIME</code> string is local to, and use <em>that</em> to convert the local time to UTC before... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The operator '[]' isn't defined for the type 'Object'. Try defining the operator '[]' streambuilder<pre><code>StreamBuilder<QuerySnapshot>(
... | <p>The <code>data['key']</code> operator you want to use is only available for a <code>Map<String, dynamic></code> type variable. But if not typed the method <code>data()</code> will return an object of type <code>Object</code>.</p>
<p>You will have to cast the result like this:</p>
<pre class="lang-dart prettypr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should MongoDbContext Static?<p>I've a ASP.NET Core ntier ecommerce application with Mongo Db. I am new on MongoDb by the way. And this application will work... | <p>Yes, you should keep only one instance of <code>MongoClient</code> per cluster per application</p>
<blockquote>
<p>Use one MongoClient instance per application unless the application is
connecting to many separate clusters.</p>
<p>MongoClient objects are thread-safe in most drivers.</p>
</blockquote>
<p><a href="htt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FaunaDB returns empty array (FaunaDB + Netlify + VueJS)<p>My code is based on the repository - <a href="https://github.com/ttntm/recept0r-ts" rel="nofollow n... | <p>This code works:</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> return client.query(q.Paginate(q.Documents(q.Collection('customers')), { size: 500 }))
.then((response... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to run jupyter notebook multiple times with different parameters<p>I prepared a jupyter notebook that is a python template for a report. It displays pand... | <p>I would advise to put the code that generates the report inside a function. Then call the function from a loop. Which loops over an array of the different parameters you want to pass along each report. Then you just run your notebook once.</p>
<p>Otherwise pass the parameters to your notebook described here:
<a href... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel not sorting numbers correctly on pivot table<p>It's as the title says, my excel pivot table is not sorting numbers corretly.</p>
<p>When I create the p... | <p>I don't know if the correct procedure is to delete the question or not (If it is, can any moderator delete it please? sorry). But while I was writing I thought of a solution, and if anyone has this problem here it is:</p>
<p>The problem was that the calculation of "PM_Value" is a division, and some of the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I send a string in a function<p>I have this code and I want to make it send "b1" when when executing the command mic_press <code>b1 = Butto... | <p>I guess you want</p>
<pre class="lang-py prettyprint-override"><code>b1 = Button(root, image= img1, bd=0, bg='#292424', activebackground='#292424', command=lambda:mic_press('b1'))
</code></pre>
<p>Tkinter commands take and pass no arguments, but you can use a <code>lambda</code> function to call your method with the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pop-up when hovering over a node<p>I have a d3.js tree that looks like this:
<img src="https://i.stack.imgur.com/oek4F.jpg" alt="" /></p>
<p>What I want to d... | <p>I found this <a href="https://d3-graph-gallery.com/graph/interactivity_tooltip.html" rel="nofollow noreferrer">demo</a> to be very close to what I want, so I used what it used exactly to create tooltips. Thank you to everyone who contributed.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a schema data health expectation in Palantir Foundry Code Repositories<p>I have a dataset that is the output of a Python transform defined in Palant... | <p>You can use expectations to make assertions about which columns exist in your output schema.</p>
<p>See the <a href="https://www.palantir.com/docs/foundry/transforms-python/data-expectations-reference/#schema-expectations" rel="nofollow noreferrer">official docs for schema expectations</a>.</p>
<p>There are 3 kinds ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.