question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72,234,945 | What type of accessToken scope/resourceType do I need when using Pnp-Powershell<p>In the PNP Docs it shows:
<a href="https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-13" rel="nofollow noreferrer">https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-13</a></p>
<p>you can access ... | <p>As you mentioned <em><strong>"Connect-PnPOnline method using a pfx certificate with password"</strong></em> is working fine.
Please check whether you have assigned required <strong>permissions</strong> and <strong>scopes</strong> while generating the access token via Azure CLI.</p>
<p><strong>To validate t... | What type of accessToken scope/resourceType do I need when using Pnp-Powershell | powershell|sharepoint|azure-active-directory | 0 | 82 | 1 | 72,258,150 | 72,258,150 | 1 | true | 2022-05-13T20:10:49.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What type of accessToken scope/resourceType do I need when using Pnp-Powershell<p>In the PNP Docs it shows:
<a href="https://pnp.github.io/powershell/cmdlets... |
72,225,506 | SwiftUI Localize Raw Strings<p>In SwiftUI how can i get my raw string localized?</p>
<pre class="lang-swift prettyprint-override"><code>Text(#"Hello \\\\"#)
</code></pre>
<p>Adding this to the localized file will not work.</p>
<pre class="lang-swift prettyprint-override"><code>"Hello \\\\" = "i... | <p>"Raw strings" don't exist in the syntax of .strings files. See <a href="https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html" rel="nofollow noreferrer">here</a>:</p>
<blockquote>
<p>some characters must be prefixed with a backslash before you can ... | SwiftUI Localize Raw Strings | swift|swiftui | 0 | 76 | 4 | 72,225,927 | 72,225,927 | 1 | true | 2022-05-13T06:53:44.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI Localize Raw Strings<p>In SwiftUI how can i get my raw string localized?</p>
<pre class="lang-swift prettyprint-override"><code>Text(#"Hello \\\... |
72,139,127 | Avoid using partially moved value in match statement<p>The solution provided in question <a href="https://stackoverflow.com/questions/38553513/use-of-partially-moved-value-error-in-match-statement">38553513</a> does not work for me.</p>
<p>Consider these types and functions:</p>
<pre><code>pub enum Parameter {
Para... | <p>The most idiomatic way to fix this would be to change the signature of <code>use_string</code> so that it takes a <code>&str</code> instead of a <code>String</code>:</p>
<pre><code>pub enum Parameter {
ParameterTypeA { n: i32 },
ParameterTypeB { s: String },
}
pub struct Res {
pub param: Parameter,
... | Avoid using partially moved value in match statement | rust|switch-statement|borrow-checker | 0 | 53 | 1 | 72,139,580 | 72,139,580 | 1 | true | 2022-05-06T09:24:18.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoid using partially moved value in match statement<p>The solution provided in question <a href="https://stackoverflow.com/questions/38553513/use-of-partial... |
72,106,958 | How to connect to posgres in Heroku from Python?<p>I have followed the <a href="https://devcenter.heroku.com/articles/connecting-heroku-postgres#connecting-in-python" rel="nofollow noreferrer">documentation</a> and in my Python code I've added:</p>
<pre><code>import os
import psycopg2
DATABASE_URL = os.environ['postgr... | <p>The whole point of putting a connection string into an environment variable is so it doesn't need to be in your source code.</p>
<p>Instead of looking up the value of <code>DATABASE_URL</code> manually and pasting it into your source code, use the <em>name</em> of the environment variable:</p>
<pre class="lang-py pr... | How to connect to posgres in Heroku from Python? | heroku|heroku-postgres | 0 | 24 | 1 | 72,111,987 | 72,111,987 | 1 | true | 2022-05-04T01:09:56.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to connect to posgres in Heroku from Python?<p>I have followed the <a href="https://devcenter.heroku.com/articles/connecting-heroku-postgres#connecting-i... |
72,222,511 | Cannot create database migration on EF Core but It can when you ask to EnsureCreate database<p>I am trying to inject some repository to a service and some services to a controller but I am using the DbContext is an assembly that is not the startup project but oddily when i try to call to create a migration it tells me... | <p>Try to add a parameterless constructor in your DbContext class.</p>
<p>If that doesn't work you might need to add a design time factory as described <a href="https://docs.microsoft.com/en-us/ef/core/cli/dbcontext-creation?tabs=dotnet-core-cli#from-a-design-time-factory" rel="nofollow noreferrer">here</a>.</p> | Cannot create database migration on EF Core but It can when you ask to EnsureCreate database | asp.net-core|entity-framework-core|asp.net-core-mvc|asp.net-core-webapi | 0 | 103 | 1 | 72,222,572 | 72,222,572 | 1 | true | 2022-05-12T22:02:45.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot create database migration on EF Core but It can when you ask to EnsureCreate database<p>I am trying to inject some repository to a service and some s... |
72,155,887 | Setting tkinter Text yview / Text view area<p>I would like to set the tkinter Text box's view area / yview to a specific area. How do I do this? I know that one can retrieve the current yview but have been unsuccessful in setting it to a desired value. I know that it can be set to the desired value because I am getting... | <p>I figured it out. We can get the yview with <code>t.yview()</code> but we can't just insert a yview value and expect it to use it. Instead, we must use <code>t.yview(MOVETO, yview[0])</code>. This gives it a value it can work with and goes to about the correct position</p>
<p>NOTE:
The same can be done with xview bu... | Setting tkinter Text yview / Text view area | python|tkinter | 0 | 149 | 1 | 72,157,309 | 72,157,309 | 1 | true | 2022-05-07T19:43:19.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting tkinter Text yview / Text view area<p>I would like to set the tkinter Text box's view area / yview to a specific area. How do I do this? I know that ... |
72,148,003 | case_when fails when condition checks for rows that don't exist<p>Consider this data:</p>
<pre><code>df <- data.frame(group = c(1, 2, 2, 2),
start = c(2, 7, 7, 7),
stop = c(8, 7, 8, 9),
unstop = c(10, 7, 9, 10))
</code></pre>
<p>I now want to setup a more or les... | <p>I think the errors are coming up when you ask R to find a <code>lead</code> either a) beyond the end of the table rows or b) outside of the group. You could pass it a default value of 0, which is never used and supresses the error, but only gets halfway there as the function is trying to concatenate every <code>star... | case_when fails when condition checks for rows that don't exist | r|tidyverse | 0 | 43 | 2 | 72,148,240 | 72,148,240 | 1 | true | 2022-05-06T22:33:54.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
case_when fails when condition checks for rows that don't exist<p>Consider this data:</p>
<pre><code>df <- data.frame(group = c(1, 2, 2, 2),
... |
72,147,647 | r - Plotting monthly time series data in R - cannot plot more than 10 series<p>I'm having a lot of trouble plotting my time series data in R Studio. My data is laid out as follows:</p>
<blockquote>
<p>tsf</p>
</blockquote>
<pre><code>Time Series:
Start = 1995
End = 2021
Frequency = 1
Jan Feb Mar Apr Ma... | <p>I think the problem is with the shape of your data. It's indicating <code>Frequency = 1</code>, showing that it thinks the monthly columns are separate yearly time series, rather than a continuous time series across months. To plot the whole time length you can reshape your time series to match monthly frequency (fr... | r - Plotting monthly time series data in R - cannot plot more than 10 series | r|ggplot2|plot|multivariate-time-series | 0 | 50 | 2 | 72,148,548 | 72,148,548 | 1 | true | 2022-05-06T21:42:39.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
r - Plotting monthly time series data in R - cannot plot more than 10 series<p>I'm having a lot of trouble plotting my time series data in R Studio. My data ... |
72,214,078 | Is it possible to prioritize (give a priority) to specific Akka's Actor?<p>I've made my research about Akka Framework,
And I would like to know ;
Is it possible to give a priority to a specific actor?
I mean - actors are working while getting a "let" message from the queue,
Is there an option to let an actor ... | <p>Effectively, yes.</p>
<p>One of the parts of your Actor configuration is which <a href="https://doc.akka.io/docs/akka/current/typed/dispatchers.html#more-dispatcher-configuration-examples" rel="nofollow noreferrer">Dispatcher</a> those actors will use. A dispatcher is what connects the actor to the actual threads th... | Is it possible to prioritize (give a priority) to specific Akka's Actor? | akka|actor | 0 | 73 | 1 | 72,232,770 | 72,232,770 | 1 | true | 2022-05-12T10:36:33.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to prioritize (give a priority) to specific Akka's Actor?<p>I've made my research about Akka Framework,
And I would like to know ;
Is it possi... |
72,158,482 | How to display image in ReactJS from MongoDB<p>I am currently building a drawing app using React, Node and MongoDB.</p>
<p>It saves images along with name and username in the database. When home page is opened, it has to retrieve and display the image on the screen.</p>
<p>The image is stored in database in the form of... | <p>so, as the server is sending a JSON image, you need to convert JSON to Buffer with Int8Array</p>
<p>then that needs to be converted to Blob, and then create a URL object:</p>
<p>EDIT: use <code>useEffect</code> when fetching, that's what's giving that loop error</p>
<p>try it now:</p>
<pre><code>import React, { useS... | How to display image in ReactJS from MongoDB | node.js|reactjs|mongodb|mern | 0 | 724 | 2 | 72,160,101 | 72,160,101 | 1 | true | 2022-05-08T05:54:16.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display image in ReactJS from MongoDB<p>I am currently building a drawing app using React, Node and MongoDB.</p>
<p>It saves images along with name an... |
72,147,990 | How to call getter and setter from within a javascript class<p>Is it possible to call getter and setter from within own class ? If yes what's the valid syntax instead of invalid</p>
<pre><code> this.gettext();
</code></pre>
<p>in below class :</p>
<pre><code> class Test {
_text: string;
constructor(value: st... | <p>Setters are called during asignment and getters during reading.</p>
<pre class="lang-js prettyprint-override"><code> this.text = "testing..."
</code></pre>
<p>will call the setter passing "testing..." as a value.</p>
<pre class="lang-js prettyprint-override"><code> console.log(this.text)
</code... | How to call getter and setter from within a javascript class | javascript | 0 | 207 | 2 | 72,148,046 | 72,148,046 | 1 | true | 2022-05-06T22:32:04.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call getter and setter from within a javascript class<p>Is it possible to call getter and setter from within own class ? If yes what's the valid synta... |
72,229,749 | File exists but Colab says no such file found<p>I mounted the files from google drive correctly with the following code.</p>
<pre><code>from google.colab import drive
drive.mount('/content/gdrive')
base_path = "/content/gdrive/MyDrive/Colab\ Notebooks/data"
CAPUCHIN_FILE = os.path.join(base_path, 'Parsed_Capu... | <p>You have a backslash in your <code>base_path</code>. The ls command and Python's string handling might escape that backslash differently.</p>
<pre><code>base_path = "/content/gdrive/MyDrive/Colab Notebooks/data"
</code></pre> | File exists but Colab says no such file found | python|tensorflow|google-colaboratory | 0 | 65 | 1 | 72,230,080 | 72,230,080 | 1 | true | 2022-05-13T12:38:20.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
File exists but Colab says no such file found<p>I mounted the files from google drive correctly with the following code.</p>
<pre><code>from google.colab imp... |
72,187,764 | How do you use " (double quotes) in a formula in OpenOffice VBA? For instance with Replace()<p>I am looking to replace double quotes, <code>"</code>, with backslash escaped double quotes - <code>\"</code>.</p>
<p>I read online that you can use double quotes in VBA, if you use two double quotes inside the main... | <p>When I entered <code>a"b</code> in a cell, Calc converted it to a right double quote, not a left one. Adding this line made it work:</p>
<pre><code>NewString = Replace(NewString, CHR(148), "\"+CHR(148))
</code></pre>
<p>Be aware that <code>x94</code> (decimal 148) is an extended ASCII encoded characte... | How do you use " (double quotes) in a formula in OpenOffice VBA? For instance with Replace() | vba|openoffice-calc | 0 | 109 | 1 | 72,203,261 | 72,203,261 | 1 | true | 2022-05-10T14:00:56.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you use " (double quotes) in a formula in OpenOffice VBA? For instance with Replace()<p>I am looking to replace double quotes, <code>"</code>, wi... |
72,165,131 | Binding tables with fulltext search query?<p>I run into a problem. I have three tables: product, where is stored his price and name. Then table Query with atributtes like description of searched words and their frequency(so there are no duplicates). And table UsersQuery, where each of the searched words of the user are... | <p>-- table is case insensitive so use product,query, user_query. please refer manual 4.1 lexical structure.<br />
<a href="https://dbfiddle.uk/?rdbms=postgres_14&fiddle=8a146ba5fe03a2bc138c295b85731efc" rel="nofollow noreferrer"><strong>demo</strong></a></p>
<p>I hope I understand correctly. The <strong>number_of... | Binding tables with fulltext search query? | database|postgresql|full-text-search | 0 | 34 | 1 | 72,168,184 | 72,168,184 | 1 | true | 2022-05-08T21:14:23.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Binding tables with fulltext search query?<p>I run into a problem. I have three tables: product, where is stored his price and name. Then table Query with at... |
72,213,203 | Elasticsearch query for wikipedia pages<p>I have indexed all wikipedia pages on elasticsearch, and now I would like to search through them according to a list of keywords that I have created. The documents on elasticsearch have only three fields: <code>id</code> for the page id, <code>title</code> for the page title an... | <blockquote>
<p>The query has a set of similar multi_match clauses searching my keywords in fields like ["title.plain^1", "title^3"]. While I understand the ^n boost, I ignore what .plain refers to. Does it have to do with elasticsearch itself (i.e. is it a field derived from title at index time?) o... | Elasticsearch query for wikipedia pages | elasticsearch|full-text-search|mediawiki|mediawiki-api | 0 | 136 | 3 | 72,297,174 | 72,297,174 | 1 | true | 2022-05-12T09:33:02.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Elasticsearch query for wikipedia pages<p>I have indexed all wikipedia pages on elasticsearch, and now I would like to search through them according to a lis... |
72,047,777 | CPU Percentage Scan<p>I need to scan through all running processes and filter the ones with high usage.
I currently have the code bellow but is taking too long to scan through them.</p>
<p>Is there a way that this can be done faster?</p>
<pre><code>
for proc in psutil.process_iter():
try:
cpu_usage = proc.c... | <p>The reason it is taking so long is because <code>proc.cpu_percent(1)</code> is a blocking function that take 1 second every time it is called. According to the <a href="https://psutil.readthedocs.io/en/latest/#psutil.Process.cpu_percent" rel="nofollow noreferrer">docs</a>, the function can be called once with interv... | CPU Percentage Scan | python-3.x | 0 | 29 | 1 | 72,050,940 | 72,050,940 | 1 | true | 2022-04-28T17:13:48.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CPU Percentage Scan<p>I need to scan through all running processes and filter the ones with high usage.
I currently have the code bellow but is taking too lo... |
72,104,777 | How can I, using a WebApplication MapGet handler, send an image as an HTTP response?<p>Here's my sample command line app. I'm using Windows 10 with dot-net 6.</p>
<pre><code>using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System.IO;
var app = WebApplication.Builder();
app.MapGet("/"... | <p>If you want to send the image as file download:</p>
<pre><code>var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", MyGet);
async Task MyGet(HttpContext context)
{
context.Response.ContentType="image/png";
context.Response.Headers.Add("content-di... | How can I, using a WebApplication MapGet handler, send an image as an HTTP response? | asp.net-core|http|.net-core | 0 | 527 | 2 | 72,106,629 | 72,106,629 | 1 | true | 2022-05-03T19:53:49.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I, using a WebApplication MapGet handler, send an image as an HTTP response?<p>Here's my sample command line app. I'm using Windows 10 with dot-net 6... |
72,202,451 | React router how to get current path and look for its updates<p>Hello I have question how can I get current path of app with search params and look for its updates. For example I have <code>localhost3000/?filter=breakfastdinner</code> and I want to go back to <code>localhost3000/?filter=breakfast</code>. I want to wait... | <p>What about using <code>useRouter();</code> and pass the route in the useEffect deps, something like:</p>
<pre><code>const { asPath } = useRouter(); // asPath or whatever from the router
useEffect(() => {
for (let i = 0; i <= recipeTypesArray.length - 1; i++) {
if (searchParams.get("filter"... | React router how to get current path and look for its updates | reactjs|react-router | 0 | 96 | 2 | 72,202,492 | 72,202,492 | 1 | true | 2022-05-11T14:02:21.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React router how to get current path and look for its updates<p>Hello I have question how can I get current path of app with search params and look for its u... |
72,166,725 | How to override localparam? -GPARAM=VAL not working<p>I know we can override a generic/parameter in Verilog/SystemVerilog using vsim's option <code>-GMYPARAM=VALUE</code>.</p>
<p>This doesn't work for a <code>localparam</code> and the use of <code>localparam</code> in the module to prevent the change of the value isn't... | <p>Normally the only way to override a <code>localparam</code> is by changing it to a <code>parameter</code>. But Modelsim has a <code>vopt</code> switch that global converts all localparam to parameters for the -G option. You can look it up in the ModelSim/Questa Reference Manual</p> | How to override localparam? -GPARAM=VAL not working | system-verilog|modelsim|questasim | 0 | 185 | 1 | 72,166,875 | 72,166,875 | 1 | true | 2022-05-09T03:34:20.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to override localparam? -GPARAM=VAL not working<p>I know we can override a generic/parameter in Verilog/SystemVerilog using vsim's option <code>-GMYPARAM... |
72,063,341 | How do I search Column O for a value listed on another sheet and change row color?<p>I have a spreadsheet where I want to search row by row and compare the value in column O to one on my "Menu" page. If the value in column O is less than the value of Menu, turn the whole row red.</p>
<p>This is what I have s... | <p>This appears to work...</p>
<pre><code> function checkDate(sheetName){
menu = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("menu");
sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
var rows = sheet.getDataRange().getValues();
console.log(sheet.getName... | How do I search Column O for a value listed on another sheet and change row color? | google-apps-script|google-sheets | 0 | 32 | 2 | 72,063,795 | 72,063,795 | 1 | true | 2022-04-29T20:25:13.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I search Column O for a value listed on another sheet and change row color?<p>I have a spreadsheet where I want to search row by row and compare the v... |
72,171,886 | Slow, nested For loop<p>Code shown is a subroutine that compares the data in two arrays looking for account numbers that appear in one list but not the other. If it finds one that's missing, it adds the account information to a Sheet. On a usual day, it finds 10-20 missing accounts out of 2,500 - 4,000 records depend... | <p>Replace <em>all</em> your Opportunities.Cells lines with this <em>single</em> one</p>
<pre><code>Opportunities.Cells(n, 2).Resize(1, 15).Value2 = WorksheetFunction.Index(Saved_User_Input, i, 0)
</code></pre>
<p><strong>Edit</strong> (to eliminate one loop)</p>
<p>Replace the loop below</p>
<pre><code>For y = 1 To Op... | Slow, nested For loop | vba|performance | 0 | 52 | 1 | 72,172,068 | 72,172,068 | 1 | true | 2022-05-09T12:18:21.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Slow, nested For loop<p>Code shown is a subroutine that compares the data in two arrays looking for account numbers that appear in one list but not the other... |
72,206,214 | Copy data to another spreadsheet based off value stored in string<p>I have the below code for one of my financial reports and I'm struggling with updating the code to make it more automated. The code creates a string of the column headers stored in multiple sheets. Each column header is a new tab in wb2. I can't figure... | <pre><code>Sub Prepare_CYTD_Report()
Dim addresses() As String
Dim wb1 As Workbook, wb2 As Workbook
Dim i As Long, lastCol As Long, my_FileName
Dim tabNames As Range, cell As Range, tabName As String
addresses = Strings.Split("A12:A26,A32:A38,A42:A58,A62:A70,A73:A76,A83:A90", ",&... | Copy data to another spreadsheet based off value stored in string | excel|vba|string | 0 | 80 | 1 | 72,208,389 | 72,208,389 | 1 | true | 2022-05-11T18:52:38.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Copy data to another spreadsheet based off value stored in string<p>I have the below code for one of my financial reports and I'm struggling with updating th... |
72,229,449 | How do i change table zebra pattern colors using <input type='color'/><p>I created two color picker to change table colors in html using input, but i don't know how to change those colors based off what user picks in color picker. I really, really don't want to use jquery and i prefer it to be really simple.
Also if it... | <p>You can use a css variable and change the variable with JavaScript when the color is selected.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const root = document.querySel... | How do i change table zebra pattern colors using <input type='color'/> | javascript|html|css | 0 | 46 | 2 | 72,230,325 | 72,230,325 | 1 | true | 2022-05-13T12:14:50.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i change table zebra pattern colors using <input type='color'/><p>I created two color picker to change table colors in html using input, but i don't k... |
72,172,260 | How do I assign textures to 2D meshes in Bevy?<p>I want to create hexagonal tiles similar to Civilization that I can click on the tiles and move things in and out of them with a drag and drop system. The code I've written throws an error after I run the program:</p>
<pre class="lang-none prettyprint-override"><code>Mes... | <p>With the default shader in <code>bevy</code> your mesh must also have <strong>normals</strong> and <strong>uvs</strong> for each vertex.</p>
<p>You could either provide your own shader or add the required attributes, similar to the method shown in <a href="https://stackoverflow.com/a/66724123/4593433">this answer</a... | How do I assign textures to 2D meshes in Bevy? | rust|mesh|bevy | 0 | 495 | 1 | 72,173,648 | 72,173,648 | 1 | true | 2022-05-09T12:46:35.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I assign textures to 2D meshes in Bevy?<p>I want to create hexagonal tiles similar to Civilization that I can click on the tiles and move things in an... |
72,143,687 | How to get the week number starting from monday of given month in python?<p>I was trying to calculate the week number starting from first Monday of October. Is there any functions in pandas or datetime to do the calculation efficiently?</p>
<h1>MWE</h1>
<pre class="lang-py prettyprint-override"><code>import pandas as p... | <p>Shift dates by the number of days to new year, they use standard Monday week number formatting (<code>%W</code>):</p>
<pre><code>df['Fiscal_Week'] = (
df['date'] + pd.DateOffset(days=91)
).dt.strftime('%W').astype(int).replace({0:None}).fillna(method='ffill')
</code></pre>
<ul>
<li>The offset in days can be calc... | How to get the week number starting from monday of given month in python? | python|pandas | 0 | 41 | 1 | 72,143,984 | 72,143,984 | 1 | true | 2022-05-06T15:08:12.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the week number starting from monday of given month in python?<p>I was trying to calculate the week number starting from first Monday of October. ... |
72,209,787 | How to modify the value of only one of the keyvalues in the json array of js and keep the others?<p>This is the data that needs to be processed</p>
<pre><code>let test=[
{
"id": 28620,
"name": "fenbi1",
"dn": "chl"
},
{
"id": 5941,
&q... | <p>Just a simple for loop might be better than map in this situation</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>let test=[
{
"id": 28620,
"name": "fenbi1",
"... | How to modify the value of only one of the keyvalues in the json array of js and keep the others? | javascript | 0 | 19 | 3 | 72,209,838 | 72,209,838 | 1 | true | 2022-05-12T03:23:50.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modify the value of only one of the keyvalues in the json array of js and keep the others?<p>This is the data that needs to be processed</p>
<pre><cod... |
72,209,333 | C# string with multiple double quotes & "/" slashes<p><strong>I have a string like this</strong></p>
<pre><code>'Name.ToLower().Contains ("") And Created < ("05/12/2022 01:41:16") And Disabled == false'
</code></pre>
<p>How to deal with this in C#?</p>
<p>I've tried prepending with <code>@"&... | <pre class="lang-cs prettyprint-override"><code>var a = @"'Name.ToLower().Contains ("""") And Created < (""05/12/2022"") And ExpandOnStart == false'";
</code></pre>
<p>like this?</p> | C# string with multiple double quotes & "/" slashes | c#|string|double-quotes|string-literals | 0 | 63 | 3 | 72,209,352 | 72,209,352 | 1 | true | 2022-05-12T02:00:36.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# string with multiple double quotes & "/" slashes<p><strong>I have a string like this</strong></p>
<pre><code>'Name.ToLower().Contains ("") And C... |
72,157,751 | Store the number of incoming data in API<p>in SwiftUI</p>
<p>I'm trying to count the number of data in API
To display on the View</p>
<p>When I print a variable <code>@Published var counts = 0</code> in the same class, I see that the value coming from API has been saved</p>
<p>But when it is displayed on the View comes... | <p>you could try the following alternative approach to get the count of your models:</p>
<pre><code>struct Tap1Section1: View {
@StateObject var viewModel = Api() // <-- here
var body: some View {
VStack {
Text("\(viewModel.models.count)") // <-- here
F... | Store the number of incoming data in API | ios|swiftui | 0 | 29 | 1 | 72,157,872 | 72,157,872 | 1 | true | 2022-05-08T02:59:35.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Store the number of incoming data in API<p>in SwiftUI</p>
<p>I'm trying to count the number of data in API
To display on the View</p>
<p>When I print a varia... |
72,158,280 | Error about trying to view a TabView by API<p>I am facing this error</p>
<pre><code>Thread 1: Fatal error: Index out of range
</code></pre>
<p>I want to view content by TabView</p>
<p>The number of times come from the number of data from API</p>
<p>The background of his image is displayed on the number of data in API</... | <p>try this sample code to show your <code>TabView</code> image and number on top.
Adapt the code for your purpose. You need to have a View while the data is being fetched.
Use <code>.tag</code> so <code>TabView</code> knows which one you want to see.</p>
<p>This is just an example, you should re-structure your code, t... | Error about trying to view a TabView by API | ios|swiftui | 0 | 64 | 1 | 72,158,800 | 72,158,800 | 1 | true | 2022-05-08T05:16:34.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error about trying to view a TabView by API<p>I am facing this error</p>
<pre><code>Thread 1: Fatal error: Index out of range
</code></pre>
<p>I want to view... |
72,236,147 | Updating @Published var if a userdefault value is present swift<p>I am trying to check my app and see if a value exists in user defaults and if it does exist they will be taken into the app. If it doesnt exist they need to enter there pin and then get into the app.</p>
<p>Any idea how to check if a value is present in ... | <p>try this, to check your <code>UserDefaults</code> when the App starts (ie. when <code>Authentication</code> is created):</p>
<pre><code>class Authentication: ObservableObject {
@Published var isValidated = false
// --- here
init() {
getIsValidated
}
//....
</code></pre>
<p>Note th... | Updating @Published var if a userdefault value is present swift | swift|swiftui | 0 | 103 | 2 | 72,236,348 | 72,236,348 | 1 | true | 2022-05-13T23:06:44.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating @Published var if a userdefault value is present swift<p>I am trying to check my app and see if a value exists in user defaults and if it does exist... |
72,178,106 | How do I use a .svg image as a HTML icon?<p>I have some .svg images and I want to use then as icon in my webpage. Is there any way to do this with the <code><i></code> tag?</p> | <p>I've solved my problem adding the svg code of the image directly on my html.</p>
<p>Something like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><svg class="b... | How do I use a .svg image as a HTML icon? | html|css|svg|icons | 0 | 595 | 1 | 72,536,365 | 72,536,365 | 1 | true | 2022-05-09T20:53:32.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I use a .svg image as a HTML icon?<p>I have some .svg images and I want to use then as icon in my webpage. Is there any way to do this with the <code>... |
72,232,317 | C++ change parent class based on option<p>There is a <strong>Student</strong> class inherited from <strong>Person</strong>.
And there is <strong>Student</strong> class inherited from <strong>University</strong>.
I want to change the parent class <strong>Person</strong>, <strong>University</strong> based on the option w... | <p>Since we can't know what <code>option.person</code> is at compile-time, we need to find a way to work around that at runtime.</p>
<p>One option for doing so is <code>std::variant</code>, which can store any number of different types; but does so at the cost of always having the same size as the largest templated typ... | C++ change parent class based on option | c++|class | 0 | 56 | 1 | 72,233,089 | 72,233,089 | 1 | true | 2022-05-13T15:53:29.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ change parent class based on option<p>There is a <strong>Student</strong> class inherited from <strong>Person</strong>.
And there is <strong>Student</str... |
72,208,949 | Iterate a JSON data, put comma after each run and SerializeObject<p>I am trying to <strong>iterate</strong> (Do While) JSON data input, put <strong>Comma</strong> after each run, and <strong>put [ ]</strong> around at the end.</p>
<pre class="lang-cs prettyprint-override"><code>var query = new QueryFunction()
{
... | <p>Don't append the JSON string manually.</p>
<p>Instead, add the object into the array/list during the iteration in the <code>do-while</code> loop.</p>
<p>The <code>result.Data</code> returns an array of data, hence you need <code>List.AddRange()</code>.</p>
<p>When the loop exits, serialize the array/list.</p>
<pre c... | Iterate a JSON data, put comma after each run and SerializeObject | c#|json|serialization|json.net | 0 | 84 | 1 | 72,209,147 | 72,209,147 | 1 | true | 2022-05-12T00:42:11.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Iterate a JSON data, put comma after each run and SerializeObject<p>I am trying to <strong>iterate</strong> (Do While) JSON data input, put <strong>Comma</st... |
72,229,107 | Autmapper map collections of different types to collection of another type with nesting<p>I am currently struggling with automapper.10.1.1 config.
I have following types:</p>
<pre class="lang-cs prettyprint-override"><code>class Response
{
List<Assignment> Assignments { get; }
List<Product> Products... | <p>Would suggest using <a href="https://docs.automapper.org/en/stable/Custom-type-converters.html" rel="nofollow noreferrer">Custom Type Resolver</a> for your scenario.</p>
<blockquote>
<p>Mapping Configuration / Profile</p>
</blockquote>
<pre class="lang-cs prettyprint-override"><code>cfg.CreateMap<Assignment, Assi... | Autmapper map collections of different types to collection of another type with nesting | c#|collections|merge|nested|automapper | 0 | 95 | 1 | 72,246,914 | 72,246,914 | 1 | true | 2022-05-13T11:49:02.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Autmapper map collections of different types to collection of another type with nesting<p>I am currently struggling with automapper.10.1.1 config.
I have fol... |
72,152,962 | Pressing button for 3 seconds and how to measure its time with Atmega8 1MHz?<p>Currently I have Atmega8 1MHz Microcontroller. I'm working with C language.
So basically my program shows numbers on the 7 segment display.
And each time you press the button it increases number +1</p>
<p>Right now I want to measure time an... | <p>I am not about to wade through all that code to answer your question - not least because your naming convention, lack of comments or I/O abstraction make it very difficult to determine what I/O is for what or what code does what. But the "logic" would be as follows (replace timing and I/O calls with those... | Pressing button for 3 seconds and how to measure its time with Atmega8 1MHz? | c|embedded|microcontroller|interrupt|atmega | 0 | 115 | 1 | 72,154,779 | 72,154,779 | 1 | true | 2022-05-07T13:24:44.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pressing button for 3 seconds and how to measure its time with Atmega8 1MHz?<p>Currently I have Atmega8 1MHz Microcontroller. I'm working with C language.
S... |
72,157,193 | duplicated data scraper json api<p>I have this script:</p>
<pre><code>import scrapy
from scrapy.crawler import CrawlerProcess
from datetime import datetime
import os
if os.path.exists('jfs_hombre.csv'):
os.remove('jfs_hombre.csv')
print("The file has been deleted successfully")
else:
pri... | <p>You are using <code>'Casa':'Just_For_Sports',</code> which is not correct, it would be <code>result['Just_For_Sports']</code> but the most important thing is that from where you have got the <code>"Just_For_Sports"</code>. I didn't find it in product list. Actually,you can't include the key that didn't exi... | duplicated data scraper json api | python|json|web-scraping|scrapy | 0 | 63 | 1 | 72,157,447 | 72,157,447 | 1 | true | 2022-05-08T00:05:01.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
duplicated data scraper json api<p>I have this script:</p>
<pre><code>import scrapy
from scrapy.crawler import CrawlerProcess
from datetime import datetime
i... |
72,172,145 | How to scrap depending on a class name with BeautifulSoup<p>I'm using Python and BeautifulSoup for web scrapping, and I'd like to sort the results depending on a class name on my html page.
There is my code:</p>
<pre><code>import requests
from bs4 import BeautifulSoup
import pandas as pd
url = 'https://www.ville-saint... | <p>The url entirely depends on Javascript. So you can grab text value usin selenium with bs4.</p>
<pre><code>import time
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from webdriver_manag... | How to scrap depending on a class name with BeautifulSoup | python|html|web-scraping|beautifulsoup | 0 | 66 | 1 | 72,172,933 | 72,172,933 | 1 | true | 2022-05-09T12:37:34.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to scrap depending on a class name with BeautifulSoup<p>I'm using Python and BeautifulSoup for web scrapping, and I'd like to sort the results depending ... |
72,147,730 | Outlook VSTO - Allow specific AD group to see ribbon<p>How can I <strong>programmatically</strong> restrict the VSTO Add-in Ribbon visibility to a specific AD group only? Can this be controlled directly from the Ribbon XML itself? The plugin is distributed to entire org, but need the ribbon visibility to change by AD g... | <p>No, but your own code can easily perform the check and show/hide the ribbon using the <code>getVisible</code> callback specified for your ribbon.</p>
<p>Would be a good idea to perform that check asynchronously and cache the check result before the ribbon is requested by Outlook. If the check completes after the rib... | Outlook VSTO - Allow specific AD group to see ribbon | c#|vsto|outlook-addin | 0 | 20 | 1 | 72,147,792 | 72,147,792 | 1 | true | 2022-05-06T21:53:47.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Outlook VSTO - Allow specific AD group to see ribbon<p>How can I <strong>programmatically</strong> restrict the VSTO Add-in Ribbon visibility to a specific A... |
72,198,821 | Social link don't added in Fragment<p>I'm trying to add social media links in fragment in my app. When I staring adding img_vk, <code>findViewById</code> selected red color. In empty project ImageView working fine.</p>
<pre><code> public class Fragment5 extends Fragment {
ImageView img_instagram,img_vk;
@N... | <p>So you should inflate the view of fragment first and then try to find your view in it.</p>
<pre><code>public class Fragment5 extends Fragment {
ImageView img_instagram,img_vk;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bun... | Social link don't added in Fragment | android|android-studio|android-fragments|imageview|social-media | 0 | 39 | 1 | 72,212,505 | 72,212,505 | 1 | true | 2022-05-11T09:44:01.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Social link don't added in Fragment<p>I'm trying to add social media links in fragment in my app. When I staring adding img_vk, <code>findViewById</code> sel... |
72,147,662 | Proportional sizing using equal heights missing constraint<p>I would like the blue container view to be the same height as the orange container view. I am using proportional sizing to do so (all of these are within a vertical stack)I selected all of the containers then added the equal heights constraint to them. I am c... | <p>The layout is exactly what you've specified for the Heights:</p>
<pre><code>Orange: 0.5 * Blue (1/2 Blue Height)
Green: == Blue
Yellow: == Blue
Purple: == Blue
Grey: 0.5 * Blue (1/2 Blue Height)
</code></pre>
<p>If you want <em>"the blue container view to be the same height as the orange container view"... | Proportional sizing using equal heights missing constraint | autolayout|proportions | 0 | 38 | 1 | 72,155,709 | 72,155,709 | 1 | true | 2022-05-06T21:45:11.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Proportional sizing using equal heights missing constraint<p>I would like the blue container view to be the same height as the orange container view. I am us... |
72,166,742 | Getting request body from apex Rest Resource class<p>I have created a rest resource in apex and I am passing in an id through the body through post man via GET request. I then deserialize the body and I am getting an empty string even when I am providing the id. code below.</p>
<p>// rest resource code, More to code bu... | <p>More of a comment than answer but it'd be too long.</p>
<blockquote>
<p>passing in an id through the body through post man via GET request</p>
</blockquote>
<p>If it's a GET request - Postman should ignore the body, GETs use only the url/uri/whatever is the official name. Make sure it's a POST and that your function... | Getting request body from apex Rest Resource class | salesforce|apex | 0 | 1,878 | 1 | 72,172,355 | 72,172,355 | 1 | true | 2022-05-09T03:38:07.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting request body from apex Rest Resource class<p>I have created a rest resource in apex and I am passing in an id through the body through post man via G... |
72,212,987 | How to display time in hours overshooting 24 hours in SSRS<p>I have a report with a column displaying time cumulatively overshooting 24 hours. I'd like it to be displayed in hours.
I've found a solution that when time exceeds 86400 seconds (number of seconds in a day), it'll display number of days and time but I want o... | <p>You could do this with expressions only but this way is a little bit more reusable..</p>
<p>Add the following code to your Report's custom code
(<em>apologies to the original author who's blog I based this on years ago... I can't find your post</em>)</p>
<p><a href="https://i.stack.imgur.com/uDyQ2.png" rel="nofollow... | How to display time in hours overshooting 24 hours in SSRS | reporting-services|ssrs-2012 | 0 | 66 | 1 | 72,222,944 | 72,222,944 | 1 | true | 2022-05-12T09:17:59.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display time in hours overshooting 24 hours in SSRS<p>I have a report with a column displaying time cumulatively overshooting 24 hours. I'd like it to... |
72,165,779 | Webpack not able to interpret files?<p>I'm trying to use webpack with react and ts so I can optimise my websites, however I have come to a stumbling point with webpack. Below is my webpack.config.js file, which I believe is all correct, but maybe not? And below that is the image of the error.</p>
<pre><code>const path ... | <h4>You are missing loader to handle CSS files.</h4>
<p>Just like you have added loader in <code>module.rules</code> array to handle <code>.js</code> and <code>.tsx</code> file, similarly you have to add appropriate file loader to handle <code>.css</code> file.</p>
<p>For that you need to install at least two npm packa... | Webpack not able to interpret files? | webpack|babeljs|webpack-5 | 0 | 38 | 1 | 72,166,199 | 72,166,199 | 1 | true | 2022-05-08T23:37:43.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webpack not able to interpret files?<p>I'm trying to use webpack with react and ts so I can optimise my websites, however I have come to a stumbling point wi... |
72,203,919 | How to rename variable (data) after destructuring (SWR hook for example)<p>If I have 2 SWR hooks in same function (or some other hook that has a data variable),</p>
<pre><code>export default function Panel() {
const { data, error } = useSWR("/api/customer", fetcher);
const { data, error } = useSWR("/api/... | <p>you can try destructuring and rename property</p>
<pre><code>export default function Panel() {
const { data: data1, error: error1 } = useSWR("/api/customer", fetcher);
const { data: data2, error: error2 } = useSWR("/api/user", fetcher);
...
data.map(...)
}
</code></pre>
<p>and can... | How to rename variable (data) after destructuring (SWR hook for example) | javascript|reactjs|react-hooks|next.js|swr | 0 | 176 | 1 | 72,203,958 | 72,203,958 | 1 | true | 2022-05-11T15:40:32.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rename variable (data) after destructuring (SWR hook for example)<p>If I have 2 SWR hooks in same function (or some other hook that has a data variabl... |
72,189,011 | How to inspect files compiled by webpack before they are emitted<p>I'm using webpack (v4) to package assets for my UI application. I'd like to run a function that checks the contents of the compiled assets for invalid strings ideally <em>before</em> the files are emitted to the output directory. In coming up with an ... | <p>If you want control the emitting assets you must use <strong><code>compiler.hooks.shouldEmit</code></strong> hook, with it's return value you can actually control. Which you cant control with <strong><code>compiler.hooks.emit</code></strong> hook. Both execute before emitting assets but <strong><code>shouldEmit</cod... | How to inspect files compiled by webpack before they are emitted | webpack|webpack-4 | 0 | 227 | 1 | 72,248,002 | 72,248,002 | 1 | true | 2022-05-10T15:21:48.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to inspect files compiled by webpack before they are emitted<p>I'm using webpack (v4) to package assets for my UI application. I'd like to run a functio... |
72,196,053 | Comparison of Multiple Conditions Using Filters in React TypeScript<p>I'm going to make a new arrangement by comparing the current list data with the filter data</p>
<p>I made a new arrangement by comparing one condition using a filter, and all I want to do is compare many conditions, so please help me</p>
<p>index.tsx... | <p>You can just add more conditions to the filter itself:</p>
<p><code>const filteredData = listData.filter((user) => user === form.user && condition2 && condition3);</code></p>
<p>In case you would like to do some processing before checking a condition, you can add that as follows:</p>
<pre><code>c... | Comparison of Multiple Conditions Using Filters in React TypeScript | javascript|reactjs|typescript|filter|use-state | 0 | 108 | 1 | 72,196,099 | 72,196,099 | 1 | true | 2022-05-11T05:57:29.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparison of Multiple Conditions Using Filters in React TypeScript<p>I'm going to make a new arrangement by comparing the current list data with the filter ... |
72,224,646 | How to add background color to the test in webpage?<p>I found some text in webpage using below code</p>
<pre><code>document.body.innerText.indexOf('tested')
document.body.innerText.includes('tested')
</code></pre>
<p>after finding the text I want to apply background color to that text.</p> | <p>Find the reference of the element with your innerText:</p>
<pre><code>let xpath = "//div[text()='tested']";
let element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
</code></pre>
<p>Replace <code>div</code> with whatever type of element you have whe... | How to add background color to the test in webpage? | javascript|html|angular | 0 | 26 | 1 | 72,224,662 | 72,224,662 | 1 | true | 2022-05-13T04:58:36.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add background color to the test in webpage?<p>I found some text in webpage using below code</p>
<pre><code>document.body.innerText.indexOf('tested')
... |
72,167,685 | SwiftUI Animation breaks when moved to Swift Package Manager<p>I want to implement a text animation in SwiftUI and made a view that boils down to something like this:</p>
<pre class="lang-swift prettyprint-override"><code>public struct AnimatedTextView: View, Animatable {
public var number: CGFloat
public ini... | <p>So it seems that the issue is not related to being the code inside the package, but actually to the iOS version.</p>
<p>I have dropped your app's <em>iOS Deployment Target</em> to <strong>iOS 14</strong>, and the animation appears to be broken in the <em>App module</em> as well. Then, I bumped it again to <strong>iO... | SwiftUI Animation breaks when moved to Swift Package Manager | swift|swiftui|swift-package-manager | 0 | 46 | 1 | 72,171,407 | 72,171,407 | 1 | true | 2022-05-09T06:20:24.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI Animation breaks when moved to Swift Package Manager<p>I want to implement a text animation in SwiftUI and made a view that boils down to something l... |
72,162,256 | Attempt of fit a Gaussian distribution: Error scipy/optimize/minpack.py", line 765, in curve_fit raise ValueError("`sigma` has incorrect shape.")<p>I have a pretty known issue but impossible to fix for the moment.
This is about <code>curve_fit</code> function. I get the error:</p>
<blockquote>
<p>Error scipy/optimize/m... | <p>There are two problems with the OP.</p>
<p>First problem is that the code tries to fit the random samples with a normal distribution. This is wrong. One can fit the output of the histogram, though. This is shown in the code below. Better would be the use of <code>scipy.stats.norm.fit()</code> which allows to fit the... | Attempt of fit a Gaussian distribution: Error scipy/optimize/minpack.py", line 765, in curve_fit raise ValueError("`sigma` has incorrect shape.") | python|scipy|curve-fitting|gaussian|standard-deviation | 0 | 96 | 1 | 72,168,641 | 72,168,641 | 1 | true | 2022-05-08T15:00:02.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Attempt of fit a Gaussian distribution: Error scipy/optimize/minpack.py", line 765, in curve_fit raise ValueError("`sigma` has incorrect shape.")<p>I have a ... |
72,225,910 | Contentful + Azure static web apps trigger deployment<p>I have a next.js application on Azure static web apps. I've got it building on commit to github (via github actions). Next task is for changes on contentful to trigger a build on Azure.</p>
<p>Am pretty new to Azure, can anyone advise how I do this?</p> | <p>Contentful provides the ability to use webhooks, these are URLs to hit when content is changed. Using these you can use a webhook trigger in the github action to trigger the build and inturn the deploy.</p>
<p><a href="https://www.contentful.com/developers/docs/concepts/webhooks/" rel="nofollow noreferrer">https://w... | Contentful + Azure static web apps trigger deployment | azure|next.js|contentful|azure-static-web-app | 0 | 141 | 1 | 72,225,962 | 72,225,962 | 1 | true | 2022-05-13T07:31:43.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Contentful + Azure static web apps trigger deployment<p>I have a next.js application on Azure static web apps. I've got it building on commit to github (via ... |
72,119,066 | Rails: Using selected => when setting a default value for my collection_select drop down on a form. But when I edit the item it defaults back<p>I'm stumped on this one.. I'm using this:</p>
<pre><code><%= f.collection_select :project_type, @project_types, :name, :name, {:selected => "Other"}, class: 'fo... | <p>The best way in my opinion would be to set the default value on the object itself and remove the <code>selected</code> option from the <code>collection_select</code>, so on the controller action where you create the new object you can set it:</p>
<pre><code>Model.new(project_type: 'other')
</code></pre>
<p>You can a... | Rails: Using selected => when setting a default value for my collection_select drop down on a form. But when I edit the item it defaults back | ruby-on-rails|ruby | 0 | 25 | 1 | 72,119,245 | 72,119,245 | 1 | true | 2022-05-04T20:22:54.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails: Using selected => when setting a default value for my collection_select drop down on a form. But when I edit the item it defaults back<p>I'm stumped o... |
72,233,079 | Error when trying to include Devise::Test::ControllerHelpers<p>I'm trying to get started with controller tests, and I'm not sure what I'm doing wrong. Here's my code, and the error it's producing:</p>
<pre><code>require 'test_helper'
class InvProcure::UserImportsControllerTest < ActionDispatch::IntegrationTest
in... | <p>From the doc: <a href="https://www.rubydoc.info/gems/devise/Devise/Test/ControllerHelpers" rel="nofollow noreferrer">https://www.rubydoc.info/gems/devise/Devise/Test/ControllerHelpers</a></p>
<blockquote>
<p><code>Devise::Test::ControllerHelpers</code> provides a facility to test controllers in isolation when using ... | Error when trying to include Devise::Test::ControllerHelpers | ruby-on-rails | 0 | 70 | 1 | 72,234,195 | 72,234,195 | 1 | true | 2022-05-13T16:59:43.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error when trying to include Devise::Test::ControllerHelpers<p>I'm trying to get started with controller tests, and I'm not sure what I'm doing wrong. Here's... |
72,217,050 | Python version 3.10 generating a error when trying to add a watermark to an image<p>Note: all 3.9 versions run the code perfectly creating the watermarked image.</p>
<p>I created this project to fit a watermark cross that perfectly fits the size of the image, but in this line of code:</p>
<pre><code>paste_mask = waterm... | <p>Try:</p>
<pre><code>paste_mask = watermark.split()[3].point(lambda i: int(i * TRANSPARENCY / 100.))
</code></pre>
<p>Seems that in when moving to <code>Python 3.9</code>, the <code>type inference</code> changed and the values did not automatically cast into <code>int</code>.</p> | Python version 3.10 generating a error when trying to add a watermark to an image | python|python-imaging-library|watermark | 0 | 37 | 1 | 72,217,193 | 72,217,193 | 1 | true | 2022-05-12T14:02:45.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python version 3.10 generating a error when trying to add a watermark to an image<p>Note: all 3.9 versions run the code perfectly creating the watermarked im... |
72,226,305 | Python, pyautogui: how to explicitly for os to find required file/dir?<p>I am writing Selenium tests and faced an issue when I need to upload an image, but the <em>input</em> I want to interact with is hidden from view and doesn't have a '<em>value</em>' attribute. So, I decided to <strong>use pyautogui to find and att... | <p>You can try this solution on <strong>Windows</strong>:</p>
<pre><code>while True:
try:
pyautogui.getWindowsWithTitle("Open")[0]
break
except IndexError:
pass
pyautogui.write(JPEG)
pyautogui.press("enter")
</code></pre>
<p>"Open" here is a name of window w... | Python, pyautogui: how to explicitly for os to find required file/dir? | python|selenium|pyautogui | 0 | 118 | 1 | 72,226,660 | 72,226,660 | 1 | true | 2022-05-13T08:06:29.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python, pyautogui: how to explicitly for os to find required file/dir?<p>I am writing Selenium tests and faced an issue when I need to upload an image, but t... |
72,215,703 | Get value from appsettings.json from array of objects<p>We know that we can get values from json with the IConfiguration class with the GetSection method or simply with <code>configuration["Serilog:Properties:ApplicationName"];</code> in case of array with <code>configuration.GetSection("Serilog.Enrich&q... | <p>try this</p>
<pre><code>var serverUrl = configuration.GetSection("Serilog").GetSection("WriteTo")
.Get<Dictionary<string,Dictionary<string,string>>[]>()[0]["Args"]["serverUrl"];
</code></pre>
<p>or using c# classes</p>
<pre><code>var serverUrl = configuratio... | Get value from appsettings.json from array of objects | asp.net|json | 0 | 61 | 1 | 72,216,527 | 72,216,527 | 1 | true | 2022-05-12T12:34:40.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get value from appsettings.json from array of objects<p>We know that we can get values from json with the IConfiguration class with the GetSection method or ... |
72,203,646 | User with assigned policy can't access secrets<p>I have created a kv (version 2) secrets engine, mounted on /secret:</p>
<pre><code>$ vault secrets list
Path Type Accessor Description
---- ---- -------- -----------
cubbyhole/ cubbyhole cubbyhole_915b3383... | <p>It turns out that you need to define your policy like this:</p>
<pre><code>path "secret/metadata/myproject/*" {
capabilities = ["list"]
}
path "secret/data/myproject/*" {
capabilities = ["create","read","update","delete"]
}
</code></pre>
<p>bec... | User with assigned policy can't access secrets | hashicorp-vault | 0 | 574 | 1 | 72,203,982 | 72,203,982 | 1 | true | 2022-05-11T15:23:29.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
User with assigned policy can't access secrets<p>I have created a kv (version 2) secrets engine, mounted on /secret:</p>
<pre><code>$ vault secrets list
Path... |
72,156,113 | Understanding the spring profile<p>I have basic idea how spring profile works. But here in this file this <code>-</code> i am not able to get it. And current <code>Application.yml</code> file mentioning the three profile which one will get active and when that i need to know as well. Below is the Application.yml file c... | <blockquote>
<p>But here in this file this - i am not able to get it. spring use the
naming convention like Application-.extension . so - is already
get added for the new config file then why we explicitly need to put
another one in our application.yml file under spring.profile.active</p>
<pre><code>spring:
applicati... | Understanding the spring profile | spring-boot|spring-profiles|spring-properties | 0 | 255 | 1 | 72,158,286 | 72,158,286 | 1 | true | 2022-05-07T20:25:34.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Understanding the spring profile<p>I have basic idea how spring profile works. But here in this file this <code>-</code> i am not able to get it. And current... |
72,057,120 | Mongo DB Update data<p>I want to decrease previours quantity by 1 how can I do this in Node Js Mongo Db</p>
<p>Here is my code:</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... | <p>Instead of <code>$set</code> use <code>$inc</code>. It increments a field by a specified value.</p>
<p>To decrease the value by 1 you change your code to:</p>
<pre><code>const updateDoc = { $inc: { quantity: -1 } }
</code></pre>
<p>To get more details, checkout the <a href="https://www.mongodb.com/docs/manual/refere... | Mongo DB Update data | node.js|mongodb | 0 | 30 | 1 | 72,058,091 | 72,058,091 | 1 | true | 2022-04-29T11:18:14.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongo DB Update data<p>I want to decrease previours quantity by 1 how can I do this in Node Js Mongo Db</p>
<p>Here is my code:</p>
<p><div class="snippet" ... |
72,169,197 | Get Firestore Object Attributes From Array<p>I used to have a document with the following structure:</p>
<p><strong>OldDoc:</strong></p>
<p><code>members:</code> <code>['userId1', 'userId2', 'userId3']</code></p>
<p>I then wrote a query to retrieve all documents relevant to a user:</p>
<pre><code>const docsSnapshot = a... | <p>Firestore isn't great at these kinds of queries... I'd consider restructuring your member array to be an object with user.id as keys.</p>
<pre><code>members : {
userId1: { name: "fred" },
userId2: { name: "martha" }
}
</code></pre>
<p>Another way, and perhaps more closely aligned to how Fir... | Get Firestore Object Attributes From Array | javascript|firebase|google-cloud-firestore | 0 | 30 | 1 | 72,169,448 | 72,169,448 | 1 | true | 2022-05-09T08:43:54.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get Firestore Object Attributes From Array<p>I used to have a document with the following structure:</p>
<p><strong>OldDoc:</strong></p>
<p><code>members:</c... |
72,161,363 | Make a FOR LOOP with numpy arrays multiplication and "appending" faster<p>This is my current code.</p>
<p>It works fine when the number of elements in the second "for loop" is low (around 10k) and it takes only a few seconds, but when he number of elements in the second "for loop" is high (around 40... | <p>Your code as is killed my session, presumably because the array dimension(s) was too big for memory. Trying again with smaller numbers:</p>
<pre><code> In [1]: from collections import deque
...: import random
...:
...: center_freq = 20000000
...: smpl_time = 0.03749995312*pow(10,-6)
...:
...: ... | Make a FOR LOOP with numpy arrays multiplication and "appending" faster | python|numpy|performance|loops|append | 0 | 146 | 1 | 72,164,585 | 72,164,585 | 1 | true | 2022-05-08T13:14:18.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make a FOR LOOP with numpy arrays multiplication and "appending" faster<p>This is my current code.</p>
<p>It works fine when the number of elements in the se... |
72,217,965 | Where do load balancers sit in microservice architecture?<p>I'm planning on creating a brand new backend with microservices. I've been looking into infrastructure and I'm unsure as to where load balancers come in. Does the API gateway act as a load balancer or do they sit behind each microservice. I'd love to know.</p> | <p>You can read a really nice article about it <a href="https://www.nginx.com/resources/glossary/load-balancing/" rel="nofollow noreferrer">here</a>, but in simple words - when you have a lot of traffic to your application (i.e. your microservice), one thing you can do is to deploy your application to more than one ser... | Where do load balancers sit in microservice architecture? | networking|microservices|load-balancing | 0 | 171 | 2 | 72,220,235 | 72,220,235 | 1 | true | 2022-05-12T15:03:32.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where do load balancers sit in microservice architecture?<p>I'm planning on creating a brand new backend with microservices. I've been looking into infrastru... |
72,235,485 | Clarification about modern CMake structure<p>I am not an expert C or C++ programmer, but I have to write a C and a C++ application for two course projects. To start off on the right foot, I was reading a guide about <a href="https://cliutils.gitlab.io/modern-cmake/chapters/basics/structure.html" rel="nofollow noreferre... | <p>If you are writing an application, you can put stuff wherever you want. The user mostly expects you to have a <code>bin</code> subdirectory with your binary executables. Oh, and please support the <code>CMAKE_INSTALL_PREFIX</code>: in-source builds are evil, as far as I'm concerned.</p>
<p>If you are writing a libra... | Clarification about modern CMake structure | c++|cmake|project-structure | 0 | 62 | 1 | 72,240,702 | 72,240,702 | 1 | true | 2022-05-13T21:13:51.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Clarification about modern CMake structure<p>I am not an expert C or C++ programmer, but I have to write a C and a C++ application for two course projects. T... |
72,206,854 | How to add sentence embeddings derived from an existing column into a new column?<p>I have a dataframe that has four nw_data=['Qn_id', 'Qn_context', 'Qns', 'Anwsers']. This is how it looks like</p>
<pre><code>Qn_id | Qn_context | Qns | Anwsers
01 | In 1962, Uk gave... | what year....| the y... | <p>If I understand correctly, you'd like to insert a list (embedding) into a cell.</p>
<p>Try using <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.at.html" rel="nofollow noreferrer"><code>at</code></a>:</p>
<pre class="lang-py prettyprint-override"><code>>>> import pandas ... | How to add sentence embeddings derived from an existing column into a new column? | python|pandas|nlp|sentence-transformers | 0 | 296 | 1 | 72,207,067 | 72,207,067 | 1 | true | 2022-05-11T19:48:02.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add sentence embeddings derived from an existing column into a new column?<p>I have a dataframe that has four nw_data=['Qn_id', 'Qn_context', 'Qns', '... |
72,188,986 | Filter Json Keys that contains certain character in Python<p>I need to filter all Keys in this dict (book-1, book-2 and book-3) that conatains the string 'book'and save them in a new dict. In this example no need to seave 'bicycle'.</p>
<pre><code>import json
# some JSON file:
jInfo = '{"store":{"book-1... | <p>This can be accomplished with a dict comprehension, which can be updated based on your needed filter:</p>
<pre class="lang-py prettyprint-override"><code>new_dict = {key: value for key, value in info['store'].items() if "book" in key}
</code></pre> | Filter Json Keys that contains certain character in Python | python|json|filter|key | 0 | 475 | 1 | 72,189,224 | 72,189,224 | 1 | true | 2022-05-10T15:19:46.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter Json Keys that contains certain character in Python<p>I need to filter all Keys in this dict (book-1, book-2 and book-3) that conatains the string 'bo... |
72,166,087 | Show/Hide multiple elements of each button click with matching indexes in React JS<p>I have a scenario where I have 2 different components ( buttons and an info container). On each button click I am trying to display each matched info container. I am able to achieve the desired functionality in my buttons, but when I p... | <p><strong>Codesandbox</strong> : <a href="https://codesandbox.io/s/72166087-zu4ev7?file=/src/App.js" rel="nofollow noreferrer">https://codesandbox.io/s/72166087-zu4ev7?file=/src/App.js</a></p>
<p>You can store the selected tabs in a state. That way you don't need to render 3 (or more) <code><ToggleContainer></co... | Show/Hide multiple elements of each button click with matching indexes in React JS | reactjs|react-hooks | 0 | 99 | 1 | 72,166,423 | 72,166,423 | 1 | true | 2022-05-09T01:06:59.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show/Hide multiple elements of each button click with matching indexes in React JS<p>I have a scenario where I have 2 different components ( buttons and an i... |
72,178,896 | Is there a concurrent.futures.wait equivalent for the multiprocessing library?<p>I have a multiprocessing.Pool of workers, and I'd like to block the main thread until one worker completes. If I use <code>concurrent.futures.ProcessPoolExecutor</code> I can use <code>concurrent.futures.wait</code> to wait for the first o... | <p>The answer given by Andrej Kesely is certainly the most straight forward and is more-or-less equivalent to using the <code>concurrent.futures.as_completed</code> method. But by definition each iteration will always give you just one more completed task even if two or more had completed between iterations.</p>
<p>Thi... | Is there a concurrent.futures.wait equivalent for the multiprocessing library? | python|multiprocessing | 0 | 57 | 2 | 72,200,689 | 72,200,689 | 1 | true | 2022-05-09T22:39:17.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a concurrent.futures.wait equivalent for the multiprocessing library?<p>I have a multiprocessing.Pool of workers, and I'd like to block the main thr... |
72,178,792 | Why can't I join a child process created by ProcessPoolExecutor or Pool?<p>I want to manually join and close child processes from either multiprocessing.Pool or ProcessPoolExecutor. However whenever I try to join a child process created by either of those Pools the code hangs indefinitely.</p>
<pre class="lang-py prett... | <p>A multiprocessing pool is made up of one or more processes that takes a submitted "task" from an input queue and runs the task until it is complete and then goes back to get the next task from the queue. These processes run until you implicitly or explicitly terminate the entire pool via one of the methods... | Why can't I join a child process created by ProcessPoolExecutor or Pool? | python|multiprocessing | 0 | 52 | 1 | 72,201,420 | 72,201,420 | 1 | true | 2022-05-09T22:22:36.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I join a child process created by ProcessPoolExecutor or Pool?<p>I want to manually join and close child processes from either multiprocessing.Pool... |
72,150,450 | How to avoid overflow of a bootstrap card image in card-body?<p>I am using bootstrap cards and I could manage the card image from overflowing outside the card area but the bottom of the image overflows in the card-body region. Not sure if we have any CSS attribute that can avoid overflowing content into the current div... | <p>Try out this snippet.</p>
<p>This is fairly simple as you have to wrap the image inside a div and add <strong>overflow-hidden</strong> utility class to the wrapper.</p>
<p>overflow utilities: <a href="https://getbootstrap.com/docs/5.1/utilities/overflow/" rel="nofollow noreferrer">Overflow utilities</a></p>
<p><div ... | How to avoid overflow of a bootstrap card image in card-body? | html|css|bootstrap-4 | 0 | 332 | 3 | 72,150,497 | 72,150,497 | 1 | true | 2022-05-07T07:36:22.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to avoid overflow of a bootstrap card image in card-body?<p>I am using bootstrap cards and I could manage the card image from overflowing outside the car... |
72,230,292 | Python pyaudio error while recording from microphone<p>I was trying to convert speech to text via pyaduio.The program was working fine for a few hours but suddenly my visual studio 2019 keeps on marking an error in the <strong>6th line</strong> for no reason.
Does anyone know how to fix it? tnx :)</p>
<pre><code>import... | <p>The problem was that google api is restricted to certain amount of uses without paying, and I ran out of free uses.</p> | Python pyaudio error while recording from microphone | python|speech | 0 | 53 | 1 | 72,248,343 | 72,248,343 | 1 | true | 2022-05-13T13:22:28.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python pyaudio error while recording from microphone<p>I was trying to convert speech to text via pyaduio.The program was working fine for a few hours but su... |
72,188,917 | Show only records with count greater than certain number using aggregation<p>I am trying to only show the records which have a sum greater than or equal to four. This isn't working.</p>
<pre><code>const bookings = await Booking.aggregate([
{
$group: {
_id: { $dateToString: { format: "%Y-%m-%d", da... | <pre><code>db.collection.aggregate([
{
$group: {
_id: {
$dateToString: {
format: "%Y-%m-%d",
date: "$bookingDate",
},
},
totalBookings: {
$sum: 1,
},
}
},
{
$match: {
total... | Show only records with count greater than certain number using aggregation | node.js|mongodb|mongoose | 0 | 19 | 1 | 72,189,162 | 72,189,162 | 1 | true | 2022-05-10T15:15:17.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show only records with count greater than certain number using aggregation<p>I am trying to only show the records which have a sum greater than or equal to f... |
72,165,503 | How to improve MySQL performance on self join<p>I'm doing a self-join on a table like this one (the actual table has many more fields):</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>id</th>
<th>pagetitle</th>
<th>parent</th>
<th>class_key</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Pa... | <p>That <code>id</code> column is almost certainly a primary key. So the query planner can easily infer a condition that's redundant with <code>c2.parent >= 0</code> from the second condition <code>c1.parent = c2.id</code>: it knows any rows that match the second condition also match the first, so the query plans ar... | How to improve MySQL performance on self join | mysql|query-optimization|self-join | 0 | 28 | 1 | 72,165,565 | 72,165,565 | 1 | true | 2022-05-08T22:24:17.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to improve MySQL performance on self join<p>I'm doing a self-join on a table like this one (the actual table has many more fields):</p>
<div class="s-tab... |
72,097,877 | How to provide a dictionary with lists as values to Django Table2?<p>I would like to populate a Django Table 2 with a dictionary like this, how can I do that ?</p>
<p>This is my code but the table has no data.</p>
<p>views.py</p>
<pre><code>class MyDetailView(SingleTableMixin, generic.DetailView):
model = MyModel
... | <p>You enter values by row:</p>
<pre><code>dic = [
{"col_1": -6.9, "col_2": -1.9, "col_3": '2022-05-03T05:00:00Z'},
# ...
]
</code></pre>
<p>Or a cooler way:</p>
<pre><code>col_1 = [-6.9, -7.1, -3.8]
col_2 = [-1.9, -7.9, -0.8]
col_3 = ['2022-05-03T05:00:00Z', '2022-05-03T06:00:00Z'... | How to provide a dictionary with lists as values to Django Table2? | python|django | 0 | 33 | 1 | 72,100,684 | 72,100,684 | 1 | true | 2022-05-03T10:10:09.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to provide a dictionary with lists as values to Django Table2?<p>I would like to populate a Django Table 2 with a dictionary like this, how can I do that... |
72,217,253 | Why do we need to typecast the WebDriver instance to JavascriptExecutor before calling the executeScript method?<p><code>JavascriptExecutor</code> is an interface which provides some default code for <code>executeScript</code> method.</p>
<p><code>RemoteWebDriver</code> implements this interface and overrides the metho... | <p>We are typecasting because out code is usually using the webdriver type, which is an interface and does not include the executeScript method.</p>
<p>When you pass the driver around as "webdriver" type, the classes assume it only has the WebDriver interface's methods. You could also cast it to Chromedriver ... | Why do we need to typecast the WebDriver instance to JavascriptExecutor before calling the executeScript method? | java|selenium|selenium-webdriver|inheritance | 0 | 316 | 1 | 72,253,281 | 72,253,281 | 1 | true | 2022-05-12T14:15:19.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do we need to typecast the WebDriver instance to JavascriptExecutor before calling the executeScript method?<p><code>JavascriptExecutor</code> is an inte... |
72,186,952 | how to keep `$@` arguments seperated when using them in a string?<p>Hey I'm writing a wrapper script for git that applies one git command to all its submodules e.g.: <code>supergit commit -m "change message"</code> commits to all submodules.<br />
The script essentially does:</p>
<pre class="lang-sh prettypri... | <h3>If Your <code>/bin/sh</code> Is Provided By Bash</h3>
<p><code>printf %q</code> will generate a version of your data correctly escaped to be parsed by a shell.</p>
<p><code>printf '%q ' "$@"</code> generates a string containing an individually shell-escaped word for each argument in your array, with space... | how to keep `$@` arguments seperated when using them in a string? | bash | 0 | 49 | 1 | 72,188,566 | 72,188,566 | 1 | true | 2022-05-10T13:09:34.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to keep `$@` arguments seperated when using them in a string?<p>Hey I'm writing a wrapper script for git that applies one git command to all its submodul... |
72,050,110 | SQL / SQLite Query that counts the number of text occurrences based on date<p>Below I have an example of a query that I am trying to perform. The INPUT is the table that I have access to. The OUTPUT is how I would like to organize the data. I am trying to group the data by the date and have an output for the number ups... | <p>You can try <code>sum</code> with a conditional case expression</p>
<pre><code>select date,
Sum(case when status='Up' then 1 else 0 end) NumUps,
Sum(case when status='Down' then 1 else 0 end) NumDowns
from t
group by date;
</code></pre> | SQL / SQLite Query that counts the number of text occurrences based on date | sql|sqlite | 0 | 22 | 1 | 72,050,167 | 72,050,167 | 1 | true | 2022-04-28T20:52:46.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL / SQLite Query that counts the number of text occurrences based on date<p>Below I have an example of a query that I am trying to perform. The INPUT is th... |
72,156,143 | Unknown column in where clause in NextJS API<p>I'm writing an API which would fetch data from a MySQL table based on a category. The code currently looks like this.</p>
<pre><code>import { sql_query } from "../../../lib/db"
export default async function handler(req, res) {
var category = 'Starters'
i... | <p>The error indicates the parameter is being injected and used in the context of a column name, you need to contain it within quotes:</p>
<pre><code>`SELECT * FROM products WHERE category = '${category}'`
</code></pre> | Unknown column in where clause in NextJS API | javascript|mysql|database|next.js | 0 | 20 | 1 | 72,156,236 | 72,156,236 | 1 | true | 2022-05-07T20:29:56.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unknown column in where clause in NextJS API<p>I'm writing an API which would fetch data from a MySQL table based on a category. The code currently looks lik... |
72,231,874 | How to make network graph normalised data<p>I am new in this era. I have a data with actors and movies.
<a href="https://i.stack.imgur.com/YmyqD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YmyqD.png" alt="enter image description here" /></a></p>
<p>I'm trying to make network analysis and find com... | <p>You can use NetworkX to map this network and hopefully I can help with this part!</p>
<p>First, you will need to import the NetworkX library (using <code>import networkx as nx</code>).</p>
<p>Next, import the data. Since your data is in <strong>matrix format</strong> (rather than a simple edge list), it is a little ... | How to make network graph normalised data | python|network-programming|networkx|social-networking | 0 | 93 | 1 | 72,238,237 | 72,238,237 | 1 | true | 2022-05-13T15:16:41.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make network graph normalised data<p>I am new in this era. I have a data with actors and movies.
<a href="https://i.stack.imgur.com/YmyqD.png" rel="no... |
72,152,357 | Load plugin after another fastify<p>I'm currently working on an api where I autoload my plugins but I would like to add global hooks on all routes.
What I'm currently doing is I load all my plugins and after I load my middlewares but I have a problem
I'm trying to use mongoClient created by <a href="https://www.npmjs.c... | <p>Your setup looks good, but the <code>this</code> context in <code>mongoClient</code> function is <code>undefined</code>.</p>
<p>Here some fixes:</p>
<pre><code>async function hooks(fastify, opts) {
fastify.addHook('onRequest', (req, res, done) => {
// Inject mongo client
mongoClient.call(fastify, req);... | Load plugin after another fastify | node.js|fastify | 0 | 1,099 | 1 | 72,159,376 | 72,159,376 | 1 | true | 2022-05-07T12:12:01.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Load plugin after another fastify<p>I'm currently working on an api where I autoload my plugins but I would like to add global hooks on all routes.
What I'm ... |
72,232,009 | Delete old entries of the event-log with PowerShell or CMD? (Not all of them | With period of time condition)<p>Please take a look at these two threads :</p>
<p><a href="https://deploywindows.com/2015/10/22/how-to-clear-eventlog-with-powershell-or-wevtutil/" rel="nofollow noreferrer">how-to-clear-eventlog-with-powershe... | <p>Almost anything is possible if you have administrator rights on a machine</p>
<p>There is no built-in function to delete only certain logs, but one example way to do this is simply export all logs except the ones you want, then replace the original log file with your filtered log. The built-in <code>wevtutil</code> ... | Delete old entries of the event-log with PowerShell or CMD? (Not all of them | With period of time condition) | windows|powershell|cmd|event-log | 0 | 212 | 1 | 72,232,588 | 72,232,588 | 1 | true | 2022-05-13T15:27:09.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete old entries of the event-log with PowerShell or CMD? (Not all of them | With period of time condition)<p>Please take a look at these two threads :</p>... |
72,200,159 | How to calculate LAG difference in R - if periods changes or how to add empty NA rows to dataframe?<p>If i have the following dataframe:</p>
<pre><code>tibble(
period = c("2010END", "2011END",
"2010Q1","2010Q2","2010Q3","2010Q4","2010END&q... | <p>If I understand correctly, the OP wants a calculate the <em>year-on-year differences</em> of the values of a period and the same period in the prior year for each website. There is a related question <a href="https://stackoverflow.com/q/72189827/3817004">Calculating Lag for dataframe in R?</a> where the OP explicite... | How to calculate LAG difference in R - if periods changes or how to add empty NA rows to dataframe? | r|dataframe|dplyr|data.table|tidyverse | 0 | 121 | 2 | 72,207,530 | 72,207,530 | 1 | true | 2022-05-11T11:22:01.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate LAG difference in R - if periods changes or how to add empty NA rows to dataframe?<p>If i have the following dataframe:</p>
<pre><code>tibbl... |
72,067,218 | For cyclus python3 with if statement<p>What is wrong with this cycle, please that the output is</p>
<pre><code>0
One
1
One
2
One
3
One
4
One
5
One
for i in range(6):
print(i)
if i == 0 or 2 or 4:
print('One')
else:
print('Two')
</code></pre>
<p>I would expect alternate printing of One and ... | <p>Make the below changes in your <code>if</code> statement:</p>
<pre><code>for i in range(6):
print(i)
if i == 0 or i == 2 or i == 4:
print('One')
else:
print('Two')
</code></pre>
<p>Your <code>if i == 0 or 2 or 4:</code> is equivalent to <code>if (i == 0) or 2 or 4:</code> and hence will c... | For cyclus python3 with if statement | python-3.x|for-loop|if-statement | 0 | 17 | 1 | 72,067,255 | 72,067,255 | 1 | true | 2022-04-30T09:26:54.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
For cyclus python3 with if statement<p>What is wrong with this cycle, please that the output is</p>
<pre><code>0
One
1
One
2
One
3
One
4
One
5
One
for i in... |
72,185,849 | How to convert this sql query into linq query. I am stuck at the group by and sum part<p>My SQL query looks something like this :
The SQL query returns the revenue associated with every colorwaysid present</p>
<pre><code>select p.colorwaysid,sum(oivs.actItemvalue+oivs.custom) as revenue
from Product p inner join eshak... | <p><code>group by</code> part is obvious:</p>
<pre class="lang-cs prettyprint-override"><code>var query =
from product in eshaktiDb.Products
join oivs in corpDb.OrderitemvalueSplits on product.ProductId equals oivs.Productid
join order in corpDb.Orders on oivs.Orderid equals order.OrderID
where produc... | How to convert this sql query into linq query. I am stuck at the group by and sum part | c#|sql|asp.net|.net|linq | 0 | 88 | 1 | 72,186,447 | 72,186,447 | 1 | true | 2022-05-10T11:53:56.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert this sql query into linq query. I am stuck at the group by and sum part<p>My SQL query looks something like this :
The SQL query returns the r... |
72,207,904 | Building Expression to search in child properies (collection) of object<p>I have a search setup to return matching <code>Record</code> objects based on criteria. It builds an Expression Tree based on the type of criteria and queries the database to return matches. Previously, it only matched on top-level properties, bu... | <p>You have forgot to create 'LambdaExpresson'. Also <code>Expression.Call</code> can besimplified.</p>
<pre class="lang-cs prettyprint-override"><code>private Expression GetExpression(ParameterExpression parameter, Guid searchId, string searchValue)
{
// Get the Record.Attributes Memboer.
MemberExpression attr... | Building Expression to search in child properies (collection) of object | c#|linq|expression|linq-expressions | 0 | 28 | 1 | 72,210,353 | 72,210,353 | 1 | true | 2022-05-11T21:42:22.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Building Expression to search in child properies (collection) of object<p>I have a search setup to return matching <code>Record</code> objects based on crite... |
72,217,582 | EFCore join values<p>I'm trying to join a big table to a small list of data pairs using EFCore 2.1.1. I want this join to happen server-side, rather than trying to download the whole table, e.g translating to something like:</p>
<pre><code>SELECT a.*
FROM Groups AS a
INNER JOIN (VALUES (1, 'admins'), (2, 'support'),... | <p>If you expect that EF Core 3.x can support this, you are wrong. If you plan to upgrade your application, better think about EF Core 6 and .net 6.</p>
<p>Anyway I know several options:</p>
<ol>
<li>With extension method <a href="https://stackoverflow.com/a/67666993/10646316">FilterByItems</a> or similar</li>
</ol>
<p... | EFCore join values | c#|sql-server|entity-framework-core|ef-core-2.1 | 0 | 166 | 2 | 72,219,324 | 72,219,324 | 1 | true | 2022-05-12T14:37:08.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EFCore join values<p>I'm trying to join a big table to a small list of data pairs using EFCore 2.1.1. I want this join to happen server-side, rather than tr... |
72,182,371 | How to overload the operator[] with multiple subscripts<p>C++23 added support for overloading operator[] with multiple subscripts. It's now available on GCC 12. How should one make use of it?</p>
<p>An example struct:</p>
<pre><code>struct Foo
{
int& operator[]( const std::size_t row,
const... | <pre><code>fooObject[ 0, 0, 0 ] = 5;
</code></pre>
<p>not</p>
<pre><code>fooObject.matrix[ 0, 0, 0 ] = 5;
</code></pre>
<p>you should also add compile option <code>--std=c++23</code>.</p> | How to overload the operator[] with multiple subscripts | c++|operator-overloading|c++23|subscript-operator | 0 | 105 | 1 | 72,182,462 | 72,182,462 | 1 | true | 2022-05-10T07:38:38.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to overload the operator[] with multiple subscripts<p>C++23 added support for overloading operator[] with multiple subscripts. It's now available on GCC ... |
72,184,974 | Height and width of a square matrix<p>I want to represent a matrix where x=y. (3x3, 5x5) in a container with fixed width and height.</p>
<p>My problem I have that I can't square the single cells dynamically. I always have a problem with the height.</p>
<p><strong>My goal</strong> is to spread the individual fields over... | <p>Make your whole container a flex in <code>column</code> direction, set <code>flex: 1</code> on your rows and cells so they stretch to cover their parent</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 ... | Height and width of a square matrix | html|css|flexbox | 0 | 55 | 3 | 72,185,688 | 72,185,688 | 1 | true | 2022-05-10T10:48:44.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Height and width of a square matrix<p>I want to represent a matrix where x=y. (3x3, 5x5) in a container with fixed width and height.</p>
<p>My problem I have... |
72,146,765 | How do I call useQuery in a map function?<p>I have the below react component which is removing products from a mongodb collection based on the items in the cart. I get this error when I run the code:</p>
<p>Component:</p>
<pre><code> function AddOrder() {
const d = new Date();
let text = d.toString();
const... | <p>Hooks need to be called on every render to be deterministically consistent and React checks for this on every build (and throws an error when detected). If a hook is not in the top/main call stack of your React component, you can expect problems.</p>
<p>What you can do is create another React component that is rende... | How do I call useQuery in a map function? | reactjs|mongodb|react-hooks|graphql|apollo-client | 0 | 678 | 1 | 72,146,894 | 72,146,894 | 1 | true | 2022-05-06T19:56:57.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I call useQuery in a map function?<p>I have the below react component which is removing products from a mongodb collection based on the items in the c... |
72,216,297 | why Ref try to acces fields instead of getters setters<p>I have class like this : ( i'm using ts )</p>
<pre><code>class FooClass
{
private _Id:number=0 ;
private _PrCode: number =0;
public get Id(): number {
return this._Id;
}
public set Id(id: number) {
this._Idproduit = id;
... | <p>This is TypeScript error that doesn't happen at runtime, so it's not about private fields being actually accessed.</p>
<p>Private fields affect type compatibility in TypeScript. This can be used to force the incompatibility and prevent types from being accidentally matched with similar types. Here the opposite needs... | why Ref try to acces fields instead of getters setters | typescript|vue.js|vuejs3 | 0 | 30 | 1 | 72,217,212 | 72,217,212 | 1 | true | 2022-05-12T13:15:37.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why Ref try to acces fields instead of getters setters<p>I have class like this : ( i'm using ts )</p>
<pre><code>class FooClass
{
private _Id:number=0... |
72,211,759 | why is this still need to cast in java?<p>error</p>
<pre><code>public class DefaultLiteProcessScopeFactory<S extends DefaultLiteProcessScope> implements LiteProcessScopeFactory<S> {
@Override
public S build() {
return new DefaultLiteProcessScope();
}
}
</code></pre>
<p>right</p>
<pre><co... | <p>What you are doing here is wrong. You want to return some subtype of <code>DefaultLiteProcessScope</code> from the <code>build</code> method. However, you hard code the return type like this: <code>new DefaultLiteProcessScope()</code>. Now think of a slightly contrived example like this.</p>
<pre><code>static class ... | why is this still need to cast in java? | java|generics | 0 | 102 | 4 | 72,212,178 | 72,212,178 | 1 | true | 2022-05-12T07:41:43.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is this still need to cast in java?<p>error</p>
<pre><code>public class DefaultLiteProcessScopeFactory<S extends DefaultLiteProcessScope> implement... |
72,164,886 | How to use socketio inside controllers?<p>I have a application created with Reactjs,Redux,Nodejs,MongoDB. I have created socketio in backend side.</p>
<p><strong>server.js</strong></p>
<pre class="lang-js prettyprint-override"><code>
const express = require('express');
const mongoose = require('mongoose');
const cors =... | <p>Infinite loop is steming from not dispatching "type: ADD_ITEM" once.This issue cause that your itemAction always would dispatch "type: ADD_ITEM" and payload with it when after every fetching then your react would re-render page again and again.</p>
<p>You should get rid of your dispatching acti... | How to use socketio inside controllers? | node.js|reactjs|express|redux|socket.io | 0 | 138 | 1 | 72,201,894 | 72,201,894 | 1 | true | 2022-05-08T20:33:13.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use socketio inside controllers?<p>I have a application created with Reactjs,Redux,Nodejs,MongoDB. I have created socketio in backend side.</p>
<p><st... |
72,168,836 | Unhandled Exception: FormatException: Unexpected end of input (at character 1) in flutter (in shared_preferences)<p>I'm making a task book, on a flutter, in this project I will use a lot of packages that I have not worked with before (this is not my first question on this project). My goal is to create tasks to add to ... | <p>Change null check value from <code>''</code> to <code>'[]'</code>.</p>
<p>You set <code>jsonData</code> with type <strong>List</strong>. In case <code>prefs.getString('todoLists')</code> is <strong>null</strong>, <code>jsonDecode</code> will take <code>''</code> as parameter, but <code>''</code> is <strong>not a val... | Unhandled Exception: FormatException: Unexpected end of input (at character 1) in flutter (in shared_preferences) | flutter|dart | 0 | 175 | 1 | 72,169,282 | 72,169,282 | 1 | true | 2022-05-09T08:11:38.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unhandled Exception: FormatException: Unexpected end of input (at character 1) in flutter (in shared_preferences)<p>I'm making a task book, on a flutter, in ... |
72,229,796 | How to add Window: beforeunload event to antd form<p>Hi How can we add Window: beforeunload event to an antd form? For a single field, we can implement as below <a href="https://codesandbox.io/s/cool-brattain-uufyg?file=/src/App.js:452-558" rel="nofollow noreferrer">https://codesandbox.io/s/cool-brattain-uufyg?file=/sr... | <p>You can use method <code>onFieldsChange</code> to understand when block the navigation:</p>
<pre><code>import React, { useEffect } from "react";
import { Form, Input, Button } from "antd";
const { Item } = Form;
const App = () => {
const [cannotLeave, setCannotLeave] = React.useState(false... | How to add Window: beforeunload event to antd form | reactjs|antd|onbeforeunload|unload | 0 | 207 | 2 | 72,319,889 | 72,319,889 | 1 | true | 2022-05-13T12:42:23.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add Window: beforeunload event to antd form<p>Hi How can we add Window: beforeunload event to an antd form? For a single field, we can implement as be... |
72,183,806 | How to connect mysql with express nodejs as i am getting error 1045, access denied for the user 'root'@'localhost' (using password: NO)<p>I am trying to connect mysql database with my node express application with the code:
my db.js file</p>
<pre><code>const mysql = require("mysql")
const dbconn = require('..... | <pre><code> host: dbconn.HOST,
user: dbconn.USER,
Password: dbconn.PASSWORD,
database: dbconn.DB
</code></pre>
<p>Instead of <strong>P</strong>assword, write <strong>p</strong>assword</p>
<pre><code> host: dbconn.HOST,
user: dbconn.USER,
password: dbconn.PASSWORD,
database: dbconn.DB
</code></pre> | How to connect mysql with express nodejs as i am getting error 1045, access denied for the user 'root'@'localhost' (using password: NO) | mysql|node.js | 0 | 86 | 1 | 72,184,152 | 72,184,152 | 1 | true | 2022-05-10T09:26:12.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to connect mysql with express nodejs as i am getting error 1045, access denied for the user 'root'@'localhost' (using password: NO)<p>I am trying to conn... |
72,211,854 | Running npm start on pm2 server returns Error: Cannot find module Cors<p>When I run <code>npm start</code> or even <code>pm2 start npm --name "app name" -- start</code> command, my app returns an error like this:</p>
<pre><code>/home/cloud/sites/myapp$ npm start
> myapp@1.0.0 start /home/cloud/sites/myap... | <p>Replace it</p>
<pre><code>const cors = require('Cors')
</code></pre>
<p>With this</p>
<pre><code>const cors = require('cors')
</code></pre> | Running npm start on pm2 server returns Error: Cannot find module Cors | node.js|express|npm|server|pm2 | 0 | 396 | 1 | 72,212,068 | 72,212,068 | 1 | true | 2022-05-12T07:49:08.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running npm start on pm2 server returns Error: Cannot find module Cors<p>When I run <code>npm start</code> or even <code>pm2 start npm --name "app name&... |
72,070,244 | Passing a member variable as a parameter in a method of the same class<p>I'm developing a game with Unreal Engine and I have a class that represent something (a pawn) that I can move inside the game's level. I'm using Spherical coordinates to move it.</p>
<p>This class has a method to convert its spherical coordinates ... | <p>For your specific question "Is it a good idea to pass a member variable as a parameter in a method of the same class?" - There is <strong>no</strong> need to pass member variable, since the member function already have access to those anyways.</p>
<p>But you need to know the below as well, since this is mo... | Passing a member variable as a parameter in a method of the same class | design-patterns | 0 | 18 | 1 | 72,070,539 | 72,070,539 | 1 | true | 2022-04-30T16:30:07.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing a member variable as a parameter in a method of the same class<p>I'm developing a game with Unreal Engine and I have a class that represent something... |
72,194,720 | How do I display geom_bar labels with values of thousands to "K" instead of the full numbers?<p>So I figured out how to display thousands with "K" for the y-axis with the <code>scale_y_continuous()</code> function but I don't know how I could go about doing the same for each of my labels.</p>
<pre><code>ggplo... | <p><code>label_number</code> returns a function:</p>
<pre><code>library(scales)
label_number(scale=1e-3, suffix='K')(123456.789)
## 123K
label_number(scale=1e-3, suffix='K')(123567.890)
## 124K
</code></pre>
<p>so you should be able to use:</p>
<pre><code>geom_text(aes(label=label_number(scale=1e-3, suffix='K')(number_... | How do I display geom_bar labels with values of thousands to "K" instead of the full numbers? | r|data-visualization|bar-chart|geom-bar | 0 | 47 | 2 | 72,194,790 | 72,194,790 | 1 | true | 2022-05-11T02:22:23.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I display geom_bar labels with values of thousands to "K" instead of the full numbers?<p>So I figured out how to display thousands with "K" ... |
72,146,622 | Phoenix live view link not working with dynamic element<p>I have code in an html.eex file that needs to render a series of links and I'm using this code currently,</p>
<pre><code><%= for item <- @links do %>
<%= link(item, to: URI.parse(item))%>
<% end %>
</code></pre>
<p>However when this render... | <p>You can still use standard</p>
<p><code><a class="tailwind for example" href={URI.parse(item)}>click me</a></code></p>
<p>tag or add class to your link which is missing from your example to become clickable.</p>
<p><code>link("<hello>", to: "/world", class: "btn&q... | Phoenix live view link not working with dynamic element | elixir|phoenix-framework|phoenix-live-view | 0 | 143 | 1 | 72,149,420 | 72,149,420 | 1 | true | 2022-05-06T19:39:28.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Phoenix live view link not working with dynamic element<p>I have code in an html.eex file that needs to render a series of links and I'm using this code curr... |
72,233,279 | R output matrix index with values in dataframe<p>I am trying to find the "matrix index" from values of dataframe in the <code>Position</code> column. The "matrix" that I would like to reference to is either a 3 x 3 or 4 x 4 matrix, depending on the length of the <code>Position</code> column (<code>1... | <p>Subtract 1 from 'Position' before the <code>%/%</code>/<code>%%</code> and then add 1 on the result</p>
<pre><code>library(dplyr)
out <- df %>%
group_by(col1) %>%
mutate(Position_ij = if (n() == 9) {
paste0("[", ((Position-1) %/% 3) + 1, ", ", (Position-1) %% 3 + 1, "]&q... | R output matrix index with values in dataframe | r|dataframe|matrix | 0 | 33 | 1 | 72,233,371 | 72,233,371 | 1 | true | 2022-05-13T17:16:49.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R output matrix index with values in dataframe<p>I am trying to find the "matrix index" from values of dataframe in the <code>Position</code> colum... |
72,232,860 | copy/clone of keras subclassed models with custom attributes<p>I have a subclassed model with some custom attributes like this:</p>
<pre><code>class MyModel(tf.keras.Model):
def __init__(self, *args, my_var, **kwargs):
super().__init__(*args, **kwargs)
self.my_var = my_var
def my_func(self):
... | <p>You need to add</p>
<pre><code>cloned = model.__class__.from_config(model.get_config())
</code></pre>
<p>as shown in the doc <a href="https://www.tensorflow.org/api_docs/python/tf/keras/models/clone_model#example" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/keras/models/clone_model#exampl... | copy/clone of keras subclassed models with custom attributes | python|tensorflow|keras | 0 | 23 | 1 | 72,234,929 | 72,234,929 | 1 | true | 2022-05-13T16:40:16.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
copy/clone of keras subclassed models with custom attributes<p>I have a subclassed model with some custom attributes like this:</p>
<pre><code>class MyModel(... |
72,170,198 | Setting Elevation on Custom control button not working<p>I'm trying to achieve having a button just like this screenshot:</p>
<p><a href="https://i.stack.imgur.com/6ilrS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6ilrS.png" alt="enter image description here" /></a></p>
<p>So i did a custom contr... | <p>If you just want shadow, you could use <code>Community Toolkit</code>.</p>
<p>Install from NuGet: <a href="https://www.nuget.org/packages/Xamarin.CommunityToolkit/2.0.1?_src=template" rel="nofollow noreferrer">https://www.nuget.org/packages/Xamarin.CommunityToolkit/2.0.1?_src=template</a></p>
<p>Xaml:</p>
<pre><code... | Setting Elevation on Custom control button not working | xamarin|xamarin.forms | 0 | 71 | 1 | 72,196,069 | 72,196,069 | 1 | true | 2022-05-09T10:01:43.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting Elevation on Custom control button not working<p>I'm trying to achieve having a button just like this screenshot:</p>
<p><a href="https://i.stack.img... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.