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

鍍金池/ 問答

一個(gè)打叉的圖,一個(gè)透明底的框圖,絕對(duì)定位

擱淺 回答

我不知道你們后臺(tái)是用語言寫的,一般跨域是后臺(tái)配置的,這個(gè)是你請(qǐng)求后臺(tái)入口文件的前綴而已,前臺(tái)在你的config文件里配置,
圖片描述

配置文件
有3個(gè),一個(gè)開發(fā)模式下的前綴配置
第二屬于映射表,具體你可以去研究下
第三個(gè)是生產(chǎn)模式下配置,和第一基本一致,前綴是正式的
圖片描述

第一個(gè)文件里的內(nèi)容

圖片描述
第二個(gè)文件內(nèi)容

圖片描述
在main.js里設(shè)置全局變量這樣你可以在子頁(yè)面都可以使用

遺莣 回答

在你html中增加
<script>
alert('hello world!');
</script>
就可以彈出來'hello world!'對(duì)話框。

你應(yīng)該是初學(xué)者,自己多百度,多練習(xí)。我這邊就不講太多知識(shí)了。

空白格 回答

cli模式下的php.ini配置,部分會(huì)被覆蓋。參考官方網(wǎng)址(覆蓋 php.ini 設(shè)置選項(xiàng)):http://php.net/manual/zh/feat...

熊出沒 回答

實(shí)現(xiàn)key-value咯,參見https://www.zhihu.com/question/30527705。

當(dāng)然時(shí)間多的話你可以對(duì)比各種查找樹實(shí)現(xiàn)key-value存儲(chǔ)結(jié)構(gòu)的存儲(chǔ)和查詢效率,搞個(gè)benchmark,然后就可以寫一篇博客。

涼薄 回答

你應(yīng)該先把別人的項(xiàng)目fork到你的倉(cāng)庫(kù),然后你在git clone 你自己的倉(cāng)庫(kù)地址

毀與悔 回答

可以監(jiān)聽onload,iframe有跳轉(zhuǎn)就會(huì)觸發(fā)。
var iframe = document.getElementById('index');
iframe.onload = function() {

console.log(123)

}

慢半拍 回答

python 的文檔:https://docs.python.org/2/lib... 顯示:

The built-in sorted() function is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal — this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade).

即,不改變比較相等的元素的相對(duì)位置。根據(jù)問題給出的 key,237 和 100 是“相等”的,所以它們之間的相對(duì)關(guān)系不會(huì)變化,即 237 在 100 之前。

深記你 回答

把你想保留的數(shù)據(jù)持久化成 Query String 放在 URL 中。

初心 回答

圖片描述

,先npm個(gè)插件extract-text-webpack-plugin;里面的名字你看著改就行了

別硬撐 回答
Lock.acquire([ blocking ] )
獲取鎖定,阻止或不阻止。
當(dāng)調(diào)用阻塞參數(shù)設(shè)置為True(默認(rèn))時(shí),阻塞,直到鎖定解鎖,然后將其設(shè)置為鎖定并返回True。
當(dāng)調(diào)用阻塞參數(shù)設(shè)置為False,不要阻塞。如果阻塞設(shè)置的呼叫True會(huì)阻塞,F(xiàn)alse 立即返回; 否則,將鎖設(shè)置為鎖定并返回True。

所以你可以寫成 if _from.lock.acquire(False): 不阻塞

參考https://docs.python.org/2.7/l...

那你只能js判斷了,當(dāng)在6后面的時(shí)候,動(dòng)態(tài)設(shè)置box-item的橫向滾動(dòng)值

不討囍 回答

已經(jīng)找到問題了, 因?yàn)樵赾ss文件夾下我自己創(chuàng)建了二級(jí)文件夾,但是二級(jí)文件夾沒有權(quán)限 ,所以導(dǎo)致一直是404 ??墒呛芤苫鬄樯稕]報(bào)”沒權(quán)限“問題 。:)

薄荷糖 回答

每次 bind() 都會(huì)生成一個(gè)新的函數(shù)返回出來,所以 a.bind(o) !== a.bind(o)

任她鬧 回答

有的字符就是空白,比如回車,tab,有的顯示成文號(hào),可能是你電腦上沒有這個(gè)字符集吧。

菊外人 回答

for in會(huì)把[__ob__: Observer]當(dāng)成一個(gè)子項(xiàng)進(jìn)行遍歷,所以res.data.list長(zhǎng)度不是4而是5。
解決方法:
1、for in 里面過濾掉:

for(let i in obj){
    if(typeof obj[i] == "undefined") return;
}

2、不要使用for in 方法,改為:

for(let i = 0 ; i < obj.length; i++){
   
}
傻丟丟 回答

不需要桌面的話可以只下載minimal版本的,后續(xù)需要什么就聯(lián)網(wǎng)安裝,如果是新手的話建議下載DVD或者everything版本的,里面自帶的軟件比較多,也有圖形化界面

