如果我使用bash脚本在一个cpmputer上为字符串创建md5哈希,那么如果我通过另一台计算机上的php脚本调用md5哈希,那么同一个字符串会创建相同的md5哈希吗?我正在尝试在一台计算机上编写脚本并将其移植到另一台计算机上.该脚本将为用户密码创建md5哈希.然后,单独的网页将要求输入用户名和密码.因为我不想存储我希望存储哈希的原始密码,所以让php脚本计算用户输入的密码的哈希值,并在它们匹配时授予访问权限.这在理论上是否有效,或者是否存在我需要考虑的问题?
我正在尝试在Mac上使用rxtx JAR文件for Java(OSX 10.8).我已经安装RXTXcomm.jar了librxtxSerial.jnilib,附带的.so文件/Library/Java/Extensions.我正在尝试执行示例代码:http: //arduino.cc/playground/Interfacing/Java
但我显然错过了一些东西,因为我得到了一堆cannot find symbol错误信息.
这是一对夫妇:
SerialTest.java:3: cannot find symbol
symbol : class CommPortIdentifier
location: package gnu.io
import gnu.io.CommPortIdentifier;
^
SerialTest.java:4: cannot find symbol
symbol : class SerialPort
location: package gnu.io
import gnu.io.SerialPort;
Run Code Online (Sandbox Code Playgroud)
在我的机器上安装的Java中是否有更基本的东西?我刚刚安装了Xcode 4.5,所以我认为一切都是为了运行这个简单的代码.
人们要求我将库放在同一目录中.附上一个ls和javac我正在运行的命令:
$javac -classpath RXTXcomm.jar:. SerialTest.java
SerialTest.java:3: cannot find symbol
symbol : class CommPortIdentifier
location: package gnu.io
import gnu.io.CommPortIdentifier;
^
SerialTest.java:4: cannot find symbol
symbol : class …Run Code Online (Sandbox Code Playgroud) 我正在研究Arduino和String.substring似乎没有正常运行,所以我想知道我可能做错了什么....
我的功能如下:
boolean processSerial()
{
String buf;
int iter = 0;
char thisChar;
while(iter < 1000){
if (Serial.available()) {
#if ARDUINO >= 100 //For Arduino v1.0+
{
thisChar = Serial.read();
buf += thisChar;
//if(DEBUG){Serial.print(thisChar);}
}
#else //For Arduino v0023 or earlier
thisChar = Serial.read();
#endif
}
iter++;
}
Serial.print(buf);
Serial.print(buf.substring(0,10));
if(buf.substring(1) == "GPGGA"){
Serial.println("FOUND IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
Serial.println("And we're done");
}
Run Code Online (Sandbox Code Playgroud)
模式"GPGGA"即将出现但子字符串未返回true.
我的Serial的输出如下:
$GPGGA,053540.000,3804.1237,N,07615.5232,W,1,7,1.39,117.5,M,-33$GPGGA,053And we're done
Run Code Online (Sandbox Code Playgroud)
因此buf在字符串中显然有'GPGGA'.再次显示'GPGGA'的最后一点是在字符串中打印字符0-10.为什么我的if陈述没有归还?
以下代码块为数组中的每个元素打印FOUND和NOT FOUND.我错过了什么?
$values = DB::query($SQL);
print_r($values);
foreach($values as $value)
{
$myVal = $value->thisAttribute;
if(isset($myVal)) print("FOUND");
if(!isset($myVal)) print("NOT FOUND");
}
Run Code Online (Sandbox Code Playgroud)
输出:
Array
(
[0] => stdClass Object
(
[thisAttribute] =>
)
[1] => stdClass Object
(
[thisAttribute] => value
)
[2] => stdClass Object
(
[thisAttribute] =>
)
)
FOUNDNOTFOUNDFOUNDNOTFOUNDFOUNDNOTFOUND
Run Code Online (Sandbox Code Playgroud)