小编jnb*_*bdz的帖子

使用PHP加密AES-256文件的最佳方法是什么?

我在网上发现了一些可能有用的教程,但我不确定是否有最好的选择.我想用高度安全的算法加密文件(我有点偏执)但同时我在寻找速度(我知道它有点矛盾)......所以我选择了AES-256 ..但是使用AES-256和PHP加密文件的最佳方法是什么?

php security encryption

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

如何在JavaScript中检测元素何时超过另一个元素?

我编写了大部分代码......当元素"完全"覆盖其他元素时,它就可以工作了.问题是,当元素"完全"在元素上时,我不仅仅希望它是真的,当元素部分地超过另一个元素时,我也希望它是真的.

这是我的代码:

    element = this.element.getStyles('left', 'top', 'width', 'height');
    elementLeftX = element.left.toInt();
    elementLeftY = element.top.toInt();
    elementRightX = (element.width.toInt() + element.left.toInt());
    elementRightY = (element.top.toInt() + element.height.toInt());

    el = this.positions ? this.positions[i] : this.getDroppableCoordinates(el); // Element drop area
    elLeftX = el.left.toInt();
    elLeftY = el.top.toInt();
    elRightX = (el.width.toInt() + el.left.toInt());
    elRightY = (el.height.toInt() + el.top.toInt());

   if (((elLeftY <= elementLeftY) && (elementLeftY <= elRightY)) && ((elLeftY <= elementRightY) && (elementRightY <= elRightY))) {
        if (((elLeftX <= elementLeftX) && (elementLeftX <= elRightX)) && ((elLeftX <= elementRightX) …
Run Code Online (Sandbox Code Playgroud)

javascript mootools mootools-more

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

在谷歌浏览器的一些网页中,字体没有明显变化

我在谷歌浏览器中发现了这个我无法解释的错误.

为文本加载的字体有时会因某种原因而发生变化.

以下是网页加载时的初始字体的屏幕截图:

最初的字体

这是我一段时间后看到的:

一段时间后会出现什么

当我开始在页面上滚动时,字体恢复正常.

有人知道发生了什么吗?

我也在很多其他网站上看到过这种情况.甚至在我自己的网页上.

我使用的是Google Chrome版本31.0.1650.57,我使用的是Mac OS X 10.9.

截图来自DropBox文档网站.

macos fonts google-chrome

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

使用"./bin/cassandra -f"启动Cassandra的问题

出于某种原因,当我尝试使用此命令启动Cassandra时:

bin/cassandra -f
Run Code Online (Sandbox Code Playgroud)

终端卡在了:

倾听节俭的客户......

这是正常的吗?这是否意味着Thrift可以说话节俭?

我正在使用Ubuntu Server.

ubuntu thrift ubuntu-server cassandra

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

Nginx的哪个模块最适合HTTP PUSH?

在nginx网站上,它们是HTTP PUSH的两个模块.

他们来了:

http://pushmodule.slact.net/http://wiki.nginx.org/HttpPushStreamModule

哪一个更好?

你用过其中一个吗?你更倾向哪个?

提前致谢.

nginx server-push

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

在Google Chrome中使用FullScreen API时,我无法在输入元素中使用字母数字键盘

在Google Chrome中,当我使用FullScreen API并尝试在输入元素中输入字母数字内容时,它不会执行任何操作.它适用于Firefox.

他们是否在谷歌浏览器中解决了这个问题?

javascript google-chrome fullscreen

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

流浪汉不断要求输入密码

起初我得到这个错误:

文本将清晰地回显。请安装HighLine或Termios库以隐藏回显的文本。

vagrant@127.0.0.1的密码:

然后我安装了:HighLine

现在我只得到:

vagrant@127.0.0.1的密码:

我试图用vagrant拥有的密码。

我没工作。我尝试了我的计算机密码,但是也没有用。

所以我不知道我应该使用什么密码。

在添加这些设置(在Vagrantfile中)之后,所有这些工作就开始了:

config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
config.ssh.keys_only = true
config.ssh.insert_key = true
Run Code Online (Sandbox Code Playgroud)

有人可能会问为什么我要使用这些设置(因为通常无聊是默认的用户名和密码)。原因是由于某种原因,该框会生成一些随机密码,并且使用ubuntu的用户名。

# Front load the includes
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)

Vagrant.configure("2") do |config|
  config.vm.base_mac = "02357F2D68C4"
  config.ssh.username = "ubuntu"
  config.ssh.password = "1547c59e6cbdffd4104ad720"

  config.vm.provider "virtualbox" do |vb|
     vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
     vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "ubuntu-zesty-17.04-cloudimg-console.log") ]
  end
