小编Nor*_*ert的帖子

PHP + MongoDB:未捕获的异常'MongoCursorException',消息'没有这样的文件或目录'

我正在研究一个尝试从PHP连接到MongoDB数据库的Web应用程序.在90%的页面加载中一切正常,但在其他10%中,当我尝试更新集合时会抛出以下异常:

Fatal error: Uncaught exception 'MongoCursorException' with message 'No such file or directory' in D:\webDev\webSites\str\dev3\_global_classes\User.php:40
Stack trace:
#0 D:\webDev\webSites\str\dev3\_global_classes\User.php(40):
   MongoCollection->update(Array, Array, Array)
#1 D:\webDev\webSites\str\dev3\_init\_init.php(8):
   User->__construct(NULL)
#2 D:\webDev\webSites\str\dev3\index.php(3):
   include('D:\webDev\webSi...')
#3 {main} thrown in D:\webDev\webSites\str\dev3\_global_classes\User.php on line 40
Run Code Online (Sandbox Code Playgroud)

PHP代码:

public function __construct($SESSIONID = null) {        
    User::$_users_collection = Main::$_mongo->selectCollection("users");

     ...   

    $query = array('session_id' => session_id());

    $expiry = time() + Main::$_lifetime;
    $data = array(
        'session_id' => session_id(),
        'expiry' => (string)$expiry,
        'ip' => $_SERVER['REMOTE_ADDR']
    );

    $options = array(
        'upsert' => true,
        'safe' => true
    ); …
Run Code Online (Sandbox Code Playgroud)

php mongodb mongodb-php

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

深度学习中的图像预处理

我正在尝试深入学习图像.我有来自不同相机的约4000张图像,具有不同的光线条件,图像分辨率和视角.

我的问题是:什么样的图像预处理有助于改善对象检测?(例如:对比度/颜色标准化,去噪等)

image-processing object-detection deep-learning

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

GetWindowRect()失败,但IsWindow()失败

我试图获得外部窗口的大小:

POINT point;

point.x = 100;
point.y = 100;

HWND hwnd = WindowFromPoint(point);

LPRECT pRect = {0};
bool ret1 = IsWindow(hwnd);
bool ret = GetWindowRect(hwnd, pRect);
Run Code Online (Sandbox Code Playgroud)

IsWindow的返回值为true,但GetWindowRect失败并出现以下错误:

1400:窗口句柄无效

有什么不对?

winapi visual-c++

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