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,213,090 | How to load a placeholder image then toggle to the real one once HTTP calls are done?<p>I'm currently working on a project with a particularly large gif file on the page.</p>
<p>I'd like to be able to load something much smaller, like a static image or perhaps even just a colored div, while the gif is loading to improv... | <p>Assume we have a big local image <code>tasty.jpg</code> (huge 4k pizza) and a small one with ducks, here is how to make a simple swap between both while using the <code>fetch()</code> hook.</p>
<pre class="lang-html prettyprint-override"><code><template>
<div>
<img
:src="require(`~/as... | How to load a placeholder image then toggle to the real one once HTTP calls are done? | css|nuxt.js | -2 | 75 | 2 | 72,214,412 | 72,214,412 | 1 | true | 2022-05-12T09:24:41.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load a placeholder image then toggle to the real one once HTTP calls are done?<p>I'm currently working on a project with a particularly large gif file... |
72,215,238 | Why am I getting error of 'android.widget.EditText com.google.android.material.textfield.TextInputLayout.getEditText()' on a null object reference<p>I have seen many forums related to this question but nothing resolved my issue. I hope I get it here.</p>
<p>Here is my Activity Code</p>
<pre><code>public class addIndivi... | <p>In your onCreate(), you are initialising you view views before setting view. Your onCreate should look like this:</p>
<pre><code>protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_individual);
db=FirebaseFirestore.getInstance();
... | Why am I getting error of 'android.widget.EditText com.google.android.material.textfield.TextInputLayout.getEditText()' on a null object reference | java|android|android-textinputlayout | -2 | 47 | 1 | 72,215,437 | 72,215,437 | 1 | true | 2022-05-12T12:04:54.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why am I getting error of 'android.widget.EditText com.google.android.material.textfield.TextInputLayout.getEditText()' on a null object reference<p>I have s... |
72,215,218 | How can I create a hover div?<p>If you go to <a href="https://www.handy.com/" rel="nofollow noreferrer">https://www.handy.com/</a> and hover over the All Services link, you'll be able to see a overlay with a bunch of categories.</p>
<p>How can I do this so that it's SEO friendly?</p>
<p>See image attached</p>
<p><a hre... | <p>I would structure it like this, which in my opinion would be the most semantically correct. Just because everything is wrapped in a <code><div></code>, it doesn't mean it doesn't have semantic value. As long as the child elements have the proper HTML-structuring it's fine.</p>
<p><div class="snippet" data-lang... | How can I create a hover div? | javascript|html|css | -2 | 53 | 1 | 72,215,566 | 72,215,566 | 1 | true | 2022-05-12T12:02:35.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a hover div?<p>If you go to <a href="https://www.handy.com/" rel="nofollow noreferrer">https://www.handy.com/</a> and hover over the All Ser... |
72,217,071 | PHP Array split string and Integers<p>Below is an array of strings and numbers. How could the string and number values be split into separate arrays (with <strong>strings in one array</strong> and <strong>numbers in another array</strong>)?</p>
<pre><code>array('a','b','c',1,2,3,4,5,'t','x','w')
</code></pre> | <p>Loop through them, check if is_numeric and add to appropriate array:</p>
<pre><code>$original = array('a','b','c',1,2,3,4,5,'t','x','w');
$letters = array();
$numbers = array();
foreach($original as $element){
if(is_numeric($element)){
$numbers[] = $element;
}else{
$letters[] = $element;
... | PHP Array split string and Integers | php|arrays | -2 | 145 | 4 | 72,217,136 | 72,217,136 | 1 | true | 2022-05-12T14:03:59.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Array split string and Integers<p>Below is an array of strings and numbers. How could the string and number values be split into separate arrays (with <s... |
72,207,408 | How can I make controls in WPF stretch to fill available width when HorizontalAlignment and HorizontalContentAlignment don't work?<p>I'm trying to make a simple WPF app that has sections that fill the available width. Despite trying various ways of stretching the width of elements, containers, and children, nothing is ... | <p><code>StackPanel</code> with Orientation="Vertical" (default value) instead of <code>WrapPanel</code> should work: it will allow each child element use full width and as much height as necessary</p> | How can I make controls in WPF stretch to fill available width when HorizontalAlignment and HorizontalContentAlignment don't work? | c#|wpf | -2 | 84 | 1 | 72,217,620 | 72,217,620 | 1 | true | 2022-05-11T20:45:19.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make controls in WPF stretch to fill available width when HorizontalAlignment and HorizontalContentAlignment don't work?<p>I'm trying to make a sim... |
72,217,738 | CSS - How can I divide a list <li> in 3 columns using li:nth-child?<p>There are 6 elements and I want them to be something like that:</p>
<pre><code> - First - Third - Fifth
- Second - Fourth - Sixth
</code></pre>
<p>I tried something like this:</p>
<pre><code>li:nth-child(6n+1) {
float: left;
wi... | <p>You can use CSS grid like below:</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-css lang-css prettyprint-override"><code>ul {
display: grid;
list-style: none;
grid-auto-flow: column;
grid-template-rows: ... | CSS - How can I divide a list <li> in 3 columns using li:nth-child? | html|css|css-selectors | -2 | 73 | 2 | 72,218,210 | 72,218,210 | 1 | true | 2022-05-12T14:48:40.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS - How can I divide a list <li> in 3 columns using li:nth-child?<p>There are 6 elements and I want them to be something like that:</p>
<pre><code> - First... |
72,217,877 | Typescript error message ',' expected.ts(1005)<p>I keep getting the error message ',' expected.ts(1005) when trying to dynamically render a modal on Typescript. I'm almost certainly missing a closing curly bracket somewhere but cant figure out where.</p>
<pre><code> `<div class="modalWrap">
... | <p>Less of an answer than a rant with good intentions.</p>
<p>This code is illegible, and because of that, finding the missing backtick is extremely tedious. Here's how to make it less awful. <sup>* <em>Edited for brevity.</em></sup></p>
<p><strong>Step 1: Indent. We're not savages.</strong></p>
<p>This step alone is e... | Typescript error message ',' expected.ts(1005) | javascript|typescript | -2 | 377 | 2 | 72,218,380 | 72,218,380 | 1 | true | 2022-05-12T14:58:55.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript error message ',' expected.ts(1005)<p>I keep getting the error message ',' expected.ts(1005) when trying to dynamically render a modal on Typescr... |
72,220,624 | How to divide the output of Markdown in two lines?<p>I am trying to get the OS and CPU version and for that I use the following command in Rmarkdown</p>
<pre><code>uname -an
</code></pre>
<p>To which it gives me a very long output (Darwin MacBook-Air-de-Julio.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47... | <p>The simple way to divide it roughly in half at the date is to replace <code>": "</code> with <code>'\n'</code> using <code>sed</code>, e.g.</p>
<pre class="lang-none prettyprint-override"><code>$ uname -an | sed 's/: /\n/'
Darwin MacBook-Air-de-Julio.local 21.4.0 Darwin Kernel Version 21.4.0
Fri Mar 18 00:... | How to divide the output of Markdown in two lines? | bash|r-markdown | -2 | 48 | 1 | 72,220,778 | 72,220,778 | 1 | true | 2022-05-12T18:40:03.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to divide the output of Markdown in two lines?<p>I am trying to get the OS and CPU version and for that I use the following command in Rmarkdown</p>
<pre... |
72,220,760 | how can i check that a json file already has something inside?<p>I have this json file where it contains a name and a code:</p>
<pre class="lang-json prettyprint-override"><code>{
"CDIA": [
{
"name": "Pablo",
"cdia": "XB&DE@E+TY"
... | <p>Combining all of my suggestions:</p>
<pre><code>cdia = open('CDIA.json', 'r')
data = json.load(cdia)
def Check(x):
for i in data['CDIA']:
if x == i['name']:
return True
return False
name = input('[?] Enter your name: ')
if Check(name):
print('[!] The name is already registered.')
el... | how can i check that a json file already has something inside? | python|json | -2 | 21 | 1 | 72,220,833 | 72,220,833 | 1 | true | 2022-05-12T18:53:21.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can i check that a json file already has something inside?<p>I have this json file where it contains a name and a code:</p>
<pre class="lang-json prettyp... |
72,224,056 | Do not close window after clicking 'X' button?<p>I want to show a dialog when users click the <code>X</code> button to close the browser's window. In the dialog, it will ask users if they want to proceed with closing or not, if users choose <code>no</code>, it won't close the window.</p>
<p>I am wondering how to achiev... | <p>[https://stackoverflow.com/questions/2923139/prompt-user-before-browser-close]</p>
<p>this is the basic way to do
but prompt will be always the same</p>
<pre><code>window.onbeforeunload = function(evt) {
return true;
}
</code></pre> | Do not close window after clicking 'X' button? | javascript|html|dom-events | -2 | 156 | 1 | 72,224,096 | 72,224,096 | 1 | true | 2022-05-13T03:11:59.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do not close window after clicking 'X' button?<p>I want to show a dialog when users click the <code>X</code> button to close the browser's window. In the dia... |
72,229,592 | How to convert String to Generics in java<p>I have a class similar to this:</p>
<pre><code>public class Car<T> {
private T model;
private CarBodyParts body;
}
</code></pre>
<pre><code>public class CarBodyParts {
private Integer carWidth;
private Integer carHeight;
}
</code></pre>
<pre><code>public c... | <p>You can use <a href="https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.13.2.2" rel="nofollow noreferrer">Jackson</a> library to convert the string to class.
Add the below dependency to your project</p>
<pre><code><dependency>
<groupId>com.fasterxml.jackson.core</grou... | How to convert String to Generics in java | java|generics | -2 | 58 | 1 | 72,230,215 | 72,230,215 | 1 | true | 2022-05-13T12:26:39.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert String to Generics in java<p>I have a class similar to this:</p>
<pre><code>public class Car<T> {
private T model;
private CarBody... |
72,233,795 | How to filter out rows that do not fit specified condition in R<p>I have this data frame:</p>
<pre><code>df <- data.frame (ID = c(1:20),
Ethnicity = c(rep(c("White", "Asian", "Black", "Hispanic", "Other"), times=20/5)),
Age = c(1:... | <p>In addition to PaulS's tidyverse/dplyr solution, here's how you can filter out rows using base R.</p>
<pre><code>df[df$Ethnicity != "Asian",]
#> ID Ethnicity Age Set
#> 1 1 White 1 1
#> 3 3 Black 3 3
#> 4 4 Hispanic 4 4
#> 5 5 Other 5 1
#> 6 6 ... | How to filter out rows that do not fit specified condition in R | r|tidyverse|data-wrangling | -2 | 71 | 1 | 72,234,150 | 72,234,150 | 1 | true | 2022-05-13T18:06:08.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to filter out rows that do not fit specified condition in R<p>I have this data frame:</p>
<pre><code>df <- data.frame (ID = c(1:20),
... |
72,236,686 | Javascript: check multiple elements in array<p>I have an array: <code>a=[10,11,12,13]</code>. How can check elements from a[0] to a[2] if they >0 in the shortest way and don't use for loop? Does anyone have any ideas? Thank you.</p> | <p>You can <code>slice</code> the array to get the items within the specified indexes, then use <code>filter</code> to filter out the items that don't match the condition and check whether the length of the resulting array is the length of the range.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-con... | Javascript: check multiple elements in array | javascript|arrays|element | -2 | 45 | 1 | 72,236,695 | 72,236,695 | 1 | true | 2022-05-14T01:25:18.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript: check multiple elements in array<p>I have an array: <code>a=[10,11,12,13]</code>. How can check elements from a[0] to a[2] if they >0 in the s... |
72,221,610 | If value is greater than the previous replace with previous in Pandas<p>I am working on a data processing script that does some basic calcs from data files and sorts the data. The last piece to the puzzle is identifying if the next value is > the previous and if it is replace the next value with the previous.</p>
<p... | <p>I was able to solve my question pretty simply.</p>
<pre><code>df['min z'] = df5['Minimum Z'].expanding().apply(min)
df = df5.drop(columns=['Minimum Z'])
</code></pre>
<p>Which outputs:</p>
<pre><code> Date min z
0 2020-06-30 6550.000000
1 2020-07-31 6550.000000
2 2020-08-31 6550.000000
3 202... | If value is greater than the previous replace with previous in Pandas | python|pandas | -2 | 81 | 2 | 72,262,615 | 72,262,615 | 1 | true | 2022-05-12T20:15:01.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If value is greater than the previous replace with previous in Pandas<p>I am working on a data processing script that does some basic calcs from data files a... |
72,165,862 | whats the difference between those links?<p>link 1 = <a href="https://website.com/" rel="nofollow noreferrer">https://website.com/</a> %D7%9C%D7%99%D7%9E%D7%95%D7%93%D7%99%D7%9D</p>
<p>link 2 = <a href="https://website.com/q.aspx?q=" rel="nofollow noreferrer">https://website.com/q.aspx?q=</a> %D7%9C%D7%99%D7%9E%D7%95%D... | <pre><code>Link1 : https://website.com/<abc>
</code></pre>
<blockquote>
<p>Here <abc> is generally considered the sub-category of the hierarchy of the website in the URL.<br> For ex : <a href="https://website.com/user/settings" rel="nofollow noreferrer">https://website.com/user/settings</a></p>
</blockquote... | whats the difference between those links? | asp.net|hyperlink|.aspxauth | -2 | 60 | 1 | 72,165,934 | 72,165,934 | 1 | true | 2022-05-08T23:59:03.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
whats the difference between those links?<p>link 1 = <a href="https://website.com/" rel="nofollow noreferrer">https://website.com/</a> %D7%9C%D7%99%D7%9E%D7%... |
72,149,191 | count how many people who buy the same item at second time and how many people who did not buy the second item at second time (compare to firsttime)<p>Here is the question:count how many people who buy the same item at second time and how many people who did not buy the second item at second time (compare to <code>buyi... | <p>Its not a hugely clear question. I would also raises questions why you even have the buying_order column, as it really doesn't seem to add value, you already have a row per user and item and also a date!</p>
<p>You could simply do this to count the orders, again ignoring the buying_order column altogether</p>
<pre><... | count how many people who buy the same item at second time and how many people who did not buy the second item at second time (compare to firsttime) | sql-server | -2 | 94 | 1 | 72,149,971 | 72,149,971 | 1 | true | 2022-05-07T03:10:37.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
count how many people who buy the same item at second time and how many people who did not buy the second item at second time (compare to firsttime)<p>Here i... |
72,226,629 | it says i have errors but there are no errors<p>I have tried to run the program with more than one inheritance i got many errors
For this program ,but when i use it for Source File, it will looks good</p>
<p>I don't know why but I think because i update my version or does make any sense</p>
<p>please help me with my pr... | <p>In <code>shape2d.h</code> and <code>shape3d.h</code> with have to add</p>
<pre><code>#include "shape.h"
</code></pre>
<p>In <code>square.h</code> and <code>triangle.h</code> with have to add</p>
<pre><code>#include "shape2d.h"
</code></pre>
<p>In <code>sphere.h</code> and <code>cylinder.h</code> ... | it says i have errors but there are no errors | c++ | -2 | 45 | 1 | 72,226,953 | 72,226,953 | 1 | true | 2022-05-13T08:32:26.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
it says i have errors but there are no errors<p>I have tried to run the program with more than one inheritance i got many errors
For this program ,but when i... |
72,074,694 | PHP Regex capture repeated children as groups inside parent pattern<p>I want to capture a repeated values wrapped by parentheses within parents.</p>
<pre><code>(parent (foo 25) (bar 500) (child (100 10) (300 20) (400 30)))
(parent (foo 80) (bar 130) (child (200 15)))
</code></pre>
<p>knowing every child can contain one... | <p>Assuming the elements <code>(100 10)</code> would only occur as children, then a regex find all approach might be viable here:</p>
<pre class="lang-php prettyprint-override"><code>$input = "(parent (foo 25) (bar 500) (child (100 10) (300 20) (400 30)))";
$input = preg_replace("/\(parent (?:\((?!\bchil... | PHP Regex capture repeated children as groups inside parent pattern | php|regex | -2 | 34 | 1 | 72,074,733 | 72,074,733 | 1 | true | 2022-05-01T07:10:26.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Regex capture repeated children as groups inside parent pattern<p>I want to capture a repeated values wrapped by parentheses within parents.</p>
<pre><co... |
72,172,636 | Remove all characters in a string after the last ocurrence of a pattern in R<p>I want to remove all the characters after the last ocurrence of a specific pattern in a string, in R.</p>
<p>For example:</p>
<p><code>string = "asdsads dfdsfd>x 442 /<sdasvre (geqwe) ge ge ge regthyty "</code></p>
<p>I would... | <p>You can use a capture group to capture all strings before the last "ge" (<code>^(.*ge)</code>), and replace that whole thing with that capture group (<code>\\1</code>).</p>
<pre><code>sub('^(.*ge).+$', '\\1', string)
[1] "asdsads dfdsfd>x 442 /<sdasvre (geqwe) ge ge ge"
</code></pre> | Remove all characters in a string after the last ocurrence of a pattern in R | r|substring|extract | -2 | 46 | 2 | 72,172,775 | 72,172,775 | 1 | true | 2022-05-09T13:18:04.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove all characters in a string after the last ocurrence of a pattern in R<p>I want to remove all the characters after the last ocurrence of a specific pat... |
72,164,697 | Git: pulling colleague's feature branch<p>Git beginner here. My colleague is going on holiday and I've to pick up (and finish and merge to master) his work in his absence. He has his feature branch (call it his_branch) with all his work. He cannot merge it to master as the changes are not complete yet and will break st... | <p>You can get the changes from his branch with git-cherry-pick that applies the changes introduced by some existing commits.</p>
<p>You can check the commit number from his branch and then use the following in terminal:</p>
<ul>
<li>git checkout your_branch_name (move to your branch)</li>
<li>git cherry-pick his_commi... | Git: pulling colleague's feature branch | git | -2 | 27 | 1 | 72,164,774 | 72,164,774 | 1 | true | 2022-05-08T20:02:43.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git: pulling colleague's feature branch<p>Git beginner here. My colleague is going on holiday and I've to pick up (and finish and merge to master) his work i... |
72,208,811 | else: IndentationError: unexpected unindent<p>Can someone explain why else is getting IndentationError: unexpected unindent while i try to work further on my if else loop.</p>
<p>Basicly am working on a port scanner project where i need to get some user input where out of this user input, i will specify how many ports ... | <p>I’d have to say it’s that you’ve got an else in between your except statements, separating it from the try… right?
Try something like this maybe</p>
<pre><code>input = input("1 or 2")
if input == '1':
try:
for port in range(1,65535):
s = socket.socket(socket... | else: IndentationError: unexpected unindent | python|port | -2 | 89 | 2 | 72,208,853 | 72,208,853 | 1 | true | 2022-05-12T00:06:25.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
else: IndentationError: unexpected unindent<p>Can someone explain why else is getting IndentationError: unexpected unindent while i try to work further on my... |
72,209,292 | python facing problems writing for loop logic when I have multiple items in my list<p>My for loop working when I have only one item in my list. see the code below:</p>
<pre><code>remove_month_year = ["apple","banana"]
for remove_m_y in remove_month_year:
if remove_m_y not in time_posted: #I w... | <p>It’s iterating over the array with one variable at a time, so imo you could either add a Boolean value which is changed upon one being present, followed by a conditional after the loop to check that Boolean value, or a more efficient way would be</p>
<pre><code>
remove_month_year = ["apple","banana&qu... | python facing problems writing for loop logic when I have multiple items in my list | python|list | -2 | 36 | 1 | 72,209,357 | 72,209,357 | 1 | true | 2022-05-12T01:53:10.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python facing problems writing for loop logic when I have multiple items in my list<p>My for loop working when I have only one item in my list. see the code ... |
72,195,345 | Need to know if a sphere intersects with cube using python code...?<p>I am developing a code in python to check whether a sphere having a center at (x, y, z) coordinates and with radius R, intersects the cube of dimension one, i.e., l = 1, b = 1, h = 1. As mentioned above, I want to know if the sphere intersects the cu... | <p>To reveal a fact of intersection, you can calculate distance from cube to sphere center and compare it with sphere radius. <a href="https://stackoverflow.com/a/27615622/844416">2D case is described here</a>, it could be easily extended to 3D case.</p>
<p>Get cube center as <code>(rcx, rcy, rcz)</code> and find coord... | Need to know if a sphere intersects with cube using python code...? | python|math|geometry | -2 | 69 | 1 | 72,196,257 | 72,196,257 | 1 | true | 2022-05-11T04:14:53.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to know if a sphere intersects with cube using python code...?<p>I am developing a code in python to check whether a sphere having a center at (x, y, z)... |
72,144,090 | Receiving error: "error: static assertion failed: result type must be constructible from value type of input range" when constructing class vectors<p>I am trying to create a script that uses polymorphism to create a set of linking vectors within parent/child class structure. So far I have got the classes setup, but whe... | <p>Upcast to a base class is ill-formed if the inheritance is not public. i.e</p>
<pre><code>struct base {};
class derived : base {}; // private inheritance
int main(){
derived a;
auto & b = static_cast<base &>(a); // invalid
}
</code></pre>
<p>That's exactly what that last assignment expression ... | Receiving error: "error: static assertion failed: result type must be constructible from value type of input range" when constructing class vectors | c++|class|vector|polymorphism | -2 | 524 | 1 | 72,144,215 | 72,144,215 | 1 | true | 2022-05-06T15:37:35.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Receiving error: "error: static assertion failed: result type must be constructible from value type of input range" when constructing class vectors<p>I am tr... |
72,235,332 | How to get index of elements of string array?<p>I have the below data in a <code>String[] strArray</code></p>
<blockquote>
<p>1, 9, 3, 4, 16, 6, 7, 8, 2, 10, 11, 12, 13, 45</p>
</blockquote>
<p>I want to find the index of those elements that contain <code>3</code> (e.g:3,13). i.e I should have 3=str[2] and 13=str[12] w... | <p>Here is one way. Use the ternary operator <code>(?:)</code> to decide if the current string should be replaced with <code>Test</code> or the original value.</p>
<pre><code>String[] vals = { "1", "9", "3", "4", "16", "6", "7", "8",
... | How to get index of elements of string array? | collections|java-8|java-stream | -2 | 121 | 2 | 72,235,861 | 72,235,861 | 1 | true | 2022-05-13T20:54:42.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get index of elements of string array?<p>I have the below data in a <code>String[] strArray</code></p>
<blockquote>
<p>1, 9, 3, 4, 16, 6, 7, 8, 2, 10,... |
72,200,823 | combine three query and get specific error alert<p>how can i brief this queries?
i want to combine them but get specific error alert and different three variable</p>
<pre><code><?php
$sql = "SELECT content FROM post where title='tv'";
$sql2 = "SELECT content FROM post where title='radio'"... | <p>Using the <code>IN()</code> you can return only those rows with a title of 'tv', 'radio' and 'net'. Then add the <code>title</code> to the query selection so you know which results a re which.</p>
<p>Then just amend you code to fetch all the results into a rows array and then check for the entries and report errors ... | combine three query and get specific error alert | php|mysql | -2 | 38 | 2 | 72,201,042 | 72,201,042 | 1 | true | 2022-05-11T12:09:11.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
combine three query and get specific error alert<p>how can i brief this queries?
i want to combine them but get specific error alert and different three vari... |
72,148,782 | Is there a way to guarantee a certain number of lines detected with cv2.HoughLines()?<p>This question is an extension to my previous <a href="https://stackoverflow.com/q/72118551/15936471">question</a> asking about how to detect a pool table's corners. I have found the <a href="https://i.imgur.com/eKMm4PD.png" rel="nof... | <blockquote>
<p>Using @fana's comments, I have created a histogram of gradient directions with the code below. I'm still not entirely sure how to obtain four lines from this histogram.</p>
</blockquote>
<p>I tried a little.</p>
<p>Because I don't know python, following sample code is C++. However, what done are written... | Is there a way to guarantee a certain number of lines detected with cv2.HoughLines()? | python|opencv|image-processing|edge-detection|hough-transform | -2 | 115 | 1 | 72,198,317 | 72,198,317 | 1 | true | 2022-05-07T01:27:29.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to guarantee a certain number of lines detected with cv2.HoughLines()?<p>This question is an extension to my previous <a href="https://stackov... |
72,168,983 | AWK: How to get count of column couples?<p>I have a CSV file made of many <strong>couples</strong> of columns, each couple has <code>code_###</code> and <code>name_###</code>.</p>
<pre><code>code_boat|name_boat|year|code_color|name_color|code_size|name_size
1|jeanneau|2000|#00f|blue|5|small
2|bavaria|2005|#00f|blue|10|... | <p>Assumptions/Understandings:</p>
<ul>
<li>from OP's comments the actual data file is pipe-delimited with no leading/trailing spaces in fields (see modified input file - below)</li>
<li>output is to be generated in the same format (ie, pipe-delimited with no leading/trailing spaces in fields)</li>
</ul>
<p>Sample inpu... | AWK: How to get count of column couples? | awk | -2 | 72 | 3 | 72,174,073 | 72,174,073 | 1 | true | 2022-05-09T08:25:07.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWK: How to get count of column couples?<p>I have a CSV file made of many <strong>couples</strong> of columns, each couple has <code>code_###</code> and <cod... |
72,159,470 | Deep learning how to assign probability scores to the classes<p>I am running deep learning with <code>keras</code>. I need to assign probabilities to the predicted classes of a binary classification. The command <code>model.predict()</code> is providing an output which is an array consisting of a single column with pro... | <p>A DNN with sigmoid activation function in the last layer would give one array of probabilities, you can construct the class column by yourself:</p>
<pre><code>df["class_1_prob"]=predicted_prob
df["class_0_prob"]=1-predicted_prob
df["target_class_0"]=[0 if x <0.5 else 1 for x in pred... | Deep learning how to assign probability scores to the classes | python|keras | -2 | 61 | 1 | 72,160,168 | 72,160,168 | 1 | true | 2022-05-08T09:00:08.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deep learning how to assign probability scores to the classes<p>I am running deep learning with <code>keras</code>. I need to assign probabilities to the pre... |
72,151,739 | php increment nested arrray from list array by values<p>probably can not see something,
I got two arrays:</p>
<pre><code>$grid =
Array
(
[0] => 3
[1] => 2
[2] => 3
[3] => 2
)
$elements =
Array
(
[0] => 24426
[1] => 25015
... | <p>EDIT: Changed code slightly to meet required output format</p>
<p>Please consider this code.</p>
<pre><code>$grid = [3, 2, 3, 2];
$elements = [24426,25015,24422,24425,24531,24421,24530,24532,25016,24418];
$result = [];
foreach($grid as $take) {
$org_take = $take;
while($take-- > 0) {
if (empty($e... | php increment nested arrray from list array by values | php|arrays|multidimensional-array | -2 | 44 | 1 | 72,151,833 | 72,151,833 | 1 | true | 2022-05-07T10:44:00.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
php increment nested arrray from list array by values<p>probably can not see something,
I got two arrays:</p>
<pre><code>$grid =
Array
(
... |
72,219,532 | How to iterate through a nested dictionary and return the keys and values?<p>Say I have a nested dictionary like so:</p>
<pre><code>dict = ["{'model': 'network.customer', 'pk': 'C00001', 'fields': {'name': 'Valentino Solomon', 'latitude': 57.13514, 'longitude': -2.11731}}"
"{'model': 'network.customer',... | <p>Convert that dict into a list and make every entry a dict. Then just iterate through the list, put it in a dict and access it like you would every other dict.</p>
<pre><code>list: list = [{'model': 'network.customer', 'pk': 'C00001', 'fields': {'name': 'Valentino Solomon', 'latitude': 57.13514, 'longitude': -2.11731... | How to iterate through a nested dictionary and return the keys and values? | python | -2 | 45 | 1 | 72,220,852 | 72,220,852 | 1 | true | 2022-05-12T16:59:54.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to iterate through a nested dictionary and return the keys and values?<p>Say I have a nested dictionary like so:</p>
<pre><code>dict = ["{'model': '... |
72,172,311 | How to list total number of scholarships per department in SQL<p>I have 2 tables that look like this where I want to query how many scholarships (from Tuition table) each department (from Student table) has distributed:</p>
<p><a href="https://i.stack.imgur.com/Tb8zi.png" rel="nofollow noreferrer"><img src="https://i.s... | <p><strong>Create tables</strong></p>
<pre><code>create table students (
sid int auto_increment primary key,
name varchar(100),
email varchar(100),
department varchar(100)
);
create table tutions (
id int auto_increment primary key,
sid int,
cost int,
scholarships int,
duedate timestamp default curre... | How to list total number of scholarships per department in SQL | sql | -2 | 49 | 2 | 72,172,922 | 72,172,922 | 1 | true | 2022-05-09T12:51:07.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to list total number of scholarships per department in SQL<p>I have 2 tables that look like this where I want to query how many scholarships (from Tuitio... |
72,140,614 | If val variables are immutable how I was able to change its value?<pre><code>class Mobile(val company: String= "unknown", var model: String ="unknown") {
fun call(mobile: Mobile) = "Calling with ${mobile.model} from the company ${mobile.company}"
}
fun main()
{
val mobile = Mobile(&qu... | <p>Those values passed in the Mobile class are just default values as part of the declaration of the constructor of your Mobile class, those will be used if you don't provide any when instantiating the class. But since in you main you are instantiating the class with company="Samsung" and model="S10"... | If val variables are immutable how I was able to change its value? | kotlin | -2 | 35 | 1 | 72,140,787 | 72,140,787 | 2 | true | 2022-05-06T11:17:18.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If val variables are immutable how I was able to change its value?<pre><code>class Mobile(val company: String= "unknown", var model: String ="... |
72,150,768 | Trying to decode dynamic JSON response<p>I'm trying to decode the JSON response for all tags from the Pinboard API. I have a simple model I'd like to decode into:</p>
<pre><code> struct Tag: Coddle, Hashable {
let name: String
let count: Int
}
</code></pre>
<p>The problem is that the JSON respons... | <p>Your JSON can be decoded into a dictionary of type <code>[String: Int]</code>.</p>
<p>If you enter key and value of each entry of the dictionary into a <code>Tag</code> object, you can then sort the array of tags by <code>name</code>. Or you can sort the dictionary keys first, both work.</p>
<p>Catch: it will work <... | Trying to decode dynamic JSON response | swift | -2 | 49 | 1 | 72,151,187 | 72,151,187 | 2 | true | 2022-05-07T08:25:16.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to decode dynamic JSON response<p>I'm trying to decode the JSON response for all tags from the Pinboard API. I have a simple model I'd like to decode ... |
72,152,072 | Reading accounting information with regex<p><strong>Context</strong></p>
<p>In my daily job I lost a lot of time putting values in excel from a balance sheet manually, so I start learning how to code in python to speed up my work.</p>
<p><strong>Problem</strong></p>
<p>I am trying to create a regex that is able to dete... | <p>For the example data, you might use an approach with capture groups and for the <code>Value of account</code> create an optional group at the end of the pattern.</p>
<p>If you have more columns, you can extend the pattern.</p>
<p>When using code, you can check for the existence of the last optional group.</p>
<pre><... | Reading accounting information with regex | python|regex | -2 | 118 | 1 | 72,152,655 | 72,152,655 | 2 | true | 2022-05-07T11:33:20.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading accounting information with regex<p><strong>Context</strong></p>
<p>In my daily job I lost a lot of time putting values in excel from a balance sheet... |
72,154,980 | How to convert and cast an object list to an integer list?<p>Bellow code snippet errors with:</p>
<pre><code> "Type mismatch: cannot convert from element type Object to Integer".
</code></pre>
<hr />
<pre><code>public static List<Integer> quickSort(List<Integer> arr) {
if(arr.size() == 1) {
... | <p>There's a logic bug, <code>Arrays.asList(arr)</code> actually creates a list of lists <code>List<List<Integer>></code> while it looks like what you want is a List where arr already is one..</p>
<p>Also you need to properly parameterize <code>List left</code> and <code>List right</code> as <code>List<I... | How to convert and cast an object list to an integer list? | java|arrays|sorting|data-structures | -2 | 52 | 2 | 72,155,125 | 72,155,125 | 2 | true | 2022-05-07T17:38:03.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert and cast an object list to an integer list?<p>Bellow code snippet errors with:</p>
<pre><code> "Type mismatch: cannot convert from elemen... |
72,156,924 | Compilation error: method call through an interface<p>I am learning go interfaces and trying to implement the below but vscode is showing me a compilation error, requesting help. What am I missing. Thank you.</p>
<pre><code>package dataaccess
import (
"../domain"
)
type IProductDataAccess interface {
... | <p>This line looks like it needs adjustment:</p>
<pre><code>product, err := dataaccess.IProductDataAccess.GetProduct(productID)
</code></pre>
<p><code>dataaccess.IProductDataAccess</code> is an interface, not an actual object to invoke a call on. <code>dataaccess.ProductDataAccess</code> is the singleton instance on t... | Compilation error: method call through an interface | go|interface | -2 | 53 | 1 | 72,158,646 | 72,158,646 | 2 | true | 2022-05-07T22:57:44.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compilation error: method call through an interface<p>I am learning go interfaces and trying to implement the below but vscode is showing me a compilation er... |
72,166,570 | WPF C# System.NullReferenceException: 'Object reference not set to an instance of an object.'<p>I'm using WPF .net 5.0 framework. I'm trying to display a value that I passed into a textbox for users to edit the current value.</p>
<p>This is the code</p>
<pre><code> public EditUserDetailsPage1(User user)
{
... | <p>It's because you're trying to use <code>InputFullName</code> before it's been created.</p>
<p>In WPF, the UI elements are created when you run <code>InitializeComponent</code>.</p>
<p>Try this instead:</p>
<pre><code>public EditUserDetailsPage1(User user)
{
InitializeComponent();
InputFullName.Text = user.F... | WPF C# System.NullReferenceException: 'Object reference not set to an instance of an object.' | c#|wpf|.net-5|nullreferenceexception | -2 | 352 | 1 | 72,166,583 | 72,166,583 | 2 | true | 2022-05-09T02:58:58.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF C# System.NullReferenceException: 'Object reference not set to an instance of an object.'<p>I'm using WPF .net 5.0 framework. I'm trying to display a va... |
72,173,647 | Create Date object passing a date format of mmddyyyy<p>I'm trying to create a date with the format <code>'mmddyyyy'</code>. I've noticed I can pass a four digit string, but when I use the format above, it says invalid date. How can I go about this with pure js?</p>
<pre><code>let dateString = '01012022'
let d = new Dat... | <p>maybe you want something like that</p>
<pre><code>let dateString = '01012022'
let [match, dd, mm, yyyy] = dateString.match(/(\d{2})(\d{2})(\d{4})/)
// iso format
let d = new Date(`${yyyy}${mm}${dd}`)
</code></pre> | Create Date object passing a date format of mmddyyyy | javascript|date | -2 | 99 | 2 | 72,173,737 | 72,173,737 | 2 | true | 2022-05-09T14:28:27.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create Date object passing a date format of mmddyyyy<p>I'm trying to create a date with the format <code>'mmddyyyy'</code>. I've noticed I can pass a four di... |
72,181,533 | Left join in SQL to identify certain rows<p>Given below is table A:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Cust_id</th>
<th>Code</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>101</td>
</tr>
<tr>
<td>1</td>
<td>102</td>
</tr>
<tr>
<td>1</td>
<td>103</td>
</tr>
<tr>
<td>2</td>
<td>... | <p>Two conditions:</p>
<ul>
<li>cust_id must be in table B</li>
<li>(cust_id, code) must not be in table B</li>
</ul>
<p>The query with the conditions almost literally translated from human language to SQL:</p>
<pre><code>select *
from a
where cust_id in (select cust_id from b)
and (cust_id, code) not in (select cust_i... | Left join in SQL to identify certain rows | mysql|sql|merge|left-join | -2 | 39 | 2 | 72,181,594 | 72,181,594 | 2 | true | 2022-05-10T06:20:08.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Left join in SQL to identify certain rows<p>Given below is table A:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Cust_id</th>... |
72,185,378 | Does "new CLASS" return CLASS or CLASS*<p>This may seem really simple, but I don't know how to actually make a program that tells me this.</p> | <p>As stated in comments, <code>new</code> will always give you a pointer.</p>
<p>But as <code>new</code> implies <code>delete</code>, I strongly advise you to take a look at a concept call RAII, especially why it's so popular.</p> | Does "new CLASS" return CLASS or CLASS* | c++|class | -2 | 93 | 2 | 72,185,501 | 72,185,501 | 2 | true | 2022-05-10T11:16:12.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does "new CLASS" return CLASS or CLASS*<p>This may seem really simple, but I don't know how to actually make a program that tells me this.</p> |
72,183,066 | How can i add a queue function in my discord music bot?<p>I dont know how to put a queue function in here, when i play another song while its already playing, it gives me an error with "Already playing audio".</p>
<p>this is inside a cog btw</p>
<p>here is my play command code:</p>
<pre><code> @commands.comma... | <p>Before anything, you seem to have answered your own question? "put a queue".</p>
<p>All you had to google was "How to make queue in Python" and this would have shown you the way to queue standard library of python.</p>
<p>Now what you need to do is identify, what type of queue do you want.</p>
<p... | How can i add a queue function in my discord music bot? | discord|discord.py | -2 | 149 | 1 | 72,188,943 | 72,188,943 | 2 | true | 2022-05-10T08:33:16.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i add a queue function in my discord music bot?<p>I dont know how to put a queue function in here, when i play another song while its already playing... |
72,190,169 | Container not running from image<p>I have an image <code>segmentation_site_segmentation_site</code>. The image is built from the following Dockerfile and Docker-Compose file.</p>
<pre><code>junaidali@ubuntu:~/Documents/segmentation/segmentation_site$ sudo docker images
REPOSITORY TAG ... | <p>Remove <code>command: gunicorn -b 0.0.0.0:8000 segmentation_site.wsgi</code> from your <code>docker-compose.yaml</code> and put it into your <code>Dockerfile</code> like this:</p>
<pre><code>CMD gunicorn -b 0.0.0.0:8000 segmentation_site.wsgi
</code></pre>
<p>Otherwise the image doesn't start any process</p>
<p><a h... | Container not running from image | docker|docker-compose|gunicorn | -2 | 105 | 1 | 72,190,219 | 72,190,219 | 2 | true | 2022-05-10T16:47:05.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Container not running from image<p>I have an image <code>segmentation_site_segmentation_site</code>. The image is built from the following Dockerfile and Doc... |
72,192,366 | Query XML XPATH in column containing XML but not stored as XML type<p>I have a column in a database I'm working on that contains XML, but is stored as <code>varchar</code>. I can <code>CAST()</code> the column to XML, but it's not clear how I would fetch anything from this column using XPATH or otherwise.</p>
<p><code>... | <p>Please try the following solution.</p>
<p>It is better to use XML data type for a column with XML data.</p>
<p>It is available starting from SQL Server 2005 onwards.</p>
<p><strong>SQL</strong></p>
<pre><code>-- DDL and sample data population, start
DECLARE @tbl TABLE (ID INT IDENTITY PRIMARY KEY, Content NVARCHAR(M... | Query XML XPATH in column containing XML but not stored as XML type | sql-server|xml|tsql|xquery | -2 | 71 | 1 | 72,193,402 | 72,193,402 | 2 | true | 2022-05-10T20:05:27.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query XML XPATH in column containing XML but not stored as XML type<p>I have a column in a database I'm working on that contains XML, but is stored as <code>... |
72,193,100 | How can I get all the indexes of the number 1 in a two-dimensional array?<p>I have an array that looks like this:</p>
<pre><code>int[,] figureL = {{0, 1, 0},
{0, 1, 0},
{0, 1, 1}};
</code></pre>
<p>How can I get the indexes of all the numbers that are equal to <code>1</code>? So not ... | <p>How about something like this:</p>
<pre><code>int[,] matrix =
{{0, 1, 0},
{0, 1, 0},
{0, 1, 1}};
for (var i = 0; i < matrix.GetLength(0); i++)
{
for (var j = 0; j < matrix.GetLength(1); j++)
{
if (matrix[i, j] == 1)
{
Debug.WriteLine($"index [{i}, {j}] is... | How can I get all the indexes of the number 1 in a two-dimensional array? | c#|multidimensional-array | -2 | 103 | 3 | 72,193,550 | 72,193,550 | 2 | true | 2022-05-10T21:23:05.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get all the indexes of the number 1 in a two-dimensional array?<p>I have an array that looks like this:</p>
<pre><code>int[,] figureL = {{0, 1, 0},... |
72,195,354 | I had try to run a car game through c++ only<p>As mentioned in the title I try to run a car game developed using only CPP but faced problems in line 20 of my code...</p>
<pre><code>#include<conio.h>
#include<dos.h>
#include <windows.h>
#include <time.h>
#define SCREEN_WIDTH 90
#define SCREEN_H... | <p>You're defining your 'car' array as a 2d (1x1) array, which would need to be initialized like:</p>
<pre><code>char car[1][1] = {{' '}}; // probably not useful (it only holds 1 char)
</code></pre>
<p>You probably need to change the size of your array. Something like:</p>
<pre><code>char car[2][3] = { // here car ... | I had try to run a car game through c++ only | c++ | -2 | 73 | 1 | 72,195,484 | 72,195,484 | 2 | true | 2022-05-11T04:15:58.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I had try to run a car game through c++ only<p>As mentioned in the title I try to run a car game developed using only CPP but faced problems in line 20 of my... |
72,213,248 | HTTPS Request : CORS error but I still get data<p>I'm making HTTPS request to a private API (hosted Itop), I get an response but I get <code>CORS Multiple Origin Not Allow</code> error so my JavaScript program can't use the response content.<br />
I'm supposed to have CORS authorization</p>
<p>The requests are <code>PO... | <p>It's not allowed to send multiple <code>Access-Control-Allow-Origin</code> headers or multiple origins in one header in the same response. In the comments, you described two same <code>Access-Control-Allow-Origin</code> headers in one response. Even two same origins aren't allowed. Remove one header in the backend c... | HTTPS Request : CORS error but I still get data | javascript|https|fetch | -2 | 601 | 2 | 72,213,493 | 72,213,493 | 2 | true | 2022-05-12T09:36:42.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTTPS Request : CORS error but I still get data<p>I'm making HTTPS request to a private API (hosted Itop), I get an response but I get <code>CORS Multiple Or... |
72,222,499 | Golang 'exec.Command' treat single quote parameter special?<p>I am refer to the post <a href="https://stackoverflow.com/questions/20437336/how-to-execute-system-command-with-unknown-arguments">How to execute system command with unknown arguments?</a> to run a jq command on my ubuntu shell.
Below is the code I tried</p>... | <p>The program executes the jq command, not a shell. The jq command does not understand the shell syntax passed to the command (the quotes and I/O redirection).</p>
<p>Use the following code to run the command with stdout redirected to short-response.json.</p>
<pre><code>cmd := exec.Command("jq",
"(.... | Golang 'exec.Command' treat single quote parameter special? | go | -2 | 169 | 1 | 72,223,785 | 72,223,785 | 2 | true | 2022-05-12T22:00:15.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Golang 'exec.Command' treat single quote parameter special?<p>I am refer to the post <a href="https://stackoverflow.com/questions/20437336/how-to-execute-sys... |
72,224,296 | How can I tell subprocess to answer "y" to a commandline question?<p>I'm automating an ffmpeg command but when the file exists already, it asks me if I have to "Overwrite [y/N]" and it stalls the entire script until I have to enter "y" myself in the console. How can I automate that?</p>
<pre><code>f... | <p>Add <code>-y</code> to ffmpeg args. Add <code>-n</code> for no.</p> | How can I tell subprocess to answer "y" to a commandline question? | python|ffmpeg|automation|subprocess | -2 | 33 | 1 | 72,224,337 | 72,224,337 | 2 | true | 2022-05-13T04:02:16.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I tell subprocess to answer "y" to a commandline question?<p>I'm automating an ffmpeg command but when the file exists already, it asks me if I have ... |
72,225,418 | how to implement odd numbers in a new array?<p>I want to output only the odd numbers from an array with the numbers from 1-100 in a new array. I have no idea how to do this.</p>
<pre><code>use strict;
use warnings;
my @zahlen = (1..100);
foreach my $zahlen (@zahlen){
if ($zahlen % 2) {
print "$zahle... | <p>Just create new array and add the odd numbers</p>
<pre><code>use strict;
use warnings;
my @zahlen = (1..100);
my @ungerade;
my $i = 0;
foreach my $zahlen (@zahlen){
if ($zahlen % 2){
$ungerade[$i] = $zahlen;
$i = $i + 1;
}
}
print "@ungerade"
</code></pre> | how to implement odd numbers in a new array? | arrays|perl | -2 | 89 | 2 | 72,225,552 | 72,225,552 | 2 | true | 2022-05-13T06:43:10.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to implement odd numbers in a new array?<p>I want to output only the odd numbers from an array with the numbers from 1-100 in a new array. I have no idea... |
72,226,926 | How to return the value of a reference field of a struct that is no longer used without copy?<p>Code like this:</p>
<pre><code>pub fn sample_from_categorical_logits(prob_logits: Tensor) -> (Tensor, Tensor) {
let prob_obj = match prob_logits.size().len() {
3 => Categorical::from_logits(prob_logits),
... | <blockquote>
<p>I wonder if there is a more efficient way other than copying the field, like move in C++.</p>
</blockquote>
<p>Well yes, moving. But moving requires having ownership of the object, meaning you need a version of <code>probs()</code> which <em>consumes</em> the object in order to return its bits.</p>
<p>O... | How to return the value of a reference field of a struct that is no longer used without copy? | rust | -2 | 105 | 1 | 72,227,016 | 72,227,016 | 2 | true | 2022-05-13T08:57:13.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return the value of a reference field of a struct that is no longer used without copy?<p>Code like this:</p>
<pre><code>pub fn sample_from_categorical... |
72,164,890 | Syntax error near '=' -- delete statement<p>I'm trying to add something so that things can be deleted from a table, though it says there is a syntax error near '=' and I can't seem to spot it. I know this isn't the most ideal way to be doing this, but I've been told to do it this way.</p>
<p>Here's what I've put:</p>
<... | <p>As you said the <code>.</code> is meant to be there and that the column name is <code>passportno.</code>, this is where your problem is. It's not something that is expected, or recommended, but it is something that can be handled.</p>
<p>When using Sql you <strong>really</strong> should be using Parameters when cons... | Syntax error near '=' -- delete statement | c#|sql | -2 | 80 | 2 | 72,165,008 | 72,165,008 | 2 | true | 2022-05-08T20:33:24.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Syntax error near '=' -- delete statement<p>I'm trying to add something so that things can be deleted from a table, though it says there is a syntax error ne... |
72,214,059 | Run time error assigning cv::Mat element value using cv::Mat::at<p>In the following code I would like to assign a values to elements of a Mat variable in a loop. I get the runtime error below.</p>
<pre class="lang-cpp prettyprint-override"><code>pair<Mat, Mat> meshgrid(vector<int> x, vector<int> y) {
... | <p>I assume you meant to generate output similar to <a href="https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html" rel="nofollow noreferrer"><code>numpy.meshgrid</code></a>, and <a href="https://ch.mathworks.com/help/matlab/ref/meshgrid.html" rel="nofollow noreferrer">Matlab <code>meshgrid</code></a>.</... | Run time error assigning cv::Mat element value using cv::Mat::at | c++|opencv|image-processing|matrix | -2 | 67 | 1 | 72,214,759 | 72,214,759 | 2 | true | 2022-05-12T10:35:23.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run time error assigning cv::Mat element value using cv::Mat::at<p>In the following code I would like to assign a values to elements of a Mat variable in a l... |
72,199,697 | How to convert OrderedDict to a list of values only, in Python?<p>I have an <code>OrderedDict</code> object and I want to make a list with just the values while keeping the same order they have in the dictionary. Is there an out of the box method to do this? My <code>OrderedDict</code> object looks something like this:... | <h3>FOR ONLY VALUES.</h3>
<pre class="lang-py prettyprint-override"><code>import datetime
OrderedDict = [
(
datetime.datetime(2022, 5, 11, 7, 43, 0, 90913),
{
"time": datetime.datetime(2022, 5, 11, 7, 43, 0, 90913),
"angl... | How to convert OrderedDict to a list of values only, in Python? | python|ordereddictionary | -2 | 46 | 1 | 72,199,837 | 72,199,837 | 2 | true | 2022-05-11T10:48:55.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert OrderedDict to a list of values only, in Python?<p>I have an <code>OrderedDict</code> object and I want to make a list with just the values wh... |
72,143,753 | Is it possible to calculate the value after overflow?<p>I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum. It is connected in a cycle. In the code below can I calculate the value after overflow.</p>
<pre><code>#include<bits/stdc++.h>
using namespace std;
int main()
{... | <blockquote>
<p>I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum.</p>
</blockquote>
<p>You've misuderstood. If 1 is added to INT_MAX, then the behaviour of the program is undefined.</p>
<blockquote>
<p>can I calculate the value after overflow.</p>
</blockquote>
<p>After s... | Is it possible to calculate the value after overflow? | c++|precision|integer-overflow | -2 | 75 | 1 | 72,143,862 | 72,143,862 | 2 | true | 2022-05-06T15:13:12.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to calculate the value after overflow?<p>I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum. It ... |
72,188,432 | Form validation - Must contain a specific word from a list<p>I'm trying to use Javascript to validate an input field to have the specific formatting below:</p>
<ul>
<li>"WORD1,WORD2"</li>
</ul>
<p>So there has to be a <strong>comma</strong> in between two words, <strong>no spaces</strong>. WORD1 can be any wo... | <p><strong>Use a Select</strong></p>
<p><em>(code revised to allow any text prefix)</em></p>
<p>Selects are typically used to limit options to a defined set of values. This avoids the needless complexity of parsing and validating user input. So in this solution "word2" has been made a <code><select></co... | Form validation - Must contain a specific word from a list | javascript|html|css|forms|validation | -2 | 105 | 2 | 72,188,989 | 72,188,989 | 2 | true | 2022-05-10T14:42:33.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Form validation - Must contain a specific word from a list<p>I'm trying to use Javascript to validate an input field to have the specific formatting below:</... |
72,168,967 | How can we select a random hex value from a given hex range in python<p>If I have a hex range as <code>0x2080000000-0x217fffffff</code>, and if I need to select a random hex number or multiple hex number from this range, How can I do that using python?</p> | <p>Use <a href="https://docs.python.org/3/library/random.html#random.randint" rel="nofollow noreferrer">randint</a> from the <code>random</code> module:</p>
<pre><code>from random import randint
x = randint(0x2080000000, 0x217fffffff)
print(f"Decimal : {x}\n"
f"Hexadecimal: {hex(x)}")
</c... | How can we select a random hex value from a given hex range in python | python|python-3.x|random|hex | -2 | 96 | 2 | 72,169,112 | 72,169,112 | 2 | true | 2022-05-09T08:24:07.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can we select a random hex value from a given hex range in python<p>If I have a hex range as <code>0x2080000000-0x217fffffff</code>, and if I need to sel... |
72,203,743 | remove first and last quote from python list<p>I have a list</p>
<pre><code>list = ['1,2,3,4,5,6,7']
</code></pre>
<p>I want my list as under:</p>
<pre><code>desire output = [1,2,3,4,5,6,7]
</code></pre>
<p>how to get this, i read other similar answer where strip method used. i had tried strip but strip method not work... | <p>What you have is a <code>list</code> with a single <code>str</code> element. To get the list you want, try:</p>
<pre><code>lst = ['1,2,3,4,5,6,7']
>>> list(map(int, lst[0].split(",")))
</code></pre> | remove first and last quote from python list | python|python-3.x|django|list | -2 | 52 | 2 | 72,203,790 | 72,203,790 | 2 | true | 2022-05-11T15:29:33.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
remove first and last quote from python list<p>I have a list</p>
<pre><code>list = ['1,2,3,4,5,6,7']
</code></pre>
<p>I want my list as under:</p>
<pre><code... |
72,219,028 | Using a Raspberry Pi 4 to host react web app<p>I have some broad questions on the flow of how to set up my web app on Raspberry Pi.</p>
<p>I've built a React App on my local PC, it hits up an node/express API the I've put together which in turn performs basic CRUD on my MYSQL database. I would like to make the whole th... | <p>My first recommendation would be <a href="https://www.simplilearn.com/tutorials/docker-tutorial/raspberry-pi-docker" rel="nofollow noreferrer">Docker</a>, but I understand if you just want a server. I think the best way to go in this case would be to use something like <a href="https://nextjs.org" rel="nofollow nore... | Using a Raspberry Pi 4 to host react web app | node.js|reactjs|express|networking|raspberry-pi | -2 | 496 | 1 | 72,219,399 | 72,219,399 | 2 | true | 2022-05-12T16:18:39.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using a Raspberry Pi 4 to host react web app<p>I have some broad questions on the flow of how to set up my web app on Raspberry Pi.</p>
<p>I've built a React... |
72,202,560 | Remove part of a string after a character until a charcter and repeat until the string end<p>I am trying to filter part of a string until it reaches a specific character and repeat until the end of string.</p>
<p>Data loooks like</p>
<pre><code>095930
CF0010+EN
060983+PS
086588+GG;086326+GG
900010;
CF0002;;CF0018;
</co... | <p>Removing everything after and including a character in a value is quite simple, just use <code>LEFT</code> and <code>CHARINDEX</code>:</p>
<pre class="lang-sql prettyprint-override"><code>LEFT(DS.Item,CHARINDEX('+',DS.Item + '+')-1)
</code></pre>
<p>The <em>real</em> problem you have is a little more complex:</p>
<o... | Remove part of a string after a character until a charcter and repeat until the string end | sql|sql-server|sql-server-2012 | -2 | 87 | 2 | 72,203,268 | 72,203,268 | 2 | true | 2022-05-11T14:09:35.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove part of a string after a character until a charcter and repeat until the string end<p>I am trying to filter part of a string until it reaches a specif... |
72,146,924 | When I Run My Code I Get A Huge Error In Python<p>If I Run This Code:</p>
<pre><code>import re
mapping = {'gde1': 'a', '4&TW': 'b', 'E#ZB': 'c', 'B0F&': 'd', 'uvRD': 'e', 'M7vr': 'f', 'X$*d': 'g', 'XQ%R': 'h', 'jma+': 'i', 'P9We': 'j', 'xw4O': 'k', 'zT@3': 'l', '4B30': 'm', 'Jc&$': 'n', 'Szb7': 'o', '+yvf':... | <p>In your mapping you have special regex characters, such as <code>+</code> that indicates that the previous character/group can be repeated.</p>
<p>Your error is due to strings like <code>+yvf</code> where there is nothing before the <code>+</code>. Even if there was no error, you would match the wrong things (e.g. <... | When I Run My Code I Get A Huge Error In Python | python | -2 | 94 | 2 | 72,147,019 | 72,147,019 | 2 | true | 2022-05-06T20:16:19.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When I Run My Code I Get A Huge Error In Python<p>If I Run This Code:</p>
<pre><code>import re
mapping = {'gde1': 'a', '4&TW': 'b', 'E#ZB': 'c', 'B0F&... |
72,145,400 | How to convert array into JavaScript object<p>I have an array like this (which is similar to a JSON array) of length n:</p>
<pre><code>const mainData = [
{
phrase: "Phrase 1",
categorynumber: 1,
optionnumber: 1,
},
{
phrase: "Phrase 2",
categorynumber: 1,
optionnumber: ... | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer">Reduce</a> the dataset by accessing the <code>categorynumber</code> as the main key, and the <code>optionnumber</code> as the subkey. You can apply new options to the existing category b... | How to convert array into JavaScript object | javascript|arrays|json|object|nested | -2 | 49 | 1 | 72,145,461 | 72,145,461 | 2 | true | 2022-05-06T17:32:59.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert array into JavaScript object<p>I have an array like this (which is similar to a JSON array) of length n:</p>
<pre><code>const mainData = [
{... |
72,213,906 | Nuxt SSR app does not share date from store between two windows<p>I have a Nuxt SSR app which need to open new window on link click, but new window does not have actual data in the store. There are only default values. How can I share actual values in the store between this two pagaes?</p>
<p>This is the code of new pa... | <p>Yes, if you open a new tab, Vue will need to re-hydrate from the start, you cannot transfer the state from one page to the other with just Vue.</p>
<p>You'll need to use something to persist the data. A quick search brings up this exact answer with quite more details: <a href="https://stackoverflow.com/a/66872372/88... | Nuxt SSR app does not share date from store between two windows | javascript|vue.js|nuxt.js|vuex | -2 | 81 | 1 | 72,214,328 | 72,214,328 | 2 | true | 2022-05-12T10:24:43.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nuxt SSR app does not share date from store between two windows<p>I have a Nuxt SSR app which need to open new window on link click, but new window does not ... |
72,232,484 | C++ - Reading a line without getline<p>I am trying to read user entered data from the stream and then store it in a custom String class.</p>
<p>To my best knowledge, std::getline() can route data only to std::string , that is why I need to come up with something else, as <strong>my project is not allowed to use std::st... | <blockquote>
<p>To my best knowledge, std::getline() can route data only to std::string , that is why I need to come up with something else, as my project is not allowed to use std::string class.</p>
</blockquote>
<p>Note that <a href="https://en.cppreference.com/w/cpp/string/basic_string/getline" rel="nofollow norefer... | C++ - Reading a line without getline | c++|input | -2 | 175 | 2 | 72,233,716 | 72,233,716 | 2 | true | 2022-05-13T16:07:08.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ - Reading a line without getline<p>I am trying to read user entered data from the stream and then store it in a custom String class.</p>
<p>To my best kn... |
72,160,037 | Implement inner-class-like reference behaviour?<p>First of all, allow me to explain a "behaviour" that I observed, then I will ask in "Example" section.</p>
<h4>Inner-class-reference behaviour</h4>
<p>In Java we can have (non-static) <strong>inner-classes</strong>, which seem to behave like having a... | <blockquote>
<p>In Java we can have (non-static) <strong>inner-classes</strong>, which seem to "<strong>behave</strong>" like having a strong-reference to their container-class and/or owner-class, <strong>but without causing memory-leak</strong>.</p>
<p>I mean, I observed that even if both owner-class and inn... | Implement inner-class-like reference behaviour? | java|reference|inner-classes | -2 | 87 | 1 | 72,167,978 | 72,167,978 | 2 | true | 2022-05-08T10:20:01.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implement inner-class-like reference behaviour?<p>First of all, allow me to explain a "behaviour" that I observed, then I will ask in "Example... |
72,204,523 | Convert zip lists to a txt file without using any libraries<pre><code>for (a, b, c, d, e, f, g) in zip(A, B, C, D, E, F, G):
result = ''.join([a,b,c,d,e,f,g])
# Write the file
with open("file.txt","w") as f:
f.write(result)
</code></pre>
<p>This only gives one line instead of the whole resu... | <p>You need to call <code>f.write(result)</code> in the loop. And append a newline to each line.</p>
<pre><code>with open("file.txt","w") as f:
for data in zip(A, B, C, D, E, F, G):
result = ''.join(data)
f.write(result + '\n')
</code></pre>
<p>There's no need to spread the zippe... | Convert zip lists to a txt file without using any libraries | python|list|file | -2 | 72 | 1 | 72,204,602 | 72,204,602 | 3 | true | 2022-05-11T16:26:58.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert zip lists to a txt file without using any libraries<pre><code>for (a, b, c, d, e, f, g) in zip(A, B, C, D, E, F, G):
result = ''.join([a,b,c,d,e,... |
72,174,901 | Awk: for-loop with array of numbers<p>How to use an array of numbers in a <code>for</code> loop with awk ?</p>
<p>I tried:</p>
<pre><code>awk '{ for (i in [10, 12, 18]) print i }' myfile.txt
</code></pre>
<p>But I'm getting a <strong>syntax error</strong>.</p> | <p>The <code>in</code> operator works on arrays. The way to create an array from a list of numbers like <code>10 12 18</code> is to <code>split()</code> a string containing those numbers.</p>
<p>To have those numbers stored as values in an array <code>a[]</code> with indices <code>1</code> to <code>3</code>:</p>
<pre><... | Awk: for-loop with array of numbers | awk | -2 | 121 | 2 | 72,174,986 | 72,174,986 | 3 | true | 2022-05-09T15:58:49.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Awk: for-loop with array of numbers<p>How to use an array of numbers in a <code>for</code> loop with awk ?</p>
<p>I tried:</p>
<pre><code>awk '{ for (i in [1... |
72,209,358 | Regex to extract S expression?<p>I'm wondering if it's possible to do a pass on parsing of a <code>define</code> expression in lisp with a single regular expression, for example with the following input:</p>
<pre><code>#lang sicp
(define (square x) (* x x))
(define (average x y) (/ (+ x y) 2))
; using block scope
(def... | <p>As a preface, there is a famous quote due to Jamie Zawinski:</p>
<blockquote>
<p>Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.</p>
</blockquote>
<p>The one word answer to your question is 'no'. Regular languages – the languages that ... | Regex to extract S expression? | regex|lisp|sicp | -2 | 68 | 1 | 72,212,559 | 72,212,559 | 3 | true | 2022-05-12T02:05:44.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex to extract S expression?<p>I'm wondering if it's possible to do a pass on parsing of a <code>define</code> expression in lisp with a single regular exp... |
72,156,306 | Sort a string in Javascript<p>I have a string like the following. The string contains words which contain a number from 0 to 9 in them The number is the position they must have in the resulting string.
If the string is empty, the result will be an empty string</p>
<p>Example: "en5 4terremoto NAS1A regi2stró L0a M6... | <p>You could take each word, and remove all non-digits from it (with a regular expression), and use that as index in a result array:</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"><... | Sort a string in Javascript | javascript | -2 | 52 | 1 | 72,156,354 | 72,156,354 | 3 | true | 2022-05-07T20:54:04.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort a string in Javascript<p>I have a string like the following. The string contains words which contain a number from 0 to 9 in them The number is the posi... |
72,169,105 | Connect to AWS account via AWS CLI<p>I need to login to AWS account via AWS CLI.</p>
<p>I imagine the first port of call with anything AWS CLI is to connect via the terminal.</p>
<p>How do I do this with AWS CLI</p> | <p>use</p>
<pre><code>aws configure
</code></pre>
<p>it will ask for your <code>access key</code>, <code>secret key</code> & your default <code>region</code>.</p>
<p><a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html" rel="nofollow noreferrer">AWS CLI Quickstart - Configure</a><... | Connect to AWS account via AWS CLI | amazon-web-services|aws-cli | -2 | 171 | 1 | 72,169,140 | 72,169,140 | 3 | true | 2022-05-09T08:35:47.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Connect to AWS account via AWS CLI<p>I need to login to AWS account via AWS CLI.</p>
<p>I imagine the first port of call with anything AWS CLI is to connect ... |
72,147,025 | What are CUDA Global Memory 32-, 64- and 128-byte transactions?<p>I am relatively new to CUDA programming.</p>
<p>In this blog (<a href="https://developer.nvidia.com/blog/how-access-global-memory-efficiently-cuda-c-kernels/" rel="nofollow noreferrer">How to Access Global Memory Efficiently in CUDA C/C++ Kernels</a>), w... | <p>Both of these need to be understood in the context of a CUDA <a href="https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#simt-architecture" rel="nofollow noreferrer">warp</a>. All operations are issued warp-wide, and this includes instructions that access memory.</p>
<p>An individual CUDA thread <a hr... | What are CUDA Global Memory 32-, 64- and 128-byte transactions? | cuda | -2 | 107 | 1 | 72,147,357 | 72,147,357 | 4 | true | 2022-05-06T20:27:20.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What are CUDA Global Memory 32-, 64- and 128-byte transactions?<p>I am relatively new to CUDA programming.</p>
<p>In this blog (<a href="https://developer.nv... |
72,154,495 | Program not running after scanf<p>I am new to programming . I am trying to do an assignment but the code doesn't do anything after the first input to scanf . ( I am coding in VS code and i have to run the program again to get the result . until then nothing happens. ) I wrote an another simple code to check if anything... | <p>Remove the space after <code>%i</code>. Specifically, <code>scanf("%i ", &a)</code> should be <code>scanf("%i", &a)</code>. This works for me.</p> | Program not running after scanf | c|scanf | -2 | 47 | 2 | 72,154,603 | 72,154,603 | 4 | true | 2022-05-07T16:35:13.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Program not running after scanf<p>I am new to programming . I am trying to do an assignment but the code doesn't do anything after the first input to scanf .... |
72,162,294 | Basic example of how to do numerical integration in C++<p>I think most people know how to do numerical derivation in computer programming, (as limit --> 0; read: "as the limit approaches zero").</p>
<pre class="lang-cpp prettyprint-override"><code>//example code for derivation of position over time to obta... | <h2>Numerical derivation and integration in code for physics, mapping, robotics, gaming, dead-reckoning, and controls</h2>
<p><em>Pay attention to where I use the words "estimate" vs "measurement" below. The difference is important.</em></p>
<ol>
<li><strong>Measurements</strong> are direct readings... | Basic example of how to do numerical integration in C++ | c++|math|game-development|integral|calculus | -2 | 393 | 1 | 72,162,992 | 72,162,992 | 4 | true | 2022-05-08T15:03:21.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Basic example of how to do numerical integration in C++<p>I think most people know how to do numerical derivation in computer programming, (as limit --> 0... |
72,217,604 | How is it possible to save two data in the same memory location on C?<p>I'm learning C language, specifically pointers and I have this little question.</p>
<p>How is it possible to save two data in the same memory location on C? Look my code:</p>
<pre><code>#include <stdio.h>
int main()
{
const int y = 2;
... | <p>First of all, <code>int *const ptr_y = &y;</code> isn't valid C, so if your compiler made an executable despite this code, all bets of its behavior are off. And in case you got no messages from the compiler, it means that your compiler configuration is non-standard. See <a href="https://software.codidact.com/pos... | How is it possible to save two data in the same memory location on C? | c | -2 | 101 | 2 | 72,217,943 | 72,217,943 | 5 | true | 2022-05-12T14:38:18.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How is it possible to save two data in the same memory location on C?<p>I'm learning C language, specifically pointers and I have this little question.</p>
<... |
72,233,203 | Should you always put join() after launching a thread?<p>I wonder if there is any advantage putting <code>join()</code> not immediately after launching a thread?</p>
<pre class="lang-cpp prettyprint-override"><code>std::thread t(func);
// some code ...
t.join();
</code></pre>
<p>does it give you any advantage or it's... | <p>If you use <code>join()</code> right after starting the new thread then it will block (wait) execution on the <code>join()</code> call until the new thread is finished running (defeating the whole purpose of the parallelization you get from starting the new thread). Therefore, if you want to execute "some code&... | Should you always put join() after launching a thread? | c++|multithreading | -2 | 96 | 1 | 72,233,250 | 72,233,250 | 8 | true | 2022-05-13T17:10:09.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should you always put join() after launching a thread?<p>I wonder if there is any advantage putting <code>join()</code> not immediately after launching a thr... |
72,237,182 | New users can't create an account with part of an already existing username (text file problem)<p>I'm relatively new to python and am trying to create a reliable account creation and storage program. When the user wants to create a new username, the username_storage file is read to see if it already exists for another ... | <pre><code>usernames = username_storage.split()
print(new_user in usernames)
</code></pre>
<p>would do what you want assuming you cant have spaces in the username</p> | New users can't create an account with part of an already existing username (text file problem) | python|text-files|account | -2 | 34 | 1 | 72,237,206 | 72,237,206 | -2 | true | 2022-05-14T03:41:28.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
New users can't create an account with part of an already existing username (text file problem)<p>I'm relatively new to python and am trying to create a reli... |
72,077,082 | Discоrd Bot Event<p>is it possible to somehow put before.rules and after.sales into two arrays, then compare the number of elements in them and subtract not their number, but the elements, so that the rest can be output later?
<a href="https://i.stack.imgur.com/g9Oz6.png" rel="nofollow noreferrer">example</a></p> | <p>To compare the lengths of two lists, you can:</p>
<pre><code>>>> print(len(after.roles)-len(before.roles))
3
</code></pre>
<p>In this example 3 new roles were gained</p> | Discоrd Bot Event | python|arrays|events|discord|bots | -2 | 25 | 1 | 72,077,163 | 72,077,163 | -1 | true | 2022-05-01T13:19:36.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Discоrd Bot Event<p>is it possible to somehow put before.rules and after.sales into two arrays, then compare the number of elements in them and subtract not ... |
72,144,428 | Why does on_member_join() is not working in my discord.py bot?<p>I try to run this code below, but on_member_join is not working for me.</p>
<pre class="lang-py prettyprint-override"><code> async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
t... | <p>Make sure to subscribe to members intent.</p>
<pre><code>class Bot(commands.Bot):
def __init__(self):
intents = discord.Intents.default()
intents.members = True
super().__init__(intents=intents)
</code></pre> | Why does on_member_join() is not working in my discord.py bot? | python|discord|discord.py | -2 | 57 | 2 | 72,145,106 | 72,145,106 | -1 | true | 2022-05-06T16:02:50.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does on_member_join() is not working in my discord.py bot?<p>I try to run this code below, but on_member_join is not working for me.</p>
<pre class="lang... |
72,147,139 | How to update a single property using PATCH method in Node JS?<p>I want to create a PATCH method to update a single property for my API but there is something I don't understand.</p> | <p>You should Clearly post your question, this is what i understand, i hope this will help you if you are using <code>request</code> npm in <code>node.js</code></p>
<pre><code>var request = require('request');
request.patch(
//First parameter API to make post request
'https://example.com/api/users',
//The... | How to update a single property using PATCH method in Node JS? | node.js|reactjs|mongodb | -2 | 64 | 1 | 72,147,198 | 72,147,198 | -1 | true | 2022-05-06T20:39:47.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update a single property using PATCH method in Node JS?<p>I want to create a PATCH method to update a single property for my API but there is somethin... |
72,149,828 | How to put new page into a frame thats inside main html?<p>Im trying to put a graph that can be interactable with main page onto the canvas. ive seen many pages that use this: <a href="https://i.stack.imgur.com/HYj1C.png" rel="nofollow noreferrer">"#document" being used inside frame</a></p>
<p>im not sure how... | <p>You can easily reach your purpose by use <code>iframe</code>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><iframe id="inlineFrameExample"
title="Inline Frame ... | How to put new page into a frame thats inside main html? | javascript|html|css | -2 | 43 | 1 | 72,149,854 | 72,149,854 | -1 | true | 2022-05-07T05:48:02.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to put new page into a frame thats inside main html?<p>Im trying to put a graph that can be interactable with main page onto the canvas. ive seen many pa... |
72,157,090 | How can I get an ID attribute to work inside a span on Visual Studio<p>I am very new to coding. I am trying to put an ID attribute into a span on visual studio but when I try to put ID it is simply coming up as a string instead.</p>
<p>I know this is basic but would appreciate any help.</p>
<pre><code><div>
... | <p>You have to place the id attribute inside the span tag as well as any other attribute or property. <code><span id='myId'>Content</span></code>. Everything between the opening and closing tag is considered content of the tag.</p> | How can I get an ID attribute to work inside a span on Visual Studio | html|css | -2 | 25 | 1 | 72,157,174 | 72,157,174 | -1 | true | 2022-05-07T23:41:40.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get an ID attribute to work inside a span on Visual Studio<p>I am very new to coding. I am trying to put an ID attribute into a span on visual stud... |
72,144,750 | Excel Write cell if another cell has a 1<p>I have done some digging and I haven't found the solution to my problem. To be honest I don't know the "keywords' to search to find the solution to this problem.</p>
<p>I have a list of names in a in one sheet2.</p>
<p>I want to scan a column with that person's name at th... | <p>Assuming your data are in the cells below on <em>Sheet1</em> (it's impossible to be sure between your having merged cells, and no row labels visible):
<a href="https://i.stack.imgur.com/imwwE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/imwwE.png" alt="rendering of OP's Sheet1" /></a></p>
<p>I ... | Excel Write cell if another cell has a 1 | google-sheets | -2 | 38 | 1 | 72,157,420 | 72,157,420 | -1 | true | 2022-05-06T16:33:30.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel Write cell if another cell has a 1<p>I have done some digging and I haven't found the solution to my problem. To be honest I don't know the "keywo... |
72,201,459 | How to avoid `for` loops for indexing for huge data<p>This is my code. I would like to avoid <code>for</code> loop for huge number of iterations.</p>
<pre><code>iterations = 10000
max_number = 9700
W = is a matrix(300,9700)
def grad_function(x,y):
grad = np.sum(W*(x - y))
return grad
x = np.arange(300)
y = np... | <p>As far as I understand a <code>map()</code> does essentially the same as your nested <code>for</code>-loops and if you need to check every value in the matrix, this will be one of the fastest options anyway.</p> | How to avoid `for` loops for indexing for huge data | python|numpy|for-loop | -2 | 64 | 2 | 72,201,554 | 72,201,554 | -1 | true | 2022-05-11T12:56:12.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to avoid `for` loops for indexing for huge data<p>This is my code. I would like to avoid <code>for</code> loop for huge number of iterations.</p>
<pre><c... |
72,219,868 | i tried to style my navbar but it is not working well and i don't know why?<p>i am trying to make an unordered list in the navbar and make anchors inline but the style doesn't apply. the below style of stylish navbar not working . but it applies when i try to change background color</p>
<pre><code><!DOCTYPE html>... | <p>Flex only applies to the immediate children. Right now, it's just applying to the h1 and ul.</p>
<p>Add</p>
<pre><code>.stylishnavbar > ul { display: flex; }
</code></pre>
<p>To apply flex to your list.</p> | i tried to style my navbar but it is not working well and i don't know why? | html|css | -2 | 35 | 2 | 72,219,902 | 72,219,902 | -1 | true | 2022-05-12T17:27:45.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
i tried to style my navbar but it is not working well and i don't know why?<p>i am trying to make an unordered list in the navbar and make anchors inline but... |
72,150,252 | How to use best use vb.net to automate task in binance smart chain or ethereum network?<p>Basically I want to automate some tasks in crypto currency.</p>
<p>For example, say I want to buy bitcoin if the price in a defi is 36k</p>
<p>In cefi there is an API for that.</p>
<p>What about in defi?</p>
<p>After that I need t... | <p>I did research on google.</p>
<p>The best I can come up is</p>
<p><a href="https://medium.com/coinmonks/a-net-developers-workflow-for-creating-and-calling-ethereum-smart-contracts-44714f191db2" rel="nofollow noreferrer">https://medium.com/coinmonks/a-net-developers-workflow-for-creating-and-calling-ethereum-smart-co... | How to use best use vb.net to automate task in binance smart chain or ethereum network? | vb.net|cryptography|ethereum|nethereum | -2 | 124 | 1 | 72,394,862 | 72,394,862 | -1 | true | 2022-05-07T07:06:43.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use best use vb.net to automate task in binance smart chain or ethereum network?<p>Basically I want to automate some tasks in crypto currency.</p>
<p>... |
72,143,138 | How can I solve Uncaught TypeError?<p>While trying to push element in array, I receive an error:</p>
<blockquote>
<p>main.js:1 Uncaught TypeError: Cannot read properties of null (reading
'document')
at main.js:1:50</p>
</blockquote>
<p>Here is my code:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-c... | <h5>There are two mistakes in your code.</h5>
<ol>
<li>You are targeting the <code>id</code> by using <code>document.getElementById(".input")</code>, however; <em><strong>id</strong></em> in html is <code>input</code> not <code>.input</code>. You have to remove <code>.</code> before <code>input</code>.</li>
<... | How can I solve Uncaught TypeError? | javascript | -2 | 126 | 2 | 72,143,662 | 72,143,662 | -1 | true | 2022-05-06T14:28:52.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I solve Uncaught TypeError?<p>While trying to push element in array, I receive an error:</p>
<blockquote>
<p>main.js:1 Uncaught TypeError: Cannot rea... |
72,211,787 | How increment id tag with map function in React<p>I have array in react like</p>
<pre><code>[
{
no:"s1",
name:"abcd"
},
{
no:"s1",
name:"abcd"
}
]
</code></pre>
<p>I want to use map function to render in UI but. I want id to be increment with map integrations</p>
<p>eg</p... | <p>you can just use array <code>index</code> for that</p>
<pre><code>const data = [
{
no:"s1",
name:"abcd"
},
{
no:"s1",
name:"abcd"
}
]
...
return <ul>
{data.map((item, i) => <li key={i} id={i+1}>{item.no} {item.name}</li>)}
</ul>
</code></pr... | How increment id tag with map function in React | javascript|reactjs | -2 | 162 | 1 | 72,211,829 | 72,211,829 | -1 | true | 2022-05-12T07:44:31.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How increment id tag with map function in React<p>I have array in react like</p>
<pre><code>[
{
no:"s1",
name:"abcd"
},
{
no:"... |
72,178,411 | Using Javascript Template Literals With The prepend() Method<p>I have a loop of button elements that are outputted with a <code>while</code> loop from data called from a MySQL database via PHP.</p>
<p>A user can add a button to this list and I want to add the new button and it's associated HTML using the <code>prepend(... | <p>The solution to this was using the <code>insertAdjacentHTML</code> method. The question/answer given in one of the comments helped me on this, but I don't think it is a duplicate question, and the question linked to has an overly complicated answer IMHO.</p>
<p><div class="snippet" data-lang="js" data-hide="false" d... | Using Javascript Template Literals With The prepend() Method | javascript|prepend|template-literals | -2 | 83 | 2 | 72,178,581 | 72,178,581 | -1 | true | 2022-05-09T21:31:41.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Javascript Template Literals With The prepend() Method<p>I have a loop of button elements that are outputted with a <code>while</code> loop from data c... |
71,426,553 | Listing products function for users with WooCommerce<p>I have a one simple question - is it real to create function which allows to users list their own products on my website, with Word Press and WooCommerce plugin ? Can you share solutions if is ?
Thank you !</p> | <pre><code>$args = get_posts( [
'post_type' => 'product',
'post_status' => [ 'publish', 'pending' ],
'author' => get_current_user_id(),
'posts_per_page' => 50,
'page' => 1,
'offset' => 0,
'orderby' => 'post_date',
'order' ... | Listing products function for users with WooCommerce | wordpress|woocommerce | -2 | 26 | 1 | 71,427,051 | 71,427,051 | 0 | true | 2022-03-10T15:18:17.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Listing products function for users with WooCommerce<p>I have a one simple question - is it real to create function which allows to users list their own prod... |
71,440,105 | how to get height and 'X' value from react tag using BeautifulSoap?<p>Hi I am trying to get the bar graph height and value of x from this site
<a href="https://www.sofascore.com/football/livescore" rel="nofollow noreferrer">https://www.sofascore.com/football/livescore</a><br />
Here is what I want to do
<a href="https:... | <p>There's an api to get that. Just input the event ID.</p>
<pre><code>import requests
import pandas as pd
eventId = 10181868
url = f'https://api.sofascore.com/api/v1/event/{eventId}/graph'
jsonData = requests.get(url).json()
df = pd.DataFrame(jsonData['graphPoints'])
</code></pre>
<p><strong>Output:</strong></p>
<pr... | how to get height and 'X' value from react tag using BeautifulSoap? | python|selenium|web-scraping|web-scraping-language | -2 | 31 | 1 | 71,440,457 | 71,440,457 | 0 | true | 2022-03-11T14:34:30.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get height and 'X' value from react tag using BeautifulSoap?<p>Hi I am trying to get the bar graph height and value of x from this site
<a href="https... |
71,283,511 | Why can't I create a view with a visual interface?<p>When the narrator in the video I watched on the Internet creates a view, he adds tables to the view with a visual interface as in the 1st picture, and sets the relations between the tables. But when I create a view, a code screen greets me and I need to create a view... | <p>The visual interface I'm looking for is also available in SSMS. I use SSMS to use visual interface. my problem is solved.</p> | Why can't I create a view with a visual interface? | sql|visual-studio | -2 | 29 | 1 | 71,708,550 | 71,708,550 | 0 | true | 2022-02-27T09:16:09.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I create a view with a visual interface?<p>When the narrator in the video I watched on the Internet creates a view, he adds tables to the view with... |
71,802,538 | What is the box on inspect browser<p>What does this purple box represent when inspecting element in inspect, because it is not a padding, margin or Border and occupies the space inside the div</p>
<p><a href="https://i.stack.imgur.com/9IpKh.png" rel="nofollow noreferrer">[1]: https://i.stack.imgur.com/14nnb.png</a></p> | <p>You can think of it as space that belongs to an element that is not:</p>
<ul>
<li>padding</li>
<li>margin</li>
<li>border</li>
<li>children</li>
</ul>
<p>I might be missing some, but it's just space not used that has to be accounted for somehow. It comes up when you do a layout that isn't the result of sizing and pa... | What is the box on inspect browser | css|inspect|web-inspector | -2 | 30 | 1 | 71,802,827 | 71,802,827 | 0 | true | 2022-04-08T19:54:53.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the box on inspect browser<p>What does this purple box represent when inspecting element in inspect, because it is not a padding, margin or Border an... |
71,805,195 | Why am I getting NullPointerException on my "plain1.findPosition(iMsg)"?<p>First Class which is giving me the error. I'm to make an array with the letters A-Z, and then have the user input the keys which it takes and compares each character's position in the array of the key with the position of a user inputted string<... | <p>You are not assigning your class variables, you are actually assigning new local variables inside the method. Change to:</p>
<pre><code>public Encryption(String key1, String key2) {
plain1 = new Square();
plain2 = new Square();
Encrypt1= new Square(key1);
Encrypt2= new Square(key2);
... | Why am I getting NullPointerException on my "plain1.findPosition(iMsg)"? | java|arrays|sorting|nullpointerexception | -2 | 23 | 1 | 71,805,228 | 71,805,228 | 0 | true | 2022-04-09T04:15:09.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why am I getting NullPointerException on my "plain1.findPosition(iMsg)"?<p>First Class which is giving me the error. I'm to make an array with the letters A-... |
71,835,541 | Steps to open a php project sent to me<p>after open the project and create database,,,,</p>
<p>Fatal error: Uncaught Exception: SQLSTATE[HY000] [1045] Access denied for user 'id18629747_netmonitor_user'@'localhost' (using password: YES) in</p> | <p>You should add the user and grant it privileges to access your database. Via mysql console for example:</p>
<pre><code>create user id18629747_netmonitor_user@localhost identified by '%YOUR_PASSWORD_HERE%';
grant all on %YOUR_DATABASE_NAME_HERE% to id18629747_netmonitor_user@localhost;
</code></pre> | Steps to open a php project sent to me | php | -2 | 15 | 1 | 71,837,117 | 71,837,117 | 0 | true | 2022-04-12T00:00:39.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Steps to open a php project sent to me<p>after open the project and create database,,,,</p>
<p>Fatal error: Uncaught Exception: SQLSTATE[HY000] [1045] Access... |
71,852,751 | Can i somehow insert number multiple times into input?<p>this code while i click two times: 2<br>
what i need: 11</p>
<pre class="lang-html prettyprint-override"><code><div id='one'></div>
<input type="number" id='pin'/>
<script>
document.getElementById('one').onclick = document.getEl... | <pre><code><div id='one'></div>
<input type="number" id='pin'/>
<script>
var one = document.getElementById('one');
var pin = document.getElementById('pin');
one.onclick = function(){
pin.value = pin.value + '1';
}
</script>
</code></pre> | Can i somehow insert number multiple times into input? | javascript|html | -2 | 21 | 1 | 71,853,030 | 71,853,030 | 0 | true | 2022-04-13T06:20:55.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can i somehow insert number multiple times into input?<p>this code while i click two times: 2<br>
what i need: 11</p>
<pre class="lang-html prettyprint-overr... |
71,882,110 | If else statement seems to fail executing correctly<p>I got a discord Bot in which I want to implement a own logging System. The problem here is that I check if I want to check if the bot was shut down in the last log, it detects it but still does something wrong of which I don't really know what.</p>
<p>This is the re... | <p>The problem here is that you call <code>f.read()</code> twice, so the second read will return an empty string because the end of the file was reached after the first read.</p>
<p>What you can do instead is save the output of <code>f.read().endswith('Bot wird heruntergefahren')</code> in a variable before printing it... | If else statement seems to fail executing correctly | python|python-3.x|io|discord.py | -2 | 27 | 1 | 71,882,203 | 71,882,203 | 0 | true | 2022-04-15T09:07:35.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If else statement seems to fail executing correctly<p>I got a discord Bot in which I want to implement a own logging System. The problem here is that I check... |
71,900,079 | How to simply the python code in getting items from tuples?<p>How to write a loop to get the items from tuples?</p>
<p>The tuples are:</p>
<pre><code>order = (1, 0, 1)
seasonal_order = (0, 1, 1, 12)
</code></pre>
<p>The codes I wrote:</p>
<pre><code>d = (bestdpq['order'])[0]
p = (bestdpq['order'])[1]
q = (bestdpq['or... | <p>Use unpacking (and better variable names than <code>d</code>, <code>p</code> and <code>q</code>)</p>
<pre><code>d, p, q = bestdpq['order']
</code></pre>
<p>In case of <code>bestdpq['seasonal_order']</code> where you have 4 elements in the tuple but want the first 3 you can use <code>_</code> which is the convention ... | How to simply the python code in getting items from tuples? | python | -2 | 32 | 2 | 71,900,097 | 71,900,097 | 0 | true | 2022-04-17T07:31:46.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to simply the python code in getting items from tuples?<p>How to write a loop to get the items from tuples?</p>
<p>The tuples are:</p>
<pre><code>order =... |
71,904,331 | How can I print the 1st and 2nd elements on a line, then 2nd and 3rd on the next line, then 3rd and 4th next line, and so on<p>I'm trying to print array elements 1st and 2nd in one line, then next line 2nd and 3rd elements, but I'm still stuck.</p>
<p>Input:</p>
<pre><code>const arr = [10, 20, 30, 40, 50];
</code></pre... | <pre><code>for (let i = 0; i < arr.length - 1; i ++) {
console.log(arr[i] + ' - ' + arr[i+1]);
}
</code></pre>
<p>but I'd recommend using the syntax</p>
<pre><code>console.log(`${arr[i]} - ${arr[i+1]}`)
</code></pre> | How can I print the 1st and 2nd elements on a line, then 2nd and 3rd on the next line, then 3rd and 4th next line, and so on | javascript | -2 | 18 | 1 | 71,904,375 | 71,904,375 | 0 | true | 2022-04-17T18:13:32.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I print the 1st and 2nd elements on a line, then 2nd and 3rd on the next line, then 3rd and 4th next line, and so on<p>I'm trying to print array elem... |
71,920,385 | How do I extract duplicate values for objects in JavaScript?<p>I have the data from the database and I want to push the duplicate value to each array. I attach the exact example I want.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre c... | <p>One way would be to use <code>reduce</code> together with <code>Object.values</code>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const data = [
{
name: "Amy",
... | How do I extract duplicate values for objects in JavaScript? | javascript|node.js | -2 | 30 | 1 | 71,920,435 | 71,920,435 | 0 | true | 2022-04-19T06:11:15.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I extract duplicate values for objects in JavaScript?<p>I have the data from the database and I want to push the duplicate value to each array. I atta... |
71,920,798 | how to extract recent data and delete previous data if more column have same value<p><a href="https://i.stack.imgur.com/TvtpC.png" rel="nofollow noreferrer">input data frame</a>(input data have duplicates with some columns ,wants to delete previous data)</p>
<p><a href="https://i.stack.imgur.com/A80zF.png" rel="nofollo... | <p>According to your input and output I think you want to remove duplicate rows:</p>
<pre><code>cols = ['col1', 'col2']
df_output = df_input.drop_duplicates(cols, keep='last')
</code></pre>
<p>You'll have to specify which columns to use, I'm not sure from your example which columns define duplicates</p> | how to extract recent data and delete previous data if more column have same value | python|pandas | -2 | 26 | 1 | 71,920,851 | 71,920,851 | 0 | true | 2022-04-19T06:55:40.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to extract recent data and delete previous data if more column have same value<p><a href="https://i.stack.imgur.com/TvtpC.png" rel="nofollow noreferrer">... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.