鍍金池/ 問答/ 網(wǎng)絡(luò)安全問答
舊城人 回答

路徑不對,你得知道什么是相對路徑,什么是絕對路徑。

尕筱澄 回答
x(any(x==1,2) & x(:,2)~=0 ,:)

any(var, 2)判定行中有沒有1:

any(x==1,2)

朽鹿 回答

你原本的圖片不是通過input type=file上傳的么,那你就直接使用FileReader對象即可
https://blog.csdn.net/for_cxc...

枕頭人 回答

c

#include<stdlib.h>
#include<string.h>

int main(void){
    long mem = 1000L*1000*1000*64;//64G, 我的機器有16G內(nèi)存
  
    char* f = malloc(mem);

    memset(f,0xff, mem-1); //注釋掉這一行你會成功的

    free(f);

}
gcc melloctest.c
./a.out

運行時你會看到段錯誤 (核心已轉(zhuǎn)儲)(我就不提Segmentfault,呵呵!)

java

public class Test{
    static final int mem = 1000*1000*64;//64M //java 不能用long聲明數(shù)組
    public static void main(String[] args){       
        int a[][] = new int[1000][];
        
        for(int i=0;i<1000; i++)
           a[i] = new int[mem];

        a[999][mem-1]=10086;
        System.out.println(a[999][mem-1]);
    }

}

運行時你會看到

java Test
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at Test.main(Test.java:10)
    

## 結(jié)論

c: 聲明沒問題,分配沒問題, 使用了就不行
java: 聲明沒問題,分配都不行,更別說使用了

不討囍 回答

在需要使用其它賬號的地方,自己創(chuàng)建一個新的Swift_Mailer來發(fā)送郵件

// 備份原有Mailer
$backup = Mail::getSwiftMailer();

// 設(shè)置郵箱賬號
$transport = Swift_SmtpTransport::newInstance('smtp.qq.com', 25, 'tls');
$transport->setUsername('email_username');
$transport->setPassword('email_password');

$mailer = new Swift_Mailer($transport);

Mail::setSwiftMailer($mailer);

Mail::send();

// 發(fā)送后還原
Mail::setSwiftMailer($backup);
伴謊 回答

.app或者其他域名修改為.test即可

笑浮塵 回答

怎么一會兒是控制臺,一會兒是打開網(wǎng)頁?

純妹 回答
  1. 嘗試從GitHub找一下
  2. 我堅信這種發(fā)送短信API是簡單的,沒有復(fù)雜到?jīng)]有SDK就完全沒法下手的份上,所以,對著API文檔自己用py3寫
懷中人 回答

你這段代碼在我本地執(zhí)行時是正常的,你需要看看是不是哪里有代碼會自動將historyArr置空。

憶往昔 回答

試試這個,可以獲取最大最小,并且可以自定義

function minOrMaxsInArray(array, length, compare) {

    let result = {};

    if (array == null || !(array instanceof Array)) {
        return result;
    }
    // 默認長度為數(shù)組的長度
    length = length || array.length;
    // 數(shù)組比較方法
    compare = compare || function (a, b) {
            return a - b;
        };

    // 進行排序
    array.sort(compare);

    result = {
        1: array.slice(0, length),
        2: array.reverse().slice(0, length)
    };

    return function (type) {
        return result[type] || [];
    }

}

獲取普通數(shù)組最大 || 最小集合:

let arr = [1, 5, 3, 2, 10, 15];
console.log(minOrMaxsInArray(arr, 4)(1));
console.log(minOrMaxsInArray(arr, 4)(2));

獲取對象數(shù)組的最大 || 最小集合

let arr2 = [{id: 1}, {id: 3}, {id: 4}, {id: 9}, {id: 12}, {id: 199}];
console.log(minOrMaxsInArray(arr2, 4, (a, b) => (a.id - b.id))(1));
來守候 回答

onClick事件寫在屬性上,找元素用e.target

維她命 回答

表頭分組

給 column 設(shè)置 children,可以渲染出分組表頭。

<template>
    <Table :columns="columns11" :data="data10" border height="500"></Table>
</template>
<script>
    export default {
        data () {
            return {
                columns11: [
                    {
                        title: 'Name',
                        key: 'name',
                        align: 'center',
                        width: 200,
                        fixed: 'left',
                        filters: [
                            {
                                label: 'Joe',
                                value: 1
                            },
                            {
                                label: 'John',
                                value: 2
                            }
                        ],
                        filterMultiple: false,
                        filterMethod (value, row) {
                            if (value === 1) {
                                return row.name === 'Joe';
                            } else if (value === 2) {
                                return row.name === 'John Brown';
                            }
                        }
                    },
                    {
                        title: 'Other',
                        align: 'center',
                        children: [
                            {
                                title: 'Age',
                                key: 'age',
                                align: 'center',
                                width: 200,
                                sortable: true
                            },
                            {
                                title: 'Address',
                                align: 'center',
                                children: [
                                    {
                                        title: 'Street',
                                        key: 'street',
                                        align: 'center',
                                        width: 200
                                    },
                                    {
                                        title: 'Block',
                                        align: 'center',
                                        children: [
                                            {
                                                title: 'Building',
                                                key: 'building',
                                                align: 'center',
                                                width: 200,
                                                sortable: true
                                            },
                                            {
                                                title: 'Door No.',
                                                key: 'door',
                                                align: 'center',
                                                width: 200
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        title: 'Company',
                        align: 'center',
                        children: [
                            {
                                title: 'Company Address',
                                key: 'caddress',
                                align: 'center',
                                width: 200
                            },
                            {
                                title: 'Company Name',
                                key: 'cname',
                                align: 'center',
                                width: 200
                            }
                        ]
                    },
                    {
                        title: 'Gender',
                        key: 'gender',
                        align: 'center',
                        width: 200,
                        fixed: 'right'
                    }
                ],
                data10: []
            }
        },
        mounted () {
            const data = [];
            for (let i = 0; i < 20; i++) {
                data.push({
                    key: i,
                    name: 'John Brown',
                    age: i + 1,
                    street: 'Lake Park',
                    building: 'C',
                    door: 2035,
                    caddress: 'Lake Street 42',
                    cname: 'SoftLake Co',
                    gender: 'M',
                });
            }
            this.data10 = data;
        }
    }
</script>
獨特范 回答

每次用戶來,有狀態(tài)的話,去sso驗證一下唄

病癮 回答

OOA和OOP中的一個設(shè)計原則就是接口分離原則,你這么是違背這條。
所以不推薦暴露一個大接口的方式來操作。
若是你期望對于其中的部分做組合,那么可以用門面模式來搞定。
若是你接口存在多個緯度的變化的話,那么可以用橋接模式來搞定。

建議多看看OOP,OOA的設(shè)計原則和23個設(shè)計模式。

吃藕丑 回答

海外服務(wù)器打開慢是正常的,當然也分品牌。其次3.2的云平臺有很多站外連接沒剔除。也是慢的原因之一

澐染 回答

其實還有更好的做法,通過使用 Package Control 的 Add Repository 功能

打開 Package Control 的 add repository 添加對應(yīng)的 github 地址
clipboard.png

此時 Install Package 時就會出現(xiàn)對應(yīng)的包了
clipboard.png

凹凸曼 回答

你的理解是對的,稍微補充一點,線程的棧,其他線程也是可以訪問的,只是常規(guī)上訪問不到,如果你使用C/C++語言的話,數(shù)組越界后,很容易就訪問到其他線程的棧了,以致有可能導致其他線程的異常。 這一點也從側(cè)面證明一個進程內(nèi)的多個線程是共享內(nèi)存的。