赱丅呿 回答

使用jsonp返回的數(shù)據(jù)格式要相應(yīng)的調(diào)整下,并非json格式。大致說一下java如何返回使用jsonp請(qǐng)求的數(shù)據(jù)格式吧!

// jsonStr:json格式的數(shù)據(jù)
return  "jsonpCallback(" + jsonStr+ ");" ;

返回使用jsonp請(qǐng)求的數(shù)據(jù)格式大致應(yīng)該是這樣的:

jsonpCallback({
    "url": "1234",
    "name": "abcd"
})

多說一句:如果您使用jsonp單單是為了跨域的話,推薦您使用跨域資源共享 CORS 來跨域,推薦您看下阮一峰大神的博文:http://www.ruanyifeng.com/blo...

忠妾 回答

我也剛看,試了好久,初步知道怎么回事了.
先回答你的兩個(gè)問題:
1、setDaemon所綁定的都是主線程,都是一樣的,即運(yùn)行py文件第一次創(chuàng)建的那個(gè)線程(也是主進(jìn)程),有且只有一個(gè)
2、queue.join()如果單獨(dú)使用會(huì)被無限掛起,字面翻譯為等待隊(duì)列為空,再執(zhí)行別的操作.但是他等待的隊(duì)列不是我們創(chuàng)建的aqueue,而是一個(gè)與aqueue長(zhǎng)度相等的一個(gè)"需要完成的子線程"隊(duì)列,他判斷的很可能是這個(gè)列表,當(dāng)這個(gè)列表為空時(shí)queue.join()才成立,所以如樓上的那位所說queue.join()要結(jié)合aqueue.task_done()函數(shù)來使用,aqueue.task_done()的意思是每task_done一次 就從"需要完成的子線程"隊(duì)列里刪掉一個(gè)元素,這樣在最后join的時(shí)候根據(jù)隊(duì)列長(zhǎng)度是否為零來判斷隊(duì)列是否結(jié)束,aqueue.task_done()用在子線程函數(shù)中,這樣queue.join()才知道完成了多少個(gè)子線程,才不會(huì)無限掛起,也就是為什么你沒退出的原因

但是你的程序也有問題:
主要的問題是,守護(hù)線程機(jī)制:主線程運(yùn)行完畢去結(jié)束子線程時(shí),由于有大量的子線程還在time.sleep(5),結(jié)束這些子線程會(huì)觸發(fā)異常:

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads

Thread 0x000019cc (most recent call first):
  File "test.py", line 13 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

這是因?yàn)?
下面的一些說法是錯(cuò)誤的,可以看我后面的補(bǔ)充,這里就不改了,是一種猜測(cè),但是應(yīng)該確實(shí)不是這樣
喂不飽的子線程:你aqueue.put(i)了是10個(gè)元素,但是卻運(yùn)行了20個(gè)子線程來"吃"這10個(gè)元素,又因?yàn)檫@20個(gè)線程都是守護(hù)進(jìn)程,當(dāng)10個(gè)吃飽了,這個(gè)10個(gè)卡在了item = aqueue.get()等待接受元素,另外的那些很有可能卡在了time.sleep(5)上,而主線程運(yùn)行完畢,準(zhǔn)備結(jié)束所有的守護(hù)進(jìn)程,我判斷,結(jié)束卡在item = aqueue.get()的守護(hù)進(jìn)程不會(huì)報(bào)錯(cuò),而結(jié)束其他程序,如time.sleep會(huì)觸發(fā)異常,這也是為啥樓上那位吧你的for i in range(20):改成了for i in range(1):的原因.

還有兩種退出的方式:
1、是在子線程里判斷隊(duì)列是否為空:

if aqueue.empty() == True:
    break

為空就退出
2、主線程通過queue向子線程發(fā)送退出命令
其實(shí)這里一般用pipe管道的,Queue隊(duì)列不好針對(duì)特定的線程進(jìn)行退出操作,大概的偽碼為:

主線程:

aqueue.put('quit')

子線程""

item = aqueue.get()
if item == 'quit':
    return
else:
    # "do something"

所以多進(jìn)程,多線程還是要控制好程序邏輯,控制好調(diào)度.

我沒用過守護(hù)進(jìn)程,我一般用的是普通的用戶進(jìn)程,這樣主線程跑完會(huì)等待所有子線程運(yùn)行完畢再結(jié)束

其實(shí)還沒完=_=:
后面的都是我的猜測(cè),算是附加的,選修:
這程序的細(xì)節(jié)也值得我們關(guān)注:
這程序如果真去實(shí)踐的話很容易炸,以下都是我的猜測(cè)
如上所述,我們修改程序,注意注釋

import queue
import threading
import time

aqueue = queue.Queue()
# 發(fā)送了0到9的十個(gè)數(shù)據(jù)
for i in range(10):
    aqueue.put(i)

