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
56,855,310
im a big c++ noob and I need help starting out a block of code for my program
<p>so i am making a code that takes data from a txt file and gets its variance. The formula that my teacher required us to use needs the program to square the decimals in the txt file and then gets its sum. unfortunately i do not have a sample of code because I do not know where to start. I was only able to store the data in the text file into a vector.</p> <pre><code>ifstream dataInput("D:\\Users\\Rodolfo Obre\\Documents\\Ateneo De Manila\\Intersession 2019\\Engg 21\\Programs\\Text Files\\Data Set.txt"); double readNumber; vector&lt;double&gt; dataSet; if (!dataInput.is_open()) { cerr &lt;&lt; "The file can not be opened\n"; exit(1);//exits the program } while (dataInput &gt;&gt; readNumber){ dataSet.push_back(readNumber); } cout &lt;&lt; "n is equal to " &lt;&lt; dataSet.size() &lt;&lt; endl; double sum=0; for (int i=0; i &lt; dataSet.size(); i++){ sum += dataSet[i]; } cout &lt;&lt; "The sum of the data is " &lt;&lt; sum &lt;&lt; endl; </code></pre> <p>This block of code takes the data from the txt file, counts how many there are and then takes its sum.</p> <p>I have no idea how I to do the part where i need to take each decimal in the text file, raise it to the power 2 and then get the sum of all of the values.</p>
<c++>
2019-07-02 15:02:51
LQ_CLOSE
56,855,361
Question about declaration and initialization
<p>I have a question about initialization. When we initialize an array with { }, we must do it right after declaration to show compiler which type to use. Why does compiler allow diamond operator do it with 2 statements?</p> <pre><code>Integer[] array = {2,4,5}; //Integer[] array; array = {2,4,5}; - error List&lt;Integer&gt; list = new ArrayList&lt;&gt;(); //List&lt;Integer&gt; list; list = new ArrayList&lt;&gt;(); - no error </code></pre>
<java>
2019-07-02 15:05:46
LQ_CLOSE
56,855,913
Why this constant expression is not constant
<p>I have the following C listing:</p> <pre class="lang-c prettyprint-override"><code>static const int constant = (0 | ((((1 &lt;&lt; 6) - 1) &lt;&lt; ((((0 + 8) + 8) + 3) + 7)) &amp; ((1) &lt;&lt; ((((0 + 8) + 8) + 3) + 7))) | ((((1 &lt;&lt; 7) - 1) &lt;&lt; (((0 + 8) + 8) + 3)) &amp; ((0) &lt;&lt; (((0 + 8) + 8) + 3))) | ((((1 &lt;&lt; 3) - 1) &lt;&lt; ((0 + 8) + 8)) &amp; ((0) &lt;&lt; ((0 + 8) + 8))) | ((((1 &lt;&lt; 8) - 1) &lt;&lt; 0) &amp; ((1) &lt;&lt; 0))); int main(int argc, char** argv) { return constant; } </code></pre> <p>When I am trying to compile this with GCC-9.1 using this command line:</p> <pre><code>gcc-9 -Werror -Wpedantic main.c </code></pre> <p>I am getting this error:</p> <pre><code>main.c:1:29: error: initializer element is not a constant expression [-Werror=pedantic] </code></pre> <p>Why is that? Is this a compiler bug? Clearly, <code>constant</code> is initialized with a constant expression.</p>
<c><gcc>
2019-07-02 15:38:45
HQ
56,856,022
Is Database will get affect by using POSTMAN tool
Is Database will get affect by passing API url by POSTMAN. I didn't tried yet. But I need to try with that. So Could anybody help me for this.
<postman>
2019-07-02 15:45:32
LQ_EDIT
56,856,327
Flattening arbitrarily deep nested lists
<p>I want to retrieve data from n nested lists in Python. That is:</p> <pre><code>[[[[[1, 2]]]]] =&gt; [1, 2] </code></pre> <p>I could obviously do something like:</p> <pre><code>mylist[0][0][0][0] </code></pre> <p>But I'm wondering if there is a way to do this without having to know how deep the nesting of the list is. </p> <p>I want to do this because I have got some fairly malformed data from a REST API request which needs processing. </p>
<python><list><nested-lists>
2019-07-02 16:04:15
LQ_CLOSE
56,856,433
How can I echo it properly? HTML+PHP issue
<p>I have a problem with this line,is there any solution for a line which must contain both single and double quotation marks?</p> <pre><code>echo "&lt;a href='/ad/.$row['id_ad']'&gt;".$row['title']; </code></pre> <p>I get this error:</p> <pre><code>Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) </code></pre>
<php><html>
2019-07-02 16:11:55
LQ_CLOSE
56,857,484
Can I make a application frontend for smartphones using Python?
<p>I've done a little predictive program with Python and I would like to transform it in an application for smartphones. Can I accomplish it with Python itself, or should I use another language? If yes, what APIs would you recommend for that?</p> <p>Thanks</p>
<python><frontend><apt>
2019-07-02 17:31:26
LQ_CLOSE
56,857,769
regex for minimum 8 character,beside letters add number or symbol or both
<p>Examples which should Satisfy: test@1234 (accept) TestTo^12 (accept) test!5655(accept) Test!@$&amp;(accept) testtesttest(should not accept) Beside Letter i want atleast one number or symbol.If both is available that is fine.</p>
<javascript><regex><typescript>
2019-07-02 17:53:27
LQ_CLOSE
56,858,216
why are my div boxes widening whenever a large text is written?
i had been working on a project in the past days but i came across with a visual error that show my boxes doesn't have a proper right margin. i had tried changing the flex on css but i didn't get other good results to fix this so i ha to scrap that idea ```<html> <head> <title>math lizard</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="nav"> <ul> <a href=""><li>tema 1</li></a> <a href=""><li>tema 2</li></a> <a href=""><li>tema 3</li></a> </ul> </div> <div class="container-temas"> <div class="tema"> <img src="" class="thumbnail"> <h2 class="titulo-tema">titulo del subtema</h2> <hr> <p class="descripcion-breve">Esta descripcion demuestra que tema se esta explicando</p> <a href=""><p class="boton-tema">Entrar</p></a> </div> <div class="tema"> <img src="" class="thumbnail"> <h2 class="titulo-tema">titulo del subtema</h2> <hr> <p>Esta descripcion demuestra que tema se esta explicando</p> <a href=""><p class="boton-tema">Entrar</p></a> </div> <div class="tema"> <img src="" class="thumbnail"> <h2 class="titulo-tema">titulo del subtema</h2> <hr> <p>Esta descripcion demuestra que tema se esta explicando</p> <a href=""><p class="boton-tema">Entrar</p></a> </div> <div class="tema"> <img src="" class="thumbnail"> <h2 class="titulo-tema">titulo del subtema</h2> <hr> <p>Esta descripcion demuestra que tema se esta explicando</p> <a href=""><p class="boton-tema">Entrar</p></a> </div> <div class="tema"> <img src="" class="thumbnail"> <h2 class="titulo-tema">titulo del subtema</h2> <hr> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dapibus tincidunt vehicula. Sed nec ante molestie, dignissim sapien et, finibus felis. Mauris a enim eget sapien laoreet interdum id a tellus. Duis blandit et lorem non aliquet. Vivamus id tellus ut eros finibus tempor ac ac sem. Etiam lacinia nisl eu varius ullamcorper. Vestibulum finibus ligula aliquam ipsum fringilla, nec luctus dolor ultrices. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur est est, aliquet ut commodo at, luctus sit amet nunc. Aenean in aliquet neque, vitae commodo tellus. Nulla et semper massa. Quisque tristique turpis ante, non semper libero fringilla a. Praesent et arcu id massa semper iaculis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; </p> <a href=""><p class="boton-tema">Entrar</p></a> </div> </div> </body> </html> ``` ```* { margin: 0; padding: 0; } body { background-color: #003300; } .nav { background-color: #00b300; margin-bottom: 0%; } ul { margin-left: 75%; } li { padding: 20px; display: inline-block; } a { text-align: center; color: white; list-style: none; text-decoration: none; } li:hover { -moz-transition-duration: 0.3s; background-color: #004d00; } .post { padding: 20px; background-color: white; margin-right: 5%; margin-left: 30%; margin-top: 5%; border-radius: 15px; } h1 { text-align: center; } .form { background-color: #404040; margin-left: 1%; margin-right: 70%; padding: 20px; border-radius: 15px; } .link { background-color: #19194d; margin-left: 15px; margin-right: 15px; padding: 10px; border-radius: 15px; color: white; } .link:hover { background-color: #0c0c27; -moz-transition-duration: 0.3s; } * { margin: 0; padding: 0; } body { background-color: #003300; } .nav { background-color: #00b300; margin-bottom: 0%; } ul { margin-left: 75%; } li { padding: 20px; display: inline-block; } a { text-align: center; color: white; list-style: none; text-decoration: none; } li:hover { -moz-transition-duration: 0.3s; background-color: #004d00; } .post { padding: 20px; background-color: white; border-radius: 15px; } h1 { text-align: center; } .form { background-color: #404040; padding: 20px; border-radius: 15px; } .link { background-color: #19194d; margin-left: 15px; margin-right: 15px; padding: 10px; border-radius: 15px; color: white; } .link:hover { background-color: #0c0c27; -moz-transition-duration: 0.3s; } /* Flex container */ .container { display: flex; flex-direction: row; justify-content: space-between; padding: 20px; } /* Make post larger than form */ .post { flex: 3; margin-left: -65%; } .form { flex: 1; } .tema { background-color: white; margin-top: 20px; margin-left: 2%; padding: 20px; border-radius: 15px; } .thumbnail { border: solid; width: 100%; height: 100px; } .titulo-tema { text-align: center; } .boton-tema { background-color: #00b300; text-align: center; padding: 20px; margin-left: 150px; margin-right: 150px; margin-top: 20px; border-radius: 15px; } .boton-tema:hover { background-color: #004d00; -moz-transition-duration: 0.3s; } .container-temas { display: flex; justify-content: space-between; padding: 20px; flex-wrap: wrap; } @media screen and (min-width: 480px) { ul { margin-left: 0%; } .container { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; } .post { margin-left: 0%; margin-bottom: -40%; margin-right: 0%; } .form { margin-right: 20%; margin-left: 20%; } li { padding: 70px; } h1 { font-size: 50px; } p { font-size: 40px; } .titulo-tema { font-size: 50px; } } @media screen and (min-width: 767px) { ul { margin-left: 35%; } .container { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; } .post { margin-left: 0%; margin-bottom: -80%; margin-right: 0%; } .form { margin-right: 20%; margin-left: 20%; } li { padding: 70px; } h1 { font-size: 70px; } p { font-size: 40px; } .titulo-tema { font-size: 70px; } } @media screen and (min-width: 1030px) { ul { margin-left: 75%; } .container { display: flex; flex-direction: row; justify-content: space-between; padding: 20px; } .post { margin-left: -65%; margin-bottom: 0%; margin-right: 0%; } .form { margin-right: 70%; margin-left: 0%; margin-bottom: 0%; } li { padding: 20px; } h1 { font-size: 30px; } p { font-size: 20px; } .titulo-tema { font-size: 30px; } } ``` i just expect to get a proper margin so this problem won't happend everytime a long text is posted on the index
<html><css>
2019-07-02 18:24:53
LQ_EDIT
56,860,966
I have problem with the output of the js array sorting
I'm using js array sorting method on my webpage but it includes "," to the output. var locationTownInAshanti = new Array("<input type=\"radio\" value=\"Buokrom\" name=\"gender\">Buokrom", "<input type=\"radio\" value=\"Dote\" name=\"gender\">Dote", "<input type=\"radio\" value=\"Bantama\" name=\"gender\">Bantama") ; locationTownInAshanti.sort(); I expect the output to be only the item in the array without including ","[enter image description here][1] [1]: https://i.stack.imgur.com/79Bi3.png
<javascript><arrays><sorting>
2019-07-02 22:57:03
LQ_EDIT
56,861,494
ASP.NET error NullReferenceException: Object reference not set to an instance of an object
<p>This is my first MVC project and I'm stuck. When I try to run my project, I'm getting NullReferenceException: 'Object reference not set to an instance of an object.' in my Index View at the foreach line. Any idea why and what I need to do to fix it.</p> <p>This configuration was also included all the configuration.</p> <p>.cshtml File is here: @model IEnumerable ===> foreach (var echipament in Model ) &lt;====== HERE IS THE ERROR This is the Controller class:</p> <pre><code> public ViewResult List() { var echipamente=_echipamentRepository.Echipamente; return View(echipamente); } } </code></pre> <p>Can you please help me to solve this error?</p>
<asp.net><asp.net-mvc><view><model><controller>
2019-07-03 00:30:36
LQ_CLOSE
56,863,110
How to grep all the njmbers in a file
Cat test 1 0 2 Operator 3 Cat test ¦ grep [0-9] >> 1 The test file contains the baove values. When i grep the test file using grep [0-9] it gives only 1 as output.. How to grep all the numbers in the test file
<bash>
2019-07-03 04:53:42
LQ_EDIT
56,863,940
I need an real-life project for practice with python and Django
<p>I'm working as an apprentice for a software company in Germany. The most time I work for projects with Visual Basic for Application (Excel). For my finals I need more practice in modern languages. I like to build a web-application for free, can be a little project or something bigger, the important thing is that I learn a few things about planing a project, speaking with the customer about the project and build the application. </p> <p>Why Python and Django? Aside from VBA, I learned Python for my own projects. But writing application for myself is not the same like working for a customer.</p> <p>Best Regards, Tobias.M</p>
<django><python-3.x>
2019-07-03 06:11:34
LQ_CLOSE
56,866,167
Is there a ways to save variabel in string?
Is there a ways to save variabel in string and use it later? in code i expect the stdout should `41` #include <iostream> int main(){ std::string number [5] = {1,2,3,4,5}; std::string join = "number[3]+number[0]"; std::cout << join; // Expect result should 41. return 0; }
<c++><string><reflection>
2019-07-03 08:42:31
LQ_EDIT
56,867,051
Please help making me do exceptions with random numbers
I've made this code for practicing and I want to make a list that keeps every numbers that this code wrote before so I dont want to get duplicates. Sorry for my english It's just guessing random numbers and I don't want it to guess the number that it already guessed before. Just to be clear I want to make it as a list int password = 432678; int valt = 999999; for (int i = 0; i < valt; i++) { int[] test2 = new int[valt]; Random randNum = new Random(); for (int j = 0; j < test2.Length; j++) { test2[i] = randNum.Next(1, valt); Console.WriteLine("CURRENT: " + test2[i]); if (test2[i] == password) { goto Back; } } } Back: Console.WriteLine("password: "+ password); Console.ReadLine();
<c#>
2019-07-03 09:30:58
LQ_EDIT
56,867,334
Remove/change section header background color in SwiftUI List
<p>With a simple <code>List</code> in SwiftUI, how do I change/remove the standard background color for the section header</p> <pre><code>struct ContentView : View { var body: some View { List { ForEach(0...3) { section in Section(header: Text("Section")) { ForEach(0...3) { row in Text("Row") } } } } } } </code></pre> <p><a href="https://i.stack.imgur.com/VFPk4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VFPk4.png" alt="Screenshot with grey section header background"></a></p>
<swiftui>
2019-07-03 09:48:12
HQ
56,867,767
how to read specific line from the text file in C#
<p>how to read particular line (for eg line no 2) from the text file in C#.</p> <p>abc.txt is the filename contains line 1- xyz line 2- pqr</p> <p>I want to read pqr from abc.txt</p>
<c#>
2019-07-03 10:11:34
LQ_CLOSE
56,868,683
Remove - from number
<p>I need to remove Hyphen from numbers and I cant find the function that does this. I know I have used it before Somewhere but I cant remember.</p> <p>+123-567-896 </p> <p>need +123-567896 like this</p>
<php><sql>
2019-07-03 11:03:17
LQ_CLOSE
56,869,952
What is "EC2-Other" filter in "Cost Explorer" mean?
<p>While investigating AWS Bill using Cost Explorer tool, I selected EC2-Other filter under services and it showed an amount around 5k monthly but I still don’t know what services are costing all this amount. What does EC2-Other include in Cost Explorer?</p>
<amazon-web-services><amazon-ec2><aws-billing>
2019-07-03 12:15:56
HQ
56,870,189
How to proxy http requests with plain javascript?
<p>I'm writing a bot with plain javascript that sends requests to a certain website without node.js or dependencies like jquery. I want to send every requests through a proxy, but I can't figure out how to do that with vanilla js.</p> <p>I don't know where to even start. I've read the xhr documentation and found nothing about proxies. Google yielded nothing too.</p> <p>Thanks!</p>
<javascript><proxy><xmlhttprequest>
2019-07-03 12:28:56
LQ_CLOSE
56,870,341
how can execute other contextmenu in console with javascripte or other js
**i want to change this top in console log with other menucontext other there i tried but no solution any one have a solution please** check this image please ! https://i.imgur.com/bienKZ0.png <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header mh-clearfix"><?php the_title('<h1 class="entry-title">', '</h1>'); mh_post_header(); ?> <br>
<javascript><jquery><arrays><console>
2019-07-03 12:37:30
LQ_EDIT
56,871,802
list of tuples to list of dictionary
I have a list like [ [('a' , 'b'), ('c' , 'd')] , [('e' , 'f') , ('g' , 'h')] ]. I want the output to be like a list of dictionaries [ {'a' : 'b', 'c' : 'd' } , {'e' : 'f' , 'g' : 'h'} ]. How to parse it to get the output?
<python>
2019-07-03 13:57:49
LQ_EDIT
56,871,882
CondaValueError: The target prefix is the base prefix. Aborting
<p>I have the following conda environment file <code>environment.yml</code>:</p> <pre><code>name: testproject channels: - defaults dependencies: - python=3.7 prefix: /opt/projects/testproject </code></pre> <p>Before creating the environment, only the base environment exists:</p> <pre><code>(base) me@mymachine:/opt/projects/testproject$ conda env list # conda environments: # base * /opt/anaconda/anaconda3 </code></pre> <p>When trying to create the environment, I get the following error:</p> <pre><code>(base) me@mymachine:/opt/projects/testproject$ conda create -f environment.yml CondaValueError: The target prefix is the base prefix. Aborting. </code></pre> <p>What does this error mean?</p>
<anaconda><conda>
2019-07-03 14:02:06
HQ
56,873,278
How to fix: error: '<filename>' does not have a commit checked out fatal: adding files failed when inputting "git add ." in command prompt
<p>I'm trying to add a ruby rails file to my repository in gitlab but it somehow wouldn't allow me to add the file saying that my file does not have commit checked out.</p> <p>I've tried git pull, making the the file again and git adding but still wont work</p> <p>error: '172069/08_lab_routes_controllers_views_172069_172188-Copy/adventure_game/' does not have a commit checked out fatal: adding files failed</p>
<ruby-on-rails><command-line><gitlab>
2019-07-03 15:16:15
HQ
56,873,910
why array is not obsolete after collection comes in java
<p>In java post collection , we can do all thing which we could do by array and some other stuffs using collection . so my question is can array be obsolete in future ? </p>
<java>
2019-07-03 15:51:21
LQ_CLOSE
56,874,133
Use Hex color in SwiftUI
<p>in UIKit we could use an Extension to set hex color to almost everything. <a href="https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor" rel="noreferrer">https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor</a></p> <p>but when I'm trying to do it on SwiftUI, it's not possible, it looks like the SwiftUI does not get the UIColor as parameter.</p> <pre><code> Text(text) .color(UIColor.init(hex: "FFF")) </code></pre> <p>error message: </p> <pre><code>Cannot convert value of type 'UIColor' to expected argument type 'Color?' </code></pre> <p>I even tried to make an extension for <code>Color</code>, instead of <code>UIColor</code>, but I haven't any luck</p> <p>my extension for Color:</p> <p>import SwiftUI</p> <pre><code>extension Color { init(hex: String) { let scanner = Scanner(string: hex) scanner.scanLocation = 0 var rgbValue: UInt64 = 0 scanner.scanHexInt64(&amp;rgbValue) let r = (rgbValue &amp; 0xff0000) &gt;&gt; 16 let g = (rgbValue &amp; 0xff00) &gt;&gt; 8 let b = rgbValue &amp; 0xff self.init( red: CGFloat(r) / 0xff, green: CGFloat(g) / 0xff, blue: CGFloat(b) / 0xff, alpha: 1 ) } } </code></pre> <p>error message:</p> <pre><code>Incorrect argument labels in call (have 'red:green:blue:alpha:', expected '_:red:green:blue:opacity:') </code></pre>
<ios><uicolor><swiftui>
2019-07-03 16:03:40
HQ
56,874,600
How to generate a unique Long value in Java?
<p>everyone.</p> <p>I have a simple question. Is the value returned by <code>UUID.randomUUID().getMostSignificantBits()</code> ALWAYS unique?</p> <p>I need to generate a Long value which needs to ALWAYS be unique. Is there any other way to generate a Long that accomplishes this?</p> <p>Thanks.</p>
<java><unique><uuid><long-integer>
2019-07-03 16:33:38
LQ_CLOSE
56,874,771
Pyhton - Numpy array, number of time satisfying a condition
I have a numpy array as follow: a = [1 4 2 6 4 4 6 2 7 6 2 8 9 3 6 3 4 4 5 8] and a constant number `b=6` I am searching for a number `c` which is defined by the number of occurrence that `a` is more than 2 times consecutively inferior to `b`? So in this example it `c=3`
<python><numpy>
2019-07-03 16:47:17
LQ_EDIT
56,875,429
check not null for list in a list at specific index
<p>How do I access <code>list2</code> in <code>list1</code> below and check <code>IsnotNull</code> in an Assert </p> <pre><code>List&lt;Object&gt; list1= new List&lt;Object&gt;(); List&lt;int&gt; list2= new List&lt;int&gt;(); list1.add(someValue); list1.add(list2); Assert.IsNotNull(list1[1]..??); </code></pre>
<c#>
2019-07-03 17:38:39
LQ_CLOSE
56,875,839
My bot runs a command in multi servers at once
i programed a cmd in wich it shows like a random riddle in wich the user can answer it thru a cmd but idk it runs like in the two servers.I want it just like start the random riddle per server like every server got his owne riddle not same one tried to save server id and try to write some conditions with it but didnt work :p [this pic is taken form server 1][1] [this pic is taken from server 2][2] i hope you understand what i mean.I like want to make the cmd works per server not get shared in all of them [1]: https://i.stack.imgur.com/Scq1M.png [2]: https://i.stack.imgur.com/pJOFQ.png
<node.js><discord><discord.js>
2019-07-03 18:12:06
LQ_EDIT
56,875,994
TypeError: Cannot read property 'wanted' of undefined:
<p>I have been deploying functions with firebase successfully all day learning how to use it. I was trying to see what happened if I initialized another directory that deploys to the same project and had no problems until i updated my npm version and now I am getting "Unexpected error has occurred" whenever I try to deploy</p> <p>I have tried updating npm permission by making my own user the owner of the node_modules, bin, and share directories. I have tried uninstalling and reinstalling firebase-tools. I have also tried deleting all my current function directories and initializing a fresh directory and reinstalling my dependencies in there fresh.</p> <p>Here is the debug log</p> <pre><code>Dylans-MacBook-Pro-3:functions dsenderling$ firebase deploy --debug [2019-07-03T18:04:35.526Z] ---------------------------------------------------------------------- [2019-07-03T18:04:35.528Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug [2019-07-03T18:04:35.529Z] CLI Version: 7.0.2 [2019-07-03T18:04:35.529Z] Platform: darwin [2019-07-03T18:04:35.529Z] Node Version: v10.16.0 [2019-07-03T18:04:35.529Z] Time: Wed Jul 03 2019 13:04:35 GMT-0500 (Central Daylight Time) [2019-07-03T18:04:35.529Z] ---------------------------------------------------------------------- [2019-07-03T18:04:35.537Z] &gt; command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"] [2019-07-03T18:04:35.537Z] &gt; authorizing via signed-in user [2019-07-03T18:04:35.537Z] [iam] checking project my-awesome-project-5a4e9 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"] [2019-07-03T18:04:35.539Z] &gt;&gt;&gt; HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/my-awesome-project-5a4e9:testIamPermissions permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get] [2019-07-03T18:04:35.769Z] &lt;&lt;&lt; HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Wed, 03 Jul 2019 18:04:35 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=83, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked [2019-07-03T18:04:37.033Z] TypeError: Cannot read property 'wanted' of undefined at /usr/local/lib/node_modules/firebase-tools/lib/checkFirebaseSDKVersion.js:37:51 at process._tickCallback (internal/process/next_tick.js:68:7) Error: An unexpected error has occurred. </code></pre> <p>My gut tells me there is something wrong with firebase-tools or my firebase sdk but I can't figure out what. Thanks in advance</p>
<node.js><firebase><google-cloud-functions><firebase-cli>
2019-07-03 18:23:34
HQ
56,876,293
My code seems to only let player 2 win I am not sure what I need to change
I have human player and and random player. The humanplayer is an input and the random player just plays a random move. I play them against each other and the player 2 always wins I am not sure what is missing. I have tried mutlpe things. I have tried editing the beats fucntion but I need that for the hw. They gave us that in the starter code. I am thinking it has something to do with the players this is a link to the code. https://codeshare.io/aY9KPM
<python><python-3.x>
2019-07-03 18:46:30
LQ_EDIT
56,876,395
Is it possible to have same interface in javaee app and use it in CLI and GUI both?
<p>We have a javaee application whithout any gui. To adding some records to database config. tables( entities) we use manual sql script which is not safe and easy. We have decided to develop gui and also CLI for our application to handle this issue. Is it possible to have interfaces in javaee app and use then in both Gui and CLI? From end-user point of veiw, services and parameters arr same in both gui and cli. Something like jboss admin web console and jboss cli to deploy an artifact.</p>
<java><api><user-interface><command-line-interface>
2019-07-03 18:54:30
LQ_CLOSE
56,876,492
plsql procedure that will detele rows
I have a table: USERS, with fields: username,fname, lname, age I need to create procedure that will delete username from parameter, if the age if less than 18 I did some code, but it won't work: create procedure delete_user(username in varchar2) as begin if exists (delete from username where age < 18); dmbs_output.put_line(username); end; exec detele_user('mrgreen');
<sql><oracle><plsql><procedure>
2019-07-03 19:03:30
LQ_EDIT
56,877,648
Is this a violation of strict aliasing rules?
<p>According to the standard — <em>an aggregate or union type that includes one of the aforementioned types among its elements or nonstatic data members (including, recursively, an element or non-static data member of a subaggregate or contained union)</em>, this is allowed:</p> <pre class="lang-cpp prettyprint-override"><code>struct foo { float x; }; void bar(foo*); float values[9]; bar(reinterpret_cast&lt;foo*&gt;(&amp;values)); </code></pre> <p>However, I am not sure whether the following example also honors this rule:</p> <pre class="lang-cpp prettyprint-override"><code>struct foo { float x; float y; float z; }; void bar(foo*); float values[9]; assert((sizeof(values) / sizeof(float)) % 3 == 0); // sanity check bar(reinterpret_cast&lt;foo*&gt;(&amp;values)); </code></pre>
<c++><language-lawyer><strict-aliasing>
2019-07-03 20:41:05
HQ
56,878,301
How to initialize new object with a data type List<T>?
<p>I am a beginner in C# and I want to initialize a new object which contains the datatype string as well a data type list&lt;> from a enumeration. How does the structure/semantics looks like if I put a List into a new object ? Thank you for your help.</p> <p>I have searched on stackoverflow and also on MSDN and didn't found a proper solution.</p> <p>This is my code:</p> <pre><code>Vegetables Veg1 = new Vegetables("Apple", List&lt;Colour&gt;("red, green, yellow")); </code></pre>
<c#>
2019-07-03 21:45:27
LQ_CLOSE
56,879,207
What does it mean to initialize a string like "std::string mystring{""};". Is it new feature of C++ 11 or 14?
<p>I am new to <strong>C++ 11 &amp; 14</strong>. In my new role I saw a code where <strong>string was initialized</strong> (below) and I do not know what is this new way called and where to read about it. Can some one tell what is it called and how does it work. Regards.</p> <pre><code>std::string mystring{""}; </code></pre>
<c++11><c++14>
2019-07-04 00:01:22
LQ_CLOSE
56,880,284
parsing the shell program output using golang
i am trying to call a shell program using golang (os/exec) but the output i am getting is in bytes and i need to convert it into float64 but it is showing error? error: cannot convert out (type []byte) to type float64 func Cpu_usage_data() (cpu_predict float64, err error) { out,err1 := exec.Command("/bin/sh","data_cpu.sh").Output() if err1 != nil { fmt.Println(err1.Error()) } return float64(out), err1 } data_cpu.sh is: top -b n 1 | egrep -w 'apache2|mysqld|php' | awk '{cpu += $9}END{print cpu/NR}'
<go><strconv>
2019-07-04 03:29:59
LQ_EDIT
56,880,977
How do I convert a list in quotes ( '[1,2,3]' ) to a proper list ( [1,2,3] ) in python?
<p>The problem is very fundamental. All I want to know is if there is a function to perform the task without appending to a new list.</p> <p>I tried using loop but it will become a little complex for cases like... '[1,2,3],[4,5,6]'</p>
<python><python-3.x>
2019-07-04 05:07:20
LQ_CLOSE
56,881,428
Replacement css tags in sql server
I need to replace <span style="text-decoration: underline;"> as <span style="text-decoration: underline;"><u> and </span> to </u></span>. Only replace </span> for <span style="text-decoration: underline;">. No need to replace </span> for <span style="background-color: #ffff00;"> Sql, css, HTML, sql-server declare @text varchar(max) set @text = '<font color="Gray"><b>123123) <span style="text-decoration: underline;"><em><br /> </em></span> <div><span style="text-decoration: underline;">Tested from 14.82 Phoenix CRM QA <span style="background-color: #ffff00;">DB(Version 06/22/2019)&nbsp;</span><br /> </span> <div><span style="text-decoration: underline;"><br /> </span></div> <span style="text-decoration: underline;">Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </span> <div>&nbsp;</div> <span style="text-decoration: underline;">Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </span> <div>&nbsp;</div> <span style="text-decoration: underline;">Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </span> <div>&nbsp;</div> <span style="text-decoration: underline;">Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </span> <div>&nbsp;</div> <span style="text-decoration: underline;"><br /> </span></div></b></font>' <font color="Gray"><b>123123) <span style="text-decoration: underline;"><u><em><br /> </em></u></span> <div><span style="text-decoration: underline;"><u>Tested from 14.82 Phoenix CRM QA <span style="background-color: #ffff00;">DB(Version 06/22/2019)&nbsp;<br /> </u></span> <div><span style="text-decoration: underline;"><u><br /> </u></span></div> <span style="text-decoration: underline;"><u>Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </u></span> <div>&nbsp;</div> <span style="text-decoration: underline;"><u>Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </u></span> <div>&nbsp;</div> <span style="text-decoration: underline;"><u>Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </u></span> <div>&nbsp;</div> <span style="text-decoration: underline;"><u>Tested from 14.82 Phoenix CRM QA DB(Version 06/22/2019)&nbsp;<br /> </u></span> <div>&nbsp;</div> <span style="text-decoration: underline;"><u><br /> </u></span></div></b></font>
<sql><sql-server><sql-server-2008-r2>
2019-07-04 05:55:00
LQ_EDIT
56,881,892
Get div details on scroll
<p>I have a social feed page when a user can post something in his/her mind, I want to add a view count on this page, my problem is how can I count views on every social feed when the user scroll down the page</p>
<javascript><jquery><html>
2019-07-04 06:34:23
LQ_CLOSE
56,883,718
How to change div text from php required child's, jquery .load grandgrandchild (with picture)?
[img]https://i.imgur.com/38yMTzF.jpg Hello, so to understand the problem, please open image. 5.php needs to change text in index.php using jquery. index.php includes 2.php. from 2.php to 5.php each php is nested into div of that one that's coming before him. I tried different ways, but always get error that says Uncaught SyntaxError: Unexpected identifier (problem is in 5.php, where jquery just can't find "bla" class.
<php><jquery>
2019-07-04 08:30:30
LQ_EDIT
56,883,727
An unwanted margins and my command about width not worked
I was designing a home page but I dealt with : http://uupload.ir/files/ypzf_untitled.png and something like this in footer part... It wasn't happened for me before :( there are all stylesheets and html docs http://uupload.ir/view/rdtj_web_sample.rar/ I suppose They end in on column without horizontal scroll!!
<html><css>
2019-07-04 08:31:29
LQ_EDIT
56,883,817
I would like to convert 'A+B+C.E+F.G' into 'A.E.G+A.F.G+B.E.G+B.F.G+C.E.G+C.F.G' using R
I would like to convert this:</BR> `v_in <- 'A+B+C.E+F.G'` into this: </BR> `v_out <- 'A.E.G+A.F.G+B.E.G+B.F.G+C.E.G+C.F.G'` using R. ANy idea?
<r><string>
2019-07-04 08:37:33
LQ_EDIT
56,884,080
Can't understand how c++ set works
I am using c++ stl set class for a leetcode question. from googlein I heard set keeps the elements in ordered manner and I heard that set.begin() returns the smallest element. But I also heard set uses red black trees and has log(n) time complexity. I don't understand how these two can go together, as in how does set.begin() return smallest element when a redblack tree doesn't guarantee the smallest element will be the head. Also set.begin() function makes it seem like this container uses an array instead of a linked list to build the redblack tree, which again I don't understand how an array can be used instead of a tree.Can someone explain me the implementation of c++ set? Thank you.
<c++><set>
2019-07-04 08:51:15
LQ_EDIT
56,886,260
How to split number each two length in angular
I have a number 112233445566 How can I spilt it and put it into array so that I can get Array[11,22,33,44,55,66]
<javascript><arrays>
2019-07-04 10:44:41
LQ_EDIT
56,886,601
Refereshing window
<p>I have a window with a grid and periodically I need to turn whole screen black.</p> <p>In order to do that I set grid visibility to hidden:</p> <pre><code>mainGrid.Visibility = Visibility.Hidden; </code></pre> <p>then, after one second, I change it back to <code>Visible</code>.</p> <p>But after setting visibility to hidden, screen doesn't change at all.</p> <p>I tried <code>UpdateLayout</code>, <code>InvalidateArrange</code>, nithing worked...</p> <p>How to get the grid to hide and reappear again?</p> <p>Whole code:</p> <pre><code>mainGrid.Visibility = Visibility.Hidden; mainGrid.UpdateLayout(); Thread.Sleep(1000); mainGrid.Visibility = Visibility.Visible; mainGrid.UpdateLayout(); </code></pre>
<c#><.net><wpf>
2019-07-04 11:04:47
LQ_CLOSE
56,887,510
regex - get last occurrence before match
<p>With regex, from the following sentence</p> <pre><code>my name is oscar my name is oscar my name is oscar my name is david my name is oscar </code></pre> <p>I would like to get the "oscar" immediately previous to david (in this case would be the 3rd "oscar")</p> <p>I've tried many things but none of them have worked.</p> <p>Any ideas? Thanks</p>
<python><regex>
2019-07-04 12:01:26
LQ_CLOSE
56,887,972
Swift current ViewController dismiss after or before present new ViewController
My scenario, I am trying to create multiple present ViewController. Here, presenting new ViewController after I need to dismiss previous ViewController. ViewController A (RootViewController) next button click to showing ViewController B then View Controller B next button click to present model ViewController C. Now, If I close ViewController C need to show ViewController A. NOTE: ViewController A having closing button, If I close it. It will show Tabbar view controller. [![example][1]][1] [1]: https://i.stack.imgur.com/CVzW4.png
<ios><swift>
2019-07-04 12:27:43
LQ_EDIT
56,888,453
Please tell how ch[1] on printing gave answer as 2?
#include<stdio.h> int main() { union a { int i; char ch[2]; }; union a z={512}; printf("%d %d %d",z.i,z.ch[0],z.ch[1]); } //Output 512 0 2
<c><arrays><output><union>
2019-07-04 12:56:26
LQ_EDIT
56,890,238
Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details
<p>My key is restricted using package name and SHA1, still Google Play store shows this warning.</p> <p>Any idea why it is showing like this. I defined my API key in build.gradle file and using it from there.</p>
<android><google-cloud-platform>
2019-07-04 14:41:40
HQ
56,891,179
C++ Can't Return A Vector of Textures
<p>I have a class that keeps track of objects I've declared. This class also has a vector as a member. I add textures through a function (probably, there is a leak). I am probably doing a mistake about c++ itself, not sfml.</p> <p>in Item.h:</p> <pre><code> #ifndef ITEM_H #define ITEM_H class ItemTexture { public: static std::vector&lt;ItemTexture*&gt; textures; std::vector&lt;sf::Texture*&gt; variation; ItemTexture(std::string file); void addTexture(std::string file); static sf::Texture getTexture(int id, int no) { return *textures[id]-&gt;variation[no]; //Program crashes here } static void declare_textures(); }; #endif </code></pre> <p>in the Item.cpp:</p> <pre><code>#include "Item.h" std::vector&lt;ItemTexture*&gt; ItemTexture::textures; ItemTexture::ItemTexture(std::string file) { sf::Texture *tex = new sf::Texture; tex-&gt;setSmooth(false); tex-&gt;loadFromFile(file); variation.push_back(tex); textures.push_back(this); delete tex; } void ItemTexture::addTexture(std::string file) { sf::Texture *tex = new sf::Texture; tex-&gt;setSmooth(false); tex-&gt;loadFromFile(file); variation.push_back(tex); delete tex; } </code></pre> <p>This doesn't give any error messages, program crashes at the line return *textures[id]->variation[no];</p>
<c++><sfml>
2019-07-04 15:43:36
LQ_CLOSE
56,892,125
Syntax error - PHP if statement in html td tag
<p>I get this message in my browser: Parse error: syntax error, unexpected 'if' (T_IF)</p> <p>I have been making a HTML table showing prices on a Woocommerce product.</p> <p>I have seen a lot of similar issues, but cannot relate to my own problem.</p> <p>The problem should be in this code... </p> <pre><code> &lt;tr&gt; &lt;td&gt;'. $product_variation-&gt;get_name() .'&lt;/td&gt; &lt;td&gt;'. $product_variation-&gt;get_regular_price() .'&lt;/td&gt; &lt;td&gt;' if($sale_price) { echo $sale_price; }else { echo $product_variation-&gt;get_regular_price(); } '&lt;/td&gt; &lt;/tr&gt;';´´´ </code></pre>
<php><html>
2019-07-04 17:12:11
LQ_CLOSE
56,892,249
Read A Line In Text File with JavaScript
<p>I need to read the numeric value of one line in a text file</p> <pre><code>color=7 </code></pre> <p>so var color will = 7</p>
<javascript>
2019-07-04 17:26:00
LQ_CLOSE
56,894,985
Can a normal variable hold address of another varibale?
My problem is quite crazy, but listen i created two normal variable just like this int a,b and then i assigned the address of b variable to the a and when i print the address of both a and &b it show a random number but same for both. how it is possible? while a is not a pointer variable. int main() { int a,b; a = &b; printf("%u %u",a,&b); return 0; } i got a number that must be address.and both are same.
<c>
2019-07-04 23:09:58
LQ_EDIT
56,897,225
Use Linq instead of nested foreach loops to sum values
<p>I want to find the sum of values without using a nested foreach loop</p> <p>How do I write this using Linq instead?</p> <pre><code>decimal posVal = 0; decimal negVal = 0; foreach (var j in journal) { foreach (var t in j.trans) { foreach (var l in t.line) { if (l.val &gt; 0) posVal += l.val; else negVal += l.val; } } } </code></pre>
<c#><linq>
2019-07-05 05:54:17
LQ_CLOSE
56,897,326
Can someone help break down this line of code for me?
<p>I just don't really understand what's going on here(The constructing a new vector part). It's code from a book I am using to learn C++. I can't seem to find that sort of construction anywhere on the web.</p> <pre><code>class Vector { public: Vector(int s):elem{new double[s]}, sz{ s }{} //constructs a new vector double&amp; operator[](int i) { return elem[i]; } //elements access: subscripting int size() { return sz; } private: double* elem; //pointer to the elements int sz; // number of elements }; </code></pre>
<c++>
2019-07-05 06:04:26
LQ_CLOSE
56,897,539
Android Recycler View with multiple Views
<p>I am making an app in which I want to put texts , images and videos all in separate ViewHolders (similar to Instagram and Facebook). I know that we have to use a Recycler View with multiple ViewTypes . I am using firebase as my storage . How do I retrieve the items from firebase and place them in the appropriate ViewHolder . Please help me.</p>
<java><android><firebase><firebase-storage>
2019-07-05 06:22:36
LQ_CLOSE
56,897,711
Which way is more efficient to learn data structures?
<p>My programming knowledge is up to OOP since that was the last thing we covered in the university. However, I am taking 2 courses this summer and I am constantly under pressure, but I am planning to learn data structures along the way too, to be prepared for it next semester.</p> <p>I had two plans to learn it but I am not sure which one will be more efficient:</p> <p>-The first one is to skim through and learn about all the types of data structures and how they are implemented.</p> <p>-The second one is to try instead of just reading and knowing about a data structure, I will go and try to implement it. However, the drawbacks are that its slow and time consuming, so I might not be able to learn all of the data structures in time</p>
<data-structures>
2019-07-05 06:35:30
LQ_CLOSE
56,897,838
Getting a error TypeError: color.charAt is not a function in C:/...../node_modules/@material-ui/core/styles/colorManipulator.js:148
<p>Here is a link to the screenshot of the error : <a href="https://drive.google.com/open?id=1HL-Fy1M4tHp9qMUpt88PzOfI10AHHem-" rel="noreferrer">https://drive.google.com/open?id=1HL-Fy1M4tHp9qMUpt88PzOfI10AHHem-</a> .</p> <p>This is the code portion where colors are used.</p> <pre><code>const theme = createMuiTheme({ palette: { primary: { light: '#33c9dc', main: '#00bcd4', dark: '#008394', contrastText: '#fff' }, secondary: { light: '#ff6333', main: '#ff3d00', dark: '#b22a00', contrastText: '#fff' } }, typography: { useNextVariants: true }, form: { textAlign: "center" }, image: { margin: "10px auto 10px auto" }, pageTitle: { margin: "10px auto 10px auto" }, textField: { margin: "10px auto 10px auto" }, button: { marginTop: 20, position: "relative" }, customError: { color: "red", fontSize: "0.8rem", marginTop: 5 }, progress: { position: "absolute" } }); </code></pre> <p>I already tried changing the colors from hexadecimal to rgb values, it didn't work.</p>
<javascript><reactjs><material-ui>
2019-07-05 06:44:38
HQ
56,898,702
SwiftUI: NavigationLink not working if not in a List
<p>I guess it might be a bug in beta 3 as the NavigationView is all broken. But a view like that:</p> <pre><code>struct GenreBadge : View { @EnvironmentObject var store: Store&lt;AppState&gt; let genre: Genre var body: some View { NavigationLink(destination: MoviesGenreList(genre: genre).environmentObject(store)) { RoundedBadge(text: genre.name) } } } </code></pre> <p>is not triggering any push in the navigation stack. The view doens't seems interactive at all. If anyone found a workaround would be good, unless Apple is documenting this behaviour I would consider it broken until beta 4. </p>
<swift><swiftui>
2019-07-05 07:44:38
HQ
56,898,994
is there any soloution for OnTick patched?
I Had a problem on the script that when i enter the game it told " Error message: patchOnTick was not successful " So This is The If There any solutions i hope you comment below The Script for This Game ```https://krunker.io/``` This is the script `https://pastebin.com/raw/ucUT0mdC`
<javascript>
2019-07-05 08:04:48
LQ_EDIT
56,899,276
Refreshing data periodically using SignalR rather than broadcasting to clients
<p>I display some of the data i.e. Sum, Average and Total on a page and want to update them after the data changed using SignalR. Most of the examples uses the following approach that broadcast all of the clients after create / update / delete methods (that change data) are executed:</p> <pre><code>private void BroadcastDataChange(Data data) { Clients.All.dataChanged(); } </code></pre> <p>However, I am wondering if there is a smarter approach that let me update the data i.e. periodically refreshing without broadcast in each of the create-update-delete methods (I do not use SqlDependency, etc, juts using SignalR). On the other hand, I am not sure this kind of approach is contradictory to the SignalR logic. This is the first time I use SİgnalR and I am too confused :( Any help would be appreciated.</p>
<c#><asp.net><asp.net-mvc><asp.net-core><signalr>
2019-07-05 08:22:21
LQ_CLOSE
56,899,370
How to mapping an array to another array in efficient way
<p>For these 4 array, a1 a2 a3 </p> <pre><code>a1 = [5,3,0,2,4,2,...,...] a2 = [5,3,0,2,4,2,...,...] =&gt; store index number, correspond value is in b a3 = [5,3,0,2,4,2,...,...] b = [250,300,1,2,70,23,...,...] </code></pre> <p>I want to find an efficient way to generate an array like:</p> <pre><code> c1 = [23,2,250,1,70,1,...,...] c2 = [23,2,250,1,70,1,...,...] c3 = [23,2,250,1,70,1,...,...] </code></pre> <p>But using 3 Forloop solving this problem is too slow in my case. I want to find an efficient way to solve. For example, mapping 3 array at the same time.</p>
<python><python-3.x><numpy>
2019-07-05 08:28:26
LQ_CLOSE
56,901,018
I am using azure devops , and getting unknown field "imagePullPolicy" in io.k8s.api.core.v1.PodSpec while doing helm install
2019-07-05T09:56:41.1837910Z Error: validation failed: error validating "": error validating data: ValidationError(Deployment.spec.template.spec): unknown field "imagePullPolicy" in io.k8s.api.core.v1.PodSpec 2019-07-05T09:56:41.1980030Z ##[error]Error: validation failed: error validating "": error validating data: ValidationError(Deployment.spec.template.spec): unknown field "imagePullPolicy" in io.k8s.api.core.v1.PodSpec
<kubernetes><kubernetes-helm><kubernetes-ingress><azure-aks><azure-kubernetes>
2019-07-05 10:11:54
LQ_EDIT
56,904,919
How do I get the uri from a CloseableHttpResponse
When I get a CloseableHttpResponse object for the response to a web request, and the request was successful, how do I get the URI of the response?
<java><apache-httpclient-4.x>
2019-07-05 14:23:37
LQ_EDIT
56,905,063
Is there any limit of data while tcp transfering between Client-server?
<p>I want to transfer 32k data between client-server with WinSock2. Is it possible or there is a limitation with data?</p>
<c++><tcp><winsock2>
2019-07-05 14:32:22
LQ_CLOSE
56,905,857
Algorithm to detect more than one sequence of 4 same letters horizontally, vertically or diagonally
I have been assigned a task to write an algorithm to detect if a given array of strings contains more than one sequence of 4 repeated letters horizontally, vertically or diagonally. They also asked me the most efficient way to do it. An input example would be something like this: `String[] input = {"ATGCGA","CAGTGC","TTATGT","AGAAGG","CCCCTA","TCACTG"};` but you guys can see it more clearly like a table here: A T G C G A C A G T G C T T A T G T A G A A G G C C C C T A T C A C T G This array contains 3 sequences with a repeated letter: AAAA is found diagonally CCCC is found horizontally GGGG is found vertically So, since there are more than 1 sequence found in this input example, the output should be true. I have an idea to solve this problem but my major issue is handling the diagonals, especially using an efficient way to do it since they expect to use this function in a high concurrency environment. I would be grateful for any help provided. It's ok if someone can't write the code, but at least some ideas to get the right approach to solve this problem. I am thankful already!
<java><string>
2019-07-05 15:31:07
LQ_EDIT
56,905,998
why does '10' is less than '7' or less while we are sorting?
>>> '10'>'3' False >>> >>> a=['10','9','8','7'] >>> a.sort() >>> a ['10', '7', '8', '9'] >>> why '10' is less than '3' ? I tried with several more values but the same thing is happening with it. >>> '10'>'3' False >>> >>> a=['10','9','8','7'] >>> a.sort() >>> a ['10', '7', '8', '9'] >>> I expect the output of '10'>'3' to be True
<python><python-3.x>
2019-07-05 15:42:25
LQ_EDIT
56,906,590
How to create a page automatically after pressing the Submit button (HTML)
<p>When I enter information in a website then press the Submit button, the information is automatically saved in a database after that how the information display on a page?</p> <p>Example: I entered my personal information in a website and saved it by pressing the submit button then I will see my profile page How did this happen? and would I need to specify the action in the form if the page shows up when the end user submits the info?</p> <p>like in StackOverflow site when we create an account automatically we have a URL and page contain our information</p> <p>NOTE: I am a beginner in coding</p>
<javascript><php><jquery><html><ajax>
2019-07-05 16:33:09
LQ_CLOSE
56,907,809
Access array member through two subscripts
<p>I have stored the members of a matrix into a 1D array. The problem now is that I need to access those members throught a 2 index notation like this:</p> <pre><code>int matrix[2][3] = {{ 1 , 2 , 3 },{ 4, 5 , 6 }}; // this is no longer available int x , y; //Stored matrix data on array[] int array[] = {1,2,3,4,5,6}; // only this member available cout &lt;&lt; "Insert the x index : "; cin&gt;&gt; x; cout &lt;&lt; "Insert the y index : "; cin&gt;&gt; y; </code></pre> <p>So, How can I print the matrix [1][1] member stored in on array[] ??</p>
<c++>
2019-07-05 18:29:37
LQ_CLOSE
56,907,982
Mysql Query to find out third line manager
There is a employee table with id, manager_id, salary, department I want to know the maximum salary department wise for third line managers
<mysql>
2019-07-05 18:49:25
LQ_EDIT
56,907,994
How dissemblers maintain the value of registers while analyzing object files?
When we analyze object files using gdb or any dissembler, we put break points into it. At any time it shows the current state of registers. There can be many programs running in background. Each of these programs will also use these registers and can change their value. How does dissembler maintains the value of registers for our program when other processes may be continuously changing it?
<debugging><assembly><gdb><reverse-engineering>
2019-07-05 18:50:18
LQ_EDIT
56,908,510
function call returns NaN when all types are correct
<p>A function call keeps returning NaN, when taken out of context it works but in context it doesn't</p> <p>I've tried changing types between double and Double to no avail</p> <pre><code>private Double average(ArrayList&lt;Double&gt; x){ Double sum = 0.0; for(int i = 0; i &lt; x.size(); i++) sum += x.get(i); return sum / x.size(); } </code></pre> <p>the return is NaN in most cases</p>
<java><types><int><double><nan>
2019-07-05 19:43:26
LQ_CLOSE
56,908,640
Is it functionally/ practically more efficient to create a CLI program that uses Console.Readline();, or args[i] for input?
<p>When creating a console based app, is it functionally more efficient/ practically more efficient to run off of command line start arguments than it is to use <code>Console.ReadLine();</code>? I have two options, open the program and have it listen to my commands via <code>ReadLine</code> in a console window, or I can use CMD like: <code>C:\MYPROGRAM argument</code> and have it take my commands this way. (think ping.exe for example)</p> <p>I have used <code>string userCommand = Console.ReadLine();</code> along with <code>if</code> statements in order to control my program. I have also used <code>userCommand = args[x]</code> as a way to command my program from CMD.</p> <p>Examples:</p> <pre><code>string userCommand = Console.ReadLine(); if(userCommand == "help") { Console.WriteLine(help); } </code></pre> <p>Or</p> <pre><code>if(args[0] == "help") { Console.WriteLine(help); } </code></pre> <p>Both of these methods are working for me, but I do not understand which of these is going to be more efficient in terms of speed/ performance. I also do not understand which one of these is practically a better solution. Is one of these superior to the other for any specific functional/ practical/ potential reason? Note: Google wasn't particularly helpful here.</p>
<c#><command-line-interface><command-line-arguments>
2019-07-05 19:56:49
LQ_CLOSE
56,908,718
AWS - Can't detaching network interfaces - You are not allowed to manage 'ela-attach' attachments
<p>I did the AWS mysfits tutorial and I thought the cleanup would be as simple as deleting the Cloud Formation stack. However, items failed to delete so I am trying to clean them up manually to assist the Cloud Formation stack deletion.</p> <p>I keep getting an error when trying to Detach the network interfaces (I am logged into the root account):</p> <p>Error detaching network interfaces:</p> <blockquote> <pre><code>eni-0047gfhfgh8ab0e: You are not allowed to manage 'ela-attach' attachments. eni-0f4a46hgfha757e: You are not allowed to manage 'ela-attach' attachments. </code></pre> </blockquote> <p>I am unable to delete my VPC without these being deleted.</p> <p>The stack as a whole is failing to delete because of the following: The following resource(s) failed to delete: [InternetGateway, PublicSubnetTwo, VPC, GatewayAttachement, PublicSubnetOne].</p>
<amazon-web-services><amazon-ec2><amazon-vpc><aws-console>
2019-07-05 20:04:27
HQ
56,908,771
TypeError: undefined is not an object (evaluating 'navigator.geolocation.requestAuthorization')
<p>I am attempting to call: </p> <pre><code>`navigator.geolocation.requestAuthorization();` </code></pre> <p>to request geolocation permission.</p> <p>But, this is resulting in error when running in iOS simulator</p> <p>This was working at one point, but stopped. I attempted to delete and create a new project. I also tried to uninstall/reinstall node and react-native-cli.</p> <pre><code>import React, {Fragment, Component} from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, } from 'react-native'; import { Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; export default class App extends Component { constructor(props) { super(props); navigator.geolocation.requestAuthorization(); } render() { return ( &lt;View style={styles.MainContainer}&gt; &lt;SafeAreaView style={{flex: 1, backgroundColor: '#fff'}}&gt; &lt;Text style={styles.sectionTitle}&gt;Hello World!&lt;/Text&gt; &lt;/SafeAreaView&gt; &lt;/View&gt; ); } } const styles = StyleSheet.create({ MainContainer :{ justifyContent: 'center', flex:1, margin: 5, marginTop: (Platform.OS === 'ios') ? 20 : 0, }, sectionTitle: { fontSize: 24, fontWeight: '600', color: Colors.black, }, }); </code></pre> <p>I am getting this error: </p> <pre><code>[error][tid:com.facebook.react.JavaScript] TypeError: undefined is not an object (evaluating 'navigator.geolocation.requestAuthorization') This error is located at: in App (at renderApplication.js:40) in RCTView (at View.js:35) in View (at AppContainer.js:98) in RCTView (at View.js:35) in View (at AppContainer.js:115) in AppContainer (at renderApplication.js:39) </code></pre>
<react-native><geolocation>
2019-07-05 20:12:23
HQ
56,909,180
Decoding Kubernetes secret
<p>I inherited a Kubernetes/Docker setup, and I accidentally crashed the pod by changing something relating to the DB password.</p> <p>I am trying to troubleshoot this.</p> <p>I don't have much Kubernetes or Docker experience, so I'm still learning how to do things.</p> <p>The value is contained inside the db-user-pass credential I believe, which is an Opaque type secret.</p> <p>I'm describing it:</p> <pre><code>kubectl describe secrets/db-user-pass Name: db-user-pass Namespace: default Labels: &lt;none&gt; Annotations: &lt;none&gt; Type: Opaque Data ==== password: 16 bytes username: 13 bytes </code></pre> <p>but I have no clue how to get any data from this secret. The example on the Kubernetes site seems to assume I'll have a base64 encoded string, but I can't even seem to get that. How do I get the value for this?</p>
<docker><kubernetes>
2019-07-05 20:59:46
HQ
56,909,587
Get first and second element satisfying a CSS path
<p>Let's say I have a CSS path: <code>.event__participant.event__participant--away</code> How can I get the first element satisfying that path? Or second element? Or X element? I'm using selenium and I don't want to be getting all 100+ of them. <code>:nth-type-of</code> doesn't work and I can't use <code>nth-child</code> because it has more children than just <code>.event__participant--away</code>.</p>
<css><selenium><xpath><path><selector>
2019-07-05 21:52:24
LQ_CLOSE
56,909,704
how to know if a .txt extension cotains a plain text or a CSV structure?
A client sends a csv structure in a .txt file and at other times sends a flat structure with paragraphs and sentences. How can I identify through a program in C # if the file sent by the client is a CSV or a plain text? **CSV Example:** 1,33838,20181217,GTR,5,1587,S,"STT PPP USA, SA.",N,2,58.00,3,58.00 2,1,0,0,LHG,1000000007,,6,0,1000000006, 2,2,0,0,LHG,1000000007,,6,0,1000000003, **Text Plane Example:** ASCII Converter enables you to easily convert ASCII characters to their hex, decimal, and binary representations. In addition, base64 encode/decode binary data. As you type in one of the text boxes above, the other boxes are converted on the fly. The ASCII converter doesn't automatically add spaces between the converted values. You can use the add spaces button to separate the ASCII characters so that the converted values will also be separated from one another.
<c#><csv>
2019-07-05 22:11:12
LQ_EDIT
56,910,040
How i can get image from printer scanner using javascript library
<p>I want to make node js script that allows to user to get scanned image from printer scanner </p>
<javascript><node.js><npm>
2019-07-05 23:11:03
LQ_CLOSE
56,910,854
SwiftUI Views with a custom init
<p>Let's say that I am making a custom input element that looks like this:</p> <pre class="lang-swift prettyprint-override"><code>struct CustomInput : View { @Binding var text: String var name: String var body: some View { TextField(name, text: $text) .modifier(InputModifier()) } } </code></pre> <p>Currently, when I instantiate this view I'm required to pass both <code>text</code> and <code>name</code> names to arguments. I want to be able to make the <code>name</code> argument optional, like in the example below.</p> <pre class="lang-swift prettyprint-override"><code> CustomInput("Some name", $text) </code></pre> <p>Typically I'd use an init method for this. But I'm not sure how to handle property wrappers like <code>@Binding</code> in the init function. </p> <p>Any ideas on how I can achieve this?</p>
<swift><swiftui>
2019-07-06 02:47:21
HQ
56,911,187
Android Studio com.google.wireless.android.sdk.stats.IntellijIndexingStats
<p>I having a problem building my android project.</p> <p>I somehow ended up with this exception and i cant figure out what it is.</p> <pre><code>Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at com.intellij.util.indexing.counters.IndexCounters.&lt;clinit&gt;(IndexCounters.java:34) at com.intellij.util.indexing.impl.MapReduceIndex.&lt;init&gt;(MapReduceIndex.java:85) at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.&lt;init&gt;(CompilerReferenceIndex.java:232) at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.&lt;init&gt;(CompilerReferenceIndex.java:79) at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.&lt;init&gt;(JavaCompilerBackwardReferenceIndex.java:12) at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:79) at org.jetbrains.jps.incremental.java.JavaBuilder.buildStarted(JavaBuilder.java:148) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:363) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) </code></pre> <p>Im running <code>android studio 3.5</code> as i read that it should have solved the problem but im still gitting it.</p>
<java><android>
2019-07-06 04:17:02
HQ
56,913,590
Data.table - group by with custom functions that returns a matrix
I have below Data.table library(data.table) DT = as.data.table(data.frame(Z=c("abc","abc","def","abc"), column=c(1,2,3,4), someOtherColumn=c(5,6,7,8))) Fn = function(DT1) { Value = as.numeric(DT1[1, 2]) Calc = sapply(DT1[, c("Z"):=NULL], sum) - Value return(matrix(Calc, nr = 1, nc = length(Calc))) } Now, I want to apply `Fn()` to each group formed by `'Z'`, and get a resulting matrix with 2 rows (because there are 2 unique members in `DT$Z`) and 2 rows DT[, Fn(.SD), by = Z, .SDcols = c('Z', 'column', 'someOtherColumn')] But with that I am getting error as Error in `[.data.table`(DT1, , `:=`(c("Z"), NULL)) : .SD is locked. Using := in .SD's j is reserved for possible future use; a tortuously flexible way to modify by group. Use := in j directly to modify by group by reference. Any pointer towards the right approach to achieve that same will be helpful. I have a quick big `DT, so am looking for some efficient method.`
<r><data.table>
2019-07-06 11:16:48
LQ_EDIT
56,914,927
How to group by two field?
I have the following table: listId | accountId | ammount | 1 1 20 1 1 20 2 2 30 2 2 30 I need to `sum(ammount)` and group by `listId, accountId` to get result: listId | accountId | ammount | 1 1 40 2 2 60 But this does not work for me: `SUM(ammount) ... GROUP BY listId, accountId`
<mysql><sql>
2019-07-06 14:18:13
LQ_EDIT
56,915,622
how to do the activat route in angular?
My url http://xx.xx.xxx.xxx:xxxx/#/Test?name=7779394 how can i get '7779394'? i tried the follow code: this.activatedRoute.queryParams.subscribe(params => { this.ind = params.name; console.log("this.ind " + params.name); }); but the result is undefined first, after undefined, the function run again and god 7779394 but it should run one time only how to fix this ?
<angular>
2019-07-06 15:54:41
LQ_EDIT
56,915,651
Can't boot after installing ubunto with windows 10
<p>I have asus computer with uefi mode and windows 10 installed on.</p> <p>I istalled ubuntu 16 with custom installation and then i can.t run both systems. There is no boot file. </p> <p>I have this message when booting the computer: reboot and select proper boot device or insert boot media in selected boot device and press a key</p> <p>What i have to do? I don't want to loose my files on windowd 10.</p>
<installation><ubuntu-16.04>
2019-07-06 15:57:46
LQ_CLOSE
56,916,798
React/RCTBridgeDelegate.h' file not found
<p>I have created a new project called auth using react-native init auth at terminal.When i tried to run the project using react-native run-ios. The build failed and gave a error 'React/RCTBridgeDelegate.h' file not found.</p> <p>Tried to update the react native version</p> <p>react-native run-ios at terminal in mac</p> <p>I expect the build to be successful and see the ios simulator The actual result which i got is build failed and hence cant see the simulator</p>
<react-native><build><project><new-operator>
2019-07-06 18:49:13
HQ
56,917,794
Can these multiple if statements be condensed?
<p>I made a simple program that tells the user what cards are still in a deck based on the cards seen.If one looks at the code you can see that there are several if statements that do almost the same thing. Could anyone help me condense these?</p> <pre class="lang-py prettyprint-override"><code>for card in cards_seen: if card.endswith('C') == True: Deck["clubs"].remove(card) if card.endswith('D') == True: Deck["diamonds"].remove(card) if card.endswith('H') == True: Deck["hearts"].remove(card) if card.endswith('S') == True: Deck["spades"].remove(card) </code></pre>
<python>
2019-07-06 21:28:34
LQ_CLOSE
56,917,963
react-native ios Podfile issue with "use_native_modules!"
<p>In my react-native project (react-native@0.60) in the ios/ dir I run <code>pod install</code> and get this error:</p> <pre><code>[!] Invalid `Podfile` file: no implicit conversion of nil into String. # from /Users/coryrobinson/projects/hhs2/ios/Podfile:37 # ------------------------------------------- # &gt; use_native_modules! # end # ------------------------------------------- </code></pre> <p>I haven't added or changed anything in this Podfile - it's all react-native generated. (I'm not experienced in iOS dev so this might be a simple fix, I just don't know what to look for :-|) Thanks for any help!</p> <p>Here is my Podfile</p> <pre><code>platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'hhs2' do # Pods for hhs2 pod 'React', :path =&gt; '../node_modules/react-native/' pod 'React-Core', :path =&gt; '../node_modules/react-native/React' pod 'React-DevSupport', :path =&gt; '../node_modules/react-native/React' pod 'React-fishhook', :path =&gt; '../node_modules/react-native/Libraries/fishhook' pod 'React-RCTActionSheet', :path =&gt; '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path =&gt; '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path =&gt; '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path =&gt; '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path =&gt; '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path =&gt; '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path =&gt; '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path =&gt; '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path =&gt; '../node_modules/react-native/Libraries/Vibration' pod 'React-RCTWebSocket', :path =&gt; '../node_modules/react-native/Libraries/WebSocket' pod 'RNFS', :path =&gt; '../node_modules/react-native-fs' pod 'React-cxxreact', :path =&gt; '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path =&gt; '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path =&gt; '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path =&gt; '../node_modules/react-native/ReactCommon/jsinspector' pod 'yoga', :path =&gt; '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec =&gt; '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec =&gt; '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec =&gt; '../node_modules/react-native/third-party-podspecs/Folly.podspec' target 'hhs2Tests' do inherit! :search_paths # Pods for testing end use_native_modules! end target 'hhs2-tvOS' do # Pods for hhs2-tvOS target 'hhs2-tvOSTests' do inherit! :search_paths # Pods for testing end end </code></pre>
<ios><react-native><cocoapods><react-native-ios>
2019-07-06 22:04:15
HQ
56,918,481
Method App\Http\Requests\EndTripRequest::rules()
Hello I'm new on Laravel and while i'm working with a code i found an error when i try to call an API from the application on android I'm really lost with it i don't even know what is the problem I don't know where to start ReflectionException: Method App\Http\Requests\EndTripRequest::rules() does not exist in file /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php on line 142 Stack trace: 1. ReflectionException-&gt;() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:142 2. ReflectionMethod-&gt;__construct() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:142 3. Illuminate\Container\BoundMethod-&gt;getCallReflector() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:120 4. Illuminate\Container\BoundMethod-&gt;getMethodDependencies() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32 5. Illuminate\Container\BoundMethod-&gt;Illuminate\Container\{closure}() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90 6. Illuminate\Container\BoundMethod-&gt;callBoundMethod() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34 7. Illuminate\Container\BoundMethod-&gt;call() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:576 8. Illuminate\Container\Container-&gt;call() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php:105 9. Illuminate\Foundation\Http\FormRequest-&gt;createDefaultValidator() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php:84 10. Illuminate\Foundation\Http\FormRequest-&gt;getValidatorInstance() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php:23 11. Illuminate\Foundation\Http\FormRequest-&gt;validateResolved() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php:30 12. Illuminate\Foundation\Providers\FormRequestServiceProvider-&gt;Illuminate\Foundation\Providers\{closure}() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:1082 13. Illuminate\Container\Container-&gt;fireCallbackArray() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:1046 14. Illuminate\Container\Container-&gt;fireAfterResolvingCallbacks() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:1031 15. Illuminate\Container\Container-&gt;fireResolvingCallbacks() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:687 16. Illuminate\Container\Container-&gt;resolve() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Container/Container.php:615 17. Illuminate\Container\Container-&gt;make() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:757 18. Illuminate\Foundation\Application-&gt;make() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php:79 19. Illuminate\Routing\ControllerDispatcher-&gt;transformDependency() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php:46 20. Illuminate\Routing\ControllerDispatcher-&gt;resolveMethodDependencies() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php:27 21. Illuminate\Routing\ControllerDispatcher-&gt;resolveClassMethodDependencies() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:41 22. Illuminate\Routing\ControllerDispatcher-&gt;dispatch() /home/********/domains/hilove.tech/vendor/laravel/framework/src/Illuminate/Routing/Route.php:2 responseFromServerError D/errror: null D/error: [Ljava.lang.StackTraceElement;@33928b1 null
<laravel-5>
2019-07-07 00:02:36
LQ_EDIT
56,918,767
Disable check of camel case rule in eslint
<p>I have a large JavaScript file with multiple eslint rule violations. I am trying to disable them and address them one at a time. The code below shows that I can disable them all with no trouble, but not the rule about camelcase and perhaps other individual rules. The approaches I have used should work according to the eslint documentation, but there must be a flaw in my interpretation.</p> <p>The code is short and it does not eliminate the error concerning camel case. </p> <pre><code>/* eslint-disable /* eslint-disable// works but gets everything. `/* eslint (camelcase) : 0 */ /* eslint camelcase : ["error", {ignoreDestructuring:true}] */ </code></pre> <p><code>const Lesson_1 = {title:'The Home Row Keys.'},'lesson': 'jjj fff jjj fff'}</code></p> <p>Just get the same camelcase error without any change. The eslint documentation says just disable the entire rule but does not specify a method other than listed above.</p>
<constants><eslint><camelcasing><disable>
2019-07-07 01:26:41
HQ
56,918,926
Find elements which are present in first array and not in second given arrays are in sorted?solve in linear time and without using collections
static void findMissing(int a[], int b[], int n, int m) { for (int i = 0; i < n; i++) { int j; for (j = 0; j < m; j++) if (a[i] == b[j]) break; if (j == m) System.out.print(a[i] + " "); }
<arrays><algorithm>
2019-07-07 02:19:19
LQ_EDIT
56,921,506
How to print array of numbers given i and j? Such that some of all elements of i is equal to j
Given number i and j. Print an array of length i such that the sum of all the elements in array is equal j. input: i = 5 ; j = 27; Output: 6 6 5 5 5
<c++><algorithm>
2019-07-07 10:52:58
LQ_EDIT
56,922,180
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually
<p>This error came up after upgrading to React Native 0.60.</p> <p>I've tried to manually unlink each manually linked dependency using <code>react-native unlink &lt;dependency&gt;</code> as suggested in the error message, but the problem still persists.</p> <p>The error message is as follows:</p> <pre><code>error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: - react-native-admob (to unlink run: "react-native unlink react-native-admob") - react-native-facebook-account-kit (to unlink run: "react-native unlink react-native-facebook-account-kit") - react-native-fbsdk (to unlink run: "react-native unlink react-native-fbsdk") - react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler") - react-native-linear-gradient (to unlink run: "react-native unlink react-native-linear-gradient") - react-native-localization (to unlink run: "react-native unlink react-native-localization") - react-native-restart (to unlink run: "react-native unlink react-native-restart") - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons") - react-native-webview (to unlink run: "react-native unlink react-native-webview") This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink &lt;dependency&gt;" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md </code></pre>
<react-native>
2019-07-07 12:31:50
HQ
56,922,517
Getting First unix number in array php
i have array [1,2,1,2,3,4,5,] and i want make function in php that will return first Unix number in those array is 3 or how we can remove all double array and will return [3,4,5]
<php>
2019-07-07 13:20:37
LQ_EDIT
56,923,006
Front Degradation Issue
I'm beginning to learn the basics of HTML and CSS and am currently working through the FreeCodeCamp program. Currently, I cannot create an account to access the forums there so I'm going to attempt to solve it here. Within the problem, it's asking the user to add a second font and comment out the Google font import at the top. Everything is correct and accepted as so yet it's saying the H2 element must use the "Lobster" font. The problem is that the current font is already set the "Lobster". I've tried adding a separate font-family beneath the Lobster font, but this removes the functionality of the degradation feature. This did not work. I also attempted to rearrange the formatting of the code but doing so breaks it even more. Here are the directions. Your h2 element should use the font Lobster. Your h2 element should degrade to the font monospace when Lobster is not available. Comment out your call to Google for the Lobster font by putting <!-- in front of it. Be sure to close your comment by adding -->. <!--<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">--> <style> .red-text { color: red; } h2 { font-family: Lobster, monospace; } p { font-size: 16px; font-family: monospace; } </style> <h2 class="red-text">CatPhotoApp</h2> <main> <p class="red-text">Click here to view more <a href="#">cat photos</a>.</p> <a href="#"><img src="image-removed" alt="A cute orange cat lying on its back."></a> <div> <p>Things cats love:</p> <ul> <li>cat nip</li> <li>laser pointers</li> <li>lasagna</li> </ul> <p>Top 3 things cats hate:</p> <ol> <li>flea treatment</li> <li>thunder</li> <li>other cats</li> </ol> </div> <form action="/submit-cat-photo"> <label><input type="radio" name="indoor-outdoor" checked> Indoor</label> <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br> <label><input type="checkbox" name="personality" checked> Loving</label> <label><input type="checkbox" name="personality"> Lazy</label> <label><input type="checkbox" name="personality"> Energetic</label><br> <input type="text" placeholder="cat photo URL" required> <button type="submit">Submit</button> </form> </main> I expect everything to be correct as is, and for this to be an error on the program's end. Unlikely.. but I'm confident I followed the directions accurately.
<html><css><fonts>
2019-07-07 14:27:54
LQ_EDIT
56,923,576
Django E.408, E.409 and E.410 errors on runserver
<p>I am installing a new Django project using virtualenv, all in the normal way. My version of Python is 3.7.3, and django is 2.2.3. </p> <p>If I do python manage.py runserver, I get the following errors:</p> <pre><code>?: (admin.E408)'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application. ?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application. ?: (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware' must be in MIDDLEWARE in order to use the admin application. </code></pre> <p>Here is my settings.py, and you can see that those middleware are there. </p> <pre><code>""" Django settings for fcc_new project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = MY KEY goes here # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'fcc_new.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'fcc_new.wsgi.application' # Database # https://docs.djangoproject.com/en/1.9/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.9/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' </code></pre> <p>I've tried reinstalling, checking versions, and changing 'MIDDLEWARE_CLASSES' to 'MIDDLEWARE'. Nothing is working. Can anyone identify the problem?</p>
<python><django><admin>
2019-07-07 15:31:36
HQ
56,925,321
ItemSource/DataSource for Text Blocks
Im using dapper to retrieve some data from a database using a list. I've been able to do it with a ListBox with ``` private void UpdateBinding() { displayLastNameLB.ItemsSource = people; displayLastNameLB.DisplayMemberPath = "FullInfo"; } ``` and now I want to display it onto a TextBlock but I cant find how. What would be the text block equivalent of `ItemSource` and `DisplayMemberPath`? Heres the full code. ``` public partial class MainWindow : Window { List<Person> people = new List<Person>(); public MainWindow() { InitializeComponent(); UpdateBinding(); } private void UpdateBinding() { displayLastNameLB.ItemsSource = people; displayLastNameLB.DisplayMemberPath = "FullInfo"; } private void Search_Click(object sender, RoutedEventArgs e) { DataAccess db = new DataAccess(); people = db.GetPeople(lastNameTB.Text); UpdateBinding(); } } ``` **The Person List** ``` public class Person { public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } public string PhoneNumber { get; set; } public string FullInfo { get { return $"{ FirstName } { LastName } ({ PhoneNumber })"; } } public string FirstNameOnly { get { return $"{ FirstName }"; } } } ```
<c#><wpf><dapper>
2019-07-07 19:12:35
LQ_EDIT
56,926,056
Python: Please why does this code print out only the first letter?
Word=input('please enter a word') def cap(word): for char in word: if char in 'aeiou': return letter.upper() else: return letter result=cap(word) print result
<python><string><return><return-value><uppercase>
2019-07-07 20:56:25
LQ_EDIT