在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ 網(wǎng)絡(luò)安全問答
老梗 回答

你每秒都執(zhí)行setInterval,可是如果在一秒內(nèi),setInterval中的內(nèi)容沒執(zhí)行完,你覺得會怎么樣呢?

櫻花霓 回答

樓主是需要自己搭建服務(wù)器嗎,自己部署私有云?工作量怎么來說呢?沒有辦法給一個具體的定位,還是要看你的具體的需求。網(wǎng)上相關(guān)的開源代碼也是挺多的,比如webrtc開源了所有的代碼,比如tucodec免費提供了SDK。你在這些SDK的基礎(chǔ)上,完成自己服務(wù)器搭建和UI設(shè)計就可以了~

真難過 回答

注意:python3以后才支持yield from語法

import collections


def flatten(d, prefix="", sep="_"):
    def _take_prefix(k, v, p):
        if p:
            yield from flatten(v, "{}{}{}".format(p, sep, k))
        else:
            yield from flatten(v, str(k))

    if isinstance(d, dict):
        for k, v in d.items():
            if isinstance(v, str) or not isinstance(v, collections.Iterable):
                if prefix:
                    yield "{}{}{}".format(prefix, sep, k), v
                else:
                    yield k, v
            elif isinstance(v, dict):
                yield from _take_prefix(k, v, prefix)
            elif isinstance(v, list):
                for i in v:
                    yield from _take_prefix(k, i, prefix)
            else:
                pass
    else:
        pass

dic = {your dataset}
for key, value in flatten(dic):
    print("{}: {}".format(key, value))

結(jié)果如下,應(yīng)該能拍平了

status: changed
dataset_id: 5a4b463c855d783af4f5f695
dataset_name: AE_E
dataset_label: 1- ADVERSE EVENTS - Not Analyzed
details_variables_variable_id: 5a4b4647855d783b494f9d3f
details_variables_variable_name: CPEVENT
details_variables_variable_label: CPEVENT
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: factor
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d25
details_variables_variable_name: CPEVENT2
details_variables_variable_label: CPEVENT2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d26
details_variables_variable_name: CP_UNSCHEDULED
details_variables_variable_label: CP_UNSCHEDULED
details_variables_status: changed
details_variables_details_r_type_new_value: undefined
details_variables_details_r_type_old_value: unary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d02
details_variables_variable_name: VISIT_NUMBER
details_variables_variable_label: VISIT_NUMBER
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: integer
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9ccf
details_variables_variable_name: VISIT_NUMBER2
details_variables_variable_label: VISIT_NUMBER2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_many_visits: None

針對你修改后的問題, 再加個函數(shù)就搞定:

# 這個fuck_all函數(shù)比較特例, 完全是針對你要區(qū)分的dataset下面的N個變量信息這種需求
def fuck_all(dic, prefix="details_variables"):
    lst = list(flatten(dic))  # flatten函數(shù)則比較通用,任何嵌套數(shù)據(jù)集都可以用它拍平
    lines = []
    top = {k: v for k, v in lst if not k.startswith(prefix)}
    index = 0
    for key, value in lst:
        if not key.startswith(prefix):
            continue
        else:
            if not lines:
                lines.append(top.copy())
        if key in lines[index].keys():
            index += 1
            lines.append(top.copy())
        lines[index][key] = value
    return lines

d = {your dataset}
for i in fuck_all(d):
    print(i)    

結(jié)果長這樣,應(yīng)該是能滿足你需求了

{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d3f', 'details_variables_variable_name': 'CPEVENT', 'details_variables_variable_label': 'CPEVENT', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'factor', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d25', 'details_variables_variable_name': 'CPEVENT2', 'details_variables_variable_label': 'CPEVENT2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d26', 'details_variables_variable_name': 'CP_UNSCHEDULED', 'details_variables_variable_label': 'CP_UNSCHEDULED', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'undefined', 'details_variables_details_r_type_old_value': 'unary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d02', 'details_variables_variable_name': 'VISIT_NUMBER', 'details_variables_variable_label': 'VISIT_NUMBER', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'integer', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9ccf', 'details_variables_variable_name': 'VISIT_NUMBER2', 'details_variables_variable_label': 'VISIT_NUMBER2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}

送佛送到西好了

from functools import reduce
import json

import pandas as pd


with open("your dataset file", "r") as fh:
    dic = json.load(fh)

df = pd.DataFrame(reduce(lambda x, y: x + y, (fuck_all(i) for i in dic)))
df.to_csv("out.csv", index=False)

成品

clipboard.png

尐飯團 回答

我對算法不熟悉,如果有什么常識性錯誤請指正。
看了一下,這是找子串嗎?
可能是想在 j == i, k = 0 時,s[j] != t[k] 這種情況下,不去檢查 t[k]的值,避免只在遍歷到串尾時才退出循環(huán)。

風畔 回答

你好,你可先隨意在一臺slave的機器中看下broker打印的日志,該slave是否注冊到了namesrv中呢?也可以將HA方式改成同步雙寫模式,就可以在producer發(fā)送消息會返回具體的問題。

綰青絲 回答

