我在Android Studio 2.2 Preview 1中使用Android App和Backend模块在Google Messaging中创建了一个新项目.这是应用程序文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
compile project(path: ':backend', configuration: 'android-endpoints')
}
Run Code Online (Sandbox Code Playgroud)
但它给了:
错误:与依赖项'com.google.code.findbugs:jsr305'冲突.app(1.3.9)和测试app(2.0.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.
我是Android的新手,无法找到这个错误.我如何解决它?
gradle google-cloud-messaging android-studio build.gradle android-gradle-plugin
splice和之间有什么区别slice?
$scope.participantForms.splice(index, 1);
$scope.participantForms.slice(index, 1);
Run Code Online (Sandbox Code Playgroud) 我正在构建一个应用程序,我希望通过默认的相机活动捕获图像并返回到我的活动并在ImageView中加载该图像.问题是相机活动总是返回null.在我的onActivityResult(int requestCode, int resultCode, Intent data)方法中,我得到数据null.这是我的代码:
public class CameraCapture extends Activity {
protected boolean _taken = true;
File sdImageMainDirectory;
Uri outputFileUri;
protected static final String PHOTO_TAKEN = "photo_taken";
private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
setContentView(R.layout.cameracapturedimage);
File root = new File(Environment
.getExternalStorageDirectory()
+ File.separator + "myDir" + File.separator);
root.mkdirs();
sdImageMainDirectory = new File(root, "myPicName");
startCameraActivity();
} catch (Exception e) {
finish();
Toast.makeText(this, "Error occured. Please try again …Run Code Online (Sandbox Code Playgroud) 我想通过icrontab在Linux上安排任务,并且任务是用python编写的,必须导入cx_Oracle模块,所以我导出ORACLE_HOME并LD_LIBRARY_PATH在.bash_profile中,但它引发了错误:
libclntsh.so.11.1:无法打开共享对象文件.
因为可以通过在shell中发出命令来运行任务,如:
python a.py # ok
Run Code Online (Sandbox Code Playgroud)
我将icrontab中的任务更改为一个调用我的Python脚本的shell脚本,但异常重现了吗?
# the shell script scheduled in icrontab
#! bash
python a.py
Run Code Online (Sandbox Code Playgroud)
你能帮忙怎么做吗?
考虑以下WorkExperience课程:
public class WorkExperience {
private int year;
private List<Skills> skill;
public WorkExperience(int year, List<Skills> skill) {
this.year = year;
this.skill = skill;
}
//getter setter
}
public class Skills {
private String skills;
public Skills(String skills) {
this.skills = skills;
}
@Override
public String toString() {
return "Skills [skills=" + skills + "]";
}
}
Run Code Online (Sandbox Code Playgroud)
假设我希望按年份按照我的技能进行分组,这就是我们groupBy今年的表现:
public static void main(String[] args) {
List<Skills> skillSet1 = new ArrayList<>();
skillSet1.add(new Skills("Skill-1"));
skillSet1.add(new Skills("Skill-2"));
skillSet1.add(new Skills("Skill-3"));
List<Skills> skillSet2 …Run Code Online (Sandbox Code Playgroud) 我已经部署了我的应用程序大约3个月了,但我仍然看到不同的SSL证书.此外,它似乎已使用不同的域更新它.这仍然正常吗?如果是,那么完成配置通常需要多长时间?有没有办法使用我自己的证书?...因为它毕竟只是使用LetsEncrypt.
域名连接:

域不匹配:

任何的想法?
我一直在使用Glassfish 4作为我的服务器.我正在使用以下语句打开WebSocket连接:
webSocket = new WebSocket(link);
Run Code Online (Sandbox Code Playgroud)
哪里:
link = 'ws://localhost:8080/CollabEdit/Document/file333B1CDF85-DDDC-E411-8299-F82FA8BE8622';
Run Code Online (Sandbox Code Playgroud)
并在服务器文件中:
@ServerEndpoint(value="/file333B1CDF85-DDDC-E411-8299-F82FA8BE8622", encoders = {MessageEncoder.class}, decoders = {MessageDecoder.class})
Run Code Online (Sandbox Code Playgroud)
实际上,我一直在使用URL映射,这个" file333B1CDF85-DDDC-E411-8299-F82FA8BE8622 "实际上是针对用户的,但是在后端,控件位于" main.jsp "文件中.在执行期间,生成的错误是:
WebSocket connection to 'ws://localhost:8080/CollabEdit/Document/file333B1CDF85-DDDC-E411-8299-F82FA8BE8622' failed: Error during WebSocket handshake: Unexpected response code: 200
Run Code Online (Sandbox Code Playgroud)
GlassFish服务器中的异常StackTrace:
SEVERE: WebModule[/CollabEdit]Exception starting filter WebSocket filter
java.lang.InstantiationException
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:135)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5297)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5909)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) …Run Code Online (Sandbox Code Playgroud) 我希望这段代码能够纵向和横向集中内容.它就是这样,但是一旦我使窗口变小(移动尺寸),文本的(h1和p)对齐就会变为左边.
我错过了非常基本的东西吗?我可以说它text-center有效,但我不想自己添加任何CSS样式.
angular.module('app', ['ngMdIcons', 'ngMaterial']);Run Code Online (Sandbox Code Playgroud)
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.10.0/angular-material.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=RobotoDraft:300,400,500,700,400italic">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://login.persona.org/include.js"></script>
<script src="https://code.angularjs.org/1.4.0/angular.js"></script>
<script src="https://code.angularjs.org/1.4.0/angular-route.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.10.0/angular-material.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-material-icons/0.5.0/angular-material-icons.min.js"></script>
</head>
<body layout="column" ng-app="app">
<div layout="row" flex layout-align="center center">
<div layout="column" layout-align="center">
<h1>Welcome to Dreamland!</h1>
<md-button class="md-hue-2 md-raised md-primary" >
<h1 class="md-display-1">Login</h1>
</md-button>
<p class="md-caption">This web site uses your membership with the given email address.</p>
</div>
</div>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
我有一个需要一段时间才能加载的组件.实际上,它是一个加载<iframe>另一个网站的组件,需要一段时间才能加载.
我希望组件能够挂载,因此运行加载iframe的componentDidMount代码块,这样当用户点击"创建"选项卡时,用户立即<main>在页面的正确部分看到iframe .
有没有办法指示react-router 预加载组件,同时在路由更改时保留相同的条件呈现逻辑并保留呈现组件页面上的位置?
这是我目前render()在应用程序根目录上的声明,为您提供一些上下文:
render() {
return (
<div className="App">
<Nav />
<Snackbar
open={this.props.snackbar.get().open}
message={this.props.snackbar.get().message}
autoHideDuration={4000}
onRequestClose={() => this.handleSnackbarRequestClose()}
/>
<TreeViewer />
<PayloadListener/>
<main>
<ThankYouModal open={this.props.showConfirmationModal.get()} handleClose={ () => this.props.showConfirmationModal.set(false) }/>
<Switch>
<Route path="/imageservices" component={ImageServicesController} />
<Route path="/create" component={Iframe} />
<Route exact path="/account" component={Account} />
<Route exact path="/analytics" component={AnalyticsController} />
<Route path="/support" component={SupportView} />
<Route path='/login' render={ (props) => <Login { ...props } /> } />
<Route path='/logout' render={ (props) => …Run Code Online (Sandbox Code Playgroud) 如果我有一个清单,请说:
lst = ['foo', 'bar', '!test', 'hello', 'world!', 'word']
Run Code Online (Sandbox Code Playgroud)
如果有一个字符!,我将如何返回给出的列表:
lst = ['foo', 'bar', ['test', 'hello', 'world'], 'word']
Run Code Online (Sandbox Code Playgroud)
我很难找到解决方案.这是我尝试过的一种方法:
def define(lst):
for index, item in enumerate(lst):
if item[0] == '!' and lst[index+2][-1] == '!':
temp = lst[index:index+3]
del lst[index+1:index+2]
lst[index] = temp
return lst
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.