小编MIk*_*ode的帖子

在Golang中读取YAML文件

我在阅读YAML文件时遇到问题.我认为它是文件结构中的东西,但我无法弄清楚是什么.

YAML文件:

conf:
  hits:5
  time:5000000
Run Code Online (Sandbox Code Playgroud)

码:

type conf struct {
    hits int64 `yaml:"hits"`
    time int64 `yaml:"time"`
}


func (c *conf) getConf() *conf {

    yamlFile, err := ioutil.ReadFile("conf.yaml")
    if err != nil {
        log.Printf("yamlFile.Get err   #%v ", err)
    }
    err = yaml.Unmarshal(yamlFile, c)
    if err != nil {
        log.Fatalf("Unmarshal: %v", err)
    }

    return c
}
Run Code Online (Sandbox Code Playgroud)

yaml go

21
推荐指数
2
解决办法
4万
查看次数

找不到密钥类型安全配置的配置设置

我试图 使用此代码实现配置工具typesafehub/config im

 val conf = ConfigFactory.load()
 val url = conf.getString("add.prefix") + id + "/?" + conf.getString("add.token")
Run Code Online (Sandbox Code Playgroud)

属性文件的位置是 /src/main/resources/application.conf

但由于某种原因,我收到了

com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'add'
Run Code Online (Sandbox Code Playgroud)

文件内容

add {
  token = "access_token=6235uhC9kG05ulDtG8DJDA"
  prefix = "https://graph.facebook.com/v2.2/"
  limit = "&limit=250"
  comments="?pretty=0&limit=250&access_token=69kG05ulDtG8DJDA&filter=stream"
  feed="/feed?limit=200&access_token=623501EuhC9kG05ulDtG8DJDA&pretty=0"
}
Run Code Online (Sandbox Code Playgroud)

一切看起来配置正确?我错过了什么.

谢谢,

三木

scala typesafe-config

20
推荐指数
2
解决办法
4万
查看次数

汇编Spark 1.2.0时未解决的依赖关系

我正在尝试在ubuntu上构建Spark 1.2.0,但我遇到依赖问题.

我基本上下载文件解压缩文件夹并运行sbt/sbt/assembly

  • sbt = 0.13.6

  • scala = 2.10.4

sbt.ResolveException: unresolved dependency: org.apache.spark#spark-
network-common_2.10;1.2.0: configuration not public in 
org.apache.spark#spark-network-common_2.10;1.2.0: 'test'. It was 
required from org.apache.spark#spark-network-shuffle_2.10;1.2.0 test
Run Code Online (Sandbox Code Playgroud)

apache-spark

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

实体框架 linq 包含和分组

我正在尝试用一句话进行包含和分组

var instanceIdList = context.
    Tracks.
    Include("Services").
    GroupBy(x => x.ServiceId).
    Take(top);
Run Code Online (Sandbox Code Playgroud)

但是当我在调试时检查结果时,我看不到任何包含值

我试图以另一种方式做

var objectContext = ((IObjectContextAdapter)context).ObjectContext;
var set = objectContext.CreateObjectSet<Track>();
var instanceIdList = set.Include("Services").GroupBy(x => x.ServiceId);
Run Code Online (Sandbox Code Playgroud)

