小编Kar*_*gan的帖子

卷曲失败:OpenSSL SSL_connect:SSL_ERROR_SYSCALL与Codeigniter中的fcm.googleapis.com:443相关联

我将Fire-base Notification CRUL Code与Codeigniter集成在一起.有时我会收到错误,但不是所有时间.

我已将下面的代码集成到控制器中

控制器代码

$newDate=Date('m-d-Y H:i:s');

$test_str=$user->us_name. ' Clocked at '.$newDate;
$res = array();

$res['data']['title'] = $user->us_name.' - Clocked In';
$res['data']['is_background'] = "TRUE";
$res['data']['message'] = $test_str;
$res['data']['image'] = 'http://api.androidhive.info/images/minion.jpg';
$res['data']['payload'] = 'individual';
$res['data']['timestamp'] = date('Y-m-d G:i:s');
$res['data']['act_tab'] = 0;


$cur_id1=$this->db->query("Select token from devices")->result();

foreach($cur_id1 as $cur_id) {

    $fields = array('to' => $cur_id->token,'data' => $res);
    $this->notif_model->sendPushNotification($fields);
}
Run Code Online (Sandbox Code Playgroud)

型号代码

function sendPushNotification($fields) {


        // Set POST variables
        $url = 'https://fcm.googleapis.com/fcm/send';

        $headers = array(
            'Authorization: key=MyServerKey',
            'Content-Type: application/json'
        );
        // Open connection …
Run Code Online (Sandbox Code Playgroud)

php codeigniter

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

更新后,Android Emulator无法运行

最近我更新了我的Android SDK和模拟器.之后我无法运行'Hello world'程序.在加载模拟器时,我收到警告和错误.

OpenGL backend 'angle' without OpenGL ES 1.x library detected. Using GLESv2 only.
emulator: WARNING: encryption is off
TextureDraw: Could not create/link program: Failed to create D3D shaders.
Hax is enabled
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
audio: Failed to create voice `goldfish_audio'
qemu-system-i386.exe: warning: opening audio output failed
audio: Failed to create voice `goldfish_audio_in'
qemu-system-i386.exe: warning: opening audio input failed
audio: Failed to create voice `dac'
audio: Failed to create …
Run Code Online (Sandbox Code Playgroud)

android android-emulator android-studio

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

Python程序找到等于数字n的连续数值的总和?

我想在字符串中找到与给定数字相加的连续数字.

例:

a="23410212"数字is=5- 输出23,41,410,0212,212.

此代码无效.我需要修理什么?

def find_ten_sstrsum():
    num1="2825302"
    n=0;
    total=0;
    alist=[];
    ten_str="";
    nxt=1;
    for n in range(len(num1)):
        for n1 in range(nxt,len(num1)):
            print(total)
            if(total==0):
                total=int(num1[n])+int(num1[n1])
                ten_str=num1[n]+num1[n1]
            else:
                total+=int(num1[n1])
                ten_str+=num1[n1]
            if(total==10):
                alist.append(ten_str)
                ten_str=""
                total=0
                nxt+=1
                break
            elif(total<10):
                nxt+=1
     return alist 
Run Code Online (Sandbox Code Playgroud)

python list sum-of-digits

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