小编Jos*_*ook的帖子

Docker错误:设备上没有剩余空间

我用以下方式在Debian 7机器上安装了docker

$ echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
$ sudo apt-get update
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
Run Code Online (Sandbox Code Playgroud)

之后,当我第一次尝试创建一个Image时,它失败并出现以下错误

 time="2015-06-02T14:26:37-04:00" level=info msg="[8] System error: write /sys/fs/cgroup/docker/01f5670fbee1f6687f58f3a943b1e1bdaec2630197fa4da1b19cc3db7e3d3883/cgroup.procs: no space left on device"
Run Code Online (Sandbox Code Playgroud)

这是码头工人信息

Containers: 2
Images: 21
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 25
Dirperm1 Supported: true
Execution Driver: native-0.2
Kernel Version: 3.16.0-0.bpo.4-amd64
Operating System: Debian GNU/Linux 7 (wheezy)
CPUs: 2
 Total Memory: 15.7 GiB


WARNING: No memory limit support
 WARNING: No swap limit …
Run Code Online (Sandbox Code Playgroud)

memory ubuntu temp docker

277
推荐指数
21
解决办法
19万
查看次数

无法在Mac OSX上设置$ GOPATH

我正在尝试设置我的$GOPATH变量以在我的机器上运行一些示例代码:

$ smitego-example go run main.go 
main.go:5:2: cannot find package "github.com/#GITHUB_USERNAME#/smitego" in any of:
    /usr/local/go/src/pkg/github.com/#GITHUB_USERNAME#/smitego (from $GOROOT)
    ($GOPATH not set)

$ smitego-example export $GOPATH=$HOME
-bash: export: `=/Users/#OSX_USERNAME#': not a valid identifier
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

内容github.com/#GITHUB_USERNAME#/smitego/smitego.go:

package smitego
Run Code Online (Sandbox Code Playgroud)

我如何设置我的GOPATH所以它始终如一地工作?

macos environment-variables go

59
推荐指数
6
解决办法
8万
查看次数

在Julia中插值时如何格式化字符串?

在Python 3中,我愿意

print_me = "Look at this significant figure formatted number: {:.2f}!".format(floating_point_number)
print(print_me)
Run Code Online (Sandbox Code Playgroud)

要么

print_me = f"Look at this significant figure formatted number: {floating_point_number:.2f}!"
print(print_me)
Run Code Online (Sandbox Code Playgroud)

在朱莉娅

print_me = "Look at this significant figure formatted number: $floating_point_number"
print(print_me)
Run Code Online (Sandbox Code Playgroud)

但这会产生说法

Look at this significant figure formatted number: 61.61616161616161
Run Code Online (Sandbox Code Playgroud)

如何让Julia限制它显示的小数位数?请注意,据我所知,要打印的字符串的必要存储使用@printf宏来排除.

这有效,但在风格上似乎不正确.

floating_point_number = round(floating_point_number,2)
print_me = "Look at this significant figure formatted number: $floating_point_number"
print(print_me)
Run Code Online (Sandbox Code Playgroud)

julia

10
推荐指数
3
解决办法
7511
查看次数

当我将二维数组作为一维数组读取时会显示什么?

我试图理解C处理数组的方式,在这种情况下,通过读取二维数组就好像它是一维数组一样.

鉴于这个简单的C程序

#include <stdio.h>

int main(int argc, char *argv[]){

    int array[4][4];
    int i, j;

    for(i = 0; i < 4; i++){
        for(j = 0; j < 4; j++){
            array[i][j] = (i+1)*(j+1);
            printf("%d ", array[i][j]);
        }
        printf("\n");
    }

    for(i = 0; i < 16; i++){
        printf("%d ", array[i]);    
    }

    printf("\n");

}
Run Code Online (Sandbox Code Playgroud)

我得到了这个奇怪的输出.

1 2 3 4 
2 4 6 8 
3 6 9 12 
4 8 12 16 
56319776 56319792 56319808 56319824 56319840 56319856 56319872 56319888 56319904 56319920 56319936 56319952 56319968 …
Run Code Online (Sandbox Code Playgroud)

c arrays multidimensional-array

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

C数据结构理论和技术 - 同一堆栈中的ints和chars

我正在努力将中缀表达式转换为前缀表达式,并决定使用堆栈来保存我的表达式.我正在使用链表方法来实现堆栈,并使用以下数据结构:

struct stacknode {
    char char_val;
    int int_val;
    struct stacknode *nextptr;
    struct stacknode *prevptr;
};
Run Code Online (Sandbox Code Playgroud)

然后我push()push_int()和写了两个不同的函数push_char().

push_int()分配的值'\0',以char_val然后将值被推到int_val.

push_char()分配的值-1,以int_val然后将值被推到char_val.

请注意,正在使用的所有整数值都大于0.

然后我编写了其余的函数来处理这样一个事实,即每个节点中的重要值可能是int或char,使用'\ 0'和-1的"否定"值来标识节点是否为"int" "节点或"char"节点.

从本质上讲,我想知道我是否认为数据结构都是错误的.有一个更好的方法吗?

c data-structures

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

有没有办法缩短此命令以查找本地IP地址?

我在用

ifconfig | grep en0 -A 5 | grep 'inet ' | cut -d ' ' -f 2
Run Code Online (Sandbox Code Playgroud)

找到我系统的本地IP地址.我确信有办法缩短这一点.

macos bash

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