小编Cù *_*iếu的帖子

警告:找不到父tsconfig.json

我想修正警告:

警告:找不到父tsconfig.json

在TypeScript Errors选项卡中IntelliJ IDEA 2016.3.我的TypeScript代码存在于src目录中,我的TypeScript输出lib将按预期进行,src而不会添加文件夹lib.

lib在其他项目中使用该文件夹,它似乎按预期工作.所以这似乎不是一个大问题,但我偶尔会遇到TSLint的问题,它有时似乎没有拿起.tsx文件是JSX和lint错误,似乎偶尔将其视为普通.ts文件.最终它似乎弄明白了.我想知道这是否与我的TSLint设置配置使用有关tsconfig.json.

我之前已经.js将文件转换成.ts文件src夹中的文件旁边的文件,但是因为我tsconfig.json最近修改了文件.

文件如下:

tsconfig.json
src/index.ts
lib/index.js
lib/index.d.ts
Run Code Online (Sandbox Code Playgroud)

我已经升级到TypeScript 2.1.4,但是看到了2.0.10.

我的tsconfig.json档案:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "jsx": "react",
    "allowJs": false,
    "isolatedModules": false,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "declaration": true,
    "noImplicitAny": false,
    "noImplicitUseStrict": true,
    "noEmitHelpers": false,
    "removeComments": true,
    "noLib": false,
    "sourceMap": true,
    "inlineSources": true, …
Run Code Online (Sandbox Code Playgroud)

intellij-idea webstorm typescript tsconfig

18
推荐指数
2
解决办法
9073
查看次数

Angular:从指令更​​新模型

我这里有一个小提琴:http://jsfiddle.net/KdkKE/44/

我想做的是创建一个'toggle'组件,基本上是一个自定义复选框,但如果它是真或假,则会更改html,它会绑定到控制器中的布尔值.

当用户单击切换时,模型会更新,指令的视图会发生变化.它类似于指令文档http://docs.angularjs.org/guide/directive末尾的示例,但状态将被绑定,以便在启动时正确.

var app = angular.module('App', []);

function Ctrl($scope) {
    $scope.init = function() {
        $scope.foo = true
    }
}

 app.directive('toggle', function() {
        return {
            restrict: 'E',
            replace: true,
            transclude: true,
            scope: {
                label: '@',
                ngModel: '='
            },
            template: 
                '<div style="cursor: hand; cursor: pointer">{{label}}: {{ngModel}}</div>',
            link: function(scope, element, attrs, controller) {
                element.bind('click', function() {
                    scope.ngModel = false;
                    attrs.$set('ngModel', false);
                    console.log('plz', attrs.ngModel);
                });
            }
        };
    });
Run Code Online (Sandbox Code Playgroud)

-

<div ng-app="App">
    <div ng-controller="Ctrl" ng-init="init()">
        <p>Foo in Ctrl: {{foo}}</p> …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive angularjs-scope angularjs-digest

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

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

google signin not working with production apk on playstore.(release apk on playstore)

Actually Google sign-in is working in debug mode but when i upload the apk on playstore,it is not working.

I made a new google project in google console. There i enable the google+ signin api. After that same project was open in firebase where it ask for sha1 key which i entered. everything is working fine in debug mode but release is creating problem in google signin.

I am uploading the pic of my google console with firebase

Please help

在此处输入图片说明

authentication android release google-signin

6
推荐指数
2
解决办法
3076
查看次数

更新哈希集中的项目

有没有一种方法来更新哈希集中的项目。我有一个用户哈希集,我想更新connectionId字段。

Hashset的ScreenGrab

我应该执行以下操作:

  1. 检索项目,进行必要的更新
  2. 从哈希集中删除项目
  3. 再次添加

c# hashset

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

Unity3D 播放器移动脚本

我有一个脚本可以让你控制一个玩家并跳跃。但是,我正在努力使播放器不断移动,并且无法通过键盘上的 WASD 键进行控制。每当我尝试只使用controller.Move()重力功能时,它就会消失。现在,使用此代码 Gravity 可以工作,但 WASD 也已启用。我的问题是:我怎样才能让这段代码让我的玩家不断移动,并且仍然使用重力?

using UnityEngine;
using System.Collections;

public class PlayerMotor : MonoBehaviour {

