我正在进行一个侧面项目,并且我将我的Skelton项目重新设计为微服务,到目前为止我没有找到任何遵循这种模式的开源项目.经过大量的阅读和搜索,我总结了这个设计,但我仍然有一些问题和想法.
以下是我的问题和想法:
我有阿拉伯字符的问题,当我做json_encode()它总是返回????,在数据库中所有字段和数据库是utf8
我的代码:
$query = mysql_query("SELECT * FROM `Names`");
if (!$query) {
$message = 'Invalid query: ' . mysql_error() . "\n";
die($message);
}else
{
while ($row = mysql_fetch_assoc($query))
{
$result[] = array(
'Mid' => $row['Mid'],
'Uid' => $row['Uid'],
'Cid' => $row['Cid'],
'Name' => $row['Name'],
'city' => $row['city'],
'status' => $row['status'],
'Mobile' => $row['Mobile'],
'Phone' => $row['Phone'],
'Email' => $row['Email']);
}
header('Content-Type: application/json; charset=utf-8');
echo json_encode($result);
}
Run Code Online (Sandbox Code Playgroud)
结果如下:
[{"Mid":"17","Uid":"1","Cid":"8","Name":"???? ?? ??????? ?? ???","city":"?????",
Run Code Online (Sandbox Code Playgroud)
请帮我
我有一个Nodejs API,它使用ssl和https,所以我试图在不同的服务器上使用它来使用express-js构建一个Web应用程序.
在发出GET请求时收到以下错误:
events.js:141
throw er; // Unhandled 'error' event
^
Error: unable to verify the first certificate
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
at emitNone (events.js:67:13)
at TLSSocket.emit (events.js:166:7)
at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
Run Code Online (Sandbox Code Playgroud)
我尝试过以下方法,但没有成功:
添加require('ssl-root-cas').inject();
并rejectUnauthorized: false,
根据请求.
添加process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
我的主文件,这给了我一个Error: socket hang up
请求代码:
var service_bus = require('service_bus');
var error_engine = require('error_engine');
exports.get = function(call_back){
function request_service() {
require('ssl-root-cas').inject();
var end_point = {
host: "www.xxxx.com",
port: "4433",
path: "/api/xxx/xx/",
method: "GET", …
Run Code Online (Sandbox Code Playgroud) 我有我的数字 1.010101101,数字的类型是 REAL8,我尝试使用默认的舍入方法“四舍五入到最接近的偶数”,我看到了很多例子,它都是关于四舍五入和使用 frndint 但经过大量搜索我意识到这不是默认舍入我是对还是错?
如果是错误的,请您向我解释如何使用 MASM 程序集进行操作??
这是我的代码:
.686
.model flat,stdcall
.stack 4096
include irvine32.inc
include macros.inc
include floatio.inc
.data
R REAL8 1.010101101
.code
main proc
finit
call ShowFPUStack
fld R
call ShowFPUStack
frndint
call ShowFPUStack
exit
main endp
end main
Run Code Online (Sandbox Code Playgroud)
这是我的 FPU 堆栈
------ FPU Stack ------
------ FPU Stack ------
ST(0): +1.0101011E+000
------ FPU Stack ------
ST(0): +1.0000000E+000
Run Code Online (Sandbox Code Playgroud)