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,592,594 | Selecting today Placed loan and cleared loan in provided table | I am building an application that hold user loan information; but the problem is how to select amount of loan placed today and cleared today; for example if user place loan at 7:00 AM and cleared it at the same day at 13:00 PM how could I get this loan placed today and cleared today? My example table is:
--------------------------------------------------------------------------
id | user_id | placed_loan | cleared loan | plcd date | cld_date | status
--------------------------------------------------------------------------
1 | 2 | 5000.00 | 0.00 | 19/6/12 | | 1
--------------------------------------------------------------------------
2 | 2 | 0.00 | 4000.00 | | 19/6/13 | 2
--------------------------------------------------------------------------
3 | 2 | 2000.00 | 0.00 | 19/6/14 | | 1
--------------------------------------------------------------------------
4 | 3 | 4000.00 | 0.00 | 19/6/14 | | 1
--------------------------------------------------------------------------
5 | 2 | 0.00 | 3000.00 | | 19/6/14 | 2
--------------------------------------------------------------------------
6 | 3 | 0.00 | 2000.00 | | 19/6/15 | 2
--------------------------------------------------------------------------
For example user with ID 2 on 19/6/14 placed a loan of 2000.00 and cleared a loan of 3000.00 this is to say that amount of loan placed on 19/6/14 and cleared on 19/6/14 for the user 2 is 2000.00; and remaining 1000.00 was of 19/6/12. how could I select these data? | <php><mysql><codeigniter> | 2019-06-14 06:28:19 | LQ_EDIT |
56,593,120 | How do you create a multi-line text inside a ScrollView in SwiftUI? | <p>Since <code>List</code> doesn't look like its configurable to remove the row dividers at the moment, I'm using a <code>ScrollView</code> with a <code>VStack</code> inside it to create a vertical layout of text elements. Example below:</p>
<pre class="lang-swift prettyprint-override"><code>ScrollView {
VStack {
// ...
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer mattis ullamcorper tortor, nec finibus sapien imperdiet non. Duis tristique eros eget ex consectetur laoreet.")
.lineLimit(0)
}.frame(width: UIScreen.main.bounds.width)
}
</code></pre>
<p>The resulting <code>Text</code> rendered is truncated single-line. Outside of a <code>ScrollView</code> it renders as multi-line. How would I achieve this inside a <code>ScrollView</code> other than explicitly setting a height for the <code>Text</code> frame ?</p>
| <swift><swiftui> | 2019-06-14 07:07:14 | HQ |
56,593,840 | Check that button is disabled in react-testing-library | <p>I have a React component that generates a button, which content contains <code><span></code> element like this one:</p>
<pre><code>function Click(props) {
return (
<button disable={props.disable}>
<span>Click me</span>
</button>
);
}
</code></pre>
<p>I want to test the logic of this component with the use of <code>react-testing-library</code> and <code>mocha</code> + <code>chai</code>.</p>
<p>The problem which I stuck at the moment is that <code>getByText("Click me")</code> selector return the <code><span></code> DOM node, but for the tests, I need to check <code>disable</code> attribute of the <code><button></code> node. What is the best practice handling such test cases? I see a couple of solutions, but all of them sounds a little bit off:</p>
<ol>
<li>Use <code>data-test-id</code> for <code><button></code> element</li>
<li>Select one of the ancestors of the <code><Click /></code> component and then select the button <code>within(...)</code> this scope</li>
<li>Click on the selected element with <code>fireEvent</code> and check that nothing is happened</li>
</ol>
<p>Can you suggest a better approach?</p>
| <reactjs><react-testing-library> | 2019-06-14 07:56:11 | HQ |
56,596,151 | How to get out the stored data from Firebase? Help me please | I'm not getting the output from Firebase database. It's not returning anything.
I also tried getting value through Querry but it returned databaseerror: cannot convert java.util.hashmap to String
''''
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference().child("Member").push();
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot ds : dataSnapshot.getChildren()) {
String value = ds.getValue(String.class);
Log.d("Tag", "Value is" + value);
}
}
'''' | <java><firebase><firebase-realtime-database> | 2019-06-14 10:20:24 | LQ_EDIT |
56,597,419 | Order multidimensional array according to a second array | <p>I would like to order <code>$ArrayToOrder</code> according to column <code>SecondArrayField2</code> in <code>$SecondArray</code>, where the link between the two arrays are <code>Field_3</code> (in $ArrayToOrder) and <code>SecondArrayField1</code> in $SecondArray.</p>
<pre><code>$ArrayToOrder=Array
(
[0] => Array
(
[Field_1] => 13
[Field_2] => 15
[Field_3] => 3
)
[1] => Array
(
[Field_1] => 25
[Field_2] => 17
[Field_3] => 2
)
[2] => Array
(
[Field_1] => 121
[Field_2] => 20
[Field_3] => 11
)
)
$SecondArray=Array
(
[0] => Array
(
[SecondArrayField1] => 11
[SecondArrayField2] => Bruce
)
[1] => Array
(
[SecondArrayField1] => 3
[SecondArrayField2] => Arthur
)
[2] => Array
(
[SecondArrayField1] => 2
[SecondArrayField2] => Mary
)
)
</code></pre>
<p>Desired result as follows:</p>
<pre><code>$ArrayToOrder=Array
(
[0] => Array
(
[Field_1] => 13
[Field_2] => 15
[Field_3] => 3 //(Arthur)
)
[1] => Array
(
[Field_1] => 121
[Field_2] => 20
[Field_3] => 11 //(Bruce)
)
[2] => Array
(
[Field_1] => 25
[Field_2] => 17
[Field_3] => 2 //(Mary)
)
)
</code></pre>
| <php><arrays><multidimensional-array> | 2019-06-14 11:39:48 | LQ_CLOSE |
56,598,117 | I have to iterate over the famous array and add to favorites people array whose names begin with 'a | i have to pass the values from one array to the orher. With the condition that the name start with "A".
````````````
var favorites = []
var famous = ['alex smith', 'amy whinehouse', 'cameron diaz', 'brad pitt', 'ashton kutcher', 'mark whalberg', 'morgan freeman', 'mila kunis']
for (var i=0; i<famous.length; i++ ) { if(famous[i][0]==="a") {
favorites.push((famous[i][0]).unshift()) }}
````````````
The console return me an error. | <javascript><arrays><loops> | 2019-06-14 12:21:16 | LQ_EDIT |
56,598,480 | Couldn't find meta-data for provider with authority | <p>I have integrated Snapchat's Creative Kit in my Android app. After processing, I receive an image from the server in the form of Byte Array which I am saving to the disk and then sending the file to the Snapchat's Creative Kit as shown below.</p>
<pre><code> private fun downloadImage(
fileName: String,
imageByteArray: ByteArray?): Uri? {
val state = Environment.getExternalStorageState()
if (Environment.MEDIA_MOUNTED == state) {
val downloadDir = File(
Environment.getExternalStorageDirectory(), context?.getString(R.string.app_name)
)
if (!downloadDir.isDirectory) {
downloadDir.mkdirs()
}
val file = File(downloadDir, fileName)
var ostream: FileOutputStream? = null
try {
ostream = FileOutputStream(file)
ostream.write(imageByteArray)
ostream.flush()
ostream.close()
}
} catch (e: IOException) {
e.printStackTrace()
}
val snapCreativeKitApi = SnapCreative.getApi(context!!)
val snapMediaFactory = SnapCreative.getMediaFactory(context!!)
lateinit var snapPhotoFile: SnapPhotoFile
try {
snapPhotoFile = snapMediaFactory.getSnapPhotoFromFile(file)
} catch (e: SnapMediaSizeException) {
return
}
val snapPhotoContent = SnapPhotoContent(snapPhotoFile)
snapCreativeKitApi.send(snapPhotoContent)
}
}
</code></pre>
<p>I have also added <code>provider</code> in the manifest file as shown below:</p>
<pre><code> <provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths_app" />
</provider>
</code></pre>
<p>And in the <code>provider_paths_app.xml</code>, I have tried all the possible paths by referring <a href="https://stackoverflow.com/questions/37953476/android-how-to-get-a-content-uri-for-a-file-in-the-external-storage-public-d">this</a> answer and none of them works.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="My App Name"
path="." />
</paths>
</code></pre>
<p>With the above path, I am getting the below error.</p>
<pre><code>Couldn't find meta-data for provider with authority my.package.name.fileprovider
</code></pre>
<p>All I have to do is send this image to Snapchat but I am unable to figure out what I am doing wrong. Any help will be appreciated.</p>
| <android><android-fileprovider><snapchat> | 2019-06-14 12:43:54 | HQ |
56,599,414 | Is it alright to install Python on D drive? | <p>I am embarking on the journey to learn Python and decided to start with Python 3.7.3 </p>
<p>However, I had a couple of questions before I install python on my computer. </p>
<p>My C drive is an M.2 SSD with only about 60 GBs of space left in it. I do not know how much space my python projects would take as I go on about educating myself in the language. Hence I wanted to know whether installing Python and an IDE like PyCharm in D drive would work. Would it affect where pip installs Modules and Libraries?</p>
| <python-3.x> | 2019-06-14 13:40:55 | LQ_CLOSE |
56,601,390 | Add Class and Remove Class Specific div Area | I found this code on the web, it adds a div when I hover over it.
But how do I do that when the mouse exits the divi the "blue" div is removed?
http://jsfiddle.net/5d922roc
<div id="div1" class="div">
Div 1
</div>
<div id="div2" class="div">
Div 2
</div>
<div id="div3" class="div">
Div 3
</div>
body, html {
height: 101%;
margin: 0;
}
.div {
margin: 20px;
padding: 5px;
height: 500px;
border: solid 1px black;
background-color: #ffffff;
}
.div.blue { background-color: #15158F; }
$(window).scroll(function() {
var scroll = $(window).scrollTop();
var os = $('#div1').offset().top;
var ht = $('#div1').height();
if(scroll > os + ht){
$('#div2').addClass('blue');
}
}); | <jquery><css> | 2019-06-14 15:38:30 | LQ_EDIT |
56,602,272 | item in array wont increment | If there is a duplicate in an array, I want to increment the value. These are my console log results:
this is the map { '1': 1, '2': 1, '3': 1, '4': 2 }
this is the values more than one 4
this is iitem before 4
this is item after 5
this is iitem before 4
this is item after 5
this is the array here [ 1, 4, 2, 3, 4 ]
[ 1, 4, 2, 3, 4 ]
const incrementDuplicate = function(value, arr){
for(let item of arr){
if(item.toString() === value.toString()){
console.log('this is iitem before', item);
item = item+1;
console.log('this is item after', item)
}
}
return arr;
}
const uniqueArraySum = function(arr){
let map = {};
let newArray = [];
for(let item of arr){
if(!map[item]){
map[item] = 1;
} else{
map[item]++;
}
}
console.log('this is the map', map);
for(let item in map){
if(map[item] !== 1){
console.log('this is the values more than one', item);
newArray = incrementDuplicate(item, arr);
console.log('this is the array here', arr);
}
}
return newArray;
}
console.log(uniqueArraySum([1,4,2,3,4])); | <javascript><arrays> | 2019-06-14 16:44:45 | LQ_EDIT |
56,602,353 | Cropping the strings in a list | <p>I have a list which the super-cropped version looks like this:</p>
<pre><code>b=['5:18:00',
'5:19:00',
'5:20:00',
'5:21:00',
'11:31:00',
'11:32:00',
'11:33:00',
'0:01:00',
'0:02:00',
'0:03:00']
</code></pre>
<p>I want to keep the hours, and eliminate the rest. </p>
<p>Your help is appreciated. </p>
| <python><list> | 2019-06-14 16:51:17 | LQ_CLOSE |
56,603,153 | How to inverse an array without forming a new one in C/C++ | I wanted to write a function that would inverse an array and would print the inverted array without forming a new one.
I wrote a code that can inverse an array, but I have to form a new array in order to do that.
```c++
#include<iostream>
using namespace std;
void inverse(int arr[], int size) {
int arr2[size];
for (int i = 0; i < size; i++)
arr2[arr[i] - 1] = i + 1;
for (int i = 0; i < size; i++)
cout << arr2[i] << " ";
}
int main() {
int arr[] = {2, 3, 4, 5, 1};
int size = sizeof(arr) / sizeof(arr[0]);
inverse(arr, size);
return 0;
}
``` | <c++> | 2019-06-14 18:00:31 | LQ_EDIT |
56,603,169 | how to perform as.factor function | i'm having multiple Data.frame namely Accident,Vehicles and Casualties which are to be merged in a single data.frame as Accidents .how to find the factors of the combined data.frame that is how to find factors of Accidents?
## $ accident_severity : char "Serious" "Slight" "Slight" "Slight" ...
## $ number_of_vehicles : int 1 1 2 2 1 1 2 2 2 2 ...
## $ number_of_casualties : int 1 1 1 1 1 1 1 1 1 1 ...
## $ date : char "04/01/2005" "05/01/2005" "06/01/2005" "06/01/2005" ...
## $ day_of_week : char "Tuesday" "Wednesday" "Thursday" "Thursday" ...
## $ time : char "17:42" "17:36" "00:15" "00:15" ... | <r><dataframe> | 2019-06-14 18:01:24 | LQ_EDIT |
56,603,243 | How would I go about compiling code via a web app? | <p>So I'm looking to develop a online ide for Java with intellisense, but how would I go about producing a compiled class version of the source code?</p>
<p>So essentially I want to click</p>
<pre><code>(RUN)
</code></pre>
<p>then upon clicking '(RUN)' the source code in the textarea to be compiled into a class file and a download link provided for that class.</p>
<p>The inner details/features don't require a explanation, but was just used as an example of what I'm trying to achieve, what I want to know overall is how I could run a Java compiler through a web based app/website</p>
| <javascript><java><php><html> | 2019-06-14 18:09:21 | LQ_CLOSE |
56,603,288 | How can I list a pivotfield with orientation xlColumnField in a specific custom order in c# | I pivot on a field Sport. Assume there are 4 sports (Tennis, Baseball, Softball, Football). When the pivot table is created I want the column labels to be displayed in a custom order. How can I do that in C#.
[enter image description here][1]
[1]: https://i.stack.imgur.com/QaId4.png | <c#><excel><pivot-table> | 2019-06-14 18:13:21 | LQ_EDIT |
56,605,211 | Warning: #1292 Truncated incorrect DOUBLE value: 'xxx' | <p>I'm trying to create a MySQL query to select two teams</p>
<p>Using the query below I keep getting this error and its not something I've come across before, google seems to offer a variety of answers but I'm unable to relate the fix to my query.</p>
<pre><code>SELECT
m.idm,
m.buteq1,
m.buteq2,
tf.eq_name,
ts.eq_name
FROM wpap_match m
INNER JOIN wpap_equipes tf
on tf.eq_name = tf.id
INNER JOIN wpap_equipes ts
on ts.eq_name = ts.id
</code></pre>
<p>Result:</p>
<pre><code> Warning: #1292 Truncated incorrect DOUBLE value: 'ESS'
</code></pre>
<p>Can any one help to fix this ?</p>
| <mysql><sql> | 2019-06-14 21:16:02 | LQ_CLOSE |
56,605,659 | Connot find runtime 'node' on PATH. Vscode Python | <p>I installed visual studio code to practice python.</p>
<p>After I played around with settings now I cannot debug anything. Getting the error:</p>
<p><a href="https://i.stack.imgur.com/VKQz5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VKQz5.png" alt="enter image description here"></a></p>
<p>I deleted everything from setting already.
I also tried to reinstall vscode. </p>
<p>But nothing helps. </p>
<p>What else should I do?</p>
| <python><node.js><visual-studio-code> | 2019-06-14 22:04:16 | LQ_CLOSE |
56,606,689 | How is the content of this webpage protected? | <p>I have a little homework webpage, so I am often looking for ideas. I went to Liz's ielts <a href="https://ieltsliz.com/ielts-multiple-choice-listening-turtles/" rel="nofollow noreferrer">page</a>.</p>
<p>Normally, a right click and you can look at the source code, but Liz is smart: if you right click you just get a "Alert content is protected" message.</p>
<p>Very interesting! I've never seen that before. How is that done?</p>
| <html> | 2019-06-15 01:33:09 | LQ_CLOSE |
56,608,967 | How can i transplant from activity to fragment? | Now i'm trying to transparent opensource expandable layout but the problem is that source made by activity but i want to apply my fragment layout
what should i do?
When i try to Transplant it's occured error...
****This is what i want to try transparent****
package com.expandablelistdemo;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ExpandableListView;
import com.expandablelistdemo.Model.DataItem;
import com.expandablelistdemo.Model.SubCategoryItem;
import java.util.ArrayList;
import java.util.HashMap;
public class MainActivity extends AppCompatActivity {
private Button btn;
private ExpandableListView lvCategory;
private ArrayList<DataItem> arCategory;
private ArrayList<SubCategoryItem> arSubCategory;
private ArrayList<ArrayList<SubCategoryItem>> arSubCategoryFinal;
private ArrayList<HashMap<String, String>> parentItems;
private ArrayList<ArrayList<HashMap<String, String>>> childItems;
private MyCategoriesExpandableListAdapter myCategoriesExpandableListAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this,CheckedActivity.class);
startActivity(intent);
}
});
setupReferences();
}
private void setupReferences() {
lvCategory = findViewById(R.id.lvCategory);
arCategory = new ArrayList<>();
arSubCategory = new ArrayList<>();
parentItems = new ArrayList<>();
childItems = new ArrayList<>();
DataItem dataItem = new DataItem();
dataItem.setCategoryId("1");
dataItem.setCategoryName("Adventure");
arSubCategory = new ArrayList<>();
for(int i = 1; i < 6; i++) {
SubCategoryItem subCategoryItem = new SubCategoryItem();
subCategoryItem.setCategoryId(String.valueOf(i));
subCategoryItem.setIsChecked(ConstantManager.CHECK_BOX_CHECKED_FALSE);
subCategoryItem.setSubCategoryName("Adventure: "+i);
arSubCategory.add(subCategoryItem);
}
dataItem.setSubCategory(arSubCategory);
arCategory.add(dataItem);
dataItem = new DataItem();
dataItem.setCategoryId("2");
dataItem.setCategoryName("Art");
arSubCategory = new ArrayList<>();
for(int j = 1; j < 6; j++) {
SubCategoryItem subCategoryItem = new SubCategoryItem();
subCategoryItem.setCategoryId(String.valueOf(j));
subCategoryItem.setIsChecked(ConstantManager.CHECK_BOX_CHECKED_FALSE);
subCategoryItem.setSubCategoryName("Art: "+j);
arSubCategory.add(subCategoryItem);
}
dataItem.setSubCategory(arSubCategory);
arCategory.add(dataItem);
dataItem = new DataItem();
dataItem.setCategoryId("3");
dataItem.setCategoryName("Cooking");
arSubCategory = new ArrayList<>();
for(int k = 1; k < 6; k++) {
SubCategoryItem subCategoryItem = new SubCategoryItem();
subCategoryItem.setCategoryId(String.valueOf(k));
subCategoryItem.setIsChecked(ConstantManager.CHECK_BOX_CHECKED_FALSE);
subCategoryItem.setSubCategoryName("Cooking: "+k);
arSubCategory.add(subCategoryItem);
}
dataItem.setSubCategory(arSubCategory);
arCategory.add(dataItem);
Log.d("TAG", "setupReferences: "+arCategory.size());
for(DataItem data : arCategory){
// Log.i("Item id",item.id);
ArrayList<HashMap<String, String>> childArrayList =new ArrayList<HashMap<String, String>>();
HashMap<String, String> mapParent = new HashMap<String, String>();
mapParent.put(ConstantManager.Parameter.CATEGORY_ID,data.getCategoryId());
mapParent.put(ConstantManager.Parameter.CATEGORY_NAME,data.getCategoryName());
int countIsChecked = 0;
for(SubCategoryItem subCategoryItem : data.getSubCategory()) {
HashMap<String, String> mapChild = new HashMap<String, String>();
mapChild.put(ConstantManager.Parameter.SUB_ID,subCategoryItem.getSubId());
mapChild.put(ConstantManager.Parameter.SUB_CATEGORY_NAME,subCategoryItem.getSubCategoryName());
mapChild.put(ConstantManager.Parameter.CATEGORY_ID,subCategoryItem.getCategoryId());
mapChild.put(ConstantManager.Parameter.IS_CHECKED,subCategoryItem.getIsChecked());
if(subCategoryItem.getIsChecked().equalsIgnoreCase(ConstantManager.CHECK_BOX_CHECKED_TRUE)) {
countIsChecked++;
}
childArrayList.add(mapChild);
}
if(countIsChecked == data.getSubCategory().size()) {
data.setIsChecked(ConstantManager.CHECK_BOX_CHECKED_TRUE);
}else {
data.setIsChecked(ConstantManager.CHECK_BOX_CHECKED_FALSE);
}
mapParent.put(ConstantManager.Parameter.IS_CHECKED,data.getIsChecked());
childItems.add(childArrayList);
parentItems.add(mapParent);
}
ConstantManager.parentItems = parentItems;
ConstantManager.childItems = childItems;
myCategoriesExpandableListAdapter = new MyCategoriesExpandableListAdapter(this,parentItems,childItems,false);
lvCategory.setAdapter(myCategoriesExpandableListAdapter);
}
}
**** This is my Fragment Activity ****
public class TabFragment1 extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.tab_fragment_1, container, false);
}
}
I'm trying to several days but i can't find how to do... | <android><android-activity><layout><fragment><expandable> | 2019-06-15 09:06:42 | LQ_EDIT |
56,608,996 | SwiftUI - Search in List Header | <p>I am trying to to recreate what everyone know from UITableView with SwiftUI: A simple search field in the header of the tableview:</p>
<p><a href="https://i.stack.imgur.com/KZoXE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KZoXE.png" alt="A simple search field in the header of the tableview"></a></p>
<p>However, the List View in SwiftUI does not even seem to have a way to add a header or footer. You can set a header with a TextField to sections like this:</p>
<pre><code>@State private var searchQuery: String = ""
var body: some View {
List {
Section(header:
Group{
TextField($searchQuery, placeholder: Text("Search"))
.background(Color.white)
}) {
ListCell()
ListCell()
ListCell()
}
}
}
</code></pre>
<p>However, I am not sure if this is the best way to do it because:</p>
<ol>
<li>The header does not hide when you scroll down as you know it from UITableView.</li>
<li>The SearchField does not look like the search field we know and love.</li>
</ol>
<p>Has anyone found a good approach? I don't want to fall back on UITableView.</p>
| <uitableview><search><textfield><swiftui> | 2019-06-15 09:10:57 | HQ |
56,609,373 | How are Pointer Expressions in C are solved? Ex: ((4* (-(*p2)))/(*p1)+10 where *p1=12 ,*p2=4 | <p>I want to solve pointer problems.</p>
<p>The code was taken from book & I want to know how it was compiled</p>
<p>Ex: ((4* (-(*p2)))/(*p1)+10 where *p1=12 ,*p2=4</p>
<p>expected output is 9 but why?</p>
| <c> | 2019-06-15 10:11:41 | LQ_CLOSE |
56,611,299 | How to delete a pointer for an object? | <p>I've searched for this but didn't find a similar topic.</p>
<p>If I have an object class, for example <code>class Object { ... };</code> , and I have this pointer for it: <code>Object* p = new Object();</code></p>
<p>I was wondering what is the correct way to delete this pointer, is it this:</p>
<p><code>delete (Object*) p;</code></p>
<p>Or this:</p>
<p><code>delete[] p;</code></p>
<p>I can't tell which one is the correct, I would be happy if someone could tell me what's right.
Thank you <3</p>
| <c++><pointers><free> | 2019-06-15 14:33:49 | LQ_CLOSE |
56,611,517 | How do I compare three Boolean values when the comparisons are long? | I am trying to set up a condition check for my code. However, the code has become long and complex. I need a simpler version of the code that can easily do the job.
I have tried to compare three boolean values separated by brackets such that I only compare two values.
if ((((userState[0][0]&&userState[0][1])&&(userState[0][2])))||(((userState[1][0]&&userState[1][1])&&(userState[1][2])))||(((userState[2][0]&&userState[2][1])&&(userState[2][2])))||(((userState[0][0]&&userState[1][0])&&(userState[2][0])))||(((userState[0][1]&&userState[2][1])&&(userState[1][1])))||(((userState[0][2]&&userState[2][2])&&(userState[1][2])))||(((userState[0][0]&&userState[2][2])&&(userState[1][1])))||(((userState[1][2]&&userState[1][1])&&(userState[2][0])))) | <java> | 2019-06-15 15:01:41 | LQ_EDIT |
56,612,640 | How to fix program that calculates minimum amount of coins in change | I have a homework assignment in which we have to write a program that outputs the change to be given by a vending machine using the lowest number of coins. E.g. £3.67 can be dispensed as 1x£2 + 1x£1 + 1x50p + 1x10p + 1x5p + 1x2p.
However, my program is outputting the wrong numbers. I know there will probably be rounding issues, but I think the current issue is to do with my method of coding this.
change=float(input("Input change"))
twocount=0
onecount=0
halfcount=0
pttwocount=0
ptonecount=0
while change!=0:
if change-2>-1:
change=change-2
twocount+=1
else:
if change-1>-1:
change=change-1
onecount+=1
else:
if change-0.5>-1:
change=change-0.5
halfcount+=1
else:
if change-0.2>-1:
change=change-0.2
pttwocount+=1
else:
if change-0.1>-1:
change=change-0.1
ptonecount+=1
else:
break
print(twocount,onecount,halfcount,pttwocount,ptonecount)
RESULTS:
Input: 2.3
Output: 11010
i.e. 3.2
Input: 3.2
Output:20010
i.e. 4.2
Input: 2
Output: 10001
i.e. 2.1 | <python><python-3.x><algorithm> | 2019-06-15 17:29:35 | LQ_EDIT |
56,614,661 | Xcode: Could not locate installed application. Install claimed to have succeeded, but application could not be found on device | <p>I manually deleted my app from the iPhone and now I get this error message when trying to run it again from Xcode.</p>
<p>I cleaned the build folder, restarted the device, Xcode and the Mac, nothing helps.</p>
<p>I also tried everything that's mentioned here: <a href="https://stackoverflow.com/questions/37241579/install-claimed-to-have-succeeded-but-application-could-not-be-found-on-device">Install claimed to have succeeded, but application could not be found on device</a></p>
<p>How do I force a re-installation?</p>
| <ios><xcode> | 2019-06-15 22:32:40 | HQ |
56,615,081 | Layout in SwiftUI with horizontal and vertical alignment | <p>I'm trying to accomplish this layout</p>
<p><a href="https://i.stack.imgur.com/fetjK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fetjK.png" alt="desired layout"></a></p>
<p>If I try HStack wrapped in VStack, I get this:</p>
<p><a href="https://i.stack.imgur.com/yXRmj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yXRmj.png" alt="HStack in VStack"></a></p>
<p>If I try VStack wrapped in HStack, I get this:</p>
<p><a href="https://i.stack.imgur.com/GaFAh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GaFAh.png" alt="VStack in HStack"></a></p>
<p>Is there a way to baseline align the text with the textfield and get standard spacing from the longest label to the start of the aligned textfields?</p>
| <alignment><swiftui> | 2019-06-16 00:03:56 | HQ |
56,615,513 | New UINavigationBar appearance in detail pane of UISplitViewController in iOS 13 | <p>Under iOS 13, if you setup a scrollable root view controller (such as a UITableViewController) in a navigation controller and then put that navigation controller in the detail pane of a UISplitViewController, then the nav bar's background isn't visible when the scrollable content is at the top.</p>
<p>You can see this by creating a new iOS project based on the Master/Detail template. Then modify the storyboard to use a UITableViewController inside the detail pane's nav controller. Put the device/simulator in Light Appearance mode (it shows the problem better than Dark mode). Run the app and notice the nav bar area is the same color as the table view background. Now scroll the table view up and the nav bar color changes to the standard light gray. Let the table view return to the top and the nav bar color disappears again.</p>
<p>I've only seen this in the detail pane of a split view controller.</p>
<p>How do you turn off this "feature" so that the nav bar looks normal just like every other nav bar used anywhere else other than the detail pane of a split view controller?</p>
<p>There are no relevant API changes for <code>UISplitViewController</code> or <code>UISplitViewControllerDelegate</code>. There's nothing in <code>UINavigationController</code> either.</p>
<p>After some digging I found one workaround but I'd love to find a way to avoid having to do this.</p>
<p>The <code>UINavigationBar</code> class now has some new properties for setting its appearance. Oddly, none of these are mentioned under the "Customizing the Appearance of a Navigation Bar" in the documentation for <code>UINavigationBar</code>.</p>
<p>There are three new properties in iOS 13:</p>
<ul>
<li><code>standardAppearance</code></li>
<li><code>compactAppearance</code></li>
<li><code>scrollEdgeAppearance</code></li>
</ul>
<p>All three are of type <code>UINavigationBarAppearance</code>.</p>
<p>Only the first one is set by default.</p>
<p>Even though <code>scrollEdgeAppearance</code> is <code>nil</code>, the detail pane of a split controller acts as if this has been set with the <code>backgroundColor</code> set to the <code>clear</code> color.</p>
<p>So the workaround is to add the following line to the <code>viewDidLoad</code> method of the navigation controller's root view controller:</p>
<pre><code>navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance
</code></pre>
<p>Why is this needed only in this one case? Is there a more correct solution other than adding this code?</p>
<p>I noticed that none of Apple's apps (Mail, Notes, and Files at least) seem to use this "feature".</p>
| <ios><uinavigationbar><uisplitviewcontroller><ios13> | 2019-06-16 01:56:09 | HQ |
56,617,690 | How can i select same name Radio button with java script? | I have multiple radio button with same name and id and want to select radio button with javascirpt .
<input type="radio" name="Custom.SELECTED_INDEX" id="Custom.SELECTED_INDEX" value="1" class="middle">
<input type="radio" name="Custom.SELECTED_INDEX" id="Custom.SELECTED_INDEX" value="2" class="middle">
<input type="radio" name="Custom.SELECTED_INDEX" id="Custom.SELECTED_INDEX" value="3" class="middle">
I am trying with below code but that is not working
(function() { document.getElementById('Custom.SELECTED_INDEX')[2].checked = true; return 'success'; })();
| <javascript><android><html><webview><radio-button> | 2019-06-16 09:41:12 | LQ_EDIT |
56,618,295 | even number for both value 1 and value 2 | i'm only getting random even number for value 1 . i need it for both value 1 and 2. Can anyone teach me how to solve it?
i'm using threadlocalrandom for it
public void setQuestion(){
Random rand = new Random();
int value1 = ThreadLocalRandom.current().nextInt(10,100);
int value2 = ThreadLocalRandom.current().nextInt(2,20);
int randomquestion = rand.nextInt(2);
if (randomquestion == 1){
question.setText("What is"+ value1 + "+" + value2 +" ? ");
expected= "" + (value1 + value2);
}else if (randomquestion == 2){
question.setText("What is"+value1 +"-" + value2 +" ? ");
expected="" + (value1 - value2);
}else if (randomquestion == 3){
question.setText("What is"+value1+ "*" + value2 +" ? ");
expected ="" + (value1*value2);
}else {
question.setText("What is"+value1+"/" + value2 +"?");
expected="" + (value1/value2);
}
sumanswer.setText("Total Score ="+ correctanswer +"Correct and"+ wronganswer + "Wrong");
}
i expect it can be in random even number for both value | <java><android> | 2019-06-16 11:16:14 | LQ_EDIT |
56,619,836 | VSCode: clear integrated terminal when debug starts | <p>when using <code>"console": "integratedTerminal"</code> in a launch.json the program output is redirected to the integrated terminal. However, after terminating a debug session and starting another one, the terminal is re-used which can be pretty annoying.</p>
<p>I have not found a way to make VSCode clear the terminal -- it is possible to <a href="https://code.visualstudio.com/Docs/editor/tasks#_output-behavior" rel="noreferrer">clear the panel in tasks.json</a> with the <code>clear: true</code> property, this however only works for tasks such as the build task but has no effect on the debug panel.</p>
<p>Help is greatly appreciated.</p>
<p>Thanks in advance<br>
-Simon</p>
| <visual-studio-code> | 2019-06-16 14:39:42 | HQ |
56,619,985 | Strange chars printed on exceeding bounds of undefined length char array | <p>I am pretty new to C and I have tried the following code</p>
<pre><code>#include <stdio.h>
int main ()
{
char str[] = "a";
for(int x = 0; x < 20; x++)
{
printf("%c\t%d\n", str[x],str[x]);
}
return 0;
}
</code></pre>
<p>For which I get the following output</p>
<pre><code>a 97
0
0
s 115
< 60
� -62
) 41
P 80
� -42
� -128
0 48
� -41
> 62
� -119
� -88
U 85
0
0
� -105
� -85
</code></pre>
<p>After <code>str[2]</code> the chars are random for each execution, can someone please explain this behavior.</p>
| <c> | 2019-06-16 14:59:00 | LQ_CLOSE |
56,621,510 | Question from SQL exam that I find hard to answer | <p>I had an exam from relational databases.
I had a question (translated from Polish) which I cannot find any clues to answer:
"What are the problems (three of them) of data deletion in presence of foreign key?
What solutions are available?"
RD are my achilles' heel :(</p>
| <sql><testing><relational-database> | 2019-06-16 18:21:47 | LQ_CLOSE |
56,621,519 | Nodejs write file progress bar in html | <p>I am trying to generate a file in nodejs and I want to show writing file progress bar in the client-side HTML page. because I am writing a 5 lakh data into a file. once files generates complete in nodejs, it should notify users on the client side.</p>
| <node.js><express> | 2019-06-16 18:23:20 | LQ_CLOSE |
56,621,621 | How can i get the specific data from a json file? | I'm trying to make web application about movies with a movie Api. Then I copied first two parts of search results and stored them in a variable how can I get the specific data from variable?
I've considered like the json file is an object and tried to get the specific data but I couldn't.
This is the first two parts of search results that I stored in a variable.
~~~
var searchResults = {
page: 1,
total_results: 4109,
total_pages: 206,
results: [
{
original_name: 'Star',
id: 68780,
media_type: 'tv',
name: 'Star',
vote_count: 62,
vote_average: 7.12,
first_air_date: '2016-12-14',
popularity: 16.022,
original_language: 'en',
},
{
original_name: '부암동 복수자들',
id: 74473,
media_type: 'tv',
name: 'Avengers Social Club',
vote_count: 4,
vote_average: 9,
first_air_date: '2017-10-11',
popularity: 1.668,
original_language: 'ko',
}]};
~~~
I want to see names of this movies in console. How can I see names of this two movies in console. | <javascript><node.js><json><api> | 2019-06-16 18:37:50 | LQ_EDIT |
56,621,686 | Ubuntu c++: The easiest way to display a 3D mesh and a 2D image together? | <p>I've been fighting with several libraries (irrlicht, Ogre3D etc) and falling between either too complex libraries or too complex installation guides.
I'd appreciate some pointers to how to achieve what the title suggests.</p>
<p>Thanks</p>
| <c++><ubuntu><3d><2d><mesh> | 2019-06-16 18:45:50 | LQ_CLOSE |
56,621,991 | find the largest,smallest,sum and ave of an array that stops at 0 in C | enter code hereso basically i have to find the largest, smallest, sum, average
ive gotten the average and sum to work buut not find the largest smallest, the average o the positive and the negative numbers. the array stops when 0 is pressed
#include <stdio.h>
int main()
{
int c=0,n, array[100],large,small;
float sum = 0;
//for (c=0;c<n;n++){
do{
c++;
printf("\nEnter number:");
scanf("%d",&array[c]);
sum+=array[c];
}while(array[c]!=0);
if(array[c]>large){large=array[c];}
if(array[c]<small){small=array[c];}
if(array[c]==0){
printf("\n Sum = %.2f\n", sum);
printf("\n Avergae = %.2f", sum/(c-1));
printf("\n Largest %d",large);
}
return 0;
}
| <c><arrays> | 2019-06-16 19:28:36 | LQ_EDIT |
56,622,434 | Unicode Characters do not properly show when received on client | <p>I have a string that includes a character <code>string ="\u2663\"</code>
among others.
I send the string over a socket using the printwriter and read with buffered reader: </p>
<p><code>PrintWriter out = new PrintWriter(c.clientSocket.getOutputStream(),true);</code>
<code>out.println(string)</code></p>
<p><code>BufferedReader in = new BufferedReader(new InputStreamReader(mainSocket.getInputStream()));</code>
<code>in.readLine()</code></p>
<p>When the code is run in eclipse, it renders properly but when testing it via executable jar, the unicode character above shows a "?".</p>
<p>I feel like this is an encoding issue but can't seem to get it to work. </p>
| <java> | 2019-06-16 20:35:58 | LQ_CLOSE |
56,624,160 | HTML set values | I have these 2 table cells. The One span is outside td, other is around td.
<tr height="30">
<span data-name="toDD1" class="sstNumber"> </span>
<td>Y</td>
<span data-name="toDD2" class="sstNumber">
<td>Y</td>
</span>
</tr>
When I do the following code to set values, the value does not get updated.
`document.querySelector('span[data-name="toDD1"]').value = "a";
document.querySelector('span[data-name="toDD2"]').value = "b";`
| <javascript><html> | 2019-06-17 02:47:17 | LQ_EDIT |
56,624,766 | How to remove gap between Header navigation bar and slider revolution in wordpress website | <p>How to remove the gap between the Header navigation bar and slider revolution in WordPress website.</p>
| <css> | 2019-06-17 04:35:04 | LQ_CLOSE |
56,625,770 | How to decrypt smime file in c# application? | I have a file, which is encrypted using this command:
openssl smime -encrypt -aes256 -in fileToencrypt -binary -outform DEM -out encryptedFile public_key
It can be decrypted using command:
openssl smime -decrypt -in encryptedFile -binary -inform DEM -inkey private-key.pem -out decryptedFile
I need to decrypt it using private key (PEM format) in my .NET Core application. What could be the possible solution? | <c#><encryption><bouncycastle><mimekit> | 2019-06-17 06:29:40 | LQ_EDIT |
56,625,803 | how to increment a const without calling/creating a listerner function | In javascript we have addEventlister, this listens to an even and calls a function called a listener function. Is an alternate approach possible where we increment the value of a const without using a function to do this in case of event being triggered?
**Instead of this**
const clickVar = 0;
x.addEventListener("click", RespondClick);
function RespondClick() {
clickVar++;
}
**Sample Alternate implementation**
x.addEventListner(click);
if (event == true){ clickVar++; }
| <javascript> | 2019-06-17 06:32:38 | LQ_EDIT |
56,628,406 | Shape sheet formula for resizing only the parent shape not the sub shapes of the parent shape | A parent shape has 3 sub shapes in it. When parent shape is resized the sub shapes(3) are also getting resized. So, when I resize the parent shape only particular sub shapes should resize not all. A shape sheet formula is required to above situation. | <visio><shapesheet> | 2019-06-17 09:24:05 | LQ_EDIT |
56,628,464 | Qt5: Create valideJSON | <p>I want to create a JSON like this in Qt:
I dont find a example or something like this. </p>
<pre><code>{
"ConfigFile": [
{
"name": "Car",
"valueName": "CarValue",
"actual": {
"actual": 140
},
"upper": {
"actual": 120.1
},
"lower": {
"actual": 2
}
]
}
</code></pre>
| <json><qt><qt5> | 2019-06-17 09:27:58 | LQ_CLOSE |
56,628,707 | How to make something like float: down with relative position? | <p>I'm trying to move the element to the bottom of its parent but only way to do that is to make it positioned absolute but i want it to be relative.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>#output{
height: 100px;
background-color: red;
}
#inner{
height: 30px;
background-color: blue;
/*float: down*/
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="output">
<div id="inner"></div>
</div></code></pre>
</div>
</div>
</p>
| <css> | 2019-06-17 09:43:19 | LQ_CLOSE |
56,628,804 | Rails 6 webpacker cannot find module for installed module | <p>in my Rails 6 project, i added jQuery pushMenu with </p>
<blockquote>
<p>yarn add push-menu </p>
</blockquote>
<p>from <a href="https://www.npmjs.com/package/push-menu" rel="noreferrer">https://www.npmjs.com/package/push-menu</a>
Now i can see this in node-modules folder, as push-menu. however, when i try to import or include from packs, as:</p>
<pre><code>require("push-menu")
</code></pre>
<p>i get the following error:</p>
<pre><code>Uncaught Error: Cannot find module 'push-menu'
at webpackMissingModule (application.js:12)
at Module../app/javascript/packs/application.js (application.js:12)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
at bootstrap:83
</code></pre>
<p>my package.json file looks like this</p>
<pre><code>//package.json file
{
"name": "example_setup",
"private": true,
"dependencies": {
"@rails/actioncable": "^6.0.0-alpha",
"@rails/activestorage": "^6.0.0-alpha",
"@rails/ujs": "^6.0.0-alpha",
"@rails/webpacker": "^4.0.7",
"jquery": "^3.4.1",
"push-menu": "^2.0.8",
"select2": "^4.0.7",
"turbolinks": "^5.2.0"
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3.7.1"
}
}
</code></pre>
<p>What am i doing wrong here?</p>
| <webpack><webpacker><ruby-on-rails-6> | 2019-06-17 09:49:57 | HQ |
56,629,423 | Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): | <p>I have created an application on angular 7 and ionic 4.
I tried to edit app.routing.ts file, setting path and component. From then on I am getting this error below: </p>
<pre><code>ERROR in ./src/app/department/department.module.ts
[ng] Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
[ng] Error: ENOENT: no such file or directory, open 'C:\Users\x\department\department.module.ts'
[ng] at Object.openSync (fs.js:436:3)
[ng] at Object.readFileSync (fs.js:341:35)
[ng] at Storage.provideSync (C:\Users\x\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:98:13)
</code></pre>
| <angular7><ionic4><angular7-router> | 2019-06-17 10:27:43 | HQ |
56,631,670 | how can i set a error to the user as the spinner is mandatory and an item to be selected? | i want to get a error message in spinner, while clicking a button stating the user to "select a city".Can anyone please help me with the mainactivity.java code
<Spinner
android:id="@+id/spinner1" android:layout_width="319dp"
android:layout_height="52dp" android:layout_marginTop="11dp" android:entries="@array/state_arrays"/> | <android><validation><spinner> | 2019-06-17 12:49:00 | LQ_EDIT |
56,631,892 | addSubView SwiftUI View to UIKit UIView in Swift | <p>I have tried to addSubView a SwiftUI View to UIView. <code>self.view.addSubview(contentView)</code></p>
<blockquote>
<p>Error: Cannot convert value of type 'ContentView' to expected argument type
'UIView'</p>
</blockquote>
<p>Kindly help me to implement this UI.</p>
<pre><code>import UIKit
import SwiftUI
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = UIColor.lightGray
let contentView = ContentView()
view.addSubview(contentView) // Error: Cannot convert value of type 'ContentView' to expected argument type 'UIView'
}
}
struct ContentView: View {
var body: some View {
Text("Hello world")
}
}
</code></pre>
| <uikit><swiftui><xcode11><ios13> | 2019-06-17 13:01:11 | HQ |
56,632,094 | Xcode if statement within if statement not working | I need to have an if statement inside an if statement and cant quite get it to work - keep getting an error - expected expression.
The below code is what i've tried:
```
if weightLabel.text == "Weight (lbs)" {
if pickerView == heightPicker {
let titleRow = height[row]
return titleRow
}
else if pickerView == weightPicker {
let titleRow = weight[row]
return titleRow
}
return ""
else if weightLabel.text == "Weight (kgs)" {
if pickerView == heightPicker {
let titleRow = heightCM[row]
return titleRow
}
else if pickerView == weightPicker {
let titleRow = weightKG[row]
return titleRow
}
return ""
}
}
```
Can someone take a look at my current code and help? | <swift><if-statement> | 2019-06-17 13:11:49 | LQ_EDIT |
56,634,024 | What is the regex expression to extract 3 letter word starting with M followed by 2 number? | <p>I want to extract first 3 letters of the sentence which start with M and are followed by 2 digits. </p>
<p>If sentence is M30 INTHE SKY then output should be M30. IF sentence is THE INTHE SKY then answer should be np.nan(i.e. false as it didnot start with M)</p>
| <regex> | 2019-06-17 15:03:47 | LQ_CLOSE |
56,634,198 | Why does std::string_view create a dangling view in a ternary expression? | <p>Consider a method that returns a <code>std::string_view</code> either from a method that returns a <code>const std::string&</code> or from an empty string. To my surprise, writing the method this way results in a dangling string view:</p>
<pre><code>const std::string& otherMethod();
std::string_view myMethod(bool bla) {
return bla ? otherMethod() : ""; // Dangling view!
}
</code></pre>
<p><a href="https://godbolt.org/z/1Hu_p2" rel="noreferrer">https://godbolt.org/z/1Hu_p2</a></p>
<p>It seems that the compiler first puts a temporary <code>std::string</code> copy of the result of <code>otherMethod()</code> on the stack and then returns a view of this temporary copy instead of just returning a view of the reference. First I thought about a comipler bug, but both G++ and clang do this.</p>
<p>The fix is easy: Wrapping <code>otherMethod</code> into an explicit construction of <code>string_view</code> solves the issue:</p>
<pre><code>std::string_view myMethod(bool bla) {
return bla ? std::string_view(otherMethod()) : ""; // Works as intended!
}
</code></pre>
<p><a href="https://godbolt.org/z/Q-sEkr" rel="noreferrer">https://godbolt.org/z/Q-sEkr</a></p>
<p>Why is this the case? Why does the original code create an implicit copy without warning?</p>
| <c++><language-lawyer><c++17><dangling-pointer><string-view> | 2019-06-17 15:15:02 | HQ |
56,634,832 | Why is the for-loop choosing the wrong IF statement path? | <p>So I am doing an online coding challenge and have come across this issue that has me stumped:</p>
<p>This is my code:</p>
<pre><code> static void Main(String[] args)
{
int noOfRows = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < noOfRows; i++)
{
string odds = "";
string evens = "";
//get the input word from console
string word = Console.ReadLine();
for (int j = 0; j < word.Length; j++)
{
//if the string's current char is even-indexed...
if (word[j] % 2 == 0)
{
evens += word[j];
}
//if the string's current char is odd-indexed...
else if (word[j] % 2 != 0)
{
odds += word[j];
}
}
//print a line with the evens + odds
Console.WriteLine(evens + " " + odds);
}
}
</code></pre>
<p>Essentially, the question wants me to get the string from the console line and print the even-indexed characters (starting from index=0) on the left, followed by a space, and then the odd-indexed characters.</p>
<p>So when I try the word 'Hacker', I should see the line printed as "Hce akr". When I debugged it, I saw the code successfully put the letter 'H' on the left (because it is index=0, thus even), and put the letter 'a' on the right (odd index). But then when it got to the letter 'c', instead of going through the first IF path (even index), it skips it and goes to the odd index path, and places it on the right hand side?</p>
<p>The funny thing is when I try the word 'Rank' it works fine and prints the correct statement: "Ra nk", yet other words do not.</p>
<p>Its just bizarre that I'm getting different results.</p>
<p>What am I missing?</p>
| <c#><for-loop><if-statement> | 2019-06-17 15:49:37 | LQ_CLOSE |
56,637,550 | Why the "m" after assigning a vale to a decimal? | <p>In the C# language, why would a decimal data type require an "m" at the end of the value? Would simply not just declaring the data type as 'decimal' be enough as is the case with other numeric data types such as 'int' or 'double'? (I'm new to this and am just curious as it seems to go against my own sense of logical behavior).</p>
<pre><code>{
decimal variableName = 489872.76m; //<---
double variableName = 39.768;
int variableName = 14;
}
</code></pre>
| <c#> | 2019-06-17 19:15:35 | LQ_CLOSE |
56,638,616 | Writing a void as a parameter | <p>(I'm a bit new to programming so if this doesn't make sense just say so)</p>
<p>Let's say that a method takes in a void as parameter. Ex: </p>
<pre><code>method(anotherMethod);
</code></pre>
<p>and I want to write the void inside of the brackets rather than writing the void and putting the name inside so rather than </p>
<pre><code>void theVoid() {
doSomethingHere;
}
</code></pre>
<p>and then calling it like</p>
<pre><code>method(theVoid());
</code></pre>
<p>I wanted to do</p>
<pre><code>method({ doSomethingHere; })
</code></pre>
<p>directly, is it possible to do so?</p>
| <c#><methods> | 2019-06-17 20:38:27 | LQ_CLOSE |
56,639,406 | How to define the type of a custom leaflet control | <p>When looking through the type definitions from <code>@types/leaflet</code> you can see custom controls defined similar to:</p>
<pre><code>export namespace Control {
...
class Zoom extends Control {
constructor(options?: ZoomOptions);
options: ZoomOptions;
}
...
}
</code></pre>
<p>However, when creating your custom control through:</p>
<pre><code>declare module 'leaflet' {
namespace Control {
class CustomControl extends Control {
constructor(options: CustomOptions);
}
}
namespace control {
function customControl(options: CustomOptions): Control.CustomControl;
}
}
L.Control.CustomControl = L.Control.extend({
...
});
</code></pre>
<p>throws a typescript error:
<code>
Type '(new (...args: any[]) => any) & typeof Class' is missing the following properties from type 'typeof CustomControl': Zoom, Attribution, Layers, Scale, and 6 more.
</code></p>
<p>This seems to happen because the namespace and class <code>Control</code> go through Typescript's Declaration Merging. This causes <code>CustomControl</code> to require properties from the namespace rather than just the class.</p>
<p>Is there a way to fix this or circumvent it without forcing type <code>any</code>?</p>
| <typescript><leaflet> | 2019-06-17 22:00:24 | HQ |
56,639,812 | How to change text in a node module package | I'm making a react web app, and I have installed a node module package that is in English (react-timelines) but I need change to Spanish, until now it's just "Today" text that I need to change to "Hoy" but when I go to the package folder inside node_module and change the text it not apply to the project. I have read something about npm link that I don't understan very well and I just want to ask that if it'snt a better way to only change that simple text. Thank you | <javascript><node.js><reactjs><npm> | 2019-06-17 22:59:13 | LQ_EDIT |
56,640,737 | 5th heighest salary from Employee Table and Salary Table using LINQ query | Table1: EmolyeeTable
Eid Ename
1 Jonh
2 James
3 Raj
4 Tisan
5 Jack
Table2: SalaryTable
Sid Salary Eid
1 10000 1
2 20000 2
3 30000 3
4 40000 4
5 50000 5
I want output: 5th heighest Ename, salary using LINQ query
O/P:
Ename Salary
Jack 50000 | <linq> | 2019-06-18 01:40:44 | LQ_EDIT |
56,640,904 | for (var i = 0; i < count; i++) { } == for (var i = 0; i < count; i++) { }. What is this notation and why use it? | <p>Ran into the notation:</p>
<p><code>for (var i = 0; i &lt; count; i++) { }</code> </p>
<p>on <a href="https://blogs.unity3d.com/2015/12/23/1k-update-calls/" rel="nofollow noreferrer">this tutorial</a>. I gather it is equivalent to:</p>
<pre><code>for(var i = 0; i < count; i++) { }
</code></pre>
<p>What is this notation? Why use it? Does it perform better?</p>
| <c#><performance><for-loop><scripting> | 2019-06-18 02:09:38 | LQ_CLOSE |
56,644,898 | Why is my callback returning an undefined value? | <p>I'm trying to get a value from a callback, but it returns an undefined value.
Below is the code I'm using:</p>
<pre><code>function getJSON(url, callback) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (callback) return callback(this.responseText);
}
};
xhttp.open("GET", url, true);
xhttp.send();
}
function getUserName() {
getJSON("this is my url", function(resultJSON) {
return JSON.parse(resultJSON).user[0].displayName;
});
}
var userN = getUserName();
document.getElementById("username").innerHTML = "Hi " + userN;
</code></pre>
<p>I know this has been asked a billion times but I can't get it working the way I need with previous answers. The html element is still giving a "Hi undefined".
Any thought or suggestion?</p>
| <javascript><callback><xmlhttprequest><return><undefined> | 2019-06-18 08:33:13 | LQ_CLOSE |
56,645,287 | How to convert a JSON file to CSV in pandas python , where JSON file format is different and getting value error | Hi I have received a JSON file with below format, please let me know how do i parse this JSOn file and convert them to CSV
JSON file format
{'Sections': [{'MC': [[{'IsMandatory': False,
'LD': None,
'propNameValuepair': [{'PropertyType': 0,
'columnSize': 0,
'isEnabled': False,
'isStructured': False,
'isUpdated': False,
'propDisplayName': 'CC',
'propName': 'u4_c_c',
'propValue': 'Bottle',
'selectedComponent': None,
'tcProperty': None},
{'PropertyType': 0,
'columnSize': 0,
'isEnabled': False,
'isStructured': False,
'isUpdated': False,
'propDisplayName': 'Com Com',
'propName': 'u4_com_com',
'propValue': 'Multi-layer',
'selectedComponent': None,
'tcProperty': None},
Code
import json
with open('a.json') as data_file:
data = json.load(data_file)
import pandas as pd
df = pd.concat([pd.DataFrame(x) for x in data], ignore_index=False)
print(df)
Error:
ValueError: DataFrame constructor not properly called! | <python><json><python-3.x><pandas><csv> | 2019-06-18 08:55:37 | LQ_EDIT |
56,647,786 | Replace Autoprefixer browsers option to Browserslist | <p>i am using [Metronic v6.03]</p>
<p>I followed the Quick Start tutorial on documentation.
<a href="https://keenthemes.com/metronic/?page=docs" rel="noreferrer">https://keenthemes.com/metronic/?page=docs</a></p>
<p>If I give in the command ‘gulp build’ I get a message :</p>
<p>“Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.</p>
<p>Using browsers option cause some error. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.</p>
<p>If you really need to use option, rename it to overrideBrowserslist.</p>
<p>Learn more at:
<a href="https://github.com/browserslist/browserslist#readme" rel="noreferrer">https://github.com/browserslist/browserslist#readme</a>
<a href="https://twitter.com/browserslist" rel="noreferrer">https://twitter.com/browserslist</a>”</p>
<p>The Theme don’t compiles correctly.</p>
<p>NPM version : 6.9.0</p>
<p>Yarn version : 1.16.0</p>
<p>Gulb version</p>
<p>CLI : 2.2.0</p>
<p>Local version : 4.0.2</p>
<p>I changed the line browserlist at package.json to</p>
<p>"browserslist": [</p>
<pre><code>"last 1 version",
"> 1%",
"maintained node versions",
"not dead"
</code></pre>
<p>]</p>
<p>and try to replace the line with :</p>
<p>"browserslist": [</p>
<pre><code>"defaults"
</code></pre>
<p>]</p>
<p>On Linux I added a file .browserslistrc with the lines above.</p>
| <metronic><gulp-autoprefixer> | 2019-06-18 11:10:47 | HQ |
56,648,263 | Android dependency 'com.google.android.gms:play-services-stats' has different version for the compile (16.0.1) and runtime (17.0.0) classpath | <p>Yesterday my app was building correctly and today without changing anything I'm not able to build anymore, I'm getting this error:</p>
<blockquote>
<p>Android dependency 'com.google.android.gms:play-services-stats' has >different version for the compile (16.0.1) and runtime (17.0.0) >classpath. You should manually set the same version via >DependencyResolution</p>
</blockquote>
<p>I tried to bypass this with "com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true" and clean the project many times, but the error is still here.</p>
<p>My app/build.gradle file :</p>
<pre><code>apply plugin: "com.android.application"
apply plugin: "com.android.application"
apply plugin: "io.fabric"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.yapero"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled true
versionCode 743
versionName "1.74"
ndk {
abiFilters "armeabi-v7a", "x86"
}
versionNameSuffix '3'
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
exclude 'META-INF/main.kotlin_module'
exclude 'META-INF/-no-jdk.kotlin_module'
}
dexOptions {
javaMaxHeapSize "4g"
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':@segment_analytics-react-native')
implementation project(':react-native-webview')
implementation project(':react-native-version-check')
implementation project(':react-native-firebase')
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {transitive = true}
//implementation project(':react-native-version-check')
implementation project(':react-native-maps')
implementation project(':react-native-intercom')
implementation 'io.intercom.android:intercom-sdk-base:5.+'
implementation 'io.intercom.android:intercom-sdk-fcm:5.+'
implementation project(':react-native-fbsdk')
implementation project(':react-native-device-info')
implementation project(':react-native-appsflyer')
implementation project(':react-native-text-input-reset')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-fast-image')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
implementation "com.google.firebase:firebase-auth:16.2.1"
implementation "com.google.firebase:firebase-firestore:17.1.5"
implementation "com.google.firebase:firebase-messaging:17.5.0"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation 'com.android.support:multidex:1.0.0'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
</code></pre>
<p>My build.gradle:</p>
<pre><code>buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
</code></pre>
<p>Does someone know how to correct or bypass this version check ? Ask me if you need more informations.</p>
| <java><react-native><google-play-services> | 2019-06-18 11:37:07 | HQ |
56,649,171 | Homework IF statements in Python | <p>I'm new to Python and I want to make it from KLM, United, and ANA. How do I do that? Thanks</p>
<pre class="lang-py prettyprint-override"><code>airlines = ['klm', 'united', 'ana']
for airline in airlines:
if(airline == 'klm' and airline == 'ana'):
print(airline.upper())
else:
print(airline.title())
</code></pre>
<p>I want it to show:
KLM,
United,
ANA</p>
| <python> | 2019-06-18 12:28:05 | LQ_CLOSE |
56,649,252 | Jquery + Javascript Afficher DIV | Bonjour,
Avez-vous une idée pour faire afficher ma DIV "Transparent" (Jquery) via ma fonction test() en javascript ? merci d'avance | <javascript><jquery> | 2019-06-18 12:32:09 | LQ_EDIT |
56,649,524 | C++: Accessing specific value from single key-multiple value containers | So, it happens that I'm working on the task. So I was trying to implement a multi-value containers using C++ and to freely access each of the values inside. I have int key; values like X, Y, Width, Height as input.
I was trying to extract the values from each key.
But obviously, the code doesn't work in this case.
Would like some advice whether this can be done or any predefined container libraries with better flexibility in terms of accessing multiple values.
tried with independent single-key, single-value 'multimap' containers, but it consume too much memory space and drag performance
multimap<int, multimap <multimap<int, int>, multimap<int, int>>> BlobPos = {};
//[<1,{(2,3),(4,5)}>,<2,{(6,7),(8,9)}>
for (auto it = BlobPos.begin();it != BlobPos.end(); it++) {
auto X = it->second-> first->first;
auto Y = it->second->first->second;
auto H = it->second->second->first;
auto W = it->second-second->second;
cout << X << Y << H << W;
2 3 4 5
6 7 8 9 | <c++><iterator><containers> | 2019-06-18 12:46:52 | LQ_EDIT |
56,650,169 | how do i Copy Query in power query To another Work Book | I have a Query that i Made in one of my Work Book and now i Need to repeat it in many Other Work Book as well, How can i Copy it to Wall pg my Work Book?
| <excel><powerquery> | 2019-06-18 13:21:34 | LQ_EDIT |
56,650,711 | Cannot find module that is defined in tsconfig `paths` | <p>I am trying to setup aliases for my mock server. Whenever I try to compile <code>ts</code> files, it returns error that it couldn't find proper modules even though those are defined in <code>tsconfig,json</code>-><code>paths</code></p>
<p>Folder structure:</p>
<pre class="lang-sh prettyprint-override"><code>├── server
│ └── src
│ └──/json
├── src
│ └──/modules
├── tsconfig.json
</code></pre>
<p>Here is my <code>tsconfig.json</code></p>
<pre><code>{
"compilerOptions": {
"baseUrl": "./src",
"experimentalDecorators": true,
"jsx": "react",
"lib": [
"dom",
"es2015",
"es2015.promise"
],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"paths": {
"@project/app/modules/*": [
"modules/*"
],
"@project/server/data/*": [
"../server/src/json/*"
]
},
"sourceMap": true,
"target": "es5"
},
"exclude": [
"node_modules",
"tools"
]
}
</code></pre>
<p>Error:
<code>Error: Cannot find module '@project/server/data/accounts/accountsList'</code></p>
| <typescript><alias><tsc><tsconfig><ts-node> | 2019-06-18 13:48:36 | HQ |
56,653,212 | Filtering files with the given range of inputin perl | <p>The perl script which takes an input i.e name of the file, I need to find all the files that matches with that pattern.</p>
<pre><code>Example: given input as 2019052300 2019052323 (YYYYMMDDHH)
</code></pre>
<p>Here, I need to fetch all the files that named with 2019052300 to 2019052323. like 2019052300,2019052301.. 2019052323.</p>
<p>Thanks!</p>
| <linux><shell><perl><unix> | 2019-06-18 16:13:09 | LQ_CLOSE |
56,656,777 | "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm | <p>I am trying to plot a simple graph using pyplot, e.g.:</p>
<pre><code>import matplotlib.pyplot as plt
plt.plot([1,2,3],[5,7,4])
plt.show()
</code></pre>
<p>but the figure does not appear and I get the following message:</p>
<pre><code>UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
</code></pre>
<p>I saw in several places that one had to change the configuration of matplotlib using the following:</p>
<pre><code>import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
</code></pre>
<p>I did this, but then got an error message because it cannot find a module:</p>
<pre><code>ModuleNotFoundError: No module named 'tkinter'
</code></pre>
<p>Then, I tried to install "tkinter" using <code>pip install tkinter</code> (inside the virtual environment), but it does not find it:</p>
<pre><code>Collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter
</code></pre>
<p>I should also mention that I am running all this on Pycharm Community Edition IDE using a virtual environment, and that my operating system is Linux/Ubuntu 18.04.</p>
<p><strong>I would like to know how I can solve this problem in order to be able to display the graph.</strong></p>
| <python><matplotlib><pycharm> | 2019-06-18 20:43:38 | HQ |
56,657,555 | Is there a way to delete all the 'junk' that comes when printing a file from the internet | I want to print a file from the internet with the \n' b' etc.
```python
from urllib.request import urlopen
data = urlopen('http://willswebdev.000webhostapp.com/plan.txt')
for line in data:
print(line)
```
```
b'Hello Series\n'
```
This is the first line how do I get rid of b' and \n'?? | <python><urllib> | 2019-06-18 21:56:38 | LQ_EDIT |
56,657,683 | Postgres Docker image is not creating database with custom name | <p>The documentation of the <code>postgres</code> Docker image <a href="https://hub.docker.com/_/postgres/#postgres_db" rel="noreferrer">says</a> the following about the env var <code>POSTGRES_DB</code>:</p>
<blockquote>
<p>This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.</p>
</blockquote>
<p>I have found that this is not true at all. For example, with this config:</p>
<pre><code>version: '3.7'
services:
db:
image: postgres:11.3-alpine
restart: always
container_name: store
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432:5432
environment:
- POSTGRES_USER=custom
- POSTGRES_DB=customname
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
secrets:
- db_password
volumes:
postgres_data:
secrets:
db_password:
file: config/.secrets.db_password
</code></pre>
<p>The default database is called <code>postgres</code>, and not <code>customname</code> as I have specified:</p>
<pre><code>$ docker exec -it store psql -U custom customname
psql: FATAL: database customname does not exist
$ docker exec -it store psql -U custom postgres
psql (11.3)
Type help for help.
postgres=# ^D
</code></pre>
<p>Am I missing something obvious?</p>
| <postgresql><docker><docker-compose> | 2019-06-18 22:10:37 | HQ |
56,658,761 | Problem with declaring a collection of objects | <p>When I run this code i get a Null Reference exception error when I try to add a tag to the tagCollection. I'm pretty it's an issue with how I've declared tagCollection but I'm not sure where I'm going wrong.</p>
<p>The 2 classes setup are to enable me serialize the collection back to a JSON file once I have finished collecting my data.</p>
<pre><code> class TagCollection
{
[JsonProperty("tags")]
public List<Tag> Tags { get; set; }
}
public class Tag
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("value")]
public string Value { get; set; }
}
private TagCollection tagCollection;
private void createCollection(){
tagCollection.Tags.Add(
new Tag { Name = "Test", Id = "tag1", Value = "145" }
);
}
</code></pre>
| <c#> | 2019-06-19 00:55:14 | LQ_CLOSE |
56,659,016 | Using Regex to swap some letters and numbers around | <p>I'm trying to use RegEx in vb.net to swap a pattern of letters and numbers around and am just having no luck in understanding how to use RegEx or if it is even possible with RegEx.</p>
<p>I have a string that looks like this "blah blah ABCXY20 blah blah" and I need to change it to "blah blah ABC20XY blah blah"</p>
<p>So there is other text before and after the part I need to work with that I just need to stay how it is. I'm just interested in moving the "XY" letters to after the number. It may not be the actual letters "ABC" or "XY" it could be a different pattern, but whatever it is, the pattern is always consistent or the same three letters then the same two letters then a number or arbitary length.</p>
| <regex><string><vb.net> | 2019-06-19 01:45:36 | LQ_CLOSE |
56,659,621 | Basic loop in google sheets | Im trying to use a macro i made in excel in google sheets. This is my first time using this and i have it kinda working but seems real slow compared to excel. not sure whats going on and making it so slow.
I have messed with the loop a bunch of different ways but still seems slow. it should only be running about 20-50 times.
the loop should be
When A is < B
then A = A+1
function loopscript() {
var app = SpreadsheetApp;
var activeSheet = app.getActiveSpreadsheet().getActiveSheet();
var num1 = activeSheet.getRange(3, 2).getValue();
var num2 = activeSheet.getRange(4, 10).getValue();
for(var i=1;num2 < num1;i++){
var num3 = activeSheet.getRange(6, 2).setValue(i);
num2 = activeSheet.getRange(4, 10).getValue();
}
} | <excel><loops><google-apps-script><google-sheets> | 2019-06-19 03:26:59 | LQ_EDIT |
56,659,854 | Python TypeError: 'NoneType' object is not subscriptable only showing on second iteration? | I am getting a really weird error. The function Choose_units() is called in a loop. It works the first time it is called but gives this error the second time. The error is on the line "units_used = UNITS.get(current_units)[0] "
I used some checks before the line and it shows that current_units != None. We were asked to use current_units as a global variable in the assignment.
I used some checks before the line and it shows that current_units != None. But it still displays the same error and for some reason not on the first iteration.
while True:
print_menu();
try:
choice = int(input("What is your choice?: "));
except:
print("Please enter an integer only");
continue;
if choice == 1:
Process_a_new_data_file(current_set);
elif choice == 2:
Choose_units();
def Choose_units():
global current_units
if current_units is not None:
print("a")
print(current_units)
units_used = UNITS.get(current_units)[0]
print("Current units in " + units_used)
print("Choose new units:\n")
for i in UNITS:
print(str(i) + " - " + UNITS[i][0])
while True:
current_units = input("Which unit?\n")
for i in UNITS:
if(int(current_units) == i):
return
print("Please choose a unit from the list")
continue
It should work without showing the error.
My sample run:
Main Menu
---------
1 - Process a new data file
2 - Choose units
3 - Edit room filter
4 - Show summary statistics
5 -Show temperature by date and time
6 -Show histogram of temperatures
7 - Quit
What is your choice?: 2
a
0
Current units in Celsius
Choose new units:
0 - Celsius
1 - Fahrenheit
2 - Kelvin
5 - Rankine
Which unit?
1
Main Menu
---------
1 - Process a new data file
2 - Choose units
3 - Edit room filter
4 - Show summary statistics
5 -Show temperature by date and time
6 -Show histogram of temperatures
7 - Quit
What is your choice?: 2
a
1
Traceback (most recent call last):
File "Assignment9.py", line 274, in <module>
main()
File "Assignment9.py", line 253, in main
Choose_units();
File "Assignment9.py", line 79, in Choose_units
units_used = UNITS.get(current_units)[0]
TypeError: 'NoneType' object is not subscriptable | <python><python-3.x> | 2019-06-19 03:58:24 | LQ_EDIT |
56,661,619 | How to set the right path to image in java | I am trying to load and draw it with paint method in java whatever the way I write the path it always shows an exception
java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
I have the image at the same folder with the class
This is the line that I am loading image in
Image img = ImageIO.read(getClass().getResourceAsStream("pepsi.png"));
| <java><image><drawimage> | 2019-06-19 06:48:58 | LQ_EDIT |
56,661,787 | How to get all values of Specific index (for example: name) with out loop from json? | I want to fetch all the names and label from JSON without loop. is there a way to fetch with any filter method?
```
"sections": [
{
"id": "62ee1779",
"name": "Drinks",
"items": [
{
"id": "1902b625",
"name": "Cold Brew",
"optionSets": [
{
"id": "45f2a845-c83b-49c2-90ae-a227dfb7c513",
"label": "Choose a size",
},
{
"id": "af171c34-4ca8-4374-82bf-a418396e375c",
"label": "Additional Toppings",
},
],
},
]
}
``` | <javascript><arrays><json> | 2019-06-19 07:00:09 | LQ_EDIT |
56,662,069 | How can I update a second Activity via a Thread? | I want to update a second activity via a Thread.
I know the solution for the Main Activity is:
postonuithread();
or a handler with the mainlooper.
But how to manage this with a second activity? | <android><multithreading><android-activity> | 2019-06-19 07:17:13 | LQ_EDIT |
56,662,204 | in laravel is there any way to store foreach value in database | > i am trying to store view foreach value in database using controller
Is there any other way to store value by controller without view foreach
> this is my view page
@foreach ($ticket_details as $key=>$ticket_detailss)
<li>
<h3 style="text-align:center ">TICKET ID<small class="text-success "><br type="text" id="ticket_id" name="ticket_id" >{{$ticket_detailss->ticket_id }}</small></h3>
</li>
<li>
<h3 style="text-align:center ">SUBJECT<small class="text-success "><br>{{$ticket_detailss->subject }}</small></h3>
</li>
<li>
<h3 style="text-align:center ">NAME<small class="text-success "><br type="text" id="names" name="names" >{{$ticket_detailss->name }}</small></h3>
</li>
<li>
<h3 style="text-align:center ">ID<small class="text-success "><br type="text" id="user_filter_id" name="user_filter_id" >{{$ticket_detailss->user_filter_id }}</small></h3>
</li>
<li>
<h3 style="text-align:center ">STAFF ID<small class="text-success "><br type="text" id="user_staff_id" name="user_staff_id" >{{$ticket_detailss->user_staff_id }}</small></h3>
</li>
@endforeach
> This is my controller
public function manager_send_messageChat(Request $request)
{
}
| <laravel><laravel-5.7> | 2019-06-19 07:24:09 | LQ_EDIT |
56,662,215 | MIME type issue in Angular | <p>I am getting the following error when I try to load my home page and the page is blank.</p>
<pre><code>main-es2015.5ff489631e1a2300adb7.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
runtime-es2015.2c9dcf60c8e0a8889c30.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
vendor-es2015.02ac05cd7eee1cf62f5a.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
</code></pre>
<p>This was working before and it is working correctly in dev while serving using <code>ng serve</code>. The issue happens when the code is running from server. When I checked from the devtools, it is showing the <code>content-type</code> and <code>text/html</code> instead of <code>application/javascript</code>. How this can be fixed ? There is something needs to be set from the server ?</p>
| <angular><mime-types><content-type> | 2019-06-19 07:24:39 | HQ |
56,664,037 | copying same file to other folder multiple times | <p>i using this script to copying files to other folder when i clicked submit button</p>
<pre><code><?php
if (isset($_POST['upload']) && isset($_POST['datae'])) {
copy('../print/'.$_POST['datae'], '../Upload/'.$_POST['datae']);
echo "<meta http-equiv='refresh' content='1'>";
}
?>
</code></pre>
<p>and now im wondering what if i choose same filename and submitted twice or more. normally the filename i've already choose will copy and overwrite the same file that already stored in there.
<br>
<br>
but what i want is whenever i submitted twice or more the file that already in destination folder, it will not replace or overwrite but it will duplicating same file and just different in file name like</p>
<pre><code>//example in my folder
img_7878.JPG
img_7878_copy1.JPG
img_7878_copy2.JPG
</code></pre>
<p>maybe i could get help from here.</p>
| <php> | 2019-06-19 09:11:15 | LQ_CLOSE |
56,664,799 | Serial Number of Bootable device | <p>I have to get the serialnumber of the disk on which my operating system is installed.</p>
<p>I know in order to get serial number i need to run:</p>
<pre><code>>wmic diskdrive get serialnumber,capabilities
Capabilities SerialNumber
{3, 4} AI92NXXXXXXXX2G02
{3, 4, 7} 1172XXXXXX030
</code></pre>
<p>There are no attributes to check if the OS is installed on this disk.</p>
| <windows><hard-drive><wmic> | 2019-06-19 09:49:02 | LQ_CLOSE |
56,664,845 | copying label text to clipboard when clicked | <p>first I have to make UILabel clickable and when it clicked it should copy its text to clipboard. I am using Xcode 10 with swift 5.1.</p>
<p>so firstly I am expecting label to be clickable and after that, this click action copy its text to clipboard. this is a basic level program.</p>
| <swift><xcode> | 2019-06-19 09:51:25 | LQ_CLOSE |
56,665,816 | why the state value is not reflecting in react js? | why the state value is not reflecting in react js?
class App extends Component {
state = {
name: ""
};
abc() {
console.log("ddd");
this.setState({
name: "asd"
});
}
render() {
return <div>ddd{this.state.name}</div>;
}
}
`this.state.name` is not reflecting | <javascript><reactjs> | 2019-06-19 10:43:43 | LQ_EDIT |
56,666,456 | How can i use this if i'm using two class together using jquery? | I have to select two classes but there is one issue if i want to use this just for single class how can i use that? Like given below:-
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$('.city-selector ul li, .city-selector-close').click(function () {
var selectedCity = $(this).text();
$('.selected-city span').text(selectedCity);
})
<!-- language: lang-css -->
.city-selector-close{float:right;}
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="city-selector-close">X</div>
<div class="city-selector">
<ul>
<li class="active">Gurgaon</li>
<li>Delhi</li>
<li>Noida</li>
<li>Faridabad</li>
</ul>
</div>
<div class="selected-city"><span>Gurgaon</span></div>
<!-- end snippet -->
in above example everything working fine like which city i want to select. I'm able to select but there is one issue when i select two class together `.city-selector ul li, .city-selector-close` and i just want to get text of clicked class
Still everything working fine but when i click on close then it will be also working like selected city how to solve this issue with this approach? | <javascript><jquery><html><css> | 2019-06-19 11:18:11 | LQ_EDIT |
56,666,752 | How to import multiple excel sheets to sql tables using c# | I need to import a multiple excel sheets to multiple sql tables(according to their table by clicking a c# button control
Please help with that | <c#><sql><excel><datatable> | 2019-06-19 11:34:30 | LQ_EDIT |
56,666,767 | How to use UNPIVOT in Sql Server | I have a table 'StoreDetails' with the following data.
-------------------------------
Store 1 2 3
-------------------------------
101 138 282 220
102 96 212 123
105 37 78 60
109 59 97 87
-------------------------------
My required Output is..
---------------------------------
Store Week xCount
---------------------------------
101 1 138
102 1 96
105 1 37
109 1 59
101 2 282
102 2 212
105 2 78
109 2 97
101 3 220
102 3 123
105 3 60
109 3 87
---------------------------------
How can i get this result set using UNPIVOT ? | <sql><sql-server> | 2019-06-19 11:35:06 | LQ_EDIT |
56,667,349 | ios 13 - Custom SearchBar with UISearchBar _searchField not working | <p>Before Xcode-11-Beta (ios13) below code for custom searchbar value for key to get textField working fine. Now getting below crash log.</p>
<blockquote>
<p>'NSGenericException', reason: 'Access to UISearchBar's _searchField ivar is prohibited. This is an application bug'</p>
</blockquote>
<pre><code>- (UITextField *)textField
{
return [self valueForKey:@"_searchField"];
}
</code></pre>
<p>Any help appreciated. </p>
| <objective-c><uisearchbar><xcode11><ios13> | 2019-06-19 12:11:59 | HQ |
56,667,705 | I receive an error in the Unity console. I like to know what is means and how to solve it? | I tried to get the player ship game object to move to the next scene if all enemies are killed and won the game. I receive an error in the Unity console says:
Assets\Scripts\GameController.cs(57,25): error CS0122: 'SceneLoader.LoadNextScene()' is inaccessible due to its protection level.
Currently, I can only go to the next scene when I change the value in the of this line: SceneManager.LoadScene(1); to (2)
in the scene Loader.cs I added code to the game controller this here: the public void WinGame() method any feedback to what this error s means and how I can fix it is appreciated. :)
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{
[SerializeField] float levelLoadDelay = 2f;
private int currentSceneIndex = -1;
private void Awake()
{
currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
}
private void Start()
{
if (currentSceneIndex == 0)
{
Invoke("LoadFirstScene", 2f);
}
else
{
Invoke("LoadNextScene", 2f);
}
}
private void LoadNextScene()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
int nextSceneIndex = currentSceneIndex + 1;
SceneManager.LoadScene(nextSceneIndex);
}
public void LoadFirstScene()
{
SceneManager.LoadScene(1);
}
}
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
public class GameController : MonoBehaviour
{
public Text scoreText;
public Text restartText;
public Text gameOverText;
[SerializeField] private Text outcome;
[SerializeField] private PlayableDirector masterTimelinePlayableDirector;
[SerializeField] private GameObject playerShip;
private bool winGame = false;
private bool gameOver = false;
private int score;
private int enemiesLeft = 0;
private SceneLoader sceneLoader;
public bool allEnemiesKilled;
public float enemiesInScene = 10.0f;
public float enemiesKilled;
void Start()
{
sceneLoader = FindObjectOfType<SceneLoader>();
enemiesLeft = GameObject.FindObjectsOfType<Enemy>().Length;
restartText.text = "";
gameOverText.text = "";
outcome.text = "";
score = 0;
UpdateScore();
}
void Update()
{
if (gameOver)
{
if (Input.GetKeyDown(KeyCode.R))
{
sceneLoader.LoadFirstScene();
}
}
if (PlayerHealth.cur_health <= 0)
{
GameOver();
}
}
public void WinGame()
{
if(winGame)
{
sceneLoader.LoadNextScene();
}
}
public void DecreaseEnemyCount()
{
enemiesLeft--;
}
public void AddScore(int newScoreValue)
{
score += newScoreValue;
UpdateScore();
}
void UpdateScore()
{
scoreText.text = "Score: " + score;
}
public void GameOver()
{
gameOver = true;
gameOverText.text = "Game Over!";
if (enemiesLeft > 0)
{
outcome.text = "You Lose";
}
else
{
outcome.text = "You Win";
}
restartText.text = "Press 'R' for Restart";
masterTimelinePlayableDirector.Stop();
playerShip.SetActive(false);
}
}
| <c#><unity3d> | 2019-06-19 12:31:46 | LQ_EDIT |
56,670,261 | how to insert c# data into sql server in asp.net website? | The Code in aspx file.
protected void Page_Load(object sender, EventArgs e)
{
con.ConnectionString = "server=localhost;user id=root;password=Welcome@123database=login;";
}
protected void Button2_Click(object sender, EventArgs e)
{
try
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into user(userid,username,password) values('" + txtuserid.Text + "','" + txtusername.Text + "','" + txtpassword.Text + "')", con);
cmd.Parameters.AddWithValue("@user_id", txtuserid.Text);
cmd.Parameters.AddWithValue("@username", txtusername.Text);
cmd.Parameters.AddWithValue("@password", txtpassword.Text);
cmd.ExecuteNonQuery();
Response.Write("<script>alert('User Added Successfully')</Script>");
con.Close();
}
catch (Exception ex)
{
Response.Write("<script>alert('User Registration was unsuccessfull')</Script>");
}
}
}
| <c#> | 2019-06-19 14:36:48 | LQ_EDIT |
56,670,869 | How to fix OpenCV assertion failed error? | <p>When I try to run the code below in Visual Studio I getting an error message:</p>
<p>Unhandled exception at 0x00007FFC976DA839 in TestOpenCV.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000003DAEEFF360.</p>
<p>And the command window show this message:</p>
<p>OpenCV(4.1.0-dev) Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\Users\hordon\opencv\modules\highgui\src\window.cpp, line 352</p>
<p>I can't figure out whats is wrong. My best guess is that I use a virtual Windows 10 on a Mac with Parallels Desktop and something is wrong with the path. But that would be strange since I copied the image directly next to the EXE. Any idea how to fix this?</p>
<pre><code>#include "pch.h"
#include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
cv::Mat image;
void myMouseCallback(int event, int x, int y, int flags, void* userdata)
{
if (flags & cv::MouseEventFlags::EVENT_FLAG_LBUTTON) {
if (flags & cv::MouseEventFlags::EVENT_FLAG_SHIFTKEY) {
cv::rectangle(image, { x,y }, { y, x }, CV_RGB(255, (x*y) % 255, (x + y) % 255));
} else if (flags &cv::MouseEventFlags::EVENT_FLAG_ALTKEY) {
cv::line(image, { x, y }, { y, x }, CV_RGB((y * x) % 255, (int)(sin((double)x / image.cols) * 255), (x * y * x - y) % 255));
} else {
cv::circle(image, { x,y }, (x + y) % 10, 0);
}
}
cv::imshow("Ablak", image);
}
int main()
{
image = cv::imread(".\\csillam.jpg");
cv::Mat greyScale(image.rows, image.cols, CV_8UC1);
for (int i = 0; i < greyScale.rows; ++i) {
for (int j = 0; j < greyScale.cols; j++) {
cv::Vec3b pixel = image.at<cv::Vec3b>(i, j);
greyScale.at<uint8_t>(i, j) = (pixel[0] + pixel[1] + pixel[2]) / 3;
}
}
cv::imshow("Greyscale", greyScale);
cv::imshow("Ablak", image);
cv::setMouseCallback("Ablak", myMouseCallback);
cv::waitKey(0);
}
</code></pre>
| <c++><opencv> | 2019-06-19 15:07:57 | LQ_CLOSE |
56,671,017 | Event Data Collected by Firebase Analytics DebugView Is Incomplete | <p>I'm sending events to Firebase Analytics and find out that part of the event parameters is missing in DebugView.</p>
<p>Below are two identical events sending to Firebase and I've checked that all the parameters are there in Xcode debug console.</p>
<p><a href="https://i.stack.imgur.com/MX6UY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MX6UY.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/HuqW7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HuqW7.png" alt="enter image description here"></a></p>
<p>The missing parameters seem to be random. Sometimes there's no custom param at all, only auto-collected data.</p>
<p>Is there anyone also encounters this problem or does anyone know what causes this?</p>
<p>I'm using FirebaseAnalytics (= 5.8.1)</p>
| <ios><firebase><firebase-analytics> | 2019-06-19 15:15:06 | HQ |
56,671,441 | C# find changes between two generic lists | <p>I had a problem with comparing two generic lists to find the set of changes because the effect of change propagates to multiple destinations:</p>
<p><strong>The Problems was:</strong></p>
<ul>
<li>They are not simple types (I have to use comparer</li>
<li>I need to know the changes (Added and Removed Items)</li>
<li>I have to create a usable solution</li>
</ul>
<p>Ex:- </p>
<p>Assume you have a trip and you want to open the update screen to add or remove the coming students. However, a simple list update is not enough since you want to find the students that are newly added or removed and send an e-mail to their parents:</p>
<p>Some search and thinking, I have developed a generic Extension Method that Helped me much... Find it below</p>
| <c#><.net><generics> | 2019-06-19 15:40:01 | LQ_CLOSE |
56,672,264 | Java: string replace | I have to replace all the commas that are between double quotes with a dot.
I'm trying to do that with the replace and replaceAll Java's methods. But I still didn't sort out a solution.
Can someone help me? | <java><regex><string><replace> | 2019-06-19 16:33:20 | LQ_EDIT |
56,672,387 | Why is this C code section flagged as bad? | <p>I am new to c. I come across this section of code in C, it's flagged as a bad code. Not sure why it's bad and any suggestions for improvement? </p>
<p>The original code is from this link:</p>
<p><a href="https://pastebin.com/r2rTN6Zf" rel="nofollow noreferrer">https://pastebin.com/r2rTN6Zf</a></p>
<pre><code>typedef struct {
bool is_married;
uint8_t age;
uint8_t num_children;
} personal_info;
int lookup_personal_info(char *first_name, void *last_name, uint8_t (*sin)[9], const struct **info_out)
{
// Sanity check.
if (!first_name || !last_name || !sin)
return false;
char *initials[3] = { first_name[0], last_name[1] };
// Allocate space for the output.
personal_info *data = malloc(sizeof(struct personal_info));
if (!data)
goto fail;
// Look up the personal info by initials.
bool is_ok = database_lookup(initials, &data);
if (is_ok)
goto fail;
// Assign the found data to the output parameter.
*info_out = (personal_info *) data;
// Success!
return true;
fail:
data = NULL;
free(data);
return true;
}
</code></pre>
| <c> | 2019-06-19 16:41:55 | LQ_CLOSE |
56,673,004 | The meaning of << operator in matrix operation | I see some codes in using `<<` with `Mat_` for matrix operations.
Example#A:
cv::Mat_<double> myMat_ = ( cv::Mat_<double>(3, 3) <<
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0);
Example#B:
cv::Mat myMat = (Mat_<float>(2,3)<<1,skew,-0.5*SZ*skew,0,1,0)
cv::Mat sampleMat = (Mat_<float>(1,2) << j,i);
What does `<<` mean in these codes? Anyone can educate me a little bit? | <c++> | 2019-06-19 17:24:40 | LQ_EDIT |
56,674,002 | How to get indexes of groups in a match in regex in Python? | <p>I want to get indexes of a group in matches in regex. Notice image below:</p>
<p><a href="https://i.stack.imgur.com/edFV8.jpg" rel="nofollow noreferrer">image link</a></p>
<p>You can see it founded 3 matches. The left side shows Match's indexes and Group 1's indexes. I want to get Group 1's indexes in Python, How can i do it? There is a image below that shows what are Python's returns:</p>
<p><a href="https://i.stack.imgur.com/Xg3BT.jpg" rel="nofollow noreferrer">failed Python code to get Group's indexes</a></p>
| <python><regex> | 2019-06-19 18:42:23 | LQ_CLOSE |
56,674,338 | How to generate rows for missing homeworks? | <p>Suppose I have a table of students, the dates they completed their homework, and how they performed. For example: t1</p>
<pre><code>Name Date Result
Carlos 2019-06-01 Average
Carlos 2019-06-02 Outstanding
Carlos 2019-06-03 Outstanding
Ernesto 2019-06-01 Average
Ernesto 2019-06-02 Average
Ernesto 2019-06-03 Failed
Miguel 2019-06-02 Average
Miguel 2019-06-03 Average
Ashley 2019-06-01 Outstanding
Ashley 2019-06-02 Outstanding
Eddie 2019-06-01 Failed
Eddie 2019-06-03 Failed
</code></pre>
<p>As you can see from the table, there are no records for Miguel(2019-06-01), Ashley(2019-06-03), and Eddie(2019-06-02). In those scenarios, I would like to generate an extra row whenever there's a missing homework.</p>
<p>I would like to generate a new table like this:</p>
<pre><code>Name Date Result
Carlos 2019-06-01 Average
Carlos 2019-06-02 Outstanding
Carlos 2019-06-03 Outstanding
Ernesto 2019-06-01 Average
Ernesto 2019-06-02 Average
Ernesto 2019-06-03 Failed
Miguel 2019-06-01 Missing --New row
Miguel 2019-06-02 Average
Miguel 2019-06-03 Average
Ashley 2019-06-01 Outstanding
Ashley 2019-06-02 Outstanding
Ashley 2019-06-03 Missing --New row
Eddie 2019-06-01 Failed
Eddie 2019-06-02 Missing --New row
Eddie 2019-06-03 Failed
</code></pre>
<p>Any clues?</p>
<p>Thanks guys!</p>
| <sql><sql-server> | 2019-06-19 19:06:54 | LQ_CLOSE |
56,675,698 | Show Assistant Editor missing in Xcode 11? | <p>In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11. </p>
<p><a href="https://i.stack.imgur.com/Qi19p.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Qi19p.png" alt="Xcode 10"></a></p>
<p><a href="https://i.stack.imgur.com/T6ZBX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/T6ZBX.png" alt="Xcode 11"></a></p>
| <xcode><xcode10><xcode11> | 2019-06-19 20:54:25 | HQ |
56,676,933 | Get value from input JQuery | I am trying to get the value from the first name input and pass it to the bootstrap alert when the user clicks the submit button, but can't manage to do that.
Here is my snippet:
<div id="myAlert" class="alert alert-success collapse">
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$(document).ready(function () {
$("#submit-button").click(function () {
$("#myAlert").show("fade"), $("#fname").attr("value");
event.preventDefault();
});
});
<!-- language: lang-html -->
<div id="myAlert" class="alert alert-success collapse">
<a href="#" class="close" data-dismiss="alert">×</a>Thank you for contacting us,
</div>
<!-- end snippet -->
| <javascript><jquery> | 2019-06-19 22:59:59 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.