def worker():
    while True:
        # 輸出當(dāng)前線程,和主線程(可以看到主線程都一樣)
        print('thread %s is running...\nmain_thread %s is running...\n\n' % (threading.current_thread().name,threading.main_thread()))
        time.sleep(1)
        item = aqueue.get()
        print(item)
        aqueue.task_done()
        print('thread end')


n = 1
"""注意這!!!!!!!!!!!!!!!!!!"""
# 運(yùn)行了10個(gè)線程來處理這十個(gè)數(shù)據(jù)
for i in range(10):
    print("run thread Counts: ",n)
    n += 1
    a = threading.Thread(target = worker)
    a.setDaemon(True)
    a.start()

aqueue.join()
print('after to do')
print('end')

10個(gè)數(shù)據(jù)10個(gè)線程,time.cleep(5)秒結(jié)果會(huì)怎么樣?運(yùn)行正常?
很不幸運(yùn)的炸了23333333
有一定的幾率報(bào)錯(cuò),和上面一樣:

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads

Thread 0x0000063c (most recent call first):
  File "test.py", line 13 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

我電腦上大部分運(yùn)行正常,只有幾次會(huì)這樣,為什么會(huì)這樣?
換成10個(gè)數(shù)據(jù)9個(gè)線程就不會(huì)出錯(cuò)了
我猜測(cè)的情況是,初步認(rèn)為:
直接看完整的輸出,注意看有注釋的地方:

run thread Counts:  1
thread Thread-1 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  2

thread Thread-2 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  3

thread Thread-3 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  4

thread Thread-4 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  5

thread Thread-5 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  6

thread Thread-6 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  7

thread Thread-7 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  8

thread Thread-8 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  9

thread Thread-9 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

run thread Counts:  10

thread Thread-10 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...


0
1
3
4
thread end
thread end
5
2
thread Thread-2 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

thread end
thread end
thread end
thread Thread-3 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

thread end

thread Thread-4 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

thread Thread-1 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

thread Thread-5 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...





6
8
thread Thread-6 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

thread end
thread end

thread Thread-7 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

7
9
thread Thread-9 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...
"""到這里主線程已經(jīng)完畢"""
thread end
after to do
"""
這里其實(shí)系統(tǒng)在調(diào)用守護(hù)線程的結(jié)束程序來結(jié)束所有子線程
"""
"""但是在結(jié)束守護(hù)進(jìn)程程序后,又運(yùn)行了一個(gè)不該運(yùn)行的子線程,這就是為什么會(huì)報(bào)錯(cuò)的原因"""
thread Thread-10 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

end
thread end


thread Thread-8 is running...
main_thread <_MainThread(MainThread, started 6680)> is running...

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads

Thread 0x00000424 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x00000f04 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x0000165c (most recent call first):
  File "test.py", line 13 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x000018b0 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x00000db4 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x00001a88 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x0000111c (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x0000177c (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x000008e4 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Thread 0x00001788 (most recent call first):
  File "test.py", line 14 in worker
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864 in run
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916 in _bootstrap_inner
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\threading.py", line 884 in _bootstrap

Current thread 0x00001a18 (most recent call first):

看主要的幾句

"""到這里主線程已經(jīng)完畢"""
    thread end
    after to do
    """
    這里其實(shí)系統(tǒng)在調(diào)用守護(hù)線程的結(jié)束程序來結(jié)束所有子線程
    """
    """但是在結(jié)束守護(hù)進(jìn)程程序后,又運(yùn)行了一個(gè)不該運(yùn)行的子線程,這就是為什么會(huì)報(bào)錯(cuò)的原因"""
    thread Thread-10 is running...
    main_thread <_MainThread(MainThread, started 6680)> is running...
    
    end
    thread end

先這樣吧,可以自己運(yùn)行下程序看看

看了另一個(gè)答主的,使用了a.join()也是一種選擇

改成發(fā)送10個(gè)數(shù)據(jù),用9個(gè)線程跑,效率是最高的(理論)

import queue
import threading
import time

aqueue = queue.Queue()
# 發(fā)送了0到9的十個(gè)數(shù)據(jù)
for i in range(10):
    aqueue.put(i)

def worker():
    while True:
        # 輸出當(dāng)前線程,和主線程(可以看到主線程都一樣)
        print('thread %s is running...\nmain_thread %s is running...\n\n' % (threading.current_thread().name,threading.main_thread()))
        time.sleep(5)
        item = aqueue.get()
        print(item)
        aqueue.task_done()
        print('thread end')


n = 1
"""注意這!!!!!!!!!!!!!!!!!!"""
for i in range(9):
    print("run thread Counts: ",n)
    n += 1
    a = threading.Thread(target = worker)
    a.setDaemon(True)
    a.start()

aqueue.join()
print('after to do')
print('end')