    public float speed = 6.0F;
    public float jumpSpeed = 8.0F;
    public float gravity = 20.0F;

    private Vector3 moveDirection = Vector3.back;
    void Update() {
        CharacterController controller = GetComponent<CharacterController>();
        if (controller.isGrounded)
        {
            controller.Move (Vector3.back * Time.deltaTime);
            moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
            moveDirection = transform.TransformDirection(moveDirection);
            moveDirection *= speed;
            if (Input.GetButton("Jump"))
                moveDirection.y = jumpSpeed;

        }
        moveDirection.y -= gravity * Time.deltaTime;
        controller.Move(moveDirection * Time.deltaTime);
    } …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine unity5

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

在我的mac上启动Android Studio时"缺少SDK工具目录"

在此输入图像描述

它显示我已经安装了Android SDK但我找不到它.:<在终端中试图查看文件夹中的内容但什么都没找到,这个位置是空的.为什么应用程序告诉我我已安装它?我怎么解决这个问题?谢谢!!

sdk android

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

软键盘未显示在DialogFragment的EditText RecyclerView上

我试图创建一个包含EditTexts的RecyclerView的DialogFragment。当我单击EditText时,它会滚动并显示“复制/剪切/粘贴”,但键盘永远不会出现。自从我尝试在Activity中实现RecyclerView以来,适配器就起作用了。

我已经尝试过寻找使键盘显示出来的解决方案,例如将其添加到XML中。

</request focus>
Run Code Online (Sandbox Code Playgroud)

还是这个到对话框

dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
Run Code Online (Sandbox Code Playgroud)

但仍然没有任何效果。

非常感谢。

其他:这是目前的样子

在此处输入图片说明

android android-softkeyboard android-edittext android-recyclerview

4
推荐指数
3
解决办法
4008
查看次数

R中的KnapSack动态编程具有递归函数

我在R中创建了这个简单的代码来解决带有递归功能的Knapsack程序

n <- c(0,1,2,3,4)
v <- c(10,40,30,50)
w <- c(5,4,6,3)
k <- 10


myfunction  <- function(n,k){
  if (n==0 | k==0){
  output <- 0
  } else if (w[i] > k) {
        output <- myfunction[i-1,w]
  } else {
        output <- max(v[i]+ myfunction(i-1, k-w[i]),myfunction(i-1,k))
      }
return(myfunction)
}
Run Code Online (Sandbox Code Playgroud)

但是,我没有得到一个值作为输出,而是整个函数.例如,如果我输入:myfunction(4,10)

我没有得到90的值,但整个功能输出.

在此输入图像描述

这些是价值观

recursion r knapsack-problem

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

Doxygen:将类分组为多个嵌套组

我打算AClass在 Doxygen 组(假设)中包含一些记录的 C++ 类(假设)GROUP_C,而该组包含在另一个组(假设GROUP_B)中,而第二组包含在另一个基类(假设GROUP_A)中。像这样:

/** \addtogroup GROUP_A */
/** @{ */

/** \defgroup GROUP_B */
/** @{ */

/** \defgroup GROUP_C */
/** @{ */

/// Comment
class AClass
{
};

/** @} */

/** @} */ 
/** @} */
Run Code Online (Sandbox Code Playgroud)

我正在尝试为这种情况获得一个干净且合乎逻辑的文档,但是,正如我所看到的那样简单,我无法找到比 Doxygen 官方文档更具体的内容,其中没有提及任何循环分组问题。然而,仅仅对上面的简单代码进行 doxygen 处理,就会出现这样的问题:

warning: Refusing to add group GROUP_C to group GROUP_B, since the latter is already a subgroup of the former
Run Code Online (Sandbox Code Playgroud)

我还在文档下得到了生成模块的奇怪面包屑指示AClass

在此输入图像描述

有人知道我对 Doxygen 嵌套组系统的理解有什么问题吗?

提前致谢!

c++ doxygen

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

胶囊对撞机没有统一跳跃

我进口的Unity chan,从资产的统一存储字符,当我和我加入到它rigidbodycapsuleCollider,然后我分配给它的

JUMP00 动画与图像一样,所以当我点击播放时,角色跳跃但碰撞器没有向上移动,当我添加运动以移动 x 和 z 轴时,碰撞器与角色一起移动。

在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

c# unity-game-engine game-physics

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