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 |
|---|---|---|---|---|---|
38,796,153 | efficient merging on substrings (long lists of short terms) | I have a list of terms that need to be categorized according to a dictionary table. The term list and the dictionary are both hundreds of thousands of lines long.
The terms will typically not match a keyword in the dictionary exactly; the keywords will typically be a **substring** of the terms.
*I* ***could*** *loop through the dictionary keywords and then grep for the presence of the current keyword in all list terms.*
**What approaches would be more efficient than that? My preferred language is R, followed by Python.**
For the terms and dictionary below, I would want a result like this:
bean soup legume
cheese omelette dairy
cheese omelette eggs
turkey sandwich meat
turkey sandwich sandwich
Input terms:
bean soup
cheese omelette
turkey sandwich
Dictionary columns: keyword, category
bean legume
beef meat
carrot vegetable
cheese dairy
ice cream dairy
milk dairy
omelette eggs
sandwich bread
turkey meat
I have seen many good SO posts about effienct substring searching, but they seem more focused on searchign for short needles in long haystacks. | <python><r><string><optimization> | 2016-08-05 19:01:20 | LQ_EDIT |
38,796,280 | Helpt to understand 'string' must be a non-nullable and generic method | I have few questions in the following method. Can an expert help me to understand the structure and why I am getting the error?
I have this method that will get a xml element, search the attribute specified in name parameter and case is can't find in the xml, it returns the default value:
protected static T GetValue<T>(XElement group, string name, T default) where T : struct
{
//Removed some code for better view
XAttribute setting = group.Attribute(name);
return setting == null ? default: (T)Enum.Parse(typeof(T), setting.Value);
}
My questions is about the generic types used in this method. When I try to use this method in a string variable, I get the following error:
string test = GetValue(element, "search", "default value");
The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'GetValue<T>(XElement, string, T)'
What T is this method it the issue that I am getting that error? What does where T : struct mean? I tried to use this as GetValue<String> and it did not work as well...
Any help are really welcome! Thanks! | <c#><generics><methods> | 2016-08-05 19:10:25 | LQ_EDIT |
38,796,376 | Cannot read property 'getHostNode' of null | <p>I have a horizon/react app with react router and I have a simple button in my app:</p>
<pre><code><Link className="dark button" to="/">Another Search</Link>
</code></pre>
<p>When I click on it, I get the following exception:</p>
<pre><code>Uncaught TypeError: Cannot read property 'getHostNode' of null
</code></pre>
<p>The error comes from:</p>
<pre><code>getHostNode: function (internalInstance) {
return internalInstance.getHostNode();
},
</code></pre>
<p>Any idea why am I getting this?</p>
| <javascript><reactjs><react-router> | 2016-08-05 19:17:09 | HQ |
38,796,451 | C++ basic inheritance | <p>While learning C++ Classes - Basic Inheritance - my program returned an error saying: "C++ forbids comparison between pointer and integer and C++ forbids comparison between pointer and integer". Where did I go wrong? Thanks for your help! :-) </p>
<pre><code>#include <iostream>
using namespace std;
class Pizza
{ public: int slices; char topping[10]; bool pepperoni , cheese ; };
int main() {
// Make your own Pizza!
Pizza pizza;
cout << "\n You can have Cheese or Pepperoni Pizza!";
cout << "\n Type [cheese] or [pepperoni] \n";
cin >> pizza.topping[10];
if (pizza.topping[10] == "pepperoni") { pizza.pepperoni = true;}
if (pizza.pepperoni == true) {cout << "How many slices of pepperoni would you like?";};
if ( pizza.topping[10] == "cheese") { pizza.cheese = true;}
if (pizza.cheese == true) {cout << "How many slices of cheese would you like?";};
cin >> pizza.slices;
if (pizza.slices >= 1) {cout << "You ordered " << pizza.slices << " slices of " << pizza.topping[10] << " Pizza!"; }
else if (pizza.slices <= 0) {cout << "Change your mind?"; }
else { cout <<"Can't Decide? That's Okay.";}
}
</code></pre>
| <c++><c++11><inheritance><conditional> | 2016-08-05 19:21:42 | LQ_CLOSE |
38,796,778 | :after going over my text with background | <p>I am doing a menu for a restaurant, they want to have an orange line on the last line of the menu that leads to the price. Everything is done only the orange line gets OVER by text that has a background.</p>
<p>Here's the link:</p>
<p><a href="http://abbababba.gosuuftw.com" rel="nofollow">http://abbababba.gosuuftw.com</a></p>
<p>Thank you!</p>
| <html><css> | 2016-08-05 19:45:59 | LQ_CLOSE |
38,797,509 | Passing array into URLSearchParams while consuming http call for get request | <p>Going through the Angular documentation for <a href="https://angular.io/docs/ts/latest/api/http/index/URLSearchParams-class.html">URLSearchParams</a>, I dint find any documentation on passing array as an parameter.</p>
<p>Can anybody help with that?</p>
| <angular><angular2-http> | 2016-08-05 20:43:39 | HQ |
38,797,879 | Why can't I parse "0-2-6-1" to ints after splitting by '-' | <p>Reading from an Excel Worksheet that was copy and pasted with a list of string speperated numbers, why will c# not convert a char/string 0 to a zero or a char/string 1 to an int 1 after splitting the string into an array by '-'? </p>
<p>It seems like there is a character problem, the difference between a 1 and a 1 with no line at the bottom?</p>
<p>Thanks</p>
| <c#> | 2016-08-05 21:17:49 | LQ_CLOSE |
38,798,683 | php gcm save registration token | <p>hello I'm working with gcm , service worker I'm getting registration id of each user and everything , now what I want is how to save the registration token and store it to my database using mysql and php. any help would be appreciated</p>
| <php><android><push-notification><google-cloud-messaging> | 2016-08-05 22:42:53 | LQ_CLOSE |
38,799,140 | split file extension from an array | <p>I am trying to remove the extension found in every file name in my array.</p>
<p>I have</p>
<pre><code>files = ['file.tsv', 'file2.tsv', 'file3.tsv']
</code></pre>
<p>and want the output to be</p>
<pre><code>files = ['file', 'file2', 'file3']
</code></pre>
<p>How do I perform this function on an array?</p>
| <python> | 2016-08-05 23:40:10 | LQ_CLOSE |
38,799,338 | What does 'ICU' stand for in Android SDK? | <p>Have seen new packages in Android SDK docs. All of them are available in API level 24 which corresponds to Android Nougat and seem to replace the '<em>java.xxx</em>' packages by '<em>android.icu.xxx</em>'. For example:</p>
<blockquote>
<p>The <em>java.text.DateFormat</em> package is duplicated in <em>android.icu.text.DateFormat</em> and so on</p>
</blockquote>
<p>Also, in some icu classes appears the following annotation: </p>
<blockquote>
<p>[icu enhancement] ICU's replacement for (class name). Methods, fields, and other functionality specific to ICU are labeled '[icu]'.</p>
</blockquote>
<p>So, what does ICU stand for? And what are differences between java and android.icu packages? Will java packages be deprecated soon?</p>
| <java><android><package><icu> | 2016-08-06 00:14:45 | HQ |
38,799,671 | HTTP Status 500 - Servlet execution threw an exception. I have tried add libraries but still I am getting an exception? | This is my output, I have tried add libraries but still I am getting an exception?
I have tried all previously asked questions in stack overflow. Could you please help me out.
[1]: http://i.stack.imgur.com/XCGFS.png | <java><servlets> | 2016-08-06 01:12:53 | LQ_EDIT |
38,800,217 | Trying to think about how to build a multi step form in angular 2 | <p>I am trying to build a small, 3 step form. It would be something similar to this:</p>
<p><a href="https://i.stack.imgur.com/BysIo.jpg"><img src="https://i.stack.imgur.com/BysIo.jpg" alt="enter image description here"></a></p>
<p>The way I did this in react was by using redux to track form completion and rendering the form body markup based on the step number (0, 1, 2). </p>
<p>In angular 2, what would be a good way to do this? Here's what I am attempting at the moment, and I'm still working on it. Is my approach fine? Is there a better way to do it? </p>
<p>I have a parent component <code><app-form></code> and I will be nesting inside it <code><app-form-header></code> and <code><app-form-body></code>.</p>
<pre><code><app-form>
<app-header [step]="step"></app-header>
<app-body [formData]="formData"></app-body>
</app-form>
</code></pre>
<p>In <code><app-form></code> component I have a <code>step: number</code> and <code>formData: Array<FormData></code>. The step is just a index for each object in formData. This will be passed down to the header. formData will be responsible the form data from user. Each time the form input is valid, user can click Next to execute nextStep() to increment the index. Each step has an associated template markup. </p>
<p>Is there a better way to do something like this? </p>
| <forms><angular> | 2016-08-06 03:16:56 | HQ |
38,801,186 | Please Help the Button is unclickable what should i do ? or is there any errors of my codes ? | [enter image description here][1]
[1]: http://i.stack.imgur.com/yPhoE.jpg
I just started using android Eclipse last week for school. the teacher give us a homework. "SIMPLE CALCULATOR" with "TWO JAVA CLASSES " one is the main activity and the other one is for displaying answer.
I dont get any errors from my codes but when i run the app the button is unclickable. I've been doing this for 3 hrs still not working. Thanks in advance Here are my codes
enter code herepublic class MainActivity extends Activity {
public static String SUM_DISPLAY ="com.example.calculatorrm.DISPLAY";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button listener = (Button)findViewById(R.id.add);
final Intent intent =new Intent (this,DisplayAnswerActivity.class);
listener.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
EditText e1 = (EditText)findViewById(R.id.fistvalue);
EditText e2 = (EditText)findViewById(R.id.secondvalue);
// For displaying answer
int firstvalue =Integer.parseInt(e1.getText().toString());
int secondvalue = Integer.parseInt(e2.getText().toString());
int sum = firstvalue + secondvalue;
String display = Integer.toString(sum);
intent.putExtra(SUM_DISPLAY,display);
}
});
} | <android> | 2016-08-06 06:18:09 | LQ_EDIT |
38,801,599 | xcode10 button to create mad lips story will not run, i am new to Xcode | i am just starting out with Xcode 10 and cannot get this button to work for my mad libs creation. this is just for fun but i would love to know how to fix it. please look over my code to see why the "create story" button is not active thank you so much
//
// ViewController.swift
// Field Button Fun
//
// Created by Audrey Chao on 8/3/16.
// Copyright © 2016 Maddie Chao. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var thePlace: UITextField!
@IBOutlet weak var theVerb: UITextField!
@IBOutlet weak var theNumber: UITextField!
@IBOutlet weak var theTemplate: UITextView!
@IBOutlet weak var theStory: UITextView!
@IBAction func createStory(sender: AnyObject) {
theStory.text = theTemplate.text
theStory.text = theStory.text.stringByReplacingOccurrencesOfString("<place>", withString: thePlace.text!)
theStory.text = theStory.text.stringByReplacingOccurrencesOfString("<verb>", withString: theVerb.text!)
theStory.text = theStory.text.stringByReplacingOccurrencesOfString("<number>", withString: theNumber.text!)
}
override func viewDidLoad() {
super.viewDidLoad()
//thePlace.resignFirstResponder()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
| <swift><button> | 2016-08-06 07:14:57 | LQ_EDIT |
38,802,157 | Can I require a module specifically for iOS in React Native? | <p>I am currently using <a href="https://github.com/naoufal/react-native-safari-view" rel="noreferrer"><code>react-native-safari-view</code></a> module in my React Native project for showing web views in iOS.</p>
<p>As the module is not yet implemented for Android, when I try to build the project for Android, it gives me an error at this line:</p>
<pre><code>import SafariView from 'react-native-safari-view'
</code></pre>
<p>I am going to use the <a href="https://facebook.github.io/react-native/docs/linking.html" rel="noreferrer"><code>Linking</code></a> library for Android, but I don't know how to use the same code for two platforms.</p>
<p>I tried:</p>
<pre><code>if (Platform.OS == 'ios') {
import SafariView from 'react-native-safari-view'
}
</code></pre>
<p>And it gives me this error:</p>
<blockquote>
<p>import' and 'export' may only appear at the top level</p>
</blockquote>
<p>How do I get around this?</p>
| <android><ios><react-native> | 2016-08-06 08:23:50 | HQ |
38,802,171 | Typescript error TS2339: Property 'webkitURL' does not exist on type 'Window' | <p>Using Angular 2 on a project which is compiled with typescript.</p>
<p>Getting this error when trying to create a blob image:</p>
<p><code>error TS2339: Property 'webkitURL' does not exist on type 'Window'</code></p>
<p>ts code is:</p>
<p><code>public url = window.URL || window.webkitURL;
this.photo = this.url.createObjectURL( res );
</code></p>
| <javascript><google-chrome><typescript><angular><webkit> | 2016-08-06 08:25:19 | HQ |
38,802,437 | Upgrading Spring Boot from 1.3.7 to 1.4.0 causing NullPointerException in AuthenticatorBase.getJaspicProvider | <p>This is somewhat caused by the tomcat-embed-core version 8.5.4 that comes with the spring-boot-starter-jersey. It generates an error shown below on all integration tests. It will only work if I override the pom to use tomcat-embed-core version 8.0.36. What's weird is, that's the only error message I get.</p>
<pre><code>java.lang.NullPointerException: null
at org.apache.catalina.authenticator.AuthenticatorBase.getJaspicProvider(AuthenticatorBase.java:1140)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:431)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
</code></pre>
<p>Here's my dependecy tree:</p>
<pre><code>[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ sample-services ---
[INFO] com.sample:sample-services:jar:1.0.0-SNAPSHOT
[INFO] +- com.sample:sample-customer:jar:1.0.0-SNAPSHOT:compile
[INFO] | +- com.sample:sample-core:jar:1.0.0-SNAPSHOT:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.0.RELEASE:compile
[INFO] | | | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.0.RELEASE:compile
[INFO] | | | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.4:compile
[INFO] | | | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.4:compile
[INFO] | | | | \- org.springframework:spring-jdbc:jar:4.3.2.RELEASE:compile
[INFO] | | | +- org.hibernate:hibernate-core:jar:5.0.9.Final:compile
[INFO] | | | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | | | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | | | +- org.hibernate:hibernate-entitymanager:jar:5.0.9.Final:compile
[INFO] | | | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | | | +- org.springframework.data:spring-data-jpa:jar:1.10.2.RELEASE:compile
[INFO] | | | | \- org.springframework:spring-orm:jar:4.3.2.RELEASE:compile
[INFO] | | | \- org.springframework:spring-aspects:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | +- com.h2database:h2:jar:1.4.192:compile
[INFO] | | +- org.postgresql:postgresql:jar:9.4.1209.jre7:compile
[INFO] | | +- javax:javaee-api:jar:7.0:compile
[INFO] | | | \- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile
[INFO] | | +- org.joda:joda-money:jar:0.10.0:compile
[INFO] | | \- com.sun.jna:jna:jar:3.0.9:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:1.4.0.RELEASE:compile
[INFO] | | \- org.springframework.data:spring-data-elasticsearch:jar:2.0.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.12.2.RELEASE:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | \- org.elasticsearch:elasticsearch:jar:2.3.4:compile
[INFO] | | +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[INFO] | | | +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[INFO] | | | \- com.spatial4j:spatial4j:jar:0.5:compile
[INFO] | | +- org.elasticsearch:securesm:jar:1.0:compile
[INFO] | | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | | +- org.joda:joda-convert:jar:1.2:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.1:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.1:compile
[INFO] | | +- io.netty:netty:jar:3.10.5.Final:compile
[INFO] | | +- com.ning:compress-lzf:jar:1.0.2:compile
[INFO] | | +- com.tdunning:t-digest:jar:3.0:compile
[INFO] | | +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.3.1:compile
[INFO] | | \- com.twitter:jsr166e:jar:1.1.0:compile
[INFO] | +- com.google.guava:guava:jar:19.0:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | +- commons-io:commons-io:jar:2.5:compile
[INFO] | +- net.sf.uadetector:uadetector-core:jar:0.9.22:compile
[INFO] | | +- net.sf.qualitycheck:quality-check:jar:1.3:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:2.0.3:compile
[INFO] | | \- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] | +- net.sf.uadetector:uadetector-resources:jar:2014.10:compile
[INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.1:compile
[INFO] +- com.sample:sample-messaging:jar:1.0.0-SNAPSHOT:compile
[INFO] | +- com.amazonaws:aws-java-sdk-sns:jar:1.11.24:compile
[INFO] | \- com.amazonaws:aws-java-sdk-sqs:jar:1.11.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.3.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:4.3.2.RELEASE:compile
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.23.1:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b34:compile
[INFO] | | \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b34:compile
[INFO] | | \- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-spring3:jar:2.23.1:compile
[INFO] | | +- org.glassfish.hk2:hk2:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:config-types:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-core:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-config:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-runlevel:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2:class-model:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.4.0-b34:compile
[INFO] | | \- org.glassfish.hk2:spring-bridge:jar:2.4.0-b34:compile
[INFO] | \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.23.1:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.1:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.2.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.2.RELEASE:compile
[INFO] +- com.amazonaws:aws-java-sdk-s3:jar:1.11.24:compile
[INFO] | +- com.amazonaws:aws-java-sdk-kms:jar:1.11.24:compile
[INFO] | \- com.amazonaws:aws-java-sdk-core:jar:1.11.24:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.1:compile
[INFO] | \- joda-time:joda-time:jar:2.9.4:compile
[INFO] +- com.wordnik:swagger-jersey2-jaxrs_2.10:jar:1.3.13:compile
[INFO] | +- com.wordnik:swagger-jaxrs_2.10:jar:1.3.13:compile
[INFO] | | +- com.wordnik:swagger-core_2.10:jar:1.3.13:compile
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.4.1:compile
[INFO] | | | | \- com.thoughtworks.paranamer:paranamer:jar:2.6:compile
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.4.1:compile
[INFO] | | | +- com.wordnik:swagger-annotations:jar:1.3.13:compile
[INFO] | | | +- org.json4s:json4s-ext_2.10:jar:3.2.11:compile
[INFO] | | | +- org.json4s:json4s-native_2.10:jar:3.2.11:compile
[INFO] | | | | \- org.json4s:json4s-core_2.10:jar:3.2.11:compile
[INFO] | | | | +- org.json4s:json4s-ast_2.10:jar:3.2.11:compile
[INFO] | | | | \- org.scala-lang:scalap:jar:2.10.0:compile
[INFO] | | | | \- org.scala-lang:scala-compiler:jar:2.10.0:compile
[INFO] | | | \- org.json4s:json4s-jackson_2.10:jar:3.2.11:compile
[INFO] | | \- org.reflections:reflections:jar:0.9.9:compile
[INFO] | | \- com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] | \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.1:compile
[INFO] | \- org.jvnet.mimepull:mimepull:jar:1.8:compile
[INFO] +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.23.1:compile
[INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b34:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.23.1:compile
[INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | +- javax.el:javax.el-api:jar:2.2.4:compile
[INFO] | +- org.glassfish.web:javax.el:jar:2.2.4:compile
[INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- com.jayway.restassured:rest-assured:jar:2.9.0:test
[INFO] | +- org.codehaus.groovy:groovy:jar:2.4.7:test
[INFO] | +- org.codehaus.groovy:groovy-xml:jar:2.4.7:test
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.2:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
[INFO] | +- com.jayway.restassured:json-path:jar:2.9.0:test
[INFO] | | +- org.codehaus.groovy:groovy-json:jar:2.4.7:test
[INFO] | | \- com.jayway.restassured:rest-assured-common:jar:2.9.0:test
[INFO] | \- com.jayway.restassured:xml-path:jar:2.9.0:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:compile
[INFO] | +- net.minidev:json-smart:jar:2.2.1:compile
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:compile
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | +- org.springframework:spring-core:jar:4.3.2.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.2.RELEASE:test
[INFO] +- org.assertj:assertj-core:jar:3.2.0:compile
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile
[INFO] | \- org.json:json:jar:20140107:compile
[INFO] +- org.neo4j:neo4j-cypher-compiler-2.2:jar:2.2.5:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.10.5:compile
[INFO] | +- org.scala-lang:scala-reflect:jar:2.10.5:compile
[INFO] | +- org.parboiled:parboiled-scala_2.10:jar:1.1.7:compile
[INFO] | | \- org.parboiled:parboiled-core:jar:1.1.7:compile
[INFO] | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4:compile
[INFO] \- org.springframework.boot:spring-boot-devtools:jar:1.4.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile
</code></pre>
<p>And here's my Application class:</p>
<pre><code>@EntityScan(basePackageClasses = { Application.class, Jsr310JpaConverters.class })
@EnableScheduling
@EnableAsync
@SpringBootApplication(scanBasePackages = "com.sample")
public class Application extends Loggable implements AsyncConfigurer {
/**
* This forces the SNS topics to be created and/or linked.
*/
@Autowired
@SuppressWarnings("all")
private TopicFactory topicFactory;
/**
* It all begins here.
*/
public static void main(String[] args) throws Exception {
SpringApplication application = new SpringApplication(Application.class);
application.setBanner(new SampleBanner());
application.run(args);
}
/**
* Returns the @Async executor.
*/
@Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(4);
executor.setMaxPoolSize(4);
executor.setQueueCapacity(0);
executor.setThreadNamePrefix("Async-");
executor.initialize();
return executor;
}
/**
* Returns the uncaught exception handler for @Async operations.
*/
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return (e, method, params) -> log.error("Uncaught async error", e);
}
}
</code></pre>
<p>If someone could point me out where to start or what's causing it to fail, it would be of great help.</p>
| <spring><spring-boot><tomcat8> | 2016-08-06 08:58:29 | HQ |
38,802,675 | Create bool mask from filter results in Pandas | <p>I know how to create a mask to filter a dataframe when querying a single column:</p>
<pre><code>import pandas as pd
import datetime
index = pd.date_range('2013-1-1',periods=100,freq='30Min')
data = pd.DataFrame(data=list(range(100)), columns=['value'], index=index)
data['value2'] = 'A'
data['value2'].loc[0:10] = 'B'
data
value value2
2013-01-01 00:00:00 0 B
2013-01-01 00:30:00 1 B
2013-01-01 01:00:00 2 B
2013-01-01 01:30:00 3 B
2013-01-01 02:00:00 4 B
2013-01-01 02:30:00 5 B
2013-01-01 03:00:00 6 B
</code></pre>
<p>I use a simple mask here:</p>
<pre><code>mask = data['value'] > 4
data[mask]
value value2
2013-01-01 02:30:00 5 B
2013-01-01 03:00:00 6 B
2013-01-01 03:30:00 7 B
2013-01-01 04:00:00 8 B
2013-01-01 04:30:00 9 B
2013-01-01 05:00:00 10 A
</code></pre>
<p>My question is how to create a mask with multiple columns? So if I do this:</p>
<pre><code>data[data['value2'] == 'A' ][data['value'] > 4]
</code></pre>
<p>This filters as I would expect but how do I create a bool mask from this as per my other example? I have provided the test data for this but I often want to create a mask on other types of data so Im looking for any pointers please. </p>
| <python><pandas> | 2016-08-06 09:27:14 | HQ |
38,802,798 | Parent bottom views hide with parent center layout view on opening keyboard | <p>I am working on layout where I have aligned one <code>cardview</code> on the center of the screen and contact us <code>button</code> on bottom of the screen. This layout looks OK when keyboard is closed.</p>
<p>It looks like below :-<a href="https://i.stack.imgur.com/lzc61.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lzc61.png" alt="enter image description here"></a></p>
<p>layout.xml</p>
<pre><code><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<ImageView
android:id="@+id/login_image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/login_background" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/grey_background" />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/media_card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
card_view:cardBackgroundColor="@color/white"
card_view:cardElevation="4dp"
card_view:cardCornerRadius="5dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/logoImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/grey_background"
android:padding="15dp"
android:src="@drawable/logo_login"
/>
<EditText
android:id="@+id/usertext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@id/logoImageView"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/edittext_background"
android:hint="User ID"
android:maxLength="50"
android:padding="10dp"
android:singleLine="true"
android:textColorHint="@color/hint_text_color"
android:textSize="16sp" />
<FrameLayout
android:id="@+id/passwordLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/usertext"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<EditText
android:id="@+id/passtext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/edittext_background"
android:fontFamily="sans-serif"
android:hint="@string/password"
android:inputType="textPassword"
android:maxLength="50"
android:padding="10dp"
android:singleLine="true"
android:textColorHint="@color/hint_text_color"
android:textSize="16sp" />
<ImageView
android:id="@+id/passwordeye"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:padding="8dp"
android:layout_marginRight="25dp"
android:src="@drawable/eye_close" />
</FrameLayout>
<LinearLayout
android:id="@+id/termsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/passwordLayout"
android:layout_marginLeft="15dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/check_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@drawable/checkbox_checked" />
<TextView
android:id="@+id/terms_and_cond"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textColor="@color/black"
android:textColorLink="#80000000"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="@+id/lineView"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/termsLayout"
android:layout_marginTop="15dp"
android:background="@color/grey_background" />
<LinearLayout
android:id="@+id/newuser_login_layout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/dark_grey"
android:layout_below="@id/lineView"
android:orientation="horizontal">
<TextView
android:id="@+id/newUserButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/translucent_round_button"
android:gravity="center"
android:text="New User ?"
android:textColor="@color/grey_text_color"
android:textSize="17sp" />
<TextView
android:id="@+id/loginbutton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bottom_round_button"
android:gravity="center"
android:text="Login"
android:textColor="@color/white"
android:textSize="17sp" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/contactus_button"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:background="@drawable/contact_us_selector"
android:drawableLeft="@drawable/contact_us_green"
android:drawablePadding="5dp"
android:gravity="center"
android:padding="8dp"
android:text="Contact Us"
android:textColor="@color/black" />
<TextView
android:id="@+id/textviewone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:gravity="center"
android:textColor="@color/black"
android:textColorLink="#80000000"
android:textSize="13sp" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/snackbarCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</android.support.design.widget.CoordinatorLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/android:progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
</FrameLayout>
</code></pre>
<h1>Question :-</h1>
<p>When keyboard opens then contact us <code>button</code> and text which is at the bottom of above screen hide behind the center layout. I want it should not be hide, on opening keyboard screen should be scroll and contact us <code>button</code> should be at the bottom.</p>
<p>On opening keyboard it looks like :-</p>
<p><a href="https://i.stack.imgur.com/q1QVJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q1QVJ.png" alt="enter image description here"></a></p>
| <android> | 2016-08-06 09:38:53 | HQ |
38,802,840 | split value and add in to spinner | <p>want to add pipeline seprated value in to spinner.
I have String defined below.</p>
<blockquote>
<p>String value =
12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35;</p>
</blockquote>
<p>how to split this value and add it in to spinner.</p>
| <android><spinner> | 2016-08-06 09:43:36 | LQ_CLOSE |
38,802,938 | get contact number from device and display into listview in android | Hey @STACKERS i want to display contact number in listview. And it is working perfect. But i want to put condition when it read contact from device. The Condition are
1) if number digit <10 { --don't add into list-}.
2)else if(number is starting from 0 then repalce with 91){--Add to list}.
3)else if{number is start from + then remove it }{--add to list}.
4)else{other are directly add to list}.
public class ReferFriend extends AppCompatActivity {
ArrayList<SelectUser> selectUsers;
List<SelectUser> temp;
ListView listView;
Cursor phones, email;
ContentResolver resolver;
SearchView search;
SelectUserAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.refer_friend);
selectUsers = new ArrayList<SelectUser>();
resolver = this.getContentResolver();
listView = (ListView) findViewById(R.id.contacts_list);
phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC");
LoadContact loadContact = new LoadContact();
loadContact.execute();
}
// Load data on background
class LoadContact extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... voids) {
// Get Contact list from Phone
if (phones != null) {
Log.e("count", "" + phones.getCount());
if (phones.getCount() == 0) {
Toast.makeText(ReferFriend.this, "No contacts in your contact list.", Toast.LENGTH_LONG).show();
}
while (phones.moveToNext()) {
Bitmap bit_thumb = null;
String id = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.CONTACT_ID));
String name = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
String image_thumb = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHOTO_THUMBNAIL_URI));
try {
if (image_thumb != null) {
bit_thumb = MediaStore.Images.Media.getBitmap(resolver, Uri.parse(image_thumb));
} else {
Log.e("No Image Thumb", "--------------");
}
} catch (IOException e) {
e.printStackTrace();
}
SelectUser selectUser = new SelectUser();
selectUser.setThumb(bit_thumb);
selectUser.setContactName(name);
selectUser.setPhone(phoneNumber);
selectUser.setContactEmail(id);
selectUser.setCheckedBox(false);
selectUsers.add(selectUser);
}
} else {
Log.e("Cursor close 1", "----------------");
}
//phones.close();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
adapter = new SelectUserAdapter(selectUsers, ReferFriend.this);
listView.setAdapter(adapter);
// Select item on listclick
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Log.e("search", "here---------------- listener");
SelectUser data = selectUsers.get(i);
}
});
listView.setFastScrollEnabled(true);
}
}
@Override
protected void onStop() {
super.onStop();
phones.close();
}
public class SelectUserAdapter extends BaseAdapter {
public List<SelectUser> _data;
private ArrayList<SelectUser> arraylist;
Context _c;
ViewHolder v;
RoundImage roundedImage;
public SelectUserAdapter(List<SelectUser> selectUsers, Context context) {
_data = selectUsers;
_c = context;
this.arraylist = new ArrayList<SelectUser>();
this.arraylist.addAll(_data);
}
@Override
public int getCount() {
return _data.size();
}
@Override
public Object getItem(int i) {
return _data.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public View getView(int i, View convertView, ViewGroup viewGroup) {
View view = convertView;
if (view == null) {
LayoutInflater li = (LayoutInflater) _c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = li.inflate(R.layout.contact_info, null);
Log.e("Inside", "here--------------------------- In view1");
} else {
view = convertView;
Log.e("Inside", "here--------------------------- In view2");
}
v = new ViewHolder();
v.title = (TextView) view.findViewById(R.id.name);
v.check = (CheckBox) view.findViewById(R.id.check);
v.phone = (TextView) view.findViewById(R.id.no);
v.imageView = (ImageView) view.findViewById(R.id.pic);
final SelectUser data = (SelectUser) _data.get(i);
v.title.setText(data.getContactName());
v.check.setChecked(data.getCheckedBox());
//v.phone.setText(data.getPhone());
//I want to apply that condition here
/*if (data.getPhone().length() <= 10) {
v.phone.setText("Contact not Added to list");
} else if(data.getPhone().length() == 10){
v.phone.setText(data.getPhone());
} else if(data.getPhone().equalsIgnoreCase("+")){
v.phone.setText(data.getPhone());
}else if(data.getPhone().startsWith("0")){
v.phone.setText(data.getPhone().replace(0,91));
}*/
view.setTag(data);
return view;
}
// Filter Class
public void filter(String charText) {
charText = charText.toLowerCase(Locale.getDefault());
_data.clear();
if (charText.length() == 0) {
_data.addAll(arraylist);
} else {
for (SelectUser wp : arraylist) {
if (wp.getContactName().toLowerCase(Locale.getDefault())
.contains(charText)) {
_data.add(wp);
}
}
}
notifyDataSetChanged();
}
class ViewHolder {
ImageView imageView;
TextView title, phone;
CheckBox check;
}
}
}
plz help me to solve this issue.. | <android><listview><android-contacts> | 2016-08-06 09:55:46 | LQ_EDIT |
38,803,157 | Xamarin.Forms - Button Pressed & Released Event | <p>I want to my event to trigger when button <strong>pressed and released</strong>, but I can only find <strong>Click</strong> event in Xamarin.Forms.</p>
<p>I believe there must be some work around to get this functionality. My basic need is to <em>start a process when button is pressed and stop when released</em>. It seems to be a very basic feature but Xamarin.Forms doesn't have it right now.</p>
<p>I tried TapGestureRecognizer on button, but button is firing only click event.</p>
<pre><code>MyButton.Clicked += (sender, args) =>
{
Log.V(TAG, "CLICKED");
};
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) => {
Log.V(TAG, "TAPPED");
};
MyButton.GestureRecognizers.Add(tapGestureRecognizer);
</code></pre>
<p>Keep in mind that I need those events to be working in Android and iOS togather.</p>
| <c#><events><cross-platform><xamarin.forms> | 2016-08-06 10:18:49 | HQ |
38,803,203 | Many CDNjs vs one minified local js |
<pre><code><script src="//cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.3.1/jquery.inputmask.bundle.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/numeral.js/1.5.3/numeral.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.0/spin.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.0/ladda.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-modal/2.2.6/js/bootstrap-modalmanager.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-modal/2.2.6/js/bootstrap-modal.min.js"></script>
</code></pre>
<p>vs</p>
<pre><code><script src="/myMin.js">
</code></pre>
<p>(myMin.js will contain all js file concatenated together and minified)
What is the best for performance? I am using cdnjs because it solves the problem of people in other region downloading the js file directly from my server. For example, people in Asia don't have to download my js file from USA server, which is a huge performance issue. <code>cdnjs</code> helps me with scattering js file all over the globe. Since cdnjs is downloaded asynchronously so when will <code>myMin.js</code> be preferred?</p>
| <javascript><cdn> | 2016-08-06 10:24:56 | HQ |
38,803,486 | How to develop Shopify themes locally? | <p>I'm going to work on a Shopify theme, and I want to figure out how to run/edit it locally. I'd like to be able to the following, if possible:</p>
<ol>
<li>Pull all the Shopify theme code from the site to my local computer (ideally a single command line tool)</li>
<li>Make edits locally, and run them locally or in a staging environment</li>
<li>Push all the edits to the main Shopify site, again using a command line tool</li>
</ol>
<p>Is this at all possible?</p>
| <shopify> | 2016-08-06 10:56:48 | HQ |
38,804,306 | How do I do strikethrough (line-through) in asciidoc? | <p>How do I render a strikethrough (or line-through) in an <code>adoc</code> file?</p>
<p>Let's presume I want to write "That technology is -c-r-a-p- not perfect."</p>
| <asciidoc><asciidoctor> | 2016-08-06 12:28:40 | HQ |
38,804,646 | BottomSheetDialog remains hidden after dismiss by dragging down | <p>I am pretty curious about the behavior of the <code>BottomSheetDialog</code> when it is dismissed : when the user draggs it down to hide it, it will remain hidden, even if <code>bottomSheetDialog#show()</code> is called after. This only happens when it is dragged down, not when the user touches outside or when <code>bottomSheetDialog#dismiss()</code> is called programatically. </p>
<p>It is really annoying because I have a pretty big <code>bottomSheetDialog</code> with a recyclerview inside, and I have to create a new one every time I want to show the <code>bottomSheetDialog</code>.</p>
<p>So instead of just doing this : </p>
<pre><code>if(bottomSheetDialog != null){
bottomSheetDialog.show();
else{
createNewBottomSheetDialog();
}
</code></pre>
<p>I have to create one every time. </p>
<p>Am I missing something or is it the normal behavior ? (Btw I use <code>appcompat-v7:23.2.1</code>)</p>
| <android><android-support-library><bottom-sheet> | 2016-08-06 13:11:19 | HQ |
38,805,208 | Fast Speed Distributed File System For Small File | Our Company Has five million users,we storage user's code file, we used the **MooseFS** but when we read the files in the program, in particular the slow loading speed.
So,we need to replace the file system , I hope someone can give me some advice , we have a huge number of **small files** , which distributed file system should be used . | <filesystems><distributed-filesystem> | 2016-08-06 14:15:23 | LQ_EDIT |
38,805,375 | Keras: batch training for multiple large datasets | <p>this question regards the common problem of training on multiple large files in Keras which are jointly too large to fit on GPU memory.
I am using Keras 1.0.5 and I would like a solution that does not require 1.0.6.
One way to do this was described by fchollet
<a href="https://github.com/fchollet/keras/issues/107" rel="noreferrer">here</a> and
<a href="https://github.com/fchollet/keras/issues/68" rel="noreferrer">here</a>:</p>
<pre><code># Create generator that yields (current features X, current labels y)
def BatchGenerator(files):
for file in files:
current_data = pickle.load(open("file", "rb"))
X_train = current_data[:,:-1]
y_train = current_data[:,-1]
yield (X_train, y_train)
# train model on each dataset
for epoch in range(n_epochs):
for (X_train, y_train) in BatchGenerator(files):
model.fit(X_train, y_train, batch_size = 32, nb_epoch = 1)
</code></pre>
<p>However I fear that the state of the model is not saved, rather that the model is reinitialized not only between epochs but also between datasets. Each "Epoch 1/1" represents training on a different dataset below:</p>
<p>~~~~~ Epoch 0 ~~~~~~</p>
<p>Epoch 1/1
295806/295806 [==============================] - 13s - loss: 15.7517<br>
Epoch 1/1
407890/407890 [==============================] - 19s - loss: 15.8036<br>
Epoch 1/1
383188/383188 [==============================] - 19s - loss: 15.8130<br>
~~~~~ Epoch 1 ~~~~~~</p>
<p>Epoch 1/1
295806/295806 [==============================] - 14s - loss: 15.7517<br>
Epoch 1/1
407890/407890 [==============================] - 20s - loss: 15.8036<br>
Epoch 1/1
383188/383188 [==============================] - 15s - loss: 15.8130</p>
<p>I am aware that one can use model.fit_generator but as the method above was repeatedly suggested as a way of batch training I would like to know what I am doing wrong.</p>
<p>Thanks for your help,</p>
<p>Max</p>
| <deep-learning><keras> | 2016-08-06 14:34:07 | HQ |
38,805,548 | How to add 10 number in listbox with a little code? | I code this it's fine but can I code a little ?
If D = 10 Then
ListBox3.Items.Add(1)
ListBox3.Items.Add(2)
ListBox3.Items.Add(3)
ListBox3.Items.Add(4)
ListBox3.Items.Add(5)
ListBox3.Items.Add(6)
ListBox3.Items.Add(7)
ListBox3.Items.Add(8)
ListBox3.Items.Add(9)
ListBox3.Items.Add(10)
End If
if you don't understand my question you can read the example
we can code
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
but we can code a little like this
Dim A, B, C, D As Integer | <vb.net><winforms> | 2016-08-06 14:51:30 | LQ_EDIT |
38,805,835 | how to input a huge number in C string? | I want store a positive integer up to 10^500000 in a string,
but i don't know what should i write of the size of string.
`char in[?????];`
just like that.
I tried to write something like that
char in[sizeof(long double)];
but it wasn't work.
| <c><string> | 2016-08-06 15:25:29 | LQ_EDIT |
38,806,490 | What does gs protocol mean? | <p>I'm playing with <a href="https://cloud.google.com/speech/" rel="noreferrer">Google Speech Recognition API</a></p>
<p>After a successfully <a href="https://cloud.google.com/speech/docs/getting-started" rel="noreferrer">Getting started</a> I'm trying to understand and made some changes in this first example but I don't know what "gs" protocol is and how to set it to use my own audio file.</p>
<p>sync-request.json</p>
<pre><code>{
"config": {
"encoding":"FLAC",
"sample_rate": 16000
},
"audio": {
"uri":"gs://cloud-samples-tests/speech/brooklyn.flac"
}
}
</code></pre>
<p>I tried to change gs protocol to http protocol but doesn't work. </p>
<p>Thanks in advance.</p>
| <json><uri><speech-recognition><google-cloud-platform> | 2016-08-06 16:39:21 | HQ |
38,806,786 | i am trying to print a txt file and it doesnt work in @c homework q | i were writing a code that suppose to work on a txt file.
i am writing in java and pyrhon and this my first time using c
so it is a noob q,
i work as i saw in toutorial and in the website
and for some reason my script doent even print my file.
can u tell me what am i doing wrong?
the code will do something far more complex but i still trying to work on my basics
==============
## *my code so far* ##
==============
`int main(int argc, char *argv[]){
/* argv[0] = name of my running file
* argv[1] = the first file that i receive
*/
define MAXBUFLEN 4096
char source[MAXBUFLEN + 1];
int badReturnValue = -1;
char* error = "Error! trying to open the file ";
if(argc != 2)
{
printf("please supply a file \n");
return badReturnValue;
}
char* fileName = argv[1];
if (fopen(argv[1], "r") != NULL)
{
} else{
printf("%s %s", error, fileName);//todo check weather this shit even work
return badReturnValue;
}
FILE *fp = fopen(argv[1], "r"); /* "r" = open for reading */
if (fp != NULL) {
size_t newLen = fread(&source, sizeof(char), MAXBUFLEN, fp);
if ( ferror( fp ) != 0 ) {
printf("%s %s", error, fileName);//todo check weather this shit even work
return badReturnValue;
}
int symbol;
while((symbol = getc(fp)) != EOF){
printf("%c",symbol);
}
printf("finish");
` | <c><file> | 2016-08-06 17:08:26 | LQ_EDIT |
38,806,915 | how to find consecutive rows, that an employee is 'Absent'? I need it Urgent? | I have a table name employee. which has 4 columns: id, name, statuse and date_present. the date_present column contains all the dates an employee is present and absent. i need to write a query to find if any employee is continuously absent for more than 3 days.
id | name | statuse | date_presnet
1 | khan | present | 2016-12-1
2 | jan | present | 2016-12-2
3 | Kiran| absent | 2016-12-3
4 | jan | absent | 2016-12-4
4 | jan | absent | 2016-12-5
4 | jan | absent | 2016-12-6 | <mysql><sql> | 2016-08-06 17:25:26 | LQ_EDIT |
38,807,415 | Mapstruct - How can I inject a spring dependency in the Generated Mapper class | <p>I need to inject a spring service class in the generated mapper implementation, so that I can use it via </p>
<pre><code> @Mapping(target="x", expression="java(myservice.findById(id))")"
</code></pre>
<p>Is this applicable in Mapstruct-1.0?</p>
| <spring><mapstruct> | 2016-08-06 18:18:17 | HQ |
38,807,773 | Enter age javascript error | <p>Can anyone tell me what's wrong with this specific code and how can I fix it? Thanks in advance. </p>
<pre><code><script language=javascript type="text/javascript">
toDays(21);
function toDays(years)
{
var time;
time = 365*years;
return time;
}
document.write("My age is " + time);
</script>
</code></pre>
| <javascript> | 2016-08-06 18:59:33 | LQ_CLOSE |
38,807,883 | How to pass an object with template function? | <p>Doing my homework, got stuck on the template function part. I have the following <code>main()</code> in my <code>.cpp</code> file:</p>
<pre><code>int main()
{
Pair<char> letters('a', 'd');
cout << "\nThe first letter is: " << letters.getFirst();
cout << "\nThe second letter is: " << letters.getSecond();
cout << endl;
system("pause");
return 0;
}
</code></pre>
<p>I need to use <code>template</code> to make the <code>class</code> exchageable, and here is what I have in the <code>.h</code> file: </p>
<pre><code>template <class T>
class Pair
{
private:
T letters;
public:
T getFirst();
T getSecond();
};
</code></pre>
<p>now, in my VS, it says both <code>getFrist()</code> and <code>getSecond()</code> are not found. How am I supposed to pass T as a <code>class</code> in <code>template</code>?</p>
| <c++> | 2016-08-06 19:15:08 | LQ_CLOSE |
38,808,875 | Moving Files In Google Drive Using Google Script | <p>I'm trying to create documents using information posted through Google forms, then once the document is created I would like to move the document into a shared folder for people to view.</p>
<p>At the moment I have the script taking all of the information from the Google Forms linked spreadsheet. </p>
<p>Using that information I'm using the following code to create the document:</p>
<pre><code> var targetFolder = DriveApp.getFolderById(TARGET_FOLDER_ID);
var newDoc = DocumentApp.create(requestID + " - " + requestSummary);
</code></pre>
<p>This is creating the document successfully in my Google Drive root folder, but I can't seem to move it where I want to move it to. </p>
<p>I've seen a lot of posts suggesting use stuff like targetFolder.addFile(newDoc) but that doesn't work, similarly I've seen examples like newDoc.addToFolder(targetFolder) but again this isn't working for me.</p>
<p>It seems that all the online questions people have already asked about this are using the previous API versions that are no longer applicable and these methods do not apply to the new DriveApp functionality. </p>
<p>What I would like, if possible, is to create the new document as above so that I can edit the contents using the script, then be able to move that file to a shared folder. (From what I understand there is no 'move' function at present, so making a copy and deleting the old one will suffice).</p>
| <google-apps-script><google-sheets><google-drive-api> | 2016-08-06 21:29:39 | HQ |
38,808,980 | Destructure an object parameter two levels? | <p>So, I'm passing an object to an ES6 function that I'd like to <strong>destructure</strong> down to the parameter of a parameter. For example, the code below will log the <code>data</code> prop of <code>stuff</code>, but I'd like it to log the <code>things</code> prop of <code>data</code> of <code>stuff</code>. So the correct answer would log <code>[1,2,3,4]</code>. Not confusing at all, I know. Anyone know if this is possible?</p>
<pre><code>const stuff = {
data: {
things: [1,2,3,4]
}
};
const getThings = ({ data }) => {
console.log(data)
};
getThings(stuff);
</code></pre>
| <javascript><ecmascript-6> | 2016-08-06 21:44:41 | HQ |
38,809,061 | Remove some x labels with Seaborn | <p>In the screenshot below, all my x-labels are overlapping each other.</p>
<pre><code>g = sns.factorplot(x='Age', y='PassengerId', hue='Survived', col='Sex', kind='strip', data=train);
</code></pre>
<p>I know that I can remove all the labels by calling <code>g.set(xticks=[])</code>, but is there a way to just show some of the Age labels, like 0, 20, 40, 60, 80?</p>
<p><a href="https://i.stack.imgur.com/UUdH4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UUdH4.png" alt="enter image description here"></a></p>
| <python><seaborn> | 2016-08-06 21:56:00 | HQ |
38,809,067 | AWS API Gateway ARN | <p>One of the things that drives me nuts is that AWS has loads of docs about the format of an ARN, but doesn't have any kind of generator to make you confident that the ARN is correct.</p>
<p>In IAM, I'm trying to set up a policy to allow access to an API Gateway and I've read the following docs about it:</p>
<ul>
<li><a href="http://docs.aws.amazon.com/apigateway/latest/developerguide/permissions.html#api-gateway-control-access-using-iam-policies" rel="noreferrer">http://docs.aws.amazon.com/apigateway/latest/developerguide/permissions.html#api-gateway-control-access-using-iam-policies</a></li>
<li><a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-apigateway" rel="noreferrer">http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-apigateway</a></li>
<li><a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.policies.arn.html" rel="noreferrer">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.policies.arn.html</a></li>
</ul>
<p>But I can't get any ARN to validate, even just a wide open API Gateway ARN. See screenshot:</p>
<p><a href="https://i.stack.imgur.com/sO02S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sO02S.png" alt="open arn called invalid"></a></p>
<p>What am I doing wrong here?</p>
| <amazon-web-services><amazon-iam><aws-api-gateway> | 2016-08-06 21:57:13 | HQ |
38,809,137 | Golang multiple json tag names for one field | <p>It it possible in Golang to use more than one name for a JSON struct tag ?</p>
<pre><code>type Animation struct {
Name string `json:"name"`
Repeat int `json:"repeat"`
Speed uint `json:"speed"`
Pattern Pattern `json:"pattern",json:"frames"`
}
</code></pre>
| <json><go><struct><tags> | 2016-08-06 22:07:31 | HQ |
38,809,333 | Best way to call a function at specific timestamp | <p>I want to call a function when System timestamp reaches to specific time.
is there anyway better than a CountDownTimer ?
It should be called on a service because i want it still run when app closes.</p>
<p>thanks a lot.</p>
| <java><android> | 2016-08-06 22:34:03 | LQ_CLOSE |
38,809,580 | How to get List from Page in Spring Data REST | <p>I am using <code>JPARespository</code> for all my CRUD operation.
Recently I wanted to implement sorting, so I went ahead with <code>Pagable</code>.</p>
<p>The problem is, I want the repository methods to return <code>List</code> objects, I use them in my service layer.</p>
<p>How can I achieve this, is there a way to convert these <code>Page</code> objects to <code>List</code>?</p>
| <java><spring><pagination><spring-data><spring-restcontroller> | 2016-08-06 23:25:43 | HQ |
38,809,605 | can a image url contain a written virus | <p>i was trying to insert image urls into my database but I was wondering can image urls contain virus written in the url itself. I've looked around for the answer but can't find the answer.
like this. I've seen real huge urls about a page long. Like this url below could that be a virus.
<a href="http://vignette4.wikia.nocookie.net/disney/images/8/8b/AoU_Hulk_03.png/revision/latest?cb=20150310161344" rel="nofollow">http://vignette4.wikia.nocookie.net/disney/images/8/8b/AoU_Hulk_03.png/revision/latest?cb=20150310161344</a></p>
<p>data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMWFhUXGBgXGBgYGBgaHRodGBcYFxcXGhcYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0lICUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIALEBHAMBIgACEQEDEQH/xAAbAAACAgMBAAAAAAAAAAAAAAAEBQMGAAECB//EAEUQAAEDAgMFBQYDBQYEBwAAAAEAAhEDIQQSMQUGQVFhEyJxgZEyQqGxwfAUUuEjYnKS0QcVM4LC8SQ0Q6JEU2Oys8PS/8QAGQEAAwEBAQAAAAAAAAAAAAAAAQIDBAAF/8QALhEAAgICAQMCBAUFAQAAAAAAAAECEQMhEgQxQRNRIjJxgWGRocHwIzOx0eEU/9oADAMBAAIRAxEAPwC9vaoi1TPC4Wi2ZaNsYFIAFHnW2OXWztHZKExARRKhqBFAkDCkEFUObM3jEhTbUqGMomdUKxpBY/yKexKMxlIHDlw1aqLWxTS7vEhWza2JOHbVDrtIt9FzsZ1Knh6LxSp9q5udz3Ma53eJIguBi0aLN1HVrBFNq7YeCq34M3UoOqd5rXOYOMGD56IffGs/LALA+7sgcHOytLQSS2QIzNsTOvIpni9ouqCHPLvE29FTts18pD4nszmgcRBbUb4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gve/iH/tcsWLF1HyP+eSvgr+8f/M4XxHzXe0dVixXx/LH6fuSh8zBDwUtPRYsVUMQHVdYr/Gpfwt+QWLEku6+5z7FqHtN8vmEX7p8T81tYsuL539A+PuTUNF21YsW0U6cpMD/jM/iCxYmXcXwCN4qVunksWJYjnVPRSBbWI+EKYdV2VpYuXcJ//9k=</p>
| <javascript><php><jquery><html> | 2016-08-06 23:31:13 | LQ_CLOSE |
38,810,843 | How can I write an else if structure using React (JSX) - the ternary is not expressive enough | <p>I want to write the equivalent in react:</p>
<pre><code>if (this.props.conditionA) {
<span>Condition A</span>
} else if (this.props.conditionB) {
<span>Condition B</span>
} else {
<span>Neither</span>
}
</code></pre>
<p>So maybe</p>
<pre><code>render() {
return (<div>
{(function(){
if (this.props.conditionA) {
return <span>Condition A</span>
} else if (this.props.conditionB) {
return <span>Condition B</span>
} else {
return <span>Neither</span>
}
}).call(this)}
</div>)
}
</code></pre>
<p>But that seems overly complex. Is there a better way?</p>
| <javascript><reactjs><jsx> | 2016-08-07 04:20:22 | HQ |
38,810,846 | How to set the value of a JavaFX Spinner? | <p>I'm wondering how to set the value of a JavaFX Spinner, as I haven't been able to figure it out.</p>
<p>I know with Swing you can just use spinner#setValue but it seems to be different with JavaFX.</p>
<pre><code>@FXML
private Spinner<Integer> spinner;
</code></pre>
| <java><javafx> | 2016-08-07 04:20:57 | HQ |
38,812,225 | Queue vs Dequeue in java | <p>What is the difference between them? I know that </p>
<p>A queue is designed to have elements inserted at the end of the queue, and elements removed from the beginning of the queue.
Where as Dequeue represents a queue where you can insert and remove elements from both ends of the queue. </p>
<p>But which is more efficient?</p>
<p>Plus what's the difference between them two? cause i have a bit of knowledge about them, what i said above, but i would like to know more about them. It will be appreciated.</p>
| <java><data-structures><queue><deque> | 2016-08-07 08:13:27 | HQ |
38,812,453 | how can i be able to check weather particular username or password is correct or the session is created after getting autharised | how can i be able to check weather particular username or password is correct or the session is created after getting autharised
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
final String uid=jTextField1.getText();
String pass = new String(jPasswordField1.getPassword());
//server Config
Properties prop=new Properties();
prop.put("mail.smtp.auth","true");
prop.put("mail.smtp.starttls.enable","true");
prop.put("mail.smtp.host","smtp.gmail.com");
prop.put("mail.smtp.port","587");
//client Authentication
Authenticator auth=new Authenticator()
{
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(uid,pass);
}
};
//Session Creation
Session session= Session.getInstance(prop,auth);
try{
String to=JOptionPane.showInputDialog("To :");
String sub=JOptionPane.showInputDialog("Subject :");
String data=JOptionPane.showInputDialog("Compose :");
//Message Creation
Message msg=new MimeMessage(session);
msg.setFrom(new InternetAddress(uid));
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to));
msg.setSubject(sub);
msg.setText(data);
//sending msg
Transport.send(msg);
JOptionPane.showMessageDialog(null,"sent !");
// TODO add your handling code here:
} catch (MessagingException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
} | <java> | 2016-08-07 08:47:54 | LQ_EDIT |
38,812,995 | Android TextView Hyperlink | <p>I'm implementing a TextView with a string containing two hyperlinks as below but the links are not opening a new browser window:</p>
<pre><code><TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#ffffff"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:textSize="14sp"
android:clickable="true"
android:linksClickable="true"
android:textColorLink="@color/colorPrimary"
android:autoLink="web"
android:text="@string/agree_terms_privacy"/>
</code></pre>
<p>In string.xml</p>
<pre><code><string name="agree_terms_privacy">By continuing, you agree to our <a href="http://link1/terms">Terms of Use</a> and read the <a href="http://link1/privacy">Privacy Policy</a></string>
</code></pre>
| <android><hyperlink><textview> | 2016-08-07 10:00:50 | HQ |
38,813,399 | Cache a static file in memory forever on Nginx? | <p>I have Nginx running in a Docker container, and it serves some static files. The files will <em>never</em> change at runtime - if they actually do change, the container will be stopped, the image will be rebuilt, and a new container will be started.</p>
<p>So, to improve performance, it would be perfect if Nginx would read the static files only one single time from disk and then server it from memory forever. I have found some configuration options to configure caching, but at least from what I have seen none of them provided this "forever" behavior that I'm looking for.</p>
<p>Is this possible at all? If so, how do I need to configure Nginx to achieve this?</p>
| <caching><nginx><static-content> | 2016-08-07 10:55:41 | HQ |
38,815,234 | How to add fonts for different font weights for react-native android project? | <p>I've managed to add a custom font by:</p>
<ul>
<li><p>putting *.ttf files in <code>ProjectName/android/app/src/main/assets/fonts/</code> like this:</p>
<ul>
<li>Open Sans.ttf</li>
<li>Open Sans_italic.ttf</li>
<li>Open Sans_bold.ttf</li>
<li>Open Sans_bold_italic.ttf</li>
</ul></li>
<li><p>and setting font family by <code>fontFamily: "Open Sans"</code></p></li>
</ul>
<p>But there are extra font weights I want to use like 'Semi Bold', 'Extra Bold'. I tried adding them as 'Open Sans_900.ttf' and setting <code>fontWeight: 900</code> but that didn't work, it displayed bold version of the font.</p>
<p>Is there a way to add these additional font weights?</p>
| <android><fonts><react-native> | 2016-08-07 14:38:13 | HQ |
38,815,608 | Rat in Maze Puzzle | I was recently asked this question in an Interview.
http://www.geeksforgeeks.org/backttracking-set-2-rat-in-a-maze/
I gave the interviewer the solution mentioned in the link which happens to be exponential.The interviewer was quite surprised by my response , and was apparently expecting a polynomial time solution.I looked for one but could not find any.Does there exist a polynomial time solution for this problem. | <algorithm><time-complexity><path-finding> | 2016-08-07 15:20:00 | LQ_EDIT |
38,815,721 | Error:(67, 51) java: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator) | <p>I want to use <a href="https://github.com/guoguibing/librec" rel="nofollow">this</a> library, I cloned it and imported it into IntelliJ IDEA 14.0.3, with JDK 1.8.0_77, but when I want to run the main method I get this error:</p>
<pre><code>Error:(422, 50) java: diamond operator is not supported in -source 1.6
(use -source 7 or higher to enable diamond operator)
</code></pre>
<p>what is going on here? how can I resolve it?</p>
| <java><intellij-idea><diamond-operator> | 2016-08-07 15:35:19 | LQ_CLOSE |
38,816,955 | Elasticsearch Fuzzy Phrases | <p>I have the following query to add fuzziness to my search. However, I now realize that the match query doesn't consider the order of the words in the search string, as the match_phrase does. However, I can't get match_phrase to give me results with fuzziness. Is there a way to tell match to consider the order and distance between words?</p>
<pre><code>{
"query": {
"match": {
"content": {
"query": "some search terms like this",
"fuzziness": 1,
"operator": "and"
}
}
}
}
</code></pre>
| <elasticsearch> | 2016-08-07 17:54:26 | HQ |
38,817,058 | Stack Implementations in C | <p>I’m stuck trying to figure out what, exactly, are the definitions of the following stack implementations and the advantages and disadvantages associated with each.</p>
<pre><code>1.Array-based implementation
2.Linked implementation
3.Blocked implementation
</code></pre>
<p>Any help would be much appreciated.</p>
| <c> | 2016-08-07 18:07:49 | LQ_CLOSE |
38,817,352 | What is difference between echo and return in shortcode function with wordpress? | <p>I found both 'echo' and 'return' are working fine to display in shortcode function.</p>
<pre><code>function display_shortcode_content($atts) {
echo "COMES";
}
function display_shortcode_content($atts) {
return "COMES";
}
</code></pre>
<p>My doubt is what is difference between echo and retutn in the function? </p>
| <php><wordpress> | 2016-08-07 18:40:20 | LQ_CLOSE |
38,817,417 | what is the meaning of hibernate inverseJoinColumns? | <p>I understand hibernate @JoinTable annotation, but I don't understand the inverseJoinColumns. What is it used for?</p>
<p>e.g.</p>
<pre><code> @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "stock_category", catalog = "mkyongdb", joinColumns = {
@JoinColumn(name = "STOCK_ID", nullable = false, updatable = false) },
inverseJoinColumns = { @JoinColumn(name = "CATEGORY_ID",
nullable = false, updatable = false) })
public Set<Category> getCategories() {
return this.categories;
}
</code></pre>
| <hibernate> | 2016-08-07 18:49:38 | HQ |
38,817,636 | Uncaught ReferenceError: define is not defined typescript | <p>I am new to typescript, knockout and requirejs. I have created some demo using this files. Now, I want to implement some minor logic using typescript and knockoutjs. </p>
<p>I have created 4-5 typescript files, which are imported internally. When I run the html file. I am getting the error stating. as Titled </p>
<p><a href="https://i.stack.imgur.com/oAisn.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/oAisn.jpg" alt="enter image description here"></a>
Can somebody help me on this error. What I am missing in this code. </p>
<p>have search on google and spend quite a good time but didn't find the proper solutions. It must be related to requireJS to define all modules. But, as new in requireJS not able to catch up with that. I have also search stackoverflow for the similar error, but it doesn't help me out.</p>
<p>Waiting for the solution</p>
| <javascript><knockout.js><typescript><requirejs> | 2016-08-07 19:16:09 | HQ |
38,818,190 | How do we authenticate against a secured NuGet server with Cake build? | <p>We are working on automating our builds using Cake Build and we use NuGet packages from nuget.org but we also have our own NuGet Feed server which has a username/password authentication to access. How do we utilize Cake Build with a custom NuGet feed server with authentication?</p>
| <c#><msbuild><nuget><build-server><cakebuild> | 2016-08-07 20:22:07 | HQ |
38,819,138 | How to dismiss Keyboard if subscriber throws an error in reactive cocoa using swift? | <p>I subscribed to a service call and handling error incase if service call throws an error. This is everything done in View Model. So, when an error throws I want to dismiss Keyboard. How can I let my View Model tells to VC to dismiss keyboard. I am using reactive cocoa and swift.</p>
| <ios><swift><uiviewcontroller><viewmodel><reactive-cocoa> | 2016-08-07 22:28:40 | LQ_CLOSE |
38,819,289 | Why is computed value not updated after vuex store update? | <p>I got a <code>printerList</code> computed property that should be re-evaluated after <code>getPrinters()</code> resolve, but it look like it's not.</p>
<p><a href="https://github.com/Coaxis-ASP/opt/tree/f1267a6a4f1202a3db710b1ee0639996730186c1/frontend/src" rel="noreferrer">sources are online</a>: <a href="https://github.com/Coaxis-ASP/opt/blob/f1267a6a4f1202a3db710b1ee0639996730186c1/frontend/src/pages/optboxes/optbox.component.vue" rel="noreferrer">optbox.component.vue</a>, <a href="https://github.com/Coaxis-ASP/opt/tree/f1267a6a4f1202a3db710b1ee0639996730186c1/frontend/src/vuex" rel="noreferrer">vuex</a>, <a href="https://github.com/Coaxis-ASP/opt/blob/f1267a6a4f1202a3db710b1ee0639996730186c1/frontend/src/services/optboxes.service.js" rel="noreferrer">optboxes.service.js</a></p>
<h3>Component</h3>
<pre><code><template>
<div v-for="printer in printersList">
<printer :printer="printer" :optbox="optbox"></printer>
</div>
</template>
<script>
…
created() { this.getPrinters(this.optbox.id); },
computed: {
printersList() {
var index = optboxesService.getIndex(this.optboxesList, this.optbox.id);
return this.optboxesList[index].printers
}
},
vuex: {
actions: { getPrinters: actions.getPrinters,},
getters: { optboxesList: getters.retrieveOptboxes}
}
<script>
</code></pre>
<h3>Actions</h3>
<pre><code>getPrinters({dispatch}, optboxId) {
printers.get({optbox_id: optboxId}).then(response => {
dispatch('setPrinters', response.data.optbox, response.data.output.channels);
}).catch((err) => {
console.error(err);
logging.error(this.$t('printers.get.failed'))
});
},
</code></pre>
<h3>Mutations</h3>
<pre><code>setPrinters(optboxes, optboxId, printers) {
var index = this.getIndex(optboxes, optboxId);
optboxes[index] = {...optboxes[index], printers: printers }
},
</code></pre>
<h3>Question</h3>
<p>Why does the <code>printerList</code> computed property isn't re-evaluated (i.e. the <code>v-for</code> is empty)</p>
| <vue.js><computed-properties><vuex> | 2016-08-07 22:54:03 | HQ |
38,819,322 | How to recover deleted iPython Notebooks | <p>I have iPython Notebook through Anaconda. I accidentally deleted an important notebook, and I can't seem to find it in trash (I don't think iPy Notebooks go to the trash).</p>
<p>Does anyone know how I can recover the notebook? I am using Mac OS X.</p>
<p>Thanks!</p>
| <ipython-notebook><jupyter-notebook><recovery> | 2016-08-07 22:58:43 | HQ |
38,819,884 | VBA code to copy cells from a range (A1:T1) to a range whose address is a text value in another cell (A20) | I so hope someone can help me (a VBA Newbie) with a simple issue.
In one cell (A20), I have a text address of another cell (let's say A366). I want to copy a range of cells (say A21:T21) to the target range whose address is in cell A20 (that example was A366).
For the life of me, I have been totally unable to do what seems incredibly basic and easy.
Help, please! | <excel><vba><copy> | 2016-08-08 00:40:31 | LQ_EDIT |
38,820,188 | Rails 5: How to remove a column from a database? | <p>What is the command for removing an existing column from a table using migration?</p>
<p>The column I want to remove is: <code>country:string</code></p>
<p>From the table: <code>sample_apps</code></p>
| <ruby-on-rails> | 2016-08-08 01:39:29 | HQ |
38,820,556 | Unit test on Kotlin Extension Function on Android SDK Classes | <p>Kotlin extension function is great. But how could I perform unit test on them? Especially those that is of Android SDK provided class (e.g. Context, Dialog).</p>
<p>I provide two examples below, and if anyone could share how I could unit test them, or if I need to write them differently if I really want to unit test them.</p>
<pre><code>fun Context.getColorById(colorId: Int): Int {
if (Build.VERSION.SDK_INT >= 23)
return ContextCompat.getColor(this, colorId)
else return resources.getColor(colorId)
}
</code></pre>
<p>and </p>
<pre><code>fun Dialog.setupErrorDialog(body : String, onOkFunc: () -> Unit = {}): Dialog {
window.requestFeature(Window.FEATURE_NO_TITLE)
this.setContentView(R.layout.dialog_error_layout)
(findViewById(R.id.txt_body) as TextView).text = body
(findViewById(R.id.txt_header) as TextView).text = context.getString(R.string.dialog_title_error)
(findViewById(R.id.txt_okay)).setOnClickListener{
onOkFunc()
dismiss()
}
return this
}
</code></pre>
<p>Any suggestion would help. Thanks!</p>
| <android><unit-testing><kotlin><kotlin-android-extensions><kotlin-extension> | 2016-08-08 02:35:43 | HQ |
38,821,059 | What is the rails way equivalent of mailto: and tel:? | <p>My model have contact:string and email:string attributes. In pure html, we can write</p>
<p><code><a href="mailto:sample@email.com">email us</a></code></p>
<p>and </p>
<pre><code><a href="tel:123-456">123-456</a>
</code></pre>
<p>How do we convert these two into rails code assuming my model name is sample. My guess would be something like</p>
<pre><code><%= link_to @sample.email, "#" %>
<%= link_to @sample.contact, "#" %>
</code></pre>
<p>What should be in the <code>"#"</code> ?</p>
| <ruby-on-rails> | 2016-08-08 03:53:19 | HQ |
38,821,132 | Bokeh: ValueError: Out of range float values are not JSON compliant | <p>I came across this discussion (from a year ago): <a href="https://github.com/bokeh/bokeh/issues/2392" rel="noreferrer">https://github.com/bokeh/bokeh/issues/2392</a></p>
<p>I also saw the white screen without any errors..and then i tried to take a small subset of 2 columns and tried the below:</p>
<p>Since pandas just gets a bunch of rows with empty data in there as well, I tried dropna.. this resulted in there being no data at all. So instead I just specified the rows that should go into the df (hence the <code>df = df.head(n=19)</code> line)</p>
<pre><code>import pandas as pd
from bokeh.plotting import figure, output_file, show
df = pd.read_excel(path,sheetname,parse_cols="A:B")
df = df.head(n=19)
print(df)
rtngs = ['iAAA','iAA+','iAA','iAA-','iA+','iA','iA-','iBBB+','iBBB','iBBB-','iBB+','iBB','iBB-','iB+','iB','iB-','NR','iCCC+']
x= df['Score']
output_file("line.html")
p = figure(plot_width=400, plot_height=400, x_range=(0,100),y_range=rtngs)
# add a circle renderer with a size, color, and alpha
p.circle(df['Score'], df['Rating'], size=20, color="navy", alpha=0.5)
# show the results
#output_notebook()
show(p)
</code></pre>
<p>df:</p>
<pre><code> Rating Score
0 iAAA 64.0
1 iAA+ 33.0
2 iAA 7.0
3 iAA- 28.0
4 iA+ 36.0
5 iA 62.0
6 iA- 99.0
7 iBBB+ 10.0
8 iBBB 93.0
9 iBBB- 91.0
10 iBB+ 79.0
11 iBB 19.0
12 iBB- 95.0
13 iB+ 26.0
14 iB 9.0
15 iB- 26.0
16 NR 49.0
17 iCCC+ 51.0
18 iAAA 18.0
</code></pre>
<p>The above is showing me an output within the notebook, but still throws : <code>ValueError: Out of range float values are not JSON compliant</code></p>
<p>And also it doesn't (hence?) produce the output file as well. How do I get rid of this error for this small subset? Is it related to NaN values? Would that also solve the 'white screen of death' issue for the larger dataset?</p>
<p>Thanks vm for taking a look!</p>
<p>In case you would like to see the entire error:</p>
<pre><code>---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-12-4fa6b88aa415> in <module>()
16 # show the results
17 #output_notebook()
---> 18 show(p)
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\io.py in show(obj, browser, new)
300 if obj not in _state.document.roots:
301 _state.document.add_root(obj)
--> 302 return _show_with_state(obj, _state, browser, new)
303
304
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\io.py in _show_with_state(obj, state, browser, new)
310
311 if state.notebook:
--> 312 comms_handle = _show_notebook_with_state(obj, state)
313 shown = True
314
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\io.py in _show_notebook_with_state(obj, state)
334 comms_target = make_id()
335 publish_display_data({'text/html': notebook_div(obj, comms_target)})
--> 336 handle = _CommsHandle(get_comms(comms_target), state.document, state.document.to_json())
337 state.last_comms_handle = handle
338 return handle
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\document.py in to_json(self)
792 # this is a total hack to go via a string, needed because
793 # our BokehJSONEncoder goes straight to a string.
--> 794 doc_json = self.to_json_string()
795 return loads(doc_json)
796
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\document.py in to_json_string(self, indent)
785 }
786
--> 787 return serialize_json(json, indent=indent)
788
789 def to_json(self):
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\site-packages\bokeh\core\json_encoder.py in serialize_json(obj, encoder, indent, **kwargs)
97 indent = 2
98
---> 99 return json.dumps(obj, cls=encoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\json\__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
235 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
236 separators=separators, default=default, sort_keys=sort_keys,
--> 237 **kw).encode(obj)
238
239
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\json\encoder.py in encode(self, o)
197 # exceptions aren't as detailed. The list call should be roughly
198 # equivalent to the PySequence_Fast that ''.join() would do.
--> 199 chunks = self.iterencode(o, _one_shot=True)
200 if not isinstance(chunks, (list, tuple)):
201 chunks = list(chunks)
C:\Users\x\AppData\Local\Continuum\Anaconda3\lib\json\encoder.py in iterencode(self, o, _one_shot)
255 self.key_separator, self.item_separator, self.sort_keys,
256 self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)
258
259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
ValueError: Out of range float values are not JSON compliant
</code></pre>
| <python><bokeh> | 2016-08-08 04:05:04 | HQ |
38,821,259 | What is the best way to perform parallel execution inside a web servlet? | <p>Spawning threads inside web servlet is not the correct way. Executor Services are best prescribed for asynchronous operations (is it?)
If one needs to perform multiple parallel operations and combine the results in the same webservlet response, then what would be a good approach? </p>
| <java><web-services><servlets> | 2016-08-08 04:20:49 | LQ_CLOSE |
38,821,317 | call stored procedure with parametes using web api | When I execute this Stored Procedure in MS SQL Server:
**use Vcom**
**go**
**exec abrir_turno @posto = 'pppe', @turno = '3', @data = '2016-06-13'**
The SQL return a messagem " **your SP set pppe to open** ".
I am trying to implement that using Web Api 2with c#:
**public IEnumerable<string> spabrirturno(string posto, string turno, string data, string STATUS_TURNO)**
{
STATUS_TURNO = null;
return obj.abrir_turno(posto, turno, data, STATUS_TURNO).AsEnumerable();
}
But that is a error : "cannot implicitly convert type ienumerable to string" message in photo...
[enter image description here][1]
[1]: http://i.stack.imgur.com/Uhbvb.png | <c#><sql-server><stored-procedures><asp.net-web-api2> | 2016-08-08 04:28:55 | LQ_EDIT |
38,821,397 | android ImageView allways top and bottom | <p>In activity, i has 2 ImageView and LinearLayout1 hold some text and button.<br>
i want like :</p>
<p><a href="https://i.stack.imgur.com/iZLNi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iZLNi.png" alt="enter image description here"></a></p>
<p>how to do it?</p>
| <android><android-imageview> | 2016-08-08 04:40:00 | LQ_CLOSE |
38,821,586 | One line to check if string or list, then convert to list in Python | <p>Suppose I have an object <code>a</code> that can either be a string (like <code>'hello'</code> or <code>'hello there'</code>) or a list (like <code>['hello', 'goodbye']</code>). I need to check if <code>a</code> is a string or list. If it's a string, then I want to convert it to a one element list (so convert <code>'hello there'</code> to <code>['hello there']</code>). If it's a list, then I want to leave it alone as a list.</p>
<p>Is there a Pythonic one-line piece of code to do this? I know I can do:</p>
<pre><code>if isinstance(a, str):
a = [a]
</code></pre>
<p>But I'm wondering if there's a more direct, more Pythonic one-liner to do this.</p>
| <python> | 2016-08-08 05:00:33 | HQ |
38,821,631 | CAGradientLayer diagonal gradient | <p><a href="https://i.stack.imgur.com/UYqru.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UYqru.png" alt="enter image description here"></a></p>
<p>I use the following CAGradientLayer:</p>
<pre><code>let layer = CAGradientLayer()
layer.colors = [
UIColor.redColor().CGColor,
UIColor.greenColor().CGColor,
UIColor.blueColor().CGColor
]
layer.startPoint = CGPointMake(0, 1)
layer.endPoint = CGPointMake(1, 0)
layer.locations = [0.0, 0.6, 1.0]
</code></pre>
<p>But when I set bounds property for the layer, it just stretches a square gradient. I need a result like in Sketch 3 app image (see above).</p>
<p>How can I achieve this?</p>
| <ios><swift><calayer><cagradientlayer> | 2016-08-08 05:05:27 | HQ |
38,821,667 | BeerAdviser application | <p>I am reading a book on android development and it has a following example</p>
<pre><code> for
(String brand:brandlist)
{
brandsFormatted.append(brand).append('\n');
}
</code></pre>
<p>This is the .java code for the application.
Can anyone please explain me what happens in the for loop?
I did not understand
I am a beginner and I tried searching on the internet but did not understand this particular part.
Can anyone help me please?
Thank you</p>
| <java><android> | 2016-08-08 05:10:10 | LQ_CLOSE |
38,822,350 | Want to know about html and php | <p>I'm new to web design. I started with html and make some pages with ext .html
but now I want to add a contact us form or message us form in my html page . So how can I do that . Actually I want to use html page and that html page can execute php script.</p>
<p>Thanks in advance.</p>
| <php><html><css> | 2016-08-08 06:14:51 | LQ_CLOSE |
38,822,497 | How to make a character with real face unreal engine 4 | <p>i am a beginner in game development.i used unreal engine4 for making a sample game. i successfully create a running game with the help of some tutorials. </p>
<p>next i need to model a character like me.also i interested to create an environment like my home. i have no idea about this. </p>
<ol>
<li>is it possible to create real characters using Unreal engine 4 ?</li>
<li>How to create a new material(Real materials eg: Hose wall,floor) ?</li>
<li>How to create a characters like Gta game characters using Unreal engine?</li>
</ol>
| <game-engine><unreal-engine4><3d-modelling><unreal-development-kit><unreal-blueprint> | 2016-08-08 06:26:49 | LQ_CLOSE |
38,822,937 | Two questions in complexity | How can I proof the following questions in complexity:
1. |O(f(n)) – O(f(n))| = ?
Complexity of absolute value of O(f(n)) – O(f(n)).
2. O(f(n))+ O(f(n)) = ?
Many thanks,
Ran. | <algorithm><complexity-theory> | 2016-08-08 06:55:46 | LQ_EDIT |
38,823,319 | Automatically add copyright banner in VS Code | <p>Is there an easy way to configure VS Code to add a custom Copyright banner to a file? I was thinking of using a <a href="https://code.visualstudio.com/docs/customization/userdefinedsnippets" rel="noreferrer">code snippet</a>. Is there a better way of achieving the same thing? Thanks! </p>
| <visual-studio-code> | 2016-08-08 07:17:58 | HQ |
38,823,431 | A Framework to remind the user that their login is about to expire | <p>Is there a framework that I can implement on a MVC website which will hook into my session and provide a reminder that their login is about to time out? </p>
<p>Ideally I would like to provide a view which would have the popup message on which can be configured.</p>
<p>Also how would it work across browser tabs? If there were two tabs and you logged out on one then the session would be finished on the second tab. Is there a way of gracefully redirecting the second tab to the login page. For example if on second tab and fire some AJAX to a secured action I then get a fail. Could that redirect to login?</p>
<p>I written something like this in the past but can be time consuming to test etc. and the multi tab issue was tricky.</p>
<p>Ideally I am wanting something to plug in and use and configure.</p>
| <jquery><asp.net><asp.net-mvc><authorization><nuget> | 2016-08-08 07:25:35 | LQ_CLOSE |
38,823,461 | Perl list referencing reversing | Folks, I am newbie to perl. And have been working with csv's, json's, list and hashes.</br>
**I have written this code, but it is giving me error. I want to use this *$header_copy* in foreach loop.**
1. my @headers=qw/January February March April May June/;
2. my $header_copy=\@headers;
3. print("$header_copy->[2]"); # Prints "March" Correctly
4. print("$header_copy[2]"); #Gives Error.
>>**Error :**
***Global symbol "@header_copy" requires explicit package name at line 4***
And I want to use $header_copy in for loop: like</br>
</br
> foreach $i ($header_copy){ **code..** }
Help! Urgent!! | <arrays><perl> | 2016-08-08 07:27:19 | LQ_EDIT |
38,823,767 | Snackbar is not dismissing on swipe | <p>i have a snackbar in my appcompat activity. It has a button OK which dismiss the snackbar.It is working perfact. but i can't dismiss the snackbar on swipe(left to right).</p>
<p>Following is my code for snackbar....</p>
<pre><code>final Snackbar snackbar = Snackbar
.make(view, "Error Message", Snackbar.LENGTH_INDEFINITE);
snackbar.setAction("OK", new View.OnClickListener() {
@Override
public void onClick(View view) {
snackbar.dismiss();
}
});
snackbar.show();
</code></pre>
<p><strong>Edit 1</strong></p>
<p>I have Relative layout as parent layout in my activity's XML layout.</p>
| <android><android-snackbar> | 2016-08-08 07:46:06 | HQ |
38,824,666 | vagrant up - server not starting because a ssh library issue | <p>I get this errormessage:</p>
<blockquote>
<p>An error occurred in the underlying SSH library that Vagrant uses. The
error message is shown below. In many cases, errors from this library
are caused by ssh-agent issues. Try disabling your SSH agent or
removing some keys and try again.</p>
</blockquote>
<p>It is my first time with vagrant.</p>
<p>I took a tour through this tutorial.</p>
<p><a href="https://wpbeaches.com/setting-up-a-wordpress-vvv-vagrant-workflow/" rel="noreferrer">https://wpbeaches.com/setting-up-a-wordpress-vvv-vagrant-workflow/</a></p>
<p>I've windows 10, vagrant 1.8.5, Oracle VM newest version.</p>
<p>I read a lot about this issue but nothing helps me.</p>
<p>Maybe somebody knows a solution.</p>
| <vagrant> | 2016-08-08 08:39:38 | HQ |
38,824,950 | how to write rest service using @beanparam and @Get mthod | <p>Please help me to write rest webservice using below class and @beanparam and @Get method</p>
<pre><code> @QueryParam("prop1")
public String prop1;
@QueryParam("prop2")
public String prop2;
@QueryParam("prop3")
public String prop3;
@QueryParam("prop4")
public String prop4;
</code></pre>
| <java><rest> | 2016-08-08 08:54:54 | LQ_CLOSE |
38,825,773 | Flowtype - string incompatible with string enum | <p>I have a value that comes from a select input and is of type string, however I want to pass it into a function (<em>updateLanguage</em>) that receives as argument a string enum with a type alias (<em>Language</em>). </p>
<p>The problem I'm facing is that Flow only allows me to call <em>updateLanguage</em> if I explicitly compare my string value with the enum strings and I want to use an array function like array.includes.</p>
<p>This is a code simplification of my problem:</p>
<pre><code>// @flow
type SelectOption = {
value: string
};
const selectedOption: SelectOption = {value: 'en'};
type Language = 'en' | 'pt' | 'es';
const availableLanguages: Language[] = ['en', 'pt'];
function updateLanguage(lang: Language) {
// do nothing
}
// OK
if(selectedOption.value === 'en' || selectedOption.value === 'pt') {
updateLanguage(selectedOption.value);
}
// FLOWTYPE ERRORS
if(availableLanguages.includes(selectedOption.value)) {
updateLanguage(selectedOption.value);
}
</code></pre>
<p>running flow v0.30.0 gives the following output:</p>
<pre><code>example.js:21
21: if(availableLanguages.includes(selectedOption.value)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call of method `includes`
21: if(availableLanguages.includes(selectedOption.value)) {
^^^^^^^^^^^^^^^^^^^^ string. This type is incompatible with
9: const availableLanguages: Language[] = ['en', 'pt'];
^^^^^^^^ string enum
example.js:22
22: updateLanguage(selectedOption.value);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function call
22: updateLanguage(selectedOption.value);
^^^^^^^^^^^^^^^^^^^^ string. This type is incompatible with
11: function updateLanguage(lang: Language) {
^^^^^^^^ string enum
Found 2 errors
</code></pre>
<p>How can I check that the string value is part of the enum in a scalable manner?</p>
| <javascript><string><enums><typechecking><flowtype> | 2016-08-08 09:37:34 | HQ |
38,825,943 | MIMEMultipart, MIMEText, MIMEBase, and payloads for sending email with file attachment in Python | <p>Without much prior knowledge of MIME, I tried to learned how to write a Python script to send an email with a file attachment. After cross-referencing Python documentation, Stack Overflow questions, and general web searching, I settled with the following code <sup>[1]</sup> and tested it to be working. </p>
<pre><code>import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
fromaddr = "YOUR EMAIL"
toaddr = "EMAIL ADDRESS YOU SEND TO"
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = "SUBJECT OF THE EMAIL"
body = "TEXT YOU WANT TO SEND"
msg.attach(MIMEText(body, 'plain'))
filename = "NAME OF THE FILE WITH ITS EXTENSION"
attachment = open("PATH OF THE FILE", "rb")
part = MIMEBase('application', 'octet-stream')
part.set_payload((attachment).read())
encoders.encode_base64(part)
part.add_header('Content-Disposition', "attachment; filename= %s" % filename)
msg.attach(part)
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(fromaddr, "YOUR PASSWORD")
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
</code></pre>
<ol>
<li><p>I have a rough idea of how this script works now, and worked out the following workflow. Please let me know how accurate my flowchart(?) is. </p>
<pre><code> as.string()
|
+------------MIMEMultipart
| |---content-type
| +---header---+---content disposition
+----.attach()-----+----MIMEBase----|
| +---payload (to be encoded in Base64)
+----MIMEText
</code></pre></li>
<li><p>How do I know when to use MIMEMultipart, MIMEText and MIMEBase? This seems like a complicated question, so maybe just offer some general rules-of-thumb to me?</p></li>
<li>I read that MIME has a tree-like structure<sup>[2]</sup> , does that mean MIMEMultipart is always at the top? </li>
<li>In the first code block, MIMEMultipart encodes ['From'], ['To'], and ['Subject'], but in the Python documentation, MIMEText can also be used to encode ['From'], ['To'], and ['Subject']. How to do I decide one to use?</li>
<li>What exactly is a "payload"? Is it some content to be transported? If so, what kind of content does this include (I noticed that body text and attachment are treated as payloads)? I thought this would be an easy question but I just could not find a satisfying, reliable, and simple answer. </li>
<li>Is is true that although MIME can attach file formats much simpler than just some texts, at the end all the encoding, header information, and payloads are all turned into strings so that they can be passed into .sendmail()?</li>
</ol>
<p>[1]<a href="http://naelshiab.com/tutorial-send-email-python/" rel="noreferrer">http://naelshiab.com/tutorial-send-email-python/</a><br>
[2]<a href="http://blog.magiksys.net/generate-and-send-mail-with-python-tutorial" rel="noreferrer">http://blog.magiksys.net/generate-and-send-mail-with-python-tutorial</a> </p>
| <python><email><smtp><mime><smtplib> | 2016-08-08 09:45:19 | HQ |
38,826,633 | How to skip the first item(s) of an iterator in Rust? | <p>When iterating over arguments (for example) thats the most straightforward way to skip the first <em>N</em> elements?</p>
<p>eg:</p>
<pre><code>use std::env;
fn main() {
for arg in env::args() {
println!("Argument: {}", arg);
}
}
</code></pre>
<p>I tried <code>env::args()[1..]</code> but slicing isn't supported.</p>
<p>Whats the simplest way to skip the first arguments of an iterator?</p>
| <iterator><rust> | 2016-08-08 10:16:59 | HQ |
38,826,969 | python string comparison unexpected results | <pre><code>>>> '1.2.3'>'1.1.5'
True
>>> '1.1.3'>'1.1.5'
False
>>> '1.1.5'>'1.1.5'
False
>>> '1.1.7'>'1.1.5'
True
>>> '1.1.9'>'1.1.5'
True
>>> '1.1.10'>'1.1.5'
False
>>> '1.2'>'1.1.5'
True
>>> '1.2.9'>'1.1.5'
True
>>> '1.2.10'>'1.1.5'
True
</code></pre>
<p>Hi,</p>
<p>I am trying to compare two strings as shown above. First of all, I am surprised that python comparing strings of numbers. firstly I thought that it will just compare lengths, but for different values it's giving exact values and I am astonished. But, for '1.1.10' > '1.1.5' it's false... i don't know why.... can anyone help...</p>
| <python><string> | 2016-08-08 10:33:35 | LQ_CLOSE |
38,827,157 | DOS script to change names with some logic | I have a directory with the following layout :
1 януари 2012
2 февруари 2012
1 януари 2013
and I want it to look like this yyyy-mm-dd:
2012-01-01
2012-02-01
2013-01-01
**Януари / февруари** are Cyrillic names of months so they map easily to numbers - **01 / 02**.
The script basically has to :
1. take a dir name
2. rename it in the correct format
I am very new to DOS scripting so if you could help me it would be great.
Thank you
| <batch-file> | 2016-08-08 10:44:01 | LQ_EDIT |
38,827,186 | What is the difference between crossinline and noinline in Kotlin? | <ol>
<li><p>This code <strong>compiles with a warning</strong> (<em>insignificant performance impact</em>):</p>
<pre><code>inline fun test(noinline f: () -> Unit) {
thread(block = f)
}
</code></pre></li>
<li><p>This code <strong>does not compile</strong> (<em>illegal usage of inline-parameter</em>):</p>
<pre><code>inline fun test(crossinline f: () -> Unit) {
thread(block = f)
}
</code></pre></li>
<li><p>This code <strong>compiles with a warning</strong> (<em>insignificant performance impact</em>):</p>
<pre><code>inline fun test(noinline f: () -> Unit) {
thread { f() }
}
</code></pre></li>
<li><p>This code <strong>compiles with no warning or error</strong>:</p>
<pre><code>inline fun test(crossinline f: () -> Unit) {
thread { f() }
}
</code></pre></li>
</ol>
<p>Here are my questions:</p>
<ul>
<li>How come (2) does not compile but (4) does?</li>
<li>What exactly is the difference between <code>noinline</code> and <code>crossinline</code>?</li>
<li>If (3) does not generates a no performance improvements, why would (4) do?</li>
</ul>
| <kotlin> | 2016-08-08 10:45:37 | HQ |
38,827,889 | Getting the targetdir variable must be provided when invoking this installer while installing python 3.5 | <p>I have Python 2.7 on my Window 7. Problem is with python 3.5 and 3.6 version only.</p>
| <python-3.x><window> | 2016-08-08 11:19:06 | HQ |
38,828,224 | Composer update `The following exception is caused by a lack of memory and not having swap configured` error in vagrant | <p>I got php5.5 with composer installed in a vagrant VirtualBox environment. </p>
<p>When I try any composer's commands the following error appears randomly:</p>
<p><code>The following exception is caused by a lack of memory and not having swap configured</code></p>
<p>How can I get around this ?</p>
| <php><memory><vagrant><composer-php><virtualbox> | 2016-08-08 11:36:50 | HQ |
38,828,396 | Generate Thumbnail of Pdf in Android | <p>I want to generate the image(thumbnail) from pdf file just like done by <strong>WhatsApp</strong> as shown below
<a href="https://i.stack.imgur.com/fVTPy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/fVTPy.jpg" alt="WhatsApp"></a></p>
<p>I have tried</p>
<ol>
<li><strong>PDFBox</strong> (<a href="https://github.com/TomRoush/PdfBox-Android" rel="noreferrer">https://github.com/TomRoush/PdfBox-Android</a>)</li>
<li><strong>Tika</strong> (compile 'org.apache.tika:tika-parsers:1.11')</li>
<li><strong>AndroidPdfViewer</strong> (<a href="https://github.com/barteksc/AndroidPdfViewer" rel="noreferrer">https://github.com/barteksc/AndroidPdfViewer</a>)</li>
</ol>
<p>and still unable to find a way to generate image from pdf.</p>
<hr>
<p><strong><em>PDFBox:</em></strong></p>
<p>There is a github issue that deals with this problem (<a href="https://github.com/TomRoush/PdfBox-Android/issues/3" rel="noreferrer">https://github.com/TomRoush/PdfBox-Android/issues/3</a>) but this is still unresolved.</p>
<p><strong>Note:</strong> I am successfully able to extract image from PDF using <strong>PDFBOX</strong></p>
<hr>
<p><strong><em>AndroidPdfViewer:</em></strong></p>
<p>Github issue (<a href="https://github.com/barteksc/AndroidPdfViewer/issues/49" rel="noreferrer">https://github.com/barteksc/AndroidPdfViewer/issues/49</a>)</p>
| <android><image><pdf><pdfbox> | 2016-08-08 11:45:40 | HQ |
38,828,730 | Manipulating a list with dynamically created controls | <p>Let's say, I have a <code>List<Person> people</code>, where <code>Person</code> is a class containing three strings: a <code>Name</code>, <code>Surname</code> and <code>Age</code>. I also have six dynamically created <code>TextBox</code> controls, that are placed on a <code>Panel</code> control, and have a name assigned to them using a <code>for</code> loop. As well as, dynamically created <code>TextChanged</code> event for said <code>TextBox</code> controls. Currently the <code>List</code> consists of two entries <code>people.Add(new Person { Name = John, Surname = Johnson, Age = 25 });</code> and <code>people.Add(new Person { Name = Jack, Surname = Jackson, Age = 30 });</code>. I need the user to be able to change those <code>List<Person></code> entries, by inputting text in the corresponding <code>Textbox</code>. So, the first <code>TextBox</code> changes the <code>people[0].Name</code>, second - <code>people[0].Surname</code>, third - <code>people[0].Age</code>, fourth - <code>people[1].Name</code>, and so on...</p>
| <c#><winforms> | 2016-08-08 12:03:37 | LQ_CLOSE |
38,829,118 | NodeJS - convert relative path to absolute | <p>In my <em>File-system</em> my working directory is here:</p>
<p><strong>C:\temp\a\b\c\d</strong></p>
<p>and under b\bb there's file: tmp.txt</p>
<p><strong>C:\temp\a\b\bb\tmp.txt</strong></p>
<p>If I want to go to this file from my working directory, I'll use this path:</p>
<pre><code>"../../bb/tmp.txt"
</code></pre>
<p>In case the file is not exist I want to log the full path and tell the user:<br>
<strong>"The file C:\temp\a\b\bb\tmp.txt is not exist"</strong>. </p>
<p><strong>My question:</strong></p>
<p>I need some <strong>function</strong> that <em>convert</em> the relative path: "../../bb/tmp.txt" to absolute: "C:\temp\a\b\bb\tmp.txt" </p>
<p>In my code it should be like this: </p>
<pre><code>console.log("The file" + convertToAbs("../../bb/tmp.txt") + " is not exist")
</code></pre>
| <javascript><node.js><relative-path><absolute-path> | 2016-08-08 12:22:15 | HQ |
38,829,466 | Limitations for Firebase Notification Topics | <p>I want to use Firebase notification for my android application and what i want to know is that is there any limitation for number of topics ? or for the number of users that can subscribe a topic ?
For example can i have 10000 topics with 1 million users for each of them ?</p>
| <firebase><firebase-notifications> | 2016-08-08 12:38:48 | HQ |
38,829,590 | Software design consulting needed (Android Library Project) |
- I have an App with my main Activity ("MainActivity")
- I have a View in a "Android Project Library". I would like to use this view in several Apps, thats why I added this view in a library.
- I can use the view from my App
But now comes the problem.
I would like to interact with my Apps MainActivity from my view.
If the view would be in the app insteed of library I would simply call...
(MainActivity)context.myfunction()
... in my view.
But in case of the library, my view doesn't know about the MainActivity, because its out of the project-scope.
How can I interact with the Activity from my view, which is placed in a library ? Any hints ?
| <android><design-patterns><shared-libraries> | 2016-08-08 12:44:24 | LQ_EDIT |
38,829,734 | File Upload Methods With PHP | <p>I'm going to try image file upload.
Then, I thought there were two choices.
First, I can save the image file into the directory which is not available for viewers.
Second idea is that I can save the image binary data into the database.</p>
<p>Which is better? Or, could you tell me the advantages and disadvantages of these methods?</p>
<p>Finally, I'm going to use CakePHP.</p>
| <php><mysql><cakephp> | 2016-08-08 12:52:11 | LQ_CLOSE |
38,830,467 | function on php file | I have this code that I got from here,
(function() {
var quotes = $(".quotes");
var quoteIndex = -1;
function showNextQuote() {
++quoteIndex;
quotes.eq(quoteIndex % quotes.length)
.fadeIn(2000)
.delay(2000)
.fadeOut(2000, showNextQuote);
}
showNextQuote();
})();
I wanna know how to put it in my index php file cause it's not working , knowing that I'm working on a joomla template and the class quote is on one of the modules ... thanks | <php><jquery><joomla> | 2016-08-08 13:26:27 | LQ_EDIT |
38,830,610 | Access Jupyter notebook running on Docker container | <p>I created a docker image with python libraries and Jupyter.
I start the container with the option <code>-p 8888:8888</code>, to link ports between host and container.
When I launch a Jupyter kernel inside the container, it is running on <code>localhost:8888</code> (and does not find a browser). I used the command <code>jupyter notebook</code></p>
<p>But from my host, what is the IP address I have to use to work with Jupyter in host's browser ? </p>
<p>With the command <code>ifconfig</code>, I find <code>eth0</code>, <code>docker</code>, <code>wlan0</code>, <code>lo</code> ...</p>
<p>Thanks ! </p>
| <python><docker><jupyter-notebook> | 2016-08-08 13:33:01 | HQ |
38,831,479 | HOW TO CALL SAP CRYSTAL REPORT FROM C#.NET CLASS FILE | I am new to crystal report. I donno how to call existing crystal report from my c# class file. I have a method in class file with parameter string **CallCrystal(string num)**. and i have the crystal report in D: drive> Reports folder> **EmployeDetails** which displays the employe detail by passing string input.<br> Now inside the method the code should call crystal report and send this string parameter(num) to crystal report and the report should be printed with employee details. | <c#><.net><oop><crystal-reports> | 2016-08-08 14:10:16 | LQ_EDIT |
38,831,926 | Why Q_ASSERT instead of assert | <p>In Qt there is a <a href="http://doc.qt.io/qt-5/qtglobal.html#Q_ASSERT" rel="noreferrer">Q_ASSERT</a> macro. What's the advantage of using this instead of <a href="http://www.cplusplus.com/reference/cassert/assert/" rel="noreferrer">assert</a> from <code><cassert></code> ?</p>
| <qt><assert><assertions> | 2016-08-08 14:31:53 | HQ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.