这是课程: 跟踪

  public partial class Track
{
    public long Id { get; set; }
    public System.Guid ServiceId { get; set; }
    public Nullable<System.Guid> ServiceInterfaceId { get; set; }
    public Nullable<System.Guid> ProviderId { get; set; }
    public System.Guid ServiceInstanceId { get; set; }
    public System.Guid ActivityParentId { get; set; }
    public System.Guid ActivityInstanceId { …
Run Code Online (Sandbox Code Playgroud)

c# linq entity-framework

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

.NET命名冲突问题中的SAP Web服务参考

我尝试使用SAP ws时,我遇到一个.net问题,元素系统导致此错误

  error CS0120: An object reference is required for the nonstatic field, method, or property 'Bapiret2.System'
Run Code Online (Sandbox Code Playgroud)

他们是这里描述的解决方案,但我想找到不需要更改WSDL的解决方案

http://www.drowningintechnicaldebt.com/ShawnWeisfeld/archive/2009/04/17/system-namespace-conflict-in-sap-web-services.aspx

或这个 http://ddkonline.blogspot.com/2009/09/sap-to-microsoft-net-integration-fixes.html

您对此有任何经验以及如何解决?

谢谢miki

.net c# sap web-services

4
推荐指数
2
解决办法
2767
查看次数

Gitlab Cloud 运行部署成功但作业失败

我的 CI/CD 管道有问题,它已成功部署到 GCP 云运行,但在 Gitlab 仪表板上状态为失败。

我尝试将图像替换为其他一些 docker 图像,但也失败了。

 # File: .gitlab-ci.yml
image: google/cloud-sdk:alpine
deploy_int:
  stage: deploy
  environment: integration
  only:
  - integration    # This pipeline stage will run on this branch alone
  script:
    - echo $GCP_SERVICE_KEY > gcloud-service-key.json # Google Cloud service accounts
    - gcloud auth activate-service-account --key-file gcloud-service-key.json
    - gcloud config set project $GCP_PROJECT_ID
    - gcloud builds submit . --config=cloudbuild_int.yaml




# File: cloudbuild_int.yaml
steps:
    # build the container image
  - name: 'gcr.io/cloud-builders/docker'
    args: [ 'build','--build-arg','APP_ENV=int' , '-t', 'gcr.io/$PROJECT_ID/tpdropd-int-front', …
Run Code Online (Sandbox Code Playgroud)

gitlab google-cloud-platform

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

活动目录findone()方法

我试图通过使用这条线来询问广告

            DirectoryEntry de = null;
            SearchResult results = null;
            de = new DirectoryEntry();

            //geting the result FROM ad
            de.Path = dr.manager;
            de.AuthenticationType = AuthenticationTypes.Secure;
            DirectorySearcher search = new DirectorySearcher(de);
            search.Filter = string.Format("(objectClass={0})",'*');
            search.PropertiesToLoad.Add("IsraelID");
            results = search.FindOne();
            de = results.GetDirectoryEntry();
Run Code Online (Sandbox Code Playgroud)

但我在findone()中得到一个例外

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error

   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_AdsObject()
   at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
   at System.DirectoryServices.DirectorySearcher.FindOne()
Run Code Online (Sandbox Code Playgroud)

c# active-directory

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

当data.addRows来自var时,谷歌图表"给出的行大小不同于"

我试图创建条形图,但由于某种原因,它的工作量.

当我将过去的数据复制到data.addRows方法时它工作正常,但当我将数据插入var rawData im接收时

Row given with size different than 8 (the number of columns in the table). 
Run Code Online (Sandbox Code Playgroud)

这是代码:

    data.addColumn('number', 'Time');
    data.addColumn('number', 'a');
    data.addColumn('number', 'b');
    data.addColumn('number', 'c');
    data.addColumn('number', 'd');
    data.addColumn('number', 'e');
    data.addColumn('number', 'f');
    data.addColumn('number', 'g');
    data.addRows([[rawData]]); 
Run Code Online (Sandbox Code Playgroud)

这是console.log(rawData)的值;

[8,0,0,0,0,0,0,2],[9,0,0,3,0,1,0,2],[10,0,0,20,0,1,0,7],[11,13,0,24,2,7,0,16],[12,0,1,23,2,3,0,1],[13,2,4,31,2,0,0,6],[14,0,0,53,0,2,0,4],[15,0,1,57,2,2,0,13],[16,0,0,46,0,7,0,6],[17,0,0,61,0,0,0,7],[18,0,0,15,3,2,0,3],[19,0,0,0,1,0,0,182],[21,0,2,0,0,0,0,305],[23,0,0,0,0,6,0,1]
Run Code Online (Sandbox Code Playgroud)

谢谢

三木

javascript google-visualization

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

弹性体和游戏框架2.2.1

我试图通过使用elastic4s API和播放框架将一些数据索引到弹性搜索

我基本上是从控制器调用这个方法

 def test(){
 val client = ElasticClient.local
 client.execute { create index "bands" }
 client execute { index into "bands/singers" fields "name"->"chris martin" }
 client.close()

 }
Run Code Online (Sandbox Code Playgroud)

我没有在播放或弹性搜索日志中收到任何错误,

然后我检查了Sense插件,如果数据被索引,我得到了

  {
   "error": "IndexMissingException[[bands] missing]",
  "status": 404
   }
Run Code Online (Sandbox Code Playgroud)

看起来查询没有去服务器?...

scala elasticsearch playframework-2.0 elastic4s

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

Go error:最终函数参数必须有类型

我的功能有问题.我得到了一个

final function parameter must have type
Run Code Online (Sandbox Code Playgroud)

对于这种方法

func (s *BallotaApi) PostUser(c endpoints.Context,userReq Users) (userRes Users, error) {

    c.Debugf("in the PostUser method")

    user := userManger.login(userReq)//return a Users Type 

    return user, nil
Run Code Online (Sandbox Code Playgroud)

我读了那些线程,但我无法弄清楚我错在哪里.看起来我宣布了一切.

可任您申报,多变量 - 在 - 一次在去

去功能声明的语法

go

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