小编dj_*_*ido的帖子

无法使用Travis CI/Android SDK v20上的支持库构建

我希望这不应该太具有挑战性,但是:

目前我正在尝试在Android/Travis CI中构建一个项目,你可以在这里找到它.我正在尝试使用Android L开发人员预览版,并使用Travis-CI进行构建.我希望使用Gradle SDK Manager插件可以让我这样做.不幸的是,事实并非如此.我不知道我的build.gradle文件是否设置不正确,或者是什么,但我希望有人能指出我正确的方向.

构建错误:

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':app'.

    > Could not resolve all dependencies for configuration ':app:_testConfigDebugCompile'.
        > Could not find any version that matches com.android.support:appcompat-v7:20.+.

Required by:

MinimalBible:app:unspecified
Run Code Online (Sandbox Code Playgroud)

build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
    }
}

apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion '20.0.0'
    defaultConfig {
        applicationId 'org.bspeice.minimalbible'
        minSdkVersion …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio

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

联系ResourceManager时,纱线容器的主机名错误

我正在尝试在Hive中编写一个简单的查询(只是一个INSERT),但是我对如何配置MapReduce作业有疑问。容器已正确分配,但我的作业永远无法运行。

在此处输入图片说明

看来他们联系不正确。我已经验证(通过JPS)我的ResourceManager确实正在运行,并且正在hadoop1.personal所有服务器在/ etc / hosts中都有引用的主机名上运行。问题看起来像这样:

2016-09-27 09:41:55,223 INFO [main] org.apache.hadoop.ipc.CallQueueManager: Using callQueue class java.util.concurrent.LinkedBlockingQueue
2016-09-27 09:41:55,224 INFO [Socket Reader #1 for port 45744] org.apache.hadoop.ipc.Server: Starting Socket Reader #1 for port 45744
2016-09-27 09:41:55,230 INFO [IPC Server Responder] org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2016-09-27 09:41:55,230 INFO [IPC Server listener on 45744] org.apache.hadoop.ipc.Server: IPC Server listener on 45744: starting
2016-09-27 09:41:55,299 INFO [main] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: nodeBlacklistingEnabled:true
2016-09-27 09:41:55,300 INFO [main] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: maxTaskFailuresPerNode is 3
2016-09-27 09:41:55,300 INFO [main] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: blacklistDisablePercent is …
Run Code Online (Sandbox Code Playgroud)

hadoop hadoop-yarn hadoop2

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

Haskell Prime测试混乱

所以我对Haskell完全不熟悉,希望它不会显示太多.无论如何,我试图创建一个函数来确定一个数字是否为素数.基本思路是这样的:给定一个数字,看看它是否可被任何小于它的任何其他数字整除.如果是,则返回false.如果不是,它是素数,返回真实.到目前为止的代码(已知有效)是这样的:

divisible :: Integer -> Integer -> Bool
divisible x 2 = even x
divisible x y = ((x `mod` y) /= 0) && not (divisible x (y-1))
isPrime :: Integer -> Bool
isPrime x = not (even x) && not (divisible x (x-1))
Run Code Online (Sandbox Code Playgroud)

生产:

ghci> isPrime 9
False
ghci> isPrime 13
True
Run Code Online (Sandbox Code Playgroud)

我想做的是稍微优化一下,因为我只需要检查小于或等于sqrt(x)的值.问题是,当我尝试实现这个时,东西变得疯狂:

isPrime x = not (even x) && not (divisible x (ceiling(sqrt(fromIntegral(x-1)))))
Run Code Online (Sandbox Code Playgroud)

除了它看起来很糟糕的事实(我说我是新的),它没有给出正确的结果:

ghci> isPrime 9
False
ghci> isPrime 13
False
Run Code Online (Sandbox Code Playgroud)

我想弄清楚改变了什么,因为:

ghci> ceiling(sqrt(13))
4
Run Code Online (Sandbox Code Playgroud)

似乎给了我正确的号码.我知道这是一个小问题,但我很困惑......

haskell primality-test

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