(┬_┬),在胡亂摸索中把這問題給解決了,其實只是自己對lambda的理解不足及使用錯誤有關(guān)。問題中的函數(shù)參數(shù)的前兩個h、c分別是iview的Table組件自定義模版render時的參數(shù),我自定義了一個函數(shù),包含這兩個參數(shù),同時自己傳多一個數(shù)組。我在內(nèi)部準備使用這些參數(shù),本來這些參數(shù)的作用域已經(jīng)是整個函數(shù)commonGenSelect了,但是我在后續(xù)的代碼中使用了匿名函數(shù),同時異想天開的將這三個參數(shù)作為匿名函數(shù)的參數(shù)傳入,不過此時的匿名參數(shù)已經(jīng)相當于定義了一個新的函數(shù)出來,且沒有傳入實參,導致在內(nèi)部代碼報錯undefinded。解決的方法有兩種:
一種是直接將匿名函數(shù)的參數(shù)直接去掉,在匿名函數(shù)代碼塊中使用的變量將是存在于commonGenSelect整個函數(shù)作用域內(nèi)的,此時這些變量就不會為空

()=>{
    let OptionArr = new Array();
    dataList.forEach(colKV => {
        OptionArr.push(h("Option",{
            props:{
                label:colKV.title,
                value:colKV.val
            }
        }))
    });    
    return OptionArr;
}

第二種方法是,匿名函數(shù)被定義成三個參數(shù)但是沒有被傳入實參,此時我們可以加多一個調(diào)用的步驟,在匿名函數(shù)后進行傳參及調(diào)用

((h,c,dataList)=>{
        let OptionArr = new Array();
        dataList.forEach(colKV => {
            OptionArr.push(h("Option",{
                props:{
                    label:colKV.title,
                    value:colKV.val
                }
            }))
        });    
        return OptionArr;
    })(h,c,dataList)

最后,這個問題也是讓我想到
匿名參數(shù)在定義的時候,要么掛鉤到對應(yīng)的已有函數(shù)中,如

render:(h,c)=>{}
此時其參數(shù)是被固定默認傳入的

要么在定義出自己的匿名參數(shù)后,記得后續(xù)進行傳參來調(diào)用,否則匿名函數(shù)的參數(shù)將是空的

((a,b)=>{console.log(a+b);})(1,3)
誮惜顏 回答

已解決,yaf不支持PATH_INFO模式,在路由重寫之后,關(guān)閉掉PATH_INFO模式即可

不舍棄 回答

函數(shù)聲明時設(shè)置的默認參數(shù)值是在函數(shù)調(diào)用時計算賦值的,而不是在函數(shù)聲明時賦值

我們可以看下下面的例子

function foo2(a, b = (function() { console.log(c); return function(){} })()) {
    b();
}
foo2();

調(diào)用 foo2();
控制臺將輸出:
Uncaught ReferenceError: c is not defined

at b (<anonymous>:1:47)
at foo2 (<anonymous>:2:5)
at <anonymous>:1:1

而不掉用 foo2();
控制臺將不報錯

以上例子說明了函數(shù)參數(shù)的默認值是在調(diào)用是賦值的,而不是在聲明時。

對于問題的代碼,還有注意一點,y默認值函數(shù)聲明中的x是綁定為函數(shù)聲明中的參數(shù)x變量而不是foo外層作用域中的變量x

function foo(x, y = function() { x = 2; }) {
  console.log("x1:"+x);
  y();
  console.log("x2:"+x);
}
foo();

輸出
x1:undefined
x2:2

那么下面的代碼輸出2就好理解了

var x = 1;
function foo(x, y = function() { x = 2; }) {
  x = 3;
  y();
  console.log(x);
}

foo(); // 2
愛礙唉 回答

RewriteRule ^(.*)$ index.php/$1 [QSA,NU,PT,L]

在偽靜態(tài)規(guī)則后面加上 [QSA,NU,PT,L] 配置完成

離殤 回答

報錯都提示了 await要在async函數(shù)里
then(async function(){})

亮瞎她 回答
$me = $response->getGraphUser();
$pictureJson = $me->getPicture();
$pictureItem = json_decode($pictureJson,true);
echo $pictureItem['url'];

大概就是把這個json字符串轉(zhuǎn)換成PHP數(shù)組。然后再處理。

心夠野 回答

現(xiàn)在開發(fā)程序都不需要學習調(diào)試的嗎?

你的label的值要用引號引起來才能是字符串。

安淺陌 回答

1.錯誤的意思是你不應(yīng)該給一個不存在的屬性賦值,可以是vue做了處理
2.為什么要把data掛在root上,如果需要在多個組件之間傳遞數(shù)據(jù),可以用vuex

尐懶貓 回答

Apache,項目文件下有.htaccess文件
內(nèi)容

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>
怣痛 回答

假設(shè)array2 = [{picUrl: "upload/1.jpg"},{picUrl: "upload/2.jpg"},{picUrl: "upload/3.jpg"}]這樣的合格的數(shù)組,你也不說明白拼接規(guī)則,怎么就把array2的第二個元素放到array1的最后面了。

arry這種拼寫趕快改改吧。