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,987,676 | Combining data from multiple processes<p>For this multithreaded python code, I'd like to combine the data
from each process variable "work_output" into a global variable "workOutput".
I'm not sure how to access variables outside individual processes or how to combine
the data from multiple processes... | <p>Write functions that return the result (like a math problem <code>y = f(x)</code>). Then <code>map()</code> will take all the processes and return them as a list.</p>
<pre><code>from multiprocessing import Pool, cpu_count
import time
import psutil
import os
import math
work =(["process1", 1,2], ["pro... | Combining data from multiple processes | python|multiprocessing | 1 | 46 | 1 | 72,987,746 | 72,987,746 | 3 | true | 2022-07-14T23:37:48.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combining data from multiple processes<p>For this multithreaded python code, I'd like to combine the data
from each process variable "work_output" ... |
73,014,789 | Create 2 child directories inside 3 different child directories<p>I'm trying to write a simple script that will create a folder and then 3 different folders inside and once that is done each of those 3 different folders should have 2 child folders named 'Phase' (1..2).</p>
<p>I'm trying to loop through the path, i.e th... | <p>Here is one way to do it using the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.io.directoryinfo.createsubdirectory?view=net-6.0#system-io-directoryinfo-createsubdirectory(system-string)" rel="nofollow noreferrer">instance method <code>CreateSubdirectory</code></a> from the <a href="https://docs.micro... | Create 2 child directories inside 3 different child directories | windows|powershell | 2 | 46 | 2 | 73,014,887 | 73,014,887 | 3 | true | 2022-07-17T19:33:50.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create 2 child directories inside 3 different child directories<p>I'm trying to write a simple script that will create a folder and then 3 different folders ... |
72,994,494 | Drop column from tuple list in Pandas dataframe<p>This is my tuple I guess</p>
<pre><code>df = [(1.8799187420058687, 1), (1.5963945918878317, 2)]
</code></pre>
<p>The type of df shows up as this</p>
<pre><code>print(type(df))
<type 'list'>
</code></pre>
<p>My goal is to remove the second variable column displayed... | <p>loop through each tuple, save the first value in a list and convert it to tuple.</p>
<pre><code>new_df = tuple([x[0] for x in df])
output: (1.8799187420058687, 1.5963945918878317)
</code></pre> | Drop column from tuple list in Pandas dataframe | python|pandas|dataframe | 1 | 46 | 2 | 72,994,593 | 72,994,593 | 3 | true | 2022-07-15T13:07:43.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Drop column from tuple list in Pandas dataframe<p>This is my tuple I guess</p>
<pre><code>df = [(1.8799187420058687, 1), (1.5963945918878317, 2)]
</code></pr... |
72,912,970 | Long overflow Even Though It doesn't pass the limit<p>I have this code where I set the byte, short, and int to their max values, and then multiplied their sum by 10 and added 50000. I calculated on my calculator that this should be allowed, because the result is less than the maximum of longs, but its giving me a weird... | <p>You are adding (byte) 127 + (short) 32767 + (int) 2147483647 first. The result is implicitly interpreted as an int by Java. So naturally this does not fit. Then afterwards you do the Long multiplication and addition but by that time the result has already overflowed the int boundary so has become some negative value... | Long overflow Even Though It doesn't pass the limit | java | -3 | 46 | 1 | 72,913,078 | 72,913,078 | 3 | true | 2022-07-08T14:32:42.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Long overflow Even Though It doesn't pass the limit<p>I have this code where I set the byte, short, and int to their max values, and then multiplied their su... |
72,929,507 | Extracting mean number of words in verb phrases<p>So I have a bit of a silly question, but being fairly new to Python, I can't seem to find the answer to it myself. I extracted verb phrases using spaCy's matcher. Now, I'm hoping to get the mean number of words in the extracted verb phrases for each person's text and st... | <p><code>np.mean()</code> takes an array (or similar) as an argument. As far as I can tell (correct me if i'm wrong) you are getting the mean of the <em>length</em> of each phase, which is just one number, and the mean of one number will be that number.</p>
<p>From <a href="https://numpy.org/doc/stable/reference/genera... | Extracting mean number of words in verb phrases | python|spacy | 3 | 46 | 1 | 72,929,586 | 72,929,586 | 3 | true | 2022-07-10T15:06:19.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extracting mean number of words in verb phrases<p>So I have a bit of a silly question, but being fairly new to Python, I can't seem to find the answer to it ... |
72,889,400 | What is opposite to 'in' condition in Kotlin - '!` mark equivalent to Java<p>In Java we do use <code>!</code> in case we want to say NOT. But what should I use in Kotlin if I follow some range condition.</p>
<pre><code>if( item in 5..10)
</code></pre>
<p>So here I want to say if <code>item NOT in 5..10</code> ?? what i... | <p>You can use <code>!in</code> operator:</p>
<pre class="lang-kotlin prettyprint-override"><code>if (item !in 5..10)
</code></pre>
<p>See documentation for a full list of operators:</p>
<ul>
<li><a href="https://kotlinlang.org/docs/operator-overloading.html#in-operator" rel="nofollow noreferrer">https://kotlinlang.org... | What is opposite to 'in' condition in Kotlin - '!` mark equivalent to Java | kotlin | 0 | 46 | 1 | 72,889,446 | 72,889,446 | 3 | true | 2022-07-06T20:17:54.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is opposite to 'in' condition in Kotlin - '!` mark equivalent to Java<p>In Java we do use <code>!</code> in case we want to say NOT. But what should I u... |
72,875,915 | Looping through an array of promises in javascript<p>I have some code that loops through an array of promises, and outputs the value.</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">... | <p>If you don't want the timers to start all at once, you shouldn't make all those <code>wait</code> calls at once. Instead only make the next call when the previous one's resulting promise has resolved:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="sni... | Looping through an array of promises in javascript | javascript|promise | 0 | 46 | 2 | 72,875,962 | 72,875,962 | 3 | true | 2022-07-05T21:50:10.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping through an array of promises in javascript<p>I have some code that loops through an array of promises, and outputs the value.</p>
<p><div class="snip... |
73,019,966 | How to use hover effect on images with no background edge-to-edge?<p>I am trying to make desk setup in css where if you hover over an image it will the background glow will change. I have used an image with no background like this:</p>
<p><a href="https://i.stack.imgur.com/if6Gj.png" rel="nofollow noreferrer"><img src=... | <p>You should be using drop-shadow instead of box-shadow.
CSS filter has lot more options, you can dim the image or make it brighter too.</p>
<pre><code>filter: drop-shadow(16px 16px 20px red);
</code></pre>
<p>For the image to have a background too along with shadow, I suggest you to add background to the parent on ho... | How to use hover effect on images with no background edge-to-edge? | javascript|html|css | 0 | 46 | 1 | 73,020,022 | 73,020,022 | 3 | true | 2022-07-18T09:19:31.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use hover effect on images with no background edge-to-edge?<p>I am trying to make desk setup in css where if you hover over an image it will the backg... |
72,826,458 | Replace all regex occurrences with item from array by index from regex group<p>I have text:</p>
<p><code>Lorem ipsum %NAME0% dolor sit amet %NAME1%, consectetur %NAME2% adipiscing elit.</code></p>
<p>and array <code>names</code>:
<code>[Bob, Alice, Tom]</code></p>
<p>I need to get <code>X</code> index from <code>%NAMEX... | <p>You could use a regex to go through the string only once and replace each value using the last <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/replace.html" rel="nofollow noreferrer">Regex.replace</a> overload (with lambda). Also, I added some validation in case there is a name reference with an ou... | Replace all regex occurrences with item from array by index from regex group | regex|kotlin|regex-group | 1 | 46 | 2 | 72,826,813 | 72,826,813 | 3 | true | 2022-07-01T08:28:28.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace all regex occurrences with item from array by index from regex group<p>I have text:</p>
<p><code>Lorem ipsum %NAME0% dolor sit amet %NAME1%, consecte... |
72,782,612 | Null value in CSV with Bash<p>I am trying to write a Bash script that checks and returns IDs of rows in CSV that fail certain criteria. A sample CSV is like below, I am thinking the [ -z {$CATEGORY} ] menthod to identify null value cell in CATEGORY column of the CSV. However, it seem that my if statement is not catchi... | <p><code>-z {$CATEGORY}</code> should be <code>-z ${CATEGORY}</code>, but <code>read ID ... <<< ${row}</code> will assign only <code>ID</code>... Try:</p>
<pre class="lang-bash prettyprint-override"><code>#!/bin/bash
while IFS=, read -r ID DATE PRODUCT CATEGORY; do
if [[ "$CATEGORY" =~ ^[[:space:]... | Null value in CSV with Bash | bash|csv | 0 | 46 | 1 | 72,782,867 | 72,782,867 | 3 | true | 2022-06-28T07:51:52.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Null value in CSV with Bash<p>I am trying to write a Bash script that checks and returns IDs of rows in CSV that fail certain criteria. A sample CSV is like ... |
72,855,197 | How does type deduction for builtin method of integer types work in rust?<p>I'm quite confused about how Rust infers the exact type of an integer. Type deduction seems to work differently for builtin methods than for traits implemented for multiple integers.</p>
<p>For example:</p>
<pre class="lang-rust prettyprint-ove... | <p>The difference is that <a href="https://doc.rust-lang.org/stable/std/primitive.i32.html#method.saturating_add" rel="nofollow noreferrer"><code>saturating_add()</code></a> is not a trait method but an inherent method, and you can't call inherent methods on an ambiguous type - similar to <code><_>::method(value)... | How does type deduction for builtin method of integer types work in rust? | rust|type-inference|type-deduction | 1 | 46 | 1 | 72,855,270 | 72,855,270 | 4 | true | 2022-07-04T10:20:19.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does type deduction for builtin method of integer types work in rust?<p>I'm quite confused about how Rust infers the exact type of an integer. Type deduc... |
72,963,260 | Array / objects - getting object by id returning all the data<p>I have some data that looks like this:</p>
<pre><code>[
{
"item":{
"Name":"Name1",
"working":true,
"extra":{
"active":true
}
},
... | <p>your code can't find the item because you are comparing 4 === "4" which are different. one is string the other one is number.</p>
<p>const item = myDat.find(item => item.id === '4');</p>
<p>change this to</p>
<pre><code>const item = myDat.find(item => item.id === 4);
</code></pre> | Array / objects - getting object by id returning all the data | javascript|typescript | -1 | 46 | 3 | 72,963,301 | 72,963,301 | 4 | true | 2022-07-13T08:39:53.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array / objects - getting object by id returning all the data<p>I have some data that looks like this:</p>
<pre><code>[
{
"item":{
... |
72,973,895 | Dynamically updated list in Rcpp stores only last value<p>I have a NumericMatrix whose values are updated every iteration of a loop. I want to store the matrix in a List every iteration. The code below gives a minimal reproducible example. However, when I compile and run this in R, every element of the list is identica... | <p>Welcome to StackOverflow, and what a gnarly question :) After a few years with R you become familiar with the 'copy-on-write' idiom. What you have here is, really, just <em>one</em> instance of the matrix so what you back is consequently always the same. As it is the same matrix. And that is, come to think (a b... | Dynamically updated list in Rcpp stores only last value | r|list|loops|rcpp | 4 | 46 | 1 | 72,974,066 | 72,974,066 | 4 | true | 2022-07-14T00:06:31.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically updated list in Rcpp stores only last value<p>I have a NumericMatrix whose values are updated every iteration of a loop. I want to store the matr... |
72,989,198 | Identifiable id not required by reference types (class) but required by structs<p>I recently came across the following code:</p>
<pre><code>struct Bar: Identifiable {
// Type 'Bar' does not conform to protocol 'Identifiable'
}
class Foo: Identifiable {
}
</code></pre>
<p>For the Bar struct, Xcode complains tha... | <p>Not exactly, there is an explicit extension for <code>Identifiable</code>, which makes that possible for classes:</p>
<p><a href="https://i.stack.imgur.com/AwNLs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AwNLs.png" alt="demo" /></a>
<a href="https://i.stack.imgur.com/9oP69.png" rel="nofollow... | Identifiable id not required by reference types (class) but required by structs | swift | 2 | 46 | 1 | 72,989,349 | 72,989,349 | 4 | true | 2022-07-15T04:54:44.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Identifiable id not required by reference types (class) but required by structs<p>I recently came across the following code:</p>
<pre><code>struct Bar: Ident... |
73,024,050 | Get the <T> type in Typescript<p>For example in my case I need to reuse the type of a component in React (<code>React.FC</code>) but I want it with optionals props by using <code>Partial<T></code>.</p>
<p>Is there a way to "get" the Generic <code><T></code> from that component type (<code>type Typ... | <pre><code>type ExtractPropsType<T> = T extends React.FC<infer Type> ? Type : never;
</code></pre>
<p>This should work if you type <code>typeof TargetComponent</code></p> | Get the <T> type in Typescript | reactjs|typescript | 0 | 46 | 2 | 73,024,111 | 73,024,111 | 4 | true | 2022-07-18T14:32:43.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get the <T> type in Typescript<p>For example in my case I need to reuse the type of a component in React (<code>React.FC</code>) but I want it with optionals... |
72,880,731 | ConfirmPassword doesnt show the error message in case the password doesn't match<p>I am building an app with React my problem is about [![enter image description here][1]][1] register user.
I tried to show a message error while the Confim password isn't the same as the password. The issues message from console.log is c... | <p>When selecting by class, you need to put a dot right before the class name. For example, in this code block you didn't do that:</p>
<pre class="lang-js prettyprint-override"><code>const pseudoError = document.querySelector("pseudo.error");
const emailError = document.querySelector("email.error");... | ConfirmPassword doesnt show the error message in case the password doesn't match | html|reactjs|user-interface|innerhtml | 1 | 46 | 2 | 72,880,798 | 72,880,798 | 4 | true | 2022-07-06T09:08:39.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ConfirmPassword doesnt show the error message in case the password doesn't match<p>I am building an app with React my problem is about [![enter image descrip... |
72,832,563 | Why is blitting images on the screen making my game very very slow?<p>im blitting a health bar onto the screen and seems like blitting the images on screen is causing the problem, i removed the for loop and whenever im making the player jump it seems like the performance is very very bad and when i remove the entire fu... | <p>Your application is slow because you are loading the images from the file every frame. Load the images once before the application loop, but <code>blit</code> them every frame:</p>
<pre class="lang-py prettyprint-override"><code>def load_lives(lives_image)
return pygame.image.load(lives_image);
def lives(lives1... | Why is blitting images on the screen making my game very very slow? | python|pygame|game-development | 2 | 46 | 1 | 72,832,719 | 72,832,719 | 4 | true | 2022-07-01T17:03:35.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is blitting images on the screen making my game very very slow?<p>im blitting a health bar onto the screen and seems like blitting the images on screen i... |
72,883,926 | Convert text file containing PowerShell Object Notations to CSV<p>I have a text file (PsonObjects.txt) that contains PowerShell Object Notation as follows:</p>
<pre><code>@{Computer=Dektop123; ServiceA=Running; ServiceB=Running; RunspaceId=1a-1b}
@{Computer=Dektop456; ServiceA=Stopped; ServiceB=Stopped; RunspaceId=2b-2... | <p><code>ConvertFrom-StringData</code> outputs an unsorted <code>Hashtable</code>, where the elements can be in any order, so it is of no use here.</p>
<p>Here is a possible solution, using the <code>-split</code> operator and a sorting step, using an <em>ordered</em> <code>Hashtable</code>:</p>
<pre class="lang-sh pre... | Convert text file containing PowerShell Object Notations to CSV | powershell|export-to-csv | 3 | 46 | 2 | 72,884,491 | 72,884,491 | 4 | true | 2022-07-06T12:54:44.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert text file containing PowerShell Object Notations to CSV<p>I have a text file (PsonObjects.txt) that contains PowerShell Object Notation as follows:</... |
72,822,480 | Native C extension not finding code used by Ruby core<p>Based on browsing the Ruby API sources for <code>Array#length</code> and <code>Range#begin</code> I know that macros <code>RARRAY_LEN</code> and <code>RANGE_BEG</code> exist and are used to implement the corresponding methods:</p>
<h2><a href="https://rubyapi.org/... | <p>For whatever reason the <code>RANGE_XXX</code> macros are not included in the API headers. They are only defined and used in the <a href="https://github.com/ruby/ruby/blob/master/internal/range.h" rel="nofollow noreferrer">internal Ruby implementation itself</a>. It seems they wanted to keep these methods private, p... | Native C extension not finding code used by Ruby core | ruby|rubygems | 1 | 46 | 1 | 72,823,772 | 72,823,772 | 4 | true | 2022-06-30T22:00:01.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Native C extension not finding code used by Ruby core<p>Based on browsing the Ruby API sources for <code>Array#length</code> and <code>Range#begin</code> I k... |
72,964,522 | Centering vertically a Div element inside the body only with margins and padding<p>I'm in a course where I should complete a challenge only using padding and margin</p>
<p>the current challenge is to center a div element with a border that is inside the body with the <code>width: 200px</code> and <code>padding: 50px</c... | <p>You can use CSS calc - this snippet assumes that the body is 100vh height in the absence of further information.</p>
<p>You can work out what space is not being taken up by the div and the halve it and use it to calculate a top margin. The space taken up is 2*border width + 2 * padding</p>
<p><div class="snippet" da... | Centering vertically a Div element inside the body only with margins and padding | css | -3 | 46 | 2 | 72,964,825 | 72,964,825 | 4 | true | 2022-07-13T10:11:15.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Centering vertically a Div element inside the body only with margins and padding<p>I'm in a course where I should complete a challenge only using padding and... |
72,898,218 | Error in a r function based on a dataset information<p>I have this dataset:</p>
<pre><code>df <- data.frame( raca = c("Nel","Nel","Nel", "Nel","Angus","Angus","Angus","Angus"),
marmo = c(350, 320, 330, 400, 800, 820, 45... | <p>I agree with shafee that reading how to program with <code>dplyr</code> is slightly differently.</p>
<p>Here's how you would do it (adapting your code directly)</p>
<pre><code>desc_function <- function(a,b, c) { a %>%
group_by(.data[[b]]) %>%
dplyr::summarise(across(.data[[c]],~data.frame(Média =r... | Error in a r function based on a dataset information | r|dataframe|function|dplyr | 0 | 46 | 4 | 72,898,652 | 72,898,652 | 5 | true | 2022-07-07T12:56:31.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error in a r function based on a dataset information<p>I have this dataset:</p>
<pre><code>df <- data.frame( raca = c("Nel","Nel",&quo... |
72,925,058 | Creating variadic template with template object containing string<p>I want to create a template that will take variadic number of a specific class that contains a string. When i try to make such a template class, it throws <em><strong>no instance of constructor "A" matches the argument list</strong></em></p>... | <p>This is an instance of the <a href="https://en.wikipedia.org/wiki/Most_vexing_parse" rel="noreferrer">"most vexing parse"</a> problem, where it looks like you are declaring a function type instead of creating on object. Here's a complete working example, where I've replaced the function call <code>()</cod... | Creating variadic template with template object containing string | c++|templates|variadic-templates|c++20 | 1 | 46 | 1 | 72,925,102 | 72,925,102 | 5 | true | 2022-07-09T22:40:53.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating variadic template with template object containing string<p>I want to create a template that will take variadic number of a specific class that conta... |
73,018,918 | Accessing parent prototype method via child object like a normal child method<p>It seems like I don't understand prototypes correctly once again.</p>
<p>If you call a method on an object, and it doesn't exist - does it not check the prototype for the method can run it?</p>
<p>like</p>
<pre><code>Array.prototype.myArray... | <blockquote>
<p>If you call a method on an object, and it doesn't exist - does it not check the prototype for the method can run it?</p>
</blockquote>
<p>Yes, it does (like with any property), but this code is incorrect:</p>
<pre><code>OtherWall.prototype = {
constructor: Object.create(Wall.prototype)
// ...
</... | Accessing parent prototype method via child object like a normal child method | javascript | 3 | 46 | 1 | 73,019,027 | 73,019,027 | 5 | true | 2022-07-18T07:51:07.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing parent prototype method via child object like a normal child method<p>It seems like I don't understand prototypes correctly once again.</p>
<p>If y... |
73,006,448 | Floyd's triangle with math, not strings<p>I'm looking at a challenge to build a Floyd's triangle out of integers using only arithmetic operators and a single for-loop. There are hundreds of tutorials using dual for-loops and string operations, but I haven't seen anything using math.</p>
<p>Example output using repeati... | <p>this works for me :)</p>
<pre><code>n = 4
val=0
for i in range(n):
val+=10**i
print(val*(i+1))
</code></pre>
<p>Val is 1, then 11, then 111. I'm not sure if this is what you are expecting.</p> | Floyd's triangle with math, not strings | python|triangle | 2 | 46 | 1 | 73,006,596 | 73,006,596 | 6 | true | 2022-07-16T17:47:35.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Floyd's triangle with math, not strings<p>I'm looking at a challenge to build a Floyd's triangle out of integers using only arithmetic operators and a single... |
72,796,568 | Why do I need the keyword TABLE in this dynamic query although I don't need in a normal query<p>db fiddle isn't working now. I will upload the code later...</p>
<pre><code>SELECT COUNT (*) FROM sys.odcivarchar2list ('2', '2');
</code></pre>
<p>this query work without using the key word table. But in a dynamic query:</p... | <p>Because when the dynamic statement</p>
<pre><code>'SELECT COUNT (*) FROM :1'
</code></pre>
<p>is parsed it sees the <code>:1</code> as a table name, and you can't use a bind variable for the table name, or any other fixed part. You can only use bind variables for, well, variables, i.e. data.</p>
<p>It doesn't matte... | Why do I need the keyword TABLE in this dynamic query although I don't need in a normal query | oracle|plsql | 1 | 46 | 1 | 72,796,884 | 72,796,884 | 6 | true | 2022-06-29T06:15:01.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I need the keyword TABLE in this dynamic query although I don't need in a normal query<p>db fiddle isn't working now. I will upload the code later...<... |
72,814,297 | Destructure a `dict` of length one to assign its key and value to two variables in Python<p>I have a bunch of <code>dict</code>ionaries with only one key-value pairs that are sometimes generated by one of the scripts I wrote, and I need to get rid of them.</p>
<p>To do this, I need to get the key and value of the <code... | <p>If you don't need the dict anymore (as your <em>"get rid of them"</em> suggests):</p>
<pre><code>k, v = d.popitem()
</code></pre>
<p>If you do:</p>
<pre><code>(k, v), = d.items()
</code></pre>
<p><a href="https://tio.run/##K6gsycjPM7YoKPr/P0XBVqFaPVHdSsGgliuxuDi1qEQhJzVPI0VTwdZWwZArW0ehDKgkJ7O4RCNFL7MkNbdY... | Destructure a `dict` of length one to assign its key and value to two variables in Python | python|python-3.x | 1 | 46 | 1 | 72,814,449 | 72,814,449 | 6 | true | 2022-06-30T10:33:36.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Destructure a `dict` of length one to assign its key and value to two variables in Python<p>I have a bunch of <code>dict</code>ionaries with only one key-val... |
72,979,128 | How can i Assign value to char** inside structure<p>I have a structure where I have char ** inside it , I have another pointer of type char * How can I assign value to it ? I tried strcpy() but it is giving me error argument of type "char **" is incompatible with parameter of type "char *".</p>
<pr... | <p>You need to alocate the space for the pointer.</p>
<pre><code>void foo( struct tmp *t, char *ptr)
{
t->ptr1 = malloc(sizeof(*t -> ptr1);
*t->ptr1 = ptr;
t->x = 0;
}
</code></pre>
<p>If you want to keep the copy of the string referenced by <code>ptr</code> you can</p>
<pre><code>void foo( struct ... | How can i Assign value to char** inside structure | c | -3 | 46 | 1 | 72,979,193 | 72,979,193 | -2 | true | 2022-07-14T10:35:37.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i Assign value to char** inside structure<p>I have a structure where I have char ** inside it , I have another pointer of type char * How can I assi... |
72,781,563 | Header name must be a valid HTTP token, nodejs?<p>I am trying to create API which will return self hosted URL.
This is my code</p>
<pre><code>const app = require('./app');
const config = require('./config/config');
const logger = require('./config/logger');
let server;
server = app.listen(config.port, config.host, () =... | <p>Syntax issue solved it using</p>
<pre><code>res.send(config.host+":"+config.port+"/sid/ui")
</code></pre> | Header name must be a valid HTTP token, nodejs? | node.js|express | -1 | 46 | 2 | 72,781,835 | 72,781,835 | -1 | true | 2022-06-28T06:20:28.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Header name must be a valid HTTP token, nodejs?<p>I am trying to create API which will return self hosted URL.
This is my code</p>
<pre><code>const app = req... |
72,836,869 | getting undefined when trying to get value from textbox using JQuery<p>I am getting undefined whenever I try to get a variable from a textbox</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-ov... | <p>Try 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-js lang-js prettyprint-override"><code>function foo() {
let fname = $("#firstName").val();
let lname = $("#lastName").val();
let fullname = fname + " " + l... | getting undefined when trying to get value from textbox using JQuery | javascript|html|jquery | 0 | 46 | 2 | 72,836,912 | 72,836,912 | -1 | true | 2022-07-02T06:10:18Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
getting undefined when trying to get value from textbox using JQuery<p>I am getting undefined whenever I try to get a variable from a textbox</p>
<p><div cla... |
72,875,297 | How to take 'snapshot' of variable value before a for loop? C#<pre><code> static void Main(string[] args)
{
Random rnd = new Random();
float myfloat = rnd.Next(1, 50);
for (int i = 0; i <= 2; i++)
{
myfloat = 3;
}
Console.WriteLine(myfloat);
... | <p>I recommend using a "temporary" variable.</p>
<pre><code>static void Main(string[] args)
{
Random rnd = new Random();
float myfloat = rnd.Next(1, 50);
float tempFloat = myfloat;
for (int i = 0; i <= 2; i++)
{
myfloat = 3;
}
myfloat = tempFloat;
Console.WriteL... | How to take 'snapshot' of variable value before a for loop? C# | c#|loops|for-loop | -3 | 46 | 1 | 72,875,341 | 72,875,341 | -1 | true | 2022-07-05T20:41:31.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to take 'snapshot' of variable value before a for loop? C#<pre><code> static void Main(string[] args)
{
Random rnd = new Random();
... |
72,316,500 | TPL Dataflow block with an inner life<p>I've been doing a bit of TPL dataflow coding and am quite happy with the basics. The question I have is, how would I go about doing a TPL block that, besides reacting to its queue, also has a life on its own?</p>
<p>Like, a background task that runs on a permanent loop, polling t... | <p>So, here's what I did in the end:
My FSM class consisted of a broadcast block, working as input, a bufferblock working as output and an async method with an endless loop running in the threadpool. The async method gets the current input value from the broadcastblock whenever needed, does its thing and posts a result... | TPL Dataflow block with an inner life | tpl-dataflow | 0 | 46 | 2 | 72,965,888 | 72,965,888 | -1 | true | 2022-05-20T09:20:38.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TPL Dataflow block with an inner life<p>I've been doing a bit of TPL dataflow coding and am quite happy with the basics. The question I have is, how would I ... |
73,015,771 | I'm trying to index an array of nodes (linked lists)<p>Node struct implementation:</p>
<pre><code>typedef struct node{
int data;
struct node* next;
} node;
typedef node* nodePtr;
</code></pre>
<p>Appending to my node:</p>
<pre><code>// Append to node
void addTo(nodePtr* aNode, int val){
//Create a new node ... | <p>There are two major issues with this program. The first is that you have not initialized your list pointers. You allocate storage for them, but their actual values can be anything. Attempting to dereference such values will result in Undefined Behavior.</p>
<p>You could <code>memset</code> after calling <code>malloc... | I'm trying to index an array of nodes (linked lists) | arrays|c|nodes|bin|radix | 0 | 46 | 1 | 73,016,011 | 73,016,011 | -1 | true | 2022-07-17T22:24:28.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to index an array of nodes (linked lists)<p>Node struct implementation:</p>
<pre><code>typedef struct node{
int data;
struct node* next;
}... |
73,025,872 | Issue on my higher or lower number guessing game<pre><code>import random
from random import randint
import string
computer = random.randint(0, 50)
player = False
while player == False:
player = input("Choose number 1-50: ")
if player == computer:
print("Well Done!")
elif playe... | <p>Replace</p>
<pre><code>input("Choose number 1-50: ")
</code></pre>
<p>With:</p>
<pre><code>int(input("Choose number 1-50: "))
</code></pre> | Issue on my higher or lower number guessing game | python | 0 | 46 | 3 | 73,025,923 | 73,025,923 | -1 | true | 2022-07-18T16:48:50.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue on my higher or lower number guessing game<pre><code>import random
from random import randint
import string
computer = random.randint(0, 50)
player =... |
72,845,727 | Display form info on alert (html and javascript)<p>I currently have a form in which a user can put his name, age and the message and then I have a button to submit the message and it is supposed to show an alert with the form information but when I put the information and click the button nothing is happening (the aler... | <p>the correct way to do that...</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 myForm = document.querySelector('#my-form') // use the form parent
... | Display form info on alert (html and javascript) | javascript|html | -2 | 46 | 1 | 72,845,925 | 72,845,925 | -1 | true | 2022-07-03T10:29:57.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display form info on alert (html and javascript)<p>I currently have a form in which a user can put his name, age and the message and then I have a button to ... |
72,774,415 | How to animate matplotlib.imshow()?<p>I am a physics student trying to simulate the 2D Ising model using the Metropolis algorithm in Python. I wanted to see the time evolution of imshow() and used the following code below. But the program outputs a blank graph. What do I do? Thank you for your help!!</p>
<pre><code>n =... | <p>I only needed to add the imports and change the def energy section (specifically the e= line). It works nicely in my system.</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy import ndimage, convolve
n = 50
ims =[]
def lattice(p):
init_random... | How to animate matplotlib.imshow()? | python | 0 | 47 | 1 | 72,778,951 | 72,778,951 | 0 | true | 2022-06-27T15:10:44.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to animate matplotlib.imshow()?<p>I am a physics student trying to simulate the 2D Ising model using the Metropolis algorithm in Python. I wanted to see ... |
72,775,675 | Macro to replace print(a) by print(f'{a=}') in Pycharm<p>In Pycharm, I'd like to create a "macro" that replaces a simple print() by a support = fstring print(), that is, when I have a line of code like that :</p>
<pre><code>print(a)
</code></pre>
<p>I would like to replace it by :</p>
<pre><code>print(f"... | <p>I ended up getting there using english keyboard (instead of french keyboard).
It looks like :</p>
<p><a href="https://i.stack.imgur.com/LwwmF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LwwmF.jpg" alt="enter image description here" /></a></p> | Macro to replace print(a) by print(f'{a=}') in Pycharm | python|pycharm | 1 | 47 | 1 | 72,781,831 | 72,781,831 | 0 | true | 2022-06-27T16:48:39.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Macro to replace print(a) by print(f'{a=}') in Pycharm<p>In Pycharm, I'd like to create a "macro" that replaces a simple print() by a support = fst... |
72,780,879 | How to give routerLinkActive for the same link in different section in Angular?<p>I have two sections, pinned tools section and all tools section. Both sections contains same routerLink. If I click on the pinned tools section menu routerLink, it should apply routerLinkActive class only that pinned tools section only. B... | <p>I suspect you can't do what you likely want to do. The point is that so long as the target route is active, it will give your specified class to the element so that you can style it to your hearts desire.</p>
<p>If both are hooked up to the route, they'll both be active whilst on that route.</p>
<p>The only way roun... | How to give routerLinkActive for the same link in different section in Angular? | angular|typescript | 1 | 47 | 1 | 72,783,020 | 72,783,020 | 0 | true | 2022-06-28T04:50:51.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to give routerLinkActive for the same link in different section in Angular?<p>I have two sections, pinned tools section and all tools section. Both secti... |
72,769,874 | is there way to modify filter in Angular MatTableDataSource to filter data from the beginning of the searched expression and not included?<p>I have the same implementation as this stackblitz : <a href="https://stackblitz.com/edit/angular-f3mmmp?file=src%2Fapp%2Fapp.component.ts" rel="nofollow noreferrer">https://stackb... | <p>Solution is found.</p>
<p>in line 91 Replace : <strong>data.name.toLowerCase().indexOf(searchTerms.name) !== -1</strong> by <strong>data.name.toLowerCase().startsWith(searchTerms.name)</strong></p> | is there way to modify filter in Angular MatTableDataSource to filter data from the beginning of the searched expression and not included? | angular-material|angular9 | 1 | 47 | 1 | 72,784,110 | 72,784,110 | 0 | true | 2022-06-27T09:31:58.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is there way to modify filter in Angular MatTableDataSource to filter data from the beginning of the searched expression and not included?<p>I have the same ... |
72,782,099 | sorting a tcl array according to a value in the key<p>I noticed a lot of examples here how to sort an array with 1 value per each key, question is: how can I sort an array with an elaborated value?<br />
e.g.</p>
<pre><code>set a(one) "some sort of text and num 234"
set a(two) "same format of text with 1... | <p>Since the -stride flag of <code>lsort</code> is useless here, solved it with a list of lists:</p>
<pre><code> foreach {k v} [array get paths] {
lappend xx [concat $k $v] ... | sorting a tcl array according to a value in the key | arrays|tcl | 0 | 47 | 3 | 72,784,948 | 72,784,948 | 0 | true | 2022-06-28T07:10:49.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sorting a tcl array according to a value in the key<p>I noticed a lot of examples here how to sort an array with 1 value per each key, question is: how can I... |
72,789,070 | I want to sort by the first element of a tuple which is in a dictionary<p>I want to know how I can sort by the bigger element (which is here the int 7):</p>
<pre><code>{'a': (2, 0, 'a'), 'b': (4, 0, 'b'), 'c': (7, 0, 'c')}
</code></pre>
<p>In my entire code the sorting is done in a 'while'</p>
<p>Thank you.</p> | <p>If I understood correctly that you want to sort by the first item in the value tuple:</p>
<pre class="lang-py prettyprint-override"><code>d = {'a': (2, 0, 'a'), 'b': (4, 0, 'b'), 'c': (7, 0, 'c')}
sorted_d = dict(sorted(d.items(), key=lambda x:x[1][0], reverse=True))
# {'c': (7, 0, 'c'), 'b': (4, 0, 'b'), 'a': (2, ... | I want to sort by the first element of a tuple which is in a dictionary | python|dictionary|tuples | 0 | 47 | 3 | 72,789,157 | 72,789,157 | 0 | true | 2022-06-28T15:14:36.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to sort by the first element of a tuple which is in a dictionary<p>I want to know how I can sort by the bigger element (which is here the int 7):</p>
... |
72,789,315 | Input tag validation<p>I have just an input tag with the following logic:</p>
<p><a href="https://codepen.io/ion-ciorba/pen/MWVWpmR" rel="nofollow noreferrer">https://codepen.io/ion-ciorba/pen/MWVWpmR</a></p>
<p>I have a minimum value coming from the database(400 in this case), the logic is good but the user interactio... | <p>I agree with @Twisty the jQuery UI Slider would be better suited</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>$(function() {
let slider = $(".tbi-slider")[0];
let loa... | Input tag validation | javascript|html|jquery|css | 0 | 47 | 2 | 72,791,542 | 72,791,542 | 0 | true | 2022-06-28T15:30:28.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Input tag validation<p>I have just an input tag with the following logic:</p>
<p><a href="https://codepen.io/ion-ciorba/pen/MWVWpmR" rel="nofollow noreferrer... |
72,789,847 | python : New to python tried to make a rock paper scissors game<p>i tried to make a rock paper scissors game but it doesn't work it just ask for user input and does nothing else.</p>
<pre><code>import random
def main():
user = input("Choose 'r' for rock, 'p' for paper or 's' for scissors ")
comp = ra... | <p>In the given code you are returning some value, so here you need to store that value in some kind of variable as <code>main()</code> is running correctly and after execution it's returning <code>Tie, Winner, Loser</code>.<br />
So need to print the result:</p>
<pre class="lang-py prettyprint-override"><code>if __nam... | python : New to python tried to make a rock paper scissors game | python | -2 | 47 | 2 | 72,792,306 | 72,792,306 | 0 | true | 2022-06-28T16:08:36.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python : New to python tried to make a rock paper scissors game<p>i tried to make a rock paper scissors game but it doesn't work it just ask for user input a... |
72,324,221 | SOLR 8.11.1 start from command window Rolling Appender errors<p>I have put SOLR 8.11.1 onto a windows server in a folder E:\ApacheSolr8_11_1
I am able to successfully start SOLR from the command window using the following command</p>
<p>bin\solr.cmd start -p 8983</p>
<p>I have a windows service that runs the following ... | <p>The issue was that the logging folder in the jetty.logs parameter was pointing to the wrong folder.</p> | SOLR 8.11.1 start from command window Rolling Appender errors | solr | 0 | 47 | 1 | 72,792,791 | 72,792,791 | 0 | true | 2022-05-20T19:56:32.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SOLR 8.11.1 start from command window Rolling Appender errors<p>I have put SOLR 8.11.1 onto a windows server in a folder E:\ApacheSolr8_11_1
I am able to suc... |
72,796,895 | Cannot figure out formatting issue with printf and %.2f<p>I am trying get an output from this code. It will compile and return perfectly, but as soon as I add the final " calories" string at the end I will get an error message. Literally having the " calories" at the end of the output is the differe... | <p>You'll have to format double calorie1 to a string to print double upto two decimal places</p>
<pre><code>System.out.printf("Calories: " + String.format("%.2f", calories1) + " calories");
</code></pre> | Cannot figure out formatting issue with printf and %.2f | java | 0 | 47 | 1 | 72,796,973 | 72,796,973 | 0 | true | 2022-06-29T06:46:40.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot figure out formatting issue with printf and %.2f<p>I am trying get an output from this code. It will compile and return perfectly, but as soon as I ad... |
72,798,570 | TypeError: router.back is not a function<p>I'm testing the next.js back route navigation. But I'm getting this error when running the test:</p>
<p><a href="https://i.stack.imgur.com/O6Nax.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O6Nax.png" alt="error" /></a></p>
<p>The back function:</p>
<pre... | <p>I solved this by mocking the back function on "next/router"</p>
<pre><code> jest.mock("next/router", () => ({
useRouter() {
return {
route: "/status",
pathname: "/status",
query: "",
asPath: "&q... | TypeError: router.back is not a function | reactjs|typescript|next.js|react-testing-library | 1 | 47 | 1 | 72,798,640 | 72,798,640 | 0 | true | 2022-06-29T08:57:27.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: router.back is not a function<p>I'm testing the next.js back route navigation. But I'm getting this error when running the test:</p>
<p><a href="... |
72,797,915 | How do I access this hash's object's attributes in Ruby?<p>I have a hash with a Vehicle object and some Google Maps API calculations:</p>
<pre><code>{#<Vehicle id: 9, type: "hybrid">=>#<GoogleDistanceMatrix::Route origin: #<GoogleDistanceMatrix::Place address: "LAX airport", extracted... | <p>It seems like your hash has a <code>Vehicle</code> as a <strong>key</strong> and <code>GoogleDistanceMatrix::Route</code> as a <strong>value</strong> (note it's not a <code>GoogleDistanceMatrix</code> as you said), therefore you could access both with something like this:</p>
<pre class="lang-rb prettyprint-override... | How do I access this hash's object's attributes in Ruby? | ruby-on-rails|ruby | 0 | 47 | 1 | 72,798,833 | 72,798,833 | 0 | true | 2022-06-29T08:09:02.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I access this hash's object's attributes in Ruby?<p>I have a hash with a Vehicle object and some Google Maps API calculations:</p>
<pre><code>{#<Ve... |
72,788,065 | Golang RCP call hanging<p>I have a back-end app and a front-end, both in Go. I am trying to make them talk via rpc.</p>
<p>back-end main.go</p>
<pre><code>package main
import (
"fmt"
"log"
"net"
"net/http"
"net/rpc"
"time"
)
type Appli... | <p>Your server is serving HTTP:</p>
<pre class="lang-golang prettyprint-override"><code>if err = http.Serve(l, nil); err != nil {
log.Fatal(err)
}
</code></pre>
<p>But your client is using straight TCP (HTTP runs over TCP but adds another layer):</p>
<pre><code>err = dial.Call("Application.GetMusicProjectById&q... | Golang RCP call hanging | go|rpc | 1 | 47 | 1 | 72,799,460 | 72,799,460 | 0 | true | 2022-06-28T14:13:46.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Golang RCP call hanging<p>I have a back-end app and a front-end, both in Go. I am trying to make them talk via rpc.</p>
<p>back-end main.go</p>
<pre><code>pa... |
72,799,494 | PyG: Remove existing edges from prediction matrix<p>I'm currently working on a recommender system using PyG.
The edges are defined as follows:</p>
<pre><code>edge_index = tensor([[ 0, 0, 0, ..., 9315, 9317, 9317],
[ 100, 448, 452, ..., 452, 1, 307]], device='cuda:0')}
</code></pre>
<p><code>ed... | <p>Since you want to index <code>recs</code> on both axes simultaneously a straight implementation is to to vectorize your for loop as:</p>
<pre><code>>>> recs[edge_index[0], edge_index[1]] = 0
</code></pre>
<p>Which you can improve by splitting <code>edge_index</code> with <em><code>tuple</code></em>:</p>
<pr... | PyG: Remove existing edges from prediction matrix | python|pytorch|recommendation-system|pytorch-geometric | 2 | 47 | 1 | 72,802,592 | 72,802,592 | 0 | true | 2022-06-29T10:03:59.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyG: Remove existing edges from prediction matrix<p>I'm currently working on a recommender system using PyG.
The edges are defined as follows:</p>
<pre><code... |
72,808,810 | Match/Case used to decide what keys JSON response contains<p>I am trying to apply a match/case in my script where I want to do some action based on the JSON response from the API call:</p>
<pre><code>response_types =
1. -> {'data': [{'id': 1485037059173588994}]}
2. -> {'data': [{'media': 1423364523411623943}]}
3... | <p>Using <code>match-case</code> is pretty straightforward here:</p>
<pre><code>match response:
case {'data': [{'id': _id}]} if _id > 51515: #using a guard, per your comment
print('response 1', _id)
case {'data': [{'media': media}, *_]}:
print('response 2', media)
case {'errors': [{'code': cod... | Match/Case used to decide what keys JSON response contains | python|python-3.10|structural-pattern-matching | 0 | 47 | 2 | 72,809,364 | 72,809,364 | 0 | true | 2022-06-29T23:22:27.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Match/Case used to decide what keys JSON response contains<p>I am trying to apply a match/case in my script where I want to do some action based on the JSON ... |
72,797,714 | How to set the value of each bar on top of the column graph in highchart<p>I have a dataframe like the belowing one and i want to plot a column graph with the value of the variation on top of each column which must be similar to the richbourse <a href="https://www.richbourse.com/common/variation/index" rel="nofollow no... | <p>The best one is</p>
<pre><code>qt%>%hchart('column', name = c('Flop', 'Top'),
hcaes(x = Symbole, y = `Variation(%)`,
group = position))%>%
hc_plotOptions(series = list(
borderWidth= 0,
dataLabels = list(
enabled = TRUE,
color = "bla... | How to set the value of each bar on top of the column graph in highchart | r|highcharts | 0 | 47 | 2 | 72,809,365 | 72,809,365 | 0 | true | 2022-06-29T07:54:04.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set the value of each bar on top of the column graph in highchart<p>I have a dataframe like the belowing one and i want to plot a column graph with th... |
72,780,123 | AVAssetExportSession export fails with non-deterministic error<p>I'm trying to export videos with CIFilters applied using AVAssetExportSession, but sometimes it works and sometimes it doesn't. It's unclear even how to reproduce the error.</p>
<p>I've noticed that <strong>there's no problem exporting videos recorded wit... | <p>I found a solution that worked for me.</p>
<p>Replaced:</p>
<pre><code>let compositionVideoTrack = composition.addMutableTrack(withMediaType: .video, preferredTrackID: kCMPersistentTrackID_Invalid)
let compositionAudioTrack = composition.addMutableTrack(withMediaType: .audio, preferredTrackID: kCMPersistentTrackID_... | AVAssetExportSession export fails with non-deterministic error | swift|avfoundation|core-image|cifilter|avassetexportsession | 0 | 47 | 1 | 72,809,392 | 72,809,392 | 0 | true | 2022-06-28T02:28:42.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AVAssetExportSession export fails with non-deterministic error<p>I'm trying to export videos with CIFilters applied using AVAssetExportSession, but sometimes... |
72,797,066 | Print table same as shown in page<p>I want when I click on print button shown in right side in image, print window show same table that shown in html page, right now I delete all class from button so you can see that code clearly</p>
<p><strong>html table</strong>
</p>
<pre><code> <div style="text-align: end... | <p>finally I got it just add some CSS in your script this will change your style from print window,</p>
<p><strong>script function</strong></p>
<pre><code><script>
function printPageArea(printableArea) {
var mywindow = window.open('', 'PRINT');
mywindow.document.write('<html><head>... | Print table same as shown in page | javascript|html|printing|styling | 0 | 47 | 1 | 72,810,569 | 72,810,569 | 0 | true | 2022-06-29T07:01:04.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print table same as shown in page<p>I want when I click on print button shown in right side in image, print window show same table that shown in html page, r... |
72,812,256 | Replace the number matching with pattern to date<p>From the below file I wanted to replace all the numbers which match with a pattern say <strong>165</strong> or <strong>164</strong> with a pattern say "2022-06-10 10:43:55".</p>
<p>Please note columns are not static so numbers can be present in any column. I ... | <p>I would use GNU <code>sed</code> for this task following way, let <code>file.txt</code> content be</p>
<pre><code>51 Nick Trump dummy@gmail.com OTHERS 1653029034386 1653029034386 1653029034385 \N \N
52 Nick Trump dummy@gmail.com 1653029527542 1653029527542 1653029527540 \N \N
53 Nick Trump dummy@gmail.com 1643029528... | Replace the number matching with pattern to date | shell|unix|awk|sed|script | -1 | 47 | 1 | 72,813,314 | 72,813,314 | 0 | true | 2022-06-30T08:01:30.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace the number matching with pattern to date<p>From the below file I wanted to replace all the numbers which match with a pattern say <strong>165</strong... |
72,819,328 | Restrict Users permission to access data in ADLS<p>Is it possible to allow only specific users from databricks to access specific data from Azure Data Lake Storage?</p>
<p>I want to allow only User 1 and User 2 to access data1.csv file and allow User 3 and User 4 to access data2.csv file.</p> | <p>It is a <strong>Premium</strong> feature in Azure Databricks that allows to authenticate to Azure Data Lake Store using the Azure Active Directory identity logged into Azure Databricks. With this feature customers can control which user can access which data through Azure Databricks.</p>
<p>This feature needs to be ... | Restrict Users permission to access data in ADLS | azure|azure-databricks | 0 | 47 | 1 | 72,819,576 | 72,819,576 | 0 | true | 2022-06-30T16:45:13.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Restrict Users permission to access data in ADLS<p>Is it possible to allow only specific users from databricks to access specific data from Azure Data Lake S... |
72,807,922 | Order top level key:value pairs in JSON file and including second level key:pair<p>I use the following code to sort key/value pairs in JSON files and append them in one file. This works if all keys are in the top level.</p>
<pre><code>from collections import OrderedDict
from textwrap import indent
import json
for i in... | <pre><code>import json
from collections import OrderedDict
for i in range(10000):
filename = str(i)+".json"
with open(filename) as json_file:
json_decoded = json.load(json_file)
edition = json_decoded['custom_fields']['edition']
json_decoded.update({"edition":edition})
... | Order top level key:value pairs in JSON file and including second level key:pair | python|json | 0 | 47 | 1 | 72,821,812 | 72,821,812 | 0 | true | 2022-06-29T21:11:48.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Order top level key:value pairs in JSON file and including second level key:pair<p>I use the following code to sort key/value pairs in JSON files and append ... |
72,794,339 | How to hook into html with my own html overlay?<p>I am trying to overlay some HTML code over a website's image using <code><iframe></code> and CSS.</p>
<p>The website is a weather-monitoring website (which we've purchase btw), that I want to overlay with my own HTML code and image.</p>
<p>Is it possible to "... | <p>The answer was to use CSS margin-left and rights.</p>
<pre><code>.divCanvas
{
z-index:99;
position:absolute;
margin-left: 525px;
margin-top: 70px;
}
</code></pre>
<p>and referring to the html with this class...</p>
<pre><code><div class="divCanvas">
<canvas id="compass&quo... | How to hook into html with my own html overlay? | javascript|html|css|overlay | 0 | 47 | 1 | 72,824,946 | 72,824,946 | 0 | true | 2022-06-28T23:55:35.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hook into html with my own html overlay?<p>I am trying to overlay some HTML code over a website's image using <code><iframe></code> and CSS.</p>... |
72,827,365 | Angular Convert POST request data to array<p>I have a post request that sends some data to a NodeJS app and then that returns an array. My problem is that I can't turn the data I receive as a response from the POST request to an array.</p>
<p>My Angular is set up like this:</p>
<pre><code>newWord = '';
keyword = '';
o... | <p>Provide the type to the http request. Otherwise angular expects any, which is not necessarily an array. That is where the error comes from.</p>
<pre><code> this.http.post<{ id: string, text: string }[]>('http://localhost:3000/search',
{ keyword: this.keyword },
{
headers: headers
})
... | Angular Convert POST request data to array | node.js|arrays|json|angular|post | 0 | 47 | 1 | 72,827,515 | 72,827,515 | 0 | true | 2022-07-01T09:42:57.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular Convert POST request data to array<p>I have a post request that sends some data to a NodeJS app and then that returns an array. My problem is that I ... |
72,816,535 | Total count of tests before test suite from dataprovider send to listener<p>Hello guys so I have 10files and 10 tests in my suite. Each test have one DATA PROVIDER what return String[].I know how to get length of all String[] from all data providers. Lets say total count of all tests in suite is 50.This value I count @... | <p>Problem solved.</p>
<p>In listener class I must get suite attribute in OnTestStart(ITestResult) instead of OnStart(ISuite)</p>
<pre><code> @Override
protected void OnTestStart(ITestResult tr) {
totalTests = (Integer) tr.getTestContext().getAttribute("Total tests");
}
</code></pre>
<p>}</p> | Total count of tests before test suite from dataprovider send to listener | java|testng | 0 | 47 | 1 | 72,827,530 | 72,827,530 | 0 | true | 2022-06-30T13:17:30.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Total count of tests before test suite from dataprovider send to listener<p>Hello guys so I have 10files and 10 tests in my suite. Each test have one DATA PR... |
72,828,946 | Any way to get a currentTime value prior to the seek on HTMLMediaElement?<p>Let's say our app is using the default video player on Safari.</p>
<p>When a user is playing a video and then attempts to move to a different position of the video using the seek bar, it seems like <code>pause</code> event is fired first, and t... | <p>I think @Kaiido means this when saying <em>"Cache two values"</em>.<br>
Code is untested (but looks better than being kept in comments section)</p>
<pre><code><script>
const video = document.querySelector("#myvideo");
let cache = 0;
let cache_prev = 0;
video.addEventListene... | Any way to get a currentTime value prior to the seek on HTMLMediaElement? | javascript|html|video|html5-video|webapi | 2 | 47 | 1 | 72,833,930 | 72,833,930 | 0 | true | 2022-07-01T11:59:19.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Any way to get a currentTime value prior to the seek on HTMLMediaElement?<p>Let's say our app is using the default video player on Safari.</p>
<p>When a user... |
72,833,459 | Splitting columns from an excel file and creating a list of elements<p>I have an excel file of 8 columns. The number of columns can change, so I need to write something able to work with a bigger number of columns too.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;... | <p>Let's solve this trick with looking at a vector first. Frankly, it does not matter what the values are, so long as we know that it is always divisible by 4, and we know that the first 2 from the front half pairs with the first 2 of the second half, etc.</p>
<p>Starting with length 12:</p>
<pre class="lang-r prettypr... | Splitting columns from an excel file and creating a list of elements | r|list | 1 | 47 | 2 | 72,834,359 | 72,834,359 | 0 | true | 2022-07-01T18:43:00.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Splitting columns from an excel file and creating a list of elements<p>I have an excel file of 8 columns. The number of columns can change, so I need to writ... |
72,801,818 | jquery button click works for only the first data in laravel foreach loop<p>Please i have a data i loop through from db to laravel view which return as a input field. i am trying to get individual inputs from the foreach when a button is clicked, but the button returns on the first loop data</p>
<p>My code :</p>
<pre c... | <p>IDs should be unique for each element</p>
<p>I changed the IDs to classes</p>
<pre><code><div class="row text-center">
@foreach($plans as $plan)
<div class="col-lg-6 col-md-12 col-sm-12 d-flex align-items-stretch">
<div class="icon-box">
<div class="... | jquery button click works for only the first data in laravel foreach loop | javascript|jquery | -2 | 47 | 1 | 72,838,929 | 72,838,929 | 0 | true | 2022-06-29T12:57:14.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jquery button click works for only the first data in laravel foreach loop<p>Please i have a data i loop through from db to laravel view which return as a inp... |
72,799,393 | google api access token null for local java client with service account<p>I created a service account to use Google chat (not bot) from a local java client. My objective is to migrate flowdock data to Google chat.</p>
<p>I tried different means to get access token using service account and looked at several docs and fo... | <p>It seems we need some clean code crafting here. The error came in fact from wrong scopes declaration. Adding chat bot (why as I don't need bot ?) made me advance.</p>
<p><strong>Scopes</strong></p>
<pre><code>public class ChatScopes {
static final String CLOUD_SCOPE = "https://www.googleapis.com/auth/cloud-plat... | google api access token null for local java client with service account | google-cloud-platform|hangouts-chat|hangouts-api | 1 | 47 | 1 | 72,839,837 | 72,839,837 | 0 | true | 2022-06-29T09:56:46.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
google api access token null for local java client with service account<p>I created a service account to use Google chat (not bot) from a local java client. ... |
72,845,379 | unity Subtraction Issue - Beginner<p>I have a really basic problem.</p>
<p>I want to display the score on my TextBox and add +1 when the "OK" button is clicked and subtract -5 when the "NO" button is clicked.</p>
<p>But now I have the problem that it seems to me that the subtraction doesn't really w... | <p>You need to use a single script that will handle both button clicks. At the moment you have two scripts, each one with its own <code>score</code> variable. Place your script to the object (usually root object for both buttons is used for this). Then point both buttons onClick method to this script. It should do the ... | unity Subtraction Issue - Beginner | c#|unity3d|math | 0 | 47 | 2 | 72,845,528 | 72,845,528 | 0 | true | 2022-07-03T09:28:12.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
unity Subtraction Issue - Beginner<p>I have a really basic problem.</p>
<p>I want to display the score on my TextBox and add +1 when the "OK" butto... |
72,839,305 | Newsapi.org not displaying full content<p>I am trying to create a news app using api provided by newsapi.org
<a href="https://i.stack.imgur.com/w4wyT.jpg" rel="nofollow noreferrer">but the content is appearing as follows.</a>. I am using a free api key</p>
<p>The code for the displaying and retrieving the data from api... | <p>@R3hankhan According to the newsApi docs
<a href="https://newsapi.org/docs/endpoints/top-headlines" rel="nofollow noreferrer">https://newsapi.org/docs/endpoints/top-headlines</a>
The response object has a key called totalResults which is an int and shows the number of articles fetched. so in your <code>PageView.buil... | Newsapi.org not displaying full content | android|flutter | 0 | 47 | 1 | 72,845,767 | 72,845,767 | 0 | true | 2022-07-02T13:10:57.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Newsapi.org not displaying full content<p>I am trying to create a news app using api provided by newsapi.org
<a href="https://i.stack.imgur.com/w4wyT.jpg" re... |
72,843,628 | Getting buffer overflow even though I have included the condition that avoids buffer flow (Question 74. Search a 2D Matrix) from leetcode<p>I was solving Q 74. Search a 2D Matrix from leetcode and I am getting heap buffer overflow error for my solution even though I have included the statements which should avoid buffe... | <p><code>t2 = matrix[0].size();</code> is out-of-bounds.</p>
<p>Did you mean</p>
<pre><code>t2 = cols - 1;
</code></pre> | Getting buffer overflow even though I have included the condition that avoids buffer flow (Question 74. Search a 2D Matrix) from leetcode | c++ | -2 | 47 | 1 | 72,845,893 | 72,845,893 | 0 | true | 2022-07-03T02:43:34.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting buffer overflow even though I have included the condition that avoids buffer flow (Question 74. Search a 2D Matrix) from leetcode<p>I was solving Q 7... |
72,817,265 | xcode-select: error: tool 'xcodebuild' requires Xcode<p>I am trying to migrate my Angular application from <a href="https://update.angular.io/?l=3&v=4.4-14.0" rel="nofollow noreferrer">v4.4.6 to v14.0.4</a>. I have conducted the following steps successfully :</p>
<pre><code> % rm -rf node_modules
% npm update --lo... | <p>Found the solution to my problem finally :</p>
<pre><code>sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
</code></pre>
<p><a href="https://github.com/nodejs/node-gyp/issues/569#issuecomment-94917337" rel="nofollow noreferrer">Source</a></p> | xcode-select: error: tool 'xcodebuild' requires Xcode | node.js|angular|npm | 0 | 47 | 1 | 72,846,226 | 72,846,226 | 0 | true | 2022-06-30T14:07:53.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
xcode-select: error: tool 'xcodebuild' requires Xcode<p>I am trying to migrate my Angular application from <a href="https://update.angular.io/?l=3&v=4.4-... |
72,847,125 | Object(...) is not a function with vuetify<p>sorry for my english.</p>
<p>I am developing an app on Nuxt + vuetify.</p>
<p>I want to use the store, but I have an error message. I searched on web, but no results work.</p>
<p>My code in store</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true... | <p>you can check this sample, perhaps it can solve your problem</p>
<pre><code>import Vuex from 'vuex'
const createStore = () => {
return new Vuex.Store({
state: () => ({
}),
mutations: {
},
actions: {}
})
}
export default createStore
</code></pre>
<p>read more from <a href="https://deve... | Object(...) is not a function with vuetify | javascript|nuxt.js|vuetify.js | 2 | 47 | 2 | 72,847,181 | 72,847,181 | 0 | true | 2022-07-03T14:05:06.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Object(...) is not a function with vuetify<p>sorry for my english.</p>
<p>I am developing an app on Nuxt + vuetify.</p>
<p>I want to use the store, but I hav... |
72,803,319 | The display is wrong when using iTerm2 + screen + emacs on macOS monterey<p>When I use iTerm2 + screen + emacs, the display is something wrong.
For example, underline is set automatically at whitespace even if I don't customize setting.
And character's color is different from what I don't use screen.
The color is pink ... | <p>I found the workaround.
If I used emacs 27.1, I don't face this issue.</p> | The display is wrong when using iTerm2 + screen + emacs on macOS monterey | macos|emacs|apple-m1|gnu-screen|iterm2 | -1 | 47 | 1 | 72,850,742 | 72,850,742 | 0 | true | 2022-06-29T14:41:28.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The display is wrong when using iTerm2 + screen + emacs on macOS monterey<p>When I use iTerm2 + screen + emacs, the display is something wrong.
For example, ... |
72,846,217 | SQL collate using select query on multiple fields<p>I have an a spring boot project with a nativeQuery sql query that is executed by front end code each time a user types in a letter in a certain field. In the query, user input serves as a parameter to two database fields. I currently have it like this:</p>
<pre><code>... | <blockquote>
<p>The COLLATE operator determines the collation for an expression</p>
<p>Source: <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/COLLATE-Operator.html#GUID-1B8CE3B0-77FC-455C-8400-6F81CF188D7B" rel="nofollow noreferrer">https://docs.oracle.com/en/database/oracle/oracle-databas... | SQL collate using select query on multiple fields | sql|oracle|jpa|spring-data-jpa|collate | 0 | 47 | 1 | 72,852,631 | 72,852,631 | 0 | true | 2022-07-03T11:45:30.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL collate using select query on multiple fields<p>I have an a spring boot project with a nativeQuery sql query that is executed by front end code each time... |
72,856,210 | My animation is not returning to idle but goes from idle to run animation and then never returns<p>I need help my animation is not returning back to idle this is for my enemy. I have the transitions set up in the animator and i have a bool parameter for true and false and no I don't want to use unity built in ai thing.... | <p>Try replacing the last <code>else if</code> Statement to just an <code>else</code> Statement. This way your code works regardless if you hit something or not.</p> | My animation is not returning to idle but goes from idle to run animation and then never returns | c#|unity3d|if-statement | 0 | 47 | 1 | 72,857,560 | 72,857,560 | 0 | true | 2022-07-04T11:48:14.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My animation is not returning to idle but goes from idle to run animation and then never returns<p>I need help my animation is not returning back to idle thi... |
72,862,732 | Return image uri to main react component<p>I'm adding a camera to an already developed react native project. I want to return the imageUri (set by takePicture in the camera component) to the calling component after the image is confirmed by user input to the image component.</p>
<p>Calling component:</p>
<pre><code><... | <p>The best way to do this is by passing parameters to image routes, you can see the documentation <a href="https://reactnavigation.org/docs/params/" rel="nofollow noreferrer">here</a>.</p>
<p>So, you can pass object in <code>navigation.navigate</code> second parameter like this:</p>
<pre><code>navigation.navigate(&quo... | Return image uri to main react component | reactjs|react-native|expo-camera | 0 | 47 | 1 | 72,863,235 | 72,863,235 | 0 | true | 2022-07-04T23:21:43.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return image uri to main react component<p>I'm adding a camera to an already developed react native project. I want to return the imageUri (set by takePictur... |
72,861,043 | Python Trouble with matrix pathfinding (DFS)<p>I am having issues with dfs, probably from a RecursionError when facing a wall.</p>
<p>Instead of continuously running an attempt which can only lead to a wall, it is supposed to return to its previous position and try another path.</p>
<p>Also, it leans heavily on the ord... | <p>I created a script that finds one path that can reach <code>goal</code>. If the path does not exists, it prints that the task is impossible.</p>
<p>Note: the algorithm does not seek for all possible paths. Once it finds one, it returns that path. Consequently, it does not return the shortest path to goal. It returns... | Python Trouble with matrix pathfinding (DFS) | python|python-3.x|recursion|depth-first-search|breadth-first-search | 0 | 47 | 1 | 72,863,394 | 72,863,394 | 0 | true | 2022-07-04T19:03:27.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Trouble with matrix pathfinding (DFS)<p>I am having issues with dfs, probably from a RecursionError when facing a wall.</p>
<p>Instead of continuously... |
72,856,057 | Linear layout split half to screen<p>I am using the adapter to show data to the screen and I am using a grid
layout.</p>
<blockquote>
<p>The single grid consists of a linear layout with two text views
one to show the heading and one to show the body.
How can I split that to
use half-width of the screen and wrap the con... | <p>Try this</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:lay... | Linear layout split half to screen | android|user-interface|layout | 0 | 47 | 2 | 72,864,823 | 72,864,823 | 0 | true | 2022-07-04T11:34:10.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linear layout split half to screen<p>I am using the adapter to show data to the screen and I am using a grid
layout.</p>
<blockquote>
<p>The single grid cons... |
72,865,369 | Unable to trigger shell script from azure repo through pipeline<p>I have deploy.sh file in my azure repository and i need to execute this deploy.sh file from azure pipeline.</p>
<p><a href="https://i.stack.imgur.com/COMz0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/COMz0.png" alt="enter image des... | <p>This solved my issue</p>
<pre><code> - task: CmdLine@2
inputs:
script: |
echo Write your commands here
cd $(Build.Repository.Name)/Orchestration/dev/
chmod +x deploy.sh
./deploy.sh
echo deploy.sh execution completed
</code></pre> | Unable to trigger shell script from azure repo through pipeline | azure|azure-devops|azure-pipelines|cloud|devops | 1 | 47 | 2 | 72,868,580 | 72,868,580 | 0 | true | 2022-07-05T07:15:31.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to trigger shell script from azure repo through pipeline<p>I have deploy.sh file in my azure repository and i need to execute this deploy.sh file from... |
72,830,481 | Convert a flattened excel to nested json in pandas<p>I am fairly new to this and have spent the entire day reading numerous posts and figuring out how i can convert this flattened excel table to a nested json. Here is an example of the flattened nested table:</p>
<pre><code> {'Sample': {0: '1A',
1: '1A',
2: '1A'... | <p>Well creating a multilevel df was not a problem. But when I exported that to a json, it did not maintain the nested structure of the indexes. Anyway, I finally found an answer here. It was just a matter to searching on google with the right keywords <a href="https://stackoverflow.com/questions/52923685/convert-panda... | Convert a flattened excel to nested json in pandas | python|json|pandas|nested-json | 1 | 47 | 2 | 72,870,401 | 72,870,401 | 0 | true | 2022-07-01T14:03:41.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a flattened excel to nested json in pandas<p>I am fairly new to this and have spent the entire day reading numerous posts and figuring out how i can ... |
72,870,190 | How to write this pandas logic for pyspark.sql.dataframe.DataFrame without using pandas on spark API?<p>I'm totally new to Pyspark, as Pyspark doesn't have loc feature how can we write this logic. I tried by specifying conditions but couldn't get the desirable result, any help would be greatly appreciated!</p>
<pre><co... | <p>For a data like the following</p>
<pre><code>data_ls = [
(1, 1, 1, 1, 10),
(5, 5, 5, 5, 10)
]
data_sdf = spark.sparkContext.parallelize(data_ls). \
toDF(['level1', 'level2', 'level3', 'level4', 'number'])
# +------+------+------+------+------+
# |level1|level2|level3|level4|number|
# +------+------+---... | How to write this pandas logic for pyspark.sql.dataframe.DataFrame without using pandas on spark API? | python|apache-spark|pyspark|apache-spark-sql | 0 | 47 | 1 | 72,871,378 | 72,871,378 | 0 | true | 2022-07-05T13:21:20.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write this pandas logic for pyspark.sql.dataframe.DataFrame without using pandas on spark API?<p>I'm totally new to Pyspark, as Pyspark doesn't have l... |
72,870,748 | Required Hawk Authentication for a GET API Call in JMeter<p>I have a one GET API request , need to pass it through JMeter but it requires Hawk Authentication . I have also Hawk Auth ID, Hawk Auth Key , Algorithm values.</p>
<p>In postman it works fine but when convert that postman script into JMeter script and execute,... | <p>Try out <a href="https://github.com/wealdtech/hawk" rel="nofollow noreferrer">Hawk Java API implementation</a>, example code can be found in the</p>
<p>Example code with explanation is provided in the <a href="http://wealdtech.github.io/hawk/core.html" rel="nofollow noreferrer">Building Your Own -> Clients</a> d... | Required Hawk Authentication for a GET API Call in JMeter | groovy|jmeter|jmeter-plugins|jmeter-5.0 | 0 | 47 | 1 | 72,872,244 | 72,872,244 | 0 | true | 2022-07-05T14:00:54.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Required Hawk Authentication for a GET API Call in JMeter<p>I have a one GET API request , need to pass it through JMeter but it requires Hawk Authentication... |
72,871,558 | Pandas TypeError: unhashable type: 'list' when importing from csv<p>I'm trying to clean some data from a csv file. Here's an example of the data I'm importing. What I'm trying to do is split the cell by the first comma. The data before the comma goes to one column, the data after goes to another.</p>
<p><a href="https:... | <p>The mistake was here, see chepner's comment pointing out that the first is a tuple of lists:</p>
<pre><code>soil_gINT_df[['USCS Major Constituent 1'],['Additional Description']]
</code></pre>
<p>Should be:</p>
<pre><code>soil_gINT_df[['USCS Major Constituent 1', 'Additional Description']]
</code></pre> | Pandas TypeError: unhashable type: 'list' when importing from csv | python|pandas | 0 | 47 | 1 | 72,872,997 | 72,872,997 | 0 | true | 2022-07-05T14:58:00.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas TypeError: unhashable type: 'list' when importing from csv<p>I'm trying to clean some data from a csv file. Here's an example of the data I'm importin... |
72,873,039 | VBA Error 13 (Type Mismatch) when trying to add items to Collection<p>I have 2 arrays taken from two ranges containing names. I want to create a 3rd array with ONLY the names in array 1 that are not in array 2. However there's a <strong>mismatch type error</strong> when trying to add values to a <strong>collection</str... | <p>This should do the same thing as you intend, and with good performance:</p>
<pre class="lang-vb prettyprint-override"><code>Sub CrearArreglos()
Dim Array1, col As New Collection, i As Long, rng2 As Range, arrOut, v
With Sheets("Sheet2")
Set rng2 = .Range("B3", .Cells(.Rows.C... | VBA Error 13 (Type Mismatch) when trying to add items to Collection | arrays|excel|vba|collections | 0 | 47 | 1 | 72,876,741 | 72,876,741 | 0 | true | 2022-07-05T16:53:55.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA Error 13 (Type Mismatch) when trying to add items to Collection<p>I have 2 arrays taken from two ranges containing names. I want to create a 3rd array wi... |
72,877,498 | How do I fillna using data from left column as the reference<p>Id like to ask for help in fixing the missing values in pandas dataframe (python)</p>
<p>here is the dataset
<a href="https://i.stack.imgur.com/RVkMA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RVkMA.png" alt="dataset" /></a></p>
<p>I... | <p>Looking at this you will probably want to use something along the lines of <code>map</code> instead of <code>join/merge</code> this is an example of how to use map with your data.</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame({
'Column1' : ['A', 'B', 'C'],
'Column2' : [1, np.nan, 3... | How do I fillna using data from left column as the reference | pandas|join|merge|lookup | 0 | 47 | 2 | 72,877,579 | 72,877,579 | 0 | true | 2022-07-06T02:59:49.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I fillna using data from left column as the reference<p>Id like to ask for help in fixing the missing values in pandas dataframe (python)</p>
<p>here ... |
72,875,522 | Using user data to calculate formulas in laravel<p>I am currently trying to find a way to use the data that is already on the users table to calculate the BMI of the user.</p>
<p>Many of the tutorials I see, they have a form, and a post, but what do I do if I already have the weight and height of the user?</p>
<p>I hav... | <p>Add the following line before the Class definition</p>
<pre><code> use Auth;
</code></pre>
<p>Get your current user height & weight using the following code:</p>
<pre><code> $weight = Auth::user()->weight;
$height = Auth::user()->height;
</code></pre> | Using user data to calculate formulas in laravel | php|laravel|phpmyadmin|laravel-breeze | 1 | 47 | 1 | 72,878,201 | 72,878,201 | 0 | true | 2022-07-05T21:04:49.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using user data to calculate formulas in laravel<p>I am currently trying to find a way to use the data that is already on the users table to calculate the BM... |
72,880,882 | Can't bind to 'ngForOf' since it isn't a known property of 'tr'. CommonModule and BrowserModule are imported<p>Really odd problem. I'm getting an error when I try to use *ngFor on a tr element:</p>
<pre><code><table>
<tbody>
<tr *ngFor="let item of productsData">
<!-- some Code -->
<... | <p>Looks like you're not importing the child module in your AppModule.</p> | Can't bind to 'ngForOf' since it isn't a known property of 'tr'. CommonModule and BrowserModule are imported | angular | -1 | 47 | 1 | 72,881,264 | 72,881,264 | 0 | true | 2022-07-06T09:18:52.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't bind to 'ngForOf' since it isn't a known property of 'tr'. CommonModule and BrowserModule are imported<p>Really odd problem. I'm getting an error when ... |
72,885,087 | How to transform panda dataframe based on date and name<p>I'm trying to transform a dataframe without but haven't achieved my desired output, would appreciate some help:</p>
<p>Input data:</p>
<pre><code>date name value
2022-07-01 Anna 5
2022-07-01 Jim 3
2022-04-29 Anna 4
2022-04-29 Jim ... | <p>Calculate new binary column to check whether the day is included, then pivot, then concat all selected day differences.</p>
<pre><code>days_select = [30, 60, 365]
pd.concat([df.assign(in_last_n_days=(pd.Timestamp.today() - df.date) < pd.Timedelta(f"{ndays}d"))
.query("in_last_n_days&qu... | How to transform panda dataframe based on date and name | python|pandas|pivot|transform | 0 | 47 | 3 | 72,885,368 | 72,885,368 | 0 | true | 2022-07-06T14:12:05.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to transform panda dataframe based on date and name<p>I'm trying to transform a dataframe without but haven't achieved my desired output, would appreciat... |
72,888,093 | C# Drawing (paint)<p>I'm developing an application which is basically drawing geo data.
I have DataSets implemented which holds all sorts of data including coordinates.
I'm using conversion from cartesian to screen in order for them to appear correctly on the screen.
I am using WinForms and paint event.</p>
<p>However,... | <p>A simple optimization is not invoke <code>Invalidate</code> on each mouse move. I suppose you need show information under cursor. In that case, you can wait until cursor is stopped: save time and mouse position and, after some time (1 second, for example) if mouse position si the same, then invalidate.
Is the same a... | C# Drawing (paint) | c#|winforms|optimization|geometry|paint | -1 | 47 | 1 | 72,890,561 | 72,890,561 | 0 | true | 2022-07-06T18:05:05.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Drawing (paint)<p>I'm developing an application which is basically drawing geo data.
I have DataSets implemented which holds all sorts of data including c... |
72,896,789 | Xamarin app crashing because of missing constructor in FormsEditText<p>Our xamarin app crashes sometimes with the following exceptions:</p>
<p>System.NotSupportedException: 'Unable to activate instance of type Xamarin.Forms.Platform.Android.FormsEditText from native handle 0xffce196c (key_handle 0xf8c2ea1).</p>
<p>Syst... | <p>The workaround in our app looks like this.</p>
<pre><code>public class CustomEntryRenderer : EntryRenderer
{
public CustomEntryRenderer(Context context) : base(context)
{
}
protected override FormsEditText CreateNativeControl()
{
return new CustomFormsEditText(Context);
}
}
public c... | Xamarin app crashing because of missing constructor in FormsEditText | c#|android|xamarin|xamarin.forms | 1 | 47 | 1 | 72,896,790 | 72,896,790 | 0 | true | 2022-07-07T11:12:04.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xamarin app crashing because of missing constructor in FormsEditText<p>Our xamarin app crashes sometimes with the following exceptions:</p>
<p>System.NotSupp... |
72,903,308 | PHP email form not showing input data<p>So, I am new to PHP and I followed a tutorial to make an email form for my website. I had to alter a few things, and the form is mostly working but for some reason when you submit the form it is only emailing the message and nothing else.</p>
<p>It redirects fine, but the name &a... | <p>You are only sending the message field in the email body</p>
<pre><code>mail($recipient_email, $subject, $message, $header);
</code></pre>
<p>You need to include the other information</p>
<pre><code>$body = $message . "\n" . $contact_name . "\n" . $contact_email;
mail($recipient_email, $subject, ... | PHP email form not showing input data | php|html|forms | -1 | 47 | 1 | 72,905,109 | 72,905,109 | 0 | true | 2022-07-07T19:32:46.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP email form not showing input data<p>So, I am new to PHP and I followed a tutorial to make an email form for my website. I had to alter a few things, and ... |
72,864,506 | How to adjust the time in a trend object in Codesys?<p>I have a trend object which takes the time of the Raspberry Pi. In my project I take the time of the main board and now the time of the trend object, the date range selection and the time displayed on the screen are different. My question is how do I set the time o... | <p>I tried the trick with the restarting of the Raspberry Pi, but I found out that the time of the trend is only set once when you first flash the project to the Raspberry Pi. So you would have to manage the time of the plot by your own to synchronize it with the main board time.</p> | How to adjust the time in a trend object in Codesys? | codesys|structured-text|iec61131-3 | 0 | 47 | 1 | 72,908,168 | 72,908,168 | 0 | true | 2022-07-05T05:47:39.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to adjust the time in a trend object in Codesys?<p>I have a trend object which takes the time of the Raspberry Pi. In my project I take the time of the m... |
72,908,935 | Replace all text between brackets Java<p>I have String</p>
<pre><code>String test = "
test_one {
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
}
test_two {
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
}
test_three {
... | <p>We can do a regex replacement with dot all mode enabled:</p>
<pre class="lang-java prettyprint-override"><code>String test = "test_one {\nLorem Ipsum is simply dummy text of the printing and typesetting industry.\n}\ntest_two {\nLorem Ipsum is simply dummy text of the printing and typesetting industry.\n}\n\nte... | Replace all text between brackets Java | java|string|replace | 0 | 47 | 1 | 72,909,092 | 72,909,092 | 0 | true | 2022-07-08T08:50:17.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace all text between brackets Java<p>I have String</p>
<pre><code>String test = "
test_one {
Lorem Ipsum is simply dummy text of the printin... |
72,910,797 | Padding inside a div<p>I am new to HTML and CSS and have created a birthday card which I want to have a 50/50 split down the centre . I have inserted my image on the left however when I add text to the right and side it is too close to the centre line, so I have used some padding (padding-left: 50px;) to move it furth... | <p>Try this</p>
<pre><code> .card {
box-sizing: border-box;
width: 600px;
height: 400px;
border: 5px solid;
display: flex;
}
.left {
background-image: url("https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/golden-retriever-royalty-free-image-506756303-1560962726.jpg");... | Padding inside a div | html|css | 0 | 47 | 1 | 72,911,226 | 72,911,226 | 0 | true | 2022-07-08T11:35:20.317Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Padding inside a div<p>I am new to HTML and CSS and have created a birthday card which I want to have a 50/50 split down the centre . I have inserted my ima... |
72,888,131 | Snakemake: Expand Incorrectly Defining Output Folders<p>I have a workaround based upon <a href="https://stackoverflow.com/questions/72776216/snakemake-mismatched-wildcards-variable-values-for-output-rule">this discussion</a>, so I don't think this problem is especially urgent.</p>
<p>However, before applying code to a ... | <p>I am still curious what caused the earlier problem.</p>
<p>However, if somebody else encounters the same problem, then I do have a workaround.</p>
<p>The details are in the following post:</p>
<p><a href="https://stackoverflow.com/questions/72776216/snakemake-mismatched-wildcards-variable-values-for-output-rule">Sna... | Snakemake: Expand Incorrectly Defining Output Folders | python|wildcard|directory-structure|snakemake|expand | 0 | 47 | 1 | 72,914,161 | 72,914,161 | 0 | true | 2022-07-06T18:08:44.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Snakemake: Expand Incorrectly Defining Output Folders<p>I have a workaround based upon <a href="https://stackoverflow.com/questions/72776216/snakemake-mismat... |
72,916,185 | How to set a multipartfile parameter as "not required" in java with spring boot?<p>my problem is that I have a controller developed in Java with Spring Boot in which I edit "Portfolio" entities. Here I get the different attributes to edit this entity and also an image. My idea is that if I receive the empty p... | <p>Try <code>@RequestParam(required = false)</code> (no need for the name to be specified with the value param, because spring takes the variable name by default and in your case they're the same)</p>
<p>You're method definition would look like this:</p>
<pre class="lang-java prettyprint-override"><code>@PutMapping(&qu... | How to set a multipartfile parameter as "not required" in java with spring boot? | java|spring|spring-boot | 0 | 47 | 1 | 72,916,515 | 72,916,515 | 0 | true | 2022-07-08T19:31:25.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set a multipartfile parameter as "not required" in java with spring boot?<p>my problem is that I have a controller developed in Java with Spring Boot ... |
72,918,452 | I need a way to calculate time differentials between 2 time variables in Batch<p>first of all here's my little batch script project that I wrote really quickly for video processing convenience with ffmpeg</p>
<pre><code>set start="00:01:52.000"
set finish="00:01:52.000"
set /A duration=24
set /A res... | <pre><code>@ECHO OFF
SETLOCAL
set "start=00:01:52.681"
set "finish=00:02:33.167"
FOR /f "tokens=1-4delims=:." %%g IN ("%start%") DO SET /a s_hr=1%%g,s_mn=1%%h,s_ss=1%%i,s_ms=1%%j
FOR /f "tokens=1-4delims=:." %%g IN ("%finish%") DO SET /a f_hr=1%%g,f_mn=1%%h,f... | I need a way to calculate time differentials between 2 time variables in Batch | batch-file|ffmpeg | 0 | 47 | 2 | 72,918,675 | 72,918,675 | 0 | true | 2022-07-09T02:12:52.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I need a way to calculate time differentials between 2 time variables in Batch<p>first of all here's my little batch script project that I wrote really quick... |
72,918,855 | How do I add to existing data with findByIdAndUpdate instead of updating the data entirely<p>This is my object schema</p>
<pre><code>var Message = mongoose.model('Message', {
name: String,
message: String,
votes: Number
})
</code></pre>
<p>I am trying to update the number of votes like this</p>
<pre><code>... | <p>Consider using the <code>$inc</code> property to increment the value of <code>votes</code> rather than overwrite it.</p>
<pre class="lang-js prettyprint-override"><code>Message.findByIdAndUpdate(req.params.id, { $inc: { votes: req.body.votes } })
</code></pre> | How do I add to existing data with findByIdAndUpdate instead of updating the data entirely | javascript|node.js|rest|mongoose|put | 0 | 47 | 1 | 72,918,883 | 72,918,883 | 0 | true | 2022-07-09T04:01:56.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add to existing data with findByIdAndUpdate instead of updating the data entirely<p>This is my object schema</p>
<pre><code>var Message = mongoose.m... |
72,917,932 | Working on a SMA type cross of a candle but the single is showing over and over<p>I am running into an issue while creating a cross but the cross is on a candle Close. I got that part pretty much ok'ish, but the label continues to be over each and every candle that is either above or below where the line has crossed.</... | <p>You can use crossover instead of cross to get signal only when crossover occurs Also you can track current pos in a variable and based on that you can close open long position</p>
<pre><code>//@version=5
indicator("Matrix test", overlay = true)
WVMA1 = ta.vwma(close, 30)
var currentpos=0
openlong = ta.cro... | Working on a SMA type cross of a candle but the single is showing over and over | pine-script|pinescript-v5 | 0 | 47 | 1 | 72,918,955 | 72,918,955 | 0 | true | 2022-07-08T23:41:15.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Working on a SMA type cross of a candle but the single is showing over and over<p>I am running into an issue while creating a cross but the cross is on a can... |
72,918,940 | How to convert two rows of data into a single row<p>I want convert below data into one Using pandas</p>
<p>Orginal data</p>
<pre><code>ID Name m1 m2 m3
1 X 2 6 6
1 Y 1 2 3
2 A 2 4 7
2 y 5 6 7
</code></pre>
<p>I want To covert into below format using pandas libray</p>
<pre><code>ID Name1 m1 m2 m3... | <p>Let's assume this is your data:</p>
<pre><code>data = {'ID':[1, 1, 2, 2],
'Name':['X', 'Y', 'A', 'y'],
'm1':[2, 1, 2, 5], 'm2':[6,2,4,6],
'm3':[6, 3, 7, 7] }
df = pd.DataFrame(data)
</code></pre>
<p>Step 1: Sort the data by ID:</p>
<pre><code>df = df.sort_values(by=['ID'])
</code></pre>
<p>S... | How to convert two rows of data into a single row | python|pandas | 0 | 47 | 1 | 72,919,177 | 72,919,177 | 0 | true | 2022-07-09T04:27:25.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert two rows of data into a single row<p>I want convert below data into one Using pandas</p>
<p>Orginal data</p>
<pre><code>ID Name m1 m2 m3
1 X... |
72,920,069 | How many times a string containes in substring - JavaScript<p>I have an array:</p>
<pre><code>var textWord = [ 'FORTWO', 'ELECTRIC' ];
</code></pre>
<p>and a json object:</p>
<pre><code>var modelsList = {
'FOR FOUR' : null,
'FOR FOUR DIESEL' : null,
'FOR FOUR EV' : null,
'FORTWO CABRIO ELECTRIC DRIVE' :... | <p>You can check for current value at that time, If there is a value other than <code>null</code> then you can <code>increment</code> it else put <code>1</code> inplace of current value</p>
<p>Either use this</p>
<pre><code>modelsList[modelsListText] = (modelsList[modelsListText] ?? 0) + 1;
</code></pre>
<p>or</p>
<pre... | How many times a string containes in substring - JavaScript | javascript|node.js | 0 | 47 | 3 | 72,920,099 | 72,920,099 | 0 | true | 2022-07-09T08:45:51.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How many times a string containes in substring - JavaScript<p>I have an array:</p>
<pre><code>var textWord = [ 'FORTWO', 'ELECTRIC' ];
</code></pre>
<p>and a... |
72,923,287 | Calculating a column's values based on previous row and a conditional<p>I would like to use the following example pseudocode/calculation on a dataframe, where the calculation needs to conditionally use a previous row value. I think I could do this using <code>apply()</code>but is there a fast vectorised solution?</p>
<... | <p>You can use <code>np.where</code></p>
<pre class="lang-py prettyprint-override"><code>df['result'] = np.where(df['data'] > 10, df['data'] * 2 - df['result'].shift(1), df['result'].shift(1))
</code></pre> | Calculating a column's values based on previous row and a conditional | python|pandas|dataframe | -1 | 47 | 1 | 72,923,323 | 72,923,323 | 0 | true | 2022-07-09T17:08:19.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculating a column's values based on previous row and a conditional<p>I would like to use the following example pseudocode/calculation on a dataframe, wher... |
72,924,364 | python: how to check if a str is available in a text file with in an if statement<p>what I am trying to do is add a string only if not available in a text file
The problem is I can't read the content of the text file within an if statement</p>
<pre><code>import random
import time
def random_srting(length=1):
digit... | <p>Store the file contents in a set, and then you don't need to re-read the file each time you add a word:</p>
<pre><code>import random
def random_string(length):
return ''.join(random.choices(
'abcdefghijklmnopqrstuvwxyz1234567890._',
k=length
))
with open('4LWordList.txt') as f:
words = ... | python: how to check if a str is available in a text file with in an if statement | python|if-statement|text-files | -1 | 47 | 2 | 72,924,615 | 72,924,615 | 0 | true | 2022-07-09T20:19:03.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python: how to check if a str is available in a text file with in an if statement<p>what I am trying to do is add a string only if not available in a text fi... |
72,925,451 | How to Move Terrain to Another Unity Project File?<p>How can I import terrains onto another Unity project? I am new to developing on Unity.</p>
<p>I would like to place this terrain...
<a href="https://i.stack.imgur.com/QFIhM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QFIhM.jpg" alt="enter image... | <p>Import Terrain Data and replace missing textures within Terrain Layers.</p> | How to Move Terrain to Another Unity Project File? | unity3d|game-development|terrain|unity3d-terrain | 0 | 47 | 1 | 72,925,517 | 72,925,517 | 0 | true | 2022-07-10T00:23:41.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Move Terrain to Another Unity Project File?<p>How can I import terrains onto another Unity project? I am new to developing on Unity.</p>
<p>I would li... |
72,925,933 | How to hide element with style in angular<p>I'm new in angular and I want to make something like:</p>
<p><code>document.getElementById('div').style.display = 'none';</code></p>
<p>but I have an error
<a href="https://i.stack.imgur.com/3thsl.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>I alread... | <p>I think you can try this solution</p>
<pre><code>showModal() {
const div = document.getElementById('modal');
if(div) {
div.style.display = 'none'
}
}
</code></pre> | How to hide element with style in angular | javascript|css|node.js|angular|sass | 0 | 47 | 4 | 72,925,971 | 72,925,971 | 0 | true | 2022-07-10T03:20:56.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide element with style in angular<p>I'm new in angular and I want to make something like:</p>
<p><code>document.getElementById('div').style.display =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.