我注意到Eclipse会在注释中输出不同的格式:
/* Eclipse prints it in green 
*/
或者如果你写:
/** Eclipse prints it in blue
*/
这两种评论有什么区别?
我已经安装了LeakCanary以查看我的应用是否有内存泄漏.
它看起来如此,但我无法阅读日志,任何人都可以告诉我如何,或给我不能找到的好教程???
在github的doc中,它说:
获得泄漏跟踪后,确定路径中的哪个引用不应存在.然后弄清楚为什么该引用仍然存在.
但我不知道该怎么做.
TX!
这是我的日志.
In com.myapp.mobile:1.3:33.
* LEAK CAN BE IGNORED.
* com.myapp.mobile.SplashScreen has leaked:
* GC ROOT static android.view.ViewConfiguration.
* references android.util.SparseArray.mValues
* references array java.lang.Object[].[0]
* references android.view.ViewConfiguration.mContext
* leaks com.myapp.mobile.SplashScreen instance
[ 07-17 14:59:07.213 32231:  770 D/LeakCanary ]
* Device: samsung samsung SGH-I337M jflteub
* Android Version: 4.4.2 API: 19 LeakCanary: 1.3.1
* Durations: watch=5014ms, gc=155ms, heap dump=1322ms, 
[ 07-17 14:59:07.213 32231:  770 D/LeakCanary ]
* Class android.view.ViewConfiguration
|   static $staticOverhead = …我在哪里做管道:
#!/bin/groovy
pipeline {
    agent none
    environment {
        agent any
        INSTANCE_NAME = "Jenk"
  }
  stages {
    stage("Print Debug Vars"){
        steps {
            sh 'echo "INSTANCE_NAME is $INSTANCE_NAME"'
        }
    }
    stage("Git Checkout") {
        agent { label 'docker' }
        steps  {
            // ...
            }
      }
    }
    stage("Ansible Galaxy"){
        agent { label 'ansible' }
        steps  {
            // ...
            }
    }
  }
}
问题我,如果我把
agent any
在环境部分,它说:
WorkflowScript: 6: "agent any" is not a valid environment expression. Use "key = value" pairs with valid Java/shell …我正在使用 Dockerfile 构建一个 elasticsearch 镜像:
FROM alpine:latest
RUN apk update \
    && apk upgrade \
    && apk add curl wget bash openssl openjdk8 \
    && rm -rf /var/cache/apk/*
WORKDIR /root/
RUN wget -e use_proxy=yes https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.tar.gz -O elasticsearch-6.1.1.tar.gz
RUN tar -xf  elasticsearch-6.1.*.tar.gz -C /usr/local/ \
    && mv /usr/local/elasticsearch-6.1* /usr/local/elasticsearch \
    && mkdir /usr/local/elasticsearch/logs \
    && mkdir /usr/local/elasticsearch/data \
    && echo '-Xms512m' > /usr/local/elasticsearch/config/jvm.options \
    && echo '-Xmx512m' >> /usr/local/elasticsearch/config/jvm.options \
    && adduser -D -u 1000 -h /usr/local/elasticsearch elasticsearch \
    && chown …在我的应用程序中,我已经成功发出了GET,POST和DELETE请求,但这是我的第一个PUT查询。我还检查了我的API是否可以直接从邮递员查询。
因此,它似乎与Angular有关,这是我的代码:
const httpOptions = {
  headers: new HttpHeaders({'Content-Type': 'application/json'})
};
export class TournamentService {
  update(tournament: Tournament, tab: string): Observable<any> {
      const tournamentUrl = this.tournamentsUrl + tournament.slug;
      console.log(tournamentUrl); // URL is OK
      return this.http.put(tournamentUrl, tournament, httpOptions).pipe(
        catchError(this.handleError<any>('updateTournamentGeneral'))
      );
    }
  }
我收到CORS错误消息:
Failed to load https://api.kz-api.test/tournaments/fake-tournoi: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
Blocked current origin from receiving cross-site document at https://api.kz-api.test/tournaments/fake-tournoi with MIME type text/html.
但对于我来说,我明确要求MIME类型为 application/json
这是我在Lumen上API方面的中间件代码:
class CorsMiddleware
{ …我有一个模板驱动的形式:
<form #form="ngForm" (ngSubmit)="onSubmit()">
      <input class="form-control input-lg" id="venue_name" name="venue_name" type="text" #venue_name="ngModel"
             [(ngModel)]="tournament.venue.venue_name" required>
      <input id="address" name="address" placeholder="search for location" required #address="ngModel"
             type="text" class="form-control input-lg" #search [(ngModel)]="tournament.venue.address">
</form>
在我的组件中,我有:
@ViewChild(NgForm) ngForm: NgForm;
在我的测试中,我有:
fixture = TestBed.createComponent(TournamentEditVenueComponent);
comp = fixture.componentInstance;
form = comp.ngForm.form;
console.log(form);
我可以在Chrome控制台中看到:
FormGroup {venue_name: FormControl, address: FormControl, details: FormControl, country_id: FormControl}
所以表格似乎是可以达到的
但当我试图与它达成时
    console.log(form.controls);
要么
    console.log(form.controls['venue_name']);
第一个是空的,第二个是未定义的.
为什么?我应该怎么做?
按照以下文档:https: //angular.io/guide/deployment
我做了:
ng build --prod --output-path docs --base-href https://v2.kendozone.com
它有效,但每次我刷新页面时,https://v2.kendozone.com/都会更改为https://v2.kendozone.com/login这是正常的,如果我刷新页面,我会得到一个404.
有人知道为什么吗?
我有一个本地 WordPress 安装运行在:https://catalogue3.test。
请注意,所有.test域都应解析为localhost,因为我使用Laravel 代客泊车。但是,当我在 Laravel 项目中执行以下代码时,出现如下所示的异常。
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', "https://catalogue3.test", ['verify' => false]);
连接异常
cURL 错误 6:无法解析:catalogue3.test(未找到域名)(参见http://curl.haxx.se/libcurl/c/libcurl-errors.html)
当我在终端中运行以下命令时,会显示 WordPress 页面。
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', "https://catalogue3.test", ['verify' => false]);
我想将 prm.fieldType 从字符串更改为浮点数,可以吗?
这是我现在所拥有的:
> show field keys
name: dev
fieldKey fieldType
-------- ---------
guid     string
name: prod
fieldKey fieldType
-------- ---------
prm      string
在 Gitlab CI 中,当我想推送我的图像时,我得到:
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
这是代码:
docker-push:
  stage: publish
  image: docker:stable
  services:
    - docker:dind
  before_script:
    - *inject-gopath
    - docker login -u gitlab-ci-token -p $GITLAB_PERSONAL_ACCESS_TOKEN $REGISTRY_URL
    # $CI_BUILD_TOKEN
  script:
    - docker build --build-arg GITLAB_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN} --target=prod -t $REGISTRY_PACKAGE_API_NAME:$CI_BUILD_ID .
    - docker build --build-arg GITLAB_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN} --target=prod -t $REGISTRY_PACKAGE_API_NAME:latest .
    - docker push $REGISTRY_PACKAGE_API_NAME:$CI_BUILD_ID
    - docker push $REGISTRY_PACKAGE_API_NAME:latest
这是输出:
Pulling docker image docker:stable ...
Using docker image sha256:23fb2c9b38b59433ea1913eafa12d2e15651ca0d08819dc7067d27d8f92e0428 for docker:stable ...
Running …