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:
Selenium select options in multiselect<p>I have a <a href="https://demos.telerik.com/aspnet-mvc/multiselect" rel="nofollow noreferrer">https://demos.telerik.... | <p>with c#, I would do something like this:</p>
<p>Click the button to open the drop down</p>
<p>then you could use</p>
<p>driver.FindElement(By.XPath("//select[@id='Supplies']/option[contains(text(), 'test1')]")).click();</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Web Scraping not working with grid layout<p>I want to extract the table which is available from the below website but i am not able to do that with the Get d... | <p>Possible workaround :</p>
<p>Load directly the .json containing data (limit of 50 results per request) with "Data > Get & Transform > From Web".</p>
<p>Then, with PowerQuery, unnest and select the variables of interest.</p>
<p>Tested with the following .json (inspect the network requests with you... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save the column header that is clicked on<p>I'm really new to reactJS. I have a table with two columns. Here is my code:</p>
<pre><code>import React, { useSt... | <p>More easy and secure is to pass the value direcly to the function, if you want only the value</p>
<pre><code>import React, { useState, useEffect } from 'react'
import { getUsers } from '../../services/userService'
const Table = () => {
const [users, setUsers] = useState([]);
cons... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSLT - copy all children except specific sub element<p>How can I copy all children of an element EXCEPT one element?
I studied a few examples but that soluti... | <p>You could do it like this:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<!-- Remove all role el... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting data within a list of a list - Python<p>I have been trying to insert data within a list of a list, I have followed all instruction regarding insert... | <p>Since row is defined at the start of your program, when you append it to your table, you probably append the reference to the object row itself (and not a new empty array every time).</p>
<p>Changing <code>table.append(row)</code> to <code>table.append([])</code> should fix your problem!</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to disable soft delete in key vault terraform<p>I'm trying to disable the soft-delete on key-vault. But i couldn't do it.
Here's my terraform Code:</p>
<... | <p>Terraform has officially deprecated the <code>soft_delete_enabled</code> field. <a href="https://github.com/hashicorp/terraform-provider-azurerm/pull/10088" rel="nofollow noreferrer">This PR</a> shows the field being deprecated starting version AzureRM 2.42.</p>
<blockquote>
<p>Data Source: azurerm_key_vault - depre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AutoMapper problem with custom convert from source to destination<p>I'm using AutoMapper to map my db models with my api models. But I have a problem with cu... | <p>I managed to find my mistake, and I have to admit it is a silly one, but took me a lot of time to figure. The problem is in the line <code>var ss = modelMapper.Map<ApiModel>(settings.Settings);</code>
See I have the <code>Profile</code> like this:</p>
<pre class="lang-cs prettyprint-override"><code>CreateMap&l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why nginx-based docker image refuses connection in VSCode devcontainer<p>Consider following setup:</p>
<p><code>devcontainer.json</code></p>
<pre class="lang... | <p>You are mapping the port <code>"8082:80"</code>, so you should access the <code>index-repository</code> container by <code>http://localhost:8082</code> isntead of <code>http://index-repository:8082</code>.</p>
<p>If you want to access the repositroy server container by the domain name <code>index-repositor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python 3 - How do I use a loop to create multiple classes at once?<p>I'm trying to make a D&D character creator, although I need to make an individual in... | <p>I'd suggest collecting your classes in a dictionary keyed on the class name, rather than having named variables for each:</p>
<pre><code>dnd_classes = {
class_name: DnD_Class(class_name)
for class_name in (
"Barbarian",
"Bard",
"Cleric",
"Dru... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React radio buttons not displaying in browser<p>I am new to React and formik and struggling to get my radio buttons to display in the browser. I think it is ... | <p>In order to get radio button rendered using Formik, you have to import Field component and use it by sending type="radio", here is how it should look like:
<a href="https://formik.org/docs/examples/radio-group" rel="nofollow noreferrer">enter link description here</a></p>
<p>Or by using the same component ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting NaN in specific index(positions) in a numpy.array in Python<p>I have two arrays <code>P</code> and <code>J</code>. I want to insert <code>C1=nan</c... | <p>You can use for loop to reach each item in J.</p>
<pre><code>import numpy as np
from numpy import nan
J = np.array([[1, 4, 5, 7]])
P = np.array([[
1.35961580e+03, 1.35179719e+03, 1.30676673e+03, 1.17569069e+02,
5.19255443e+00, 5.19255443e+00, 5.19255443e+00, 1.00000000e-09
]])
C1 = nan
for i in J[0]:
P... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Default pip package PATH in python:3.8-slim-buster docker image<p>Im installing gunicorn pip package in my docker python:3.8-slim-buster image and when I use... | <p>Ah, so the problem shows up in the docker build output:</p>
<pre><code>Step 8/10 : RUN pip install gunicorn
---> Running in 5ec725d1c957
Defaulting to user installation because normal site-packages is not writeable
Collecting gunicorn
Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
━━━━━━━━━━━━━━━━━━... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotly Dash Callback | SchemaLengthValidationError - Expected 7, Received 8 OR A nonexistent object was used in an `Output` of a Dash callback<p>Goal: Append... | <p>First, I had to append and return the <code>body_div</code>:</p>
<pre class="lang-py prettyprint-override"><code>@property
def body_div(self) -> Div:
return Div([self.graph, self.marker_string_div])
</code></pre>
<p>Because I have tabs all on one page, most components need to appear and disappear. How... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
use short hash of the current git commit in a makefile<p>I have the following problem:
I have a makefile that compiles a C Project and generates a .hex file.... | <p>This problem pops up regularly with <code>make</code>. Recipe lines are executed line by line, each in a separate shell process, which means that you can't simply instantiate shell variables and use them a few lines down, as they are disposed with the shell process immediately at line end. You have two options, #1 i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin Room Database: How to save result from sum query?<p>I´m new to Kotlin and trying to learn it by programming an app for work time recording.</p>
<p>I´v... | <blockquote>
<p>Caused by: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.</p>
</blockquote>
<p>I'd try returning either flow or live data and using view model scope to start a co routine.</p>
<p>in the dao</p>
<pre><code>//chang... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get all threads of a process using win32api (Python)<p>Let's say I have the following code that gets a handle to a process:</p>
<pre><code>pid = 1234
procHan... | <p>as far i know not exist public api which enumerated threads in process. but exist <code>NtQuerySystemInformation</code> and <code>SystemProcessInformation</code> or <code>SystemExtendedProcessInformation</code> - it return list of all processes and threads in system. by using this you can found all threads in proces... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is pushing an object to an array async operation?<p>I was doing one problem-solving program where I had to find all the pairs from an array that adds up to a... | <p>In your first version, you just have <em>one</em> <code>obj</code>:</p>
<pre><code>let obj = {
first: 0,
second: 0
}
</code></pre>
<p>The loop then <em>mutates</em> that <em>same</em> object, and pushes it unto the array. This means the array gets multiple references to the <em>same</em> object. Even when th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a symmetrical pattern in Python<p>Python (and StackOverflow) newbie here. I am trying to create a symmetrical shape in Python that uses only '#' and... | <p>Here's a list comprehension that you can potentially convert back into a <code>for/while</code> loop:</p>
<pre class="lang-py prettyprint-override"><code>rows = [' '*i + '#'*(i+1) + ' '*(14-2*i-2*(i+1)) + '#'*(i+1) + ' '*i for i in [*range(4), *reversed(range(4))]]
print('\n'.join(rows))
</code></pre>
<p>Output:</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create objects of a nested class inside the parent class but in another header file?<p>I have a class <code>Dmx</code> with a nested class <code>to... | <p>To be able to create an array:</p>
<pre><code>touchSlider slider[10] = {50,130,210,290,370,50,130,210,290,370};
</code></pre>
<p>You need the class definition available, because the compiler needs to know</p>
<ol>
<li>the size of the struct or class in use and</li>
<li>if there's a suitable constructor available.</l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multi-step form won't go to next section JS/HTML<p>So I wrote this multi-step form and it worked with the current code I have listed below until I changed it... | <p>if this isn't helpful I apologise in advance ....</p>
<p>because nextSection(); uses $(this) it won't have refrance to the button as it would have done when you used $(".btn").on("click", nextSection);</p>
<p>so you could add a reference of $(this) though to that function from the onSubmit</p>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Toggling LED through button (ESP32 FreeRTOS) + binary semaphore<p>I had already done several projects using simple freertos ideas: led, button. Implementing ... | <p>Your switch polling needs to detect transitions, but avoid erroneously detecting switch bounce as a valid transition. For example:</p>
<pre><code>#define BUTTON_DN = 0 ;
#define BUTTON_UP = 1 ;
#define POLL_DELAY = 50 ;
void task_botao(void *pvParameters)
{
int button_state = gpio_get_level( BUTTON_GPIO ) ;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CS1662 Cannot convert lambda expression to intended delegate<p>I am running VS2022 and got this error and the source of the file is from some file with the .... | <p>It turns out in my situation. I have some reference to the properties of a class that was misspelled and VS is not designed to tell you.</p>
<p>Here's the code snippet:</p>
<pre><code><RadzenDropDown
@bind-Value ="@_filteredMaterialGrade"
AllowClear ="true"
Data ="@Prese... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add bar outline to an R plotly bar chart?<p>I am creating a plotly chart with individual bars coded based on a variable category. I am having trouble ... | <p>The <code>marker</code> parameter is what you are after.</p>
<pre><code>library(plotly)
library(tidyverse)
my_tibble <- tibble(mins = runif(10,10,30),
week = 1:10,
exercise = c("a", "b", "b", "b", "a", "a", "... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Having some problems making relative reference work with an ArrayFormula<p>I'm trying to use the ArrayFormula of Google Sheets to set an auto-fill system whe... | <p>I ended up using Google Apps Script to solve my issue, since regular formulas proved to be inefficient for what I was trying to do. Below is the code I ended up using, which populates some more fields aside from the name and icon, which still has some issues, but they're beyond the scope of this question.</p>
<pre><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LDAP authentication doesn't work on Gitea custom image<p>I'm developing a Docker infrastructure with Ansible and Docker Compose and I have a problem with the... | <p>The problem was the address 127.0.0.1 in the entrypoint file in --host, changing it to openldap (name of the service in the docker-compose file) worked.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Byte to List<p>I am using redis.get method and it's returns me byte.</p>
<p>In redis ı have a list like that:</p>
<pre><code>[
"ADA/USD"... | <pre class="lang-py prettyprint-override"><code>import json
json.loads(b'["ADA/USD","ADA/USDT","ALGO/USD","ATOM/USD"]'.decode())
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change opacity of text widget to 0.7 with flutter extension?<p>I need change style of Text Widget in flutter with an extension.
this extension must be... | <p>ok. I change this extension for text style and solved , answer is :</p>
<pre><code> extension TextStyleOpacity on TextStyle?{
TextStyle colorOpacity ({required BuildContext context}){
Color? color =this==null?DefaultTextStyle.of(context).style.color: this?.color;
if(this==null){
return DefaultTex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I resize a image to shape=(None, 321, 321, 3) with name name=None and dtype=tf.float32<p><strong>Problem</strong>: I am trying to reshape a image to ... | <p>Try adding the batch dimension to your <code>PIL</code> image and it should work:</p>
<pre><code>image = np.asarray(image)[None, ...]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CreateJS chained animations not reaching target position<p>I am working on a project using Three.js and CreateJS. I have a problem with the animations, movin... | <p>It looks like you are creating a new tween every single frame. Tweens run their own requestAnimationFrame -- so you should be kicking off the tween one time, and not every frame.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reuse DownloadFile from a task in another task Azure Pipeline<p>I would like to avoid repeating code in Pipeline on Azure DevOps. For one task I need ... | <p>If you change job, you change Build Agent. This is why your file is lost.</p>
<p>You can use artifact to pass files from job to jobs or task to task.</p>
<p>You will find how to do here:</p>
<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/build-artifacts?view=azure-devops&tabs=yaml"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React, problem with my Todo list app, my search engine only finds notes on the page I'm on<p>Hello I am making an application to practice React, my notes app... | <p>As I suggested to you, search all the notes with <code>searchText</code> in your App.js and pass the results into the Pagination component and it will solve your problem.</p>
<p>Codesandbox: <a href="https://codesandbox.io/s/youthful-thompson-xugs0c" rel="nofollow noreferrer">https://codesandbox.io/s/youthful-thomps... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IoT Edge module fails to send a message to edgeHub with 400 error after updating IoT Edge runtime to version 1.3.0<p>Observed Behaviour:</p>
<p>Custom IoT Ed... | <p>It seems this is a bug in the new version of the runtime.
The <strong>version 1.3.0</strong> is expecting the value of <strong>"content-type" in the HTTP header to be exactly "application/json"</strong>.</p>
<p>The Azure IoT Device SDK for C is by <strong>default</strong> setting the <strong>con... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Eigen initialise dynamic matrix with raw data<p>Suppose I have raw data, whose size I don't know at compile time, and that's why I need to store it in a ... | <p>If you want to copy the raw data, assign the Map to a normal matrix.</p>
<pre><code>std::vector<double> v {1.1, 2.2, 3.3, 4.4};
Eigen::MatrixXd m = Eigen::MatrixXd::Map(v.data(), 2, 2);
</code></pre>
<p>BTW: You don't need to deal with the template parameters such as <code>Matrix<double, 2, 2></code> or ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Initialize the size of global array<p>I need to put the output of <code>arr</code> in global array because I need to use the array in main function. How can ... | <p>Use function parameters and return values <strong>not</strong> global variables</p>
<pre><code>long long suma(int **arr, size_t size)
{
long long output = 0;
*arr = malloc(size * sizeof(**arr));
if(*arr)
{
for (size_t i = 0; i < size; i++)
{
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android is killing my app "Force finishing activity". How to debug?<p>I have the following log output</p>
<pre><code>W/ActivityTaskManager: Force finishing... | <p>I found the solution. It had nothing to do with memory management whatsoever.</p>
<p>My Testdevice just did not show the error log (I do not understand why though!). Using a different Device I finally got the error stack trace and could narrow down the mistake</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assigning column values in for loops -- too slow<p>I have a for loop that I'm trying to run that is quite slow when I apply it to a dataset with 100k+ observ... | <p>You could loop over the columns instead of the rows:</p>
<pre><code>for (col in cols) df[[col]] = +(df$country == col)
# id country USA Japan Germany
# 1 1 USA 1 0 0
# 2 2 Japan 0 1 0
# 3 3 Germany 0 0 1
# 4 4 Japan 0 1 0
# 5 5 Japan 0 1 0... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array in JavaScript is undefined<p>I am very new to JavaScript but have good experience with C and java. For whatever reason my code below will not fill in t... | <ol>
<li><code>Math.random</code> is a function; use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random" rel="nofollow noreferrer"><code>Math.random()</code></a></li>
<li>Same for <code>push</code>, use <a href="https://developer.mozilla.org/nl/docs/Web/JavaScript/Refe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert moment.js to date-fns<p>I am trying to use the code from <a href="https://codepen.io/hiiamyes/pen/VPxdVL" rel="nofollow noreferrer">this codep... | <p>You'll have to do the porting work, there's no universal way around it. Although it's reasonably easy. For instance, for the part of the code</p>
<pre><code>// let time = [0, 1, 2, 3].map(i => refs.current[i].value).join('')
// time = moment(time, 'HHmm').add(i % 2 ? 1 : 10, Math.floor(i / 2) ? 'm' : 'h')... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Asking for user input in print function - Python 2.7<p>Sorry if this seems like a bit of a dumb question but I’m a bit confused about a Python 2 exercise I a... | <p>You have to <code>print result</code> not <code>print FirstFactorial(raw_input())</code></p>
<p>The way it is set up now the program will work for the first input, but it will never print it out so you never see <code>result</code>.</p>
<p>Then it will look for a second input from your second call to <code>raw_input... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to render a SVG graph from a dot when adding multi-edges using graphviz<p>Im trying to render my dot file using: grv.render('neato', 'svg', 'graph.dot... | <p>2.43.0 is rather old (several years). If you install a new version of Graphviz (4.0) it works fine. Unfortunately, "installing a newer version" can take some real work.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"Bad return type in lambda expression: String cannot be converted to void" in .forEach method<p>I have a class <code>Users</code> with, among others, a <code... | <p>It looks like what you're looking for is <code>map</code> and not <code>forEach</code>:</p>
<pre class="lang-java prettyprint-override"><code>public boolean checkUserExists(String targetUserID) {
List<String> userIDS = users.stream().map((user) -> user.userID).collect(Collectors.toList())
// if you... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Connect to Azure Storage via Connection String<p>I have an Azure Storage (StorageV2), and I want to connect and upload files via Powershell.</p>
<p>However, ... | <p>Each Cmdlet in <a href="https://docs.microsoft.com/en-us/powershell/module/az.storage/?view=azps-8.0.0" rel="nofollow noreferrer"><code>Az.Storage</code></a> module expects a <code>-Context</code> parameter. You can use <a href="https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragecontext?view=... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Splunk Query to find all the occurrences of a Boolean key value pair in logs over a period of time<p>Given below is a snippet of splunk event. My requirement... | <p>Finally got the query for my requirement</p>
<pre><code>index=myindex sourcetype=mysourceType
| rex max_match=0 "(?<isOutstanding>isOutstanding\\\\\":true)"
| stats count(isOutstanding) as total
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React DOM element mounts and unmounts on every render when it should instead be updated<p>According to <a href="https://reactjs.org/docs/refs-and-the-dom.htm... | <p>It is called because you passed callback as anonymous function, which will be recreated each time you update the state(thus forcing rerender), and when <code>ref</code> gets the new value(recomputed function with new reference) it will trigger callback execution. You can avoid this by stabilizing ref callback refere... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Program Toplevel freezing during the execution of a function in Tkinter<p>I have a tkinter app that is structured like that:</p>
<pre class="lang-py prettypr... | <p>I've managed to implement Roland Smith answer option 1.
Now it works, hopefuly this makes sense:</p>
<pre class="lang-py prettyprint-override"><code>import tkinter as tk
import tkinter.ttk as ttk
class TopLevelWindow(tk.Toplevel):
def __init__(self, root, *args, **kargs):
super().__init__(root, *args, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I censor any words from a textarea that are between quotation marks?<p>I am building a text censor web app, which would censor any words from a texta... | <p>This is a pretty simple version of <code>censored</code>:</p>
<pre class="lang-js prettyprint-override"><code>const censored = (w) =>
w .replace(/"([^"]+)"/g, (_, s) => `"${s.replace(/\S/g, 'X')}"`)
</code></pre>
<p>We find all text between two quotation marks, replace it by repla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assistance needed with flutter app saving user authentication status<p>I have an app where Users can currently log in (using phone auth) and log out from the... | <p>One perfect way is to store the data in shared preferences. All you need in to add the flutter shared_preference package [https://pub.dev/packages/shared_preferences].</p>
<p>CONFIGURATION</p>
<ol>
<li>After adding this package, create a shared_preference object like: * final preference = await SharedPreference.get... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix "A SockJsMessageCodec is required but not available"<p>My app. is a server written in Kotlin that uses Spring Boot, web sockets and Stomp. When t... | <p>Remove all your Jackson dependencies except <code>jackson-databind</code> and change it to this:</p>
<pre><code><dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${Jackson.version}</version>
</depende... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot invoke "com.smart.repository.UserRepository.getUserByUsername(String)" because "this.userRepository" is null<p>I have used spring security depedency.
... | <p>spring is not creating bean for the UserRepository as you have not annotated the class with <strong>@Repository</strong> annotation. Try annotating the class with this annotation and whenerer this class is required, consume it using <strong>@Autowired</strong>,
ex-</p>
<blockquote>
<p>@Autowired</p>
<p>private UserR... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
load environment variables from a file in a makefile on windows<p>So I wanted to create a <code>make run</code> command so that I can test locally. It loads ... | <p>The <code>.</code> command is a feature of the POSIX shell. You are not using a POSIX shell on Windows, you're using Windows cmd.exe.</p>
<p>First, you can't name the file <code>win.env</code>. Windows cares a lot about file extensions so you'll have to name this file <code>win.bat</code> or something like that.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can gPRC (protobuf) return a null message?<p>Our client side calls a gRPC server, which ideally should return a MyMessage response object.</p>
<p>But can thi... | <p>Answering your question, check these <a href="https://developers.google.com/protocol-buffers/docs/reference/java-generated" rel="nofollow noreferrer">Google docs</a> where says:</p>
<blockquote>
<p>Note that no Java protocol buffer methods accept or return nulls unless otherwise specified.</p>
</blockquote>
<p>So it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to install Bun on Windows without Windows Subsystem for Linux?<p>I have just heard about Bun today, and I am eager to learn it.</p>
<p>So, first thing I ... | <p>Windows support is on <a href="https://github.com/Jarred-Sumner/bun/issues/159" rel="noreferrer">Bun's roadmap</a> (until then, it is only available on *nix systems)</p>
<blockquote>
<h3>Windows support</h3>
<ul>
<li>The HTTP client needs a Windows implementation for the syscalls</li>
<li>Bun needs test coverage for... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm testing with go openAPI<p>I'm testing with OpenApi and as an example with <a href="https://github.com/d-vignesh/Todo-App-with-OpenAPI" rel="nofollow nore... | <p>I guess you are trying to run the file <code>main.go</code> in a deprecated non-modules way. Try the recipe below.</p>
<p>Clone the repository:</p>
<pre><code>git clone https://github.com/d-vignesh/Todo-App-with-OpenAPI
cd Todo-App-with-OpenAPI/
</code></pre>
<p>Run it like this:</p>
<pre><code>go run github.com/d-v... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React hook setState - setting an array (React Tic Tac Toe tutorial but with hooks)<p>I've been trying to follow the react tic tac toe tutorial, but to use fu... | <p><strong>States is not updated immediately in react hooks.</strong></p>
<p>ex:</p>
<pre><code>const [counter, setCounter]=useState(0);
handleClick(){
//counter = 0
setCounter(counter + 1);
console.log(counter); //counter is old state so it is still 0
}
</code></pre>
<p>for your question: (<code>history</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
To terminate a peviously running function and start a new one in Springboot<p>I have one HTML page. There are two buttons "Start" and "Stop&qu... | <p>The best way to do this would be to create a background thread that you keep a reference to and ideally some kind of unique id.</p>
<p>When stop is called with that id you can interrupt the thread.</p>
<p>private static volatile Map<String, Thread> threadlookup = new ConcurrentHashMap<>();</p>
<pre><code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to merge many API call into one in swift<pre><code>func getCar(session: String, CarHandler: @escaping (Result<CarResponseModel, Error>) -> Void)... | <p><strong>1. First, you can create a base service to generate AF requests</strong></p>
<pre><code>import Foundation
import Alamofire
class BaseService {
public static let shared = BaseService()
private var request = URLRequest(url: URL(string: Constant.API_BASE_URL)!)
private init() {}
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does couch DB have a partition key and sort key?<p>Does couch DB have a partition key and sort key? If yes, What is the sorting logic and theory?</p> | <p>Recent versions of CouchDB support <a href="https://docs.couchdb.org/en/stable/partitioned-dbs/index.html" rel="nofollow noreferrer">partitioned databases</a>, letting you specify an explicit partition as a document id of the form <code>mypartition:documentid</code>. For certain use cases, this can be a very efficie... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GTK fprint(%e) float writted with commas instead of dots<p>So, I'm creating a little solar system simulation, with calculus done in C. Once the calculations ... | <p><code>gtk</code> alters locales settings, switch to default with <code>setlocale</code> just after calling <code>gtk_init</code></p>
<pre><code>#include <locale.h>
int main(int argc, char *argv[])
{
gtk_init(&argc, &argv);
setlocale(LC_NUMERIC, "C");
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conceptual difference between Token, Account and Associated account in Solana<p>I'm coming from an Ethereum environment and the Solana concepts are a bit con... | <p>There's a lot of questions to cover here, so let's go through bit by bit.</p>
<p>The most important bit is the overloading of the term "account", which means many different things. An account in Solana is like a file in a normal operating system, and it can contain any data as defined by a program. The t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update Sorting Algorithm Visualization?<p>I have been making a sorting algorithm visualizer in Java using Java Swing and AWT and coded insertion sort ... | <p>Call an action with a <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html" rel="nofollow noreferrer">swing timer</a> every second that will return an intermediate array. Then paint this intermediate array. Repeat until the array is sorted.</p>
<p>To obtain an intermediate array, modify the Inser... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Native : There are some issues with autocomplete?<p>I use a library <strong>״react-native-autocomplete-input״</strong></p>
<ol>
<li><p>The keyboard dis... | <p>Refering your <a href="https://snack.expo.dev/@roei133/efc1a6" rel="nofollow noreferrer">code,</a> you can prevent the focus issue by calling function as function instead as component like below</p>
<pre><code>// main screen
return (
<>
<KeyboardAwareScrollView
behavior={Platform.OS ==... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
set commands for the condition "I'm redirected to another page" (php)<p>I'm using php
I have a process form for a comment page that when you click on submit,... | <p>you should use something like sessions.
set session on submit form. and on <code>index.php</code> check if session has set with the special key. then show the alert that you want.</p>
<ul>
<li>on form submit and success :</li>
</ul>
<pre><code>// Start the session
session_start();
// Set session variables
$_SESSION[... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read a word in upper and lower case from file? Go<p>I have a task to read a file and, then scan for <strong>"bad word"</strong>, and finally... | <p>You could use <a href="https://pkg.go.dev/strings#Contains" rel="nofollow noreferrer"><code>strings.<b>Contains</b></code></a> and <a href="https://pkg.go.dev/strings#ToLower" rel="nofollow noreferrer"><code>strings.<b>ToLower</b></code></a> slightly differently:</p>
<pre><code>func readFile(fileName string, tabooNa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Turning two columns of data in R into a series of lists as long as the columns<p>I have two columns of data referring to international abbreviations for coun... | <p>First, some test data:</p>
<pre><code>df <- data.frame(code3 = c("ABW","AFG"), code2 = c("AW", "AF"))
</code></pre>
<p>If each of the 3-Code values have to be unique, then <code>split</code> it:</p>
<pre><code>split(df$code2, df$code3)
#$ABW
#[1] "AW"
#
#$AFG
#[1]... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merging dataframes (with different date time --monthly vs daily) at the same time applying lagged values to one of the dataframes<p>I have 2 dataframes I wis... | <p>For merge use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.merge_asof.html" rel="nofollow noreferrer"><code>merge_asof</code></a>:</p>
<pre><code>print (df1)
Date Col1 Col 2 Col 3 Col 4
0 2016-03 27.57 0.93 28.70 1.57
1 2016-04 25.83 0.23 28.34 0.84
2 2016-05 2... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
URL to image always return null<p>Why does the file name not point to the picture? I tried to use a slash at the beginning but it nevertheless did not work. ... | <p>instead of the complete path can you try
<code>getClass().getResource("download.png")</code></p>
<p>This is because you are already in the path of com.teamsea.langapp</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to compare two perl object values?<p>I need to compare two Perl object values, one is from a variable and another one is from an array value</p>
<p>Immed... | <p>If <a href="https://perldoc.pl/Data::Dumper" rel="nofollow noreferrer">Data::Dumper</a> shows</p>
<pre><code>$immediateParent = 'C:\\Users\\Public';
$dictionaryitem = 'C:\\Users\\Public';
</code></pre>
<p>then you should compare them directly without array dereference, i.e. remove the <code>->[0]</code>:</p>
<pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R - convert each row of a matrix in a character vector and save as named list<p>I have a matrix containing biological pathways (rows) and corresponding genes... | <p>Well done giving us a reproducible example. You can use the <code>apply</code> family of functions where <code>lapply</code> gives you a list as output, <code>sapply</code> will try to simplify the result, and <code>apply</code> lets you decide if you want to apply the function over rows or columns of a <code>data.f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
For loop in c# vs For loop in python<p>I was writing a method that would calculate the value of e^x. The way I implemented this in python was as follows.</p>... | <p>What you're likely running into here is <strong>integer overflow</strong> with the C# version of the Factorial function (at least your implementation of it, or wherever its coming from).</p>
<p>In C#, an <code>int</code> is a numerical type stored in 32 bits of memory, which means it's bounded by <code>-2^31 <= n... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overloading and strategy pattern<p>I'm trying to write an email delivery system. I have this enum, for all users, users that were logged in the last 3 months... | <p>Python doesn't have function overloading. What it <em>does</em> have is first-class function objects.</p>
<p>Create a <code>dict</code> that maps <code>Receiver</code> values to the appropriate function.</p>
<pre><code>def send_to_all():
pass
def send_to_last_three_months():
pass
def send_to_last_six_month... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IllegalAccessException when accessing ZoneInfo via JSF/EL with JDK 17<p>While porting a big JEE8 application to Java 17, I stumbled upon an <code>IllegalAcce... | <p>It's reproducible with a plain Java application class as follows:</p>
<pre class="lang-java prettyprint-override"><code>package com.stackoverflow.q72361100;
import java.lang.reflect.Method;
import java.util.TimeZone;
public class Test {
public static void main(String... args) throws Exception {
TimeZon... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - try except with multiple possibilities<p>I'm trying the following:</p>
<pre><code>try:
scroll_token = response["scroll_token"]
except... | <p>You are catching the wrong exception; it's <code>KeyError</code> that you are expecting could be raised.</p>
<pre><code>try:
scroll_token = response["scroll_token"]
except KeyError as e:
logging.info(f'could not find "scroll_token" {e}')
try:
scroll_token = response["sc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extracting the Place and Publisher in a String of Sentence<p>So I have a list of Data Stating the Place and Publisher of a Journal</p>
<p>The Data is given i... | <ul>
<li>split on colons <code>':'</code> using <code>s.split(':')</code>;</li>
<li>discard trailing whitespace using <code>s.strip()</code>;</li>
<li>if one of the split substrings ends with <code>'Publisher'</code> or <code>'Place'</code>, add the next substring to the relevant list;</li>
<li>some of the substrings a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DateComponentsFormatter - same dates, different results<p>Why is <code>dateRemainingText2</code> giving different result from <code>dateRemainingText</code>?... | <p><code>DateComponentsFormatter.string(from:to:)</code> and <code>DateComponentsFormatter.string(from:)</code> are different methods and so they can do different things.</p>
<p>From some experimentation, we can see that <code>string(from:)</code> outputs a string that describes the <em>sum</em> of all the date compone... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Edge color based on weights in Networkx<p>I am generating a graph with <code>nodes</code> and <code>edges</code>. I want the array <code>Edges</code> to take... | <p>Try this:</p>
<pre><code>import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.cm import ScalarMappable
N = 1
def pos():
x, y = 1, N + 3 - 1
for _ in range(2 * N * (N + 1)):
yield (x, y)
y -= (x + 2) // (N + 3)
x = (x + 2) % (N + 3)
G = nx.Graph()... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Cloud App Engine - NestJS App deploys fine and runs instance, but can't access it<p>I am trying to host a NestJS application on Google App Engine. I'm... | <h1>Solved</h1>
<p>GAE docs do not tell you this (they slightly hint it when talking about <code>app.yaml</code>'s <code>environment_variables</code>, but not explicitly).</p>
<p>Make sure the port your Nest application is pointing to is <code>process.env.PORT</code> as GAE sets the best port available for your applica... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Author and address relationship with EF Core<p>I have a .NET application written with EF Core as ORM.</p>
<p>I don't know the relationship between an <code>A... | <blockquote>
<p>Is it possible to have addresses related to many authors?</p>
</blockquote>
<p>This is up to you to decide whether there are multiple authors living in the same house or not or, an author could have multiple houses. But you may build such type of relationship in EF Core.</p>
<blockquote>
<p>Is it a many... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you create multiple buttons in a ListView that are independent of each other?<p>I have setup a Firestore database in which I have a collection 'produc... | <p>You are using single variable <code>iconColor</code> to change all items. That's why all items are getting effected by changing any of it. You can create a <code>List<int></code> to hold selected index
, <code>List<YourModelClass></code> or on your model create another bool variable <code>bool icChecke... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to patch spring cloud data flow starter application (add oracle driver to jdbc-source app)<p>Im trying to add an oracle jdbc driver to to the <a href="ht... | <p>You are using the old (now deprecated) app starters repository. The new apps repository is here: <a href="https://github.com/spring-cloud/stream-applications" rel="nofollow noreferrer">https://github.com/spring-cloud/stream-applications</a>.</p>
<p>You need to patch the JDBC Source with the proper Oracle driver.</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make sure only one boolean box is ticked at a time<p>I have a Boolean button where I want a user to only click or choose one.
I am using Microsoft Dyn... | <p>In the <code>OnValidate()</code> trigger on the page field, create a local variable of the record and do something like this; it will set all other votes to <code>FALSE</code> when you set one to <code>TRUE</code>:</p>
<pre><code>IF Vote = TRUE THEN BEGIN
theRec.SETRANGE(Vote, TRUE);
IF NOT theRec.ISEMPTY TH... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check the output of an inner function in the outer function without an unbound local error?<p>I'm working on my first calculator in python, and I need... | <p>If you declare the <code>result</code> variable outside of a loop and initialize it to <code>None</code>, you can reference that when choosing to ask about <code>num_1</code> or not.</p>
<p>like this:</p>
<pre><code>power_on = True
def calculate(operation, num_1, num_2):
if operation == "+":
r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to highlight the input button by clicking to a button?<p>I can't code jquery javascript therefore i have no idea how to highlight (border or background c... | <p>Simply add a class to the element you want to highlight. Then remove the class with the <code>setTimeout</code> function.</p>
<ol>
<li>Add a class in CSS with a high specificity that contains all visible changes you want to apply. It does not matter what it is. It can be background, border, box-shadow...</li>
<li>In... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ServiceAccountKey.json can’t be downloaded<p>I’m trying to download the serviceAccountKey.json but it’s not showing the Generate new private key button.</p> | <p>Alternate method for generating new private key via Google Cloud console:</p>
<ol>
<li>Go to <a href="https://console.cloud.google.com/" rel="nofollow noreferrer">https://console.cloud.google.com/</a></li>
<li>Select the project from the drop-down at the top of the screen</li>
<li>Go to table of contents (hamburger ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type mismatch in compose state hoisting<p>I am attempting to get one property to bind between a <code>ViewModel</code> and a <code>@Composable</code>.</p>
<p... | <p>Replace</p>
<pre><code>MyContent(
myVariable = vm.myVariable,
setMyVariable = { vm.myVariable = it }
)
</code></pre>
<p>with</p>
<pre><code>MyContent(
myVariable = vm.myVariable.value,
setMyVariable = { vm.myVariable.value = it }
)
</code></pre>
<p>and you need to define your variable like this</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error message when trying to execute exit() in VS Code<pre><code>def calculate():
while True:
operator = input("What operator do you wan... | <p>You can stop the script even with a break in this case.
you're inside a single loop.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make simple number identification Python?<p>I have this exercise:</p>
<ol>
<li>Receive 10 integers using input (one at a time).</li>
<li>Tells how man... | <p>Why not something like this?</p>
<pre><code>pos = 0
neg = 0
zer = 0
for x in range(10):
number = int(input())
if number > 0:
pos +=1
if number < 0:
neg +=1
else: # number is not positive and not negative, hence zero
zer +=1
print(pos)
print(neg)
print(zer)
</code></pre>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deploying Pytorch only for prediction<p>I've trained my model locally and now I want to use it in my Kubernetes cluster. Unfortunately, all the Docker images... | <p>No easy answer for Python version of PyTorch unfortunately (or at least none I’m aware of).</p>
<p>Python, in general, is not well-suited for Docker deployments as it carries over the dependencies (even if you don't need all of their functionality, imports are often at the top of the file making your aforementioned ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to style css of scrollbar at the root level?<pre class="lang-css prettyprint-override"><code>body {
overflow-y: scroll;
::-webkit-scrollbar {
wid... | <p>Your selectors don't seem to be correct.</p>
<p>If you're using SASS it should be:</p>
<pre><code>body {
&::-webkit-scrollbar {
width: 10px;
}
&::-webkit-scrollbar-thumb {
background-color: var(--scroll-thumb-color);
border-radius: 5px;
}
&::-webkit-scrollbar-track {
backgroun... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP(CodeIgniter)-PAYPAL IPN (unable to send the session of the current user to the ipn file of paypal)<p>My integration is working fine, even the IPN is retu... | <p>IPN is a post directly from the PayPal servers to your server. It will not share any session information with users accessing your website, because users and their user agents (browsers) are not involved in the IPN communication in any way.</p>
<p>IPN is a very old, legacy technology that should be deprecated soon a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sqlalchemy: select from joined table<p>How do i write this sql query in sqlalchemy?</p>
<pre><code>SELECT
n.name
FROM
project_nomenclatures pn
JO... | <p>It happened to be, i had to use select_from() func</p> |
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 column of numeric existing data in R?<p>I have a data frame of 22 columns and 240 rows.</p>
<p>I want to create a new column with Likert Sc... | <p>You can use case_when, like this:</p>
<pre><code> data %>%
mutate(Result = case_when(
profession == "secretary" & (e.count.descrition >= 1 |
euse.count.description >=1 |
ne.count.title >= 1) ~ 2,
prof... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to loop over observations in R?<p>I have the following dataframe, representing a subject's ID, the number of months before a follow up, and the subject's... | <p>Not very clear about the conditions. This may help - replicate the rows (<code>uncount</code> from <code>tidyr</code>) based on the value in 'follow_up' column, grouped by 'USUBJID', create a <code>seq</code>uence from 0 with increments of 12 and 'AGE' incrememented by 1 (using <code>row_number</code> as sequence)<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Docker HEALTHCHECK not working as expected<p>I have a php project to test healthchecks with three files in it:</p>
<p>index.php</p>
<pre><code><html>
... | <p>You need to have <code>||</code> between the curl command and the exit command, so the exit only is executed if curl fails. Like this</p>
<pre><code>HEALTHCHECK CMD curl --fail http://localhost/health.php || exit 1
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort first element in list of tuples found in pandas df in order to plot it<p>I have an original df with 4 columns: user (user id visiting website), month (m... | <p>The simplest solution is to not use tuples at all. You can create a pivot table, with the <code>user</code> and <code>year</code> columns as an index, the <code>month</code> column as the columns, and the <code>num_hits</code> column as the values. By first sorting the rows by <code>month</code> the columns will b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract an auth code in Location response header String using Rest Assured<p>Currently I have a method that does some authorization, which is used for... | <p>You just need simple <code>split()</code> method of String to extract value from this text.</p>
<pre><code>String url = "https://something.url.com/myapp/auth/token?code=**12WVUcPyFbmTZUOcgaluGl98r08**&iss=https%3A%2F%2Fsomething.url.com%3A8443%2Fam%2Foauth2%2Fvendors&client_id=5c1d7ex3-g3rc-4a64-9855-07... |
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 shorten dataframe name references?<p>When working with Pandas dataframes, I often run into long chains of operations. Like this:</p>
<pre><... | <p>I wouldn't say that it's much better to read or shorter to write, but if you prefer you can do the same in just one call to <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.assign.html" rel="nofollow noreferrer"><code>assign</code></a>, especially if you have a lot of new columns to create:</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB - Update data type for the nested documents<p>I have this collection: (see the full collection here <a href="https://mongoplayground.net/p/_gH4Xq1Sk4... | <ol>
<li><p><code>$set</code> - Update <code>costo</code> array.</p>
<p>1.1. <code>$map</code> - Iterate each element in the <code>costo</code> array and return a new array.</p>
<p>1.2. <code>$mergeObjects</code> - Merge current document with the document from <em>1.3</em>.</p>
<p>1.3. A document with the <code>monto_u... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling alert dialog where no context is available<p>I am fetching data from api in <code>getSmartTags()</code></p>
<p>And if error occurs, I want to show th... | <p>Try this</p>
<pre><code>//add context as parameter
Future<void> _showMyDialog(BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update an existing column of a dataframe based on values in another column?<p>In python, I'm dealing with a sales data of about 21,000 houses. Each ho... | <pre><code>df = pd.DataFrame()
df['sqft_living'] = range(396, 405)
df['grade'] = range(9)
df
</code></pre>
<p>So we have:</p>
<pre><code>sqft_living grade
0 396 0
1 397 1
2 398 2
3 399 3
4 400 4
5 401 5
6 402 6
7 403 7
8 404 8
</code></pre>
<p>We apply the condi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How Can I Make A ForLoop in Windows and Insert with Single Quotes Around the For-Each Operator<p>So I have a weird task, I am trying to clean up my AD Member... | <p>The issue with the statement:</p>
<pre class="lang-sh prettyprint-override"><code>Get-ADGroup -Filter * | Select-Object -Property Name | ForEach-Object { Get-ADGroupMember -Identity $_ }
</code></pre>
<p>Is that <code>$_</code> refers to an object which's <strong>Property is <code>Name</code></strong> and <code>Get-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.