小编lan*_*nzz的帖子

使用<?vs。<?PHP-WAMP中的服务器设置

我已经尝试使用Google搜索,但是找不到设置。我有一个接受一个生产服务器<?,以及<?php,但我试图使用WAMP的网站,但它不接受<?单独,它坚持使用<?PHP。我可以在WAMP中设置吗?

php wamp

4
推荐指数
2
解决办法
2612
查看次数

如何在当前目录中提取.tar.gz?(没有子文件夹)

目前,当从shell中提取Wordpress latest.tar.gz文件时,它会在/wordpress/文件夹中提取它.

我怎么才能得到它所以它只是将文件放在实际的当前目录中?

制作一个自动脚本,我正在考虑做mv /wordpress/* ./* 但这会有用吗?

wordpress ssh bash

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

如何在异步函数中使用"this"?

我有一个简单的例子:

function File(name) {
   this.name = name
   this.text = null
}

File.prototype = {
    read: function() {
         fs.readFile(this.name, function (err, data) {
     }
    },
    getContent: function() {
         return this.text
     }
}

var myfile = new File('my_file')

watch.createMonitor('my_file_dir', function (monitor) {
    monitor.files['my_file']
    monitor.on("change", function (f, stat) {
        myfile.read()
    }
})

  main program....:

   myfile.getContent() ...
Run Code Online (Sandbox Code Playgroud)

我想在this.text变量中添加文件内容.怎么做 ?

node.js

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

逐行读取流而不知道其编码

我有一种情况,我需要逐行处理流中的一些数据.问题是数据的编码事先不知道; 它可能是UTF-8或任何遗留单字节编码(例如Latin1,ISO-8859-5等).这会不会UTF16或喜欢外来EBCDIC的,所以我可以合理预期\n是明确的,所以理论上我可以将它分割成线.在某些时候,当我遇到一个空行时,我需要将其余的流馈送到其他地方(不将它分成行,但仍然没有任何重新编码); 从HTTP风格的标题开始,然后是不透明的主体.

这是我得到的:

function processStream(stream) {
    var buffer = '';

    function splitLines(data) {
        buffer += data;
        var lf = buffer.indexOf('\n');
        while (lf >= 0) {
            var line = buffer.substr(0, lf - 1);
            buffer = buffer.substr(lf + 1);
            this.emit('line', line);
            lf = buffer.indexOf('\n');
        }
    }

    function processHeader(line) {
        if (line.length) {
            // do something with the line
        } else {
            // end of headers, stop splitting …
Run Code Online (Sandbox Code Playgroud)

stream node.js

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

使用python在脚本中创建一个文件

我是python的新手。

我想知道是否可以在写入之前在脚本本身中创建一个文本文件。我不想使用命令提示符创建文本文件。

我写了这个脚本来将结果写入文件

with open('1.txt', 'r') as flp:
        data = flp.readlines()
Run Code Online (Sandbox Code Playgroud)

但是我知道在写入之前必须创建 1.txt。

任何帮助将不胜感激。

python createfile

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

CSS,HTML - 网站在Internet Explorer中显示非常错误

请看这个链接 - http://sklepylaserowe.test.dih.pl/.它在Firefox,Chrome和Opera中表现良好 - 但它在Internet Explorer(8和9)中搞砸了.可能是什么原因呢?(从列表"Wybierzwojewództwo",请选择"śląskie",单击"Dalej >>",然后单击出现的链接,隐藏该覆盖窗口)

许多基本的CSS命令不起作用,例如:

margin:0 auto;
Run Code Online (Sandbox Code Playgroud)

html css internet-explorer

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

标签 统计

node.js ×2

bash ×1

createfile ×1

css ×1

html ×1

internet-explorer ×1

php ×1

python ×1

ssh ×1

stream ×1

wamp ×1

wordpress ×1