小编kar*_*thi的帖子

在节点js中使用fd(文件描述符)有什么用处

    fs.open('input.txt', 'r+', function(err, fd) {
       console.log(fd);
       if (err) {
           return console.error(err);
       }
    })
Run Code Online (Sandbox Code Playgroud)

什么是fd,为什么当我使用console.log()打印它时它给出3;

node.js

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

图表JS X轴值重复两次

我正在使用以下代码使用Chart js插件生成折线图,其中我面临的问题是X轴值重复两次。

function newDate(days) {
    return moment().add(days, 'd').format('MM/DD');
}

var painChartContext = document.getElementById('pain_chart');
    var painChart = new Chart(painChartContext, {
        type: 'line',
        data: {
            labels: [newDate(-7), newDate(-6), newDate(-5), newDate(-4), newDate(-3), newDate(-2), newDate(-1)],
            datasets: [{
                label: "Pain",
                data: [8, 9, 7, 3, 10, 3, 4],
                fill: false,
                borderColor: '#b71705',
                spanGaps: true
            }]
        },
        options: {
            scales: {
                xAxes: [{
                    type: 'time',
                    time: {
                        displayFormats: {
                            'millisecond': 'MM/DD',
                            'second': 'MM/DD',
                            'minute': 'MM/DD',
                            'hour': 'MM/DD',
                            'day': 'MM/DD',
                            'week': 'MM/DD',
                            'month': 'MM/DD',
                            'quarter': 'MM/DD',
                            'year': …
Run Code Online (Sandbox Code Playgroud)

javascript momentjs chart.js

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

在 ubuntu 14.04 上安装 cloudera 时无法从代理接收心跳

尝试在 ubuntu 14.04 上安装 cloudera 时出现以下错误。

Installation failed. Failed to receive heartbeat from agent.
Ensure that the host's hostname is configured properly.
Ensure that port 7182 is accessible on the Cloudera Manager Server (check firewall rules).
Ensure that ports 9000 and 9001 are not in use on the host being added.
Check agent logs in /var/log/cloudera-scm-agent/ on the host being added. (Some of the logs can be found in the installation details).
If Use TLS Encryption for Agents is enabled …
Run Code Online (Sandbox Code Playgroud)

cloudera cloudera-cdh ubuntu-14.04

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