小编Som*_*ive的帖子

使用Jack编译器为Android获取未知属性"classpath"

我正在尝试用下一个Jack编译器编译我的项目.我刚刚将Android Studio更新为2.2-Beta,将gradle插件更新为2.14.1.这是我的gradle文件:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0-beta1'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.github.jacobono:gradle-jaxb-plugin:1.3.6'
    }
}


allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

subprojects { project ->
    if(project.name.endsWith("-schema")) {
        apply plugin: 'com.github.jacobono.jaxb'

        dependencies {
            jaxb 'com.sun.xml.bind:jaxb-xjc:2.2.7-b41'
            jaxb 'com.sun.xml.bind:jaxb-impl:2.2.7-b41'
            jaxb 'javax.xml.bind:jaxb-api:2.2.7'
        }
    }
    }

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    dexOptions {
        maxProcessCount 4
        javaMaxHeapSize "2g"
    }

    defaultConfig {
        applicationId "ninja.carre.mbta"
        minSdkVersion 23 …
Run Code Online (Sandbox Code Playgroud)

android android-gradle-plugin

24
推荐指数
1
解决办法
1万
查看次数

react-google-maps“'google' 未定义”错误

我正在创建一个使用 react-google-maps 的网络,但遇到了一堆未定义的错误。我是 react/js 世界的新手,所以任何帮助都将不胜感激。这是确切的错误:

Failed to compile.

./src/App.js
  Line 23:  'lifecycle' is not defined  no-undef
  Line 25:  'google' is not defined     no-undef
  Line 28:  'google' is not defined     no-undef
  Line 29:  'google' is not defined     no-undef
  Line 30:  'google' is not defined     no-undef
  Line 32:  'google' is not defined     no-undef
Run Code Online (Sandbox Code Playgroud)

这是代码:

import React, { Component } from 'react';
import './App.css';
import { compose, withProps } from "recompose"
import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps"
const MapWithDirections = …
Run Code Online (Sandbox Code Playgroud)

google-maps reactjs

12
推荐指数
2
解决办法
1万
查看次数

INSERT语句与FOREGIGN KEY约束冲突

我是一个绿色的asp.net开发人员,我正在使用我的项目的最新实体框架.我有一个问题是使用自动生成的值为我的数据库播种(我认为).这是确切的错误.

在此输入图像描述

这是代码:

public class Address
{
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int AddressId { get; set; }
// some more properties
}

public class ApplicationUser : IdentityUser
{
        [ForeignKey("Address")]        
    public int AddressId { get; set; }
    public Address Address { get; set; }

// some more properties
}

public class Shelter
{
        [Required]
        [ForeignKey("Address")]
        public int AddressId { get; set; }
        public Address Address { get; set; }
// some more properties
}
//seed
private void CreateShelters()
{
    EntityEntry<Address> MspcaAddress = DbContext.Addresses.Add(new …
Run Code Online (Sandbox Code Playgroud)

asp.net entity-framework entity-framework-core

9
推荐指数
1
解决办法
337
查看次数

使用未申报的板条箱或模块

当我serde从文件中读取 json 时,出现以下错误:

Failed to resolve: use of undeclared crate or module serde_json

这是代码:

use serde::Deserialize;


fn main() {
  let file = fs::File::open("./feed.json")
      .expect("file should open read only");
  let reader = BufReader::new(file);
  let json = serde_json::from_reader(reader)
      .expect("file should have FirstName key");
  let feed_url = json.get("2.0")
      .expect("file should have FirstName key");
  println!("{}", reedFeed(feed_url));
}
Run Code Online (Sandbox Code Playgroud)

是有关此功能的文档。我在 ubuntu 上并使用 intellij 作为我的 ide。我在这里缺少什么?

rust

7
推荐指数
1
解决办法
2万
查看次数

为什么我会收到这些"已经定义"的链接器错误?

我是C++的初学者,但我有一些使用Java的经验.我收到一些我不明白的错误.我附上了错误控制台的图片和它下面的代码.

 Error  1   error LNK2005: "public: __thiscall VectorDouble::VectorDouble(void)" (??0VectorDouble@@QAE@XZ) already defined in Main.obj  C:\Users\carrea\Code\Visual Studio\COMP201\Lab8_VectorDoubleClass\VectorDouble.obj  Lab8_VectorDoubleClass

 Error  2   error LNK2005: "public: __thiscall VectorDouble::VectorDouble(int)" (??0VectorDouble@@QAE@H@Z) already defined in Main.obj  C:\Users\carrea\Code\Visual Studio\COMP201\Lab8_VectorDoubleClass\VectorDouble.obj  Lab8_VectorDoubleClass
....    
Run Code Online (Sandbox Code Playgroud)

还有10个像这样的错误

 Error  13  error LNK1169: one or more multiply defined symbols found   C:\Users\carrea\Code\Visual Studio\COMP201\Lab8_VectorDoubleClass\Debug\Lab8_VectorDoubleClass.exe  1   1   Lab8_VectorDoubleClass
Run Code Online (Sandbox Code Playgroud)

Main.cpp的


#include "VectorDouble.cpp"
using namespace std;
void printVD(const VectorDouble& v);
int main()
{
    VectorDouble p;
    p.push_back(1);
    p.push_back(4);
    p.push_back(3);
    VectorDouble v(p);
    printVD(v);
    printVD(p);
}
void printVD(const VectorDouble& v)
{
    int n = …
Run Code Online (Sandbox Code Playgroud)

c++ linker

6
推荐指数
2
解决办法
3万
查看次数

Google Protobuf 格式错误:输入在字段中间意外结束

我正在使用google protobuf parser解析GftsRealtime feed 。这是我遇到的确切错误: 首先想到的是文件的完整性在下载时受到损害,但我将 Android 模拟器中的文件与我在桌面上下载的文件进行检查,结果是相同的。以前有人遇到过这个问题吗?我正在使用gfts-realtime-parser版本“ 0.0.4” 。饲料在这里com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.

编辑 - -

这是我用来下载文件的代码:

override fun doInBackground(vararg urls: URL): Boolean? {
        val httpClient = OkHttpClient()
        val call = httpClient.newCall(Request.Builder().url(urls[0]).get().build())
        val urlStr = urls[0].toString()
        val fileName = urlStr.substring(urlStr.lastIndexOf('/') + 1, urlStr.length) …
Run Code Online (Sandbox Code Playgroud)

java protocol-buffers

6
推荐指数
1
解决办法
2万
查看次数

有 Rust 解释器吗?

我刚开始使用 Rust 并想知道:是 Rust 解释器吗?有了解释器,Rust 编译器就不需要在每次调用时都编译所有的源文件,而只会在代码发生变化时进行解释。这就是 JavaScript 和 Python 没有真正的编译时间的原因。

使用 Rust 进行增量编译,但大型项目仍然很慢。对于 Web IMO,使用 Rust 开发 GUI 将是一个福音。

computer-science interpreter compilation rust

6
推荐指数
3
解决办法
3059
查看次数

重新启动 JBoss/Keycloak docker 容器时出错

我正在使用Jboss docker 映像(v.4.0.0.final)设置 keycloak 服务器,并且在重新启动时遇到此错误:

.....
keycloak_1  |   at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:370)
keycloak_1  |   at java.lang.Thread.run(Thread.java:748)
keycloak_1  | 
keycloak_1  | 18:51:15,509 ERROR [org.jboss.as.controller.client] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@52734583 for operation add-deployer-chains at address [] failed handling operation rollback -- java.util.concurrent.RejectedExecutionException: Task org.jboss.as.controller.notification.NotificationSupports$NonBlockingNotificationSupport$1@2211e00e rejected from java.util.concurrent.ThreadPoolExecutor@41133ff1[Shutting down, pool size = 50, active threads = 43, queued tasks = 0, completed tasks = 93]
keycloak_1  | docker_keycloak_1 exited with code 1
Run Code Online (Sandbox Code Playgroud)

当我第一次运行 docker 容器时,一切都按计划进行。我可以登录、创建角色等。我使用jhipster的 keycloak 脚本启动容器:

version: '2'
services: …
Run Code Online (Sandbox Code Playgroud)

docker keycloak

5
推荐指数
0
解决办法
2857
查看次数

分配给堆与堆栈的执行时间有什么不同?

在我的作业中我对这个问题有点困惑: 用C或C++编写三个函数:一个静态地声明一个大数组,一个在堆栈上声明相同的大数组,一个从堆中创建相同的大数组.每次调用每个子程序{至少100,000次}并输出每个子程序所需的时间.解释结果.

    int main(void)  
{
    int staticIntArray[ARRAY_SIZE];//array on the stack
    int *ptrArray = new int[ARRAY_SIZE]; // pointer on the stack but array on the heap.
    double timeItTakes;
    clock_t tStart = clock();
    fillWithRandomNumbers(staticIntArray, ARRAY_SIZE);
    double time = static_cast<double>(clock() - static_cast<double>(tStart)/static_cast<double>(CLOCKS_PER_SEC));
    printf ("Array on stack time is %.10f\n", time);
    clock_t tStart2 = clock();
    fillWithRandomNumbers(ptrArray, ARRAY_SIZE);
    double time2 = static_cast<double>(clock() - static_cast<double>(tStart2)/static_cast<double>(CLOCKS_PER_SEC));
    printf ("Array on heap time is %.10f\n", time2);
    //cout << "Array on the heap time is " << (timeIntStack - time(NULL)); …
Run Code Online (Sandbox Code Playgroud)

c++ performance

3
推荐指数
1
解决办法
2078
查看次数

在 React 项目中部分加载的传单地图

我正在尝试在 react 组件中实现一个简单的 Leaflet 地图。由于某种原因,地图的图块没有加载或以随机顺序加载。有没有其他人经历过这种情况?

这是应用程序的 CodeSandbox:https ://codesandbox.io/s/3qmp8x4131

这是代码:

import React from "react";
import ReactDOM from "react-dom";
import * as L from "leaflet";

export default class Map extends React.Component {
  map = null;
  componentDidMount() {
    var map = (this.map = L.map(ReactDOM.findDOMNode(this), {
      minZoom: 2,
      maxZoom: 20,
      layers: [
        L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
          attribution:
            '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
        })
      ],
      attributionControl: false
    }));

    map.on("click", this.onMapClick);
    map.fitWorld();
  }

  componentWillUnmount() {
    if (!this.map) return;
    this.map.off("click", this.onMapClick);
    this.map = null;
  }

  onMapClick = …
Run Code Online (Sandbox Code Playgroud)

leaflet reactjs webpack

3
推荐指数
1
解决办法
1190
查看次数

jhipster/spring boot - 尝试代理请求时出错

当我尝试运行 jhipster 生成的 react webapp 时,我收到了一堆 nodejs 错误。我正在macos使用node 10.4.1和运行这个项目yarn 1.7.0。这是确切的错误:

[HPM] Error occurred while trying to proxy request /api/account from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /management/info from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /api/account from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /api/account from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while …
Run Code Online (Sandbox Code Playgroud)

security spring node.js jhipster

1
推荐指数
1
解决办法
5201
查看次数