小编Vaj*_*tha的帖子

如何在Ubuntu for PHP 7.1中安装bcmath

我正在使用Ubuntu 16服务器进行测试php7.1.我的一个应用程序使用bcadd功能.我知道我需要为此安装bcmath模块,但我无法找到php7.1-bcmath.当我尝试安装时apt install php-bcmath,它只是安装了php7.0-bcmath模块.

我无法php7.1-bcmath在我的服务器上随处找到模块.有人有想法吗?

apt install php7.1-bcmath 返回以下,

E: Unable to locate package php7.1-bcmath

E: Couldn't find any package by glob 'php7.1-bcmath'

E: Couldn't find any package by regex 'php7.1-bcmath'
Run Code Online (Sandbox Code Playgroud)

php bcmath ubuntu-server ubuntu-16.04 php-7.1

10
推荐指数
3
解决办法
3万
查看次数

Android getActiveNotifications 抛出 SecurityException

我有一个用于监听通知的 NotificationService 类。但是,当我调用 getActiveNotifications() 时,它会抛出一个 SecurityException。是的,我在调用此方法之前已检查过权限。

我在 NotificationService 中使用 AsyncTask 来获取通知。代码如下。

private class AsyncProcessNotification extends AsyncTask<Void, Void, Void> {

        @Override
        protected Void doInBackground(Void... params) {
            int notificationType = MainApplication.settingNotificationType;
            MainApplication.clearNotificationItems();

            if (MainApplication.settingNotificationType == Constants.KEY_NOTIFICATION_TYPE_DISABLED) {
                Log.i(TAG, "Notifications disabled");
                return null;
            }

            if (PermissionHelper.isNotificationPermissionGranted(getApplicationContext())) {
                if (getActiveNotifications() == null || getActiveNotifications().length == 0) {
                    Log.i(TAG, "No notifications found");
                    return null;
                }

                Log.i(TAG, "Getting " + getActiveNotifications().length +" notifications");
                Log.i(TAG, "Notification type  " + notificationType);
                for (StatusBarNotification statusBarNotification : getActiveNotifications()) {
                    // …
Run Code Online (Sandbox Code Playgroud)

android android-notifications android-asynctask android-securityexception notification-listener

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

如何退出/退出PostgreSQL?

我是psql的新手,在Ubuntu上使用psql命令行.从命令行注销/退出的命令是什么?

谢谢!

postgresql command-line psql ubuntu-14.04

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

Android Widget Arc Progress

在我的 android 应用程序中,我有几个小部件,我希望它们看起来像这些进度条。

在此处输入图片说明

现在我知道我不能使用任何外部库来做到这一点,因为小部件不支持大多数自定义视图。我见过大多数开发人员使用位图来绘制这样的东西。我可以设法画一个完整的圆圈。但是如何使用位图绘制这个弧形进度条或者还有其他方法吗?

感谢你的帮助。谢谢!

android android-widget android-progressbar android-bitmap

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

PHP正则表达式用于包含字母数字和特殊字符的字符串

我尝试过但找不到这个问题的答案,所以我问这个问题。

我需要创建一个用于密码验证的正则表达式,它必须具有以下条件。

  • 至少一个字母
  • 至少一个数字
  • 至少一封特别的信~!^ ( ) { } < > % @ # & * + = _ -
  • 不得包含 $ ` , 。/ \ ; : ' " |
  • 必须介于 8-40 个字符之间
  • 没有空间

我创建了以下正则表达式,但它无法正常工作。

preg_match('/[A-Za-z\d$!^(){}?\[\]<>~%@#&*+=_-]{8,40}$/', $newpassword)
Run Code Online (Sandbox Code Playgroud)

有人可以帮我正确修复这个正则表达式吗?

谢谢。

php regex preg-match

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