Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
60,102,602
Puppeteer check through website content/elements
<p>I need to check through the elements of the website for my code, but I can't understand how to do it with puppeteer on Node.JS <br>Here's the code I tried:</p> <pre><code>if(page.content('input[data-kwimpalaid="1580983806648-1"]')) found = true if(found = true) console.log("I found it") if(found = false) consol...
<javascript><node.js><puppeteer>
2020-02-06 19:56:20
LQ_CLOSE
60,103,350
What does * and ** mean in a C++ function declaration?
<p>In this function declaration:</p> <pre><code>long * multiply(long ** numbers){ </code></pre> <p>What do the * and ** mean? I'm somewhat of a beginner and haven't come across this before, so any explanation would be appreciated.</p>
<c++>
2020-02-06 20:53:07
LQ_CLOSE
60,103,844
Please help, guys
<p>Its app / site like brain trainer </p> <pre><code> &lt;body style="text-align: center;"&gt; &lt;h3 id="num1"&gt;&lt;/h3&gt; &lt;h3 id="num2"&gt;&lt;/h3&gt; &lt;input type="text" id="ans" /&gt; &lt;button id="myBtn" onclick="clickFunction()"&gt;Button&lt;/button&gt; &lt;p id="ind"&gt;&lt;/p&gt;...
<javascript>
2020-02-06 21:32:13
LQ_CLOSE
60,104,689
finding the position of an element within a numpy array in python
<p>I want to ask a question about finding the position of an element within an array in Python's numpy package. </p> <p>I am using Jupyter Notebook for Python 3 and have the following code illustrated below:</p> <pre><code>concentration_list = array([172.95, 173.97, 208.95]) </code></pre> <p>and I want to write a bl...
<python><numpy>
2020-02-06 22:47:15
LQ_CLOSE
60,106,653
What does ^= do in python
<p>I have seen the operator ^= in code now once and I dont know what it does. This was used to find a single occurrence of a number in an array. So A = [1,1,2,3,3] it should return 2. This is how it was used</p> <pre><code>def solution(A): lone_num = 0 for number in A: lone_num ^= number return lo...
<python><arrays>
2020-02-07 03:22:18
LQ_CLOSE
60,109,166
How do I change an Iframe from a text form?
<p>I am trying to have an iframe in which you can change the url of it with a text box.</p> <pre><code>&lt;form action="/action_page.php"&gt; URL: &lt;input type="text" name="firstname" value="test.com"&gt; &lt;input type="submit" value="Visit"&gt; &lt;/form&gt; &lt;iframe width="560" height="315" src="https://www.ex...
<javascript><html><css><iframe><textbox>
2020-02-07 07:50:25
LQ_CLOSE
60,110,342
Finding the index position of an array
<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>var cars = ["BMW", "BENZ", "LAMB", "AUDI"]; var abc = cars.indexOf("BMW"); document.getElementById("demo").innerHTML = abc;</cod...
<javascript>
2020-02-07 09:12:17
LQ_CLOSE
60,111,866
c# identifier expected in controller
<p>When i type this in my controller page I am getting the error message "Identifier expected" after "loginViewModel". Any idea on how to fix this? </p> <pre><code>public IActionResult Login(LoginViewModel, string Email, string Password) { return View(); } </code></pre>
<c#><asp.net-mvc>
2020-02-07 10:45:39
LQ_CLOSE
60,112,833
I does not know why it is 25
<p>[enter image description here][1]</p> <p>[1]: <a href="https://i.stack.imgur.com/gg6E1.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/gg6E1.jpg</a> Please tell me why it is 25.</p>
<garbage-collection><v8>
2020-02-07 11:44:57
LQ_CLOSE
60,113,051
JAVA: You have an error in your SQL syntax; check the manual that corresponds?
<p>I'm using <strong>Java + MySQL</strong> for a game server project of mine. I'm having a problem though -</p> <pre><code>MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(connection) (`uuid`, `name`, `joi...
<java><mysql><sql><syntax>
2020-02-07 11:57:13
LQ_CLOSE
60,122,877
how to print function-returned values in python
I have the following function: import pandas as pd def foo(): d1 = {'data1': ['A', 'B', 'C']} d2 = {'data2': [20, 30, 40]} df1 = pd.DataFrame(d1) df2 = pd.DataFrame(d2) return df1, df2 df1, df2 = foo() I am trying to get the foll...
<python><pandas><dataframe>
2020-02-08 00:34:26
LQ_EDIT
60,123,788
Comparing Text Fields Value
<p>using the Internet, Android Studio, and your current knowledge of Android app development, create an Android app project that has two (2) text fields and one (1) button. The button will compare the input from the text fields and display a response (SAME if values are the same and NOT THE SAME if they are not) if it ...
<android><android-studio><compare><textfield>
2020-02-08 03:55:13
LQ_CLOSE
60,124,217
python not understanding simple math question
<p>I am making mortgage calculator, I have provided information for variables p, i, n, but get error in the equation.</p> <pre><code>p[i(1 + i) ^ n] / [(1 + i) ^ n – 1] </code></pre>
<python><variables><math>
2020-02-08 05:33:28
LQ_CLOSE
60,124,384
Infinite loop while traversing through linked list
<p>Deleting and viewing entire queue causes the problem- I'm assuming it is an infinite loop case for traversing. It works perfectly fine for adding the element but execution stops right after 2 or 3 are selected by the user.</p> <p>I'm just adding some lines of random text before the code because stack isn't allowing...
<c++><linked-list>
2020-02-08 06:05:16
LQ_CLOSE
60,124,794
How to stop the closing of date-picker of pickadate.js on blur?
I want to remain open my date-picker calendar on click outside the calendar. Please tell me the exact solution. Thanks in Advance.
<javascript><jquery><html><pickadate>
2020-02-08 07:23:56
LQ_EDIT
60,125,184
Year Part Update in sql DateTime Column
[![Table_Data][1]][1] [1]: https://i.stack.imgur.com/o2Fxq.png Need to change only the year part of every ChangedDate Column to 2017. i.e **2017**-02-08 13:55:30.193 **2017**-02-08 13:55:30.193 **2017**-02-08 13:55:30.193
<sql-server><datetime>
2020-02-08 08:32:54
LQ_EDIT
60,125,310
how to convert string to date or date to string
<p>I have a tableview cell with a Date type Date, it shows me the following error and I don't know how to fix it:</p> <blockquote> <p>Error: Cannot assign value of type 'Date' to type 'String?'</p> </blockquote> <pre><code>cell.Resum_Controls_Data_txt.text = control.data </code></pre> <p>control.data (is type Date...
<swift><date><cell>
2020-02-08 08:56:10
LQ_CLOSE
60,125,810
Is there any reason why you would need to use `Environment.NewLine` instead of `backslash n` in Xamarin code?
Here's an example of my code: Shell.Current.DisplayAlert($"Stop Quiz {Settings.Quiz}", $"{Environment.NewLine}You tapped the {target} icon at the bottom of this page. The quiz will be stopped and you will be taken to the {target} screen.{Environment.NewLine}{Environment.NewLine}Please confirm{Environment...
<xamarin><xamarin.forms>
2020-02-08 10:14:39
LQ_EDIT
60,126,372
How to create a blog with only index.html, style.css and script.js files?
<p>Inspiration for blog listing pages: <a href="https://blog.hubspot.com/marketing" rel="nofollow noreferrer">https://blog.hubspot.com/marketing</a></p> <p><a href="https://www.igomoon.com/blog" rel="nofollow noreferrer">https://www.igomoon.com/blog</a></p> <p>I only want to know from where should I start? from the b...
<javascript><html><css><blogs>
2020-02-08 11:34:38
LQ_CLOSE
60,127,736
Is colorama the only way to change the python shell output colour?
<p>So I have been trying to change the colour of the output in the shell, but it just ends up returning boxes. I am using python 3.7.4.</p> <p><a href="https://i.stack.imgur.com/qPF6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qPF6C.png" alt="The code and the output"></a></p>
<python>
2020-02-08 14:27:28
LQ_CLOSE
60,127,901
Can someone please explain this recursion question the problem is solved?
<blockquote> <p>Given base and n that are both 1 or more, compute recursively (no loops) the value of base to the n power, so powerN(3, 2) is 9 (3 squared).</p> </blockquote> <p>The answer is </p> <pre><code>public int powerN(int base, int n) { if(n == 1) return base; return base * powerN(base, n -...
<java><recursion>
2020-02-08 14:48:18
LQ_CLOSE
60,127,991
Simple JSON parsing with Jackson
<p>I did not write a lot in Java yet, but I wonder if there is a simple way, to parse JSON and work with the results into a map just like we would do it in other modern languages:</p> <pre><code>string = loadFromSomeWhere(URI) dictionary = JSON.parse(string) // do something with the dictionary </code></pre> <p>I do n...
<java><json><jackson>
2020-02-08 14:58:56
LQ_CLOSE
60,128,142
Why is the select not visible entirely?
using MaterializeCSS, there is a modal window with a form. It is expected that there will be a lot of option in select, however, as you can see in the screenshot, the modal window "overlaps" the option part. How to win? [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/AfiLv.png
<css><select><modal-dialog><dropdown><materialize>
2020-02-08 15:16:50
LQ_EDIT
60,128,152
tweepy : ow get more than 100 different record per day per query using Twitter Standard API?
I'm trying to download a list of tweet using the standard API but what I get are always the same records. i.e. this is my request: ``` ApiSearch = api.search(q="#immigration", lang="en", result_type="mixed", count=100, until=untilDate, include_entities=False) ``` but if I run it now and then between 1 hour the res...
<python><twitter><tweepy>
2020-02-08 15:17:51
LQ_EDIT
60,129,244
while in not working in nested list PYTHON
<p>The first section of code prints 1 but the second doesn't, why and how to produce the above effect?</p> <pre><code>while [1] in k: print(1) k=[[0],[1,1,1],[0]] while [1] in k: print(1) </code></pre>
<python>
2020-02-08 17:23:18
LQ_CLOSE
60,130,922
can anyone solve it for me
<hr> <p>IndexError Traceback (most recent call last) in ----> 1 print('the {2} {1} {3}'.format('brown', 'fat', 'fox',))</p> <p>IndexError: tuple index out of range<strong>strong text</strong></p>
<python><jupyter-notebook><anaconda>
2020-02-08 20:31:28
LQ_CLOSE
60,131,733
How can you create a command to run other applications in Windows Batch?
<p>My goal is to run other programs through the command of one in Windows Batch. <a href="https://i.stack.imgur.com/IdkDW.png" rel="nofollow noreferrer">Here are the files I would like to run through a single command if possible.</a> </p> <p>However the code that I have attempted at best is this</p> <pre><code>start ...
<html><batch-file><vbscript>
2020-02-08 22:17:09
LQ_CLOSE
60,133,085
How to give canvas an id
<p>How can i give these canvas' in JS/html an id?</p> <p>I want to make multiple flashing images on a single page and when I do only one image displays as there is no way to know which canvas to display, below is a link to my project.</p> <p><a href="https://glitch.com/edit/#!/join/4cb25634-5dc4-45b8-8e28-060e6b1a98a...
<javascript><canvas><id>
2020-02-09 02:52:58
LQ_CLOSE
60,133,426
Date matching in Swift not working code there
<p>iam trying to send some string dates to one method and if its matching the date format then return true,</p> <p>my input paramters look like "4325/353/53" this is fail case and success case "09/25/2020"</p> <p>my methode, but this is returning fail for everything. pls help</p> <pre><code>func isValidDate(dateStri...
<ios><swift>
2020-02-09 04:21:48
LQ_CLOSE
60,134,531
How do you handle collection and storage of new data in an existing system?
<p>I am new to system design and have been asked to solve a problem.</p> <p>Given a car rental service website, I need to work on a new feature.</p> <p>The company has come up with some more data that they would like to capture and analyze along with the data that they already have.</p> <p>This new data can be somet...
<database><database-design><architecture>
2020-02-09 07:50:04
LQ_CLOSE
60,135,318
Filling user card with the information from the form
<p>I need to create the card which is filled with the information as soon as the user types something into the form. For example, he enters his name and the name appears on the card. The page shouldn't be reloaded, the info on the card must appear instantly. </p>
<javascript><html>
2020-02-09 09:50:47
LQ_CLOSE
60,135,694
i got this error in androidStudio : java.lang.NumberFormatException: For input string: " "
for example i want to create contacts that only has two fields name and age, but only name is important for me. public class Contact { public String name; public int age; public Contact(String name) { this.name = name; } public Contact() { } public Conta...
<android>
2020-02-09 10:37:08
LQ_EDIT
60,136,357
Display numbers from 0 to X vis versa
<p>i need your help in this puzzle: i want to take an input from the user as X and display numbers from 0 to X and from X to 0. the trick is to use only one variable. how could i solve this in java</p>
<java>
2020-02-09 11:58:39
LQ_CLOSE
60,138,318
Swift development pods
<p>is there some good tutorial where I can follow, is there a good tutorial for better understanding, the ones I find i just create the pod and them publish, there is no implementation for me start to develop my own</p>
<swift><cocoapods>
2020-02-09 15:42:25
LQ_CLOSE
60,138,452
dotnet run is not a recognized command line
<p>I have a very simple service. I'm able to start it normally through Visual Studio if I run my service on a debug mode. But I'm trying to run this service while I'm running my project normally locally.</p> <p>If I do a dotnet.run through my command prompt I get this error: dotnet is not a recognized and internal or ...
<c#><asp.net><visual-studio>
2020-02-09 15:54:26
LQ_CLOSE
60,138,465
Reading integers from a text file containing integers and strings
So here is my code and the only options I have in the chapter we are on are the while (!scan.hasNextInt()). This is my code and it works until I try to read a file with strings. The file looks like this: 1 2 John 3 4 Black 5 Jason 7 8 I do not understand how to use this method. My code: import...
<java>
2020-02-09 15:56:06
LQ_EDIT
60,138,563
Scope Issue in java
<pre><code>public class Calculator { private int total; private int value; public Calculator(int startingValue){ int total = startingValue; value = 0; } public int add(int value){ int total = total + value; return total; } /** * Adds the instance varia...
<java><scope>
2020-02-09 16:06:35
LQ_CLOSE
60,140,123
Extract strings from a list element of a certain size,
Say I have a list of names: names = ["David", "Lee", "Sara", "Daniel", "Nick"] I want to move the list elements that have a character count of less than 5 (not including 5) into a new list called short_names that would look like this: short_name ["Lee", "Sara", "Nick"] How can I do this with a for l...
<python><string><list>
2020-02-09 18:49:09
LQ_EDIT
60,146,978
I want to print a string multiple time but in a new line
print('python'*5,sep='\n') [][1] [1]: https://i.stack.imgur.com/zB3HT.png how to print it in new line Ex: python python python
<python><python-3.x>
2020-02-10 08:58:20
LQ_EDIT
60,149,360
How to put text on top of image when images arranged in list and heavily styled
Link to HTML + CSS: https://jsfiddle.net/babis95/zdhne95u/ I have some HTML and CSS setup for a simple image gallery. I've been trying to add white text on top of each of the images in the center. I researched different ways but none seem to work with they way i set up my code: ``` .section-images p { co...
<html><css>
2020-02-10 11:23:12
LQ_EDIT
60,149,450
How to make the encoded value in format
YTo2OntpOjA7czo0OiIyMDY3IjtpOjE7czo0OiIyMDY4IjtpOjI7czo0OiIyMDY5IjtpOjM7czo0OiIyMDcwIjtpOjQ7czo0OiIyMDcxIjtpOjU7czo0OiIyMDcyIjt9 Above mention is my encoded value. When iam trying to decode it iam getting the output in this format a:6:{i:0;s:4:"2067";i:1;s:4:"2068";i:2;s:4:"2069";i:3;s:4:"2070";i:4;s:4:"2071";i:5;...
<php>
2020-02-10 11:28:56
LQ_EDIT
60,152,799
How can i fix the terminated console
I am trying to do cipher game. Our teacher said it will be 2 mode. First mode will be normal mode which is one of the quote will be choosen randomly. Second mode is the test mode which is you will choose a quote. In the test mode i cant go further because it says terminated i dont know what is the problem. impor...
<java><arrays>
2020-02-10 14:47:07
LQ_EDIT
60,153,820
ER Diagram Design: Should every entity have a primary key? And can we have sub entity?
**Problem: Design a ER diagram such as:** - An item has the attribute: description. - An item can be sold by a company or a person. - A person has the attributes: name, phone and email. - A company has the attributes: company name, address and a contact person who is one from the person entity set. - A cont...
<database><database-design><entity-relationship><erd>
2020-02-10 15:46:39
LQ_EDIT
60,161,316
Create a program that asks the user for an age. It tells them their grade (9, 10, 11 or 12) based on their response. Python
age = (int(input("How old are you?"))) if (age == 14 or age ==15): print ("you are in grade 9") if (age == 15): print("or") if (age == 15 or age == 16): print ("you are in grade 10") if (age == 16): print("or") if (age ==...
<python><python-3.x><if-statement>
2020-02-11 02:52:37
LQ_EDIT
60,161,742
Why is "parameters" is not defined
I am following the tutorial at https://www.dataquest.io/blog/python-api-tutorial/. It is saying that "parameters" is not defined. the URL has params=parameters, I have used both in the coding and still getting error. Not sure how to correct it. This is the code: <code> import requests import json response...
<python><python-requests>
2020-02-11 03:50:12
LQ_EDIT
60,163,916
No such external account . Stripe Payout not working using php?
**I am transferring fund from stripe account to connect account using payout api ** my code is: $payout = \Stripe\Payout::create([ 'amount' => 500, 'currency' => 'aud', 'description' => 'first payout payment transfer on stripe', ...
<php><laravel><stripe-payments>
2020-02-11 07:31:00
LQ_EDIT
60,169,005
How upload multiple files angular 7/8 using Queue with progress bar and create main progress bar for all files
I need multiple files to upload in angular 7/8 using queue with creating one progress bar to upload all files.
<javascript><angular>
2020-02-11 12:40:52
LQ_EDIT
60,169,679
Create a folder and subfolder when selecting a cell in excel (VBA)
I am a total newbie in VBA so I hope you could help me with this. I want to create a folder inside a given path. Inside the folder, I want a subfolder. The name of the folder will be indicated in column A and of the subfolder in column B of an excel worksheet. The path will be in column C. [enter image description ...
<vba><button><subdirectory><create-directory>
2020-02-11 13:13:21
LQ_EDIT
60,169,709
Remove strings from a list that starts with '0'
My code ---------- l=['99','08','096'] for i in l: if i.startswith('0'): i.replace('0','') print(l) Output --------- l=['99','08','096']
<python><python-3.x><string><list><for-loop>
2020-02-11 13:14:50
LQ_EDIT
60,182,022
why I got UnicodeDecodeError when i use python3 readlines to read a file which contains Chinese characters?
``` >>> path = 'name.txt' >>> content = None >>> with open(path, 'r') as file: ... content = file.readlines() ... Traceback (most recent call last): File "<stdin>", line 2, in <modu...
<python><encoding>
2020-02-12 05:59:21
LQ_EDIT
60,199,187
How to Replace text partially in linux using sed
I have an xml tag that I need to manipulate on linux <m1:PayloadId>TESTCASE01_0000123456</m1:PayloadId> I need to change the text from "TESTCASE01_0000123456" to "TESTCASE01_1234567890" between the tags I used the sed command in my code:"**sed -i 's/PayloadId>.*</m1:PayloadId>'0000123456'</g' t1.xml**" but it repl...
<awk><sed><xmlstarlet>
2020-02-13 01:22:36
LQ_EDIT
60,202,155
Why, when I print a derefrenced pointer in main that points to a variable declared in a function, does it not print junk memory. (GOLANG)
package main 2 3 import "fmt" 4 5 6 func point(x int) *int { 7 8 y := x 9 return &y 10 11 } 12 13 14 func main() { 15 16 x := 10 17 18 pointer := point(x) 19 20 fmt.Println(*pointer) 21 22 23 24 25 } Shouldn'...
<go>
2020-02-13 07:02:31
LQ_EDIT
60,209,931
How to branch recursion into returning only a list of lists (Python)
I'm having a problem where I what I need returning should be a list of lists, with each nested list being a list of 2 strings. I can't find a way to flatten this list effectively, or to return just the list of lists, as the number of nested lists is undeterminable. This is happening in my recursive function, where I br...
<python><python-3.x><list><recursion><nested-lists>
2020-02-13 14:17:36
LQ_EDIT
60,210,417
i want to code this button in pictures with the following animation if possible
i am trying to create this button in html with a little animation as below how can i achieve this ? i have tried some ideas but failed as usual :D ~~~ <div class="skew-btn"> <div class="btn"> <div class="main"> <a href="#hire">Hire me</a> </div> </div> </div> ~~~ here is how i see i...
<javascript><html><css>
2020-02-13 14:43:59
LQ_EDIT
60,210,610
I'm just beginning to learn C: Can someone explain what the pointers and typecasting are doing in this code?
<p>//Beginning of a Function:</p> <pre><code>char *encrypt(char *string, size_t length) { } </code></pre> <p>I am beginning a simple encryption function, and I'm wondering what exactly the above code is carrying out? I am assuming I'm initializing an encrypt function as char pointer, with a memory destination 'string...
<c><pointers>
2020-02-13 14:53:53
LQ_CLOSE
60,211,237
HTML - Text/Button Alignment (CSS Media)
<blockquote> <p><a href="https://jsfiddle.net/5d401nso/1/" rel="nofollow noreferrer">https://jsfiddle.net/5d401nso/1/</a></p> </blockquote> <pre><code>#mobileview{ /*background-image:url(""); background-size:100% 100%;*/ width:auto; height:auto; } @media(max-width: 768px){ #mobileview{ width:411px; heigh...
<html><css>
2020-02-13 15:26:36
LQ_CLOSE
60,212,780
Is `string.assign(string.data(), 5)` well-defined or UB?
<p>A coworker wanted to write this:</p> <pre><code>std::string_view strip_whitespace(std::string_view sv); std::string line = "hello "; line = strip_whitespace(line); </code></pre> <p>I said that returning <code>string_view</code> made me uneasy <em>a priori</em>, and furthermore, the aliasing here looked like UB t...
<c++><stl><undefined-behavior>
2020-02-13 16:44:35
HQ
60,213,364
Xcode 11.4 Circular Reference errors
<p>When compiling project on Xcode 11.4 (on previous Xcode project is building fine) I get following 999+ errors (Did clean build and deleted derived data):</p> <pre><code>&lt;unknown&gt;:0: error: circular reference &lt;unknown&gt;:0: error: circular reference &lt;unknown&gt;:0: note: through reference here &lt;unkno...
<ios><swift><xcode>
2020-02-13 17:21:49
HQ
60,213,604
automatically convert string to appropriate type
<p>I am trying to find a function to have python automatically convert a string to the "simplest" type. Some examples:</p> <pre><code>conversion_function("54") -&gt; returns an int 54 conversion_function("6.34") -&gt; returns a float 6.34 conversion_function("False") -&gt; returns a boolean False conversion_function("...
<python>
2020-02-13 17:37:51
LQ_CLOSE
60,214,641
PHP quotes in SQL
<p>Why does this code produce an error</p> <pre><code> $sql = "INSERT INTO accountlist VALUES ("", "$user", "'$pwd", "$mail", "$date")"; </code></pre> <p>and this one doesn't?</p> <pre><code> $sql = "INSERT INTO accountlist VALUES ('', '$user', '$pwd', '$mail', '$date')"; </code></pre> <p>I know that double quote...
<php><mysql><sql><quotes>
2020-02-13 18:50:28
LQ_CLOSE
60,215,841
$_POST is not what I expect it to be
<p>I want to write a very simple web page. There is only one button which triggers a POST method which is called on a PHP file. But the $_POST variable in the PHP file remains empty when the button is clicked. Here are my codes:</p> <p>index.html:</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;he...
<php><jquery>
2020-02-13 20:20:20
LQ_CLOSE
60,216,317
Is go evaluation order between member invocations guaranteed?
<p>Let's say I have a struct with state, and a few member functions on that struct. Let's say that the struct member returns an instance of its own type, and I call additional functions on that instance, and pass the result of calling some other member on the initial instance as an argument. Is the order of invocation ...
<go><expression-evaluation>
2020-02-13 20:55:25
LQ_CLOSE
60,217,910
how can I simplify my if-else statement in java?
In my code I have a method `size(MyData)` that returns size of data - it can be 0 or greater. I also have a flag `exclude` that can be `true` or `false`. The point of my algorithm is to do some operation on data based on its size and the value of the flag. - If the size is greater than 0, I want to do operation on ...
<java><if-statement>
2020-02-13 23:19:41
LQ_EDIT
60,217,930
java, best API jar
<p>I'm building one API using javax.ws.rs-api(2.1.1) and com.sun.jersey (1.18.1) but it causes one Exception. Reading some threads it seems like one of both includes one class that is part of the other and this raises this Exception. After some tries I'm still stucked on find how to fix it but then another question cam...
<java><api><servlets>
2020-02-13 23:21:55
LQ_CLOSE
60,220,258
how to Send automated SMS using API?
I have this condition to scheduled my sms.(ERROR) but the sms im using is POST method I need to be automated. and send sms to the number of the current id. i dont know how to get the number of the current id and send the message. here is my code: I NEED HELP $duedate = ""; $date_now=date("Y-m-d"); d...
<php><sms>
2020-02-14 05:01:28
LQ_EDIT
60,223,024
Nested function returning a variable through the outer function in python
<p>I have a requirement which I am going to try an explain through the below example:</p> <p>Suppose we have a segment of code like this:</p> <pre><code>def a: def b: x = 2 </code></pre> <p>Now I want to return x through the function a. Is there any way to do it in python?</p>
<python><python-3.x>
2020-02-14 09:00:48
LQ_CLOSE
60,223,729
How to insert a character at a certain position in a number without converting it into a string?
<p>I have to insert "/" between 2020 and 0001 in the number 20200001. I know how to do it by converting the number to string, but I am unable to do it by not converting it.</p>
<javascript>
2020-02-14 09:43:52
LQ_CLOSE
60,226,927
python replace value if it starts with certain character
I have a following list and I am trying to replace any value which starts with ```23:``` to ```00:00:00.00``` ```tc = ['00:00:00.360', '00:00:00.920', '00:00:00.060', '00:00:02.600', '23:59:55.680', '00:00:05.960', '00:00:01.040', '00:00:01.140', '00:00:01.060', '00:00:01.480', '00:00:00.140', '00:00:00.280', '23:59...
<python><list><if-statement><list-comprehension><conditional-operator>
2020-02-14 13:05:33
LQ_EDIT
60,227,720
random numbers from to C++
I want it to display random numbers from to the value it writes but something is not working properly there is code #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int draw(int from_to, int to_from) { return (rand()%to_from)+from_to; ...
<c++><random>
2020-02-14 13:55:14
LQ_EDIT
60,228,096
Which is the best option? Use an unupdated component in React or try to implement the library in react without the component?
<p>I have found some components that are not updated with the last React version, however, those components work. But I was wondering if those components are not updated would be the best option or a good practice to try to implement the libraries in React without the npm packages?</p> <p>Thanks. </p>
<reactjs><npm>
2020-02-14 14:17:37
LQ_CLOSE
60,228,185
Waiting until a variables value isset to display it php
<p>I have a variable $infoCollectedAndSold that is being set inside a form (its values are whatever is being checked in the checkbox). I want to display this variable, once its values are set. Currently the echo is displaying nothing until i submit the form and then the values are displayed from the variable. Is it pos...
<php>
2020-02-14 14:23:29
LQ_CLOSE
60,229,879
How to calculate exact average using arrays in Java
<p>Regardless of what I try, the program outputs the average as the integer "4" when the average should be "4.78". I have tried changing the integers to doubles, but to no avail. </p> <p>The rest of the program works as intended, though. It is supposed to print how many times each value in the text files appears by pu...
<java><arrays>
2020-02-14 16:12:08
LQ_CLOSE
60,229,970
aws cli: ERROR:root:code for hash md5 was not found
<p>When trying to run the AWS CLI, I am getting this error:</p> <pre><code>aws ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in &lt;module&gt; globals()[__func_...
<python><macos><python-2.7><homebrew>
2020-02-14 16:18:06
HQ
60,230,041
Flutter json Decoding _TypeError (type 'List<dynamic>' is not a subtype of type 'Map<dynamic, dynamic>')
<p>So this error I understand kind of what it is, and WHAT I need to do, but I don't understands HOW to do what I'm trying to do.</p> <p>So I'm using an html api server-call, which returns a jsonEncoded List of Map objects.</p> <p>The size of each list CAN (and will) change, so I cannot have a function that just chec...
<arrays><json><api><flutter><decode>
2020-02-14 16:22:01
LQ_CLOSE
60,233,495
Choosing DB pool_size for a Flask-SQLAlchemy app running on Gunicorn
<p>I have a Flask-SQLAlchmey app running in Gunicorn connected to a PostgreSQL database, and I'm having trouble finding out what the <code>pool_size</code> value should be and how many database connections I should expect.</p> <p>This is my understanding of how things work:</p> <ul> <li>Processes in Python 3.7 DON'T ...
<python><database><sqlalchemy><flask-sqlalchemy><gunicorn>
2020-02-14 21:03:24
HQ
60,234,099
Passing data between a method and an event function
<p>Hello I have been struggling trying to get the event to trigger based on the object that it is passed.... I am not sure if that's how it should be worded but you guys can take a look at the book and give me some insight</p> <p>I am making a datagrid form, inside this form, there's a function</p> <pre><code>private...
<c#>
2020-02-14 22:04:15
LQ_CLOSE
60,235,508
How to hide string from C#
<p>I'm trying to hide an important text from being seen I have already tried the SecureString stuff but I failed, I don't know If I am doing it wrong but some help would be appreciated or a source code that i could learn from since i am new to c#<a href="https://i.stack.imgur.com/5eUHe.png" rel="nofollow noreferrer">Sc...
<c#>
2020-02-15 02:24:28
LQ_CLOSE
60,235,569
How to un-obfuscate JavaScript starting with const and a bunch of vars
<p>Hi i found this extension and would like to see the contents of the script itself to check what is actually does. I tried putting the script through all sort of javascript de/un-obfuscators and none worked.</p> <p>Please tell me one that works or send me the de-obfuscated JS.</p> <p><strong><a href="https://skidla...
<javascript><web><deobfuscation>
2020-02-15 02:40:00
LQ_CLOSE
60,235,614
What is the Time Complexity of my algorithim?
This algorithm was written for LeetCode's climbing stairs problem and it ran at 20ms. I believe the time complexity is O(n), because this link https://towardsdatascience.com/understanding-time-complexity-with-python-examples-2bda6e8158a7 said O(n) is when the running time increases linearly as the size of the input get...
<python><python-3.x><time-complexity>
2020-02-15 02:51:16
LQ_EDIT
60,235,631
JPG to PNG converter code not working. Please help me with my code
I have used the below code to [![enter image description here][1]][1]convert JPG into PNG file: But when i am running this code from the command line terminal using: python a.py "C:\Users\nishant.gupta2\PycharmProjects\jpgtopngconverter\photo" new The system is giving me the error: PermissionError: [Errno 13]...
<python><python-3.x><python-imaging-library><sys>
2020-02-15 02:55:57
LQ_EDIT
60,236,709
How to change the values of cv2.boundingRect
<p>is there a way to change the values of cv2.boundingRect </p> <p><a href="https://i.stack.imgur.com/RDv2J.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RDv2J.jpg" alt="enter image description here"></a></p> <p>I want to adjust so I can get the accurate cv2.drawContours <a href="https://i.stack....
<python><opencv>
2020-02-15 07:19:32
LQ_CLOSE
60,237,477
Python: Unexpected behaviour with dict and a colon. ( my_dict['key']: None ) what does the colon ( : ) do?
<p>I have encountered some <em>unexpected</em> behavior with dicts in python.<br> It might be because of annotations, but i'm not sure.<br> Please see the snippet below: </p> <pre><code>&gt;&gt;&gt; d = {} # lets create a dictionary and add something to it. &gt;&gt;&gt; d['a'] = 'a' &gt;&gt;&gt; d {'a': 'a'} &gt;&gt...
<python><python-3.x><dictionary><syntax><colon>
2020-02-15 09:33:18
LQ_CLOSE
60,237,488
Python - Replace only exact word in string
<p>I want to replace only specific word in one string. However, some other words have that word inside but I don't want them to be changed.</p> <p>For example, for the below string I only want to replace <code>x</code> with <code>y</code> in <code>z</code> string. how to do that?</p> <pre><code>x = "the" y = "a" z = ...
<python><regex>
2020-02-15 09:34:32
LQ_CLOSE
60,237,808
1. Why do we need to override the method public boolean equals(Object ob) in any class?
<ol> <li><p>Why do we need to override the method public boolean equals(Object ob) in any class?</p></li> <li><p>Is public boolean equals(Object ob) is same as public boolean equals(Circle ob)?</p></li> </ol>
<java>
2020-02-15 10:20:34
LQ_CLOSE
60,239,053
Finding sum of geometric sequence with modulo 10^9+7
The problem is given as: Output the answer of (A^1+A^2+A^3+...+A^K) modulo 1,000,000,007, where 1≤ A, K ≤ 10^9, and A and K must be an integer. I am trying to write a program to compute the above question. I have tried using the formula for geometric sequence, then applying the modulo on the answer. Since the resu...
<algorithm><math><pascal>
2020-02-15 13:07:32
LQ_EDIT
60,240,644
How can i count only 'Yes' entities in my column of a dataframe?
[In Input[96] I tried many things but couldnot do anything, always getting both 'yes, and 'no values'][1] [1]: https://i.stack.imgur.com/svTFy.png
<python><dataframe><matplotlib><count><data-visualization>
2020-02-15 16:20:15
LQ_EDIT
60,240,925
How to find the variance between two groups in python pandas?
<p>I have a dataframe like this,</p> <pre><code>ID total_sec is_weekday 1 300 1 1 200 0 2 280 1 2 260 0 3 190 1 4 290 0 5 500 1 5 520 0 </code></pre> <p>I want to find the ID with the largest va...
<python><pandas><numpy><dataframe>
2020-02-15 16:48:59
LQ_CLOSE
60,241,484
Finding the limit of a sequence in python, jupyter notebook
<p>I’ve got a sequence a(n)=(5-77sin(n)+8n^2)/(1-4n^2) and I’m trying to find a candidate for the limit of this sequence. How do I do this? I’ve tried using a code below but that didn’t work so any ideas?<a href="https://i.stack.imgur.com/zUd3V.jpg" rel="nofollow noreferrer">enter image description here</a></p>
<python><jupyter-notebook><sequence><limit>
2020-02-15 17:50:18
LQ_CLOSE
60,241,757
Change array elements to objects with key, value
<p>Can anyone tell me how to change this array in javaScript to the following one with objects having the same key 'name' ?</p> <pre><code>const myArray = ['mark', 'david', 'monica']; </code></pre> <p>Desired Output:</p> <pre><code>const myArray = [{name: 'mark'}, {name: 'david'}, {name: 'monica'}]; </code></pre>
<javascript><arrays><object><key-value>
2020-02-15 18:19:38
LQ_CLOSE
60,241,994
Passing an *os.File as an *io.Reader
<p>If there's a function that takes a *io.Reader, how would one pass an *io.File? This doesn't work:</p> <pre><code>func somefunc(r *io.Reader){ } func Test_FileReader(t *testing.T){ f, err := os.Open("xyz") assert.NoError(t, err) somefunc(&amp;f) } </code></pre> <p>It gives this error:</p> <blockquot...
<pointers><go>
2020-02-15 18:44:33
LQ_CLOSE
60,242,562
Division with if condition
<p>I just start learning ruby with an online course and in my very first exercise, I can't complete the challenge. I have to create functions to sum, subtract, multiply and divide that meet the specs conditions.</p> <p>For the division, I need to check if it will divide per 0 or not, give the result or a warning. My c...
<ruby>
2020-02-15 19:54:42
LQ_CLOSE
60,243,111
Re-run the current function when the function is a variable
<p>I have a function named <code>test</code> which is inside the main func.</p> <pre><code>//stuff func main() { var test = func() { if (/*some condition from main*/) { return test() } } val := test() } </code></pre> <p>When i run this it says:</p> <blockquote> <p>undefined: test</p> </blockq...
<function><go>
2020-02-15 21:02:57
LQ_CLOSE
60,243,537
how to updaload image twice with diffrent sizes
<p>hello i have project i work on , it have some issues ,</p> <p>the problem here i need to get file twice once to move it and one with resizing </p> <p>this is my code , what should i do here</p> <pre><code> public function update_image(Request $request) { $ad = Ad::where('id',$request-&gt;ad_id)-&gt;first(); ...
<php><laravel>
2020-02-15 22:03:54
LQ_CLOSE
60,244,718
Couldn't understand this SWIFT Fucntion
<p>Hope you are doing well. Would anyone please explain this code to me? I am still not getting how we got 120 here. When the parameters were passed to the function, where was it saved? How did it determine max and min before calculating? </p> <p>Would be really appreciated if anyone could explain it for me please..</...
<swift><function>
2020-02-16 01:39:39
LQ_CLOSE
60,244,907
How to assign a variable to the output of a return statement in Python
<p>I have a function with a return statement that returns a list. I would like to store this list in a variable so I can use it in another following function. How would i do this?</p>
<python>
2020-02-16 02:30:16
LQ_CLOSE
60,245,493
how Fix this Error Operand type clash: date is incompatible with int
INSERT INTO Buy SELECT Title,Type1,Tedat,DATEADD(DAY,-2,DATEADD(YEAR,-1,Tarikh)),Descrip FROM Buy WHERE(Tarikh BETWEEN 2019-03-21 AND 2020-03-19 )
<c#><sql><sql-server><visual-studio>
2020-02-16 04:44:48
LQ_EDIT
60,248,137
I have a problem when I install angular on terminal macOs
<p>I would like to install angular but when I type the command these error messages appear. Could someone help me? Thank you in advance. <a href="https://i.stack.imgur.com/RDxRm.png" rel="nofollow noreferrer">enter image description here</a></p>
<angular><macos><npm><terminal>
2020-02-16 11:48:27
LQ_CLOSE
60,248,151
Is there any other purpose of "dictionary.get" function in Python with two elements in it, apart from checking for a variable in the list?
<p>I thougt it could store the answer for the case when user inputs a wrong key in it, like this:</p> <pre><code>month_conversion.get("Git", "Not a valid key") month_conversion = input() </code></pre> <p>So, if user input "Git" it would print out "Not a valid key" But it doesn't store it and just prints out "None"</p...
<python><dictionary>
2020-02-16 11:50:33
LQ_CLOSE
60,248,689
Is there a way to log in to discord using a python script?
<p>My goal is to be able to loging to Discord using a script and then be able to send messages to channels. I need it to communicate with a music bot automatically but if I write a bot for discord other bot's will ignore it so thats not an option. Does anyone know how to do it?</p> <p>Thanks!</p>
<python><discord><discord.js><discord.py-rewrite>
2020-02-16 12:59:05
LQ_CLOSE
60,250,569
i keep geting eror "Uncaught SyntaxError: Unexpected token ';' " in javascript switch statement
<p>i have tried to <em>delete</em> ';' and retype <strong>case</strong> command but nothing happen and still just getting uncaught error. iam get this from tutorial please help iam so new for programming :) can somebody tell me why the eror still poppin?? heres the code</p> <pre><code>//SWITCH STATEMMENT var job = '...
<javascript>
2020-02-16 16:23:34
LQ_CLOSE