小编Cha*_*tin的帖子

sbt new scala/scalatest.g8 在 TransportException 上失败

当我尝试使用以下命令创建 ScalaTest 示例时:

sbt new scala/scalatest-example.g8 fails on TransportException
Run Code Online (Sandbox Code Playgroud)

我得到以下信息:

[info] Set current project to scala (in build file:/Users/chasrmartin/Dropbox/Etudes/Scala/)
[error] org.eclipse.jgit.api.errors.TransportException: git@github.com:scala/scalatest-example.g8.git: Auth fail
[error]     at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
[error]     at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:193)
Run Code Online (Sandbox Code Playgroud)

我已经尝试了下一个左右的几种解决方法(例如this SO question),但无济于事。这似乎是一个简单的问题,我从初学者教程中得到了这个命令。

更新

我从https://www.scala-lang.org/documentation/getting-started-sbt-track/testing-scala-with-sbt-on-the-command-line.html得到这个命令

截屏

scala sbt

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

C++问题初始化对象两次

我对C++比较陌生,并且很难理解对象的实例化和对象的指针.

这两个声明在内存和使用方面有何区别?:

MyClass obj1;
MyClass *obj2;
Run Code Online (Sandbox Code Playgroud)

而且我遇到的具体问题是我有一个类有一个无符号短数组,如果我这样做,数组的最后一个空格会改变:

MyClass obj;
obj = MyClass("123");
Run Code Online (Sandbox Code Playgroud)

MyClass有两个构造函数,它们将采用一个int,默认情况下将其赋值为零,并将其拼接为3位或更少的部分.而另一个将采用数字的字符串表示并做同样的事情...希望这是有道理的!

如果我宣布它,它运作良好

MyClass obj = MyClass("123123123");
Run Code Online (Sandbox Code Playgroud)

但如果我以另一种方式这样做,那就不行了.为什么?

c++ arrays pointers object

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

Meteor-Angular教程:HTML模板中的格式错误,用于复制/粘贴代码

通过流星角度教程,在第2步,我创建了角度模板todos-list.ng.html:

<div class="container">
    <header>
        <h1>Todo List</h1>
    </header>

    <ul ng-repeat="task in tasks">
        <li>{{task.text}}</li>
    </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

并得到这个结果

=> Errors prevented startup:

   While building the application:
   todos-list.ng.html:1: bad formatting in HTML template

=> Your application has errors. Waiting for file change.
Run Code Online (Sandbox Code Playgroud)

因为这是复制粘贴,这让我很困惑.我没有看到任何可以解释的问题,其他人有什么想法吗?

更新

这是其他文件.如果有任何帮助,之前的子步骤是有效的.我确信这是愚蠢的,但我肯定不知道是什么,

简单的待办事项,angular.html:

<head>
  <title>Charlie's Todo List with Angular.js</title>
</head>

<body ng-app="simple-todos"
      ng-include="'todos-list.ng.html'"
      ng-controller="TodosListCtrl">
</body>
Run Code Online (Sandbox Code Playgroud)

简单的待办事项,angular.js:

if (Meteor.isClient) {

  // This code only runs on the client
  angular.module('simple-todos',['angular-meteor']);

  angular.module('simple-todos').controller('TodosListCtrl', ['$scope',
    function ($scope) {

      $scope.tasks = [
        { …
Run Code Online (Sandbox Code Playgroud)

angularjs meteor angular-meteor

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

REST URL的详细问题

这是一个小细节(也可能是宗教)问题.让我们假设我们正在构建一个REST架构,并且为了明确,我们假设服务需要三个参数,x,yz.阅读有关REST的各种工作,似乎应该将其表示为类似的URI

http://myservice.example.com/service/ X/ÿ/ž

在过去写过很多CGI之后,表达这一点似乎很自然

http://myservice.example.com/service?x=val,y=val,z=val

是否有任何特别的理由喜欢全斜线形式?

rest web-services

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

在C/C++上,基本上什么是编译器依赖的东西?

什么任务,功能,执行因编译器而异?我知道这段代码依赖于编译器 -

#include <stdio.h>
#define PRODUCT(x)(x*x)
int main()
{
int i=3,j,k;
j=PRODUCT(i++);
k=PRODUCT(++i);
printf("\n%d %d",j,k);
}
Run Code Online (Sandbox Code Playgroud)

下面给出了一些垃圾,而其他的则是固定值 -

#include <stdio.h>
int main()
{
int i=5,j=10;
printf("%d,%d");
}
Run Code Online (Sandbox Code Playgroud)

因此执行顺序因编译器而异.这些模棱两可的课程是否有资格参加考试?

c c++ compiler-construction

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

c ++编程问题

嗨,我正在尝试编译一个c ++,程序为julia设置我的源代码如下

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<cpu_bitmap.h>
#include<book.h>

#define DIM 20
using namespace std;
struct cuComplex{
  float r;
  float i;
  cuComplex( float a, float b ) : r(a), i(b){}

  float magnitude2( void ) 
  { 
    return r * r + i * i; 
  }
  cuComplex operator*(const cuComplex& a)
  {
    return cuComplex(r*a.r - i*a.i, i*a.r + r*a.i);
  }
  cuComplex operator+(const cuComplex& a)
  {
    return cuComplex(r+a.r, i+a.i);
  }
};

void kernel( unsigned char *ptr )
{

  for (int  y=0; y<DIM; y++)
  {
    for ( …
Run Code Online (Sandbox Code Playgroud)

c c++

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