小编djt*_*oms的帖子

在Travis-CI上,gradlew组装失败

我正试图让一个私人构建在Travis-Ci Pro上表现,但它一直在抱怨因为./gradlew assemble失败了.这是完整的日志:

Using worker: worker-linux-docker-4002cef1.prod.travis-ci.com:travis-linux-15

travis_fold:start:system_info
[0K[33;1mBuild system information[0m
Build language: java
Build group: stable
Build dist: precise
[34m[1mBuild image provisioning date and time[0m
Thu Feb  5 15:09:33 UTC 2015
[34m[1mOperating System Details[0m
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
[34m[1mLinux Version[0m
3.13.0-29-generic
[34m[1mCookbooks Version[0m
a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e
[34m[1mGCC version[0m
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO …
Run Code Online (Sandbox Code Playgroud)

java gradle travis-ci

14
推荐指数
3
解决办法
4753
查看次数

IE 8自动关闭<header>标记

背景

我目前正致力于响应式网站的最终质量保证,我遇到了IE 8和IE 7的问题.我的客户处理政府合同,因此他们的网站需要与IE 8和IE 7兼容.我使用的是Modernizr内置html5shiv.我在为该项目定制的WordPress主题的页脚中加载Modernizr .我没有错过doctype或任何其他明显的代码.

我使用以下脚本,所有这些脚本都加载到WordPress的页脚中:

情况

我遇到IE 8自动关闭<header>标签的问题.首先,我使用了两个实用程序来检查此问题:

  1. IETester
  2. IE 11模拟到IE 8 w/IE 8用户代理

这是正确的输出

<div class="wrapper main-header">
    <header class="container">
        <div class="sixteen columns alpha omega">
            <div class="eight columns alpha omega logo"> <a href="http://example.com"><img src="http://example.com/wp-content/uploads/2013/10/logo.png" alt="Example"></a> </div>
            <div class="wrapper main-navigation desktop">
                <nav id="nav" class="six columns alpha omega">
                    ...
                </nav>
                <div class="eight columns alpha omega overlay" style="display: none;"> …
Run Code Online (Sandbox Code Playgroud)

html javascript wordpress jquery internet-explorer

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

将正则表达式传递给perl子例程

情况

我正在创建一个简单的模板文件,这将有助于创建未来的脚本,以便通过*nix系统上的命令行执行各种任务.作为其中的一部分,我可能要求用户输入需要根据源代码中提供的正则表达式进行验证的数据.

问题

当我尝试通过命令行运行Perl代码时,会开始生成错误.我试图将正则表达式传递给repeat子例程,我不确定如何正确执行此操作.我知道我可以使用eval执行一个字符串,但是由于约定,这是我想要避免的.

错误:

Use of uninitialized value $_ in pattern match (m//) at scripts/template line 40.
Use of uninitialized value $resp in concatenation (.) or string at scripts/template line 37.
Run Code Online (Sandbox Code Playgroud)

代码:

#!/usr/bin/env perl

use strict;
use warnings;
use Cwd;
use Term::ANSIColor;
use Data::Dumper;

my $log = "template.log";
my $task = "template";
my $cwd = getcwd();
my $logPath = $cwd . "/". $log;

print ucfirst($task) . " utility starting...\n";
system("cd ~/Desktop");
system("touch " . $log);
&writeLog("Test");

sub …
Run Code Online (Sandbox Code Playgroud)

regex parameters perl function subroutine

10
推荐指数
2
解决办法
5341
查看次数

getResource()使用Gradle项目返回null

我知道还有其他一些问题......

但我的问题似乎有点不同,因为我似乎有所有必要的事情没有这个问题.

代码:

 this.getClass().getResource("checkstyle_whitespace.xml"); // null
Run Code Online (Sandbox Code Playgroud)

问题是我通过检查调试器中的类加载器来验证我的类路径.这就是我所看到的:

 27 = {URL@1235} "file:/Users/dennis/Documents/Development/java/java-grader/build/classes/main/"
 28 = {URL@1236} "file:/Users/dennis/Documents/Development/java/java-grader/build/resources/main/"
Run Code Online (Sandbox Code Playgroud)

Blow是tree我的目录结构的一个快速.见build/resourcessrc/main/resources.当gradle构建我的项目时,正在复制文件.

??? build
?   ??? classes
?   ?   ??? main
?   ?   ?   ??? javaGrader
?   ?   ??? test
?   ?       ??? javaGraderTest
?   ??? resources
?       ??? main
?           ??? checkstyle_whitespace.xml
?           ??? grammars
??? src
?   ??? main
?   ?   ??? java
?   ?   ?   ??? javaGrader
?   ?   ??? resources …
Run Code Online (Sandbox Code Playgroud)

java resources classpath gradle

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

使用Sass将循环内部的选择器分组

问题

我现在正在泡菜.我需要在Sass循环中对选择器进行分组.我已尝试过许多不同的方法来做到这一点,例如:

body {
    $store: null;
    @for $i from 1 through 10 {
        $store: append($store, ".offset-by-#{$i}", comma);
    }
    // produces content: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
    @each $j in $store {
        $store: unquote($j);
    }
    // produces .offset-by-10
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用纯Sass(没有Ruby)实现的目标如下:

.offset-by-1,
.offset-by-2,
.offset-by-3,
...
.offset-by-10 { foo: bar; }
Run Code Online (Sandbox Code Playgroud)

如果你是萨斯神,请告诉我这里要做什么.如果这是元语言的固有限制,那么请告诉我这一点!

注意事项

我不能使用mixin之外的任何东西来实现这一点,因为函数应该用在属性值上.另一方面,Mixins允许生成整个代码块.

loops sass

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

Google_Service_Directory - (403)未授权访问此资源/ api

我只是使用PHP api的实际版本的示例,并使用examples文件夹的"service-account.php"文件.

原始版本用于显示"Books API",并且使用我的个人凭据配置它运行良好,但在我的xcase中,我需要通过directory.groups.get服务访问以获取Google群组邮件列表的成员帐户列表,所以我改变了原来的代码:

<?php

session_start();
include_once "templates/base.php";

/************************************************
  Make an API request authenticated with a service
  account.
 ************************************************/
require_once realpath(dirname(__FILE__) . '/../autoload.php');

/************************************************
 ************************************************/

// MY ACCOUNT DATA HERE
$client_id = 'xxx';
$service_account_name = 'xxx'; //Email Address 
$key_file_location = 'xxx.p12'; //key.p12
$groupKey = 'xxx';

echo pageHeader("My Service Account Access");
if ($client_id == '<YOUR_CLIENT_ID>'
    || !strlen($service_account_name)
    || !strlen($key_file_location)) {
  echo missingServiceAccountDetailsWarning();
}

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
//$service = new Google_Service_Books($client); //ORIGINAL
$service = new Google_Service_Directory($client);

/************************************************
 ************************************************/
if (isset($_SESSION['service_token'])) …
Run Code Online (Sandbox Code Playgroud)

php api google-api-php-client google-admin-sdk

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

如何在PHP中使用"application/octet-stream"接收发送的POST数据?

这就是我正在处理的事情.我们的一个程序有一个用户用来请求支持的支持表单.这个表单的作用是,它对PHP脚本执行HTTP POST请求,该脚本应该收集信息并将其转发到支持电子邮件地址.

POST请求包含三个类型的文本字段Content-Type: text/plain,可以使用PHP轻松读取$_POST['fieldname'].但是,此POST请求中的某些内容是文件类型Content-Type: application/octet-stream.使用$_POST似乎不适用于这些文件.我如何阅读这些文件的内容?

先感谢您.

html php post file request

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

如何使用docker和elasticsearch镜像避免CORS源错误

我设法通过使用 docker 设置 apache Web 服务器来使用模块来绕过 CORS 源错误客户端。尽管如此,当我将 elasticsearch 服务添加到我的 docker-compose 并尝试从中获取 json 响应时,我仍然拥有它。它显示“跨源请求被阻止:同源策略不允许读取 http://localhost:9200/ 处的远程资源”

我的码头工人组成:

version: '2'

services:
  apache:
    image: 'bitnami/apache:latest'
    ports:
      - '80:8080'
      - '443:8443'
    volumes:
      - .:/app
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic

volumes:
  data01:
    driver: local


networks:
  elastic:
    driver: bridge
Run Code Online (Sandbox Code Playgroud)

我的index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body> …
Run Code Online (Sandbox Code Playgroud)

cors elasticsearch docker-compose

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

在构建期间使用打字稿转换环境变量

尝试找到一种干净的方法来process.env使用tsc. 基本上我试图使用打字稿编译器来实现babel-plugin-transform-inline-environment-variables所做的事情。

网络上的大多数问题都涉及让编译器正常运行,其他解决方案推荐使用诸如存储环境变量以供以后使用之process.env类的工具。dotenv

当环境变量不包含敏感信息时,这特别有用。例子:

export const VERSION = process.env.VERSION;
Run Code Online (Sandbox Code Playgroud)

建造:

export const VERSION = process.env.VERSION;
Run Code Online (Sandbox Code Playgroud)

期望的输出:

VERSION='1.2.3' npx tsc --project tsconfig.json
Run Code Online (Sandbox Code Playgroud)

typescript

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

Zillow API 一般搜索

我在使用 Zillow API 时遇到了一些问题:

  • 查询API
  • 获取特定数据

查询问题

问题是我似乎找不到使用 Zillow API 进行一般搜索的方法,例如按邮政编码进行搜索。这是来自深度搜索的示例查询:

<SearchResults:searchresults xsi:schemaLocation="http://www.zillow.com/static/xsd/SearchResults.xsd http://www.zillowstatic.com/vstatic/419b583f682a74b83f007039dd9c49f8/static/xsd/SearchResults.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SearchResults="http://www.zillow.com/static/xsd/SearchResults.xsd">
    <request>
        <address>15096 Oak Creek Rd</address>
        <citystatezip>El Cajon, CA</citystatezip>
    </request>
    <message>
        <text>Request successfully processed</text>
        <code>0</code>
    </message>
    <response>
        <results>
            <result>
                <zpid>16893601</zpid>
                <links>
                    <homedetails>http://www.zillow.com/homedetails/15096-Oak-Creek-Rd-El-Cajon-CA-92021/16893601_zpid/</homedetails>
                    <graphsanddata>http://www.zillow.com/homedetails/15096-Oak-Creek-Rd-El-Cajon-CA-92021/16893601_zpid/#charts-and-data</graphsanddata>
                    <mapthishome>http://www.zillow.com/homes/16893601_zpid/</mapthishome>
                    <comparables>http://www.zillow.com/homes/comps/16893601_zpid/</comparables>
                </links>
                <address>
                    <street>15096 Oak Creek Rd</street>
                    <zipcode>92021</zipcode>
                    <city>El Cajon</city>
                    <state>CA</state>
                    <latitude>32.86576</latitude>
                    <longitude>-116.847964</longitude>
                </address>
                <FIPScounty>6073</FIPScounty>
                <useCode>SingleFamily</useCode>
                <taxAssessmentYear>2012</taxAssessmentYear>
                <taxAssessment>496002.0</taxAssessment>
                <yearBuilt>2006</yearBuilt>
                <lotSizeSqFt>108900</lotSizeSqFt>
                <finishedSqFt>2700</finishedSqFt>
                <bathrooms>3.0</bathrooms>
                <bedrooms>3</bedrooms>
                <totalRooms>7</totalRooms>
                <lastSoldDate>03/22/1999</lastSoldDate>
                <lastSoldPrice currency="USD">268000</lastSoldPrice>
                <zestimate>
                    <amount currency="USD">581783</amount>
                    <last-updated>05/12/2013</last-updated>
                    <oneWeekChange deprecated="true"/>
                    <valueChange duration="30" currency="USD">12050</valueChange>
                    <valuationRange>
                        <low currency="USD">523605</low> …
Run Code Online (Sandbox Code Playgroud)

xml api zillow

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