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 |
|---|---|---|---|---|---|
59,214,058 | How to build a system that gets GPS data from 4000+ embedded devices and processes it in real time | <p>I want to develop a system that has 4000 embedded devices that send their GPS data every 10 second to the system and this system is expected to handle this amount of data flow and required to perform mathematical operations on these data. I want this system to be open for upgrades so it should handle adding more devices. What kind of devices should I use and what kind of software should they run?
Should the devices have OS'es or not? If they should what OS should they run? Thank you for your time in advance.</p>
| <operating-system><embedded><iot> | 2019-12-06 13:22:35 | LQ_CLOSE |
59,214,772 | Analog TrimLeft C# function | <p>How can I remove leading zeros from a string such as '0097619896'?</p>
| <sql><sql-server> | 2019-12-06 14:10:00 | LQ_CLOSE |
59,216,125 | How to select unique nested dictionaries from list | <p>I have a list with nesetd dictionaries:</p>
<pre><code>lst = [
{'a':{'a1':1,'a2':2},
'b':{'b1':1,'b2':2},
'c':{'c1':1,'c2':2}},
{'a':{'a2':2,'a1':1},
'b':{'b1':1,'b2':2},
'c':{'c1':1,'c2':2}},
{'a':{'a1':1,'a2':2},
'b':{'bb1':11,'bb2':22},
'c':{'c1':1,'c2':2}},
{'b':{'b1':1,'b2':2},
'a':{'a1':1,'a2':2},
'c':{'c1':1,'c2':2}},
{'a':{'a1':1,'a2':2},
'b':{'b1':1,'b2':2}}]
</code></pre>
<p>I want to select only unique ones( it means that they have the same names of keys and values and the same amount of keys and values, but if some dictionaries are same but with different orders of keys with values they are the same type).
So the ouput must be like this:</p>
<pre><code>[
{'a':{'a1':1,'a2':2},
'b':{'b1':1,'b2':2},
'c':{'c1':1,'c2':2}},
{'a':{'a1':1,'a2':2},
'b':{'bb1':11,'bb2':22},
'c':{'c1':1,'c2':2}},
{'a':{'a1':1,'a2':2},
'b':{'b1':1,'b2':2}}]
</code></pre>
<p>How could i do that?</p>
| <python><python-3.x><dictionary> | 2019-12-06 15:36:28 | LQ_CLOSE |
59,216,302 | how to create a first vue js project | <p>I just started with vue.js. I created a simple project but it is not working.Please check what is wrong in the above code. I totally new to this I don't know what I have made mistake in this.</p>
<p>thank you </p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="root">
<input type="text" v-model="name">
<p>Hi my name is: {{ name }}</p>
</div>
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script>
new vue({
el: '#root',
data: {
name: 'Matheen'
}
});
</script>
</code></pre>
<p>
</p>
| <vue.js> | 2019-12-06 15:47:59 | LQ_CLOSE |
59,219,028 | Transform info in json valid | <p>Transform this result in json valid.</p>
<pre><code>"{\"name\":\"log\",\"hostname\":\"denis-Latitude-E7470\",\"pid\":1007,\"level\":30,\"conextion\":\"DBA MongDB: \[32m%s\[0m\",\"msg\":\"online\",\"time\":\"2019-12-06T13:50:42.510Z\",\"v\":0}"
</code></pre>
| <javascript><node.js><json> | 2019-12-06 19:15:19 | LQ_CLOSE |
59,219,107 | Coping a row from sheet to another based on whether the candidate is accepted or rejected | <p>Now, I'm trying to create a semi automated tool in google sheets for hiring (self-use). I need a code to copy the whole row based on whether the candidate is (Accepted or Rejected) if the candidate is accepted I want to copy the whole row and paste it in the (Accepted Candidates Sheet).</p>
<p>Can anyone support me?</p>
<p>Thanks in advance.</p>
| <google-apps-script><google-sheets> | 2019-12-06 19:21:57 | LQ_CLOSE |
59,219,450 | HOw Can I black & white camera in unity 2019.1.9? | I want make a filter camera for unity that black & white in unity 2019.1.9
how can I make it?
that can change it to RGB and black and white every time
thanks | <c#><unity3d> | 2019-12-06 19:48:09 | LQ_EDIT |
59,219,636 | How to convert string 21/01/2019 (dd/MM/yyyy) to Date object in same format using Java | <p>My input string is "22/12/2019" in "dd/MM/yyyy" format. I need to convert this string into Date object while retaining the format. The output still needs to be in dd/MM/yyyy format but it should be a Date object. Please advise</p>
| <java><string><date><datetime> | 2019-12-06 20:03:49 | LQ_CLOSE |
59,219,787 | Parallel vectors in C | I need some help with the use of parallel vectors. What I want to do is have 2 parallel vectors, 1 containing the alphabet and the other, the alphabet the other way around and when someone types in a word, it prints out the word using the inverted alphabet.
```#include <iostream>
#include <ctype.h>
using namespace std;
void search(char alfab[], char cripto[], int code){
cout << "Introduce your message: " << endl;
cin >> code;
for(int i = 0; i < code; i++)
{
if(code == 0){
cout << "Your code is:" << cripto[i] << endl;
}
}
}
int main(){
char alfab[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char cripto[26] = {'z','y','x','w','v','u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a'};
char code;
}```
This is what I've done up until now and I'm not too sure if I'm on the right track or not, I'd appreciate some help, thank you! | <c++><arrays><vector> | 2019-12-06 20:16:48 | LQ_EDIT |
59,220,108 | How to sort array in javascript or typescript by a key but if key is same sort in alphabetical order? | <p>I have this array </p>
<pre><code>[
{
"Books": [],
"_id": "5dea9a11a8e1bf301c462ce4",
"FileName": "AAAAA",
"Order": 99999
},
{
"_id": "5dea9864a8e1bf301c462cdb",
"Books": [],
"FileName": "some1",
"Order": 3
},
{
"Books": [],
"_id": "5dea9873a8e1bf301c462ce1",
"FileName": "among3",
"Order": 3
},
{
"Books": [],
"_id": "5dea986ba8e1bf301c462cde",
"FileName": "things2",
"Order": 2
},
{
"Books": [],
"_id": "5dea9a18a8e1bf301c462ce7",
"FileName": "FFFF",
"Order": 99999
},
{
"Books": [],
"_id": "5dea9a1ea8e1bf301c462cea",
"FileName": "BBBB",
"Order": 99999
}
]
</code></pre>
<p>Now I want to sort array by Order and if order is same then sort by alphabetically FileName.
So sorted array will look like this:</p>
<pre><code>[
{
"Books": [],
"_id": "5dea986ba8e1bf301c462cde",
"FileName": "things2",
"Order": 2
},
{
"Books": [],
"_id": "5dea9873a8e1bf301c462ce1",
"FileName": "among3",
"Order": 3
},
{
"_id": "5dea9864a8e1bf301c462cdb",
"Books": [],
"FileName": "some1",
"Order": 3
},
{
"Books": [],
"_id": "5dea9a11a8e1bf301c462ce4",
"FileName": "AAAAA",
"Order": 99999
},
{
"Books": [],
"_id": "5dea9a1ea8e1bf301c462cea",
"FileName": "BBBB",
"Order": 99999
},
{
"Books": [],
"_id": "5dea9a18a8e1bf301c462ce7",
"FileName": "FFFF",
"Order": 99999
},
]
</code></pre>
<p>I am able to do it in more than two loops but not sure how optimized is that. Looking for any optimized solution. Plain javascript or Typescript with Interface comparer will also work thanks.</p>
| <javascript><arrays><typescript> | 2019-12-06 20:45:59 | LQ_CLOSE |
59,222,033 | Constructor in Java - Scanner Class | import java.util.Scanner;
public class Tutorials {
public static void main(String[] args) {
Car Vehicle = new Car();
Vehicle.supboys();
}
}
import java.util.Scanner;
public class Car {
private String Vehicle;
public Car(String name) {
Vehicle=name;
}
Car() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setName (String name) {
Vehicle=name;
}
public String getName (){
return Vehicle;
}
public void saying(){
System.out.printf("Vehicle Brand is called %s\n ", getName());
}
public void supboys() {
Scanner Boyz = new Scanner(System.in);
System.out.println ("Your New Car is " + Boyz);
}
}
I am new to programming so I wanted to some practise, regarding constructors. I wanted to try doing a scanner class for this program but cant seem to get it to work. The program does not give a proper error message to me either. Does anyone have any suggestions? (Apologies for the messy code)
| <java><java.util.scanner> | 2019-12-07 00:42:50 | LQ_EDIT |
59,223,666 | Directory conventions for extra files | <p>I have written a (python) script which identifies all node on its subnet (NAT subnet) and send an email if the IP address doesn't exist within a record. For this size of project, I don't want to run a database. I think a text file delimited by new lines with an IP address on each would be suitable. What is the appropriate convention for the directory this file would be placed?</p>
| <python> | 2019-12-07 06:45:00 | LQ_CLOSE |
59,223,833 | Pin point where the optional is returning nil | <p>The output of my code is "Optional(46 bytes)"
how can I pint point which variable is returning nil so I can adjust it.</p>
| <swift><xcode> | 2019-12-07 07:15:37 | LQ_CLOSE |
59,224,367 | SQL - Schemas - MS SQL Server | <p>I'm in a new job using Microsoft SQL Server.
Is there a way to show how all of these tables link together?</p>
| <sql><sql-server> | 2019-12-07 08:43:12 | LQ_CLOSE |
59,224,530 | How can I apply multiple transformation to the same key in a Python dictionary | <p>I am an inventory manager, and my stock is as below</p>
<pre><code>oldstock = {"A":100,"B":120,"C":150,"D":100,"E":230,"F":200,"G":180,"H":140,"I":90,"J":50}
</code></pre>
<p>I sold some items from each bin as below however (seems as though a list of dictionaries was the best way to represent it)</p>
<pre><code>sale = [{"A":20},{"C":25},{"E":15},{"F":18},{"H":20},{"C":35},{"A":40},{"A":5},{"E":40},{"H":20}]
</code></pre>
<p>How can I calculate my new stock after making these sales per bin?</p>
| <python><list><dictionary> | 2019-12-07 09:10:55 | LQ_CLOSE |
59,224,869 | How to handle datecodes from excel in R with dplyr | <p>Hy everybody</p>
<p>I already imported a excelsheet with stock data. The import changes the appearance of the date column. This means, imported in R the dataset has structure as seen in dummy_df2:</p>
<pre><code>dates <- as.tibble(c("32143","32146", "32147","32148"))
Stock1 <- as.tibble(c("NA", "NA", "NA", "NA"))
Stock2 <- as.tibble(c("NA", "NA", "NA", "NA"))
Stock3 <- as.tibble(c("NA", "NA", "NA", "NA"))
dummy_df <- bind_cols(dates,Stock1,Stock2,Stock3)
dummy_df2 <- dummy_df %>% rename(Date ="value", Stock1 = "value1", Stock2 = "value2", Stock3 = "value3")
</code></pre>
<p>I tried convert the Date column variables via the convertToDate command but it seems not to be the right approach. Does anyone know a handy solution to solve this issue?</p>
<p>Kind regards</p>
| <r><excel><dplyr> | 2019-12-07 10:00:48 | LQ_CLOSE |
59,225,142 | Exam results processing | <p>I am trying to process around 8000 exam results I have put these in a datatable.</p>
<p>What I would like to know is how you would go about processing this data from a statistical point of view.</p>
<p>I have looked at averages and Max/min using summary in r.
I have used to scatter plot to plot the data.
I have used the ridgeline graph generation in ggplot to get understanding of the density/histogram within the various exam subjects.</p>
<p>I would love to hear if people had processed such data before and what tests they used, any recommendations on plots that I could use to help our users understand the data would also be very helpful</p>
<p>Please send on any links or relevant information or papers that you might feel relevant.</p>
<p>Thanks
P</p>
| <r><dataframe><ggplot2><statistics><statsmodels> | 2019-12-07 10:42:30 | LQ_CLOSE |
59,225,770 | java main method wont compile because it cannot find a symbol to create an object | <p>im relatively new to java since im attending my first year at university.
currently we are doing OOP in class and i have the following problem:</p>
<p>i am creating a "Train", but when i try to compile it , it gives the following error:
<a href="https://i.gyazo.com/2d4f3ccc68f45419a9439ab9adb1a499.png[1]" rel="nofollow noreferrer">https://i.gyazo.com/2d4f3ccc68f45419a9439ab9adb1a499.png[1]</a></p>
<p>which is really confusing to me because i have tried to run the main method in eclipse's console and it ran just fine.</p>
<p>my waggon class:</p>
<pre><code> package sheet08;
//a)
public class Waggon {
private int SitzGesamt, SitzReserviert, SitzFrei ;
private int Klasse;
private String Doppelwagen;
private int WCbesetzt, WCfrei , WCdefekt;
private String WaggonHinten;
//b)
//Getter & Setter
public int getSitzGesamt() {
return SitzGesamt;
}
public void setSitzGesamt(int sitzGesamt) {
SitzGesamt = sitzGesamt;
}
public int getSitzReserviert() {
return SitzReserviert;
}
public void setSitzReserviert(int sitzReserviert) {
SitzReserviert = sitzReserviert;
}
public int getSitzFrei() {
return SitzFrei;
}
public void setSitzFrei(int sitzFrei) {
SitzFrei = sitzFrei;
}
public int getKlasse() {
return Klasse;
}
public void setKlasse(int klasse) {
Klasse = klasse;
}
public String getDoppelwagen() {
return Doppelwagen;
}
public void setDoppelwagen(String doppelwagen) {
Doppelwagen = doppelwagen;
}
public int getWCbesetzt() {
return WCbesetzt;
}
public void setWCbesetzt(int wCbesetzt) {
WCbesetzt = wCbesetzt;
}
public int getWCfrei() {
return WCfrei;
}
public void setWCfrei(int wCfrei) {
WCfrei = wCfrei;
}
public int getWCdefekt() {
return WCdefekt;
}
public void setWCdefekt(int wCdefekt) {
WCdefekt = wCdefekt;
}
public String getWaggonHinten() {
return WaggonHinten;
}
public void setWaggonHinten(String waggonHinten) {
WaggonHinten = waggonHinten;
}
//default Constructor
public Waggon() {
}
//Constructor
public Waggon(int sitzGesamt, int sitzReserviert, int sitzFrei, int klasse, String doppelwagen, int wCbesetzt,
int wCfrei, int wCdefekt, String waggonHinten) {
super();
SitzGesamt = sitzGesamt;
SitzReserviert = sitzReserviert;
SitzFrei = sitzFrei;
Klasse = klasse;
Doppelwagen = doppelwagen;
WCbesetzt = wCbesetzt;
WCfrei = wCfrei;
WCdefekt = wCdefekt;
WaggonHinten = waggonHinten;
}
// e)
public String toString(){
String strSitzGesamt = String.valueOf(SitzGesamt);
String strSitzReserviert = String.valueOf(SitzReserviert);
String strSitzFrei = String.valueOf(SitzFrei);
String strKlasse = String.valueOf(Klasse);
String strWCbesetzt = String.valueOf(WCbesetzt);
String strWCfrei = String.valueOf(WCfrei);
String strWCdefekt = String.valueOf(WCdefekt);
return strSitzGesamt + "-" + strSitzReserviert + "-" + strSitzFrei + "-" + strKlasse + "-" + Doppelwagen + "-" + strWCbesetzt + "-" +
strWCfrei + "-" + strWCdefekt + WaggonHinten;
}
}
</code></pre>
<p>my "Train" class:</p>
<pre><code> package sheet08;
public class Train {
int Baureihe;
String Antriebsart;
int PS;
int Höchstgeschwindigkeit;
int WaggonDahinter;
//Getter&Setter
public int getBaureihe() {
return Baureihe;
}
public void setBaureihe(int baureihe) {
Baureihe = baureihe; //this.baurihe = baureihe
}
public String getAntriebsart() {
return Antriebsart;
}
public void setAntriebsart(String antriebsart) {
Antriebsart = antriebsart;
}
public int getPS() {
return PS;
}
public void setPS(int pS) {
PS = pS;
}
public int getHöchstgeschwindigkeit() {
return Höchstgeschwindigkeit;
}
public void setHöchstgeschwindigkeit(int höchstgeschwindigkeit) {
Höchstgeschwindigkeit = höchstgeschwindigkeit;
}
public int getWaggonDahinter() {
return WaggonDahinter;
}
public void setWaggonDahinter(int waggonDahinter) {
WaggonDahinter = waggonDahinter;
}
//default Constructor
public Train() {
}
//Constructor
public Train(int baureihe, String antriebsart, int pS, int höchstgeschwindigkeit, int waggonDahinter) {
super();
Baureihe = baureihe;
Antriebsart = antriebsart;
PS = pS;
Höchstgeschwindigkeit = höchstgeschwindigkeit;
}
//e)
public String toString(){
String strBaureihe = String.valueOf(Baureihe);
String strPS = String.valueOf(PS);
String strHöchstgeschwindigkeit = String.valueOf(Höchstgeschwindigkeit);
return strBaureihe + "-" + Antriebsart + "-" + strPS + "-" + strHöchstgeschwindigkeit;
}
}
</code></pre>
<p>and the main method itself :</p>
<pre><code>package sheet08;
import java.util.Random;
public class Test {
public static void main( String[] args ) {
Random WCkaputt = new Random();
int WCdefekt = WCkaputt.nextInt(100)+1;
System.out.println("Die Toilette ist zu " + WCdefekt + " % kaputt");
Train t1 = new Train (412, "elektrisch", 13500, 250, 1);
Waggon w1 = new Waggon(50, 24, 3, 1, "doppelstock", 0, 0, 0, "1 Waggon dahinter"); //keine Angabe über die WC-Anzahl
Waggon w2 = new Waggon(100, 12, 64, 2, "doppelstock", 0, 0, 0, "1 Waggon dahinter");
Waggon w3 = new Waggon(100, 32, 11, 2, "doppelstock", 0, 0, 0, "1 Waggon dahinter");
Waggon w4 = new Waggon(50, 17, 3, 1, "doppelstock", 0, 0, 0, " kein Waggon dahinter");
System.out.println(t1);
System.out.println(w1);
System.out.println(w2);
System.out.println(w3);
System.out.println(w4);
//cannot find symbol Train & Waggon
//Variable als Train1 im typ train abspeichern
}
}
</code></pre>
<p>i compiled both the waggon and train class, got no errors there and i simply cant figure out why my main method doesnt find the symbol.
id appreciate any tips as im stuck at this error since yesterday!</p>
| <java> | 2019-12-07 12:03:12 | LQ_CLOSE |
59,226,210 | How to extract string between double quotes in java? | <p>I'm reading a response from a source which is an journal or an essay and I have the html response as a string like:</p>
<p>According to some, dreams express "profound aspects of personality" (Foulkes 184), though "others disagree" but truth is.</p>
<p>My goal is just to extract all of the quotes out of the given string and save each of them into a list. And add space in original string in place of quotes. </p>
| <java><string> | 2019-12-07 12:57:18 | LQ_CLOSE |
59,226,549 | C++: Is there a way to access protected vector size via main function without turning it to public? | I've been working on a Shape program lately ( Some of you might remember my other questions about this... ;/ ) And I have a tiny problem which I want to fix.
In my Menu class, which holds all the functions related to the menu. I have a unique_ptr vector with the type of my base class Shape which holds all of the newly created objects ( Circles, Rectangles, ect )
```
protected:
vector<unique_ptr<Shape>> _shapes;
```
One of the functions that I want to create is supposed to change the values of the variables in a given shape based on it's index. To do so, I was planning to print the vector to the user, and then let him to choose the index of the shape that he wants to change.
```
void Menu::printShapes() const
{
int i = 0;
for (auto p = _shapes.begin(); p != _shapes.end(); p++, i++)
{
cout << i + " ";
(*p)->printDetails();
cout << endl;
}
}
```
The problems lays in my main program which is going to use my Menu functions. Because I don't want the user to be able to enter values which are outside of my vector, I have to check if the given input is between 0 and the size of the vector. But I cannot access this info from my main function without making the vector public or make a return statement from the printShapes() function, which will make the code messy and not intuitive as I want it to be.
So my question is: Is there a way to find the size of the vector at the Menu function from the main function without making the changes I stated above? Because in the end I want to be able to just do ```menu.printShapes()``` and then let the user to choose the index of the shape that he wants to change
this is my main function as of now:
```
Menu menu;
int input = 0, wait = 0;
while (input != 4)
{
cout << "1: Add New Shape: " << endl;
cout << "2: Modify Existing Shape: " << endl;
cout << "3: Delete All Shapes: " << endl;
cout << "4: Exit: " << endl;
while (input < MIN || input > MAX)
{
cin >> input;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
std::cin >> wait;
}
switch (input)
{
case 1:
{
cout << "1: Circle: " << endl;
cout << "2: Rectangle: " << endl;
cout << "3: Triangle: " << endl;
cout << "4: Arrow: " << endl;
while (input < MIN || input > MAX)
{
cin >> input;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
std::cin >> wait;
}
menu.createShape(input);
}
case 2:
{
//Here I want to check for the input based on the size of vector
}
}
}
```
Thanks a lot for the helpers :D
| <c++><class><vector><polymorphism> | 2019-12-07 13:38:50 | LQ_EDIT |
59,227,819 | Wait until two different users click a button and then go to a page | <p>Hi working on a website project where I want to wait until two separate users click a button and then have them both go to the same page. These users will be each in their own browser window.
I have searched the internet and went to research ajax but found that is not what I am looking for because I want the page to automatically detect when the other user in a different browser clicked the button, instead of having a user repeatedly click a button to see if another user has clicked there button such as with ajax. Please help thanks.</p>
<p><strong>Goal: Have a user be automatically redirected to another page once a <em>different</em> user clicks the same button in a different window</strong></p>
<blockquote>
<p>Example:</p>
<p>user 1 and user 2 are both on a website</p>
<p>user 1 clicks on a button. user 1 is now waiting on a waiting page
until another person clicks on the button in a different browser
window.</p>
<p>user 2 now clicks on the button in their own browser window</p>
<p>user 1 and user 2 now get automatically redirected to the same page.</p>
</blockquote>
| <javascript><php><jquery><html><ajax> | 2019-12-07 16:04:14 | LQ_CLOSE |
59,228,006 | create method channel after upgrading flutter- can not resolve method getFlutterView() | <p>i was using native android method in my flutter app using documentation which said use</p>
<pre><code>MethodChannel(flutterView, CHANNEL).setMethodCallHandler...
</code></pre>
<p>but after upgrading flutter the <code>MethodChannel</code> function does not require <code>flutterView</code> and
there is no <code>flutterView</code> anymore.</p>
<pre><code>can not resolve method getFlutterView()
</code></pre>
<p>i think there should be a new tutorial for creating channel</p>
<p>instead it needs some <code>BinaryMessenger</code> which i don't know what to give instead.</p>
<p>this is the old code which is not working anymore:</p>
<pre><code>import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
public class MainActivity extends FlutterActivity {
private static final String CHANNEL = "samples.flutter.dev/battery";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
new MethodCallHandler() {
@Override
public void onMethodCall(MethodCall call, Result result) {
// Note: this method is invoked on the main thread.
// TODO
}
});
}
</code></pre>
| <android><flutter><flutter-channel> | 2019-12-07 16:25:31 | HQ |
59,228,396 | Letters to Numbers in an array | <p>Ok so basically I am working on a final grade calculator for believe it or not, finals. I was asked to use a picker view to select a letter (grade). I am trying to figure out how that when someone selects a letter grade it will use a number like 90 or 80 or so on so I can fit it into my math equation.</p>
| <ios><arrays><swift> | 2019-12-07 17:10:53 | LQ_CLOSE |
59,228,601 | How to save the items that a user bought in the database and prevent him to buy it again | <p>I need some help storing the files a user bought and downloaded. I have a table with files and their ID. When users buy and file it's just redirecting him to the download link. But I want to make PHP script insert into the database the ID of the files that user bought. But how to do it with multiple files and store their ID in 1 field for each user. For example I have 10 files and the user bought files 1,2,3,8,9. I want to store in the database these numbers and do a while to show the link that corresponds to these ID's.</p>
| <php><mysql><field><store> | 2019-12-07 17:36:05 | LQ_CLOSE |
59,229,480 | What exactly does this compiler error want me to perform? | <p>Thank you in advance for reading ! So this is the code : </p>
<pre><code>#include<iostream>
#include<vector>
std::vector<int> MonkeyCount(int n);
int main() {
MonkeyCount(4);
return 0;
}
std::vector<int> MonkeyCount(int n) {
std::vector<int> MonkeyCountV;
for (unsigned int i = 1; i <= n; i++) {
MonkeyCountV.push_back(i);
}
for (unsigned int i = 0; i <= MonkeyCountV.size(); i++) {
std::cout << MonkeyCount.at(i) << " ";
}
return MonkeyCountV;
}
</code></pre>
<p>and the error is on line 23 : error C2227: left of '->at' must point to class/struct/union/generic type
Now i red something about this, but i use this from an example i found on the internet on how to print a vector, and in that exaple, in works. The exaple is this : </p>
<pre><code>#include <iostream>
#include <vector>
void print(std::vector<int> const& input);
int main()
{
std::vector<int> input = { 1, 2, 3, 4, 5 };
print(input);
return 0;
}
void print(std::vector<int> const& input)
{
for (unsigned int i = 0; i < input.size(); i++) {
std::cout << input.at(i) << ' ';
}
}
</code></pre>
| <c++><vector> | 2019-12-07 19:32:52 | LQ_CLOSE |
59,230,960 | How can I store objects into an ArrayList without them duplicating in Java? | <p>So i have some code that takes a bunch of data and creates objects from that data. Here is the pseudo code. The main class looks like this:</p>
<pre><code>public static void main(String[] args) {
storage.addObject(2, 20, Jake, JE);
storage.addObject(5, 34, Kate, KI);
storage.addObject(3, 26, Joe, JL);
</code></pre>
<p>Then another class called storage will create and store these objects into an ArrayList</p>
<pre><code>public void addObject(int number, int age, String name, String code) {
Object newObject = new Object(number, age, name, code);
objects.add(newObject);
</code></pre>
<p>The problem that I am getting is that when I try </p>
<pre><code>System.out.println(objects);
</code></pre>
<p>Each bit of data in the array list is storing multiple objects so the output looks like this</p>
<pre><code>[2 20 Jake JE]
[2 20 Jake JE, 5 34 Kate KI]
[2 20 Jake JE, 5 34 Kate KI, 3 26 Joe JL]
</code></pre>
<p>I don't know why it's repeating the objects but I am trying to make it so 1 object is in 1 part of the arrayList so the output looks like</p>
<pre><code>[2 20 Jake JE]
[5 34 Kate KI]
[3 26 Joe JL]
</code></pre>
<p>The object creating class has a toString part so that all of the data gets converted to a string
I'm not getting any compiling errors</p>
| <java><arrays><object><duplicates> | 2019-12-07 22:56:15 | LQ_CLOSE |
59,231,816 | my code says segmantation fault when i run it can someone help me? | <p>}<a href="https://i.stack.imgur.com/R015I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R015I.png" alt="enter image description here"></a></p>
<p>but when I run it it says segmentation fault and apart from that, I don't know if the code is correct.</p>
<p><a href="https://i.stack.imgur.com/Ncy8R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ncy8R.png" alt="enter image description here"></a></p>
| <c++><arrays><segmentation-fault> | 2019-12-08 01:54:55 | LQ_CLOSE |
59,235,127 | Python class definition syntax (bracket) | <p>I found most guys said there is no difference with or without bracket in class definition. But my codes output different results for it. </p>
<pre><code>#!/usr/bin/env python
class Tree(object):
def __init__(self):
self.left = None
self.right = None
self.data = None
root = Tree()
root.data = "root"
root.left = Tree()
root.left.data = "left"
root.right = Tree()
root.right.data = "right"
print(root.left.data)
Output: left
While
#!/usr/bin/env python
class Tree:
def __init__(self):
self.left = None
self.right = None
self.data = None
root = Tree
root.data = "root"
root.left = Tree
root.left.data = "left"
root.right = Tree
root.right.data = "right"
print(root.left.data)
Output : right
</code></pre>
<p>So what is the problem behind this </p>
| <python> | 2019-12-08 11:55:41 | LQ_CLOSE |
59,235,633 | How can you make a object access the variables in a method without using .this? | <p>By making the object in main function and calling its method and updating the variables from class.
example:</p>
<pre><code>public class Test{
int a;
void testMethod(){
//how to access the variable here?
}
public static void main(String[] args){
Test Obj = new Test();
obj.testMethod();
}
</code></pre>
<p>How to access the variable 'a' inside the method testMethod without using .this ?</p>
| <java> | 2019-12-08 12:59:51 | LQ_CLOSE |
59,235,754 | how to create mysql dynamc pivot rows to colum | please am in need of urgent help from anyone who can solve this.
SELECT DISTINCT
_2_12_company.companyInitials,
_2_05_comptype.typeInitials
FROM
_2_12_company,
_2_05_comptype,
_2_19_companycomptype
WHERE
_2_12_company.id = _2_19_companycomptype.companyID AND _2_05_comptype.id = _2_19_companycomptype.typeID
and here is the result
AMAZON | MICROSOFT
AMAZON | FACEBOOK
AMAZON | ALI EXPRESS
but i whant the result to be like below in a dynamic fashion
AMAZON | MICROSOFT/FACEBOOK/ALI EXPRESS | <java><mysql><database><select><distinct> | 2019-12-08 13:14:09 | LQ_EDIT |
59,236,446 | How should I fix this - 'int' object is not iterable? | <p>Unlike other questions, I'm getting this error <em>without</em> using a looping construct.</p>
<p>Here's the code</p>
<pre><code>def makes_twenty(n1,n2):
return ( (sum(n1, n2) == 20) or ((n1 == 20) or (n2 == 20)) )
</code></pre>
<p>The error I receive -
<code>'int' object is not iterable</code>
<a href="https://i.stack.imgur.com/hwPaN.png" rel="nofollow noreferrer">Screenshot of the code with error</a></p>
<p>The irony is, if I change this thing -
<code>sum(n1, n2)</code>
Into something like this -
<code>(n1 + n2)</code>
The code works fine.
<a href="https://i.stack.imgur.com/nw2YD.png" rel="nofollow noreferrer">Screenshot of corrected code</a>
I wonder what's happening here.</p>
| <python><python-3.x><function><sum><int> | 2019-12-08 14:35:03 | LQ_CLOSE |
59,237,227 | Php search filter showing all rows without filtering | <p>While displaying the filtered data, this sql can filter data as per $locationone and $locationtwo.</p>
<p>But it is failing to filter data as per <strong>$cate</strong></p>
<p>I mean its displaying all the rows from both locations and failing to filter it as per <strong>science(topic)</strong></p>
<pre><code>$cat= "science";
$cate= preg_replace("#[^0-9a-z]#i","", $cat);
$locationone= "dhk";
$locationtwo= "ctg";
preg_replace("#[^0-9a-z]#i","", $locationone);
preg_replace("#[^0-9a-z]#i","", $locationtwo);
$sql= "SELECT * FROM post INNER JOIN user ON post.user_id= user.id
WHERE post.topic LIKE '%$cate%'
AND post.location LIKE '%$locationone%'
OR post.location LIKE '%$locationtwo%'
order by post_id desc";
</code></pre>
| <php><mysql> | 2019-12-08 16:00:34 | LQ_CLOSE |
59,237,461 | Why is my CSS keyframe fade in animation working? | <p><a href="https://i.stack.imgur.com/hrUR3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hrUR3.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/YnCdm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YnCdm.png" alt="enter image description here"></a></p>
<p>Heres the complete CSS for the animation. I have it on an a tag in my html as a class="fadeInUp animated animatedFadeInUp". Does anyone know why it wouldnt be working? I'm not sure what a -webkit-animation is so I did not add it. Could that be the reason?</p>
| <html><css><css-animations> | 2019-12-08 16:31:26 | LQ_CLOSE |
59,238,267 | will an hashcode ever give a negative value? | <p>In the code given, it was trying to give a valid index for a hashtable by checking for any collision using another method linearprobe. I am just confuse of why we need to check for index < 0, so will there be instance when hashCode will be negative? When/why will that happens?</p>
<pre><code>private int getHashIndex(K key)
{
//1.convert key to hashcode, then get the index;
//2. then use linear probing to check for the correct index;
int index = key.hashCode() % hashTable.length;
if(index < 0) { //So a hash code can be negative?
index += hashTable.length;
}
index = linearProbe(index,key);
return index;
}
</code></pre>
| <java><hash><hashtable><hashcode> | 2019-12-08 17:57:03 | LQ_CLOSE |
59,238,685 | Can someone explain C# static variables usage to me, when accessing from another script? | <p>Keep in mind I'm new to C#. Static variables don't seem to serve the same purpose as in C/C++, Fortran, etc. so I'm struggling a bit, esp. with this:</p>
<p>I want to be able to attach game objects to variables using the inspector, but access those variables (say, the color of Text UIs) from another script, without hard-coding object names (which could change) and using Find/GetComponent. </p>
<p>If I make the game objects static, I can access them instead with a statement like classname.objectname. However, the inspector no longer sees those variables (since they're static?), and so I can no longer attach a game object to them using inspector, so I'm back to using GameObject.Find or GetComponent and hard-coding the names somewhere in my code. Hopefully, I'm just ignorant about something, hence my question.</p>
<p>So: how can I declare a variable to which I can attach an object in the inspector (and avoid hard-coding the object name), yet access it in a different script without using Find/GetComponent?</p>
| <c#> | 2019-12-08 18:39:23 | LQ_CLOSE |
59,239,077 | MIUI 10 doesn't let service start activity - Xiaomi Redmi Note | <p>My app has a service and an activity. From the service, activity is called with following code:</p>
<pre><code>Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
</code></pre>
<p>even without the flags, normally the activity window is displayed with its correct layout.
However, on Xiaomi Redmi Note 4 with Android 7, activity layout is not displayed. I only see the following line on logcat:</p>
<blockquote>
<p>I/Timeline: Timeline: Activity_launch_request time:281438674
intent:Intent { flg=0x30000000 cmp=com.test.app/.MainActivity }</p>
</blockquote>
<p>I believe this is not an Android 7 (API 24) issue because on another device with Android 7, service can successfully start the activity.
I guess, MIUI is preventing the launch of the activity from service.</p>
<p>I tried changing how the activity was defined in the manifest. I also tried with several different flags.
All of my tests failed. I could not succeed in starting the activity. Worst issue is that there is no error/exception in the logs.</p>
<p>Any ideas on this please ?</p>
| <java><android><miui> | 2019-12-08 19:23:52 | HQ |
59,239,433 | convert html to html string in JS file | <p>I want to create some html via JS, therefore I need to write the html inside the JS file like:</p>
<pre><code>function createHtmlSection() {
return "<li class=\"chapter up-wrapper-btn\">" +
"<div>" +
"<button><i class=\"fa fa-plus\" onclick=\"addSection('up',this)\"></i></button>" +
"<label contenteditable=\"true\">section 1</label>" +
"</div>" +
"</li>";
}
</code></pre>
<p>is there a tool or some shortcut to create this type of html string?</p>
<p>I mean, in this case I was needed to type all this html by hand. with <code>+</code> and needed to add <code>"</code> sign.</p>
<p>Something that can convert this:</p>
<pre><code><li class="chapter up-wrapper-btn">
<div>
<button><i class="fa fa-plus" onclick="addSection('up',this)"></i></button>
<label contenteditable="true">section 1</label>
</div>
</li>
</code></pre>
<p>to the first string that I was needed to type by hand</p>
| <javascript><html> | 2019-12-08 20:05:55 | HQ |
59,239,816 | Python 'print' function 'sep' parameter is not working as expected | <p>I am using Python version 3.7.4 on Windows 10 Enterprise.</p>
<p>I am facing a weird issue with Python's <code>print</code> function and especially <code>sep</code> parameter. </p>
<p>In Python REPL, when I use code <code>print(1, 2, 3, 4, 5, sep='\t')</code>, I get proper output as <code>1 2 3 4 5</code></p>
<p>However when code tries to iterate over a collection as shown below, instead of showing number separated by a tab, it always displays individual value on a new line.</p>
<pre><code>numbers = {1, 2, 3, 4, 5}
for n in numbers:
print(n, sep='\t')
</code></pre>
<p>Can someone please help me to understand why its displaying number value on a separate line? </p>
<p>I have attached screenshot for the reference.</p>
<p><a href="https://i.stack.imgur.com/2R1C5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2R1C5.png" alt="Python print function sep parameter"></a></p>
<p>Thanks.</p>
| <python> | 2019-12-08 20:54:25 | LQ_CLOSE |
59,240,555 | C# Error CS0019, Operator '*' cannot be applied to operands of type 'double[]' and 'double' | <p>I have tried working on a vector addition code in C#, and part of it involves using math to determine X and Y values for a vector, and for some reason it gives me the error saying I cannot multiply an array value with a double precision floating point value. I have tried converting, but that has only created more errors. Here is my code: </p>
<pre><code>using System;
using System.Windows.Forms;
namespace VectorAddEdit
{
public partial class Form1 : Form
{
double[] mag = new double[5];
double[] ang = new double[5];
int cnt = 0;
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
while (cnt < 5)
{
if (textBox1.Text == "" || textBox2.Text == "")
{
MessageBox.Show("You did not enter data into the correct boxes!");
System.Threading.Thread.Sleep(1000);
Application.Exit();
}
mag[cnt] = Convert.ToDouble(textBox1.Text);
ang[cnt] = Convert.ToDouble(textBox2.Text);
Console.ReadLine();
cnt++;
}
}
private void button2_Click(object sender, EventArgs e)
{
double xsummag = 0;
double ysummag = 0;
double resultmag;
double resultang;
for (int i = 0; i < cnt; i++)
{
xsummag = mag * Math.Cos(ang * Math.PI / 180) + xsummag;
ysummag = mag * Math.Sin(ang * Math.PI / 180) + ysummag;
}
resultmag = Math.Sqrt(Math.Pow(xsummag, 2) + Math.Pow(ysummag, 2));
resultang = Math.Atan(ysummag / xsummag) * 180 / Math.PI;
if (xsummag < 0 && ysummag > 0)
resultang = resultang + 180;
else if (xsummag < 0 && ysummag < 0)
resultang = resultang + 180;
else if (xsummag > 0 && ysummag < 0)
resultang = resultang + 360;
textBox4.Text = resultmag.ToString();
textBox5.Text = resultang.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"C:\Windows\Media\Alarm09.wav");
player.Play();
Application.DoEvents();
System.Threading.Thread.Sleep(1000);
Application.Exit();
}
}
}
</code></pre>
<p>The error occurs on 2 lines where xsummag and ysummag are assigned.
If anyone can help me resolve this error, I would greatly appreciate it. :)</p>
| <c#> | 2019-12-08 22:40:44 | LQ_CLOSE |
59,240,905 | Get current OS language - Python | <p>I want to take the current OS language in Python.
For example if english are chosen, I want to get a code (or something like that) and when I change with shift+alt to other language, I want to take the newly changed language code.</p>
<p>Is this possible?</p>
| <python><operating-system><locale><python-3.8> | 2019-12-08 23:36:49 | LQ_CLOSE |
59,241,711 | Where is documentation on Python's `set`'s class methods? | I gather that Python's built-in type `set` has a number of useful class methods, such as `set.intersection()`. Where are they documented? I haven't found them documented [here](https://docs.python.org/3.7/library/stdtypes.html?highlight=set#set), which seems to cover only the instance methods. | <python><set> | 2019-12-09 02:11:43 | LQ_EDIT |
59,241,957 | .Net Core 3.1 not yet supported in Azure Pipelines hosted agents? Getting NETSDK1045 | <p>It's great that <a href="https://devblogs.microsoft.com/dotnet/announcing-net-core-3-1/" rel="noreferrer">.Net Core 3.1 is out</a>, but I'm not sure the Azure Pipelines hosted agents have caught up.</p>
<p>My YAML pipeline specifies:</p>
<pre><code>pool:
vmImage: 'windows-latest'
</code></pre>
<p>and the <code>dotnet restore</code> step does this:</p>
<blockquote>
<p>(_CheckForUnsupportedNETCoreVersion target) -> C:\Program
Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(127,5):
error NETSDK1045: The current .NET SDK does not support targeting .NET
Core 3.1. Either target .NET Core 3.0 or lower, or use a version of
the .NET SDK that supports .NET Core 3.1.
[D:\a\1\s\StatsNZ.BESt.DataService\StatsNZ.BESt.DataService.csproj]</p>
</blockquote>
<p>works fine in .Net Core 3.0.</p>
<p>Are there any work-arounds, or do we have to wait for Azure DevOps to catch up?</p>
| <.net-core><azure-pipelines> | 2019-12-09 02:55:24 | HQ |
59,247,413 | Align both vertically and horizontally using Bootstrap flex | <p>After looking through the bootstrap 4 Flex doc, I can't seem to get the "align-item-center" property to work. I tested pretty much every example available online but really can't seem to change the vertical alignment of anything, it's driving me nuts. I join a simple HTML example I'm trying to make work. </p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.d-flex {
display: -ms-flexbox !important;
display: flex !important;
}
.justify-content-center {
-ms-flex-pack: center !important;
justify-content: center !important;
}
.align-items-center {
-ms-flex-align: center !important;
align-items: center !important;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="d-flex justify-content-center align-items-center">
<p> This should be centered right ?</p>
</div></code></pre>
</div>
</div>
</p>
<p>I'm using Bootstrap 4.4.1 and also have installed popper.js@latest and jquery@latest just to be sure. For further precision I'm only using a simple textline now but in the future I'll add elements whose size are not known until runtime.</p>
| <html><css><bootstrap-4><flexbox> | 2019-12-09 10:58:31 | LQ_CLOSE |
59,250,049 | Date Regex with special character as optional pre element | <p>Date Regex with special character as optional pre element</p>
<p>I need a date regex for YYYY-MM-DD, plus the following four case: </p>
<pre><code>1978-12-20
>1978-12-20
>=1978-12-20
<1978-12-20
<=1978-12-20
</code></pre>
<p>How can I allow those 5 scenarios? </p>
| <javascript><regex><date><special-characters> | 2019-12-09 13:35:36 | LQ_CLOSE |
59,250,693 | I've deployed JButton using multiple layout managers, but it doesn't display properly | <p>I wanted to place several buttons to check the differences between the different layout managers. But the code I wrote shows only the buttons displayed by one layout manager, and the buttons of the other layout manager are not displayed at all. What should I do?</p>
<p>This is my code:</p>
<pre><code>import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.*;
public class No2{
public No2() {
JFrame frame=new JFrame("MyFrame");
JPanel MainPanel=new JPanel();
JPanel panel1=new JPanel();
JPanel panel2=new JPanel();
JPanel panel3=new JPanel();
JButton[] btn=new JButton[5];
for (int i = 0; i < btn.length; i++) {
btn[i]=new JButton("Button"+(i+1));
}
frame.add(MainPanel);
MainPanel.setLayout(new GridLayout(3,1));
MainPanel.add(panel1);
MainPanel.add(panel2);
MainPanel.add(panel3);
panel1.setLayout(new FlowLayout());
for (int i = 0; i < btn.length; i++) {
panel1.add(btn[i]);
}
panel1.setLayout(new BorderLayout());
for (int i = 0; i < btn.length; i++) {
panel2.add(btn[i]);
}
panel1.setLayout(new GridLayout());
for (int i = 0; i < btn.length; i++) {
panel3.add(btn[i]);
}
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new No2();
}
}
</code></pre>
| <java><swing><awt> | 2019-12-09 14:13:50 | LQ_CLOSE |
59,250,938 | Reload page after 2 seconds using JavaScript | <p>I'm reloading the page like this <code>window.location.reload();</code> is there a way to have it do the same thing but after 2 seconds?</p>
| <javascript> | 2019-12-09 14:26:58 | LQ_CLOSE |
59,251,150 | Use non-local numbers to receive messages | <p>Can I use a Canadian number to send and receive SMS from US numbers?
And also a German number, which is marked as international, for receiving and sending SMS in Europe?</p>
| <twilio> | 2019-12-09 14:39:37 | LQ_CLOSE |
59,252,964 | I am getting this error while building a Personal Portfolio website in Codepen | **The height of the welcome section should be equal to the height of the view port.**
Here is the project's link:
- https://codepen.io/Aaradhyacodepen/pen/jOEEZav?editors=1100
| <javascript><html><css><codepen> | 2019-12-09 16:28:27 | LQ_EDIT |
59,253,025 | 'Python -m' in terminal | <p>I have met this pattern for quite some time when I see people try to execute a package through python. But I am not sure what does '-m' mean here. Is it a specific pattern that you need to follow?
for example:</p>
<p><code>python -m [library] download [model]</code></p>
<p>or </p>
<pre><code>python -m venv env (to create a virtual environment in Python)
</code></pre>
<p>Anyone could explain to me?</p>
| <python> | 2019-12-09 16:32:20 | LQ_CLOSE |
59,255,498 | How to register a global state for actix_web? | I am a new user of `Rust` and `actix_web` crate. I am trying to set up a global state for my HttpServer, and it seems like `register_data` is the proper API. (I could be wrong about this API).
But from the [doc][1], it is not clear to me how to create a single instance of Application Data shared by all HttpServer threads. Here is my code piece:
```
HttpServer::new(|| {
App::new()
.register_data(web::Data::new(Mutex::new(MyServer::new())))
.service(web::resource("/myservice").route(web::post().to(my_service)))
.service(web::resource("/list").to(list_service))
})
```
In the POST handler `my_service`, I update the state of `MyServer` and in the GET handler `list_service`, it will print out the state.
While `my_service` is successful in storing the state, the `list_service` only prints empty output. My question is:
How do I know if `actix` `HttpServer` created a single instance of `MyServer` or not? If not, how can I ensure it creates a single instance?
Thanks.
[1]: https://docs.rs/actix-web/1.0.9/actix_web/web/struct.Data.html | <rust><actix-web> | 2019-12-09 19:37:15 | LQ_EDIT |
59,255,817 | System Linq Enumerable error while using intersect | <p>I have 3 lists and I'm trying to display their common items in a text box, and while I am implementing the method</p>
<pre><code>var result = l1.Intersect(l2);
textBox1.Text = "";
textBox1.Text = result.ToString();
</code></pre>
<p>while l1 is my first list and l2 is my second list
I get the error:</p>
<blockquote>
<p>System.Linq.Enumerable+d__70`1[System.String]</p>
</blockquote>
<p>any help would be appreciated.</p>
| <c#><list><linq><text> | 2019-12-09 20:04:12 | LQ_CLOSE |
59,257,552 | Linux commands in BASH shell | I am trying to execute this command for a linux assignment, but I cannot figure out what the command should be? I know to append to a file you use the >> but I am not sure how to redirect and append the output together.
"9. Redirect the output of the process list (ps) only for httpd process appending it to final.txt (file created in step 5)"
Thank you! | <linux><append><io-redirection> | 2019-12-09 22:24:24 | LQ_EDIT |
59,257,781 | Can I instanciate a multi nic vm in a devtest lab environment? | Can I have multiple nics ressource and assigne them to the devtest lab vm ?
Can I specied the Lab virtual network CIDR ?
Can I set subnet address range ? | <azure><azure-devtest-labs> | 2019-12-09 22:48:56 | LQ_EDIT |
59,259,747 | Insert query works through SSMS but SqlCommand code gets error "Insufficient result space to convert uniqueidentifier value to char." | Table for the inserts:
CREATE TABLE [dbo].[CcureMessage](
[CcureMessageId] [uniqueidentifier] NOT NULL,
[Event] [varchar](20) NULL,
[Type] [varchar](20) NULL,
[Message] [varchar](max) NOT NULL,
[Xml] [varchar](4000) NOT NULL,
CONSTRAINT [PK_CcureMessage] PRIMARY KEY CLUSTERED
( [CcureMessageId] ASC)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[CcureMessage] ADD CONSTRAINT [DF_CcureMessage_CcureMessageId] DEFAULT
(newid()) FOR [CcureMessageId]
GO
I made the PK table have a default value so that I'm not passing a GUID at all, yet it seems I'm still getting an error related to the guid.
***
Insert command that works fine through SSMS:
INSERT INTO CcureMessage (Event, Type, Message, Xml)
VALUES ('event 3', 'type 3', 'big json 3', 'xml-ish');
***
C# Code:
public void DoInsert(Message msg)
{
// hard-coding this to set test values
TopicMessage tm = new TopicMessage();
tm.Event = "event 1";
tm.Type = "Type 1";
tm.Message = "json data message";
tm.Xml = "xml data goes here";
string connString = set to correct value;
string sql = "INSERT INTO CcureMessage (Event, Type, Message, Xml) VALUES (@Event, @Type, @Message, @Xml)";
using (SqlConnection conn = new SqlConnection(connString))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.CommandType = System.Data.CommandType.Text;
SqlParameter eventParm = new SqlParameter("@Event", tm.CcureMessageId);
SqlParameter typeParm = new SqlParameter("@Type", tm.Type);
SqlParameter msgParm = new SqlParameter("@Message", tm.Message);
SqlParameter xmlParm = new SqlParameter("@Xml", tm.Xml);
cmd.Parameters.Add(eventParm);
cmd.Parameters.Add(typeParm);
cmd.Parameters.Add(msgParm);
cmd.Parameters.Add(xmlParm);
cmd.ExecuteNonQuery();
}
}
Running this results in the error "Insufficient result space to convert uniqueidentifier value to char."
| <c#><sql-server><ado><guid><uniqueidentifier> | 2019-12-10 03:25:17 | LQ_EDIT |
59,260,014 | Creating a 64 bit application in Visual Studio with SysNative | I'm trying to build a 64 bit application using visual studio in C++
I need to access `Sens.dll` in windows directory. Since Visual Studio is 32 bit application, I have to use **SysNative** instead of **System32**
`C:/Windows/SysNative/Sens.dll`
because of File System Redirection.
If I change the path to `C:/Windows/System32/Sens.dll` Visual studio cannot access it since it redirects to SysWOW64 while building. To mitigate this I can use SysNative but then the executable built is a 64 bit application and SysNative is inaccessible.
Is there any way to solve it?
A better explanation of SysNative is given [here][1]
[1]: https://www.samlogic.net/articles/sysnative-folder-64-bit-windows.htm | <c++><visual-studio><32bit-64bit><include-path> | 2019-12-10 03:59:19 | LQ_EDIT |
59,262,154 | Whats the meaning of mock test using Mockito | <p>When using mockito, I guess i'm supposed to use when().thenreturn to customize the return value, even that's different from the real method. I just got confused that if everything is mocked (or fake?), how does mockito work to test if the method truly works well?</p>
| <java><unit-testing><mocking><mockito> | 2019-12-10 07:22:45 | LQ_CLOSE |
59,262,697 | Python While Loop with Multiple Conditions not Exiting | <p>I have a code in which exits only when anyone of the 3 variables cross 7</p>
<pre><code>while(a!=7 or b!=7 or c!=7):
#My algorithm to increase values based on input
#end of while
</code></pre>
<p>My code never exits the while loop when anyone of of the variables cross 7.
However when I change the code to</p>
<pre><code>while(a!-7):
#Algorithm
#End of while
</code></pre>
<p>and on providing inputs to increase a to 7, the loop exits.</p>
<p>Is there some mistake in my syntax for while loop with multiple condition or is it something else?</p>
<p><strong>The algorithm that I have written in works perfectly, only the while loop cannot exit on reaching the condition for anyone of the variable</strong></p>
| <python><while-loop> | 2019-12-10 08:04:59 | LQ_CLOSE |
59,263,557 | How I Do SQL Server Column Auto Filter | Hello every one i need help how i filter SQL Server Column Data Filter Like all the word which starts from a Or A come on first line Like B or b come on the second ...
Create Table Table_my
(
C1 varchar(50)
, C2 varchar(50)
,
)
Select*
From Table_my
WHERE C1 Like '[ABC]%'; | <sql><sql-server> | 2019-12-10 09:03:37 | LQ_EDIT |
59,263,582 | How to find the size of an image in bytes using python? | <p>I couldn't find anyway to print the size of an image in bytes. </p>
| <python><python-3.x><python-2.7><python-imaging-library> | 2019-12-10 09:05:04 | LQ_CLOSE |
59,263,964 | Groupby sum, count the number based on condition and concatenate in pandas | <p>I have a dataframe as shown below</p>
<pre><code>Sector Property_ID Unit_ID Unit_usage Property_Usage Rent_Unit_Status Unit_Area
SE1 1 1 Shop Commercial Rented 200
SE1 1 2 Resid Commercial Rented 200
SE1 1 3 Shop Commercial Vacant 100
SE1 2 1 Shop Residential Vacant 200
SE1 2 2 Apartment Residential Rented 100
SE2 1 1 Resid Commercial Rented 400
SE2 1 2 Shop Commercial Vacant 100
SE2 2 1 Apartment Residential Vacant 500
</code></pre>
<p>From the above dataframe I would like to prepare below dataframe.</p>
<pre><code>Sector No_of_Properties No_of_Units Total_area %_Vacant %_Rented %_Shop %_Apartment
SE1 2 5 800 37.5 62.5 62.5 12.5
SE2 2 3 1000 60 40 10 50
</code></pre>
| <pandas><pandas-groupby> | 2019-12-10 09:26:41 | LQ_CLOSE |
59,264,175 | how to make 2 arraylist on an adapter, adapted to one API? | <p>how to make 2 arraylist on an adapter, adapted to one API. I have given a list of cases here metadataList; but it doesn't work because the activity.java part must have a Metadata List implementation. How to retrieve data with different getter setters (2 getter setters) but can be combined in one adapter?</p>
<p>API Result</p>
<pre><code>{
"status": 200,
"reason": "OK",
"success": true,
"message": null,
"result": [
{
"id": "1",
"id_product_category": "2",
"id_currency": "58",
"name": "PlayStation 4 500GB Console - Refurbished",
"slug": "playstation-4-500gb-console-refurbished",
"image": "https://demo.xxxx.com/images/products/product-1.png",
"images": [
{
"name": "main",
"image": "https://demo.xxxx.com/storage/images/products/product-1.png"
}
],
"metadata": {
"weight_value": "1",
"weight": "KG",
}
}
</code></pre>
<p>ResultItem.java</p>
<pre><code>public class ResultItem{
@SerializedName("image")
private String image;
@SerializedName("images")
private ImagesItem[] images;
@SerializedName("metadata")
private Metadata metadata;
@SerializedName("id_product_category")
private String idProductCategory;
@SerializedName("price_capital")
private String priceCapital;
@SerializedName("name")
private String name;
@SerializedName("id")
private String id;
@SerializedName("id_currency")
private String idCurrency;
@SerializedName("slug")
private String slug;
public void setImage(String image){
this.image = image;
}
public String getImage(){
return image;
}
public void setImages(ImagesItem[] images){
this.images = images;
}
public ImagesItem[] getImages(){
return images;
}
public void setMetadata(Metadata metadata){
this.metadata = metadata;
}
public Metadata getMetadata(){
return metadata;
}
public void setIdProductCategory(String idProductCategory){
this.idProductCategory = idProductCategory;
}
public String getIdProductCategory(){
return idProductCategory;
}
public void setPriceCapital(String priceCapital){
this.priceCapital = priceCapital;
}
public String getPriceCapital(){
return priceCapital;
}
public void setPriceSale(String priceSale){
this.priceSale = priceSale;
}
public String getPriceSale(){
return priceSale;
}
public void setName(String name){
this.name = name;
}
public String getName(){
return name;
}
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setIdCurrency(String idCurrency){
this.idCurrency = idCurrency;
}
public String getIdCurrency(){
return idCurrency;
}
}
</code></pre>
<p>Metadata.java</p>
<pre><code>public class Metadata{
@SerializedName("weight_value")
private String weightValue;
@SerializedName("weight")
private String weight;
public void setWeightValue(String weightValue){
this.weightValue = weightValue;
}
public String getWeightValue(){
return weightValue;
}
public void setWeight(String weight){
this.weight = weight;
}
public String getWeight(){
return weight;
}
}
</code></pre>
<p>Adapter.java</p>
<pre><code>public class AdapterAllProduct extends RecyclerView.Adapter<AdapterAllProduct.AllproductHolder> {
List<ResultItem> resultItemList;
//// List<Metadata> metadataList;
Context mContext;
public AdapterAllProduct(Context context, List<ResultItem> resulList){
this.mContext = context;
resultItemList = resulList;
}
@NonNull
@Override
public AllproductHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_product, parent,false);
return new AllproductHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull AllproductHolder holder, int position) {
final ResultItem resultItem = resultItemList.get(position);
///final Metadata metadataItem = metadataList.get(position);
holder.txt_id.setText(resultItem.getId());
holder.txt_id_currency.setText(resultItem.getIdCurrency());
holder.txt_id_product_category.setText(resultItem.getIdCurrency());
holder.txt_name_product.setText(resultItem.getName());
holder.txt_price_capital.setText(resultItem.getPriceCapital());
// Locale localeID = new Locale("in", "ID");
// NumberFormat formatRupiah = NumberFormat.getCurrencyInstance(localeID);
// holder.txt_price_capital.setText(formatRupiah.format(resultItem.getPriceCapital()));
holder.txt_price_sale.setText(resultItem.getPriceSale());
holder.txt_description.setText(resultItem.getDescription());
holder.txt_sku.setText(resultItem.getSku());
holder.txt_stock.setText(resultItem.getStock());
//holder.image.setText(resultItem.getImage());
holder.txt_condition.setText(resultItem.getCondition());
holder.txt_deliverable.setText(resultItem.getDeliverable());
holder.txt_downloadable.setText(resultItem.getDownloadable());
holder.txt_target_gender.setText(resultItem.getTargetGender());
holder.txt_target_age.setText(resultItem.getTargetAge());
holder.txt_visibility.setText(resultItem.getVisibility());
holder.txt_image.setText(resultItem.getImage());
Glide.with(mContext)
.load(resultItem.getImage())
.placeholder(R.drawable.no_image)
.error(R.drawable.no_image)
.into(holder.image);
// holder.txt_weight_value.setText(metadataItem.getWeightValue());
// holder.txt_weight.setText(metadataItem.getWeight());
final String id = resultItem.getId();
final String id_currency = resultItem.getIdCurrency();
final String id_product_category = resultItem.getIdProductCategory();
final String name = resultItem.getName();
final String description = resultItem.getDescription();
final String stock = resultItem.getStock();
final String price_capital = resultItem.getPriceCapital();
final String price_sale = resultItem.getPriceSale();
final String condition = resultItem.getCondition();
final String image = resultItem.getImage();
// final String weight_value = metadataItem.getWeightValue();
// final String weight = metadataItem.getWeight();
holder.btnclick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent detailproduct = new Intent(v.getContext(), DetailProduct.class);
detailproduct.putExtra("id", id);
detailproduct.putExtra("id_product_category", id_product_category);
detailproduct.putExtra("id_currency", id_currency);
detailproduct.putExtra("name", name);
detailproduct.putExtra("price_capital", price_capital);
detailproduct.putExtra("price_sale", price_sale);
detailproduct.putExtra("description", description);
detailproduct.putExtra("stock", stock);
detailproduct.putExtra("condition", condition);
detailproduct.putExtra("image", image);
// detailproduct.putExtra("weight_value", weight_value);
// detailproduct.putExtra("weight", weight);
v.getContext().startActivity(detailproduct);
}
});
}
</code></pre>
| <java><android> | 2019-12-10 09:37:43 | LQ_CLOSE |
59,264,814 | What is the most frequent way to send an HTTP request in the industry at the moment (AJAX, Fetch API, Async/Await)? | <p>I know that AJAX used to be more prevalent in the past when it came to creating HTTP requests and i'm curious on what the industry standard is now?</p>
| <javascript> | 2019-12-10 10:12:28 | LQ_CLOSE |
59,265,157 | Use two nested for structures to log the following pattern. Any ideas? | <pre><code> 0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0
</code></pre>
<p>Any ideas on how to get this done in JavaScript using 2 nested for loops? </p>
| <javascript><loops><for-loop> | 2019-12-10 10:31:04 | LQ_CLOSE |
59,265,381 | How to use string parameters inside groovy script in jenkins freestyle project? | I have created a jenkins freestyle project executing groovy script inside which i need to call an api to validate username and password. How to pass these parameters and use the same inside the groovy script.
A bit urgent.
| <jenkins-groovy> | 2019-12-10 10:42:25 | LQ_EDIT |
59,267,250 | is there any method to count an average date time in python and visualize it? | I am sorry I am new in python. This is my date time. I have it in csv. Here I have two columns CALL and Time. How can I count the average date time so I will know when is the best time to call
```
Time;"Call"
0 2019-12-10 11:35:55;"Answer"
1 2019-12-10 11:31:42;"Not Answer"
2 2019-12-10 11:26:42;"Answer"
3 2019-12-10 11:23:24;"Answer"
4 2019-12-10 11:22:28;"Answer"
5 2019-12-10 11:21:31;"Not Answer"
6 2019-12-10 11:02:08;"Answer"
``` | <python><csv><datetime> | 2019-12-10 12:28:47 | LQ_EDIT |
59,268,211 | Reading a ~180KB file line by line results in StackOverflowException | <p>This text file has ~15,000 short lines. I read it this way:</p>
<pre><code>using (var reader = new StreamReader("words.txt")) {
while (reader.Peek() >= 0) {
list.Add(reader.ReadLine());
}
var r = new Random();
var randomLineNumber = r.Next(0, list.Count - 1);
InterfacePassword.Text = list[randomLineNumber].ToString();
}
</code></pre>
<p>It's frankensteined from other SO answers, I'm not sure if it would actually do what I want. Unfortunately it results in <code>StackOverflowException</code> and I don't understand why - I loaded files of larger sizes before.</p>
| <c#> | 2019-12-10 13:21:36 | LQ_CLOSE |
59,269,400 | Stop a blocking goroutine | <p>How can I kill a goroutine which is blocking. An idea is that returning from the host function would be a solution but I'm not sure if this kills the goroutine or not.</p>
<pre><code>func myFunc() int {
c := make(<-chan int)
go func(){
for i := range c {
// do stuff
}
}()
return 0 // does this kills the inner goroutine?
}
</code></pre>
<p>Is there a more nice solution? For example it would be nice that something like this work but because of the blocking for it doesn't:</p>
<pre><code>func myFunc() int {
c := make(<-chan int)
closeChan := make(chan int)
go func() {
select {
case close := <-closeChan:
return 0
default:
for i := range c {
// do stuff
}
}
}()
closeChan<-0
// other stuff
}
</code></pre>
| <go><channel><goroutine> | 2019-12-10 14:25:12 | LQ_CLOSE |
59,270,289 | Split on newline, but not newline-space in JS | <p>I am trying to split my string into an array on every new line, but not if a newline begins with a space. </p>
<pre><code>ORGANIZER;organizer@example.com //YES
ATTENDEE; user@example.com, another@exa //YES
mple.com, peter@example.com //NO
DESCRIPTION;LANGUAGE=en-US //YES
</code></pre>
| <javascript><node.js><split> | 2019-12-10 15:11:41 | LQ_CLOSE |
59,273,055 | Selenium on Google Colab, PermissionError: [Errno 13] Permission denied: '/content/chromedriver.exe' | I have been using Google Colab for my python projects. I want to learn & implement Selenium using Google Colab. I am trying to log in to Facebook as shown below. But, I am stuck with 'Permission error'. I have looked into various posts & tried to execute suggested solutions such as (https://stackoverflow.com/questions/49787327/selenium-on-mac-message-chromedriver-executable-may-have-wrong-permissions) but **did not help**.
###What I've tried.
1. Referred https://sites.google.com/a/chromium.org/chromedriver/home article as suggested
2. Used chmod 755 to allow executable permissions
3. Referenced 'chromedriver.exe' in different folders within Colab environment and but no luck
###The Code:
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
user_name = 'Username'
password = 'Password'
os.chmod('/content/chromedriver.exe', 755)
driver = webdriver.Chrome(executable_path='/content/')
driver.get("https://www.facebook.com")
element = driver.find_element_by_id("email")
element.send_keys(user_name)
element = driver.find_element_by_id("pass")
element.send_keys(password)
element.send_keys(Keys.RETURN)
driver.close()
###Complete error:
---------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in start(self)
75 stderr=self.log_file,
---> 76 stdin=PIPE)
77 except TypeError:
4 frames
PermissionError: [Errno 13] Permission denied: '/content/'
During handling of the above exception, another exception occurred:
WebDriverException Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in start(self)
86 raise WebDriverException(
87 "'%s' executable may have wrong permissions. %s" % (
---> 88 os.path.basename(self.path), self.start_error_message)
89 )
90 else:
WebDriverException: Message: '' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
###Snapshot of my Colab Environment
[![enter image description here][1]][1]
**Can someone please help me fix this issue?**
**PS:** On the long run, I want to remove my dependence on Jupyter Notebooks & rely on Cloud based Notebook environment such as Google Colab which in theory should allow me to focus on code rather than troubleshooting libraries/compatibility/permission/etc issues.
[1]: https://i.stack.imgur.com/BCcuz.png | <python><selenium><google-chrome><selenium-chromedriver><google-colaboratory> | 2019-12-10 18:05:29 | LQ_EDIT |
59,273,234 | How To stay Logged In, MySQL+Python 3+ tkinter | <p>I Made a Login+Register Page using the Tkinter, python3, and MySQL. Now I want to do the rest of my application but want to avoid trying to log in every time. I couldn't find the code to stay logged in. Does anyone know? </p>
| <python><mysql><python-3.x><authentication><tkinter> | 2019-12-10 18:19:38 | LQ_CLOSE |
59,275,073 | PHP connecting to database fails without error | <p>I am trying to connect to databse on my server by using this code:</p>
<pre><code><?php
$username = "username";
$servername = "localhost";
$password = "password";
echo "Before connection";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
</code></pre>
<p>But code after <code>$conn = new mysqli($servername, $username, $password);</code> is not executing. When i try to echo anything after it I do not get output. Code before that line works as expected. I do not get any errors from php.</p>
<p>I am not sure what is problem. Could it be something server related? I did try to add:</p>
<pre><code>ini_set('display_errors',1);
error_reporting(E_ALL);
</code></pre>
<p>but it didn't help, no errors have been displayed.</p>
<p>I have been trying many things from stackoverflow (and other places) but they didnt help, some examples:</p>
<p><a href="https://stackoverflow.com/questions/16683337/connecting-to-a-mysql-database-from-php-error-but-no-error-shown">Connecting to a mysql database from php, error but no error shown?</a></p>
<p><a href="https://stackoverflow.com/questions/41878840/connection-of-mysql-with-php-not-working">Connection of MySQL with PHP not working</a></p>
| <php><mysql><database> | 2019-12-10 20:44:46 | LQ_CLOSE |
59,275,613 | How does SQL SERVER broke down View code and pick the right tables to extract? | I encountered a problem regarding views in SQL SERVER 2017.
When query with a view, which has multiple underlying tables behind. Besides table involved in SELECT Clause, other tables also get logical read by SQL Server, want to know why.
So, here is scenario:
/*******************************************************/
CREATE VIEW v_test
AS
SELECT
a.col1,
a.col2,
b.col3,
b.col4,
c.col5,
c.col6,
d.col7,
d.col8,
e.col9,
e.col10,
f.col11,
f.col12,
g.col13,
g.col14
FROM a
LEFT JOIN b
LEFT JOIN c
LEFT JOIN d
LEFT JOIN e
LEFT JOIN f
LEFT JOIN g
/*********************************************************/
SELECT col1, col2
FROM V_test
--The col1 col2 should only be pulled out from tbl_a.=>means, logical reads should only read table a.
--However, the logical reads turns out to read more tables than tbl_a. In an senario I got, it reads tbl_a thru tbl_g.
WHY?
| <sql-server><join><view> | 2019-12-10 21:28:02 | LQ_EDIT |
59,279,006 | If else statement problem in android studio | I know this is a very silly question. But i am stuck in this and I have no idea how to solve it.
There are some variables with values:
> float total = 74.67 ;
String grade = "", point = "";
And with this values I want to do this:
if(total>=80){
grade = "A+";
point = "4.00";
}else if(total<=79 && total>=75){
grade = "A";
point = "3.75";
}else if(total>=70 && total<=74) {
grade = "A-";
point = "3.50";
}else if(total<=65 && total>=69){
grade = "B+";
point = "3.25";
}else if(total<=64 && total>=60){
grade = "B";
point = "3.00";
}else if (total<=59 && total>=55){
grade = "B-";
point = "2.75";
}else if (total<=54 && total>=50){
grade = "C+";
point = "2.50";
}else if(total<=49 && total>=45){
grade = "C";
point = "2.25";
}else if (total<=44 && total>=40){
grade = "D";
point = "2.00";
}
else {
grade = "F";
point = "0.00";
}
but it always shows grade = "F" and point = "0.00".
if I write this,
if(total>=70 && total<=74) {
grade = "A-";
point = "3.50";
}
it shows grade ="" and point ="".
the value of total is showing nicely but there are problem with grade and point. can anyone tell me what is the problem? | <java><android><if-statement><conditional-statements><relational-operators> | 2019-12-11 04:42:12 | LQ_EDIT |
59,279,176 | NavigationLink Works Only for Once | <p>I was working on an application with login and after login there are categories listed. And under each category there are some items listed horizontally. The thing is after login, main page appears and everything is listed great. When you click on an item it goes to detailed screen but when you try to go back it just crashes. I found this flow <a href="https://stackoverflow.com/questions/58404725/why-does-my-swiftui-app-crash-when-navigating-backwards-after-placing-a-navigat">Why does my SwiftUI app crash when navigating backwards after placing a `NavigationLink` inside of a `navigationBarItems` in a `NavigationView`?</a> but i could not solve my problem. Since my project become complicated, I just wanted to practice navigation in swiftui and I created a new project. By the way I downloaded the latest xcode version 11.3. I wrote a simple code as follows: </p>
<pre><code>NavigationView{
NavigationLink(destination: Test()) {
Text("Show Detail View")
}
.navigationBarTitle("title1")
</code></pre>
<p>And Test() view is as follows:</p>
<pre><code>import SwiftUI
struct Test: View {
var body: some View {
Text("Hello, World!")
}
}
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test()
}
}
</code></pre>
<p>As you can see it is really simple. I also tried similar examples on the internet but it does not work the way it suppose to work. When I run the project, I click the navigation link and it navigates to Test() view. Then I click back button and it navigates to the main page. However, when I click the navigation link second time, nothing happens. Navigation link works only once and after that nothing happens. It does not navigate, it des not throw any error. I am new to swiftui and everything is great but the navigation. I tried many examples and suggested solutions on the internet, but nothing seems to fix my issues. </p>
| <ios><xcode><navigation><swiftui><navigationlink> | 2019-12-11 05:05:12 | HQ |
59,283,596 | Why does awk always print full lines? | <p>When attempting to use <code>awk</code> to get the process ID from the output of <code>ps aux</code> like so:</p>
<pre><code>ps aux | awk "{ print $2 }"
</code></pre>
<p>No matter what number of row I attempt to print, <code>awk</code> always outputs the full line. I've never managed to get it to work properly. I'm using macOS which apparently uses a different type/version of <code>awk</code>, but I can't find an alternative syntax which might work.</p>
<p>Any advice would be greatly appreciated!</p>
| <bash><macos><awk> | 2019-12-11 10:24:00 | LQ_CLOSE |
59,284,743 | Cloud-build Trigger | <p><strong><em>1.I want to build trigger on Cloud build for only specific branches</em></strong></p>
<p><strong><em>2.It should work with both branches as well as tags in same trigger</em></strong></p>
<p>Any solution/suggestion</p>
<p>Thanks in advance</p>
| <google-cloud-build> | 2019-12-11 11:24:23 | LQ_CLOSE |
59,287,355 | json: cannot unmarshal object into Go value of type error with certain values | <p>Can I decode certain values from json to a struct? I am getting a response like this <a href="https://developer.github.com/v3/gists/#response-5" rel="nofollow noreferrer">https://developer.github.com/v3/gists/#response-5</a> when creating a gist and I created a struct like so:</p>
<pre><code>type GistResponse struct {
HTMLURL string `json:"html_url"`
Public bool `json:"public"`
}
</code></pre>
<p>But when I try to decode the json response the above struct I get a :</p>
<pre><code>json: cannot unmarshal object into Go value of type []main.GistResponse
</code></pre>
<p>Thanks</p>
| <json><go> | 2019-12-11 13:55:37 | LQ_CLOSE |
59,287,387 | Combine a JS to conditional | <p>JS newbie here. I have a landing page with two options - once and regular (two buttons). we have to include a script to the page, but can't have both firing and rather need it to be conditional. </p>
<p>The scripts are like this:</p>
<pre><code> <!-- Regular Donation -->
<script type="text/javascript">
window.adalyserTracker("trackEvent", "lce3", {value: 0.00, a4:"Regular"}, true);
</script>
<!-- One-off Donation -->
<script type="text/javascript">
window.adalyserTracker("trackEvent", "lce3", {value: 0.00, a4:"Once"}, true);
</script>
</code></pre>
<p>Any ninjas out there who can help combine those quickly to one (e.g. if id on the button = once, use 'Once', if Id on the button = regular, use 'Regular') </p>
<p>Thanks in advance :) </p>
| <javascript><arrays><if-statement><conditional-statements> | 2019-12-11 13:57:21 | LQ_CLOSE |
59,289,148 | How to create web push notification wen insert data in database with php | <pre><code><script src='push.min.js' type="text/javascript"></script>
<?php
require_once 'dbconfig.php';
$task = $db_con->prepare('SELECT * FROM table WHERE notification = "unread"');
$task->execute();
while($rows=$task->fetch(PDO::FETCH_ASSOC))
{
?>
</code></pre>
Push.create("title", {
body: "Add deposit",
icon: 'icon',
link: 'link',
});
| <javascript><php> | 2019-12-11 15:31:17 | LQ_CLOSE |
59,289,471 | How to display programmable exactly what time? I need that part code | <p>It is necessary to create an analog clock.How to display programmable exactly what time? I need that part code.Thank you</p>
| <android-studio> | 2019-12-11 15:49:21 | LQ_CLOSE |
59,292,305 | Pytthon / TXT: code to copy text after string | <p>I have a txt file that will be different for different users, it looks something like:</p>
<pre><code>NAME: Joe Bloggs
USERNAME: BLOGJOE
EMAIL: Joe.Bloggs@JB.com
PASSWORD: IAMJOE
</code></pre>
<p>I am trying to make an function where I can choose optional inputs for example, I want username and Password, then it will just return those 2 from the function, but have the ability to return all. How would I do this?</p>
| <python><function> | 2019-12-11 18:55:51 | LQ_CLOSE |
59,294,143 | How to start and stop a MS edge browserwindow from a VB script | So I want to start an MS Edge browser and close it after a few moments.
I've tried some things like the Microsoft Internet Controls.
But I need a different browser than the IE.
Dim pi As New Process
pi = Process.Start("shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge",
Threading.Thread.Sleep(1000)
pi.CloseMainWindow() -- NullReferenceException
But I always get a null reference exception even tho I've initialized it.
Can someone help?
Thanks in advantage
| <.net><vb.net><microsoft-edge> | 2019-12-11 21:11:15 | LQ_EDIT |
59,294,443 | awk and flagging identical patterns | <p>I'm missing something about awk pattern matching a using flags --</p>
<p>Given a file:</p>
<pre><code>2019 foo
a
b
c
2019 bar
d
e
f
2019 foobar
g
h
i
</code></pre>
<p>I can use awk with flags and get the expected output --
<code>awk '/foo/{flag=1;next} /^[0-9]+/{flag=0} flag' file</code></p>
<pre><code> a
b
c
g
h
i
</code></pre>
<p>But if I exclude the next to include the matched pattern, then nothing is printed.
Does awk continue from the matched line?</p>
<p>Using another syntax --
<code>awk '/foo/,/2019/' file</code></p>
<pre><code>2019 foo
2019 foobar
</code></pre>
<p>I was expecting awk to print between and including the match.
I'm definitely missing something on syntax.</p>
| <linux><bash><awk> | 2019-12-11 21:34:37 | LQ_CLOSE |
59,294,807 | How to match all strings that has only one dot using regular expression | <p>I need to capture strings containing only one dot. String will mostly contains domain names like </p>
<p>test.com, fun.test.com, lesh.test.com.</p>
<p>I need to check only the first one and to ignore the string that has more than one dots.</p>
<p>How can I do this using regex?</p>
| <regex><validation> | 2019-12-11 22:05:19 | LQ_CLOSE |
59,297,931 | Get levels for the Reply system in php+sql | <pre><code> id user_id comment_id body parent level
94 4 28 first reply NULL NULL
95 4 28 second reply NULL NULL
96 4 28 reply to the first reply 94 1
97 4 28 reply to the second reply 95 1
98 4 28 third reply NULL NULL
99 4 35 Reply to the third comment NULL NULL
100 4 29 reply to the second comment NULL NULL
</code></pre>
<p>Name : replies</p>
<p>Hey all, i am now working on a comment and reply system which contains infinity reply recursions and for that i need to get the levels of the reply . Above is my table and the values in the level column are wrong. i couldn't get the query to get the levels. So far my logic is this.
the reply to a comment will be the parent reply which will be NULL in parent column and rest of the reply for that reply will be of the reply ID as the parent and it is working . i need the help to get the levels which are greater than one
that is, get the value 2 for the reply to the reply to the reply of a comment </p>
| <mysql><sql><pdo> | 2019-12-12 04:54:07 | LQ_CLOSE |
59,300,486 | Can someone help me to fix this code? I search everywhere and I found nothing helpful | Please help fix this: Redundant conformance constraint 'T': 'ReusableView'
[enter image description here][1]
[1]: https://i.stack.imgur.com/9a1ap.png | <ios><swift> | 2019-12-12 08:33:21 | LQ_EDIT |
59,300,584 | Clearing a static list in C# | <p>I'm trying to clear a static list from my "playerStats" script which I use to access static variables globally. Adding elements to the list works just fine (with playerStats.myList.Add(levelNumber)), but when I try to use myList.Clear I get this error: </p>
<p><em>"Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement"</em>.</p>
<p>Here is the relevant code: First the list definition inside the playerStats class:</p>
<pre><code>{
public static List<int> myList = new List<int>();
}
</code></pre>
<p>And this is then on another script referencing the playerStats:</p>
<pre><code>public void goBack()
{
playerStats.myList.Clear;
SceneManager.LoadScene(0);
}
</code></pre>
<p>Why can't I clear the list like this?</p>
| <c#><unity3d> | 2019-12-12 08:39:50 | LQ_CLOSE |
59,301,566 | Python double for function | <p>I built this Python code with the intent to match each first name with the last name:</p>
<pre><code>first_names = ['Jane','Sam','Deborah']
last_names = ['Simmons','Kaybone','Stone']
for f_name in first_names:
for l_name in last_names:
print(f_name.title() + " " + l_name.title())
</code></pre>
<p>But apparently my code prints out all first names with all last_names instead of just (1,1), (2,2), (3,3). How do I tweak this code? Thanks!</p>
| <python> | 2019-12-12 09:37:39 | LQ_CLOSE |
59,302,487 | how to get text from this element I can't understand this element |
How can I get text of this element please help..???
<div class="status-value" id="divdoctyp" xpath="1">AADHAAR CARD</div>
I tried this
WebElement doctype= driver.findElement(By.xpath("//div[@id='divdoctyp']"));
String type=doctype.getAttribute("type");
String label=doctype.getText();
Thread.sleep(5000);
System.out.print("doctype is "+type +"\n"+label);
| <java><selenium-webdriver><gettext><webdriverwait><getattribute> | 2019-12-12 10:27:01 | LQ_EDIT |
59,302,724 | plus array column with with conversion that array_column in php | I want to create a accounting system. I insert all information that i need them in array but I have problem to showing array.
my accounting system has some ways to get shop and my price column in array have all the ways that isolated with `,` sign.
my array like this:
```php
$array = [
array(
'deposit_id' => 317,
'deposit_date' => '1398/9/21',
'deposit_price' => '40,0,14',
'deposit_code' => 1111,
'deposit_gender' => 0,
'deposit_phone_send' => '09124139155',
'deposit_how_get' => '',
'deposit_user_select' => 'user 2',
'deposit_for' => '3dmax',
'deposit_status' => 0,
'deposit_description' => 'null',
'deposit_abutment_id' => 52
),
array(
'deposit_id' => 400,
'deposit_date' => '1398/9/22',
'deposit_price' => '20,10,0',
'deposit_code' => 2431,
'deposit_gender' => 1,
'deposit_phone_send' => '09102781932',
'deposit_how_get' => '',
'deposit_user_select' => 'user 2',
'deposit_for' => 'Autocad',
'deposit_status' => 0,
'deposit_description' => 'null',
'deposit_abutment_id' => 55
),
];
```
I want to showing the `deposit_price` column with all ways and for all array member like this.
```html
<!--
Cash deposit = plus all member `deposit column` with first sign `,`. that meaning 60
Card deposit = plus all member `deposit column` with second sign `,`. that meaning 10
POST deposti = plus all member `deposit column` with third sign `,`. that meaning 14
all deposit = plus all `deposit_price` column with `,` sign that meaning 84
and i want to showing the in html like this;
-->
<h2>Cash deposit<h2>
<p>60</p>
<hr>
<h2>Card deposit<h2>
<p>10</p>
<hr>
<h2>POS deposit<h2>
<p>14</p>
<hr>
<h2>all deposit<h2>
<p>84</p>
```
| <php><arrays> | 2019-12-12 10:40:13 | LQ_EDIT |
59,304,685 | How to use atoi with an int and malloc? | <p>When I try and use atoi with an int and malloc I get a bunch of errors and key is given the wrong value, what am I doing wrong?</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct arguments {
int key;
};
void argument_handler(int argc, char **argv, struct arguments *settings);
int main(int argc, char **argv) {
argv[1] = 101; //makes testing faster
struct arguments *settings = (struct arguments*)malloc(sizeof(struct arguments));
argument_handler(argc, argv, settings);
free(settings);
return 0;
}
void argument_handler(int argc, char **argv, struct arguments *settings) {
int *key = malloc(sizeof(argv[1]));
*key = argv[1];
settings->key = atoi(key);
printf("%d\n", settings->key);
free(key);
}
</code></pre>
| <c><pointers><malloc><atoi> | 2019-12-12 12:33:01 | LQ_CLOSE |
59,306,162 | C++ Remove all non-number charachters from std::string | <p>What is an efficient way to remove all chars within in a string which are not in the range from 0 to 9?</p>
<pre><code>string s = "h3ll0";
string numbers = removeNonNumbersFromString(s);
cout << numbers << endl;
</code></pre>
<p>output should be <code>30</code></p>
| <c++><regex><string> | 2019-12-12 13:52:24 | LQ_CLOSE |
59,306,404 | I made a platformer! wait... something went wrong :\ | i have started with making a platformer. but my first attempt was a biiiig failure.
code:
sorry, the code is not working, it says 'invalid code format'
i'll just leave the link to download it...
https://yadi.sk/d/dtiUXyAL-KV8vQ
The error is:
Traceback (most recent call last):
File "it dosen't matter", line 68, in <module>
draw()
File "it dosen't matter", line 30, in draw
win.blit(bg, (0, 0))
TypeError: argument 1 must be pygame.Surface, not list
i don't know what the heck is this...
i watched a loooooooooot of videos but nobody helped!
so i tried ALL ide's i know, but all give that freaking error!
tried to re-write the programm, but still i see this.
waht have i do?
| <python><pygame> | 2019-12-12 14:06:14 | LQ_EDIT |
59,308,807 | Can anyone help me with the errors the given code showing? Help me to compile the code fully | It's a manipulation of two codes.
first i send the latitude and longitude value found from the gps module by sms(arduino,gsm module), then by another code i send it to a php file in the server by using http protocol(arduino+gps/gsm/gprs shield). Now when i am merging two codes,it's showing errors like below:
Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino: In function 'void getGPSLocation()':
Hajji_Tracker:58:29: error: invalid operands of types 'const char [12]' and 'char [16]' to binary 'operator+'
Serial.println("Latitude :"+latitude);
~~~~~~~~~~~~~^~~~~~~~~
Hajji_Tracker:59:30: error: invalid operands of types 'const char [13]' and 'char [16]' to binary 'operator+'
Serial.println("Longitude :"+longitude);
~~~~~~~~~~~~~~^~~~~~~~~~
C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino: In function 'void sendTabData(String, int, boolean)':
Hajji_Tracker:91:18: error: incompatible types in assignment of 'String' to 'char [16]'
latitude = data[3];
^
Hajji_Tracker:92:18: error: incompatible types in assignment of 'String' to 'char [16]'
longitude =data[4];
^
```C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino: In function 'void gsm_send_data(String*, String*)':
C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino:138:32: warning: invalid conversion from 'String*' to 'uint8_t {aka unsigned char}' [-fpermissive]
serialSIM808.write(latitude); // Add id to the url
^
In file included from C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\src/SoftwareSerial.h:102:18: note: initializing argument 1 of 'virtual size_t SoftwareSerial::write(uint8_t)'
virtual size_t write(uint8_t byte);
^~~~~
C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino:144:33: warning: invalid conversion from 'String*' to 'uint8_t {aka unsigned char}' [-fpermissive]
serialSIM808.write(longitude); // Add value to url
^
In file included from C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\src/SoftwareSerial.h:102:18: note: initializing argument 1 of 'virtual size_t SoftwareSerial::write(uint8_t)'
virtual size_t write(uint8_t byte);
^~~~~
C:\Users\rafez\OneDrive\Documents\Arduino\Hajji_Tracker\Hajji_Tracker.ino: In function 'void loop()':
Hajji_Tracker:169:37: error: cannot convert 'char*' to 'String*' for argument '1' to 'void gsm_send_data(String*, String*)'
gsm_send_data(latitude,longitude);
^
Multiple libraries were found for "SoftwareSerial.h"
Used: C:\Program
exit status 1
invalid operands of types 'const char [12]' and 'char [16]' to binary 'operator+'```
I have tried many things but can't get rid of these problems. Would please help me getting my code compiled?
Here is my code:
#include <SoftwareSerial.h>
SoftwareSerial serialSIM808(11, 10); //Arduino(RX=11), Arduino(TX=10) //you can replace these with any other pins
//Arduino(RX) to SIM808(TX)
//Arduino(TX) to SIM808(RX)
//Arduino(Gnd) to SIM808(Gnd)
String data[5];
#define DEBUG true
String state,timegps;
char latitude[16];// = "24";
char longitude[16];// = "24";
int numLatitude = 1,numLongitude = 100;
void gsm_disConnect_gprs(){
serialSIM808.write("AT+CGATT=0\r\n"); // Attach to GPRS
delay(2000);
Serial.println("GPRS off");
}
void setup() {
//Begin serial comunication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
while(!Serial);
//Being serial communication witj Arduino and SIM808
serialSIM808.begin(9600);
delay(1000);
Serial.println("Setup Complete!");
delay(200);
sendData("AT+CGNSPWR=1",1000,DEBUG);//Turn on GPS(GNSS - Global Navigation Satellite System)
delay(200);
sendData("AT+CGNSSEQ=RMC",1000,DEBUG);//configure GPS sequence mode to RMC
delay(200);
sendData("AT+CGPSSTATUS?",1000,DEBUG);//check if GPS status is either 2D or 3D fix location. You can use this AT command to check te GPS status manually using the serial monitor.
getGPSLocation();
serialSIM808.write("AT+CREG?\r\n");
delay(150);
gsm_connect_gprs();
}
void getGPSLocation()
{
//--------------------- send SMS containing google map location---------------------
sendTabData("AT+CGNSINF",1000,DEBUG);//Get GPS info(location
if (state !=0) {
Serial.println("State :"+state);
Serial.println("Time :"+timegps);
Serial.println("Latitude :"+latitude);
Serial.println("Longitude :"+longitude);
} else {
Serial.println("GPS Initializing… Items to check: Power supply 12v 2A; Antenna must be facing the sky and/or near the window; Power switch must be turned on.");
}
//-----------------------------------------------------------------------------------
}
void sendTabData(String command , const int timeout , boolean debug){
serialSIM808.println(command);
long int time = millis();
int i = 0;
while((time+timeout) > millis()){
while(serialSIM808.available()){
char c = serialSIM808.read();
if (c != ',') {
data[i] +=c;
delay(100);
} else {
i++;
}
if (i == 5) {
delay(100);
goto exitL;
}
}
}exitL:
if (debug) {
state = data[1];
timegps = data[2];
latitude = data[3];
longitude =data[4];
memset(data,0,sizeof(data));
}
}
String sendData (String command , const int timeout ,boolean debug){
String response = "";
serialSIM808.println(command);
long int time = millis();
int i = 0;
while ( (time+timeout ) > millis()){
while (serialSIM808.available()){
char c = serialSIM808.read();
response +=c;
}
}
if (debug) {
Serial.print(response);
}
return response;
}
void gsm_connect_gprs(){
serialSIM808.write("AT+CGATT=1\r\n"); // Attach to GPRS
delay(2000);
serialSIM808.write("AT+SAPBR=1,1\r\n"); // Open a GPRS context
delay(2000);
//serialSIM808.write("AT+SAPBER=2,1\r\n"); // To query the GPRS context
//delay(2000);
Serial.println("GPRS on");
}
void gsm_send_data(String * latitude,String * longitude)
{
Serial.println("Sending data.");
serialSIM808.write("AT+HTTPINIT\r\n"); // Initialize HTTP
//Serial.print("AT+HTTPINIT\r\n");
delay(1000);
serialSIM808.write("AT+HTTPPARA=\"URL\",\"http://499b.000webhostapp.com/?latitude=3&longitude=16\"\r\n"); // Send PARA command
//serialSIM808.write("AT+HTTPPARA=\"URL\",\"http://shehanshaman.000webhostapp.com/?id=");
//Serial.print("AT+HTTPPARA=\"URL\",\"http://shehanshaman.000webhostapp.com/?id=");
delay(50);
serialSIM808.write(latitude); // Add id to the url
//Serial.print(latitude);
delay(50);
serialSIM808.write("&longitude=");
//Serial.print("&longitude=");
delay(50);
serialSIM808.write(longitude); // Add value to url
//Serial.print(longitude);
delay(50);
serialSIM808.write("\"\r\n"); // close url
//Serial.print("\"\r\n");
delay(2000);
serialSIM808.write("AT+HTTPPARA=\"CID\",1\r\n"); // End the PARA
//Serial.print("AT+HTTPPARA=\"CID\",1\r\n");
delay(2000);
serialSIM808.write("AT+HTTPACTION=0\r\n");
//Serial.print("AT+HTTPACTION=0\r\n");
delay(3000);
serialSIM808.write("AT+HTTPTERM\r\n");
//Serial.print("AT+HTTPTERM\r\n");
//Serial.println();
delay(3000);
Serial.print("data sent complete : ");
}
void loop() {
//Read SIM808 output (if available) and print it in Arduino IDE Serial Monitor
if(numLatitude<5){
itoa(numLatitude, latitude, 10);
itoa(numLongitude,longitude, 10);
gsm_send_data(latitude,longitude);
Serial.print(numLatitude);
Serial.print(" >> ");
Serial.print(numLongitude);
Serial.println();
delay(2000);
numLatitude++;
numLongitude+=45;
if(numLatitude==5) gsm_disConnect_gprs();
}
}
| <c++><arduino> | 2019-12-12 16:19:40 | LQ_EDIT |
59,309,510 | Formatting LocalDate in Java | <p>I defined the following format in Java :</p>
<pre><code>//define format of YYYYMMDD
private final DateTimeFormatter dtf = DateTimeFormatter.BASIC_ISO_DATE;
</code></pre>
<p>My application fetches a certain date from the calendar:</p>
<pre><code>LocalDate localDate = fetchDate(); // fetch date in format "yyyy-mm-dd"
</code></pre>
<p>I want to store an additional two dates in format of <code>dtf</code>. The <code>startOfMonth</code> and <code>endOfMonth</code> of the given <code>localDate</code>.</p>
<p>E.g. if <code>localDate</code> is <code>"2019-12-12"</code> I want to create the following two variables - </p>
<pre><code>String startOfMonth = "20191201";
String endOfMonth = "20191231";
</code></pre>
<p>How can I do that?</p>
| <java><datetime><localdate> | 2019-12-12 17:02:35 | LQ_CLOSE |
59,309,520 | I am buildin an E-commerce websit using spring,hibernate and h2 in JavaEE. I'm getting this error ...Please help ..Thanks in advance | WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 56 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 58 more
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:343)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 68 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 71 more
Dec 12, 2019 10:27:35 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 56 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 58 more
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:343)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 68 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 71 more
| <spring><dependency-injection> | 2019-12-12 17:03:09 | LQ_EDIT |
59,311,189 | Crash when attempting to save a String to UserDefaults in Swift | <p>I am using this line of code to save a String to UserDefaults,</p>
<pre><code>UserDefaults.standard.set(userSelected, forKey: "myKeyString")
</code></pre>
<p>However it results in the crash,</p>
<pre><code>[User Defaults] Attempt to set a non-property-list object (Function) as an NSUserDefaults/CFPreferences value for key myKeyString
</code></pre>
<p>Why?</p>
| <ios><swift> | 2019-12-12 19:00:25 | LQ_CLOSE |
59,313,193 | Python - most accurate time, timezone, calendar library/module | <p>What is the most accurate library or module for python for time zone conversions, i.e. local time to UTC conversions, calendar day conversions that address many historic wartime time zone changes, timezone adoptions and splits, etc over the last couple of centuries? </p>
| <python><datetime><time> | 2019-12-12 21:48:40 | LQ_CLOSE |
59,313,358 | Build-in exception length fewer than expected? | I go over the all build-in exception in JDK, I only find `SizeLimitExceededException` when size exceed the expected length. However, if I want to throw a exception when size limit is below the expected length, there is not such build-in exception class that I can call? | <java><exception> | 2019-12-12 22:05:05 | LQ_EDIT |
59,313,460 | is there a way to disable in Twillio that i can call out with unverified numbers | is there a way to disable in Twillio so that i can call out with unverified numbers?
I'm trying to set up some kind of integration Twillio, Fusionpbx, and Zoho CRM.
and this is where I get stuck I need to disable the feature to only allow outbound from verified numbers. | <twilio> | 2019-12-12 22:14:21 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.