小编MrP*_*les的帖子

Unix:猫本身做什么?

我data=$(cat)在bash脚本中看到了这一行(只是声明一个空变量)并且对于可能做的事情感到困惑.

我阅读了手册页,但它没有这方面的例子或解释.这会捕获stdin或其他东西吗?关于这个的任何文件?

编辑:特别是如何做data=$(cat)它允许它运行这个钩子脚本?

#!/bin/bash 

# Runs all executable pre-commit-* hooks and exits after, 
# if any of them was not successful. 
# 
# Based on 
# http://osdir.com/ml/git/2009-01/msg00308.html 

data=$(cat) 
exitcodes=() 
hookname=`basename $0` 

# Run each hook, passing through STDIN and storing the exit code. 
# We don't want to bail at the first failure, as the user might 
# then bypass the hooks without knowing about additional issues. 

for hook in $GIT_DIR/hooks/$hookname-*; do 
   test -x "$hook" || …
Run Code Online (Sandbox Code Playgroud)

unix linux bash shell

14
推荐指数
2
解决办法
744
查看次数

Qt:编译器没有堆空间

当我添加更多音乐我的resources.qrc时收到此错误.mp3文件甚至都不大,你必须开玩笑说这是MSVC编译器可以处理的全部内容.

有没有办法解决?是否无法增加编译器的堆空间?我想我可以存储音乐并在本地搜索它,但是我如何将这些资源部署到手机上呢?

c++ qt qml

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

单击按钮后动画QML矩形的颜色

当点击一个按钮时,我试图让我的电路板闪烁绿色.

我添加了以下颜色动画代码以帮助创建闪烁效果,以便电路板可以从原始颜色变为绿色,并返回到原始颜色.

我在一些代码示例中看到过,ColorAnimation也可以像这样使用ColorAnimation on color{...}.我尝试使用它来引用rectanglecolor属性,但它抱怨color是一个无效的属性,这就是为什么我在下面的代码中没有它.

SequentialAnimation
        {
            running: true
            loops: Animation.Infinite

            ColorAnimation
            {
                to: "green"
                duration: 500
            }

            ColorAnimation
            {
                to: "transparent"
                duration: 500
            }
        }
Run Code Online (Sandbox Code Playgroud)

上面的代码片段已进入下面的转发器代码.下面的代码处理显示我的电路板与我开始的黑色和白色的颜色.

Repeater
{
    id: board
    model: 64

    Rectangle
    {
        color: getWhiteOrBlack(index)

        opacity: 0.45
        width: getSquareSize()
        height: getSquareSize()

        x: getX(index)
        y: getY(index)

        MouseArea
        {
            anchors.fill: parent
            onClicked:
            {
                pawn.x = parent.x
                pawn.y = parent.y

                if (starting_position == false)
                {
                    starting.x = parent.x
                    starting.y = parent.y
                    starting_position = …
Run Code Online (Sandbox Code Playgroud)

c++ qt qml

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

詹金斯没有找到JAVA_HOME

试图粘贴我安装Java JDK的地方,但Jenkins一直说:

C:\Program Files (x86)\Java\jdk1.8.0_11\bin doesn’t look like a JDK directory
Run Code Online (Sandbox Code Playgroud)

也尝试过C:\Program Files (x86)\Java\jdk1.8.0_11\bin\java:

not a directory on the Jenkins master (but perhaps it exists on some slaves)
Run Code Online (Sandbox Code Playgroud)

任何最后的文件夹/文件应该是什么?我假设bin\java但是这给了我麻烦.

java jenkins

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

标签 统计

c++ ×2

qml ×2

qt ×2

bash ×1

java ×1

jenkins ×1

linux ×1

shell ×1

unix ×1