end …
Run Code Online (Sandbox Code Playgroud)

ssh vagrant vagrantfile

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

在Ubuntu中安装cassandra时出错

我正在阅读本教程; 在我的Ubuntu服务器上安装Cassandra:http://www.unixmen.com/linux-tutorials/960-install-nosql-cassandra-db-in-ubuntu-via-ppa-repository

这是导致我一些问题的命令:

sudo apt-get update && sudo apt-get install cassandra

这是错误消息:

处理时遇到错误:cassandra E:子进程/ usr/bin/dpkg返回错误代码(1)

有任何想法吗?

提前致谢!

ubuntu apt-get cassandra

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

在没有安装UI的情况下通过Linux(Ubuntu)服务器拍摄网页图像

我正在寻找一个webservice(API)或一个我可以安装在我的Linux Ubuntu服务器上的应用程序来截取具有给定URL的网页.

我没有在我的服务器上安装任何GUI ......我应该吗?或者是否有办法安装GUI?

或者我可以使用一个好的API吗?

在此先感谢您的帮助.

webpage screenshot

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

如何/何时释放由 Go 代码创建的 C 字符串的内存?

这是我的代码:

helloworld.go :

package main

/*
#include <stdlib.h>
*/
import "C"

import "unsafe"

//export HelloWorld
func HelloWorld() *C.char {
    cs := C.CString("Hello World!")
    C.free(unsafe.Pointer(cs))
    return cs
}

func main() {}
Run Code Online (Sandbox Code Playgroud)

节点helloworld.cc

#include "helloworld.h"
#include <node.h>
#include <string>

namespace demo {

using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::String;
using v8::Value;

void Method(const FunctionCallbackInfo<Value>& args) {
  Isolate* isolate = args.GetIsolate();
  args.GetReturnValue().Set(String::NewFromUtf8(isolate, HelloWorld()));
}

void init(Local<Object> exports) {
  NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(helloworld, init)

}
Run Code Online (Sandbox Code Playgroud)

当我执行代码时,我得到:

?Oc

或者

??# …

go cgo

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

gpg --recv-keys的问题

我想在Ubuntu上使用apt-get安装cassandra.

我把它添加到我的/etc/apt/sources.list中

deb http://www.apache.org/dist/cassandra/debian unstable main deb-src http://www.apache.org/dist/cassandra/debian unstable main

然后:

sudo apt-get update

然后:

W:GPG错误:http://www.apache.org unstable发布:由于公钥不可用,无法验证以下签名:NO_PUBKEY F758CE318D77295D

然后我拿了号码NO_PUBKEY:

gpg --keyserver wwwkeys.eu.pgp.net --recv-keys F758CE318D77295D

但后来我收到一个错误:

gpg:请求密钥...来自hkp服务器wwwkeys.eu.pgp.net gpg:keyserver超时gpg:keyserver接收失败:keyserver错误

我做错了什么?

在此先感谢您的帮助.

gnupg pgp apt-get cassandra

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

有没有办法让MySQL将多个查询合并到同一个表中,以便在自己的行中获得不同的结果?

这是我的查询:

SELECT COUNT(a.rating_id), COUNT(b.rating_id), COUNT(c.rating_id)
FROM wp_ratings a
LEFT JOIN wp_ratings b
LEFT JOIN wp_ratings c
WHERE a.rating_rating <= '5' AND a.rating_rating >= '4'
AND b.rating_rating <= '4' AND b.rating_rating >= '3'
AND c.rating_rating <= '3' AND c.rating_rating >= '0'
Run Code Online (Sandbox Code Playgroud)

我收到了一个错误.我认为我的查询非常自我解释.我只是不想这样做:

SELECT COUNT(*) FROM wp_ratings WHERE rating_rating <= ‘5' AND rating_rating >= ‘4'
SELECT COUNT(*) FROM wp_ratings WHERE rating_rating <= ‘4' AND rating_rating >= ‘3'
SELECT COUNT(*) FROM wp_ratings WHERE rating_rating <= ‘3' AND rating_rating >= ‘0’
Run Code Online (Sandbox Code Playgroud)

我试图获得尽可能快的查询.

那么有没有办法利用MySQL将多个查询合并到同一个表中以获得自己行中的不同结果?

UPDATE …

mysql sql performance

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