思路:
實現(xiàn):
$numbers = ['17', '38', '12', '40', '20', '47', '45', '22', '02', '19', '29', '10', '27', '41', '26', '47', '18', '24', '22', '27', '33', '47', '25', '09', '16', '32', '01', '28', '18', '38'];
// 單雙數(shù)組
$oddEven = ['1', '2', '2', '2', '2', '1', '1', '2', '2', '1', '1', '2', '1', '1', '2', '1', '2', '2', '2', '1', '1', '1', '1', '1', '2', '2', '1', '2', '2', '2'];
$oddEvenStrs = implode("", $oddEven);
// 匹配數(shù)組
$matchArr = ['1', '2', '2', '2'];
$matchArrStrs = implode("", $matchArr);
var_dump($oddEvenStrs);
var_dump($matchArrStrs);
var_dump(count($numbers));
function findIt($from, $find, $numbers, $pos)
{
$result = '';
$pos = strpos($from, $find, $pos);
if ($pos !== false) {
$result .= implode(",", array_slice($numbers, $pos, 4));
$pos += 4;
}
if (count($numbers) > $pos)
{
return $result . "," . findIt($from, $find, $numbers, $pos);
}
return $result;
}
$result = findIt($oddEvenStrs, $matchArrStrs, $numbers, 0);
echo $result;
var_dump(explode(",", $result));
mounted window.addEventListener("scroll", func)
destroyed window.removeEventListener("scroll", func)
問題的原因找到了:
我的代碼是因為存在 遞歸導(dǎo)致的棧溢出,進(jìn)而導(dǎo)致視圖布局出錯。我的項目中存在一個側(cè)邊菜單,我使用當(dāng)前路由對象的 matched
數(shù)組進(jìn)行菜單比對,結(jié)果導(dǎo)致了棧溢出。
最終的解決辦法是:在比對菜單的時候優(yōu)先比對路徑(path
),如果路徑一致,則繼續(xù)比對參數(shù)(query
),修改后的代碼僅有10幾次循環(huán)操作,頁面在沒出現(xiàn)嵌套出錯的情況了。類似查找某人,先排除姓、再排除名,最后確認(rèn)性別,逐漸縮小循環(huán)的層級。
已解決:
import threading
import time
def test1():
while True:
print '111111111111'
time.sleep(2)
def test2():
while True:
print '22222222222'
time.sleep(10)
print '222222222222end'
break
return
def test3():
thread_list_all = threading.enumerate()
while True:
thread_list1 = threading.enumerate()
thread_list_number = len(thread_list1)
if thread_list_number < 4:
dead_thread = list(set(thread_list_all).difference(set(thread_list1)))
for item_thread in dead_thread:
fun_name = item_thread.getName()
if fun_name == 'test1':
t1 = threading.Thread(target=test1,name='test1')
t1.start()
t1.join()
elif fun_name == 'test2':
t2 = threading.Thread(target=test2,name='test2')
t2.start()
t2.join()
time.sleep(1)
t1 = threading.Thread(target=test1,name='test1')
t2 = threading.Thread(target=test2,name='test2')
while True:
if t1.isAlive() is False:
t1 = threading.Thread(target=test1,name='test1')
t1.start()
# t1.join()
if t2.isAlive() is False:
t2 = threading.Thread(target=test2,name='test2')
t2.start()
# t2.join()
監(jiān)聽127.0.0.1就好了。ddos和這個沒關(guān)系,要看具體是ddos什么
crtl + shift + p 輸入liveReload 點(diǎn)擊下是看看,我之前也是這個問題
hostname:my-rabbit
就可以
應(yīng)用創(chuàng)建的文件并不繼承應(yīng)用程序本身的所有者和所有組,而是繼承進(jìn)程的所有者。
一般來說,誰啟動這個程序,那么程序創(chuàng)建的文件的所有者就是誰。
當(dāng)然有個別程序為了安全,在啟動以后會降權(quán),比如nginx。通俗的說,就是使用root啟動nginx以后,nginx會在獲取到需要的資源以后,把自己設(shè)置為普通用戶權(quán)限,因此nginx創(chuàng)建的文件的所有者應(yīng)該也是普通用戶。
PS: 查看進(jìn)程的所有者可以使用top或者ps
top:
ps:
>&2 echo "error"
意思是將標(biāo)準(zhǔn)錯誤重定向到標(biāo)準(zhǔn)輸入.
svn diff -r ?
ifconfig eth0 |grep -i hwaddr|sed "s/.*HWaddr[[:space:]]\+\([a-z0-9\:]*\).*/\1/"
你源碼根目錄不是有個server.js 文件嗎,把他仍在服務(wù)器才可以。。。。github pages 不能跑node,我這個可能會對你有幫助https://github.com/forzeny/Mu...
JS文件加載完畢后,
第一步,文件中root級的、并且沒有使用任何關(guān)鍵字定義的變量 ,被當(dāng)做全局變量優(yōu)先賦值。
第二步,所有單獨(dú)定義的function xxx()
聲明生效
第三步,其他部分按照js中寫的代碼邏輯,開始順序執(zhí)行
文件加載過程中,內(nèi)容還不全,不涉及到變量和函數(shù)聲明的處理。
ubuntu可以讀取ntfc格式的分區(qū),所以可以操作(我之前有一些windows下的頑固文件實在ubuntu下刪除的),但是windows默認(rèn)不識別ext文件系統(tǒng)
如果用匿名代理的話,你肯定拿不到攻擊者真實IP的,我覺得用匿名代理應(yīng)該是黑客的基本素質(zhì)吧。
:hi SpellBad ctermbg=yellow
還可以設(shè)置下劃線,前景色什么都可以,如果設(shè)置亂了,可以用
:hi clear SpellBad
清掉從頭來過
首先 json_decode($data, TRUE),之后直接取$data['restaurant']['dishes-select']['options'
], 如果你非要循環(huán),那就用遞歸函數(shù)
nginx 可以由一個特殊的 X-Accel-Redirect
頭部控制資源訪問。
所以可以直接 proxy_pass 到 upstream, upstream 根據(jù)請求動態(tài)生成文件路徑,添加到X-Accel-Redirect: /path/to/file
頭部,nginx取回上游返回后,內(nèi)部跳轉(zhuǎn)/path/to/file
, 這是一個內(nèi)部跳轉(zhuǎn),外部不可見的,你還可以添加 internal
指令控制該文件不可直接訪問。
服務(wù)端加上一個允許跨域的響應(yīng)頭就好了
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。