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 |
|---|---|---|---|---|---|
57,868,145 | How to repeat a div N times in Angular | <pre><code><div ng-repeat="10">Text</div>
</code></pre>
<p>I don't have any object to use and I want it in Angular, not AngularJS or any other framework. Please make sure your solution support the latest Angular.</p>
| <angular> | 2019-09-10 09:46:46 | LQ_CLOSE |
57,868,800 | Facebook Account Kit Deprecated | <p>I <a href="https://developers.facebook.com/blog/post/2019/09/09/account-kit-services-no-longer-available-starting-march" rel="noreferrer">just saw</a> that <a href="https://developers.facebook.com/docs/accountkit/" rel="noreferrer">facebook account</a> kit is being <strong>deprecated</strong>. There isn't much information about what's the reason behind its depreciation or what could be the next steps/alternatives.</p>
<ul>
<li>Does anyone know why they deprecated it? Any technical insights/learnings?</li>
<li>What are the alternatives now? or are they planing any successor of it?</li>
</ul>
| <account-kit> | 2019-09-10 10:25:03 | HQ |
57,868,883 | Is there a way to check an email ID and a value next to it in database from frontend without submitting the form? | <p>I have a registration form and I would like to check if the email is already in database (PSQL) without submitting the form. Vanilla javascript or jQuery only please. No PHP</p>
| <javascript><postgresql><scala> | 2019-09-10 10:29:16 | LQ_CLOSE |
57,869,679 | How do I implement a scrollable drawer with flutter, It shows a bottom overflow when I rotate | Bottom overflow in drawer when I rotate the screen**strong text** | <flutter><navigation-drawer><flutter-layout><drawer> | 2019-09-10 11:17:52 | LQ_EDIT |
57,871,088 | SwiftUI View and @FetchRequest predicate with variable that can change | <p>I have a view showing messages in a team that are filtered using @Fetchrequest with a fixed predicate 'Developers'.</p>
<pre><code>struct ChatView: View {
@FetchRequest(
sortDescriptors: [NSSortDescriptor(keyPath: \Message.createdAt, ascending: true)],
predicate: NSPredicate(format: "team.name == %@", "Developers"),
animation: .default) var messages: FetchedResults<Message>
@Environment(\.managedObjectContext)
var viewContext
var body: some View {
VStack {
List {
ForEach(messages, id: \.self) { message in
VStack(alignment: .leading, spacing: 0) {
Text(message.text ?? "Message text Error")
Text("Team \(message.team?.name ?? "Team Name Error")").font(.footnote)
}
}...
</code></pre>
<p>I want to make this predicate dynamic so that when the user switches team the messages of that team are shown. The code below gives me the following error </p>
<blockquote>
<p>Cannot use instance member 'teamName' within property initializer; property initializers run before 'self' is available</p>
</blockquote>
<pre><code>struct ChatView: View {
@Binding var teamName: String
@FetchRequest(
sortDescriptors: [NSSortDescriptor(keyPath: \Message.createdAt, ascending: true)],
predicate: NSPredicate(format: "team.name == %@", teamName),
animation: .default) var messages: FetchedResults<Message>
@Environment(\.managedObjectContext)
var viewContext
...
</code></pre>
<p>I can use some help with this, so far I'm not able to figure this out on my own.</p>
| <swift><core-data><nspredicate><swiftui><nsfetchrequest> | 2019-09-10 12:43:39 | HQ |
57,871,688 | PHP Regex for replace alternative | <p>I have a requirement for which I am trying to find a regex pattern to replace the code. I understand that I can get normal regular expression for finding and replacing the text however reqirement is to find and replace the instance alternatively.</p>
<p>For example, </p>
<pre><code>{code}
UPDATE tenants SET end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' WHERE end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' AND instance_id = '265358' AND domain = 'automobieljansen';
{code}
Rollback:
{code}
UPDATE tenants SET end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' WHERE end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' AND instance_id = '265358' AND domain = 'automobieljansen';
{code}
</code></pre>
<p>This is the original text. I need to replace the first instance of the <code>{code}</code> to <code><pre></code> and the second instance of the <code>{code}</code> to <code></pre></code></p>
<p>Expected result</p>
<pre><code><pre>
UPDATE tenants SET end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' WHERE end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' AND instance_id = '265358' AND domain = 'automobieljansen';
</pre>
Rollback:
<pre>
UPDATE tenants SET end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' WHERE end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' AND instance_id = '265358' AND domain = 'automobieljansen';
</pre>
</code></pre>
<p>Any help on how to do this easily? </p>
| <regex> | 2019-09-10 13:17:19 | LQ_CLOSE |
57,871,747 | Create a time object? | <p>I have a vast number of files that need to be deleted past a certain date.
I can't use the datestamp of the file because the files are created some time before they are used. A file called OCT21.txt needs to be deleted a few days after October 21st, but it could have been created in May.</p>
<p>My question is: is it possible to convert the "OCT21" string into a format that the time module can use?</p>
| <python> | 2019-09-10 13:20:37 | LQ_CLOSE |
57,871,843 | Why is the Streamlistener reakting differently? | I'm tring to use the Streambuilder in cooperation with Bloc. The problem is that somehow the UI updates only when the expensive Funktions are finished. It seams that then, and only then updates are made to the stream. But I can not figure out why?
I Implemented a simple Bloc that has 4 events:
1. a Future called over the Bloc Sate Object
2. a Future called inside the Bloc
3. a Funktion called inside the Bloc
4 just using Future.delay
I'm Trying to understand why everything behaves as expectetd, but not when I use first two. My guess is I have a basic misunderstanding of the eventloop but I can not see why there should be a difference in behavior between 2 and 4 or 1 and 4
To make it easy I made an example Project on Githup
https://github.com/pekretsc/bloceventloop.git | <flutter><stream><event-loop><bloc> | 2019-09-10 13:26:19 | LQ_EDIT |
57,874,209 | if there's no super object created,why can I call the super constructor in java | <p>if there's no super object created when creating a new sub-class object,why can I call the super constructor in the sub-class constructor & pass to it parameters in java?</p>
| <java> | 2019-09-10 15:45:00 | LQ_CLOSE |
57,876,220 | What is difference between "git push" and "a pull request"? | <p>I already figured out the following part of workflow of git: you do git add and then git commit and then git push. The git push step basically publish your changes to the github. So what is this next step commonly referred to as "pull request"? Suppose that I'm not "forking" or anything advanced. And suppose that I work on a new branch I created (named "dev") other than the master branch. And I did the add, commit, push all under this new branch and did not do any "merge". How do I do a "pull request" and what is that step supposed to accomplish beyond git add, commit, push. Does that just mean I merge "dev" to "master"?</p>
| <git><github> | 2019-09-10 18:13:05 | LQ_CLOSE |
57,879,096 | se puede crear metodos "globales" para usar en varios fragment a la vez? | disculpen la pregunta, estoy seguro que lo hay, pero no logro ver como podría hacerlo, me imagino que creando un archivo java que guarde los métodos globales y así usarlos en los fragment que requiera, si por favor me pueden ayudar de como hacerlo, y si me pueden dar un ejemplo seria de gran ayuda
no he probado nada, porque no consigo algo que hable de eso, quiero probar en todos los fragment que tengo si hay conexión y si no la hay, que me cierre la aplicación, ya el código que tengo funciona bien, pero me parece que estoy asiendo algo mal al colocar los mismos métodos el todos los fragment
private void verificarconexion() {
//para saber si hay internet
ConnectivityManager connectivityManager = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
// Estas conectado a un Wi-Fi
Log.d("MIAPP", " Nombre red Wi-Fi: " + networkInfo.getExtraInfo());
}
} else {
//Intent salida=new Intent( Intent.ACTION_MAIN); //Llamando a la activity principal
Toast.makeText(getContext(), "no tienes internet", Toast.LENGTH_LONG).show();
mostrarsalir();
}
//para saber si hay internet
}
private void mostrarsalir() {
final CharSequence[] opciones={"Aceptar","Cancelar"};
final AlertDialog.Builder builder=new AlertDialog.Builder(getContext());
builder.setCancelable(false);
builder.setTitle("No se detectan redes de internet");
builder.setItems(opciones, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (opciones[i].equals("Aceptar")){
getActivity().finish();
System.exit(0);
int p = android.os.Process.myPid();
android.os.Process.killProcess(p);
}else{
getActivity().finish();
System.exit(0);
int p = android.os.Process.myPid();
android.os.Process.killProcess(p);
}
}
});
builder.show();
}
quisiera porder escribir el metodo en un lugar donde lo pueda llamar desde cualquier fragment, porque si quiero cambiar una letra del mensaje que muestro, no tenga que buscar en todos los fragment donde esta el metodo | <android><android-fragments><methods><global-variables> | 2019-09-10 22:51:02 | LQ_EDIT |
57,879,526 | What do these error messages mean? (Java Swing) | <p>I am writing a GUI thing that allows someone to automatically organize their students into groups. So far, I've gotten to the point where I type in the students and click a button to set them. However, when I click the button I get a whole bunch of errors.</p>
<p>Here is the code I have, so far:</p>
<pre><code>import java.awt.EventQueue;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.border.EmptyBorder;
public class StudentGrouper extends JFrame {
private JPanel contentPane;
private static ArrayList<String> students = new ArrayList<>();
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
StudentGrouper frame = new StudentGrouper();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public StudentGrouper() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(new GridLayout(0, 1, 0, 0));
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
contentPane.add(tabbedPane);
JScrollPane scrollPane = new JScrollPane();
tabbedPane.addTab("Enter Students", null, scrollPane, null);
JTextPane txtpnOneStudentPer = new JTextPane();
txtpnOneStudentPer.setFont(new Font("Lucida Grande", Font.PLAIN, 14));
txtpnOneStudentPer.setText("One student per line...");
scrollPane.setViewportView(txtpnOneStudentPer);
JButton btnSetStudentList = new JButton("Set Student List");
btnSetStudentList.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
students = (ArrayList<String>) Arrays.asList(txtpnOneStudentPer.getText().split("\n"));
System.out.println(students.get((int)(Math.random() * students.size())));
}
});
btnSetStudentList.setFont(new Font("Lucida Grande", Font.PLAIN, 14));
scrollPane.setColumnHeaderView(btnSetStudentList);
JScrollPane scrollPane_1 = new JScrollPane();
tabbedPane.addTab("Select Students", null, scrollPane_1, null);
}
}
</code></pre>
<p>Here are the error messages I get:</p>
<pre><code>Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.util.ArrayList
at StudentGrouper$2.actionPerformed(StudentGrouper.java:65)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
</code></pre>
<p>Can anyone tell me what's causing these errors to occur?</p>
<p>(Obviously, I am guessing, the errors stem from one minor error that I skipped over in a hurry. Please tell me!)</p>
| <java><swing><user-interface> | 2019-09-11 00:08:38 | LQ_CLOSE |
57,881,580 | waitfor value command doesn't work properly | I tried to run this code but it doesn't work properly. It got stuck on line 3 and gives error "timeout, element not found".
ie.open g1ant.com window ‴✱internet explorer✱‴ ie.waitforvalue script document.getElementsByClassName("footer_stuff").length expectedvalue 1 dialog ‴Page loaded!‴ ie.close | <g1ant> | 2019-09-11 03:10:27 | LQ_EDIT |
57,882,446 | What kind of knowledge and technologies needed to develop an specific mobile app? | <p>I had chosen to develop an mobile app for my final year project. The app is an parenting application that help parent to monitor and control screen time of their children and it have some function such as:
- Send notification to the parent mobile device when the child start to use the device.
- Lock the phone at certain time or by choice.
- Location tracking (optional)
- Report on use-time.</p>
<p>I'm familiar with basic Java and Android programming.</p>
<p>So what are the other knowledge (technology, mechanism, etc) that i will needed to develop this app.</p>
| <android><mobile> | 2019-09-11 05:07:02 | LQ_CLOSE |
57,882,652 | How to read from a file using Haskell? | <p>I am trying to read from a file. I want to split each line from a file into its own string. I am thinking of using the lines command in order to make a list of Strings of all the lines. I then plan to use the words command to spilt each line into a list of words. However, I am very new to functional programming/Haskell, and I don't fully understand the syntax. So, to begin, how do you read each line from a file and store it? </p>
<p>I attempted the following code, but it does not compile. </p>
<pre><code>main :: IO ()
main = do
contents <- readFile "input.txt"
contents1 = lines contents
</code></pre>
| <file><haskell><functional-programming><system.io.file> | 2019-09-11 05:29:34 | LQ_CLOSE |
57,882,826 | How to replace and matches a specific String with input string | <p>My database table column contains several Strings like below mentioned:</p>
<pre><code>---------------------------
id | string |
---------------------------
1 | I love C# Code |
---------------------------
2 | I love Java Code |
---------------------------
3 | I love python Code|
---------------------------
4 | hello java |
---------------------------
5 | hello c# |
---------------------------
</code></pre>
<p>In c# each row at a time will be fetched from data base and I want to check my given pattern is matches or not.</p>
<p>My pattern is: <code>I love <anything> Code</code></p>
<p>And I also want to replace by another String.</p>
<p>I have tried: </p>
<pre><code>foreach( string record in stringsFromDB){
boolean isMatches=Regex.Matches(record, "I love .+? Code");
if(isMatches){
Console.Writeline("String matches");
}else{
Console.Writeline("String not matches");
}
string newString= Regex.Replace(record, "I love .+? Code","",, RegexOptions.IgnoreCase);
Console.Writeline(newString);
}
</code></pre>
<p>Expected Result:</p>
<p>For matching:
For first three records it will print: String matches. For the else two print: String not matches.</p>
<p>And</p>
<p>For replacing:
For first three records it will print: I love Code. For the else two print as it is. </p>
<p>But nothing happen when i write code.</p>
<p>Please help.</p>
<p>Thanks.</p>
| <c#><regex><string> | 2019-09-11 05:46:05 | LQ_CLOSE |
57,883,408 | What is wp-includes in wordpress and the purpose of it? | <p>I want to know what is the importance of wp-includes in wordpress</p>
| <wordpress><wordpress-theming> | 2019-09-11 06:37:59 | LQ_CLOSE |
57,883,987 | how i can monitor gpu sensors using c# winform? | im using OpenHardwareMonitor.Hardware dll for tracking the gpu sensors , but im not getting fan speed . please help it .
private void Get_GPU_Configuration()
{
try
{
Computer _comp = new Computer();
_comp.GPUEnabled = true;
_comp.Open();
dgv_Main_Window.Rows.Clear();
foreach (var hardwareItem in _comp.Hardware)
{
if ((hardwareItem.HardwareType == HardwareType.GpuAti) || (hardwareItem.HardwareType == HardwareType.GpuNvidia))
{
int index = dgv_Main_Window.Rows.Add();
string _device_Name = hardwareItem.Name.Trim();// Radeon(TM) R5 M430
hardwareItem.Update();
dgv_Main_Window.Rows[index].Cells[int_Device].Value = _device_Name;
foreach (var sensor in hardwareItem.Sensors)
{
string str = sensor.SensorType.ToString();
if (str == "Temperature")
{
dgv_Main_Window.Rows[index].Cells[int_Temperature].Value = sensor.Value.ToString();
}
if (str == "Clock")
{
if (sensor.Name == "GPU Core")
{
dgv_Main_Window.Rows[index].Cells[int_CoreClock].Value = sensor.Value.ToString();
}
else
{
dgv_Main_Window.Rows[index].Cells[int_MemoryClock].Value = sensor.Value.ToString();
}
}
if(str=="Fan")
{
if (sensor.Name == "GPU Fan")
{
dgv_Main_Window.Rows[index].Cells[int_FanSpeed].Value = sensor.Value;
}
}
}
string[] _deviceName_Array = new string[dgv_Main_Window.Rows.Count];
foreach (DataGridViewRow _drow in dgv_Main_Window.Rows)
{
int i = 0;
_deviceName_Array[i] = _drow.Cells[int_Device].Value.ToString();
i++;
}
ManagementScope ms = new ManagementScope(@"root\cimv2");
ObjectQuery oq2 = new ObjectQuery("select * from Win32_VideoController");
ManagementObjectSearcher _Video = new ManagementObjectSearcher(ms, oq2);
foreach (ManagementObject obj in _Video.Get())
{
foreach (PropertyData PC in obj.Properties)
{
}
foreach (var _data in _deviceName_Array)
{
if (_data == obj["Name"].ToString())
{
foreach (DataGridViewRow _drow in dgv_Main_Window.Rows)
{
if (_drow.Cells[int_Device].Value.ToString() == _data)
{
_drow.Cells[int_Id].Value = obj["DeviceID"].ToString();
_drow.Cells[int_Driver].Value = obj["DriverVersion"].ToString();
}
}
}
}
}
}
}
}
catch (Exception ex)
{
}
} | <c#><gpu><hardware> | 2019-09-11 07:17:03 | LQ_EDIT |
57,885,849 | in androidx.fragment.app.Fragment,setUserVisibleHint()is Deprecated,and not executed,why? | <pre><code>@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (getUserVisibleHint()) {
isVisible = true;
onVisible();
} else {
isVisible = false;
onInVisible();
}
}
</code></pre>
<p>I found that this part of the code is not executed.</p>
| <android><androidx> | 2019-09-11 09:15:23 | HQ |
57,886,535 | How to set ANDROID_HOME path in windows environment? | <p>Unable to set How to set ANDROID_HOME path in windows environment.</p>
<p>Please provide the steps.</p>
| <android><android-studio> | 2019-09-11 09:52:09 | LQ_CLOSE |
57,889,263 | How to write a modal with a nested array in spring? | I am writing a new class in spring boot where I need to write a modal class in which there will be a sub modal classes(I mean an array with a nested arrays), but when I try to run it I am getting the sub modal class names as attributes not the real attributes which I mentioned in sub modals.
**********ChangeBin Modal***********
package com.demo.model;
import java.io.Serializable;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Field;
public class Changebin implements Serializable{
@Field(value = "Change_bin_Past")
private ChangebinPast changebinpast;
@Field(value = "Change_bin_Present")
private ChangebinPresent changebinpresent;
public ChangebinPast getChangebinpast() {
return changebinpast;
}
public void setChangebinpast(ChangebinPast changebinpast) {
this.changebinpast = changebinpast;
}
public ChangebinPresent getChangebinpresent() {
return changebinpresent;
}
public void setChangebinpresent(ChangebinPresent changebinpresent)
{
this.changebinpresent = changebinpresent;
}
}
***********ChangebinPast -- Sub modal ******************
package com.demo.model;
import java.io.Serializable;
import org.springframework.data.mongodb.core.mapping.Field;
public class ChangebinPast implements Serializable {
@Field(value = "ID_A")
private String ID_A;
public String getID_A() {
return ID_A;
}
public void setID_A(String ID_A) {
this.ID_A = ID_A;
}
public String getID_B() {
return ID_B;
}
public void setID_B(String ID_B) {
this.ID_B = ID_B;
}
@Field(value = "ID_B")
private String ID_B;
}
***************Changebinpresent -- Sub Modal***************
package com.demo.model;
import java.io.Serializable;
import org.springframework.data.mongodb.core.mapping.Field;
public class ChangebinPresent implements Serializable {
@Field(value = "ID_A1")
private String ID_A1;
@Field(value = "ID_B1")
private String ID_B1;
public String getID_A1() {
return ID_A1;
}
public void setID_A1(String ID_A1) {
this.ID_A1 = ID_A1;
}
public String getID_B1() {
return ID_B1;
}
public void setID_B1(String ID_B1) {
this.ID_B1 = ID_B1;
}
}
Expected :
ChangeBin [
{
ID_A : "",
ID_B : ""
},
{
ID_A1: "",
ID_B1: ""
}
]
But got like this :
ChangeBin [
{
changebinpast: "",
changebinpresent : ""
},
{
changebinpast: "",
changebinpresent : ""
}
] | <java><spring> | 2019-09-11 12:32:08 | LQ_EDIT |
57,890,821 | To get results in edittext in Android studio | I wanna know is there any chance to get our result in an edittext not in textview without using any button.. That is when we place cursor on the edittext field, the result we wanna print should be in the field. Is there anyone who could help vth this.? | <android><android-edittext> | 2019-09-11 13:58:33 | LQ_EDIT |
57,891,751 | Webpacker configuration file not found - Rails 6.0.0 | <p>I was trying to run "rails s" to run my server then I suddenly run into an error that says webpacker configuration not found. </p>
<p>Here's the info:</p>
<pre><code>boot@noki-K54C:~/Desktop/app$ rails s
=&gt; Booting Puma
=&gt; Rails 6.0.0 application starting in development
=&gt; Run `rails server --help` for more startup options
RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Exiting
<b>Traceback</b> (most recent call last):
79: from bin/rails:3:in `&lt;main&gt;&apos;
78: from bin/rails:3:in `load&apos;
77: from /home/app/Desktop/jonabell/bin/spring:15:in `&lt;top (required)&gt;&apos;
76: from /home/app/Desktop/jonabell/bin/spring:15:in `require&apos;
75: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `&lt;top (required)&gt;&apos;
74: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load&apos;
73: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/bin/spring:49:in `&lt;top (required)&gt;&apos;
72: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run&apos;
71: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call&apos;
70: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call&apos;
69: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load&apos;
68: from /home/app/Desktop/jonabell/bin/rails:9:in `&lt;top (required)&gt;&apos;
67: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require&apos;
66: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency&apos;
65: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require&apos;
64: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require&apos;
63: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi&apos;
62: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register&apos;
61: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi&apos;
60: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require&apos;
59: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `&lt;main&gt;&apos;
58: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke&apos;
57: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform&apos;
56: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch&apos;
55: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command&apos;
54: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run&apos;
53: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `perform&apos;
52: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `tap&apos;
51: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:147:in `block in perform&apos;
50: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:37:in `start&apos;
49: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout&apos;
48: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app&apos;
47: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app&apos;
46: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config&apos;
45: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file&apos;
44: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string&apos;
43: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval&apos;
42: from config.ru:in `&lt;main&gt;&apos;
41: from config.ru:in `new&apos;
40: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize&apos;
39: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval&apos;
38: from config.ru:3:in `block in &lt;main&gt;&apos;
37: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative&apos;
36: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require&apos;
35: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency&apos;
34: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require&apos;
33: from /home/app/.rvm/gems/ruby-2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require&apos;
32: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require&apos;
31: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi&apos;
30: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register&apos;
29: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi&apos;
28: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require&apos;
27: from /home/app/Desktop/jonabell/config/environment.rb:5:in `&lt;main&gt;&apos;
26: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!&apos;
25: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers&apos;
24: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each&apos;
23: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each&apos;
22: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component&apos;
21: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `call&apos;
20: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each&apos;
19: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component&apos;
18: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from&apos;
17: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component&apos;
16: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each&apos;
15: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers&apos;
14: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run&apos;
13: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec&apos;
12: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:84:in `block in &lt;class:Engine&gt;&apos;
11: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker.rb:27:in `bootstrap&apos;
10: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/commands.rb:14:in `bootstrap&apos;
9: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:18:in `refresh&apos;
8: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:83:in `load&apos;
7: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:47:in `public_manifest_path&apos;
6: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:43:in `public_output_path&apos;
5: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:39:in `public_path&apos;
4: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:80:in `fetch&apos;
3: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:84:in `data&apos;
2: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `load&apos;
1: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `read&apos;
/home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `read&apos;: <b>No such file or directory @ rb_sysopen - /home/app/Desktop/jonabell/config/webpacker.yml (</b><u style="text-decoration-style:single"><b>Errno::ENOENT</b></u><b>)</b>
78: from bin/rails:3:in `&lt;main&gt;&apos;
77: from bin/rails:3:in `load&apos;
76: from /home/app/Desktop/jonabell/bin/spring:15:in `&lt;top (required)&gt;&apos;
75: from /home/app/Desktop/jonabell/bin/spring:15:in `require&apos;
74: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `&lt;top (required)&gt;&apos;
73: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load&apos;
72: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/bin/spring:49:in `&lt;top (required)&gt;&apos;
71: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run&apos;
70: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call&apos;
69: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call&apos;
68: from /home/app/.rvm/gems/ruby-2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load&apos;
67: from /home/app/Desktop/jonabell/bin/rails:9:in `&lt;top (required)&gt;&apos;
66: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require&apos;
65: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency&apos;
64: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require&apos;
63: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require&apos;
62: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi&apos;
61: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register&apos;
60: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi&apos;
59: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require&apos;
58: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `&lt;main&gt;&apos;
57: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke&apos;
56: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform&apos;
55: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch&apos;
54: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command&apos;
53: from /home/app/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run&apos;
52: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `perform&apos;
51: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `tap&apos;
50: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:147:in `block in perform&apos;
49: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:37:in `start&apos;
48: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout&apos;
47: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app&apos;
46: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app&apos;
45: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config&apos;
44: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file&apos;
43: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string&apos;
42: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval&apos;
41: from config.ru:in `&lt;main&gt;&apos;
40: from config.ru:in `new&apos;
39: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize&apos;
38: from /home/app/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval&apos;
37: from config.ru:3:in `block in &lt;main&gt;&apos;
36: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative&apos;
35: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require&apos;
34: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency&apos;
33: from /home/app/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require&apos;
32: from /home/app/.rvm/gems/ruby-2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require&apos;
31: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require&apos;
30: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi&apos;
29: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register&apos;
28: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi&apos;
27: from /home/app/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require&apos;
26: from /home/app/Desktop/jonabell/config/environment.rb:5:in `&lt;main&gt;&apos;
25: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!&apos;
24: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers&apos;
23: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each&apos;
22: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each&apos;
21: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component&apos;
20: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `call&apos;
19: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each&apos;
18: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component&apos;
17: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from&apos;
16: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component&apos;
14: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers&apos;
13: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run&apos;
12: from /home/app/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec&apos;
11: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:84:in `block in &lt;class:Engine&gt;&apos;
10: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker.rb:27:in `bootstrap&apos;
9: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/commands.rb:14:in `bootstrap&apos;
8: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:18:in `refresh&apos;
7: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:83:in `load&apos;
6: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:47:in `public_manifest_path&apos;
5: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:43:in `public_output_path&apos;
4: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:39:in `public_path&apos;
3: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:80:in `fetch&apos;
2: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:84:in `data&apos;
1: from /home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:87:in `load&apos;
/home/app/.rvm/gems/ruby-2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:91:in `rescue in load&apos;: <b>Webpacker configuration file not found /home/app/Desktop/jonabell/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /home/app/Desktop/jonabell/config/webpacker.yml (</b><u style="text-decoration-style:single"><b>RuntimeError</b></u><b>)</b>
boot@noki-K54C:~/Desktop/app$
</code></pre>
<p>I already check the version of rails and its 6.0.0 my ruby version is 2.6.0.</p>
<p>Tried to search the web and try a few solutions but did not work out for me. </p>
<p>Any idea what am I missing? </p>
| <ruby-on-rails> | 2019-09-11 14:50:38 | HQ |
57,892,596 | Need to join two lists (date and time) into one list | <p>I have two lists:</p>
<p><code>date = ['09.10.2019', '09.10.2019', '09.10.2019']</code></p>
<p>and </p>
<p><code>time = ['8:00', '9:00', '10:00']</code></p>
<p>and I need to create a new one that should look like:</p>
<p><code>date_time = ['09.10.2019 8:00', '09.10.2019 9:00', '09.10.2019 10:00']</code></p>
<p>I've already tried to use .append():</p>
<pre><code>```date_time=[]
for element in data:
date_time.append(date+time)```
</code></pre>
<p>, but I'm not able to add a space between them: </p>
<p><code>date_time = ['09/10/201901:00', '09/10/201902:00', '09/10/201903:00']</code></p>
<p>Any thoughts?</p>
<p>Thanks</p>
| <python> | 2019-09-11 15:41:23 | LQ_CLOSE |
57,893,692 | Uncaught TypeError: this.is is not a function | <p>I am getting error on <code>this.is</code>. is there any alternatives?</p>
<pre><code> function UpdateTotalPrice() {
$('input[type=checkbox]').each(function () {
var id = this.id;
if (id.indexOf("chkSelected") > -1) {
if (this.checked && this.is(':disabled')==false) {
// alert(id);
getPrice(this);
}
}
});
}
</code></pre>
| <javascript><jquery> | 2019-09-11 16:53:58 | LQ_CLOSE |
57,896,392 | How to disable user interaction on SwiftUI view? | <p>Let's say I have a SwiftUI view hierarchy that looks like this:</p>
<pre><code>ZStack() {
ScrollView {
...
}
Text("Hello.")
}
</code></pre>
<p>The <code>Text</code> view blocks touch events from reaching the underlying <code>ScrollView</code>.</p>
<p>With UIKit, I'd use something like <code>.isUserInteractionEnabled</code> to control this, but I can't find any way to do this with SwiftUI.</p>
<p>I've tried adding a <code>Gesture</code> with a <code>GestureMask</code> of <code>.none</code> on the text view, but that doesn't seem to work.</p>
<p>I hope I'm missing something obvious here, because I need to put some status information on top of the scroll view. </p>
| <swiftui><user-interaction> | 2019-09-11 20:29:24 | HQ |
57,897,288 | UITableViewAlertForLayoutOutsideViewHierarchy error: Warning once only (iOS 13 GM) | <p>I am getting a strange error with iOS13 when performing a Segue and I can't figure out what it means, nor can I find any documentation for this error. The problem is that this seems to cause a lot of lag (a few seconds) until the segue is performed.</p>
<blockquote>
<p>2019-09-11 22:45:38.861982+0100 Thrive[2324:414597] [TableView] Warning once only: UITableView was told to layout its visible cells
and other contents without being in the view hierarchy (the table view
or one of its superviews has not been added to a window). This may
cause bugs by forcing views inside the table view to load and perform
layout without accurate information (e.g. table view bounds, trait
collection, layout margins, safe area insets, etc), and will also
cause unnecessary performance overhead due to extra layout passes.
Make a symbolic breakpoint at
UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the
debugger and see what caused this to occur, so you can avoid this
action altogether if possible, or defer it until the table view has
been added to a window. Table view: ; layer = ; contentOffset: {0, 0}; contentSize: {315, 118};
adjustedContentInset: {0, 0, 0, 0}; dataSource: ></p>
</blockquote>
<p>I am using Hero but I tried disabling it and using a regular Segue and this hasn't stopped the lag.</p>
<p>The code to initiate the segue is didSelectRowAt</p>
<pre><code>func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
selectedCell = realIndexFor(activeGoalAt: indexPath)
performSegue(withIdentifier: "toGoalDetails", sender: nil)
} else if indexPath.section == 1 {
selectedCell = indexPath.row
performSegue(withIdentifier: "toIdeaDetails", sender: nil)
} else {
selectedDecision = indexPath.row
hero(destination: "DecisionDetails", type: .zoom)
}
}
</code></pre>
<p>And then none of the code in viewDidLoad or viewWillAppear from the destination VC affects this in any way (I tried commenting it all out with no difference.</p>
<p>Any idea what's causing this? I can share whatever other details are needed.</p>
<p>Thank you.</p>
| <ios><swift><tableview><ios13> | 2019-09-11 21:55:08 | HQ |
57,898,287 | Serial.print in arduino not write variables | <p>I'm developing in arduino but I'm having problem to write in Serial</p>
<p>My code:</p>
<pre><code>void send(String prefix, String cmd, String param) {
Serial.print("@");
Serial.print(prefix);
Serial.print(":");
Serial.print(cmd);
if (param.length() > 0) {
Serial.print("=");
Serial.print(param);
}
Serial.print(";");
}
void sendComand(String cmd, String param)
{
send("CMD", "xxx", "param");
}
</code></pre>
<p>Result:</p>
<pre><code>@:;@:;@:;@:;@:;@:;@:;@:;@:;@:;
</code></pre>
<p>Whats wrong?</p>
| <c++><arduino> | 2019-09-12 00:31:34 | LQ_CLOSE |
57,902,761 | how to make Decimal conform LosslessStringConvertible in swift 5 | Hi here I want to convert Decimal to String.
It says Decimal needs to conform LosslessStringConvertible so I add an extension looks like
```
extension Decimal: LosslessStringConvertible {
public init?(_ description: String) {
}
}
```
But it won't work. My understanding is to extract the description, which is of String type, to a Decimal. But not sure how to do this... | <swift><decimal><extension-methods> | 2019-09-12 08:30:58 | LQ_EDIT |
57,902,889 | How to count emails according to said criterion from all folders and subfolders in outlook using VBA excel | How to count mails in outlook according to certain criterion based on subject, date, sender etc from all folders and subfolders using excel vba
| <excel><vba> | 2019-09-12 08:38:43 | LQ_EDIT |
57,903,980 | I need report on chat system created in firebase | <p>I have created chat system in firebase and now i want report on daily,weekly,monthly that how many users are exchaging how many words and how much time they are engaged with app,</p>
| <android><firebase><firebase-cloud-messaging> | 2019-09-12 09:44:12 | LQ_CLOSE |
57,904,500 | How can I hide/remove ScrollBar in ScrollView in SwiftUI? | <p>If the content of the ScrollView is bigger than the screen, while scrolling, the scrollbar on the side appears. I couldn't find anything to help me hide it.</p>
| <swiftui> | 2019-09-12 10:12:36 | HQ |
57,906,529 | How to Post a List of Users to an ASP.Core POST Action? | <p>want to post a List of User with details like Firstname, Lastname, email...
to an ASP.Core POST Action method. What is the best way to do this?</p>
<p>I've coded an HTML form with a jquery function to give the user feedback that a user was added to a list. But I have no idea except to put hidden inputs via jquery.</p>
<p><a href="https://jsfiddle.net/uvoqedjh/4/" rel="nofollow noreferrer">https://jsfiddle.net/uvoqedjh/4/</a></p>
<pre><code> <form asp-action="Create">
<div class="form-group col">
<label class="col control-label" for="vorname">Vorname</label>
<div class="col">
<input id="vorname" name="vorname" type="text" placeholder="Vorname" class="form-control input-md" required="">
</div>
</div>
<div class="form-group col">
<label class="col control-label" for="nachname">Nachname</label>
<div class="col">
<input id="nachname" name="nachname" type="text" placeholder="Nachname" class="form-control input-md" required="">
</div>
</div>
</div>
</form> <button id="addAnsp" class="btn btn-primary">Add</button>
<div id="ansprechpartnerliste"></div>
</code></pre>
| <asp.net-mvc><asp.net-core> | 2019-09-12 12:16:26 | LQ_CLOSE |
57,907,817 | dyld: Library not loaded SwiftUI when app runs on iOS 12 using @available(iOS 13.0, *) | <p>I decided to implement a few views using SwiftUI in my app. The app is backwards compatible to iOS 12.</p>
<p>Everything works perfectly until I run it on an iOS 12 device. The app crashes immediately and the warning I get says SwiftUI cannot be loaded.</p>
<pre><code>dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
Referenced from: /var/containers/Bundle/Application/MyApp.app/MyApp
Reason: image not found
</code></pre>
<p>I'm using @available(iOS 13.0, *) in all the correct places and there are no compiler warnings and the app runs perfectly on iOS 13</p>
<p>How can I get this to work for iOS 12?</p>
| <ios><swift><xcode><swiftui> | 2019-09-12 13:28:52 | HQ |
57,908,068 | Hi everyone, How to attach exist mysql volume to a new container | I pull mysql image and I wont to run a container with that image, but instead create a new volume I'd like to use my mysql-db volume.
what is the easiest way to do that?
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -v mysql-db:/var/lib/mysql | <docker> | 2019-09-12 13:41:43 | LQ_EDIT |
57,910,231 | Problems creating custom txt names in C | I am having trouble creating custom filenames in C. The goal is to use custom files to print data to for separate entities. My current code for the printing to the file is:
```
void output(int t, double rx[], double ry[], double rz[], double vx[], double vy[], double vz[], double fx[], double fy[], double fz[])
{
for(int i = 0; i < Npart; i++)
{
char name[20];
sprintf(name, "Part_%d.txt", i);
fptr = fopen(name, "a");
fprintf(fptr, "%4d, %10.2e, %10.2e, %10.2e, %10.2e, %10.2e, %10.2e, %10.2e, %10.2e, %10.2e\n", t, rx[i], ry[i], rz[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]);
}
}
```
The fptr has been initialised using *FILE.
In this code Npart is currently only 2 entities (its set to 2 by a #define), but will be a lot bigger once I progress the program. Sadly when running this code it seems to work for low numbers of outputs, until 464 per file to be exact.
After that I get the following error message:
```
timestep made, time is 463
Segmentation fault (core dumped)
```
When removing the output functionality and running the code without it no problems occur. Is there any clear mistake I have made in this code? | <c> | 2019-09-12 15:39:46 | LQ_EDIT |
57,910,368 | check if two array have any value same | <p>Is there any way I could check if two arrays contain the same value?</p>
<pre><code>array (size=1)
0 => string '209' (length=3)
array (size=4)
0 => string '209' (length=3)
1 => string '208' (length=3)
2 => string '1' (length=1)
3 => string '2' (length=1)
</code></pre>
<p>I want to see if I can get 209 they match in both array</p>
| <php><arrays> | 2019-09-12 15:48:21 | LQ_CLOSE |
57,911,311 | circular image view like skype in flutter | how to make this circular image like skype in flutter. Iam new to flutter. Anyone help. Thanks alot[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/sLUxN.jpg | <flutter><flutter-layout> | 2019-09-12 16:51:03 | LQ_EDIT |
57,911,503 | There is a way to make a request every .txt file line? | <p>I'm doing a roblox name checker. Only except code works.</p>
<p>I've tried things like with open(...)as f:,etc.</p>
<pre class="lang-py prettyprint-override"><code>with open('usernames.txt') as f:
for line in f:
a=requests.get('https://api.roblox.com/users/get-by-username?username=%s' % line)
r=json.loads(a.content)
try:
if r["success"]== False:
print("Username avaliable ["+line+"]")
f=open("free.txt",'a')
f.write('n')
f.close()
except:
print("Username taken ["+line+"]")
file=open("taken.txt",'a')
file.write(line)
file.close()
</code></pre>
| <python> | 2019-09-12 17:04:27 | LQ_CLOSE |
57,912,609 | How to reduce the time complexity of this nested loop code in python | <p>Please help me reduce the time complexity of the nested loop in Python</p>
<p>df is a dataframe with say 3 columns, say name, city and date for eg
rep data frame has the average/means based on 2 columns name and city from df. I need to reattach the mean from rep to df </p>
<pre><code>for i in range(0,len(rep)):
for j in range(k,len(df)):
if df["X"][j] == rep["X"][i]:
df["Mean"][j] = rep["Mean"][i]
else:
k=j
break
</code></pre>
| <python><algorithm> | 2019-09-12 18:28:28 | LQ_CLOSE |
57,912,690 | What is The Diffrence Between These Two Code? | I Am On Codewars And My Code Shows A Error Besides Being Same as A Solution. I Can't See The Difference .. Can You help Me??
if len(numbers) <= 1:
return []
numbers.remove(min(numbers))
return numbers
and this
if len(numbers) <= 1: return []
numbers.remove(min(numbers))
return numbers
| <python> | 2019-09-12 18:34:21 | LQ_EDIT |
57,913,649 | Number of Integers | <p>Write a function that receives a string as input and returns the number of integer numbers present in every token from the string. Example:</p>
<p>Input: potato 123 potato potata 1 23423p 12/4 test </p>
<p>Output: 2</p>
<p>This is the code that I have tried, but it doesn't work</p>
<pre><code>import re
text = input("Enter a sentence both string and intenger: ")
print("The original sting: " + text)
temp = re.findall(r'\d+', text)
res = list(map(int, temp))
print("The numbers list is: " + str(res))
</code></pre>
| <python> | 2019-09-12 19:51:42 | LQ_CLOSE |
57,914,903 | 'ContentView_Previews' is not a member type of error | <p>'ContentView_Previews' does not compile if ContentView references an external object.</p>
<p>If I remove all references to @ObservedObject, preview compiles.</p>
<pre><code>import SwiftUI
struct ContentView: View {
@ObservedObject var fancyTimer = FancyTimer()
var body: some View {
Text("\(fancyTimer.timerValue)")
.font(.largeTitle)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
import Foundation
import SwiftUI
import Combine
class FancyTimer: ObservableObject {
@Published var timerValue: Int = 0
init() {
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true)
{ timer in
self.timerValue += 1
}
}
}
</code></pre>
<p>Error is: 'ContentView' is not a member type of 'FancyTimer'</p>
| <swiftui> | 2019-09-12 21:47:24 | HQ |
57,915,582 | python - problem with output - iterate over dictionary | <p>I want to print('Doesn't exist') when the input is not a key in dictionary, it looks like its checking every single key in dictionary and prints if its there or not. I would like to ask if its possible to get output only one time if dictionary doesn't' contain input. </p>
<pre><code>number = input('Number: ')
data = {
'1' : 'One',
'2' : 'Two',
'3' : 'Three',
}
number = number.upper()
for a, value in data.items():
if a == number:
print(number, ":", value)
else:
print('Doesnt exist here')
Number: 1
1 : One
Doesnt exist here
Doesnt exist here
</code></pre>
| <python> | 2019-09-12 23:26:13 | LQ_CLOSE |
57,916,302 | "mov" of "assembly language" meant copy or move? | <p>Recently, I read the C++ of std::mov, and I thought of a question as the title.</p>
<p>Assume initial value following:</p>
<pre><code>int a= 1;
int b= 2;
</code></pre>
<p>I think:</p>
<p><strong>Situation 1,</strong></p>
<p><strong>after move (a <- b):</strong></p>
<pre><code>a= 2 , b=
</code></pre>
<p>b is null because moved</p>
<p><strong>Situation 2,</strong></p>
<p><strong>after copy (a <- b):</strong></p>
<pre><code>a=2 , b=2
</code></pre>
<p>I know std::move of C++ is <strong>Situation 1</strong></p>
<p>Which Situation is <code>mov</code> ( <code>mov %b %a</code> ) of <strong>Assembly lang.</strong>?</p>
<p>This is my question.</p>
| <c++><assembly><move><mov> | 2019-09-13 01:34:43 | LQ_CLOSE |
57,916,951 | Is there a reason that .str.split() will not work with '$_'? | <p>I am trying to split a string using .str.split('$_') but this is not working. </p>
<p>Other combinations like 'W_' or '$' work fine but not '$<em>'. I also tried .str.replace('$</em>') - which also does not work.</p>
<p>Initial string is '$<em>WA</em>:G_COUNTRY'</p>
<p>using
ClearanceUnq['Clearance'].str.split('$_')
results in [$<em>WA</em>:G_COUNTRY]
no split.... </p>
<p>whereas
ClearanceUnq['Clearance'].str.split('$')
results in [, <em>WA</em>:G_COUNTRY]
as expected</p>
| <python><pandas> | 2019-09-13 03:29:25 | LQ_CLOSE |
57,916,974 | Filtration of multilevel json array in javascript | i am trying to duplicate value only one time as well as unique from my json array.
i have tried the following code.
return_data = {};
return_data.planner = [{
"date": "2019-08-30T12:10:08.000Z",
"event": [{
"name": "Event 1",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
}]
},
{
"date": "2019-09-30T10:10:08.000Z",
"event": [{
"name": "Event 5",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 4",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 3",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
}
]
},
{
"date": "2019-09-30T10:10:08.000Z",
"event": [{
"name": "Event 5",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 4",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 3",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
}
]
},
{
"date": "2019-09-30T10:10:08.000Z",
"event": [{
"name": "Event 5",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 4",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
},
{
"name": "Event 3",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
"color": "#ccccc"
}
]
}
]
res.header('Content-Type', 'application/json');
res.send(JSON.stringify(return_data));
// using above json array.
var u_array = [];
var tem = JSON.parse(JSON.stringify(return_data.response.planner));
for (var i = 0; i < tem.length; i++) {
console.log(tem[i].date);
var status = true;
for (var j = 0; j < u_array.length; j++) {
if (u_array[j].date == tem[i].date) {
status = false;
break;
}
}
if (status) {
u_array.push(tem[i]);
}
};
return_data.response.planner = u_array;
i expect the duplicate value only one time with unique values. | <javascript><jquery><angular><reactjs> | 2019-09-13 03:33:44 | LQ_EDIT |
57,917,076 | Should we Use ViewModels to communicate between 2 different fragments or bundles in single activity App Architecture? | <p>Scenario 1 - If we use <code>ViewModels</code> to communicate between fragments, then the <code>ViewModel</code> has to be created by activity reference and hence going to stay there in memory until the activity is destroyed.</p>
<p>Scenario 2 - In master-detail flow <code>ViewModel</code> makes our life easier but again the memory usage issue is there.</p>
<p>Scenario 3 - We have <code>viewModelScope</code> in the new version of arch library to cancel jobs with Fragment/Activity lifecycles, but if <code>ViewModel</code> is created with activity reference then it's going to stay there until activity is destroyed. Hence the job can still be executing and fragment is already gone.</p>
| <android><android-fragments><android-lifecycle><android-viewmodel><bundles> | 2019-09-13 03:53:09 | HQ |
57,917,470 | Convert Rdd to Data Frame - i am getting output in the data frame table with " " like "2012-10-10" but i should get output without " " in the table | My input file contains below input
"date","time","size","r_version","r_arch","r_os"
"2012-10-01","00:30:13",35165,"2.15.1","i686","linux-gnu"
"2012-10-01","00:30:15",212967,"2.15.1","i686","linux-gnu"
"2012-10-01","02:30:16",167199,"2.15.1","x86_64","linux-gnu"
my present output is like
[present output][1]
my required output is
[required output][3]
[1]: https://i.stack.imgur.com/DMfXP.png
[2]: https://i.stack.imgur.com/jBzXl.png
[3]: https://i.stack.imgur.com/vVJpU.png | <apache-spark><pyspark><apache-spark-sql><pyspark-sql> | 2019-09-13 04:54:09 | LQ_EDIT |
57,917,574 | Javascript push() function is not adding objects to an array | <p>I have a for-loop that cycles thru some html elements collected with jquery selectors and extracts some text or values from them. Each loop creates a new object. The object is simple, it is just text and a value. Console.log confirms that the object is created successfully each loop.</p>
<p>Outside the for-loop, I have a variable (kvObjs) that is initialized as an array. At the end of the for-loop, I push the new object into the array. But console.log confirms that the array stays empty.</p>
<p>This is part of a larger piece of code. This appears to be the part that isn't working. The specific function that isn't working is getKVs(), well, it works except for the part that tries to push the object on the array.</p>
<p>I promise you I looked thru all or almost all the "similar questions" and nothing clicked with me. I might have missed something in them, though. I feel like I'm overlooking something obvious.</p>
<p>I have tried to creating an array manually (var x = ["bob", "steve", "frank"]) and then setting another variable equal to that (var y = x) and that seems to work. I even created an array of objects, as in var x = [{"Key":"Bob","Value":10}, {"Key":"Steve","Value":5}], and I think that worked to. But my for-loop doesn't.</p>
<pre><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
.Jobs {
width: 300px;
margin: 0 auto;
}
.Jobs li {
display: grid;
grid-template-columns: 1fr 50px;
padding: 2px 5px 2px 7px;
align-items: center;
}
.Jobs .value {
text-align: right;
}
.Jobs p.value {
padding-right: 7px;
}
.even {
background-color: rgba(0,0,0,0.2);
}
</style>
<div class="Jobs">
<ul>
<li class="kvp">
<p class="key">Bob</p>
<input class="value" type="number" value="3"/>
</li>
<li class="kvp even">
<p class="key">Frank</p>
<input class="value" type="number" value="2"/>
</li>
<li class="kvp">
<p class="key">Tom</p>
<input class="value" type="number" value="8"/>
</li>
<li class="kvp total even">
<p class="key">Total</p>
<p class="value">13</p>
</li>
</ul>
</div>
<script>
class KV {
constructor(key, value) {
this.Key = key;
this.Value = value;
}
}
function getKVs(type) {
type = "." + type + " .kvp";
var elmts = $(type);
var kvObjs = [];
for (var i = 0; i < elmts.length; i++) {
var elmt = $(elmts[i]);
if(elmt.hasClass("total")) {
// do nothing
} else {
var k = elmt.find(".key").text();
var v = elmt.find("input").val();
var kv = new KV(k, v);
console.log(kv); // the kv object is successfully created
kvObjs.push[kv];
console.log(kvObjs.length); // but it is not being added to the array (length stays 0)
}
}
return kvObjs;
}
var x = getKVs("Jobs");
console.log(x); // so I'm transferring an empty array to x
</script>
</code></pre>
<p>I keep getting an empty array.</p>
| <javascript><arrays><javascript-objects> | 2019-09-13 05:07:26 | LQ_CLOSE |
57,917,603 | I have two tables i wanto retrive the different results from same column in SQL | I have listed the actual table.from that i want the result as expected one.[enter image description here][1]
[1]: https://i.stack.imgur.com/p53W1.jpg | <sql-server> | 2019-09-13 05:10:55 | LQ_EDIT |
57,918,265 | Compare 2 csv files with numaric values | Compare two csv files and required result need to be shared like diff in numaric values, field value type, count of records etc.
input file A (XYZ_20190908.csv):
Name,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10
K1 data,8470,37609,18413,13799,24946,27870,376,24573,27247,41569,687
Total VoLte Traffic,130944.126111,689417.554722,208189.652500,196002.846944,223558.256111,501265.626667,2508.617222,200054.686389,174738.403056,394327.636389,2017.576667
K2 Data,11163.201111,52680.898056,19920.813333,15878.103611,18247.582222,40295.689444,264.738333,17732.341111,15486.259444,32662.475833,199.080278
K3 Data,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN
K4 Data,11163.201111,52680.898056,19920.813333,15878.103611,18247.582222,40295.689444,264.738333,17732.341111,15486.259444,32662.475833,199.080278
input file B (XYZ_20190909.csv):
Name,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10
Calculation,CHN,GUJ,HR,KOL,MAH,MUM,PJB,ROB,TN,UPE,UPW
K1 data,8467,37622,18418,14138,24943,27914,370,24621,27310,41565,687
K2 Data,199379.472222,NaN,241390.289167,264378.881667,292310.146944,774915.508056,3560.825278,212203.013611,213419.833611,403226.574444,2023.039167
K3 Data,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN
K4 Data,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN
Output
1. difference in each value for the corresponding fields.
2. if all the values are "NaN" error
3. compare value in file A with file B, if the value corresponding to the position in both file with different data have different data type (like file A having 52680.898056 and in file B the value is NaN) should display error
need help | <python><csv> | 2019-09-13 06:21:18 | LQ_EDIT |
57,918,374 | Javascript - print all names in array containing multiple objects | <p>So I'm new to javascript and programming in general and I have an array of objects below. I'm trying to generate and print an array containing the full names of students (first and last name separated by “ “) of all students who received an exam grade of 80 or higher. Sort of in the format like [ 'James Johnson', 'Stephanie Ottesen', 'Leonard Arvan', 'Beverly Mott', 'Beatrice Jaco' ].</p>
<p>I made a separate array already but I'm having trouble figuring out how to access only certain objects in an array and add them to my new array. From googling, I've come across the .map(), .reduce(), and .filter() methods but I'm struggling to figure out how to take these methods and format them into my program. Any help or references would be appreciated.</p>
<pre><code>let students = [{fname: "Jane", lname: "Brazier", snum: "100366942", agrade: 67.59127376966494, tgrade: 64.86530868914188, egrade: 70.52944558104066}, {fname: "Ricardo", lname: "Allen", snum: "100345641", agrade: 65.80370345301014, tgrade: 75.40211705841241, egrade: 55.39348896202821}, {fname: "Mary", lname: "Hernandez", snum: "100221207", agrade: 71.20761408935981, tgrade: 71.37529197926764, egrade: 75.82038980457698}, {fname: "James", lname: "Johnson", snum: "100200842", agrade: 72.5791318299902, tgrade: 81.65883679807183, egrade: 85.19664228946989}, {fname: "Stephanie", lname: "Ottesen", snum: "100225067", agrade: 88.19738810849226, tgrade: 84.68339894849353, egrade: 82.23947265645927}, {fname: "Martin", lname: "Conway", snum: "100358379", agrade: 71.28759059295344, tgrade: 79.13194908266965, egrade: 77.61880623797336}, {fname: "Andrew", lname: "Weaver", snum: "100376243", agrade: 70.01798139244363, tgrade: 78.64811561086252, egrade: 78.68650242850617}, {fname: "Rhonda", lname: "Ford", snum: "100296902", agrade: 56.14580882764524, tgrade: 63.9209865108888, egrade: 60.186613967770334}, {fname: "Leonard", lname: "Arvan", snum: "100220616", agrade: 80.67865525396981, tgrade: 92.73557717342663, egrade: 88.32126970338336}, {fname: "William", lname: "Culler", snum: "100307637", agrade: 65.75251699043244, tgrade: 62.18172136246404, egrade: 63.065185542933094}, {fname: "David", lname: "Nakasone", snum: "100353719", agrade: 62.63260239883763, tgrade: 58.352794766947866, egrade: 59.80461902691901}, {fname: "Maria", lname: "Young", snum: "100311331", agrade: 70.13767021264486, tgrade: 76.09348747016176, egrade: 79.99207130929622}, {fname: "Beverly", lname: "Mott", snum: "100325579", agrade: 83.08140516644137, tgrade: 94.80666640692787, egrade: 85.15875656837004}, {fname: "Patrick", lname: "Francis", snum: "100257773", agrade: 66.79534616079296, tgrade: 47.744928296560076, egrade: 64.05723052865763}, {fname: "Tracy", lname: "Bonds", snum: "100233277", agrade: 70.2289028670531, tgrade: 65.32258294210156, egrade: 77.04816321925091}, {fname: "Richard", lname: "Akers", snum: "100216705", agrade: 52.446722363991015, tgrade: 49.205597783687374, egrade: 53.72940974941982}, {fname: "Beatrice", lname: "Jaco", snum: "100233935", agrade: 81.89338938644417, tgrade: 71.05459078971688, egrade: 83.08235397281308}, {fname: "Guy", lname: "Wendelin", snum: "100336379", agrade: 68.17788319655493, tgrade: 63.82273085525137, egrade: 68.31559946786807}, {fname: "Logan", lname: "Olsen", snum: "100265736", agrade: 59.89037739094347, tgrade: 71.76550299333657, egrade: 64.61665695830132}, {fname: "Gene", lname: "Jeanlouis", snum: "100341666", agrade: 74.16481515505846, tgrade: 68.20592386917109, egrade: 78.25975050135006}]
let studentNames = [];
</code></pre>
| <javascript><arrays><dictionary> | 2019-09-13 06:31:01 | LQ_CLOSE |
57,919,279 | Endless install in android studio | <p>In the recent times I am considering to change my work title from "Android Developer" to "Endless install progress watcher".</p>
<p>It has been happening ever more often that when I try to run my applications or tests Android Studio stucks in endless installing progress like the image below:</p>
<p><a href="https://i.stack.imgur.com/HRbiz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HRbiz.png" alt="enter image description here"></a></p>
<p>This progress remains like forever. It used to be that if I disconnect my device and connect again the next attempt will succeed. Now it is often the case that I need multiple re-connects until I am able to run.</p>
<p>The speculation is the problem is due to ADB hanging and loosing connection somehow, but I do not know how to overcome that.</p>
<p>My configuration is:
- Ubuntu Linux, but colleagues experience the same on Mac OS e.g.
- Android Studio 3.5
- device is Nexus 5X, but the same happens on many other devices </p>
| <android><android-studio><adb> | 2019-09-13 07:40:38 | HQ |
57,919,736 | Extract particular text data from string using R | I have a sample text like "0 zacapa ambar 40% 1l">I would require help to extract 2 different parts of this text.
Output:
1) zacapa ambar
2) 40% 1l | <r><regex><nlp> | 2019-09-13 08:13:52 | LQ_EDIT |
57,921,491 | CSS: Position absolute ::before of child with respect to relative grandparent | <p>I'm trying to position an absolutely position <code>::before</code> of an element with respect to its relatively positioned grandparent. It's parent is not positioned, but it's <code>top</code> and <code>left</code> respect the parent and not the grandparent.</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>* {
box-sizing: border-box;
}
::-webkit-input-placeholder,
::-moz-placeholder {
color: #9b9b9b;
}
.field {
height: 43px;
display: flex;
flex-direction: column-reverse;
position: relative;
}
input,
label {
display: block;
}
input {
font-size: 14px;
border: 0;
border-bottom: 1px solid #F2F2F2;
border-radius: 0;
padding: 3px 0 10px 0;
background-color: transparent;
}
input:focus {
outline: 0;
border-bottom: 1px solid #D66C9C;
}
label {
font-size: 12px;
color: #9b9b9b;
transform: translateY(20px);
transition: all 0.2s;
}
input:focus + label {
color: #808080;
transform: translateY(0);
}
input:focus + label::before {
content: "";
width: 5px;
height: 5px;
display: block;
background-color: #d66c9c;
transform: rotate(45deg) translateY(-50%);
position: absolute;
left: 0;
bottom: 0;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="field">
<input type="text" id="fullname">
<label for="fullname">Name</label>
</div>
</body>
</html></code></pre>
</div>
</div>
</p>
| <html><css> | 2019-09-13 10:01:48 | LQ_CLOSE |
57,921,661 | Finding sorted array index of closest int value | <p>I want to use a Lookup-table that contains 205887 positive int values. They are sorted from highest to lowest value.
I have a positive int value (int a). If I have that value inside the table, I want to receive the index (int b) of the value.
If that value does not exist inside the table, I want the index of the nearest-lower value.</p>
<p>This process is performance critical so I want it to be as fast as possible.</p>
<p>Is it possible to create an array with 2^31 values but only 205887 being initialized?
If yes, would that result in the table being roughly the same size of the one I described above?
If yes, could I find b by checking the index of this array with value a and add one to it until I find an initialized entry which contains my value b?</p>
<p>I am just a beginner at C# and could not find sufficient information in documents. Thanks in advance.</p>
| <c#> | 2019-09-13 10:13:24 | LQ_CLOSE |
57,922,075 | multiple text colors in fabricJS | <p>Is there any way of adding more than one text color to a single Text or iText element in FabricJS? I am trying to use it to create a poster and the text needs different colors in the same paragraph.</p>
| <javascript><colors><html5-canvas><fabricjs> | 2019-09-13 10:39:45 | LQ_CLOSE |
57,922,510 | waht is the meaning of <> " angular bracket" in javascript | I using vscode for javascript. for example when i writing a filter on an array vscode shows me this documentation for callback function:
>"< S extends T >(callbackfn: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[]
"
i see <> in typescript code but can't understand concept of it.
what does that angular brackets means? | <javascript><typescript><visual-studio-code> | 2019-09-13 11:09:07 | LQ_EDIT |
57,926,908 | How to count the last 60s in moving window in golang? | <p>I want to know if how can I count the number of request based on the moving window in golang after 60s?</p>
| <go><goroutine> | 2019-09-13 15:58:50 | LQ_CLOSE |
57,927,576 | iOS 13 UISearchBar appearance and behaviour | <p>I have my <code>UISearchBar</code> set up as follows:</p>
<pre><code>searchController.searchResultsUpdater = self
searchController.obscuresBackgroundDuringPresentation = false // Allow user to tap on results
searchController.searchBar.placeholder = "Search patients" // Placeholder
searchController.searchBar.barStyle = .blackOpaque
searchController.searchBar.tintColor = colors.text // Cancel button tint
navigationItem.searchController = searchController // Set the searchController
navigationItem.hidesSearchBarWhenScrolling = true // Auto-hide search when user scrolls
</code></pre>
<p>This is how it looks on iOS 12: <a href="https://i.stack.imgur.com/XH3Q7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XH3Q7.png" alt="iOS 12 appearance"></a>
vs iOS 13: <a href="https://i.stack.imgur.com/ElRbM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ElRbM.png" alt="enter image description here"></a>
What's changed in iOS 13? I've tried going through the different <code>barStyles</code>, and also setting <code>.isTranslucent</code> to false - no effect for either. Light/dark mode also don't change anything.</p>
<p>The other change is hiding the search bar - on iOS 12 if I scrolled upwards a little the search bar would hide (didn't matter if the table was populated or not). With iOS 13, once the search bar has appeared (ie the user has swiped down), it cannot be hidden again. Anyone know of a fix for this too?</p>
| <ios><swift><uisearchbar><ios13> | 2019-09-13 16:52:23 | HQ |
57,928,259 | How to join tables on values | Table 1:
Col A | Col B | Col C | Col D
Cat 1 | Bla a | C-1 | D-1
Cat 1 | Bla a | C-2 | D-2
Cat 1 | Bla a | C-3 | D-3
Cat 2 | Bla b | C-4 | D-4
Cat 2 | Bla b | C-5 | D-5
Table 2:
Col A | Col B | Col E
Cat 1 | Bla a | E-1
Cat 2 | Bla b | E-2
Cat 2 | Bla b | E-3
Cat 2 | Bla b | E-4
Desired Table:
Col A | Col B | Col C | Col D | Col E
Cat 1 | Bla a | C-1 | D-1 | E-1
Cat 1 | Bla a | C-2 | D-2 | NULL
Cat 1 | Bla a | C-3 | D-3 | NULL
Cat 2 | Bla b | C-4 | D-4 | E-2
Cat 2 | Bla b | C-5 | D-5 | E-3
Cat 2 | Bla b | NULL | NULL | E-4
I want to add Column E of Table 1 to Table 2. I want to Match Columns A and B of both Tables. There is no correlation between columns C and D to Column E. I have tried Inner and outer joins, What I get is:
Wrong Table:
Col A | Col B | Col C | Col D | Col E
Cat 1 | Bla a | C-1 | D-1 | E-1
Cat 1 | Bla a | C-2 | D-2 | E-1
Cat 1 | Bla a | C-3 | D-3 | E-1
Cat 2 | Bla b | C-4 | D-4 | E-2
Cat 2 | Bla b | C-4 | D-4 | E-3
Cat 2 | Bla b | C-4 | D-4 | E-4
Cat 2 | Bla b | C-5 | D-5 | E-2
Cat 2 | Bla b | C-5 | D-5 | E-3
Cat 2 | Bla b | C-5 | D-5 | E-4
Please Help. Thank You
| <sql><sql-server> | 2019-09-13 17:49:01 | LQ_EDIT |
57,928,281 | How std::random_device generate non-deterministic random numbers? | <p>Why std::random_device generate non-deterministic random numbers? What is the seed in this generator? It's not a time, so what?</p>
| <c++><random> | 2019-09-13 17:51:02 | LQ_CLOSE |
57,929,433 | How to parse LocalTime with time-of-day abbreviation | What's the best way to show a `LocalTime` value based on the device? The United States is the only nation that exclusively uses the AM/PM time of day abbreviation but for some reason the abbreviation does not appear whenever my device locale is set to the United States.
**United States**
2:30 AM / 2:30 PM
**Elsewhere around the world**
02:30 / 14:30
**Current code**
myTV.text = LocalTime.of(2, 30) + " " + LocalTime.of(14, 30)
**Current result**
2:30 14:30
| <kotlin><java-8><localtime><time-format> | 2019-09-13 19:34:07 | LQ_EDIT |
57,930,206 | Return variables in a for loop from imported script function | <p>I have two .py files (test1.py & test2.py)</p>
<p>Now I want in a loop to run test1.py and to import a function from test2.py, let it execute and return the values back to test1.py</p>
<p>test1.py:</p>
<pre><code>from test2 import fun
for i in range(5):
% do stuff
fun(times, data)
xarr[i] = x
yarr[i] = y
</code></pre>
<p>test2.py:</p>
<pre><code>def fun(times,data):
% do stuff
return [x,y]
</code></pre>
<p>It works to execute, but the variables xarr[i] and yarr[i] are not generated</p>
| <python><import><python-import> | 2019-09-13 20:50:53 | LQ_CLOSE |
57,930,235 | Convert decimal to whole number in java | <p>I need to separate the whole number and decimal value. Representing both values as whole numbers.</p>
<p>For example, 1.24 would output:</p>
<p>Whole number: 1
Decimal: 24 </p>
| <java><data-conversion> | 2019-09-13 20:54:00 | LQ_CLOSE |
57,931,117 | What is the difference between object and object[] in java | <p>So i wrote a method that accepts any java object and i figured out that </p>
<pre><code>public void mymethod(Object javaobject) {
}
</code></pre>
<p>works, but with</p>
<pre><code>public void mymethod(Object[] javaobject) {
}
</code></pre>
<p>Eclipse trows an error</p>
<pre><code>The method mymethod(Object[]) in the type myClass is not applicable for the arguments (Object)
</code></pre>
<p>So my question is, where is the difference between these two types ?</p>
| <java><object> | 2019-09-13 22:46:55 | LQ_CLOSE |
57,931,494 | How to know what company protect a website? | <p><a href="https://www.genecards.org" rel="nofollow noreferrer">https://www.genecards.org</a> is protected by cloudflare. But this is not clear from the HTML webpages on genecards.org. Is there a systematically to figure out this kind of information for a number of websites? Thanks.</p>
| <web-scraping> | 2019-09-14 00:10:11 | LQ_CLOSE |
57,932,445 | Merge from A to B directory updating b directory using system.IO c# | <p>I would like to compare two equal directories A and B with subdirectories. If I change, delete, or include directories or files in A, I need to reflect on B. Is there is any C # routine that does this? I have this routine but I can't move on. I would like to update only what I changed in A to B and not all. If I delete a directory in A it does not delete in B</p>
| <c#><system.io.directory> | 2019-09-14 04:29:10 | LQ_CLOSE |
57,932,734 | ValidationError Stack:arn aws cloudformation stack is in ROLLBACK_COMPLETE state and can not be updated | <p>When I deploy using cloudformation <code>aws cloudformation deploy --region $region --stack-name ABC</code></p>
<p>Got error: </p>
<blockquote>
<p>An error occurred (ValidationError) when calling the CreateChangeSet
operation:
Stack:arn:aws:cloudformation:stack/service/7e1d8c70-d60f-11e9-9728-0a4501e4ce4c
is in ROLLBACK_COMPLETE state and can not be updated.</p>
</blockquote>
<p>Please help me !</p>
| <amazon-web-services><amazon-cloudformation><amazon-ecs> | 2019-09-14 05:31:43 | HQ |
57,933,409 | How do you convert a two dimensional list into a list for each row | A=[[1,3,5,7],[2,5,8,12,16],[4,7,8,12]]. I would like the result to be
[1,3,5,7][2,5,8,12,16][4,7,8,12] | <python><list><multidimensional-array><python-3.7> | 2019-09-14 07:29:39 | LQ_EDIT |
57,934,137 | IQKeyboarmanager all part scroll stop only scroll tableview contant | In My Chatting App textFieldDidBeginEditing time Keyboard height auto add using IQKeyboardmanager but that time scroll top all screen . i have reuirement only scroll tableview contact. my navigation header is fix but using this third party scroll all part in top so how can only scroll tableview | <ios><swift><iphone><iqkeyboardmanager> | 2019-09-14 09:23:34 | LQ_EDIT |
57,934,655 | MIPS program that executes a statement | i just started learning MIPS, and i want to know how write a mips program that executes ```s=(a+b)-(c+101) ```where a,b,c are user provided integer inputs ,and s is computed and printed as an output ?
| <assembly><mips><mars> | 2019-09-14 10:33:25 | LQ_EDIT |
57,934,884 | How to pass JSON data from server to client side and use the data in Javscript? | I would like to pass a JSON from server side to client side in Node.js. On the client side I want to use them in Javascript then.
What I tried so far:
```
app.get('/test', function (req, res) {
let data = {
"questions":{
"5-2?":[
{
"ans1":"3"
},
{
"ans2":"8"
},
],
"1+2":[
{
"ans1":"3"
},
{
"ans2":"1"
}
]
}
};
res.render('test', { data: data });
});
```
In my pug file I want to use that data with Javscript like this:
```
script
console.log(!{data});
``` | <javascript><node.js><json> | 2019-09-14 11:07:41 | LQ_EDIT |
57,935,214 | How can I add Offline google maps on website that I am creating | <p>I am building a website which will be used in sea with no internet access and I need to show google maps and draw a path on it.</p>
<p>Can you tell me how can I implement the offline google maps on the website?</p>
<p>Thanks in advance!
Cheers</p>
| <javascript><google-maps><google-maps-api-3><maps> | 2019-09-14 11:48:40 | LQ_CLOSE |
57,935,338 | should be really straight forward but my background for website wont show | [My Code]<https://codepen.io/Crudge/pen/MWgBwZW>
body {background: url('images\Copy_of_mona-eendra-208388-unsplash.jpg') width 100% height 100% margin:0;}
I've got a pen with the whole code on. i'm using ATOM so i've just pulling the objects path and pasting it in the url.
My first website so don't be to harsh please but any critique is welcome.
For some reason i can't set a background image on the body no matter what i try.
cheers
sam
| <html><css> | 2019-09-14 12:07:44 | LQ_EDIT |
57,935,576 | Is it normal that transfer learning (VGG16) performs worse on CIFAR-10? | <p><strong>Note:</strong> I am not sure this is the right website to ask these kind of questions. Please tell me where I should ask them before downvoting this "because this isn't the right place to ask". Thanks!</p>
<p>I am currently experimenting with deep learning using <a href="https://keras.io" rel="nofollow noreferrer">Keras</a>. I tried already a model similar to the one to be found on <a href="https://keras.io/examples/cifar10_cnn/" rel="nofollow noreferrer">the Keras example</a>. This yields expecting results:</p>
<ul>
<li>80% after 10-15 epochs without data augmentation before overfitting around the 15th epoch and</li>
<li>80% after 50 epochs with data augmentation without any signs of overfitting.</li>
</ul>
<p>After this I wanted to try transfer learning. I did this by using the <a href="https://keras.io/applications/#vgg16" rel="nofollow noreferrer">VGG16</a> network without retraining its weights (see code below). This gave very poor results: 63% accuracy after 10 epochs with a very shallow curve (see picture below) which seems to be indicating that it will achieve acceptable results only (if ever) after a very long training time (I would expect 200-300 epochs before it reaches 80%).</p>
<p><a href="https://i.stack.imgur.com/MWmsT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MWmsT.png" alt="Transfer learning results"></a></p>
<p>Is this normal behavior for this kind of application? Here are a few things I could imagine to be the cause of these bad results:</p>
<ul>
<li>the CIFAR-10 dataset has images of <code>32x32</code> pixels, which might be too few for the VGG16 net</li>
<li>The filters of VGG16 are not good for CIFAR-10, which would be solved by setting the weights to <code>trainable</code> or by starting with random weights (only copying the model and not the weights)</li>
</ul>
<p>Thanks in advance!</p>
<hr>
<p><strong>My code:</strong></p>
<p><em>Note that the inputs are 2 datasets (50000 training images and 10000 testing images) which are labeled images with shape <code>32x32x3</code>. Each pixel value is a float in the range <code>[0.0, 1.0]</code>.</em></p>
<pre class="lang-py prettyprint-override"><code>import keras
# load and preprocess data...
# get VGG16 base model and define new input shape
vgg16 = keras.applications.vgg16.VGG16(input_shape=(32, 32, 3),
weights='imagenet',
include_top=False)
# add new dense layers at the top
x = keras.layers.Flatten()(vgg16.output)
x = keras.layers.Dense(1024, activation='relu')(x)
x = keras.layers.Dropout(0.5)(x)
x = keras.layers.Dense(128, activation='relu')(x)
predictions = keras.layers.Dense(10, activation='softmax')(x)
# define and compile model
model = keras.Model(inputs=vgg16.inputs, outputs=predictions)
for layer in vgg16.layers:
layer.trainable = False
model.compile(optimizer='adam',
loss='categorical_crossentropy',
metrics=['accuracy'])
# training and validation
model.fit(x_train, y_train,
batch_size=256,
epochs=10,
validation_data=(x_test, y_test))
model.evaluate(x_test, y_test)
</code></pre>
| <python><keras><deep-learning><image-recognition><transfer-learning> | 2019-09-14 12:39:22 | LQ_CLOSE |
57,935,800 | what is for () function corrct use here | im trying to make a code that checks if a password contains a number an uppercase and a $ symbol with for function but if i add the {} to the for function it wont work
if i do it like this it wont work :
/for(x=0;x<=10;x++) {if( isdigit(password[x])){ number++;}}/ why does removing the {} from for make it work
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
int main()
{ int x=10,uppercase=0,number=0,dollar=0;
char password [x];
printf("enter password: ");
scanf(" %s",&password );
/*if i do it like this it wont work why ?
for(x=0;x<=10;x++) {if(isdigit(password[x])){ number++;}} */
for(x=0;x<=10;x++)
if ( isdigit(password[x])){ number++;}
for(x=0;x<=10;x++)
if ( isupper(password[x])){ uppercase++;}
for(x=0;x<=10;x++)
if ( password[x]=='$'){ dollar++;}
if( (number>=1)&&(uppercase>=1)&&(dollar>=1)){ printf("password saved");}else{ printf("invalid password");}
return 0;} | <c> | 2019-09-14 13:08:43 | LQ_EDIT |
57,936,080 | Placing php ,html, php in one line | <p>Can someone please tell me what am I doing wrong in my code? Every time I try, I receive </p>
<blockquote>
<p>Parse error: syntax error, unexpected '.' </p>
</blockquote>
<pre><code><?php if ( is_woocommerce()){ '<a href="' . home_url(); . '">Home</a>'
} else { '<a href="' . home_url('/shop/'); . '">My Shop</a>'
}?>
</code></pre>
| <php><wordpress> | 2019-09-14 13:42:33 | LQ_CLOSE |
57,936,091 | How I compare two picturebox array's? | I've been working on this app for long time. It has it's flaws, like, instead of using arrays, I could use 2d array, but it is difficult to get in the next row without messing somethings up. I have 6 arrays of pictureboxes on one side and same thing on other. On the bottom I have array of avaliable pictures that get be the right combination. The problem accured when I tried to compare the right combination with the one that user selected. Here is my code.
private void button1_Click(object sender, EventArgs e)
{
if (pb0.Image.ToString() == pb24.Image.ToString())
{
nizKomb[0].Image = Image.FromFile(@"Slike\crvena.png");
}
if(pb1.Image.ToString() == pb25.Image.ToString())
{
nizKomb[1].Image = Image.FromFile(@"Slike\crvena.png");
}
if(pb2.Image.ToString() == pb26.Image.ToString())
{
nizKomb[2].Image = Image.FromFile(@"Slike\crvena.png");
}
if(pb3.Image.ToString() == pb27.Image.ToString())
{
nizKomb[3].Image = Image.FromFile(@"Slike\crvena.png");
}
btnOK2.Visible = true;
ctrl = 1;
}
private void btnOK2_Click(object sender, EventArgs e)
{
for (int i = 0; i < 4; i++)
{
if (boxes2[i].Image.RawFormat == kombinacija[i].Image.RawFormat)
{
nizKomb2[i].Image = Image.FromFile(@"Slike\crvena.png");
}
}
if (boxes2[0].Image == null || boxes2[1].Image == null || boxes2[2].Image == null || boxes2[3].Image == null)
{
MessageBox.Show("Unesite kombinaciju.");
}
else if (boxes2[0].Image != null && boxes2[1].Image != null && boxes2[2].Image != null && boxes2[3].Image != null)
{
btnOK3.Visible = true;
ctrl = 2;
}
} | <c#><.net> | 2019-09-14 13:43:31 | LQ_EDIT |
57,937,280 | How can I detect if my Flutter app is running in the web? | <p>I know that I can detect the operating system with <code>Platform.isAndroid</code>, <code>Platform.isIOS</code>, etc. but there isn't something like <code>Platform.isWeb</code> so how can I detect this?</p>
| <flutter><dart> | 2019-09-14 16:18:08 | HQ |
57,937,308 | Commenting on Python | I am a student taking my first Python class and am using Anaconda & Jupyter for Python 3. I have read up on commenting and understand they begin with a hash mark ( # ) and whitespace character and continue to the end of the line. It is my understanding that they should not affect the execution of the code.
When I run "ls" in order to display my working directory it runs perfectly fine. However, when I add a comment just above it, it does not run. Can someone please help me understand why this might be? Pictures attached.
This is the error I receive with a comment: **---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-96a2904231e9> in <module>()
1 # show working directory
----> 2 ls
NameError: name 'ls' is not defined**
![run 1] https://i.stack.imgur.com/tS4aW.png
! [run 2] https://i.stack.imgur.com/fYegx.png | <python><python-3.x><comments><jupyter> | 2019-09-14 16:23:01 | LQ_EDIT |
57,937,575 | Open a website URL and login to the that website using username and password in C# | <p>I have a wpf window and there is a textbox and a button in it. I manually enter a website url into that textbox (ex. www.abc.com/index.html). </p>
<p>This website page contains a login panel (in normal case, user has to enter the username and password to login). </p>
<p>I am looking for a way to read that URL and send the login credentials through c# code to login into that site and read the content of that particular html page (the page after the logged in).</p>
<p>Please help since i am new to this.</p>
| <c#><html> | 2019-09-14 17:00:05 | LQ_CLOSE |
57,937,750 | Can anyone explain me the eval() and dict()? | price_dict["Price"] = price_dict["Price"].apply(lambda x : dict(eval(x)) )
df = price_dict['Price'].apply(pd.Series)
can anyone explain to me the above equations? | <python><python-3.x><pandas><data-science><data-analysis> | 2019-09-14 17:24:17 | LQ_EDIT |
57,938,784 | Not Found - PUT https://npm.pkg.github.com/package-name | <p>I'm trying to upload a package on GPR (Github Package registry). I log in successfully:</p>
<pre><code>npm login --registry=https://npm.pkg.github.com
</code></pre>
<p>and then run these command:</p>
<pre><code>npm set registry https://npm.pkg.github.com/
npm publish
</code></pre>
<p>which returns this error:</p>
<pre><code>npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/package-name
npm ERR! 404
npm ERR! 404 'package-name@version' is not in the npm registry.
</code></pre>
<p>Seems it tries to upload a package on npm registry instead of github package registry. How should I fix this problem?</p>
| <javascript><git><github><github-actions><github-package-registry> | 2019-09-14 19:51:58 | HQ |
57,938,930 | remove fragment in viewPager2 use FragmentStateAdapter, but still display | <p>I have a viewPager2 and FragmentStateAdapter, and there are Fragement1, 2,3 4, I am in fragment2, and want to remove fragment3, and display fragment4 after fragment2.
The problem is it always show me fragment3(data), the debug shows the fragment3 has been removed, but the displayed page still has fragment3 content. </p>
<p>Adpter:</p>
<pre><code>class TipsAdapter(
private val items: MutableList<TripPage>,
context: FragmentActivity
) : FragmentStateAdapter(context) {
private val fragmentFactory = context.supportFragmentManager.fragmentFactory
private val classLoader = context.classLoader
override fun getItemCount(): Int = items.size
override fun createFragment(position: Int): Fragment {
val pageInfo = items[position]
val fragment = fragmentFactory.instantiate(classLoader, pageInfo.fragmentClass.name)
fragment.arguments = Bundle().also { it.putParcelable(PAGE_INFO, pageInfo) }
return fragment
}
fun getFragmentName(position: Int) = items[position].fragmentClass.simpleName
fun removeFragment(position: Int) {
items.removeAt(position)
notifyItemRemoved(position)
notifyItemRangeChanged(position, items.size)
notifyDataSetChanged()
}
</code></pre>
<p>}</p>
<p>delete fragment code:</p>
<pre><code> if ((view_pager.adapter as TipsAdapter).getFragmentName(index + 1).equals(
TripPreFragment::class.simpleName) &&
viewModel.shouldRemoveBulkApply()) {
(view_pager.adapter as TipsAdapter).removeFragment(index + 1)
view_pager.setCurrentItem(index + 1, true)
} else {
view_pager.setCurrentItem(index + 1, true)
}
</code></pre>
| <android><android-viewpager><fragmentstatepageradapter><android-viewpager2> | 2019-09-14 20:11:44 | HQ |
57,938,998 | Java has .class file which is the executable file/ binary file. Same way what is it for Python or Javascript? | <p>In java .class files hide the actual source code and can only be executed. Am new to Python and JavaScript languages, how is source code protected in these languages? Do they also have something similar to .class files where in the source code isn't visible ?</p>
| <javascript><python> | 2019-09-14 20:21:52 | LQ_CLOSE |
57,939,279 | it doesn't apper add import java.util.Scanner | <p>I'm learning to "code", when i try to write the class Scanner it doesnt recognize the word, in the class that I'm taking shows that I need to add import java util scanner, but it doesn't appear in my options when a press right click,</p>
<p>the same problem happens with "var"</p>
<p>Thank you so much for your help.</p>
<p><a href="https://i.stack.imgur.com/R2zil.png" rel="nofollow noreferrer">enter image description here</a></p>
| <java> | 2019-09-14 21:10:12 | LQ_CLOSE |
57,939,493 | Regular Expression For Parsing JSON Objects | <p>I have a Json file containing text as such:</p>
<pre><code>{
title1: {
x: "abc",
y: "def"
} ,
title2:{
x: "{{abc}}",
y: "{{def}}"
},
}
</code></pre>
<p>I want to first get the title1 title2 ,... groups. And after that, for each group, I want to get the x:..., y:... parts. I try to do this in two steps. For the first step, I used the following regexp:</p>
<pre><code>[\s\S]*:\s*{(((?!}\s*,)[\s\S])*)
</code></pre>
<p>I am trying to say that find <code>:</code> followed by optional white space and then <code>{</code>. Then, continue until you see <code>}</code> followed by optional whitespace and <code>,</code>. But it finds the whole text as a match instead of title1 and title2 parts separately. What is wrong with it? </p>
| <regex> | 2019-09-14 21:45:09 | LQ_CLOSE |
57,940,197 | Python: force csv reader to include "\n"'s, instead of creating newline | While working on a Twitter scraping project recently, I noticed that tweets oftentimes have the newline character within them, `\n`, which correspond to linebreaks in the tweets.
In the `.csv` files I am creating, instead of deleting them, I would like to keep said `\n` characters, but `csv.writer` keeps interpreting them as new lines, and my `.csv`'s thus become littered with line-breaks everywhere.
I don't want to simply do `string.replace("\n", " ")` each time, as that is not efficient, and I have tried opening the csv with the following,
`with open(file_name, 'a', newline='\n') as f:`, but that does not seem to do the trick.
How could I tell the `csv.writer` to interpret as `\n`'s as literal strings, and keep them?
| <python><csv><unicode><newline> | 2019-09-15 00:15:29 | LQ_EDIT |
57,941,097 | I keep getting error when im creating trigger and i don't have idea how to fix it | CREATE TRIGGER ORDER_BILL_TRIG AFTER
INSERT ON ORDER_BILL
FOR EACH ROW MODE DB2SQL
[REFERENCING NEW AS N]
UPDATE ORDER_BILL
SET ORDER_BILL = QUANTITY * (SELECT FOOD_PRICE FROM FOOD WHERE
FOOD_PRICE = N.FOOD_NUM) WHERE N.FOOD_NUM = FOOD_NUM;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DB2SQL
[REFERENCING NEW AS N]
UPDATE ORDER_BILL
SET ORDER_BILL = QUANTITY * (SEL' at line 3 | <mysql><sql> | 2019-09-15 04:15:08 | LQ_EDIT |
57,942,250 | What does the %# flag in a printf statement in C? | <p>I am doing the chapter 3 of the book learning C the hard way by Zed Shaw. I am exploring the different string formatting options for printf. I encountered the following flag to put after the '%#' symbol:</p>
<p>The value should be converted to an "alternate form". For o conversions, the first character of the output string is made zero (by prefixing a 0 if it was not zero already). For x and X conversions, a nonzero result has the string "0x" (or "0X" for X conversions) prepended to it. For a, A, e, E, f, F, g, and G conversions, the result will always contain a decimal point, even if no digits follow it (normally, a decimal point appears in the results of those conversions only if a digit follows). For g and G conversions, trailing zeros are not removed from the result as they would otherwise be. For other conversions, the result is undefined. </p>
<p>It seems that '%#' flag is for a kind of type conversion for the printf statement. But I am not sure. Does anyone knows what kind of conversion of actual usage this %# flag has in the printf function in C? I can see any change or conversion for the character "A", which is the one I am using for the flag %# in the last print statement.</p>
<p>This is my code: </p>
<pre><code>#include <math.h>
int main(int argc, char *argv[])
{
int age = 32; // age and height not initialized
int height = 182;
printf("I am %d cm tall.\n", age);
printf("I am %d years old.\n", height);
printf("I wanna go to \"Panama\"\n"); // scaping double quotes
printf("I am %2$d tall and %1$d years old\n", age, height); // how to use positional arguments in printf statement
// how to use positional arguments in printf statement
printf("I am using the number pi: %'.2f\n", 3.1415939);
// Testing the %# formatting
printf("Testing for A: %# \n", 'A');
return 0;
}
</code></pre>
<p>The output I receive: </p>
<pre><code>I am 32 cm tall.
I am 182 years old.
I wanna go to "Panama"
I am 182 tall and 32 years old
I am using the number pi: 3.14
Testing for A: %#
</code></pre>
| <c><printf> | 2019-09-15 08:06:58 | LQ_CLOSE |
57,943,215 | i want to print helloworld recursively no times | i want to print helloworld recursively no times i want this code in this way.........................................................................................................................................................................
import java.util.*;
class ddr{
//int n;
static void hh(int n){
if(n<1) System.out.println("ffbdf");
hh(n-1);
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int no = in.nextInt();
ddr k = new ddr();
hh(no);
//hh(no);
}
| <java><algorithm> | 2019-09-15 10:24:22 | LQ_EDIT |
57,943,316 | how to build a model for computer vision without using pre trained models | <p>I am a total rookie in computer vision. I am looking to build a model without using pre-trained models for coco dataset or any open-source image datasets. Any articles or references to build such models would be appreciated. I would like to build this model from scratch and make no suggestions on pre-existing trained models or Api are irrelevant to this question. and thanks in advance for any suggestions. the programming language of preference for this project is python</p>
| <python><computer-vision><artificial-intelligence><conv-neural-network> | 2019-09-15 10:38:34 | LQ_CLOSE |
57,943,847 | Is JSF still relevant with Microprofile | <p>Still lost in the world of Microservices.
Is JSF still relevant with Microprofile and how can we migrate the UI part of a monolith application to Microservices when the same view should get data from many Microservices.</p>
| <jsf><microservices><jakarta-ee> | 2019-09-15 11:53:31 | LQ_CLOSE |
57,945,372 | When should i use `==` vs `===` vs `isequal` | <p>I see that julia has 3 different ways
to do equality.</p>
<p><code>==</code>, <code>===</code>, and <code>isequal</code></p>
<p>Which should I use, and when?</p>
| <julia> | 2019-09-15 15:07:37 | HQ |
57,945,998 | hopefully a simple Mysql/php query | I'm working with a mysql date column called 'class_of' that has dates ranging from 2014-08-01 to 2019-08-01, all formatted as a date. These dates coincide to what year an article was written.
I have set up my php execution page to grab the year through a url action.
for example - www.mywebsite.com/mypage.php?action=2016
\\\\
$classOf = ($_GET["action"]);
\\\\
I now need to somehow use said variable within a mysql query so my php while loop will only echo dates that have for example 2016 within the date.
This is what I have tried
This works, but I need the year to be a variable
\\\
$query = 'SELECT * FROM news_content WHERE hot = "false" AND trash="false" AND class_of = DATE("2020-08-01") ORDER BY article_id DESC';
\\\
I have tried the below, but with no success
\\\
$query = 'SELECT * FROM news_content WHERE hot = "false" AND trash="false" AND class_of = DATE("<?php echo $classOf ?>-08-01") ORDER BY article_id DESC';
\\\
And
\\\
$query = 'SELECT * FROM news_content WHERE hot = "false" AND trash="false" AND class_of = "<?php echo $classOf ?>" ORDER BY article_id DESC';
\\\
And
\\\
$query = 'SELECT * FROM news_content WHERE hot = "false" AND trash="false" AND class_of LIKE "%<?php echo $classOf ?>%" ORDER BY article_id DESC';
\\\
And
\\\
$query = 'SELECT * FROM news_content WHERE hot = "false" AND trash="false" AND class_of = "<?php date("echo $classOf-08-01")?>" ORDER BY article_id DESC';
\\\
All of the above no success.
Hopefully some has a few ideas or a work around so my while loop only picks up the dates in my variable.
Thanks | <php><mysql><mysqli> | 2019-09-15 16:21:29 | LQ_EDIT |
57,946,272 | Cannot insert or update a datetime column with 'yyyy-MM-dd hh:mm:ss' format | <p>I've been trying to wrap my head around what the actual problem is.
I'm thinking it might be collation, When I did </p>
<pre><code>SELECT @@character_set_database, @@collation_database;
</code></pre>
<p>I got this</p>
<pre><code>+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| latin1 | latin1_swedish_ci |
+--------------------------+----------------------+
</code></pre>
<p>the mysql workbench has utf8 - default collation as standard. </p>
<p>this is the table I want to update/insert into.</p>
<pre><code>+------------+----------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+-------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| from | datetime | YES | | NULL | |
| to | datetime | YES | | NULL | |
| breakhours | float | NO | | 0.5 | |
| created | datetime | NO | | CURRENT_TIMESTAMP | |
| assignment | int(11) | NO | MUL | NULL | |
+------------+----------+------+-----+-------------------+----------------+
</code></pre>
<p>this is what happens when I try to insert an entry manually with the mysql console, doesn't work with mysql workbench either.</p>
<pre><code>mysql> insert into TimeEntry(from, to, breakhours, assignment) values('2019-09-14 07:45', '2019-09-14 16:45', 0.5, 1);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, to, breakhours, assignment) values('2019-09-14 07:45', '2019-09-14 16:45',' at line 1
</code></pre>
<p>So I put an empty entry into the table</p>
<pre><code>+----+------+------+------------+---------------------+------------+
| id | from | to | breakhours | created | assignment |
+----+------+------+------------+---------------------+------------+
| 2 | NULL | NULL | 0.5 | 2019-09-15 18:51:24 | 1 |
+----+------+------+------------+---------------------+------------+
</code></pre>
<p>but I can't even update from or to here.</p>
<pre><code>mysql> update TimeEntry set from = '2019-09-14 07:45:00' where id = 2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from = '2019-09-14 07:45:00' where id = 2' at line 1
</code></pre>
<p>I've been using MySql for years, I've never encountered this problem before, what am I doing wrong?</p>
| <mysql> | 2019-09-15 16:55:21 | LQ_CLOSE |
57,946,691 | How do i generate a list of integers from 1 to 200 where it only prints the first 20 odd/even numbers? | <p>How do i generate a list of integers from 1 to 200 where it only prints the first 20 odd/even numbers?</p>
| <python-3.x><list> | 2019-09-15 17:46:11 | LQ_CLOSE |
57,946,855 | Classes in python, with def functions that can´t print correctly | > **it might be a question of details, as always, but still, any help would be appreciated**
```
# create a supervilan class
class supervilan:
size = ""
color = ""
powers = ""
weapons = ""
special_ability = ""
def customs(self):
print(self.name + " has a supercool and technologic advanced suit.")
def organic_gear(self, gear):
print(self.name + " use they´re" + gear + " with mastery and precision!")
```
>i reduced the amount of methods to facilitate
```
# methods
Dracula = supervilan()
Dracula.size = "2.12cm"
Dracula.color = "white"
Dracula.organic_gear("Astucy")
Chimical = supervilan()
Chimical.size = "2.30cm"
Chimical.color = "Caucasian"
Dracula.organic_gear()
Chimical.customs()
``` | <python> | 2019-09-15 18:06:44 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.