Id int64 34.6M 60.5M | Title stringlengths 15 150 | Body stringlengths 33 36.7k | Tags stringlengths 3 112 | CreationDate stringdate 2016-01-01 00:21:59 2020-02-29 17:55:56 | Y stringclasses 3 values |
|---|---|---|---|---|---|
56,356,262 | can anyone convert this linq code into sql query. because i cant understand what is it doing? | var don2 = db.Panels.Include(y => y.Invoice)
.Include(x => x.PanelTypeEntries.Select(a => a.SubItems)).Where(v => v.Invoice_Id == Quotation_Id)
.ToList(); | <c#><linq><linq-to-sql> | 2019-05-29 08:32:21 | LQ_EDIT |
56,357,133 | Total delay is for 60 secs and each check with 5 secs interval | Total sleep time should be 60 secs and each check should be in 5 secs interval.
How should I use count variable to trace the count of the total execution
```import time
def test(a):
count=0
while True:
if a < 10:
print("ok")
return True
count = count+1
time.sleep(5)
if(count == 12):
return False
print(test(a=40))
```
the while loop should stop executing after 60 secs and return false, the each check interval is 5 secs. I am confused that where should I increment the count, before time.sleep(5) or after time.sleep(5). what will be the solution to see that the time.sleep is been executed for 12 times and it has been 60 secs of waiting and return false | <python> | 2019-05-29 09:19:36 | LQ_EDIT |
56,360,425 | Short horizontal line in front of the text | <p>I've ready many posts about creating a horizontal line before and after header, but all the examples are not totally what i want to have and I cannot change them to what I would like to have.</p>
<p>Basically I need a SHORT (25px) horizontal line in front of the Header.</p>
<p>See image: <a href="https://i.stack.imgur.com/MCgA1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MCgA1.jpg" alt="enter image description here"></a></p>
<p>Maybe it is not possible to do with css ... how to do it better then?</p>
<p>Any assistance would be welcome.</p>
<p>Thanks in advance</p>
| <html><css> | 2019-05-29 12:16:13 | LQ_CLOSE |
56,361,392 | Find min and max of every column for every label in pandas.DataFrame | <p>I have a <code>DataFrame</code> called <code>df</code> and it has 4 columns, like the one presented below: </p>
<pre><code>A B C Class
12 13 22 1
8 15 20 1
9 14 25 1
18 9 35 2
5 14 30 2
4 12 28 2
35 87 67 3
35 82 66 3
20 7 32 4
10 8 32 4
22 7 31 4
... ... ... ...
</code></pre>
<p>What I want is to find the min and max for every column with respect to the class.
In other words, I would like to get a result similar to the one below: </p>
<pre><code>Class: 1
A: [8, 12]
B: [13, 15]
C: [20, 25]
Class: 2
A: [4, 18]
B: [9, 14]
C: [28, 35]
Class: 3
A: [35, 35]
B: [82, 87]
C: [66, 67]
...
</code></pre>
| <python><python-3.x><pandas><dataframe> | 2019-05-29 13:06:34 | LQ_CLOSE |
56,362,579 | Taking input again if not valid input | <p>I want to program it like that so while taking input of num1,num2 and operation if user doesn't give input in appropriate type it ask the user again for input.</p>
<pre><code>operation=(input('1.add\n2.subtract\n3.multiply\n4.divide'))
num1 =int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
if operation == "add" or operation == '1' :
print(num1,"+",num2,"=", (num1+num2))
elif operation =="subtract" or operation == '2':
print(num1,"-",num2,"=", (num1-num2))
elif operation =="multiply" or operation == '3':
print(num1,"*",num2,"=", (num1*num2))
elif operation =="divide" or operation == '4':
print(num1,"/",num2,"=", (num1/num2))
</code></pre>
| <python> | 2019-05-29 14:10:45 | LQ_CLOSE |
56,362,930 | How to put two child of Kendo grid hierarchy into tab | I have one parent table and two child table in hierarchy. what I want is to have a design that the child table was in seperate tab.
This is the sample of what I've already tried. https://dojo.telerik.com/ubiZewAh
| <jquery><html><css><kendo-grid> | 2019-05-29 14:28:18 | LQ_EDIT |
56,363,784 | How to convert alphabets to numerical values with spaces and retain it back to alphabets using Matlab? | Want to convert the alphabet to numerical values and transform it back to alphabets using some mathematical techniques like fast fourier transform in matlab | <matlab><encoding> | 2019-05-29 15:16:20 | LQ_EDIT |
56,363,831 | how can I list all files in a directory without using dirnet in c? | I can't find any way to list all files without using dirent.h does anyone have an idea or suggestions?
I can't work with dirent.h because my compiler doesn't work with it so this is why I am searching for another option | <c><winapi> | 2019-05-29 15:18:59 | LQ_EDIT |
56,364,535 | check if username exists inside firebase database | <p>Am trying to check if a username exists from a database by calling the function checkifUsernameExists(username) within an if statement. the problem is firebase's built function called</p>
<pre><code> public void onDataChange(@NonNull DataSnapshot dataSnapshot)
</code></pre>
<p>cannot return a boolean value. What can i do?</p>
<pre><code> mCreateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String username = musername.getText().toString();
String email = mEmail.getText().toString();
String password = mPassword.getText().toString();
if (TextUtils.isEmpty(username) || TextUtils.isEmpty(email) || TextUtils.isEmpty(password)) {
Toast.makeText(registerActivity.this, "Cannot sign you in. Please check the form and try again",
Toast.LENGTH_SHORT).show();
} else if (password.length() < 6) {
Toast.makeText(registerActivity.this, "Password must be at least 6 characters",Toast.LENGTH_LONG).show();
} else if (email_exists == true) {
Toast.makeText(registerActivity.this, "Email already exists",Toast.LENGTH_LONG).show();
} else if (checkifUsernameExists(username)) {
Toast.makeText(registerActivity.this, "Username already exists", Toast.LENGTH_LONG).show();
} else {
message.setTitle("Registering user");
message.setMessage("Pleases wait while we create your account");
message.setCanceledOnTouchOutside(false);
message.show();
//registerUser(username, email, password);
}
}
});
}
</code></pre>
<pre><code>
private boolean checkifUsernameExists(String username) {
Query usernameQuery = FirebaseDatabase.getInstance().getReference().child("users").orderByChild("username").equalTo(username);
usernameQuery.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.getChildrenCount() > 0) {
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
</code></pre>
| <java><firebase><firebase-realtime-database> | 2019-05-29 16:01:05 | LQ_CLOSE |
56,364,643 | What's the difference between a Docker image's Image ID and its Digest? | <p>This has been surprisingly confusing for me. I thought Docker's Image ID is its SHA256 hash. However, apparently the result from <code>docker image ls --digests</code> (listed under the column header <code>DIGEST</code>) is different from the <code>IMAGE ID</code> of that image.</p>
<p>For example</p>
<pre><code>docker image ls --digests alpine
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
alpine latest sha256:769fddc7cc2f0a1c35abb2f91432e8beecf83916c421420e6a6da9f8975464b6 055936d39205 2 weeks ago 5.53MB
</code></pre>
<p>while </p>
<pre><code>docker image ls --no-trunc
REPOSITORY TAG IMAGE ID CREATED SIZE
...
alpine latest sha256:055936d3920576da37aa9bc460d70c5f212028bda1c08c0879aedf03d7a66ea1 2 weeks ago 5.53MB
</code></pre>
<p>Clearly <code>sha256:055936d3920576da37aa9bc460d70c5f212028bda1c08c0879aedf03d7a66ea1</code> (IMAGE ID) and <code>sha256:769fddc7cc2f0a1c35abb2f91432e8beecf83916c421420e6a6da9f8975464b6</code> (DIGEST) are not the same value. But why? What's the purpose of having two different <code>sha256</code> hashes of the same image. How are they calculated, respectively?</p>
<p>I was confused by this when reading the book <em>Docker Deep Dive</em>, and I haven't been able to find a clear answer either in the book or online.</p>
| <docker><hash><sha256> | 2019-05-29 16:07:51 | HQ |
56,364,691 | Reading matrices of unkown dimension | <p>I'm trying to read a matrix from a file formatted in this way</p>
<pre>
1 2 3 4
4 5 6 7
8 9 10 11
*
1 0 1
0 1 1
1 1 1]
</pre>
<p>but I don't know how to pass the multidimensional array with its dimension given by rows[] and cols[] arrays to the function read_matrix().</p>
<p>I am able to get the correct dimension of the two matrices</p>
<pre><code>#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
int get_dim(char *file, int *r, int *col);
/*gets the dimension and type of operation*/
void read_matrix(char *file, int (*matA)[], int(*matB)[], int *m, int *n);
int main (int argc, char *argv[]){
int i,j;
int rows[2]= {0,1}; /* The last line of the file does not contain '\n' */
int cols[2]= {0,0};
int operation; /*type of operation 1 for * and 2 for + */
operation = get_dim(argv[1], rows, cols);
int A[rows[0]][cols[0]];
int B[rows[1]][cols[1]];
printf("A is a matrix %d x %d\n",rows[0], cols[0]);
if(operation != 0)
printf("B is a matrix %d x %d\n", rows[1], cols[1]);
read_matrix(argv[1], A, B, rows, cols);
/*printing the matrices */
for(i = 0; i < rows[0]; i++){
for(j=0; j < cols[0]; j++){
printf("%d ", A[i][j]);
}
printf("\n");
}
printf("*\n");
for(i = 0; i < rows[1]; i++){
for(j=0; j< cols[1]; j++){
printf("%2d ", B[i][j]);
}
printf("\n");
}
return 0;
}
int get_dim(char *file, int *r, int *col){
FILE *fp;
int c;
int op=0;
int n =0; /*to check all coefficients in a row */
/* opening file for reading */
fp = fopen(file, "r");
if(fp == NULL) {
perror("Error opening file");
}
while ( (c = getc(fp)) != ']')
{
if(isdigit(c) && n==0){
if(op == 0)
col[0]++;
else
col[1]++;
}
//Count whenever new line is encountered
if (c == '\n'){
n=1;
if(op == 0)
r[0]++;
else
r[1]++;
}
if(c == '*'){
op=1;
n =0;
c = getc(fp);
}
else if(c == '+'){
op=2;
c = getc(fp);
}
//take next character from file.
}
fclose(fp);
return op;
}
void read_matrix(char *file, int (*matA)[], int(*matB)[], int *m, int *n){
int i,j;
FILE *fp;
if( (fp = fopen(file, "r")) != NULL ){
for(i=0; i < m[0]; i++)
for(j=0; j < n[0]; j++)
fscanf(fp, "%d", &matA[i][j]);
/*skip the line containing the character operator */
while ( fgetc(fp) != '\n')
fgetc(fp);
for(i=0; i < m[1]; i++)
for(j=0; j < n[1]; j++)
fscanf(fp, "%d", &matB[i][j]);
}
fclose(fp);
}
</code></pre>
<p>I should define the pointers this way: int(*matA)[cols[0]] and int(*matB)[cols[1]].
In read_matrix() by declaring this pointer: int(*matB)[] I get the error : invalid use of array with unspecified bounds, that I understand. But the bound is determined by the get_dim() function.</p>
| <c> | 2019-05-29 16:10:58 | LQ_CLOSE |
56,364,942 | How can I write a python code for this question? | <p>A snail falls at the bottom of a 125 cm well. Each day the snail rises 30 cm. But at night, while sleeping, slides 20 cm because the walls are wet. How many days does it take to escape from the well?</p>
| <python-3.x> | 2019-05-29 16:28:12 | LQ_CLOSE |
56,365,178 | Does java support multiple inheritance? | <p>Does java support multiple inheritance?
(<a href="https://i.stack.imgur.com/PkhMD.png" rel="nofollow noreferrer">https://i.stack.imgur.com/PkhMD.png</a>)</p>
| <java> | 2019-05-29 16:44:10 | LQ_CLOSE |
56,365,826 | No information on google | I am trying to put in in to MYSQL and XML files but when i press to put in MYSQL it does that, and when i press to put in XML it puts in to MYSQL. I don't know how to fix that.
Well i looked all over the internet and couldn't find any information that could help me
I tried to fix this code for like 8 hours but couldn't find what was the problem with it.
<?php
include_once 'includes/DuombazesInfo.php'
?>
<?php
if(isset($_REQUEST['Ikelimas'])) {
$xml = new DOMDocument ("1.0","UTF-8");
$xml -> load("pavyzdysxml.xml");
$rootTag = $xml -> getElementsByTagName ("document") -> item(0);
$dataTag = $xml -> createElement("data");
$nameTag = $xml -> createElement("name", $_REQUEST['name']);
$lastnameTag = $xml -> createElement("lastname", $_REQUEST['lastname']);
$emailTag = $xml -> createElement("email", $_REQUEST['email']);
$passwordTag = $xml -> createElement("password", $_REQUEST['password']);
$dataTag -> appendChild($nameTag);
$dataTag -> appendChild($lastnameTag);
$dataTag -> appendChild($emailTag);
$dataTag -> appendChild($passwordTag);
$rootTag -> appendChild($dataTag);
$xml -> save("PavyzdysXML.xml");
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = test_input($_POST["name"]);
$lastname = test_input($_POST["lastname"]);
$email = test_input($_POST["email"]);
$password = test_input($_POST["password"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Lentele su duomenu baze</title>
</head>
<body>
<h2>Savarankiškas darbas</h2>
<form action="includes/prisijungimas.php" method="POST">
<input type="text" name="name" placeholder="Vardas" required>
<br><br>
<input type="text" name="lastname" placeholder="Pavardė" required>
<br><br>
<input type="email" name="email" placeholder="El. Paštas">
<br><br>
<input type="text" name="password" placeholder="Slaptažodis" required>
<br><br>
<button type="submit" name="Įkelti"> Įkelti į duomenų bazę </button>
<input type="button" value="Peržiūrėti duomenų bazės informaciją"
class="homebutton" id="btnHome" onClick="parent.location='index1.php'"/>
<input type="button" value="Peržiūrėti XML failą" class="homebutton"
id="btnHome" onClick="parent.location='PavyzdysXML.xml'" />
<input type="submit" name="Ikelimas" value ="Įkelti į XML failą">
</form>
</body>
</html> | <php><mysql> | 2019-05-29 17:32:55 | LQ_EDIT |
56,367,264 | Android studio layout design issue | I have a problem in the layout design in android studio, in android studio I set 720x1280 in the design preview option. Its the first image. But when i build the apk and install it in the device, the same activity looks like the second image. Its like it's cut.
I need that in the first image, the blank space "expands" because i need to put the title long across in the second screen. The sentence is "Ingrese fecha de vencimiento" but only shows "Ingrese fecha de" .
How can i fix this?
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/hRluY.png | <java><android> | 2019-05-29 19:25:12 | LQ_EDIT |
56,368,938 | Use Fragments in Koltin | How does one use fragments instead of layouts to give them its on koltin file. Using the navigation drawer template in andriod studio.
override fun onNavigationItemSelected(item: MenuItem): Boolean {
// Handle navigation view item clicks here.
when (item.itemId) {
R.id.nav_home -> {
// Handle the camera action
}
R.id.nav_gallery -> {
}
R.id.nav_slideshow -> {
}
R.id.nav_tools -> {
}
R.id.nav_share -> {
}
R.id.nav_send -> {
}
}
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
drawerLayout.closeDrawer(GravityCompat.START)
return true
}
Does this constructor automatically switch the view based on their name ie nav_gallery I am new to koltin and java so please excuse my ignorance. | <android><kotlin> | 2019-05-29 21:43:57 | LQ_EDIT |
56,370,021 | Display Vuetify tooltip on disabled button | <p>I am having difficulty displaying a tooltip on a button that is disabled with Vuetify.</p>
<p>I've made sure the tooltip can be displayed when the button is enabled, this works as expected. I think that <a href="https://stackoverflow.com/questions/51826891/how-do-i-enable-tooltips-on-a-disabled-text-field-in-vuetify">this question</a> is related, but I'm not well-versed enough to know if this applies to a <code>v-btn</code>. I attempted to create a custom class and add that to the specific <code>v-btn</code> element but I did not have any luck.</p>
<h1>Example HTML</h1>
<pre class="lang-html prettyprint-override"><code><div id="app">
<v-app id="inspire">
<v-container fluid class="text-xs-center">
<v-layout
flex
justify-space-between
row
wrap
>
<v-flex xs12>
<v-btn @click="show = !show">toggle</v-btn>
</v-flex>
<v-flex xs12 class="mt-5">
<v-tooltip v-model="show" top>
<template v-slot:activator="{ on }">
<v-btn disabled icon v-on="on">
<v-icon color="grey lighten-1">shopping_cart</v-icon>
</v-btn>
</template>
<span>Programmatic tooltip</span>
</v-tooltip>
</v-flex>
</v-layout>
</v-container>
</v-app>
</div>
</code></pre>
<h1>Example JavaScript</h1>
<pre><code>new Vue({
el: '#app',
data () {
return {
show: false
}
}
})
</code></pre>
<p><a href="https://codepen.io/anon/pen/ZNqpOW?editors=1010" rel="noreferrer">https://codepen.io/anon/pen/ZNqpOW?editors=1010</a></p>
<p>I'm expecting that the tooltip can be displayed when hovering over a disabled button. I'm hoping to use this to explain why the button is disabled.</p>
| <javascript><vuetify.js> | 2019-05-30 00:02:47 | HQ |
56,370,659 | Adding two big numbers in javascript | <p>I've been trying to add the following numbers using javascript;
<code>76561197960265728</code> + <code>912447736</code></p>
<p>Sadly, because of rounding in javascript it will not get the correct number, I need the number as a string.</p>
<p>I've tried removing the last few digits using substr and then adding the two numbers together and then putting the two strings together, sadly this doesn't work if the first of the number is a 1.</p>
<pre><code>function steamid(tradelink){
var numbers = parseInt(tradelink.split('?partner=')[1].split('&')[0]),
base = '76561197960265728';
var number = parseInt(base.substr(-(numbers.toString().length + 1))) + numbers;
steamid = //put back together
}
steamid('https://steamcommunity.com/tradeoffer/new/?partner=912447736&token=qJD0Oui2');
</code></pre>
<p>Expected:
<code>76561198872713464</code></p>
| <javascript><node.js> | 2019-05-30 01:49:00 | LQ_CLOSE |
56,370,849 | How do I find out and change the value of <input type = "text"> in asp.net? | <p>I want to find the value of and want to mask the first 4th of the text field to another character when the length of the text field is 4 or greater. </p>
<p>but I don't know well asp.net skill. help me plz.</p>
<p>here is some html in body tag</p>
<pre class="lang-html prettyprint-override"><code><body>
<form id="form1" runat="server">
<div>
<input type="text" runat="server" id="input1" name="input1" value="TestText" />
<input type="button" runat="server" class="btnCnvt" name="btnCnvt" id="btnCnvt" value="convert" onclick="GetValue()" />
</div>
</form>
</body>
</code></pre>
<p>here is javascript :(</p>
<pre><code><script type="text/javascript">
function GetValue()
{
// Don't Work!!!(not fount 'value' attribute)
var str = document.getElementById("input1").value;
}
</script>
</code></pre>
| <javascript><c#><asp.net><.net> | 2019-05-30 02:20:15 | LQ_CLOSE |
56,371,197 | Regex validate URL if it does not contain a subdomain | Basically, I would like to check a valid URL that does not have subdomain on it. I can't seem to figure out the correct regex for it.
Example of URLs that SHOULD match:
* example.com
* www.example.com
* example.co.uk
* example.com/page
* example.com?key=value
Example of URLs that SHOULD NOT match:
* test.example.com
* sub.test.example.com | <regex><iis><regex-lookarounds><regex-group><regex-greedy> | 2019-05-30 03:20:37 | LQ_EDIT |
56,371,684 | php preg_match get string | The original text
```
window.DATA_STORE = {
isMobile: false,
data: {"visitsList":{"data":[{"userId":"NkEQmWDdKzwyXKbGMJZj","userName":"GeroChile","userGender":1,"userAge":36,"userCity":"","userPicId":"axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol","userPictures":{"small":"\/content\/u\/a\/x\/axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol_12.jpg","medium":"\/content\/u\/a\/x\/axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NkEQmWDdKzwyXKbGMJZj&c=513cf8852f2a335b5a6b0dbd21c7df5fcf6c543c","userLastVisited":"heute, 02:30 Uhr"},{"userId":"rjLvKgNbDmznPrdmYGWo","userName":"Zuckerstange1","userGender":1,"userAge":56,"userCity":"","userPicId":"5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z","userPictures":{"small":"\/content\/u\/5\/g\/5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z_12.jpg","medium":"\/content\/u\/5\/g\/5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rjLvKgNbDmznPrdmYGWo&c=8011959c2842141f6dfb066ee4cfbf46aba59196","userLastVisited":"gestern, 01:44 Uhr"},{"userId":"knjlBZmawrnmMWeMxLpW","userName":"Tom_0990","userGender":1,"userAge":29,"userCity":"","userPicId":"gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc","userPictures":{"small":"\/content\/u\/g\/b\/gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc_12.jpg","medium":"\/content\/u\/g\/b\/gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=knjlBZmawrnmMWeMxLpW&c=10dd411df2eeeeffb793d9472b842c98c4928ee1","userLastVisited":"gestern, 00:55 Uhr"},{"userId":"qlBWrvxbzBBYkmbKZjPJ","userName":"Lieblingsjunge","userGender":1,"userAge":49,"userCity":"","userPicId":"lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8","userPictures":{"small":"\/content\/u\/l\/s\/lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8_12.jpg","medium":"\/content\/u\/l\/s\/lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=qlBWrvxbzBBYkmbKZjPJ&c=89da3babf04a621b8474ece8585073b38d1c0c54","userLastVisited":"gestern, 00:24 Uhr"},{"userId":"VWKqlByarzzmRxaNLYjZ","userName":"Triskell","userGender":1,"userAge":48,"userCity":"","userPicId":"co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz","userPictures":{"small":"\/content\/u\/c\/o\/co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz_12.jpg","medium":"\/content\/u\/c\/o\/co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VWKqlByarzzmRxaNLYjZ&c=d25c234771e97ba2c348089e09bc1abf6018d693","userLastVisited":"gestern, 19:13 Uhr"}],"count":5,"settings":{"m":1,"g":0,"v":2}},"onlineList":{"data":[{"userId":"wRGYvAQdklgEYJemzENj","userName":"Chaosmak3r","userGender":1,"userAge":24,"userCity":"Chemnitz","userPicId":"ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0","userPictures":{"small":"\/content\/u\/u\/a\/ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0_12.jpg","medium":"\/content\/u\/u\/a\/ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=wRGYvAQdklgEYJemzENj&c=aeb85869ec7398deb60c7e2cc11b5fbc35ff3133","userLastVisited":""},{"userId":"AJDqGPgbQJJXJYdpRWvj","userName":"Sv_Pro","userGender":1,"userAge":26,"userCity":"Freiberg","userPicId":"nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks","userPictures":{"small":"\/content\/u\/n\/b\/nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks_12.jpg","medium":"\/content\/u\/n\/b\/nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=AJDqGPgbQJJXJYdpRWvj&c=8fabf3ad40118c62f6e5a7b1c78fd0b4bf875941","userLastVisited":""},{"userId":"mZEWKkpbjjNgRPbQRLrD","userName":"Jonas13","userGender":1,"userAge":26,"userCity":"W\u00fcrzburg","userPicId":"l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e","userPictures":{"small":"\/content\/u\/l\/6\/l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e_12.jpg","medium":"\/content\/u\/l\/6\/l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=mZEWKkpbjjNgRPbQRLrD&c=80185000c609e075542f2e5275657aae87ee812d","userLastVisited":""},{"userId":"kvgNmRKdGgLjgodLJjlX","userName":"Schrauber-93","userGender":1,"userAge":26,"userCity":"Meerane","userPicId":"kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j","userPictures":{"small":"\/content\/u\/k\/g\/kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j_12.jpg","medium":"\/content\/u\/k\/g\/kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=kvgNmRKdGgLjgodLJjlX&c=60b0bea55b4bdf6b4d33f3134c51a53ec98d3d6b","userLastVisited":""},{"userId":"YMwlJyRaMroxGPbPLpkW","userName":"Martin993","userGender":1,"userAge":25,"userCity":"Darmstadt","userPicId":"no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0","userPictures":{"small":"\/content\/u\/n\/o\/no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0_12.jpg","medium":"\/content\/u\/n\/o\/no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=YMwlJyRaMroxGPbPLpkW&c=2c5cf6795f85cbc2a6f2b8181fae4aaa427431f0","userLastVisited":""},{"userId":"lvrEojzayvvlyPbPnWBX","userName":"Thommy06","userGender":1,"userAge":21,"userCity":"Chemnitz","userPicId":"3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm","userPictures":{"small":"\/content\/u\/3\/h\/3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm_12.jpg","medium":"\/content\/u\/3\/h\/3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=lvrEojzayvvlyPbPnWBX&c=84b645c5e04ecc0661aa12c3b1c232ab38c86bec","userLastVisited":""},{"userId":"rmxkNywanlpNEgdAXjpM","userName":"Furkan","userGender":1,"userAge":26,"userCity":"Heppenheim","userPicId":"a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0","userPictures":{"small":"\/content\/u\/a\/4\/a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0_12.jpg","medium":"\/content\/u\/a\/4\/a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywanlpNEgdAXjpM&c=d1e85439cf80704a95d6cbf2eeccc399392f5204","userLastVisited":""},{"userId":"GpgXMNmbxnBQqKeJzqRw","userName":"Keksian","userGender":1,"userAge":24,"userCity":"Leipzig","userPicId":"5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl","userPictures":{"small":"\/content\/u\/5\/u\/5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl_12.jpg","medium":"\/content\/u\/5\/u\/5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmbxnBQqKeJzqRw&c=500212e2e649fef4ed13a4d80b601664afdea77e","userLastVisited":""},{"userId":"NqDMnwpapqqmAYbyJQPZ","userName":"Felixmagicetea","userGender":1,"userAge":26,"userCity":"Schwalmstadt","userPicId":"sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742","userPictures":{"small":"\/content\/u\/s\/g\/sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742_12.jpg","medium":"\/content\/u\/s\/g\/sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpapqqmAYbyJQPZ&c=212f0a9ab1193108e6a8809b3e84577c9e1c903e","userLastVisited":""},{"userId":"NpEQvGqaWBBWXkewPBAj","userName":"Flint93","userGender":1,"userAge":25,"userCity":"Helmstedt","userPicId":"vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx","userPictures":{"small":"\/content\/u\/v\/m\/vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx_12.jpg","medium":"\/content\/u\/v\/m\/vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NpEQvGqaWBBWXkewPBAj&c=97afffd0a631005cd82465ad20b692e82839e63e","userLastVisited":""},{"userId":"GpgXMNmaxrrJqwdJzqRw","userName":"FitteFimmel","userGender":1,"userAge":22,"userCity":"Erlensee","userPicId":"8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0","userPictures":{"small":"\/content\/u\/8\/w\/8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0_12.jpg","medium":"\/content\/u\/8\/w\/8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmaxrrJqwdJzqRw&c=76d7567c4dc34451240bee64bedaeb3b8a991305","userLastVisited":""},{"userId":"NqDMnwpepjXyyybyJQPZ","userName":"Matatta","userGender":1,"userAge":25,"userCity":"Kirchberg","userPicId":"adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq","userPictures":{"small":"\/content\/u\/a\/d\/adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq_12.jpg","medium":"\/content\/u\/a\/d\/adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpepjXyyybyJQPZ&c=1371068df70bcd7bfac071fc9d0584a11e72069e","userLastVisited":""},{"userId":"rjLvKgNbDmmvEPdmYGWo","userName":"LautundDrau\u00dfen","userGender":1,"userAge":26,"userCity":"Erfurt","userPicId":"5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0","userPictures":{"small":"\/content\/u\/5\/y\/5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0_12.jpg","medium":"\/content\/u\/5\/y\/5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rjLvKgNbDmmvEPdmYGWo&c=ab801a62580085f365128d564f75b56e9a3fcc62","userLastVisited":""},{"userId":"xENlwKBeJwzMZKaWkLGy","userName":"michi27z","userGender":1,"userAge":21,"userCity":"Gro\u00df-Zimmern","userPicId":"jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e","userPictures":{"small":"\/content\/u\/j\/m\/jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e_12.jpg","medium":"\/content\/u\/j\/m\/jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBeJwzMZKaWkLGy&c=8b66ca15c6df77a031b087457c363cf011667403","userLastVisited":""},{"userId":"xENlwKBaJlDVpJdWkLGy","userName":"roger007","userGender":1,"userAge":21,"userCity":"G\u00f6ttingen","userPicId":"1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef","userPictures":{"small":"\/content\/u\/1\/k\/1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef_12.jpg","medium":"\/content\/u\/1\/k\/1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBaJlDVpJdWkLGy&c=d9f0b63b9f46d6439bceb99715c49f85592ba8fb","userLastVisited":""},{"userId":"qlBWrvxdzBBAnMdKZjPJ","userName":"Samy20","userGender":1,"userAge":20,"userCity":"Regensburg","userPicId":"fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2","userPictures":{"small":"\/content\/u\/f\/b\/fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2_12.jpg","medium":"\/content\/u\/f\/b\/fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=qlBWrvxdzBBAnMdKZjPJ&c=e7c6ea2e85059413bdcda620e57282cebfdcf84a","userLastVisited":""},{"userId":"QwrXmEvePrWZnZbPNKYl","userName":"themanno","userGender":1,"userAge":24,"userCity":"Marbach","userPicId":"vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7","userPictures":{"small":"\/content\/u\/v\/j\/vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7_12.jpg","medium":"\/content\/u\/v\/j\/vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=QwrXmEvePrWZnZbPNKYl&c=36baed1660b0738c8e1d94866761ebb9ba9c1795","userLastVisited":""},{"userId":"rmxkNywenlLpmrbAXjpM","userName":"SlimFelix","userGender":1,"userAge":26,"userCity":"Butzbach","userPicId":"a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk","userPictures":{"small":"\/content\/u\/a\/9\/a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk_12.jpg","medium":"\/content\/u\/a\/9\/a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywenlLpmrbAXjpM&c=3ec55bd03374bc48410360726626cf2d31d61dbe","userLastVisited":""},{"userId":"xENlwKBeJPkNMAbWkLGy","userName":"Magicdrinkmix","userGender":1,"userAge":23,"userCity":"N\u00fcrnberg","userPicId":"yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0","userPictures":{"small":"\/content\/u\/y\/c\/yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0_12.jpg","medium":"\/content\/u\/y\/c\/yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBeJPkNMAbWkLGy&c=11154131780def40accd9d70a92d789436fec79d","userLastVisited":""},{"userId":"NkEQmWDbKpLQpNdGMJZj","userName":"Thommy96","userGender":1,"userAge":23,"userCity":"Gotha","userPicId":"7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou","userPictures":{"small":"\/content\/u\/7\/x\/7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou_12.jpg","medium":"\/content\/u\/7\/x\/7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NkEQmWDbKpLQpNdGMJZj&c=84861a1ac988775acf71e35c5771cb3ae91664ff","userLastVisited":""},{"userId":"NpEQvGqaWMRBMldwPBAj","userName":"wabb93","userGender":1,"userAge":25,"userCity":"Eltville","userPicId":"7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0","userPictures":{"small":"\/content\/u\/7\/a\/7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0_12.jpg","medium":"\/content\/u\/7\/a\/7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NpEQvGqaWMRBMldwPBAj&c=4dc1d4de6d84ca82e1e0f7db9ae5956b6ea24b56","userLastVisited":""},{"userId":"VMvxkKXaYJPDywbGrZNA","userName":"ag01","userGender":1,"userAge":25,"userCity":"Bad Rappenau","userPicId":"jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke","userPictures":{"small":"\/content\/u\/j\/p\/jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke_12.jpg","medium":"\/content\/u\/j\/p\/jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VMvxkKXaYJPDywbGrZNA&c=7face200cafb74d3258ddc7534fec9924c65a423","userLastVisited":""},{"userId":"lvrEojzaynkpkwbPnWBX","userName":"Ullyses","userGender":1,"userAge":26,"userCity":"Heidelberg","userPicId":"bhugirynumzsshdo810qqtc73kkro7yvaiwna062","userPictures":{"small":"\/content\/u\/b\/h\/bhugirynumzsshdo810qqtc73kkro7yvaiwna062_12.jpg","medium":"\/content\/u\/b\/h\/bhugirynumzsshdo810qqtc73kkro7yvaiwna062_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=lvrEojzaynkpkwbPnWBX&c=7a35caca31aa4649f7be04e445564eaff40287ff","userLastVisited":""},{"userId":"mZEWKkpejjQnYqeQRLrD","userName":"Tjoram","userGender":1,"userAge":23,"userCity":"Breitenstein","userPicId":"nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36","userPictures":{"small":"\/content\/u\/n\/d\/nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36_12.jpg","medium":"\/content\/u\/n\/d\/nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=mZEWKkpejjQnYqeQRLrD&c=8cd13591aa66512c9a1e3cb9878130027be2593c","userLastVisited":""},{"userId":"ZVlQXBpeXMmkwwagnzYy","userName":"David1998","userGender":1,"userAge":20,"userCity":"Nordhausen","userPicId":"o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj","userPictures":{"small":"\/content\/u\/o\/1\/o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj_12.jpg","medium":"\/content\/u\/o\/1\/o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=ZVlQXBpeXMmkwwagnzYy&c=88dff6b62ee053584614d555a19dfeade9e305f1","userLastVisited":""},{"userId":"ZVlQXBpaXMMqkVbgnzYy","userName":"Tong888","userGender":1,"userAge":27,"userCity":"Wendeburg","userPicId":"ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb","userPictures":{"small":"\/content\/u\/l\/d\/ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb_12.jpg","medium":"\/content\/u\/l\/d\/ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=ZVlQXBpaXMMqkVbgnzYy&c=a949f31628241f4fddef9f7da7609fc15067bb70","userLastVisited":""},{"userId":"GpgXMNmaxrrKzEdJzqRw","userName":"RWa99","userGender":1,"userAge":19,"userCity":"Bad Nauheim","userPicId":"h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip","userPictures":{"small":"\/content\/u\/h\/5\/h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip_12.jpg","medium":"\/content\/u\/h\/5\/h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmaxrrKzEdJzqRw&c=c7f302870f6139d66c4de0997ac49bad4a7c1708","userLastVisited":""},{"userId":"qoyVNXZdLRnpnRaPgYWv","userName":"malte99","userGender":1,"userAge":19,"userCity":"Gie\u00dfen","userPicId":"lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0","userPictures":{"small":"\/content\/u\/l\/m\/lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0_12.jpg","medium":"\/content\/u\/l\/m\/lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=qoyVNXZdLRnpnRaPgYWv&c=cae66604fa7aa6ea514e70d87a215dc43d764ca0","userLastVisited":""},{"userId":"NqDMnwpbpqqmDgdyJQPZ","userName":"MarcSchneider","userGender":1,"userAge":27,"userCity":"Wetzlar","userPicId":"bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne","userPictures":{"small":"\/content\/u\/b\/n\/bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne_12.jpg","medium":"\/content\/u\/b\/n\/bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpbpqqmDgdyJQPZ&c=2edb9524fa70168fe93ae247c3833b80e0e7fda4","userLastVisited":""},{"userId":"VWKqlByerzgqqjeNLYjZ","userName":"Erzwo93","userGender":1,"userAge":25,"userCity":"Weiterstadt","userPicId":"47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34","userPictures":{"small":"\/content\/u\/4\/7\/47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34_12.jpg","medium":"\/content\/u\/4\/7\/47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VWKqlByerzgqqjeNLYjZ&c=88acd872c5561d9c91427b4fbfc49bb7ff551e10","userLastVisited":""}],"count":199,"ts":"1559181753","settings":{"v":2}},"user":{"hasFavoritesOnline":false,"hasNewMessages":true,"hasNewNotifications":false,"hasNewHearts":false,"hasNewFeed":true,"hasProfilePic":false,"nickname":"sabhbau14","id_pic":"","gender":2,"id":"ogmJyDPalmEqPmbYEVRr","lastlogin":1559167342},"userSettings":{"bubbles":{"feed-visitors":0,"feed-visited":0,"feed-favorites":0,"info-gallery":0,"info-matching":0,"info-search":0,"info-mobile-likes":0,"info-mobile-search-custom":0,"info-mobile-search-newbies":0,"info-mobile-search-online":0,"info-mobile-favorites":0,"info-heart-sent":0,"deprecate-ie":1}},"context":"default","page":1,"pages_total":1,"userlist":[{"userId":"","userName":"vybz-kartel28","userGender":1,"userAge":26,"userCity":"Duisburg","userPicId":"wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj","userPictures":{"small":"\/content\/u\/w\/p\/wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj_12.jpg","medium":"\/content\/u\/w\/p\/wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=knjlBZmdwrLzvVbMxLpW&c=48e7012db31d2944b912f83ff24af9dbee8fd7c3","userLastVisited":""},{"userId":"","userName":"Hanni89","userGender":1,"userAge":29,"userCity":"Laatzen","userPicId":"xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q","userPictures":{"small":"\/content\/u\/x\/i\/xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q_12.jpg","medium":"\/content\/u\/x\/i\/xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywbnvvNVAbAXjpM&c=554a87e863f1b8f65a95a91575fed925e775dcca","userLastVisited":""},],"params":{"a1":"18","a2":"30","ct":"100006207","di":"200","g":"1","nm":"1","o":"1","pc":"1","ct_meta":{"id":"100006207","country":"de","city":"Paderborn","state":"Nordrhein-Westfalen","state_short":"NW","locality":"","id_zip_center":"7071","id_city_proxy":"100006207"}},"results_total":9,"max_per_page":30,"position":1,"getvars":{"ct":"100006207","g":"1","a1":"18","a2":"30","di":"200","ec":"","rx":"","sh":"","v1":"","hs":"","hc":"","h1":"","h2":"","ch":"","cp":"","ed":"","sm":"","zo":"","se":"","mo":"","o":"1","nm":"1","im":"","nn":""},"base_url":"\/Search","nopage_url":"\/Search\/?ct=100006207&g=1&a1=18&a2=30&di=200&ec=&rx=&sh=&v1=&hs=&hc=&h1=&h2=&ch=&cp=&ed=&sm=&zo=&se=&mo=&o=1&nm=1&im=&nn=&","msg":"few_results","countries":{"de":"Deutschland","at":"\u00d6sterreich","ch":"Schweiz","eg":"\u00c4gypten","gq":"\u00c4quartorialguinea","et":"\u00c4thiopien","af":"Afghanistan","al":"Albanien","dz":"Algerien","ad":"Andorra","ao":"Angola","ag":"Antigua und Barbuda","ar":"Argentinien","am":"Armenien","az":"Aserbeidschan","au":"Australien","bs":"Bahamas","bh":"Bahrein","bd":"Bangladesch","bb":"Barbados","by":"Belarus","be":"Belgien","bz":"Belize","bj":"Benin","bt":"Bhutan","bo":"Bolivien","ba":"Bosnien und Herzegowina","bw":"Botsuana","br":"Brasilien","bn":"Brunei","bg":"Bulgarien","bf":"Burkina Faso","bi":"Burundi","cl":"Chile","cn":"China","cr":"Costa Rica","ci":"Cote d'Ivoire","dk":"D\u00e4nemark","dm":"Dominica","do":"Dominikanische Republik","dj":"Dschibuti","ec":"Ecuador","sv":"El Salvador","er":"Eritrea","ee":"Estland","fo":"Far\u00f6er","fj":"Fidschi","fi":"Finnland","fr":"Frankreich","ga":"Gabun","gm":"Gambia","ge":"Georgien","gh":"Ghana","gi":"Gibraltar","gd":"Grenada","gr":"Griechenland","gb":"Gro\u00dfbritannien","gt":"Guatemala","gn":"Guinea","gw":"Guinea-Bissau","gy":"Guyana","ht":"Haiti","hn":"Honduras","hk":"Hongkong","in":"Indien","id":"Indonesien","iq":"Irak","ir":"Iran","ie":"Irland","is":"Island","il":"Israel","it":"Italien","jm":"Jamaika","jp":"Japan","ye":"Jemen","jo":"Jordanien","kh":"Kambodscha","cm":"Kamerun","ca":"Kanada","cv":"Kap Verde","kz":"Kasachstan","qa":"Katar","ke":"Kenia","kg":"Kirgisistan","ki":"Kiribati","co":"Kolumbien","km":"Komoren","cg":"Kongo (Republik)","cd":"Kongo Dem. Republik","kp":"Korea (Nord) Dem. Volksrep.","kr":"Korea (S\u00fcd) Republik","hr":"Kroatien","cu":"Kuba","kw":"Kuwait","la":"Laotische Dem. Volksrep.","ls":"Lesotho","lv":"Lettland","lb":"Libanon","lr":"Liberia","ly":"Libysch-Arabische Republik","li":"Liechtenstein","lt":"Litauen","lu":"Luxemburg","mo":"Macao","mg":"Madagaskar","mw":"Malawi","my":"Malaysia","mv":"Malediven","ml":"Mali","mt":"Malta","ma":"Marokko","mh":"Marshallinseln","mr":"Mauretanien","mu":"Mauritius","mk":"Mazedonien","mx":"Mexiko","fm":"Mikronesien","md":"Moldau","mc":"Monaco","mn":"Mongolei","me":"Montenegro","mz":"Mosambik","mm":"Myanmar","na":"Namibia","nr":"Nauru","np":"Nepal","nz":"Neuseeland","ni":"Nicaragua","nl":"Niederlande","ne":"Niger","ng":"Nigeria","nu":"Niue","mp":"N\u00f6rdliche Marianen","no":"Norwegen","om":"Oman","pk":"Pakistan","pw":"Palau","ps":"Pal\u00e4stina","pa":"Panama","pg":"Papua-Neuguinea","py":"Paraguay","pe":"Peru","ph":"Philippinen","pl":"Polen","pt":"Portugal","rw":"Ruanda","ro":"Rum\u00e4nien","ru":"Russische F\u00f6deration","sb":"Salomonen","zm":"Sambia","ws":"Samoa","sm":"San Marino","st":"Sao Tome und Principe","sa":"Saudi Arabien","se":"Schweden","sn":"Senegal","rs":"Serbien","sc":"Seychellen","sl":"Sierra Leone","zw":"Simbabwe","sg":"Singapur","sk":"Slowakische Republik","si":"Slowenien","so":"Somalia","es":"Spanien","lk":"Sri Lanka","kn":"St. Kitts und Nevis","lc":"St. Lucia","vc":"St. Vincent","sd":"Sudan","za":"S\u00fcdafrika","sr":"Suriname","sz":"Swasiland","sy":"Syrien","tj":"Tadschikistan","tw":"Taiwan","tz":"Tansania","tl":"Timor-Leste","th":"Thailand","tg":"Togo","to":"Tonga","tt":"Trinidad und Tobago","td":"Tschad","cz":"Tschechische Republik","tr":"T\u00fcrkei","tn":"Tunesien","tm":"Turkmenistan","tv":"Tuvalu","ug":"Uganda","ua":"Ukraine","hu":"Ungarn","uy":"Uruguay","us":"USA","uz":"Usbekistan","vu":"Vanuatu","va":"Vatikanstadt","ve":"Venezuela","ae":"Vereinigte Arab. Emirate","vn":"Vietnam","cf":"Zentralafrik. Republik"},"requestUri":"\/Search?ct=100006207&g=1&a1=18&a2=30&di=200&ec=&rx=&sh=&v1=&hs=&hc=&h1=&h2=&ch=&cp=&ed=&sm=&zo=&se=&mo=&o=1&nm=1&im=&nn=","bubble_search":"\n<div class=\"tooltip tt-scheme1 tt-size2\" id=\"bubbleExpireNotice\" style=\"margin: 10px 0 20px;\">\n <a href=\"javascript:void(0);\" class=\"tt-close\" data-closeaction=\"\/Ajax\/hideBubble\" data-closedata=\"info-search\" title=\"Diesen Hinweis nicht mehr anzeigen\"><\/a>\n <div class=\"tt-title tt-title-info\">Sie suchen \u2013 wir finden f\u00fcr Sie<\/div>\n <p>\n Wie stellen Sie sich Ihren Traumpartner vor? Wie alt, wie jung, wie gro\u00df? Nutzen Sie die umfangreichen\n M\u00f6glichkeiten der Partnersuche, und lassen Sie sich \u00fcberraschen.\n <\/p>\n<\/div>\n"},
};
(function() { var run = function()
```
how can I get string between <h3>window.DATA_STORE =</h3> and <h3>;(function() { var run = function()</h3> | <php><regex><preg-match> | 2019-05-30 04:34:18 | LQ_EDIT |
56,373,044 | Error in console: ng.probe is not a function | <p>Yesterday i update ng cli and core to 8.0.0v. After that successfully init a new app and run it. Once when app was build and served on localhost:4200 i open the console and there was a error: ng.probe is not a function</p>
<p>I tryed to research the issue but there was no relevant info about it.</p>
<p>Actual result:
After ng serve / npm start there is a issue in console: Uncaught TypeError: ng.probe is not a function.
<a href="https://user-images.githubusercontent.com/32274987/58589676-14960b80-826b-11e9-8c6d-adb1f141cef7.png" rel="noreferrer">Current console state</a>
<a href="https://user-images.githubusercontent.com/32274987/58589626-ff20e180-826a-11e9-8c0c-3f88aaefad6b.png" rel="noreferrer">Current angular state</a></p>
<p>Expected result:
No error in console</p>
| <javascript><angular> | 2019-05-30 06:43:31 | HQ |
56,374,023 | How create a regex for simpleDateFormat | <p>How to create a regex for simpledateformat with this pattern <code>yyyyMMdd_HHmmss</code> should I check only digits, can anyone write a valid regex for it, or is there a web site somewhere that generates a regex for this pattern, I need to check if a string contains a date, but sometimes the time is different, so I decided that it is good idea to checks if string contains a regex.</p>
| <java> | 2019-05-30 07:54:27 | LQ_CLOSE |
56,374,066 | Can anyone help to create Regular expression to extract a value from the string response | Please help to find the regular expression to extract the Value Tag
from the following response
<CustomFieldList><CustomField><Name>OFFER_META_DATA</Name><Value>SE7gOMOEOfvKjka8b+8k4SqccKEAB8ZjUqDl0Mv7OZeKEITd0l2rAFAL1XAxgzE8+lLt6XaR9IYDY0MmUaRfGXkiE/SOmYzMB+DccN2V1cOfsBav1BNaUsubTKW79qtXwwNcg4saeZZSqaiAVDJIFFUZq+u0UhqE6aZ2EbdwELyHZPP9HfHSRHCV9ihjlHvGHKRYdL2j4PvE5O5eg3ajmSTmI5aRAG42+epkCroTRDglUmCnHMTlA3VvSvtBV/fq9lI54JqqkSDj+83tKhclvZWPw08zu6drpp6PeZwmG1UwlmokLAwI0QCxYjnJEYwt7Ikt1sm8JqWzUPoVGHJoyw==%~~`%~~~~~~~%^**(%$#%ZWZby8uQ7CCjcQDbU7exlCDAXUeQ47bkD2kcxkobEQ9y1IBlPDpk7JEquCdxOnkKCRi9y8AswLegW98YyC+OAUoMCvN5XWYMJOmGK2gkj+5xzUbGZy9GS7ov4DQ+rPaHqvomADIKxXNw52ZSda/cwvfcUETGxi6yDcEgdIXj4abWQTNUGoSE34oHPNZ0CamHd1ZCZr36DqrIRXO595aTTAQX2E/ZUvoXnxT79ezoCOkt/xGOAEGKUjCUYYGnOAmHARf5t4aqK9Z+JhB8wVtT9KaD7xunGePjINmQrEYDeosEGrFyQ0OQWfwDyjQmA+GFbFRoabZgg3tkjCNCWEXI6Q==</Value></CustomField></CustomFieldList>
| <jmeter> | 2019-05-30 07:57:23 | LQ_EDIT |
56,376,321 | How to get string and two integer input in same line | string N M
where N M is index value . i want this input in same line
i have tried input().split() but it dsnt works
alphabets = input().split() ## what to do next | <python> | 2019-05-30 10:20:59 | LQ_EDIT |
56,376,461 | Remove a big list of of special characters | <p>I want to remove each of the following special characters from my documents: </p>
<pre><code>symbols = {`,~,!,@,#,$,%,^,&,*,(,),_,-,+,=,{,[,],},|,\,:,;,",<,,,>,.,?,/}
</code></pre>
<p>The reason why I am not simply doing something like this:</p>
<pre><code>document = re.sub(r'([^\s\w]|_)+', '', document)
</code></pre>
<p>is that in this way I remove also many (accented/special) letters in the case of documents written in languages such as Polish etc.</p>
<p>How can I remove each of the special characters above in one expression?</p>
| <python><regex> | 2019-05-30 10:30:18 | LQ_CLOSE |
56,376,831 | In which directory should i navigate to to kill the docker containers | I've read the command for docker kill .Now exactly how to stop
all container or kill the container
• Should i navigate the docker folder in program files in cmd
• Should i navigate to botium folder which i created for botium box in cmd
Which of the above 2 should i do .Currently i have docker desktop version
I | <docker><docker-compose> | 2019-05-30 10:51:45 | LQ_EDIT |
56,381,551 | Sorting an Vector of Objekts | I am new at C++. I want to sort an Vector "Konten" of type vector Konto.
I've searched for a soulution but when i try to compile my code i get the error message:
Fehler C2678 Binärer Operator "=": Es konnte kein Operator gefunden werden, der einen linksseitigen Operanden vom Typ "const Konto" akzeptiert (oder keine geeignete Konvertierung möglich) c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\algorithm 3835
```C++
//KontenManager.h
#pragma once
#include "Konto.h"
#include <vector>
class Kontenmanager
{
private:
vector<Konto> Konten;
public:
Kontenmanager();
~Kontenmanager();
string getKontenListe() const;
};
//Kontenmanager.cpp
#include "pch.h"
#include "Kontenmanager.h"
#include <sstream>
#include <algorithm>
#include <iomanip>
Kontenmanager::Kontenmanager()
{
}
Kontenmanager::~Kontenmanager()
{
}
string Kontenmanager::getKontenListe() const
{
stringstream out;
sort(Konten.begin(), Konten.end());
//do some stuff
}
//Konto.h
#pragma once
#include <string>
using namespace std;
class Konto
{
private:
const int kontoNr;
double saldo;
string inhaber;
int pin;
public:
Konto(int Kontonummer, string inhaber, int pin);
~Konto();
int getKontonummer() const;
};
bool operator<(const Konto &k1, const Konto &k2);
bool operator==(const Konto &k1, const Konto &k2);
//Konto.cpp
#include "pch.h"
#include "Konto.h"
Konto::Konto(int Kontonummer, string inhaber, int pin) :kontoNr(Kontonummer)
{
this->inhaber = inhaber;
this->pin = pin;
this->saldo = 0.0;
}
Konto::~Konto()
{
}
int Konto::getKontonummer() const
{
return kontoNr;
}
bool operator<(const Konto &k1, const Konto &k2)
{
return k1.getKontonummer() < k2.getKontonummer();
}
bool operator==(const Konto &k1, const Konto &k2)
{
return k1.getKontonummer() == k2.getKontonummer();
}
``` | <c++><sorting><object><vector> | 2019-05-30 15:49:48 | LQ_EDIT |
56,382,010 | Why does MS SQL allow you to create an illegal column? | <p>I recently saw a tweet stating that you could prevent other developers from reading from a table using the <code>SELECT * FROM TableName</code> by building your table in the following way:</p>
<pre><code>CREATE TABLE [TableName]
(
[ID] INT IDENTITY NOT NULL,
[Name] VARCHAR(50) NOT NULL,
[DontUseStar] AS (1 / 0)
);
</code></pre>
<p>It's easy to see that using the <code>SELECT *</code> here would try to read the blank column name as 1 divided by 0 (thus causing a divide by zero error), but without a datatype assigned to the column.</p>
<p>Why does SQL allow you to create a column with no assigned data type, with a name it knows will be illegal?</p>
| <sql><sql-server> | 2019-05-30 16:21:23 | HQ |
56,382,129 | std::map<string, int> crashes when doing m[0] | <p>The following crashes:</p>
<pre><code> std::map<std::string, int> m1{ {"0", 0}, { "1", 1 }};
// auto melem = m1["0"]; // OK
auto melem = m1[0];
</code></pre>
<p>Why is that?</p>
| <c++><c++11> | 2019-05-30 16:29:11 | LQ_CLOSE |
56,386,088 | Copy cell value between excel workbooks based on criteria | I have two excels workbooks, let's say, wb01 and wb02.
I need to synchronize them by copying some cell values from wb01 to wb02 based on a criteria: cell values for name and surname must be copied from wb01 to wb02 when Ids match.
**Example**
**wb01**
Id | name | surname | Dept
10 | John | McCoy | Logistics
21 | Liam | Alloy | Administration
40 | Peter | Gregor | Finance
42 | Albert | Kein | Business
50 | Kelly | Braxton | Logistics
60 | Isabella | O'Neill | Finance
**wb02**
Id | name | surname | ext.
10 | David | McCoy | 1004
23 | Bren | Summer | 1230
40 | George | Brown | 2400
42 | Astrid | Anderson | 3312
50 | Kelly | Braxton | 1139
51 | Evelyn | Connor | 4532
The changes go in one direction from wb01 to wb02 ONLY when Ids match.
Also if Id exists on wb01 but not in wb02, cell values for name and surname should be copied to wb02 as a new row and the rest of fields must be kept empty/blank in wb02.
After synchronize, wb02 must be as below:
Id | name | surname | ext.
10 | John | McCoy | 1004
21 | Liam | Alloy |
23 | Bren | Summer | 1230
40 | Peter | Gregor | 2400
42 | Albert | Kein | 3312
50 | Kelly | Braxton | 1139
51 | Evelyn | Connor | 4532
60 | Isabella | O'Neill |
I want synchronization to be ONLY done on demand when user clicks a button in a sheet on wb02. On button click it will execute a macro to start the synchronization process from wb01 to wb02.
| <excel><vba> | 2019-05-30 21:51:47 | LQ_EDIT |
56,386,378 | Having trouble working with SelectWoo instances of Select2 within WooCommerce | <p>I am using Select2 within WooCommerce in some of my own custom areas and I am targeting it with some code to add and removes certain classes and it's working fine; however the <a href="https://github.com/woocommerce/selectWoo" rel="noreferrer">SelectWoo</a> instances used by WooCommerce themselves are not working.</p>
<p>Example code:</p>
<pre><code>(function($) {
$('select').each(function(e) {
handleSelectSelections($(this));
});
})( jQuery );
function handleSelectSelections(select) {
var el = (select.next('.select2').length) ? jQuery(select.data('select2').$container) : select;
if (select.val() !== "" && select.val() !== null) {
el.addClass('has-selection');
} else {
el.removeClass('has-selection');
}
}
</code></pre>
<p>Everything works fine, except when it gets to the actual part where it adds the class it doesn't work - no class is added.</p>
<p>Am I missing something here?</p>
| <javascript><jquery><woocommerce><jquery-select2><jquery-select2-4> | 2019-05-30 22:25:03 | HQ |
56,387,023 | How to launch the Hufmman Algorithm Haskell code? | I have founded some code of Huffman algorithm, bud don't know how to launch this. Some functions are working: for ex:
a = freqList "lol"
build list a
But how I can take the Huffman code of this string? encode and encode' functions use Bits argument.
Original code with comments:https://gist.github.com/kirelagin/3886243
module Huffman where
import Control.Arrow
import Data.List
import qualified Data.Map as M
import Data.Function
class Eq a => Bits a where
zer :: a
one :: a
instance Bits Int where
zer = 0
one = 1
instance Bits Bool where
zer = False
one = True
type Codemap a = M.Map Char [a]
data HTree = Leaf Char Int
| Fork HTree HTree Int
deriving (Show)
weight :: HTree -> Int
weight (Leaf _ w) = w
weight (Fork _ _ w) = w
merge t1 t2 = Fork t1 t2 (weight t1 + weight t2)
freqList :: String -> [(Char, Int)]
freqList = M.toList . M.fromListWith (+) . map (flip (,) 1)
buildTree :: [(Char, Int)] -> HTree
buildTree = bld . map (uncurry Leaf) . sortBy (compare `on` snd)
where bld (t:[]) = t
bld (a:b:cs) = bld $ insertBy (compare `on` weight) (merge a b) cs
buildCodemap :: Bits a => HTree -> Codemap a
buildCodemap = M.fromList . buildCodelist
where buildCodelist (Leaf c w) = [(c, [])]
buildCodelist (Fork l r w) = map (addBit zer) (buildCodelist l) ++ map (addBit one) (buildCodelist r)
where addBit b = second (b :)
stringTree :: String -> HTree
stringTree = buildTree . freqList
stringCodemap :: Bits a => String -> Codemap a
stringCodemap = buildCodemap . stringTree
encode :: Bits a => Codemap a -> String -> [a]
encode m = concat . map (m M.!)
encode' :: Bits a => HTree -> String -> [a]
encode' t = encode $ buildCodemap t
decode :: Bits a => HTree -> [a] -> String
decode tree = dcd tree
where dcd (Leaf c _) [] = [c]
dcd (Leaf c _) bs = c : dcd tree bs
dcd (Fork l r _) (b:bs) = dcd (if b == zer then l else r) bs | <haskell><huffman-code> | 2019-05-30 23:52:53 | LQ_EDIT |
56,387,112 | I am making full stack app using react & node , how should I design my database (Schema) | How should I approach to schema design for my app ? What are the important points to remember when doing schema design & How should be different models in my node app relate to each other. Any explanation for simple CRUD App | <node.js><database><reactjs><mongodb><data-modeling> | 2019-05-31 00:10:33 | LQ_EDIT |
56,388,617 | Running xCode 10 on device error , help meeee | So I am a Primary Teacher with no coding experience but I would like to develop a simple app to help teach phonics in my class.
However, I have been trying to get builds to run on my device (iphone 6s plus ios 12.2). The simple app I made up said build suceeded on simulator but not the device. :< I can't fix that :<
Copy Swift standard libraries into /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app
Showing All Messages
CopySwiftLibs /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app (in target: GonativeIO)
cd /Users/macbook/Desktop/ios\ 2
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk
builtin-swiftStdLibTool --copy --verbose --sign 83FA19DF98CE2F83DBD4CABB58C1ADEE9F9E52CA --scan-executable /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/GonativeIO --scan-folder /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks --scan-folder /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/PlugIns --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Social.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Accounts.framework --scan-folder /Users/macbook/Desktop/ios\ 2/FBSDKShareKit.framework --scan-folder /Users/macbook/Desktop/ios\ 2/Bolts.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/SystemConfiguration.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Security.framework --scan-folder /Users/macbook/Desktop/ios\ 2/FBSDKLoginKit.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/QuartzCore.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/CoreLocation.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/CFNetwork.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/AudioToolbox.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/MessageUI.framework --scan-folder /Users/macbook/Desktop/ios\ 2/FBSDKCoreKit.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/CoreText.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/MediaAccessibility.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/CoreGraphics.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/UIKit.framework --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework --scan-folder /Users/macbook/Desktop/ios\ 2/OneSignal.framework --platform iphoneos --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --destination /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks --strip-bitcode --resource-destination /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app --resource-library libswiftRemoteMirror.dylib --strip-bitcode-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip --emit-dependency-info /Users/macbook/Desktop/Build/Intermediates.noindex/GoNativeIOS.build/Debug-iphoneos/GonativeIO.build/SwiftStdLibToolInputDependencies.dep
Requested Swift ABI version based on scanned binaries: unstable(7)
libswiftos.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib
libswiftDarwin.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftDarwin.dylib
libswiftCoreGraphics.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftCoreGraphics.dylib
libswiftObjectiveC.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftObjectiveC.dylib
libswiftUIKit.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftUIKit.dylib
libswiftMetal.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftMetal.dylib
libswiftSwiftOnoneSupport.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftSwiftOnoneSupport.dylib
libswiftFoundation.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftFoundation.dylib
libswiftDispatch.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftDispatch.dylib
libswiftCoreFoundation.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftCoreFoundation.dylib
libswiftCore.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftCore.dylib
libswiftCoreImage.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftCoreImage.dylib
libswiftQuartzCore.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftQuartzCore.dylib
libswiftRemoteMirror.dylib is up to date at /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/libswiftRemoteMirror.dylib
Probing signature of /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib
/usr/bin/codesign -r- --display /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib
/Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib: code object is not signed at all
Codesigning /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib
/usr/bin/codesign --force --sign 83FA19DF98CE2F83DBD4CABB58C1ADEE9F9E52CA --verbose /Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib
/Users/macbook/Desktop/Build/Products/Debug-iphoneos/GonativeIO.app/Frameworks/libswiftos.dylib: errSecInternalComponent
error: Failed with exit code 1 | <ios><code-signing> | 2019-05-31 04:16:41 | LQ_EDIT |
56,388,865 | Spring Security Configuration - HttpSecurity vs WebSecurity | <p>I just need to understand something in Spring Security Configuration. Using the example below...</p>
<pre><code>@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.httpBasic()
.and()
.authorizeRequests().antMatchers("/secret/**").authenticated()
.and()
.authorizeRequests().antMatchers("/**").permitAll();
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**");
}
}
</code></pre>
<p>What is the purpose of <code>configure(WebSecurity web)</code> method? </p>
<p>Can't I just add <code>/resources/**</code> in the <code>configure(HttpSecurity http)</code> method in this line <code>.authorizeRequests().antMatchers("/**", "/resources/**").permitAll();</code>
Shouldn't it work the same i.e. permitting all requests to <code>/resources/**</code> without any authentication?</p>
| <java><spring-boot><spring-security> | 2019-05-31 04:57:03 | HQ |
56,390,131 | How to substract some values in different line using awk? | I have a data that separated by "|". This date is occurs every 15th minutes. What I want to do is to substract this data and multiply it with 100 but it seems didn't work. Can someone help me. Thank you :)
bash-4.2$ cat kresna.txt
2019-05-29 16:48:01||196579|1637589633|0|109423435|101347165|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|111|1554983|1554990|0||0|6347782|0|0|0|0|||1637602667|8747|13287295146|283512|1636036853|38771|||326516100|101703893|145340456|6988739|224616616|107247291|7764|101598218|19745231|0
2019-05-29 17:03:01||197446|1637876915|0|109456309|101349847|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|0|111|1552437|1552441|0||0|6336110|0|0|0|0|||1637889948|8747|13290533845|283553|1636326689|38771|||326591972|101734973|145373623|6990480|224660545|107268556|7764|101629298|19748302|0
awk -F "|" '{if(NR>1){print (1 - ($45+$47+$49-_m) / ($44+$46+$48-_n) *100)};_n=$44+$46+$48;_m=$45+$47+$49}' kresna.txt
0.998926
That expected output is to e 99.98 | <unix><awk> | 2019-05-31 06:55:14 | LQ_EDIT |
56,390,688 | Object of ‘NoneType’ has no len() - error | <pre><code>z=[]
while len(z)<8:
z=z.append(1)
</code></pre>
<p>This programmes says error in the line where the while loop is. The error is mentioned in the title. What should I do ?</p>
| <python><python-3.x><error-handling> | 2019-05-31 07:35:13 | LQ_CLOSE |
56,391,303 | error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8 ::NonCopyablePersistentTraits<T>> | <p>I recently upgraded my <code>nodejs</code> to <code>v12.3.1</code>, and now when I try to run <code>npm install</code> in my project repository, I am getting the preceding errors. </p>
<pre><code>error C2059: syntax error: ')' (compiling source file ..\src\custo
m_importer_bridge.cpp)
error C2660: 'v8::StringObject::New': function does not take 1 arg
uments (compiling source file ..\src\sass_context_wrapper.cpp)
node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v
8::NonCopyablePersistentTraits<T>>'
</code></pre>
<p><strong>Things I have tried</strong></p>
<ul>
<li>Deleted the node_modules folder and run <code>npm install</code></li>
<li>Closed vscode and open the solution again</li>
<li>update npm to the latest</li>
</ul>
<p>Anyone else are facing the same issue with <code>v12.3.1</code>?</p>
| <node.js><angular><npm><visual-studio-code> | 2019-05-31 08:20:36 | HQ |
56,391,918 | Where I must contain business logic of my application? | <p>After read a lot of articles about right architecture application, I still have a question: where app business logic must contains?
Becouse someone told, that logic must contains in models (skinny controllers), another said that models must contain only Database operations logic. </p>
<p>For example:</p>
<p>In my project (online shop) I have a products filter, that used in CategoryController and filtered by Products and Parameters table. So it's not a controller and not a model. I solved it by creation of new directory named Filters (yes, there are few different filters), and contain all logic there.
But i dont know is it right solution? I think not, but I dont know how to build it correctly.</p>
<p>So here is my questions:</p>
<ol>
<li>Did i do the right thing?</li>
<li>Where I must contain business logic?</li>
</ol>
<p>Thanks and have a nice day!</p>
<p>P.s
Sorry for my english.</p>
| <php><laravel><architecture><business-logic> | 2019-05-31 09:03:43 | LQ_CLOSE |
56,392,188 | Conversion of String to integer,then again to string | I am on a project developing an app on android. Here I have to find a sum between two numbers defined as Strings and then display them on a textview. But my app is crashing.Below is my code. Is it optimal? Please Help me I have to submit it as soon as possible.
String price=Place_View.prices[spinner1.getSelectedItemPosition()];
String fare=Cars.SUVFare[spinner2.getSelectedItemPosition()];
String result="";
int calc1=Integer.parseInt(price);
int calc2=Integer.parseInt(fare);
int calc3=calc1+calc2;
result=Integer.toString(calc3);
Price.setText(result);
}
}); | <java><android><string><integer> | 2019-05-31 09:20:15 | LQ_EDIT |
56,393,207 | remove match word from file |LINUX| | **HOW DO I REMOVE THE WORD FROM A FILE IF MATCH IS FOUND IN THE FILE**
The Data in the File1.txt is
Raj cmd
Rahul cmd
Pooja cmd
Vilas cmd
Vikram cmd
I want the Output to be Printed like this below
Raj
Rahul
Pooja
Vilas
Vikram
**The Word I want to remove is "cmd"** | <linux><bash> | 2019-05-31 10:19:33 | LQ_EDIT |
56,394,048 | How to change the position of the object when the window size is changed? | <p>As in the title. I would like objects moving on the board to change position propositionally to change the size of the window. How to do it?</p>
| <java><object><position> | 2019-05-31 11:14:53 | LQ_CLOSE |
56,394,864 | regular expression to allow at least one dot and all character | Could any of you help me with a regular expression which will accept these:
ex1: nagarjuna.nag@vm.com
ex2 :nagarjuna12.nag@vm.com | <regex><validation><email><regex-lookarounds><regex-group> | 2019-05-31 12:09:38 | LQ_EDIT |
56,395,188 | Why does HttpClient appear to hang without .Result? | <p>I have this code to call an API which returns a token. However, it will only return if I replace this line:</p>
<pre><code>var response = await TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent);
</code></pre>
<p>with this line:</p>
<pre><code>var response = TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent).Result;
</code></pre>
<p>Why?</p>
<pre><code>public static async Task<Token> GetAPIToken()
{
if (DateTime.Now < Token.Expiry)
return Token;
TokenClient.DefaultRequestHeaders.Clear();
TokenClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
TokenClient.BaseAddress = new Uri(EnvironmentHelper.BaseUrl);
TokenClient.Timeout = TimeSpan.FromSeconds(3);
var formContent = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("grant_type", "client_credentials"),
new KeyValuePair<string, string>("client_id", EnvironmentHelper.APITokenClientId),
new KeyValuePair<string, string>("client_secret", EnvironmentHelper.APITokenClientSecret)
});
try
{
// HANGS - this next line will only ever return if suffixed with '.Result'
var response = await TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent);
var content = await response.Content.ReadAsStringAsync();
dynamic jsonContent = JsonConvert.DeserializeObject(content);
Token token = new Token();
token.AccessToken = jsonContent.access_token;
token.Type = jsonContent.token_type;
token.Expiry = DateTimeOffset.Now.AddSeconds(Convert.ToDouble(jsonContent.expires_in.ToString()) - 30);
token.Scope = Convert.ToString(jsonContent.scope).Split(' ');
Token = token;
}
catch (Exception ex)
{
var m = ex.Message;
}
return Token;
}
</code></pre>
| <c#><async-await><httpclient><.net-4.6.1> | 2019-05-31 12:30:39 | LQ_CLOSE |
56,395,400 | convert a key value pair into 2 different objects | <p><strong>Let me explain here</strong></p>
<pre><code>let obj = {manager:XYZ}
//output:[{position:"manager",name:"XYZ"}]
</code></pre>
<p><em>you can also use lodash to find the solution</em></p>
| <javascript><typescript> | 2019-05-31 12:47:15 | LQ_CLOSE |
56,396,822 | "pip install selenium" not working // using python 3 // windows 10 | <p>I cannot install selenium. I have python 3.7 and window 10.</p>
<p>These are some of the things i have tried and the outcome: </p>
<p>C:\Users\dani>pip install selenium
'pip' is not recognized as an internal or external command,
operable program or batch file.</p>
<p>C:\Users\dani>sudo pip install selenium
'sudo' is not recognized as an internal or external command,
operable program or batch file.</p>
<p>C:\Users\dani>pip3 install selenium
'pip3' is not recognized as an internal or external command,
operable program or batch file.</p>
<p>C:\Users\dani>conda install selenium
'conda' is not recognized as an internal or external command,
operable program or batch file.</p>
<p>C:\Users\dani>pip install -U selenium
'pip' is not recognized as an internal or external command,
operable program or batch file.</p>
| <python><python-3.x><selenium><cmd><pip> | 2019-05-31 14:19:39 | LQ_CLOSE |
56,396,877 | Invert shift operation | Is it possible to invert a shift operation of a base two variable without using a dedicated function? I am looking for the variable y. x and z are known.
Example:
x << y = z
1 << 7 = 64
y = 64 ???
There are many solutions including log(64)/log(2), but therefore I would have to use math.h, however I am looking for some sort of bitwise operation.
Thank you. | <c><bit-shift> | 2019-05-31 14:23:36 | LQ_EDIT |
56,397,022 | C: Add numbers to filename | I want to store data in different files. Therefore I want to create files as follows: `data_1.log`, `data_2.log`, ..., `data_N.log`. The appendix `.log` is not necessary but would be nice. All my approaches failed so far. Here is one sample that is probably close to what I need:
#include <stdio.h>
#include <string.h>
char get_file_name(int k){
int i, j;
char s1[100] = "logs/data_";
char s2[100];
snprintf(s2, 100, "%d", k);
for(i = 0; s1[i] != '\0'; ++i);
for(j = 0; s2[j] != '\0'; ++j, ++i){
s1[i] = s2[j];
}
s1[i] = '\0';
return s1;
}
int main(){
char file_name[100];
for(int k=0; k<10; k++){
// Get data
// ...
// Create filename
strcpy(file_name, get_file_name(k));
printf("%s", file_name);
fp = fopen(file_name, "w+");
// Write data to file
print_results_to_file();
fclose(fp);
}
return 0;
}
At the moment I get the following errors which I don't understand:
string.c: In function ‘get_file_name’:
string.c:14:12: warning: returning ‘char *’ from a function with return type ‘char’ makes integer from pointer without a cast [-Wint-conversion]
return s1;
^~
string.c:14:12: warning: function returns address of local variable [-Wreturn-local-addr]
string.c: In function ‘main’:
string.c:24:27: warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
strcpy(file_name, get_file_name(k));
^~~~~~~~~~~~~~~~
In file included from string.c:2:
/usr/include/string.h:121:14: note: expected ‘const char * restrict’ but argument is of type ‘char’
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
string.c:29:9: warning: implicit declaration of function ‘print_results_to_file’ [-Wimplicit-function-declaration]
print_results_to_file();
^~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccZDRebi.o: in function `main':
string.c:(.text+0x190): undefined reference to `print_results_to_file'
collect2: error: ld returned 1 exit status
Is there a more simpler way to create such filenames? I can't believe that there isn't one. | <c><string><scope><undefined-behavior> | 2019-05-31 14:32:31 | LQ_EDIT |
56,397,191 | How to verify if a IP address is valid on Java? | <p>I want to verify an IP address in java, how can I do that?
The IP Address needs to be in this format: xxx.xxx.xxx.xxx
Each octet range must be 0 ~ 255.</p>
<p>Since the IP is verified, the code must show a message telling that the IP is valid or not. If not, the user must type the IP again.</p>
<p>I've done the method to convert an IP string to an array of integers so far...</p>
<pre class="lang-java prettyprint-override"><code>
public static void verify() {
Scanner input = new Scanner(System.in);
System.out.println("IP: (xxx.xxx.xxx.xxx)");
String ipAddress = input.nextLine();
int[] arrayIpAddress = Arrays.stream(ipAddress.split("\\.")).mapToInt(Integer::parseInt).toArray();
}
</code></pre>
| <java><ip> | 2019-05-31 14:43:33 | LQ_CLOSE |
56,398,140 | Why are generics needed when we can do casting to Object class? | <p>We have generics in java using which we can generalize a class.
I know that Object class is the parent class of every class.</p>
<p>When I can typecast to and from Object then why generics are needed?</p>
<pre><code>class Response<T>{
T data;
}
</code></pre>
<pre><code>class Response{
Object data;
}
</code></pre>
<p>Both of the above code snippets will work the same way.</p>
| <java><object><generics> | 2019-05-31 15:45:37 | LQ_CLOSE |
56,398,311 | How to notify an object that an event of another object? Java | <p>I have a Java class, named Main, which instances several classes with name Subscriber. Subscriber obtains data from the internet and when it obtains a new data it stores it in a variable. When a new data is saved I want it to notify Main, or that it detects it. How could I do it?</p>
<p>I have thought about using the Observer pattern but in my case I have an observer and many observed</p>
| <java><notify> | 2019-05-31 15:56:59 | LQ_CLOSE |
56,398,742 | eslint throws `no-undef` errors when linting Jest test files | <p>I'm using Jest to write some specs and ESLint to lint the styling. </p>
<p>For my <code>foo.spec.js</code> tests, eslint keeps throwing the following errors. It seems to think that <code>jest</code>, <code>beforeEach</code>, <code>afterEach</code>, etc... are not defined in that file. </p>
<pre><code> 11:1 error 'beforeEach' is not defined no-undef
12:3 error 'jest' is not defined no-undef
14:13 error 'jest' is not defined no-undef
18:1 error 'afterEach' is not defined no-undef
20:1 error 'describe' is not defined no-undef
21:3 error 'it' is not defined no-undef
25:5 error 'expect' is not defined no-undef
28:5 error 'expect' is not defined no-undef
31:5 error 'expect' is not defined no-undef
34:3 error 'it' is not defined no-undef
38:5 error 'expect' is not defined no-undef
41:5 error 'jest' is not defined no-undef
42:5 error 'expect' is not defined no-undef
43:5 error 'expect' is not defined no-undef
46:3 error 'it' is not defined no-undef
54:5 error 'expect' is not defined no-undef
58:5 error 'jest' is not defined no-undef
</code></pre>
<p>I believe those are included by jest automatically and so they don't need to be explicitly imported in my spec files. In fact the only thing I import via my <code>jest.setup.js</code> file is</p>
<pre><code>import "react-testing-library/cleanup-after-each";
import "jest-dom/extend-expect";
</code></pre>
<p>Is there a way to eliminate these errors without having to disable eslint rules at the top of each individual file or inline? </p>
<p>Thanks!</p>
| <javascript><unit-testing><jestjs><eslint> | 2019-05-31 16:30:06 | HQ |
56,402,357 | Questions about the order of execution of this code snippet | <p>So I been reading a tutorial about Javascript promises these days.</p>
<p>here is an example from it used to explain the macrotask queue(i.e. the event loop) and the microtask queue.</p>
<pre><code>let promise = Promise.reject(new Error("Promise Failed!"));
promise.catch(err => alert('caught'));
// no error, all quiet
window.addEventListener('unhandledrejection', event => alert(event.reason));
</code></pre>
<p>It says that because <code>promise.catch</code> catches the error so the last line, the event handler never gets to run. I can understand this. But then he tweaked this example a little bit.</p>
<pre><code>let promise = Promise.reject(new Error("Promise Failed!"));
setTimeout(() => promise.catch(err => alert('caught')));
// Error: Promise Failed!
window.addEventListener('unhandledrejection', event => alert(event.reason));
</code></pre>
<p>This time he says the event handler is gonna run first and catch the error and <strong>after</strong> this the <code>promise.catch</code> catches the error eventually.</p>
<p>What I do not understand about the second example is, why did the event handler run before the <code>promise.catch</code>? </p>
<p>My understanding is,</p>
<ol>
<li>Line one, we first encounter a promise, and we put it on the microtask queue.</li>
<li>Line two, we have a <code>setTimeout</code>, we put it on the macrotask queue,</li>
<li>Line three, we have an event handler, and we put the handler on the macrotask queue waiting to be fired</li>
</ol>
<p>Then, because microtask has higher priority than macrotask. We run the promise first. After it, we dequeue the first task on macrotask queue, which is the <code>setTimeout</code>. So from my understanding, the error should be caught by the function inside <code>setTimeout</code>.</p>
<p>Please correct me.</p>
| <javascript><event-loop> | 2019-05-31 22:30:29 | HQ |
56,403,247 | Excel - VBA - SQL Server - ADO - XML Parsing (Performance Problems) | Before anything, let me state that I'm stuck with the current stack that I'm using and I'm currently not able to transition to something else. Rather than letting me know that I should be using other stuff, I can't... so let's skip that.
**My users are mostly the following:**
- Excel 16.0, 64 Bit.
- Windows 7, 10
- Ram: Min(4 GB) - Max(8 GB)
- CPU: i5 to i7 (I'm running i7-3770 @ 3.4GHz)
**Basics:**
- The Excel Application that I've developed for internal company use uses ADO to talk w/ SQLServer.
- Currently, the entire query system is built to work with only 1 Recordset being returned at a time (If the only solution is to get multiple Recordsets back and work with those, it will require a good size rewrite to the core of the system)
**The Non-Basics:**
- The system is currently able to import 500 MB files into SQLServer in a minute or two by chunking queries into 100k row chunks and that works pretty well.
- When getting data from SQLServer, I have two different styles:
* Standard 2-D Recordset (extremely performant)
* A Recordset that contains a single String value of XML (unparsed) with the following std format:
```
<root>
<*page*>
<row>
<*column*></*column*>
</row>
</*page*>
</root>
```
Example output:
```
<root>
<tab_awesome>
<row>
<col1>Value 1</col1>
<col2>Value 2</col2>
</row>
</tab_awesome>
</root>
```
I then take this XML and currently load the String value from the Recordset using MSXML's "Load" method. After loading and doing some validation, I'll transform the XML into this standard Dictionary structure that exports to [N] tabs and whatnot.
```
{
"page_count": 1,
"page_names": ["tab_awesome"],
"pages": {
"tab_awesome": {
"page_name": "tab_awesome",
"row_count": 1,
"column_count": 2,
"column_names": ["col1", "col2"]
"data": [["Value 1", "Value 2"]]
}
}
}
```
***The Problem:***
- We have a number of Sprocs that return their results using the String XML... and when parsed contain multiple tabs of +100k rows per tab. Some Sprocs will return +1,000,000 records with +20 fields (all tabs are included in the count).
- My current problem is a Sproc for Amortizing. It's returning a string that's roughly 208 MB in size.
* Receiving the data over the network takes a few seconds
* Parsing of the String to XML using MSXML takes *3m35s* and the bossman wants it to go faster.
My thoughts:
- Possible to use Sax?
- Can I transport an XML Document from SQLServer though ADO so I don't need to Load it from the string form?
- xmllite.dll? (I see Rubberduck uses this. Matt, how's the performance & by chance, have the bindings for VBA?)
- Last resort, I'll rewrite my application's underlying query engine to handle multiple ADO Recordsets to deal with multiple tabs of data. If I do this, how do I get a single Sproc to return multiple Recordsets?
*I'm stuck using API calls to windows and VBA.*
hmm... one thing that is possible is to return each Tab as another row in the Recordset (still string XML). For each row, create a new process of Excel, parse/load that tab's information, send the XML back to the main process, close those helper instances of Excel... idk...
Thanks for the help. | <sql-server><excel><xml><vba><ado> | 2019-06-01 01:33:59 | LQ_EDIT |
56,404,343 | How to calculate profit formula with multiple user input text in swift4 | So im traying to make a simple calculation formula , but I don't know how to add all the variables simultaneously.
I already tried this but is giving an error and is being supper inaccurate.
var fee :Int = Int(0.866)
var otherFee:Int = Int(0.30)
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func calculateProfit(_ sender: Any) {
let sold = Int(soldTextField.text!)!
let paid = Int(paidTextField.text!)!
let shipping = Int(shippingTextField.text!)!
profitTotal.text = String(sold * fee - otherFee - paid - shipping )
}
}
I spect that when I hit the button it will multiply ,subtract, subtract simultaneous. | <ios><swift> | 2019-06-01 06:19:12 | LQ_EDIT |
56,405,041 | Print the number of subarrays in an array having negative sum | <pre><code>import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int n=scan.nextInt(); //taking input number of elements in the array
int[] a=new int[n];
for(int i=0;i<n;i++){
a[i]=scan.nextInt(); //taking input elements of the array
}
int count=0;
//start point
for(int i=0;i<n;i++){
//end point
for(int j=i;j<n;j++){
for(int k=i;k<=j;k++){
int sum=0;
sum+=a[k]; //calculating the sum of subarray
if(sum<0)
count++;
}
}
}
System.out.println(count); //printing the no of negative sums
}
}
</code></pre>
<p>Here there are three nested loops first loop defines the starting position second loop defines the ending position and third loop is for iterating over the elements of the subsrray and calculating their sums and if the sum is less than zero then increment the count.But with this code I am getting wrong answer.</p>
| <java><arrays><nested-loops> | 2019-06-01 08:22:23 | LQ_CLOSE |
56,405,497 | pgAdmin 4.7 displays blank popup screen on startup | <p>I've just installed latest pgAdmin (4.7) and whenever I start it up I get this strange blank popup which I can not remove:
<a href="https://i.stack.imgur.com/RbxAP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RbxAP.png" alt="enter image description here"></a></p>
<p>I can use the application just fine I just need to move that empty window to the side which is annoying.
I'm using Firefox version 67 (64bit).</p>
| <pgadmin-4> | 2019-06-01 09:32:34 | HQ |
56,405,574 | how can i arrange array like this | <p>I have array like below:</p>
<p>$matrix = array(1, 2, 1,1, 2, 1,1, 1, 1);</p>
<p>how can I get array like below?</p>
<pre><code>//OUTPUT:
minesweeper(matrix) = [[1, 2, 1],
[2, 1, 1],
[1, 1, 1]]
</code></pre>
| <php><arrays><minesweeper> | 2019-06-01 09:44:19 | LQ_CLOSE |
56,406,309 | Why does Angular show result from successfull http post request as "undefined" | <p>I'm developing a MEAN stack app on Windows10 environment, using Mongoose (v4.4.5) to connect to MongoDB. One of the http post requests in my code executes successfully and writes to MongoDB. But the response returned from the post request shows up as "undefined" on the angular side (in the browser console). This doesn't happen all the time though. There are times when the response actually shows exactly what was written to MongoDB (which is what I'd expect to see all the time). Code shown below:</p>
<p>Angular component code:</p>
<pre><code>import { Component, OnInit, ViewChildren, Renderer2 } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { Validators } from '@angular/forms';
import { contactUsInterface } from '../../models/contact-us';
import { HttpClient } from '@angular/common/http';
import { ContactUsService } from '../../services/contact-us.service';
import { ErrorMessageService } from '../../services/error-message.service';
import { Observable } from 'rxjs';
@Component({
selector: 'app-contact-us',
templateUrl: './contact-us.component.html',
styleUrls: ['./contact-us.component.css'],
})
export class ContactUsComponent implements OnInit {
contactUsForm = new FormGroup({
subject: new FormControl(''),
message: new FormControl('', Validators.required),
senderEmail: new FormControl('', [Validators.required, Validators.email]),
});
messageFromUser: contactUsInterface;
response: any;
successMessage = "Message successfully sent";
displayMessage = this.successMessage;
isVisible = "invisible"; //used for successMessage after on submitting form
submitted = false;
invalidControlArray = [];
@ViewChildren("formControl") varInputBoxes;
constructor(private renderer: Renderer2,
private contactUsService: ContactUsService,
private errorMessageService: ErrorMessageService) {}
ngOnInit() {}
onSubmit(){
this.submitted = true;
if(this.contactUsForm.valid){
this.messageFromUser = {
subject: this.contactUsForm.value['subject'],
message: this.contactUsForm.value['message'],
senderEmail: this.contactUsForm.value['senderEmail'],
};
this.saveMessage();
}
};
saveMessage(){
this.contactUsService.addMessage(this.messageFromUser)
.subscribe((data: contactUsInterface) => {this.response = {...data},
error => this.displayMessage = this.errorMessageService.convertErrorToMessage(error, this.successMessage)});
//This is where the problem occurs. "this.resopnse" below shows "undefined"
console.log('Response: ', this.response);
};
get message() { return this.contactUsForm.get('message'); }
get senderEmail() { return this.contactUsForm.get('senderEmail'); }
}
</code></pre>
<p>Angular service code which has the addMessage function called above by saveMessage():</p>
<pre><code>import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpErrorResponse, HttpResponse } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { catchError, map, tap, retry } from 'rxjs/operators';
import { contactUsInterface } from '../models/contact-us';
@Injectable({
providedIn: 'root'
})
export class ContactUsService {
private url = '/api/contactus';
private result: any;
message: string;
addMessage(messageFromUser: contactUsInterface): Observable<contactUsInterface> {
return this.http.post<contactUsInterface>(this.url, messageFromUser)
.pipe(retry(0));
};
constructor(private http: HttpClient) { }
};
</code></pre>
<p>Express code which listens to the http request:</p>
<pre><code>var express = require('express');
var router = express.Router();
var contactUsMessage = require('../models/contact_us_message');
router.route('/')
.get(function(req,res,next){
res.send(req)
})
.post(function(req,res,next){
contactUsMessage.create(
req.body, function(err,result){
if (err) {
next(err);
} else {
res.send(result);
}
}
)
})
module.exports = router;
</code></pre>
<p>I would have expected that when the express code writes to MongoDB (this part works) and returns "result", that result is what gets returned by addMessage (in the Angular service code) and is assigned to "response" in the Angular component. But that's not how it appears to work.</p>
| <javascript><angular><express><mongoose> | 2019-06-01 11:28:27 | LQ_CLOSE |
56,406,840 | calculate array values by key | <p>i have a array problem can i calculate same integer value.
my example arrays on the bottom please </p>
<pre><code>int = -21;
</code></pre>
<hr>
<p>my first array</p>
<blockquote>
<pre><code>Array
(
[580] => 13.000000
[582] => 8.000000
[485] => 7.000000
)
</code></pre>
</blockquote>
<p>and i need is algoritm</p>
<pre><code>Array
(
[580] => 13.000000+int // sum -8
[582] => 8.000000+(-8) // 0
[485] => 7.000000
)
</code></pre>
<p>after result</p>
<pre><code>Array
(
[580] => 8
[582] => 0
[485] => 7.000000
)
</code></pre>
| <php><arrays> | 2019-06-01 12:40:26 | LQ_CLOSE |
56,407,294 | How can I instantiate a lambda closure type in C++11/14? | <p>I'm <a href="https://stackoverflow.com/questions/55708180/lambda-closure-type-constructors">aware</a> that there's no default constructor for lambda closure type. But does that mean it's impossible to instantiate it after it being passed as a template parameter?</p>
<p>Consider the following <a href="https://ideone.com/QnPYL8" rel="noreferrer">minimal example</a>:</p>
<pre><code>#include <iostream>
template <typename FuncType>
std::pair<int,int> DoSomething() {
return FuncType()(std::make_pair(1,1));
}
int main() {
auto myLambda = [](std::pair<int,int> x) {
return std::make_pair(x.first*2,x.second*2);
};
std::pair<int,int> res = DoSomething<decltype(myLambda)>();
return 0;
}
</code></pre>
<p>For performance reasons, <a href="https://stackoverflow.com/questions/5057382/what-is-the-performance-overhead-of-stdfunction">I can't use <code>std::function</code></a> to avoid virtual pointer calls. Is there a way to do this? I need to instantiate that lambda once and use it many times inside that function. </p>
<p>How does the standard library make it work when <code>decltype(myLambda)</code> is passed to something like <code>std::map</code> comparators in the template parameter?</p>
| <c++><performance><lambda><closures><c++14> | 2019-06-01 13:43:35 | HQ |
56,408,568 | unable to create an MxGraph from the XML provided | <p>It's a React project and I am trying to convert XML to MxGraph.</p>
<p>PFB :- the code that I have</p>
<pre><code>import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import {
mxGraph,
mxRubberband,
mxKeyHandler,
mxClient,
mxUtils,
mxEvent
} from 'mxgraph-js'
// import axios from 'axios'
import parser from 'fast-xml-parser'
import '../../common.css'
import '../../mxgraph.css'
class mxGraphGridAreaEditor extends Component {
constructor (props) {
super(props)
this.state = {
graph: {},
layout: {},
json: '',
dragElt: null,
createVisile: false,
currentNode: null,
currentTask: ''
}
this.LoadGraph = this.LoadGraph.bind(this)
}
componentDidMount () {
const xml = `<mxGraphModel dx='2221' dy='774' grid='1' gridSize='10' guides='1' tooltips='1' connect='1' arrows='1' fold='1' page='1' pageScale='1' pageWidth='827' pageHeight='1169' math='0' shadow='0'>
<root>
<mxCell id='0'/>
<mxCell id='1' parent='0'/>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-7' value='&lt;b style=&quot;font-size: 20px;&quot;&gt;Scorecard&lt;/b&gt;'
style='rounded=0;whiteSpace=wrap;html=1;fillColor=#E6E6E6;fontSize=20;verticalAlign=top;strokeColor=none;' parent='1' vertex='1'>
<mxGeometry x='-230' y='10' width='240' height='800' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-1' value='KPA' style='rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=1;strokeColor=none;fontSize=20;fillColor=#CCCCCC;' parent='1' vertex='1'>
<mxGeometry x='10' y='10' width='240' height='800' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-2' value='&lt;b style=&quot;font-size: 20px;&quot;&gt;Domain&lt;/b&gt;' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#E6E6E6;fontSize=20;verticalAlign=top;strokeColor=none;' parent='1' vertex='1'>
<mxGeometry x='250' y='10' width='240' height='800' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-3' value='Cluster' style='rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=1;strokeColor=none;fontSize=20;fillColor=#CCCCCC;' parent='1' vertex='1'>
<mxGeometry x='490' y='10' width='240' height='800' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-4' value='&lt;b style=&quot;font-size: 20px;&quot;&gt;KPI&lt;/b&gt;' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#E6E6E6;fontSize=20;verticalAlign=top;strokeColor=none;' parent='1' vertex='1'>
<mxGeometry x='730' y='10' width='240' height='800' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-15' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-13' target='y3w0JNk_32n-TRd_Wrkm-5' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='-160' y='450' as='sourcePoint'/>
<mxPoint x='-110' y='400' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-19' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-16' target='y3w0JNk_32n-TRd_Wrkm-13' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='40' y='297.5' as='sourcePoint'/>
<mxPoint y='297.5' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-26' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-20' target='y3w0JNk_32n-TRd_Wrkm-16' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='280' y='297.5' as='sourcePoint'/>
<mxPoint x='240' y='297.5' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-27' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-23' target='y3w0JNk_32n-TRd_Wrkm-16' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='520' y='189.79310344827593' as='sourcePoint'/>
<mxPoint x='480' y='297.37931034482756' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-38' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-34' target='y3w0JNk_32n-TRd_Wrkm-20' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='280' y='297.5' as='sourcePoint'/>
<mxPoint x='240' y='297.5' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-48' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-40' target='y3w0JNk_32n-TRd_Wrkm-23' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='520' y='402.2068965517242' as='sourcePoint'/>
<mxPoint x='480' y='297.37931034482756' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-49' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-43' target='y3w0JNk_32n-TRd_Wrkm-23' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='530' y='412.2068965517242' as='sourcePoint'/>
<mxPoint x='490' y='307.37931034482756' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-50' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='750' y='440' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-43' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-50' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-44' value='End To End Fault Handling Effectiveness S2' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-50' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-45' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 19 762&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;19.8%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-50' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-51' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='750' y='247.5' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-40' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-51' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-41' value='End To End Fault Handling Effectiveness S1' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-51' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-42' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 15 544&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;15.5%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-51' vertex='1'>
<mxGeometry x='10' y='65.5' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-52' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='510' y='344' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-23' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-52' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-24' value='Fault Management' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-52' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-25' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 35&lt;/span&gt;&lt;span&gt;&amp;nbsp;306&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;35.3%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-52' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-53' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='750' y='58' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-34' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-53' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-35' value='Reporting Effectiveness' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-53' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-36' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 19 500&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;19.5%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-53' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-54' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='510' y='58' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-20' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-54' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-21' value='Reporting' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-54' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-22' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 19 500&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;19.5%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-54' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-55' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='270' y='201' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-16' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-55' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-17' value='Common' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-55' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-18' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R&amp;nbsp;&lt;/span&gt;&lt;span&gt;54 806&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;54.8%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-55' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-56' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='30' y='420' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-13' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-56' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-14' value='Process' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-56' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-11' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R&amp;nbsp;&lt;/span&gt;&lt;span&gt;54 806&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;54.8%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-56' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-57' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='-210' y='419.99999999999994' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-5' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-57' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-6' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R&amp;nbsp;&lt;/span&gt;&lt;span&gt;54 806&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;54.8%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-57' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-12' value='Huawei RAN and Transmission O&amp;amp;M' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-57' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-62' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='750' y='640' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-59' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-62' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-60' value='Network Monitoring Effectiveness' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-62' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-61' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 0&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;0.0%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-62' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-68' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-59' target='y3w0JNk_32n-TRd_Wrkm-65' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='760' y='522.5' as='sourcePoint'/>
<mxPoint x='720' y='426.66666666666674' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-73' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='510' y='640' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-65' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-73' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-66' value='Supervision' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-73' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-67' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 0&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;0.0%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-73' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-74' value='' style='group' parent='1' vertex='1' connectable='0'>
<mxGeometry x='270' y='640' width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-70' value='' style='rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;fontSize=15;strokeWidth=2;verticalAlign=top;fontStyle=1' parent='y3w0JNk_32n-TRd_Wrkm-74' vertex='1'>
<mxGeometry width='200' height='145' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-71' value='Front Office' style='rounded=0;whiteSpace=wrap;html=1;fillColor=none;fontSize=15;strokeWidth=2;verticalAlign=middle;fontStyle=1;strokeColor=none;' parent='y3w0JNk_32n-TRd_Wrkm-74' vertex='1'>
<mxGeometry width='200' height='55' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-72' value='&lt;font style=&quot;font-size: 23px&quot;&gt;&lt;span&gt;R 0&lt;/span&gt;&lt;br&gt;&lt;font style=&quot;font-size: 15px&quot;&gt;0.0%&lt;/font&gt;&lt;/font&gt;&lt;br&gt;' style='rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillColor=#4D4D4D;fontSize=15;perimeterSpacing=0;arcSize=50;strokeColor=none;fontColor=#FFFFFF;' parent='y3w0JNk_32n-TRd_Wrkm-74' vertex='1'>
<mxGeometry x='10' y='65' width='180' height='70' as='geometry'/>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-75' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-65' target='y3w0JNk_32n-TRd_Wrkm-70' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='760.166666666667' y='722.5' as='sourcePoint'/>
<mxPoint x='720' y='722.5' as='targetPoint'/>
</mxGeometry>
</mxCell>
<mxCell id='y3w0JNk_32n-TRd_Wrkm-76' value='' style='endArrow=block;html=1;fontSize=15;fontColor=#FFFFFF;strokeWidth=2;endFill=1;edgeStyle=orthogonalEdgeStyle;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;' parent='1' source='y3w0JNk_32n-TRd_Wrkm-70' target='y3w0JNk_32n-TRd_Wrkm-13' edge='1'>
<mxGeometry width='50' height='50' relative='1' as='geometry'>
<mxPoint x='280' y='284' as='sourcePoint'/>
<mxPoint x='240' y='503' as='targetPoint'/>
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
`
this.setState({ data: xml })
this.LoadGraph()
}
LoadGraph () {
var container = ReactDOM.findDOMNode(this.refs.divPenaltyGraph)
// Checks if the browser is supported
if (!mxClient.isBrowserSupported()) {
// Displays an error message if the browser is not supported.
mxUtils.error('Browser is not supported!', 200, false)
} else {
// Disables the built-in context menu
mxEvent.disableContextMenu(container)
// Creates the graph inside the given container
var graph = new mxGraph(container)
// Enables rubberband selection
new mxRubberband(graph)
var options = {
attributeNamePrefix: '',
textNodeName: '#text',
ignoreAttributes: false,
ignoreNameSpace: false,
allowBooleanAttributes: false,
parseNodeValue: true,
parseAttributeValue: true,
trimValues: true,
cdataTagName: '__cdata', // default is 'false'
cdataPositionChar: '\\c',
localeRange: '', // To support non english character in tag/attribute values.
parseTrueNumberOnly: false
}
if (parser.validate(this.state.data) === true) { // optional (it'll return an object in case it's not valid)
var jsonObj = parser.parse(this.state.data, options)
}
// Gets the default parent for inserting new cells. This is normally the first
// child of the root (ie. layer 0).
var parent = graph.getDefaultParent()
// Enables tooltips, new connections and panning
graph.setPanning(true)
graph.setTooltips(true)
graph.setConnectable(true)
graph.setEnabled(true)
graph.setEdgeLabelsMovable(false)
graph.setVertexLabelsMovable(false)
graph.setGridEnabled(true)
graph.setAllowDanglingEdges(false)
graph.getModel().beginUpdate()
try {
// mxGrapg component
var doc = mxUtils.createXmlDocument()
var node = doc.createElement('Node')
node.setAttribute('ComponentID', '[P01]')
const items = []
jsonObj.mxGraphModel.root.mxCell.forEach(cell => {
if (cell.value) {
const vertexObj = {}
let vertex = graph.insertVertex(
parent,
cell.id,
cell.value,
cell.mxGeometry.x,
cell.mxGeometry.y,
cell.mxGeometry.width,
cell.mxGeometry.height,
cell.style
)
vertexObj[cell.id] = vertex
items.push(vertexObj)
}
})
const mxCellCount = jsonObj.mxGraphModel.root.mxCell.length
for (let i = 0; i <= mxCellCount; i++) {
const cell = jsonObj.mxGraphModel.root.mxCell[i]
if (!cell.value) {
let sourceObject = items.filter(vertex => {
return Object.keys(vertex) === cell.source
})[0]
let source = sourceObject ? sourceObject[cell['source']] : null
let targetObject = items.filter(vertex => {
return Object.keys(vertex) === cell.target
})[0]
let target = targetObject ? cell['target'] : null
graph.insertEdge(
parent,
null,
'',
source,
target
)
}
}
// data
} finally {
// Updates the display
graph.getModel().endUpdate()
}
// Enables rubberband (marquee) selection and a handler for basic keystrokes
new mxRubberband(graph)
new mxKeyHandler(graph)
}
}
render () {
return (
<div className='graph-container' ref='divPenaltyGraph' id='divPenaltyGraph' />
)
}
}
export default mxGraphGridAreaEditor
</code></pre>
<p>Please Note :- The same XML works on draw.io and I am not able to catch the error in my code so any assistance in this will be appreciated</p>
| <javascript><reactjs><mxgraph> | 2019-06-01 16:38:42 | HQ |
56,409,426 | using prepared statements and fetchAll() to display to a table | <p>I'm trying to get my code SQL Injection safe, I am having trouble converting the pdo data to an array then comparing row data.</p>
<p>I have been reading up on <a href="https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php">how to prevent sql injection</a> as well as <a href="https://www.php.net/manual/en/pdostatement.fetchall.php" rel="nofollow noreferrer">fetchAll() documentation</a> and
<a href="https://phpdelusions.net/pdo_examples/select" rel="nofollow noreferrer">how to handle SELECT statements with pdo</a>.</p>
<p>Here is the relevant code. I believe it prepares the statement, then executes it, then the table is fetched and stored in $data where it is handed to $row, and then it looks up the player column and compares it with the logged in user to get the context based code to run. Where is the issue?</p>
<pre class="lang-php prettyprint-override"><code>
$stmt = $pdo->prepare("SELECT * FROM userdata");
$stmt->execute();
$data = $stmt->fetchAll();
echo "<table border='1'>
<tr>
<th>username</th>
<th>words</th>
</tr>";
while($row = $data)
{
echo $row['player'];
echo "<tr>";
echo "<td>" . $row['player'] . "</td>";
if($row['player'] == $logedInUsername)
{
echo "<td>" . $row['words'] . "<a href='edityourword.php?edit=$row[words]'> edit</a></td>";
}
else
{
echo "<td>" . $row['words'] . "</td>";
}
echo "</tr>";
}
echo "</table>";
</code></pre>
<p>My current error is reoccurring, here is the segment which the while loop keeps printing.</p>
<pre><code>Notice: Undefined index: player on line 41
Notice: Undefined index: player on line 43
Notice: Undefined index: player on line 44
Notice: Undefined index: words on line 50
Notice: Undefined index: player on line 41
Notice: Undefined index: player on line 43
Notice: Undefined index: player on line 44
Notice: Undefined index: words on line 50
</code></pre>
| <php><mysql><arrays><pdo><code-injection> | 2019-06-01 18:33:50 | LQ_CLOSE |
56,409,469 | Does an 8-bit timer take same time as a 16-bit timer to overflow in microcontroller? | <p>I want to call a function after certain time, irrespective of the other code, so which timer should I select</p>
| <embedded><microcontroller><avr> | 2019-06-01 18:39:31 | LQ_CLOSE |
56,409,771 | Files transfer to HDFS | <p>I need to bring the files (zip, csv, xml etc) from windows share location to HDFS. Which is the best approach ? I have kafka - flume - hdfs in mind. Please suggest the efficient way.</p>
<p>I tried getting the files to Kafka consumer.</p>
<p>producer.send(
new ProducerRecord(topicName,key,value),</p>
<p>Expect an efficient approach</p>
| <hadoop><apache-kafka><flume> | 2019-06-01 19:25:06 | LQ_CLOSE |
56,410,074 | How to set the background color of a Row() in Flutter? | <p>I'm trying to set up a background color for a Row() widget, but Row itself has no background color or color attribute. I've been able to set the background color of a container to grey, right before the purple-backgrounded text, but the text itself does not fill the background completely and the following spacer does not take any color at all.</p>
<p>So how can I have the Row background set to the "HexColor(COLOR_LIGHT_GREY)" value so it spans over the whole row? </p>
<p>Any idea? Thanks a lot!</p>
<p><a href="https://i.stack.imgur.com/hCeM3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hCeM3.png" alt="enter image description here"></a></p>
<p>Here's the code that I have so far:</p>
<pre><code>import 'package:flutter/material.dart';
import '../manager/ShoppingListManager.dart';
import '../model/ShoppingListModel.dart';
import '../hexColor.dart';
import '../Constants.dart';
class ShoppingListWidget extends StatelessWidget {
final Color color = Colors.amberAccent;
final int shoppingListIndex;
ShoppingListWidget({this.shoppingListIndex});
@override
Widget build(BuildContext context) {
ShoppingListManager slm = new ShoppingListManager();
String shoppingListName =
slm.myShoppingLists.shoppingLists[shoppingListIndex].name;
int categoryCount =
slm.myShoppingLists.shoppingLists[shoppingListIndex].categories.length;
return Scaffold(
appBar: AppBar(
title: Text(shoppingListName),
automaticallyImplyLeading: true,
),
body: ListView.builder(
itemBuilder: (context, index) {
Category cat = slm.myShoppingLists.shoppingLists[shoppingListIndex]
.categories[index];
return Container(
decoration: new BoxDecoration(
border: new Border.all(color: Colors.grey[500]),
color: Colors.white,
),
child: new Column(
children: <Widget>[
getCategoryWidget(context, cat),
getCategoryItems(context, cat),
],
),
);
},
itemCount: categoryCount,
),
);
}
// Render the category "headline" row where I want to set the background color
// to HexColor(COLOR_LIGHT_GREY)
Widget getCategoryWidget(BuildContext context, Category cat) {
return new Row(
children: <Widget>[
new Container(height: 40.0, width: 10.0, color: HexColor(cat.color)),
new Container(
height: 40.0, width: 15.0, color: HexColor(COLOR_LIGHT_GREY)),
new Container(
child: new Text("Category", textAlign: TextAlign.start,
style: TextStyle(
fontFamily: 'Bold',
fontSize: 18.0,
color: Colors.black),
),
decoration: new BoxDecoration(
color: Colors.purple,
),
height: 40.0,
),
Spacer(),
CircleAvatar(
backgroundImage:
new AssetImage('assets/icons/food/food_settings.png'),
backgroundColor: HexColor(COLOR_LIGHT_GREY),
radius: 15.0,
),
new Container(height: 15.0, width: 10.0, color: Colors.transparent),
],
);
}
// render the category items
Widget getCategoryItems(BuildContext context, Category cat) {
return ListView.builder(
itemBuilder: (context, index) {
String itemName = "Subcategory";
return new Row(children: <Widget>[
new Container(height: 40.0, width: 5.0, color: HexColor(cat.color)),
new Container(height: 40.0, width: 20.0, color: Colors.white),
new Container(
child: new Text(itemName),
color: Colors.white,
),
Spacer()
]);
},
itemCount: cat.items.length,
shrinkWrap: true,
physics:
ClampingScrollPhysics(),
);
}
}
</code></pre>
| <flutter><dart> | 2019-06-01 20:07:53 | HQ |
56,410,895 | Gin: Resize image before sending | I want to have a route with gin that will send an image (jpeg) as the response but instead of sending the original image that's saved to disk I would like to resize it first (to a thumbnail size).
So far I can send images using `c.File(filepath string)` but that doesn't allow me to resize the image. Is there any way to do that without having to create a new file on the disk? | <go><go-gin> | 2019-06-01 22:30:22 | LQ_EDIT |
56,412,389 | I am unable to figure out where to add a while-loop to my already finished code to get the min and max to work correctly | My issue is not knowing how to properly configure this section of coding to get the max and min to work properly.
"For the max/min logic to work correctly,
it had to be placed WITHIN a loop, not after it.
Due to that, a WHILE loop would have been preferred.
(Or use correctly the max() and min() methods.)"
I have tried moving the if statements that include the max and min statements around to no avail. Python 3.7.3, using IDLE.
def user_grade(statistic = None):
f = []
for grade in range(5):
if statistic == "max":
print('Max: {}'.format(max(f)))
if statistic == "min":
print('Min: {}'.format(min(f)))
f.append(float(input("Enter Grade (percentage): ")))
else:
print('Average: {}'.format(sum(f)/len(f)))
Expected Output: #Numbers will vary depending on user input.
Enter Grade (percentage): 99
Enter Grade (percentage): 98
Enter Grade (percentage): 97
Enter Grade (percentage): 96
Enter Grade (percentage): 95
Max: 99.0
Average: 97.0
None #The 'min" should be here instead of None.
#Current Output
Traceback (most recent call last):
line 22, in <module>
print(user_grade('max'))
line 13, in user_grade
print('Max: {}'.format(max(f)))
ValueError: max() arg is an empty sequence | <python><python-3.x><while-loop> | 2019-06-02 05:17:20 | LQ_EDIT |
56,412,441 | Android App - Result from math calculation is not showing up on screen | I am attempting to make a simple android app that calculates the diameter of a sonar signal. The user inputs the depth(in meters) and angle(in degrees) and the app inputs the information into the formula:
2.0 * depth * Math.tan(angle / 2.0)
So I have created the UI and the java code and when I go to run the app in a VM it loads, I enter numbers in to test it, and when I hit the calculate button it does nothing. I am new to java and android development in general so if anyone could shed some light that would be great.
Here is the MainActivity.java: https://gist.github.com/enporter/5c6238d0d81afaa13de9f473cd327c87
XML file for the UI widgets activity_main.xml:
https://gist.github.com/enporter/80bef3f89c2240838aab4a0472f42ba9
I suspect the problem is something to do with this code that includes the formula but I am not sure so any help would be greatly appreciated:
```double depth1 = Integer.parseInt(depth.getText().toString());
double angle1 = Integer.parseInt(angle.getText().toString());
double result1 = 2.0 * depth1 * Math.tan(angle1 / 2.0);
result.setText(valueOf(result1));``` | <java><android> | 2019-06-02 05:32:36 | LQ_EDIT |
56,413,658 | How do you load a class that is not in the classpath & is in a jar? | <p>I want to load a class that is in a jar.</p>
<p>I already tried to just load the class using this code:</p>
<pre class="lang-java prettyprint-override"><code>URL dirUrl = jarFile.toURL();
URLClassLoader ucl = new URLClassLoader(new URL[] {dirUrl}, getClass().getClassLoader());
Class<?> clazz = ucl.loadClass(mainClass);
ucl.close();
</code></pre>
<p>I get an exception that it couldn´t find the class:</p>
<pre class="lang-py prettyprint-override"><code>java.lang.RuntimeException: java.lang.ClassNotFoundException: net.api.main
at net.al.Main.onEnable(Main.java:39) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:741) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.Bukkit.reload(Bukkit.java:535) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]
Caused by: java.lang.ClassNotFoundException: net.api.main
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]
at net.al.addon.AddonLoader.loadAddons(AddonLoader.java:129) ~[?:?]
at net.al.Main.onEnable(Main.java:36) ~[?:?]
... 16 more
</code></pre>
| <java> | 2019-06-02 09:07:09 | LQ_CLOSE |
56,414,548 | Concatenating and splitting json files in a 1 level deep folder structure | <p>I'm working on a translation project the content of which is in a one level deep folder structure in JSON files.
Essentialy it looks like this</p>
<pre><code>\folder1
file1.json
file2.json
...
\folder2
file3.json
file4.json
...
</code></pre>
<p>I need some automated way to:</p>
<ul>
<li>Merge these into a single file, preferebly one that contains the original file name and folder as the first line of each file's content
e.g.:</li>
</ul>
<pre><code> \folder1\file1.json
<file1 content>
\folder1\file2.json
<file2 content>
\folder2\file3.json
<file3 content>
\folder2\file4.json
<file4 content>
</code></pre>
<ul>
<li>Split the merged file and re-create the original folder structure. </li>
</ul>
<p>I'm using Windows10.</p>
| <batch-file><split><windows-10><concatenation> | 2019-06-02 11:22:45 | LQ_CLOSE |
56,414,640 | PayPal Checkout (javascript) with Smart Payment Buttons create order problem | <p>I'm trying to implement on my webpage the PayPal Checkout (javascript) following the manual: <a href="https://developer.paypal.com/docs/checkout/" rel="noreferrer">https://developer.paypal.com/docs/checkout/</a>
Everything is great with standard options. For example this works just fine:</p>
<pre><code>paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
currency_code: 'EUR',
value: '120.16'
},
description: 'Purchase Unit test description',
custom_id: '64735',
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name);
// Call your server to save the transaction
return fetch('/api/paypal-transaction-complete', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
orderID: data.orderID
})
});
});
}
}).render('#paypal-button-container');
</code></pre>
<p>But when I try to be more specific about the order details it gives me an error:</p>
<pre><code>Error: "Order Api response error:
{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "1ed03d18530c1",
"details": [
{
"location": "body",
"issue": "INVALID_SYNTAX",
"description": "Cannot deserialize instance of `com.paypal.api.platform.checkout.orders.v2.model.AmountBreakdown` out of START_ARRAY token line: 1, column: 82"
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_SYNTAX", "rel": "information_link", "encType": "application/json"
}
]
}"
}
</code></pre>
<p>This is my code:</p>
<pre><code>paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
currency_code: 'EUR',
value: '120.16',
breakdown: [{
item_total: {
unit_amount: 7,
currency_code: 'EUR',
value: '120.16'
}
}]
},
description: 'Purchase Unit test description',
custom_id: '64735',
items: [{
name: 'Test item 1',
unit_amount: {
currency_code: 'EUR',
value: '60.12'
},
quantity: 2,
description: 'Uaua item 1 description'
}, {
name: 'Test item 2',
unit_amount: {
currency_code: 'EUR',
value: '60.00'
},
quantity: 5,
description: 'Test item 2 description'
}]
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name);
// Call your server to save the transaction
return fetch('/api/paypal-transaction-complete', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
orderID: data.orderID
})
});
});
}
}).render('#paypal-button-container');
</code></pre>
<p>Anyone knows where is the problem? The PayPal documentation is not very informative...</p>
| <javascript><paypal> | 2019-06-02 11:37:26 | HQ |
56,414,845 | Permute lists of lists | <p>Given n arrays of random sizes, I need to permute them like this:</p>
<pre><code>[a1, a2, a3]
[b1, b2]
[c1, c2]
[a1, b1, c1]
[a1, b1, c2]
[a1, b2, c1]
[a1, b2, c2]
[a2, b1, c1]
[a2, b1, c2]
[a2, b2, c1]
[a2, b2, c2]
[a3, b1, c1]
[a3, b1, c2]
[a3, b2, c1]
[a3, b2, c2]
</code></pre>
<p><strong>The columns order matters, lines dont.</strong></p>
<p>What is good way to achieve this. If possible, using this method contract:</p>
<pre class="lang-java prettyprint-override"><code><T> List<List<T>> permute(List<T>... lists)
</code></pre>
| <java><permutation> | 2019-06-02 12:05:52 | LQ_CLOSE |
56,415,114 | Problem with my SQLite (SQLiteOpenHelper) | I am creating a sqlite database with android studio. My application closes at the call of my method "Insertprofile () " in my main.
My DatabaseManager :
public class DatabaseManager extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "Userx.db";
private static final int DATABASE_VERSION = 1;
SQLiteDatabase db;
public DatabaseManager( Context context ) {
super( context, DATABASE_NAME, null, DATABASE_VERSION );
}
@Override
public void onCreate(SQLiteDatabase db) {
String strSql = "create table User ("
+ " id integer primary key autoincrement,"
+ " mission integer not null,"
+ " day integer not null"
+ ")";
db.execSQL( strSql );
Log.i( "DATABASE", "onCreate invoked" );
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public void insertProfil( int mission, int day ) {
//name = name.replace( "'", "''" );
String strSql = "INSERT INTO User (mission, day) VALUES ("
+ mission + ", " + day + ")";
this.getWritableDatabase().execSQL( strSql );
Log.i( "DATABASE", "insertScore invoked" );
}
public Profil readData() {
Profil profil = null;
//REQUEST
String strSql = "SELECT * from User";
//CREATE CURSOR WITH REQUEST
Cursor cursor = this.getReadableDatabase().rawQuery(strSql, null);
//PUT IN TOP
cursor.moveToFirst();
if (!cursor.isAfterLast()) {
//RECEPT DATA AND CREATE VALUES THIS
Integer id = cursor.getInt(0);
Integer mission = cursor.getInt(1);
Integer day = cursor.getInt(2);
profil = new Profil(id, mission, day);
//POSSIBLE CREATE LIST WITH WHILE
}
cursor.close();
return profil;
}
public void modifyData(int mission){
SQLiteDatabase db = this.getWritableDatabase();
String strSql = "UPDATE User SET mission = " + mission + " WHERE id = " + "1";
db.execSQL( strSql );
}
public void deleteData(){
String strSql = "DELETE FROM User" ;
this.getWritableDatabase().execSQL( strSql );
}
}
And my Main:
public class MainActivity extends AppCompatActivity {
private TextView profil_text;
private DatabaseManager databaseManager;
Profil profil;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
profil_text = (TextView) findViewById( R.id.profil_text);
Log.d("**************1", "onCreate: ");
databaseManager = new DatabaseManager(this);
Log.d("**************2", "onCreate: ");
Log.d("**************3", "onCreate: ");
databaseManager.modifyData(80);
Log.d("**************4", "onCreate: ");
profil = databaseManager.readData();
Log.d("**************5", "onCreate: ");
profil_text.setText(Integer.toString(profil.getMission()));
databaseManager.close();
}
And my class profil is just simple classe with getter and setter and constructor.
PS: I'm french, my English is bad. | <android><android-sqlite> | 2019-06-02 12:38:16 | LQ_EDIT |
56,415,463 | How to fix C3861: '...': identifier not found | <p>I want to create a game minesweeper using visual studio. Project visual c++ Win32 Console Application. Source file C++ file(.cpp)
This is my source code</p>
<pre><code>#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <conio.h>
#include <time.h>
int menu()//menampilkan menu
{
int x;
printf("\nThe Minesweeper for You\n\n");
printf("<<Main Menu>>\n\n");
printf("1.Start\n");
printf("2.Exit\n\n");
printf("Masukkan pilihan : ");
scanf("%i", &x);
while ((x<1) || (x>2))
{
printf("Pilihan Invalid !\n");
printf("Masukkan pilihan : \n");
scanf("%i", &x);
}
printf("\n");
return x;
}
void cek(int board[15][15], int revealed[15][15], int x, int y)//mengecek saat board[x][y] berisi 0
{
//Kamus lokal
int i, j;
revealed[x][y] = 1;
//Algoritma
for (i = x - 1; i<x + 2; i++)
{
for (j = y - 1; j<y + 2; j++)
{
if (i >= 0 && j >= 0 && i<15 && j<15)
{
if (revealed[i][j] == 0 && board[i][j] != 0)
{
revealed[i][j] = 1;
}
}
}
}
for (i = x - 1; i<x + 2; i++)
{
for (j = y - 1; j<y + 2; j++)
{
if (i >= 0 && j >= 0 && i<15 && j<15)
{
if (revealed[i][j] == 0 && board[i][j] == 0)
{
cek(board, revealed, i, j);
}
}
}
}
}
int klik(int board[15][15], int revealed[15][15], char kondisi[15][15])
{
//Kamus lokal
int a, b, x, y, q, z;
//Algoritma
do {
printf("X: ");
scanf("%i", &y);
printf("y: ");
scanf("%i", &x);
} while (x<1 || y<1 || x>15 || y>15);
x--; y--;//konfersi ke matriks yg dari 0 sampai 14
if (kondisi[x][y] == 'F')
{
}
else if (board[x][y] == 9)
{
for (a = 0; a<15; a++)for (b = 0; b<15; b++)
{
if (board[a][b] == 9)revealed[a][b] = 1;
}
z = 1;
}
else if (board[x][y] == 0)
{
revealed[x][y] = 1; //revealed 1 terbuka
cek(board, revealed, x, y);
}
else{ revealed[x][y] = 1; }
for (a = 0; a<15; a++)
{
for (b = 0; b<15; b++)
if (revealed[a][b] == 1)
{
switch (board[a][b])
{
case 0: kondisi[a][b] = '0'; break;
case 1: kondisi[a][b] = '1'; break;
case 2: kondisi[a][b] = '2'; break;
case 3: kondisi[a][b] = '3'; break;
case 4: kondisi[a][b] = '4'; break;
case 5: kondisi[a][b] = '5'; break;
case 6: kondisi[a][b] = '6'; break;
case 7: kondisi[a][b] = '7'; break;
case 8: kondisi[a][b] = '8'; break;
case 9: kondisi[a][b] = '#'; break;
}
}
}
q = jumlhbuka(revealed, kondisi);
if (z == 1){ return 1; }
else if (q >= 200){ z = 2; }
else{ z = 0; }
return z;
}
int jumlhbuka(int revealed[15][15], char kondisi[15][15])
{
int a, b, q = 0;
for (a = 0; a<15; a++)
{
for (b = 0; b<15; b++)
{
if (revealed[a][b] == 1 && kondisi[a][b] != '#'){ q = q + 1; }
}
}
return q;
}
void flag(char kondisi[15][15], int revealed[15][15])
{
//Kamus lokal
int x, y;
//Algoritma
do {
printf("X: ");
scanf("%i", &y);
printf("y: ");
scanf("%i", &x);
} while (x<1 || y<1 || x>15 || y>15);
if (revealed[x - 1][y - 1] == 0)//board = 0 tertutup
{
kondisi[x - 1][y - 1] = 'F';
}
}
void rflag(char kondisi[15][15], int revealed[15][15])
{
//Kamus lokal
int x, y;
//Algoritma
do {
printf("X: ");
scanf("%i", &y);
printf("y: ");
scanf("%i", &x);
} while (x<1 || y<1 || x>15 || y>15);
if (kondisi[x - 1][y - 1] == 'F') //jika kondisinya sedang flag
{
kondisi[x - 1][y - 1] = '_';
}
}
void random(int A[15][15])
{
//Kamus lokal
srand((unsigned)time(NULL));
int a, b, c = 0;
//Algoritma
for (a = 0; a<15; a++){ for (b = 0; b<15; b++){ A[a][b] = 0; } }
while (c<25)
{
for (a = 0; a<15 && c<25; a++)
{
for (b = 0; b<15 && c<25; b++)
{
if (A[a][b] != 9)
{
A[a][b] = rand() % 10;
if (A[a][b] == 9){ c++; }
else{ A[a][b] = 0; }
}
}
}
}
}
void PasangBom(int board[15][15])//mengisi board dengan 0-9. 9 maka berisi bom dan 0 maka kosong
{
//Kamus lokal
int x, y, a, i, j; a = 25;
//Algoritma
random(board);//isi board dengan 9 sebagai bom dan yang lain 0;
for (x = 0; x<15; x++)
for (y = 0; y<15; y++)
if (board[y][x] == 9)
{
if ((y - 1) >= 0)
if (board[y - 1][x] != 9)
board[y - 1][x]++;
if ((y - 1) >= 0 && (x - 1) >= 0)
if (board[y - 1][x - 1] != 9)
board[y - 1][x - 1]++;
if ((x - 1) >= 0)
if (board[y][x - 1] != 9)
board[y][x - 1]++;
if ((y + 1) < 15)
if (board[y + 1][x] != 9)
board[y + 1][x]++;
if ((y + 1) < 15 && (x + 1) < 15)
if (board[y + 1][x + 1] != 9)
board[y + 1][x + 1]++;
if ((x + 1) < 15)
if (board[y][x + 1] != 9)
board[y][x + 1]++;
if ((y - 1) >= 0 && (x + 1) < 15)
if (board[y - 1][x + 1] != 9)
board[y - 1][x + 1]++;
if ((y + 1) < 15 && (x - 1) >= 0)
if (board[y + 1][x - 1] != 9)
board[y + 1][x - 1]++;
}
}
void Tampilkar(char x[15][15])
{
//Kamus lokal
int a = 0;
int b = 0;
//Algoritma
printf(" y\\x");
while (b<15)
{
if (b<9){ printf("_%i__", b + 1); }
else{ printf("%i__", b + 1); }
b = b + 1;
}
printf("\n");
while (a<15)
{
b = 0;
if (a<9){ printf(" %i", a + 1); }
else{ printf("%i", a + 1); }
while (b<15){ printf("_|_%c", x[a][b]); b = b + 1; }
printf("_|\n");
a = a + 1;
}
printf("\n");
}
void Tampilang(int x[15][15])
{
//Kamus lokal
int a = 0;
int b = 0;
//Algoritma
printf(" y\\x");
while (b<15)
{
if (b<9){ printf("_%i__", b + 1); }
else{ printf("%i__", b + 1); }
b = b + 1;
}
printf("\n");
while (a<15)
{
b = 0;
if (a<9){ printf(" %i", a + 1); }
else{ printf("%i", a + 1); }
while (b<15){ printf(" | %i", x[a][b]); b = b + 1; }
printf(" |\n");
a = a + 1;
}
printf("\n");
}
void start()
{
//Kamus lokal
int a, b, x, y, z, jbuka;
int jk = 0;//jumlah klik,
int dead = 0;//0 masih main, 1 kalah, 2 menang , 4 keluar(stop)
int board[15][15];
int revealed[15][15];
char kondisi[15][15];
//Algoritma
PasangBom(board);
for (a = 0; a<15; a++)for (b = 0; b<15; b++)revealed[a][b] = 0;//mengkosongkan parameter buka
for (a = 0; a<15; a++)for (b = 0; b<15; b++)kondisi[a][b] = '_';//mengkosongkan tampilan awal
Tampilkar(kondisi);
while (dead == 0)
{
do{
printf("1.Klik\n");
printf("2.Flag\n");
printf("3.Remove Flag\n");
printf("4.Stop\n");
printf("Masukkan pilihan : ");
scanf("%i", &z);
} while (z<1 || (z>4 && z != 2357));
switch (z)
{
case 1:
dead = klik(board, revealed, kondisi);
jk++;
break;
case 2:
flag(kondisi, revealed);
jk++;
break;
case 3:
rflag(kondisi, revealed);
jk++;
break;
case 4:
system("cls");
dead = 4;
break;
case 2357: //Cheat untuk melihat seluruh isi bom di minesweeper bila user memasukkan angka 2357
Tampilang(board);
break;
}
if (z != 4)
Tampilkar(kondisi);
}
jbuka = jumlhbuka(revealed, kondisi);
if (dead == 1)
{
printf("\nANDA MENGENAI BOMB!!! \n\n");
}
else if (dead == 2)
{
printf("\nANDA MENANG!!! :)\n\n");
}
system("cls");
}
int main()
{
int a, x;
a = 1;
while (a == 1)
{
printf("========================================\n");
printf(" # # # # # ##### ##### SWEEPER\n");
printf(" ## ## # ## # # # SWEEPER\n");
printf(" # # # # # # # # ##### ##### SWEEPER\n");
printf(" # # # # # ## # # SWEEPER\n");
printf(" # # # # # ##### ##### SWEEPER\n");
printf("========================================\n\n");
x = menu();
switch (x){
case 1:
system("cls");
start();
break;
case 2:
system("cls");
a = 0;
printf("\nThanks for Playing Our Game!!!\n\n");
}
}
}
</code></pre>
<p>And i get this error
Error C3861: 'jumlhbuka': identifier not found
I try googling how to fix C3861 snd try the solution still failed :(
Please help me to fix it, i hope someone can fix it
Thanks guys :) </p>
| <c++> | 2019-06-02 13:24:33 | LQ_CLOSE |
56,416,042 | Counting the no of elements in a data structure, printing the count for each position and decrement the iteration using recursion | Various signal towers are present in a city.Towers are aligned in a straight horizontal line(from left to right) and each tower transmits a signal in the right to left direction.Tower A shall block the signal of Tower B if Tower A is present to the left of Tower B and Tower A is taller than Tower B. So,the range of a signal of a given tower can be defined as :
{(the number of contiguous towers just to the left of the given tower whose height is less than or equal to the height of the given tower) + 1}.
#include <iostream>
#include <vector>
using namespace std;
vector<int> res;
void recursion(int a[],int x)
{
if (x >= 0)
{// Taking the last element of the array as the max element
int max = a[x], count = 0;
for (int i = x; i >= 0; i--)
{//Comparing the max with all the elements in the array
if (max >= a[i])
{
count++;
}
else
{
break;
}
}
//Pushing the count of the current element in the vector.
res.push_back(count);
x = x - 1;
recursion(a, x);
}
}
int main() {
int TestCase, n;
cin >> TestCase;
for (int l = 0; l < TestCase; l++)
{
cin >> n;
int * arr = new int[n];
//Getting the elements
for (int j = 0; j < n; j++)
{
cin >> arr[j];
}
recursion(arr, n-1);
//Iterating through the vector in reverse manner and printing
//the result.
for (auto it = res.rbegin(); it != res.rend(); ++it)
{
cout << *it << " ";
}
delete[] arr;
}
return 0;
}
First line contains an integer T specifying the number of test cases.
Second line contains an integer n specifying the number of towers.
Third line contains n space separated integers(H[i]) denoting the height
of each tower.
Print the range of each tower (separated by a space).
Sample Input :
1
7
100 80 60 70 60 75 85
Sample Output :
1 1 1 2 1 4 6
My solution is correct but the time complexity is the issue. Is there any
way to reduce time complexity? | <c++><algorithm><recursion><data-structures><time-complexity> | 2019-06-02 14:41:39 | LQ_EDIT |
56,416,548 | Why does this compile? (unsigned char *thing = (unsigned char *) "YELLOW SUBMARINE";) | <p>I'm struggling to understand why this line of code makes sense:</p>
<pre class="lang-cpp prettyprint-override"><code>unsigned char *thing = (unsigned char *)"YELLOW SUBMARINE";
</code></pre>
<p>An <code>unsigned char</code> holds one byte of data (i.e. 'Y') so an <code>unsigned char*</code> should be a pointer to that single byte of data. </p>
<p>If I try to put more than one character inside, the compiler should, in my thinking, get angry. Yet it doesn't mind that I'm putting 16 bytes here and telling the compiler I'm only pointing to a single <code>unsigned char</code>. Could someone please explain?</p>
<p>My thinking was that the compiler would allocate memory for one <code>unsigned char</code>, then write the whole string into it, overwriting adjacent memory and causing havoc. Yet I'm able to correctly dereference this pointer later on and retrieve the whole string, so there doesn't seem to be a problem.</p>
<p>Context: I'm trying to convert a string to something of this form (<code>unsigned char *</code>).</p>
<p>Thanks in advance!</p>
| <c++> | 2019-06-02 15:44:29 | LQ_CLOSE |
56,417,167 | ¿ How to check admin role? | I am looking the best way to check admin rolewith component in angular.
I have the following code in component
checkIfIsAdmin(): any {
let user_string = localStorage.getItem("currentUser");
if (!isNullOrUndefined([user_string])) {
console.log(user_string);
return true;
} else {
return null;
}
}
I need to check the ROLE_ADMIN that I receive with the following format,
{"longId":4,"name":"bbb","email":"bbb@gmail.com","userName":"bbb","token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNTU5NDk0NTczLCJleHAiOjE1NTk0OTQ4NzN9.XmSHywZv09b4BR9-NxyCTVPF33pLsk3QtTEXQMQF4YHW7i27Ghj2Uh3WZAegpG4rdSImKcm1wMgJsPLpHcTyew","roles":["ROLE_USER","ROLE_ADMIN"]}
I don't know how to iterate roles inside if condition , could anyone help to me ? | <typescript> | 2019-06-02 17:06:47 | LQ_EDIT |
56,417,928 | NESTED FOR LOOP WITH PARAMATERIZED CURSORS inserting duplicate records | We are using 2 paramaterized cursor from which 1st cursor value need to use in second cursor to fetch the data accordingly but it's fetching the values from both the cursors rather it should fetched from 2nd cursor only.
Thanks | <sql><oracle><plsql><sqlplus> | 2019-06-02 18:43:55 | LQ_EDIT |
56,418,270 | Expression must have class type (vector of ponters) | I have an error that says that "column" must have class type.
vector<Column*> is a vector of pointers where
Column is an abstract class because my columns can be of type int, double or string
class Table {
vector<Column*> _columns;
Column* value;
char* name;
public:
Table() {...}
Table(char* name) {...}
~Table() {...}
template <typename T>
void addColumn(vector<T> v) {
auto column = DataColumnFactory::getColumn();
column.get()->addValuesToVector(v);
_columns.push_back(move(column));
}
int findLongestColumn() {
int length = 0;
for (auto &column : _columns) {
if (length < column.get()->lengthOfColumn()) //ERROR
length = column.get()->lengthOfColumn();
}
}
}; | <c++> | 2019-06-02 19:27:04 | LQ_EDIT |
56,418,318 | Not able insert data into table? | I'm able to see all the data that i have entered in form but not able to insert it into table.
<?php
echo "u r at starting";
$product_title = $_POST["product_title"];
$product_cat = $_POST["product_cat"];
$cat = $_POST["cat"];
$product_price = $_POST["product_price"];
$product_keywords = $_POST["product_keywords"];
$product_desc = $_POST["product_desc"];
$product_img1 = $_FILES["product_img1"]["name"];
$product_img2 = $_FILES["product_img2"]["name"];
$product_img3 = $_FILES["product_img3"]["name"];
echo $product_title;
echo $product_cat;
echo $cat;
echo $product_price;
echo $product_keywords;
echo $product_desc;
echo $product_img1;
echo $product_img2;
echo $product_img3;
if(isset($_POST["abc"]))
{
$temp_name1 = $_FILES["product_img1"]["tmp_name"];
$temp_name2 = $_FILES["product_img2"]["tmp_name"];
$temp_name3 = $_FILES["product_img3"]["tmp_name"];
move_uploaded_file($temp_name1, "product_images/img1");
move_uploaded_file($temp_name2, "product_images/img2");
move_uploaded_file($temp_name3, "product_images/img3");
$insert_product = "INSERT INTO product_tab VALUES
('$product_cat','$cat_id',NOW(),'$product_title','$product_img1','$product_img2','$product_img3','$product_price','$product_keywords','$product_desc')";
$run_product = mysqli_query($con,$insert_product);
echo $run_product;
if($run_product)
{
echo "Product inserted successfully";
}
else
{
echo "NOt inserted";
}
}
echo "end";
?> | <php><sql><mysqli> | 2019-06-02 19:32:35 | LQ_EDIT |
56,418,892 | How to write a query with NULL for missing values | <p>Below, I have 2 tables. I want to write a query that will return each <code>NAME</code> and the corresponding <code>UIN</code> value. If there is no <code>UIN</code> value, I want to return <code>NULL</code> for that entry instead</p>
<p><a href="https://i.stack.imgur.com/Do7pg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Do7pg.png" alt="enter image description here"></a></p>
<p>For example, 2 entries should be like this for Samanta should be:</p>
<p><code>Bob 49638-001</code></p>
<p><code>Samantha NULL</code></p>
<p>I've tried <code>SELECT NAME JOIN EMPLOYEE_UIN.UIN INSERT "NULL" WHERE UIN = NULL</code> but no luck. I'm a beginner with SQL and I couldn't find a similar example on SO about this.</p>
| <mysql><sql> | 2019-06-02 20:53:47 | LQ_CLOSE |
56,420,861 | how to make bruteforce without itertools in python | i'm new in python,
i try calculate 3 ** 16(¹[0-f] ² [0-f] ³ [0-f] but not working properly.
this is my code, please help me to corrected my code.
inp = str(input('value len 0-3 digit:'))
hexa = ('0123456789abcdef');
//len(hexa) = 16 digit
//pass = '36f'
pass = inp
for x in range(0, 3 ** len(hexa)):
// range = 0..(3 ^ 16)
if(hexa[x] == pass):
found = hexa[x]
//if result valid
print("pos: %d, pass: %s" % (x, found))
//print position
but i got error "index out of bound",
i need output like this.
000 #first
001
002
...
...
fff #last
how to fix it?
thanks before. ;) | <python><python-3.x><string><brute-force> | 2019-06-03 03:39:31 | LQ_EDIT |
56,423,077 | How can I do two text blocks in the listView which the first in the left alignment and the second in the right use Android Studio? | How can I set two text blocks in the listView, of which the first is on the left, the other on the right? I am tried to create a new layout with two textViews. But I don't know how I can connect tetViews with listView and how I can set texts on textViews. May anybody help me?
[I would like to have a list like this screen][1]
[1]: https://i.stack.imgur.com/k4rGG.png | <java><android><android-layout> | 2019-06-03 07:47:16 | LQ_EDIT |
56,423,451 | I want to stop print() from printing space while using , | <p>I am a noob so this question maybe a crap for you.</p>
<p>As written in title, I want to stop <code>print()</code> from printing space while using <code>,</code>.</p>
<p>I have code for that :</p>
<pre><code>i = 1
print (i,"2")
</code></pre>
<blockquote>
<p><strong>Output</strong> = 1 2</p>
<p><strong>Expected Output</strong> = 12</p>
</blockquote>
| <python> | 2019-06-03 08:14:30 | LQ_CLOSE |
56,423,861 | java.util.ConcurrentModificationException in fragment | <p>I am developing android app I have implemented searchview but when I start to search news in search bar </p>
<pre><code>I am getting following exception
</code></pre>
<blockquote>
<p>Process: edgar.yodgorbek.sportnews, PID: 5146
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.next(ArrayList.java:860)
at edgar.yodgorbek.sportnews.sportactivities.BBCSportFragment.doFilter(BBCSportFragment.java:126)
at edgar.yodgorbek.sportnews.MainActivity$1.onQueryTextChange(MainActivity.java:126)</p>
</blockquote>
<p>below BBCSportFragment.java</p>
<pre><code>public class BBCSportFragment extends Fragment implements ArticleAdapter.ClickListener {
public static List<Article> articleList = new ArrayList<>();
public List<Search> searchList = new ArrayList<>();
@ActivityContext
public Context activityContext;
Search search;
@ApplicationContext
public Context mContext;
@BindView(R.id.recycler_view)
RecyclerView recyclerView;
BBCSportFragmentComponent bbcSportFragmentComponent;
BBCFragmentContextModule bbcFragmentContextModule;
private SportNews sportNews;
private static ArticleAdapter articleAdapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_bbcsport, container, false);
ButterKnife.bind(this, view);
SportInterface sportInterface = SportClient.getApiService();
Call<SportNews> call = sportInterface.getArticles();
call.enqueue(new Callback<SportNews>() {
@Override
public void onResponse(Call<SportNews> call, Response<SportNews> response) {
if (response == null) {
sportNews = response.body();
if (sportNews != null && sportNews.getArticles() != null) {
articleList.addAll(sportNews.getArticles());
}
articleAdapter = new ArticleAdapter(articleList, sportNews);
ApplicationComponent applicationComponent;
applicationComponent = (ApplicationComponent) MyApplication.get(Objects.requireNonNull(getActivity())).getApplicationContext();
bbcSportFragmentComponent = (BBCSportFragmentComponent) DaggerApplicationComponent.builder().contextModule(new ContextModule(getContext())).build();
bbcSportFragmentComponent.injectBBCSportFragment(BBCSportFragment.this);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext(applicationComponent));
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(articleAdapter);
}
}
@Override
public void onFailure(Call<SportNews> call, Throwable t) {
}
});
SportInterface searchInterface = SportClient.getApiService();
Call<Search> searchCall = searchInterface.getSearchViewArticles("q");
searchCall.enqueue(new Callback<Search>() {
@Override
public void onResponse(Call<Search> call, Response<Search> response) {
search = response.body();
if (search != null && search.getArticles() != null) {
articleList.addAll(search.getArticles());
}
articleAdapter = new ArticleAdapter(articleList, search);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(articleAdapter);
}
@Override
public void onFailure(Call<Search> call, Throwable t) {
}
});
return view;
}
private Context getContext(ApplicationComponent applicationComponent) {
return null;
}
public static void doFilter(String searchQuery) {
searchQuery = searchQuery.toLowerCase();
for(Article article: articleList){
final String text = "";
if (text.equals(searchQuery))
articleList.add(article);
}
articleList.clear();
if(articleList.isEmpty())
articleAdapter.notifyDataSetChanged();
}
}
</code></pre>
<p>below MainActivity.java</p>
<pre><code>public class MainActivity extends AppCompatActivity {
private DrawerLayout mDrawer;
private Toolbar toolbar;
private NavigationView nvDrawer;
private ActionBarDrawerToggle drawerToggle;
Context mContext;
// Default active navigation menu
int mActiveMenu;
// TAGS
public static final int MENU_FIRST = 0;
public static final int MENU_SECOND = 1;
public static final int MENU_THIRD = 2;
public static final int MENU_FOURTH = 3;
public static final int MENU_FIFTH = 3;
public static final String TAG = "crash";
// Action bar search widget
SearchView searchView;
String searchQuery = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Set a Toolbar to replace the ActionBar.
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Find our drawer view
mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerToggle = setupDrawerToggle();
// Tie DrawerLayout events to the ActionBarToggle
mDrawer.addDrawerListener(drawerToggle);
nvDrawer = (NavigationView) findViewById(R.id.nvView);
// Inflate the header view at runtime
View headerLayout = nvDrawer.inflateHeaderView(R.layout.nav_header);
// We can now look up items within the header if needed
ImageView ivHeaderPhoto = (ImageView) headerLayout.findViewById((R.id.header_image));
ivHeaderPhoto.setImageResource(R.drawable.ic_sportnews);
setupDrawerContent(nvDrawer);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.flContent, new BBCSportFragment()).commit();
fragmentManager.beginTransaction().replace(R.id.flContent, new FoxSportsFragment()).commit();
fragmentManager.beginTransaction().replace(R.id.flContent, new TalkSportsFragment()).commit();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
switch (item.getItemId()) {
case android.R.id.home:
mDrawer.openDrawer(GravityCompat.START);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
// Getting search action from action bar and setting up search view
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) searchItem.getActionView();
// Setup searchView
setupSearchView(searchView);
Log.e(TAG,"crash");
return true;
}
public void setupSearchView(SearchView searchView) {
SearchManager searchManager = (SearchManager) this.getSystemService(Context.SEARCH_SERVICE);
if (searchManager != null) {
SearchableInfo info = searchManager.getSearchableInfo(getComponentName());
searchView.setSearchableInfo(info);
}
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextChange(String newText) {
searchQuery = newText;
// Load search data on respective fragment
if (mActiveMenu == MENU_FIRST) // First
{
BBCSportFragment.doFilter(newText);
}
if (mActiveMenu == MENU_SECOND) // First
{
BBCSportFragment.doFilter(newText);
}
if (mActiveMenu == MENU_THIRD) // First
{
BBCSportFragment.doFilter(newText);
}
if (mActiveMenu == MENU_FOURTH) // First
{
BBCSportFragment.doFilter(newText);
} else if (mActiveMenu == MENU_FIFTH) // Second
{
ESPNFragment.doFilter(newText);
}
return true;
}
@Override
public boolean onQueryTextSubmit(String query) {
//searchView.clearFocus();
return false;
}
});
// Handling focus change of search view
searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
// Focus changed after pressing back key or pressing done in keyboard
if (!hasFocus) {
searchQuery = "";
}
}
});
}
private void setupDrawerContent(NavigationView navigationView) {
navigationView.setNavigationItemSelectedListener(
menuItem -> {
selectDrawerItem(menuItem);
return true;
});
}
public void selectDrawerItem(MenuItem menuItem) {
// Create a new fragment and specify the fragment to show based on nav item clicked
Fragment fragment = null;
Class fragmentClass = null;
switch (menuItem.getItemId()) {
case R.id.bbcsports_fragment:
fragmentClass = BBCSportFragment.class;
break;
case R.id.talksports_fragment:
fragmentClass = TalkSportsFragment.class;
break;
case R.id.foxsports_fragment:
fragmentClass = FoxSportsFragment.class;
break;
case R.id.footballitalia_fragment:
fragmentClass = FootballItaliaFragment.class;
break;
case R.id.espn_fragment:
fragmentClass = ESPNFragment.class;
break;
default:
}
try {
fragment = (Fragment) fragmentClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();
// Highlight the selected item has been done by NavigationView
menuItem.setChecked(true);
// Set action bar title
setTitle(menuItem.getTitle());
// Close the navigation drawer
mDrawer.closeDrawers();
}
private ActionBarDrawerToggle setupDrawerToggle() {
// NOTE: Make sure you pass in a valid toolbar reference. ActionBarDrawToggle() does not require it
// and will not render the hamburger icon without it.
return new ActionBarDrawerToggle(this, mDrawer, toolbar, R.string.drawer_open, R.string.drawer_close);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggles
drawerToggle.onConfigurationChanged(newConfig);
}
}
</code></pre>
| <java><android><list> | 2019-06-03 08:44:15 | LQ_CLOSE |
56,424,416 | Is it possible to convert an Android Studio App to IOS? (Java) | <p>So I'm currently developping an app in Android Studio, being Java the programming languague used. I wanted to know If It's possible to convert it later into IOS, and if so, how should i do it.</p>
<p>Thanks in advance for all responses.</p>
| <java><android><ios> | 2019-06-03 09:23:23 | LQ_CLOSE |
56,425,321 | This iPhone 6 is running iOS 12.3.1 (16F203), which may not be supported by this version of Xcode | <p>Xcode updated to the latest version 10.2 recently and so did the iOS to 12.3.1. My Mac is an older mac that's working on High Sierra and I cannot update to Mojave. I have Xcode 10.1. How do I add the supporting files and where can I find them? Any help would be appriciated. Thank you</p>
<p>I have tried copying the files from a folder with 12.2 and restarting Xcode but to no luck</p>
| <ios><sdk><xcode10.1> | 2019-06-03 10:20:59 | HQ |
56,425,557 | What is the difference between Azure IoT Hub and Azure IoT Central? | <p>I used Azure IoT Hub earlier and now I found a new topic <code>Azure IoT Central</code> which looks as same as the <code>Azure IoT Hub</code>.</p>
<p>I am confused with the difference between these IoT Services, Can anyone explain me the difference and which one is better between <code>Azure IoT Central</code> and <code>Azure IoT Hub</code>? </p>
<p>Thanks in advance</p>
| <azure><azure-iot-hub><azure-iot-sdk><azure-iot-central> | 2019-06-03 10:35:19 | HQ |
56,427,067 | How to overcome issue of ".. is not function" while referring to earlier defined function expression in same js file | On accessing function expression in same file, gives error of .. "is not a function".
I need this below function expression to be available both outside the js file to other .js files and as well inside the same js file.
I have tried below things from below blogs,nothing seems working
https://github.com/nodejs/node/issues/2923
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_function
// this is in abc.js
function qpValidations() {
this.addDaystoGetDate = function(noOfDays){
...
}
this.constructDate = function(){
this.addDaystoGetDate (2);// here issue is coming
}
}
module.exports = new qpValidations();
//need addDaystoGetDate () function to be called in another file as below
var qpFns = require(abc.js);
qpFns.addDaystoGetDate() working as expected.
This is the exact error shown
Failed: this.addDaystoGetDate is not a function
Any help is most appreciated!!, though this issue occured many times with me, tried avoiding file circular dependency and as well clubbing function expression and declaration, had solved the issues earlier, but now again it has poped up not sure what the root cause of this issue..? | <javascript><node.js><function> | 2019-06-03 12:08:29 | LQ_EDIT |
56,428,919 | Object reference not set to instance of object in array | <p>I am making a random object spawn system for my game. The error I'm running into is when assigning the spawns and objects to an array. I am doing this so that a random number generator can pick one from the array to use. However I am getting the error message </p>
<p><code>NullReferenceException: Object reference not set to an instance of an object
RandomSpawn.Start () (at Assets/RandomSpawn.cs:26)
</code></p>
<p>The area that it is coming up in is my start function where I am assigning the spawns and objects to their arrays.</p>
<pre><code>public Transform spawn1;
public Transform spawn2;
public Transform spawn3;
public GameObject obj1;
public GameObject obj2;
public GameObject obj3;
private Transform[] spawns;
private GameObject[] objects;
private bool[] spawnUsed;
private bool[] objectUsed;
private int randomRun = 0;
void Start()
{
spawns[0] = spawn1;
spawns[1] = spawn2;
spawns[2] = spawn3;
objects[0] = obj1;
objects[1] = obj2;
objects[2] = obj3;
}
</code></pre>
<p>I am not sure why I am getting the error as I cannot see any mistakes in how I am assigning them. The variables are the same variables as the arrays that I am assigning them too. I have made sure that they are all attached to the correct part of the script in Unity too.</p>
| <c#><arrays><unity3d> | 2019-06-03 13:58:52 | LQ_CLOSE |
56,429,080 | Ajax.load wont work when pressing a button | <p>I am trying to run ajax.load method when pressing a button. The idea is very simple: change the body of a to something else, by using the ajax.load method. However, i havent been succesful yet, and after researching for a couple of hours, i still havent found the solution. Nothing happens when i press the button.</p>
<p>i have tried to copy/paste one of w3schools examples into my own project, just to see if it works on my computer. The result was that it didn't work on my computer, even after changing the files in the example to my own files. this makes me think that there is a problem with how ajax has been put into the project. but i am not sure.
The example is here: <a href="https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load" rel="nofollow noreferrer">https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load</a> </p>
<p>my test-website is running on a tomcat server and is written in intelliJ. Here is the code:</p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AjaxTest</title>
</head>
<body>
<script>
$("#button").click(function () {
$("#maincontainer").load("ajaxTestAlternativeText.txt")
})
</script>
<div id="maincontainer">
this text needs to change
</div>
<button id="button" type="button"> tryk her :)</button>
</body>
</html>
</code></pre>
<p>in the code above, i change the body to a .txt file. I have also tried with changing to a .html file, but that didn't work either.</p>
| <javascript><jquery><ajax><web> | 2019-06-03 14:09:17 | LQ_CLOSE |
56,429,437 | Why inbuilt classes in Java doesn't have default constructors and arguments need to be passes while creating an object of that class? | I wanted to know why inbuilt classes in Java doesn't have default constructors but arguments need to be passed while creating an object of that class?
Ex:
public final class String
extends Object
implements Serializable, Comparable<String>, CharSequence
public final class Array
extends Object
public final class String
extends Object
implements Serializable, Comparable<String>, CharSequence | <java><constructor><arguments><default-constructor> | 2019-06-03 14:30:49 | LQ_EDIT |
56,430,203 | Regex to accept 5.0 and reject 5.1 | I have been searching for a while , my requirement is I want to accept only integers and if user enters 5.00 that also I want to accept but I do not want to accept 5.01
I have seen regex to accept only integers but that does not meet my requirement completely.
REGEX to ACCEPT:
5.0,
7.0,
9.00,
77
REGEX to DECLINE:
5.1,
55.45 | <regex><regex-lookarounds><regex-group> | 2019-06-03 15:15:12 | LQ_EDIT |
56,432,319 | Find a Char in a PHP String | <p>I'm trying to make a site that prints out some stuff from a database. I need it to print on a new line after the '#' char is encountered in the string retrieved from the database. How do I go about making it print on a new line?</p>
| <javascript><php><html> | 2019-06-03 17:54:33 | LQ_CLOSE |
56,433,781 | "export 'ɵɵinject' was not found in '@angular/core' | <p>I am getting this error when i tried to use MatToolBar in my angular app.
In browser I get <code>Uncaught TypeError: Object(...) is not a function</code> and also get warnings in the console: </p>
<pre><code>WARNING in ./node_modules/@angular/cdk/esm5/text-field.es5.js 146:151-159
"export 'ɵɵinject' was not found in '@angular/core'
WARNING in ./node_modules/@angular/cdk/esm5/a11y.es5.js 2324:206-214
"export 'ɵɵinject' was not found in '@angular/core'
</code></pre>
<p>How can I resolve this? On github it is a closed issue.</p>
| <angular><angular-material> | 2019-06-03 19:57:07 | HQ |
56,435,054 | Xcode 11: Canvas does not show up | <p>I´m trying to get the new Canvas feature from Xcode 11 running, but the Canvas won´t show up. What am I doing wrong?</p>
<p>I just created a new default project (single view app), compiled it and activated 'Editor > Editor and Canvas'. I can navigate to each file in the project, nothing shows up.</p>
<p>What else does need to be done?</p>
| <ios><swift><swiftui><xcode11> | 2019-06-03 22:00:20 | HQ |
56,435,139 | How would I make a program that only prints to lines in a file after it reads a "+" sign in the file | <p>I need my program to store a lot of login information for different users. I can not get it, however, when it is writing, to only write to the lines after the "+" sign.</p>
<p>So, I need it to skip until it see's the plus sign in the file, then, on the next three lines, put data in the file, then on the fourth line put the plus sign, and remove it from it's original location.</p>
<p>I have tried absolutely everything that involves that part of the code.</p>
<p>It needs to work like this </p>
<p>Run #1</p>
<pre><code>bla
bla
bla
+
</code></pre>
<p>Run #2</p>
<pre><code>bla
bla
bla
bla
bla
bla
+
I want this thing to finally work.
</code></pre>
| <ruby><file> | 2019-06-03 22:10:29 | LQ_CLOSE |
56,435,180 | The name 'mousePosition does not exist in the current context | Tried doing 2D and 3D. I want the player to click and drag objects to stack them. I tried copying and pasting code from a video and it still didn't work. | <c#><unity3d> | 2019-06-03 22:16:47 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.