小编Bad*_*imi的帖子

./libraries/plugin_interface.lib.php#551 count() 中的警告:参数必须是实现 Countable 的数组或对象

Warning in ./libraries/plugin_interface.lib.php#551
 count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/display_import.lib.php#371: PMA_pluginGetOptions(
string 'Import',
array,
)
./libraries/display_import.lib.php#456: PMA_getHtmlForImportOptionsFormat(array)
./libraries/display_import.lib.php#691: PMA_getHtmlForImport(
string '5de53ad1bdb35',
string 'database',
string 'laxie_magento',
string '',
integer 209715200,
array,
NULL,
NULL,
string '',
)
./db_import.php#43: PMA_getImportDisplay(
string 'database',
string 'laxie_magento',
string '',
integer 209715200,
)
./index.php#53: include(./db_import.php)
Run Code Online (Sandbox Code Playgroud)

phpMyAdmin 的导入选项卡上出现此错误,下面是服务器详细信息

服务器:Localhost via UNIX socket
服务器类型:MySQL
服务器版本:5.7.28-0ubuntu0.18.04.4 - (Ubuntu)
协议版本:10
服务器字符集:UTF-8 Unicode (utf8)

mysql sql database phpmyadmin

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

带有通知中心发布者的 SwiftUI

我想在应用程序进入后台并返回时收听通知。我正在尝试使用 NotificationCenter 发布者并让 SwiftUI 视图收听它们。
我可以使用几种方法来做到这一点,我正在尝试使用其中的两种方法,但有趣的是,尽管当我将订阅者放入init()方法中时,所有方法看起来都是合法的,但它不起作用。
我试图把它放在main线程上,但仍然没有成功。
有谁知道为什么?
这是我的代码:

struct ContentView: View {
    @State var isActive = true
    @State var cancellables = Set<AnyCancellable>()
    var body: some View {
        ZStack {
            Image("background")
                .resizable()
                .scaledToFill()
                .edgesIgnoringSafeArea(.all)                        
        }
        .onReceive(NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification)) { _ in
            self.isActive = false
        }
        .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification), perform: {_ in
            self.isActive = true
        })
    }

    init() {
        NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification)
         //   .receive(on: RunLoop.main)
            .sink(receiveValue: { _ in
                print("init")
            }
            .store(in: &cancellables)
    }
}
Run Code Online (Sandbox Code Playgroud)

奇怪的是,onReceive修饰符中的侦听器就像一个魅力。在init()该 …

notificationcenter swiftui combine

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

在子位置运行时,react-scripts 父文件夹 node_modules 错误

(Create-React-App)当在子文件夹中运行react-scripts build(c:\Repos\web_app1\api_ui)及其自己的package.jsonnode_modules文件夹等时,出现以下错误:

 react-scripts build


There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "babel-loader": "8.0.4"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:

  c:\Repos\web_app1\node_modules\babel-loader (version: 7.1.4)
Run Code Online (Sandbox Code Playgroud)
  • 无法将父文件夹的 …

node-modules reactjs webpack create-react-app babel-loader

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

Richtextbox将行号转换为滚动条位置

我现在可以RichTextBox使用这段代码同步我的两个:

private const int SB_HORZ = 0x0;
private const int SB_VERT = 0x1;
private const int WM_HSCROLL = 0x114;
private const int WM_VSCROLL = 0x115;
private const int SB_THUMBPOSITION = 4;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int GetScrollPos(int hWnd, int nBar);
[DllImport("user32.dll")]
private static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);
[DllImport("user32.dll")]
private static extern bool PostMessageA(IntPtr hWnd, int nBar, int wParam, int lParam);
internal int HScrollPos
{
    private get { return GetScrollPos((int)this.Handle, …
Run Code Online (Sandbox Code Playgroud)

c# scrollbar richtextbox winforms

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

检测Web服务中的客户端断开连接

我正在使用Apache CXF Web服务堆栈.当客户端在操作完成之前超时或断开与服务器的连接时,服务器将继续运行该操作,直到完成为止.我希望服务器检测客户端何时断开连接并相应地处理它.

有没有办法检测客户端何时使用Apache CXF断开连接?那么使用其他Java Web服务堆栈呢?

java web-services cxf webservice-client

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

不推荐使用ancestorInheritedElementForWidgetOfExactType

在 Flutter 1.12.1 版本ancestorInheritedElementForWidgetOfExactType被弃用之后。我们getElementForInheritedWidgetOfExactType现在应该使用。如何编辑它BlocProvider以使用这种新方法?

import 'package:flutter/material.dart';

Type _typeOf<T>() => T;

abstract class BlocBase {
  void dispose();
}

class BlocProvider<T extends BlocBase> extends StatefulWidget {
  BlocProvider({
    Key key,
    @required this.child,
    @required this.bloc,
  }) : super(key: key);
  final Widget child;
  final T bloc;

  @override
  _BlocProviderState<T> createState() => _BlocProviderState<T>();

  static T of<T extends BlocBase>(BuildContext context) {
    final type = _typeOf<_BlocProviderInherited<T>>();
    _BlocProviderInherited<T> provider =
        context.ancestorInheritedElementForWidgetOfExactType(type)?.widget; //deprecated
    return provider?.bloc;
  }
}

class _BlocProviderState<T extends BlocBase> extends State<BlocProvider<T>> {
  @override …
Run Code Online (Sandbox Code Playgroud)

dart flutter

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

Django django.contrib.staticfiles.templatetags.static 已在 3.0 中删除:如何替换该功能?

我有以下代码块,其中.css返回相应的文件路径。
它是Theme-Class允许用户通过配置文件视图中的按钮更改网站主题(深色和浅色)的一部分。

def link(self) -> str:
        """
        Returns the link where the CSS file for this theme is located
        """
        return static('app_shared/colors_%s.css' % self.name())
Run Code Online (Sandbox Code Playgroud)

当它发生在 HTML-Template 中时,同样的问题可以通过更改{% load staticfiles %}{% load static %}. 显然,对于源代码,我需要另一种选择。

python django static-files django-staticfiles django-3.0

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

ReorderableListView 不识别自定义小部件中的键

我有一个ReorderableListView它应该填充自定义小部件,但是即使在自定义无状态小部件类和构造函数中传递了键,我也会收到以下错误:

此小部件的所有子部件都必须有一个键。'package:flutter/src/material/reorderable_list.dart':失败的断言:第 71 行 pos 10:'children.every((Widget w) => w.key != null)'

这是飞镖代码:

class CustomWidget extends StatelessWidget{

  String CustomWidgetString;
  String WidgetKey;

  CustomWidget({this.CustomWidgetString, this.WidgetKey});

  Widget _widget(){
    return Text(
      CustomWidgetString,
      key: Key(WidgetKey),
    );
  }

  @override
  Widget build(BuildContext context){
    return _widget();
  }
}


class AppState extends State<App>{

  @override
  Widget build(BuildContext context){
    return Scaffold(
      appBar: AppBar(
        title: Text("Reorderable List"),
      ),
      body: ReorderableListView(
        scrollDirection: Axis.vertical,
        children: <Widget>[
          CustomWidget(
            CustomWidgetString: "Custom Widget",
            WidgetKey: "value",
          )
        ],
        onReorder: (a, b){
        },
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

使用 …

dart flutter

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

在 Powershell 中检查关闭 Windows 窗体的内容

想知道是否有办法检查关闭窗口的事件,几乎可以单击顶角的红色 x或是否$form.Close()被调用?

$form.Add_Closing({})如果我的脚本中有它,每个都会自动启动,但我想知道关闭窗口的方式是什么。

forms powershell winforms

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

如何使用“CupertinoFullscreenDialogTransition”?

我没有找到构造函数的任何示例CupertinoFullscreenDialogTransition

https://api.flutter.dev/flutter/cupertino/CupertinoFullscreenDialogTransition-class.html

我试图理解下面的代码,但我没有明白。

CupertinoFullscreenDialogTransition({
  Key key,
  @required Animation<double> animation,
  @required this.child,
}) : _positionAnimation = CurvedAnimation(
       parent: animation,
       curve: Curves.linearToEaseOut,
       // The curve must be flipped so that the reverse animation doesn't play
       // an ease-in curve, which iOS does not use.
       reverseCurve: Curves.linearToEaseOut.flipped,
     ).drive(_kBottomUpTween),
     super(key: key);
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout

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