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

鍍金池/ 問答
安于心 回答

http://www.ruanyifeng.com/blo...

可以看這一系列文章,介紹了六種算法,你可以根據(jù)你的實(shí)際來調(diào)整

其實(shí)你自己的方法也并無不可,只不過從時(shí)間維度上來講,這樣越早的文章越容易得到推薦,這對新的文章不公平

陌顏 回答

你的id沒掛載上去吧

class Input extends React.PureComponent {
  render() {
    return <input id={this.props.id} type="text"/>;
  }
}

另外建議用ref或者用props傳遞

this.state={
    aaa:false
}//改變aaa

<Input readOnly={this.state.aaa}/>

class Input extends React.PureComponent {
  render() {
    return <input  type="text" readOnly={this.props.readOnly}/>;
  }
}
命多硬 回答

如果你這么寫條件:WHERE user_name > 'haha' AND age = 50 AND gender = 1,那么索引就應(yīng)該建為:(age, gender, user_name)。

原因很簡單:復(fù)合索引的第一個(gè)列就用大于或小于,后面的列就廢掉了。

心癌 回答

上面的方法設(shè)有形參變量,方法內(nèi)部的代碼執(zhí)行操作的是這個(gè)形參。而下面的方法,沒有設(shè)形參,也沒有var一個(gè)a,所以在函數(shù)內(nèi)部操作a的時(shí)候會從當(dāng)前方法的上一作用域找這個(gè)a,然后就找window下的a了,之后的操作都是對全局下的a進(jìn)行的操作,所以兩次的結(jié)果不一樣。

眼雜 回答

functional組件,render函數(shù)了解一下

熊出沒 回答

仿照 os.walk 寫了一個(gè) generator lwalk, 他的行為如同 os.walk 但是多了一個(gè) max_level 可以控制最大的遍歷深度, 為了與 os.walk 盡量吻合, 我也實(shí)作了 topdownfollowlinks 這兩個(gè) arguments, 但為了不使 code 太過複雜, 我省略了 onerror 參數(shù)的實(shí)作以及若干 error handling。

代碼如下:

import os

def lwalk(top, topdown=True, followlinks=False, max_level=None):
    if max_level is None:
        new_max_level = None
    else:
        if max_level==0:
            return
        else:
            new_max_level = max_level-1
    top = os.fspath(top)
    dirs, nondirs, walk_dirs = [], [], []
    with os.scandir(top) as it:
        for entry in it:
            if entry.is_dir():
                dirs.append(entry.name)
            else:
                nondirs.append(entry.name)
            if not topdown and entry.is_dir():
                if followlinks or not entry.is_symlink():
                    walk_dirs.append(entry.path)
        if topdown:
            yield top, dirs, nondirs
            for dirname in dirs:
                new_path = os.path.join(top, dirname)
                if followlinks or not os.path.islink(new_path):
                    yield from lwalk(new_path, topdown, followlinks, new_max_level)
        else:
            for new_path in walk_dirs:
                yield from lwalk(new_path, topdown, followlinks, new_max_level)
            yield top, dirs, nondirs

簡單的範(fàn)例如下:

for root, dirs, files in lwalk('YOUR_TOP_PATH', max_level=4):
    print(root, dirs, files)

一些說明:

  1. 核心在於使用 os.scandir 來保證系統(tǒng)遍歷的效率

  2. 使用 max_level 來控制最大遍歷深度, 在 recursively 進(jìn)入下一層的時(shí)候, 將最大深度減 1

  3. 要實(shí)作 buttom up, 則需先 recursively 進(jìn)入下一層再 yield 目錄與文件

這邊有一個(gè)省略掉 topdown, followlink 和若干處理的簡單版本, 可以幫助你觀察一下核心的實(shí)作手段:

import os

def lwalk(top, max_level=10000):
    if max_level==0:
        return
    dirs, nondirs = [], []
    with os.scandir(top) as it:
        for entry in it:
            if entry.is_dir():
                dirs.append(entry.name)
            else:
                nondirs.append(entry.name)
        yield top, dirs, nondirs
        for dirname in dirs:
            new_path = os.path.join(top, dirname)
            yield from lwalk(new_path, max_level-1)
                       
for root, dirs, files in lwalk('a', max_level=4):
    print(root, dirs, files)

我回答過的問題: Python-QA

冷咖啡 回答

總覺得是你的換行符被替換成空格的問題

撥弦 回答

[ngStyle]="{width: canvasWidth}"

冷咖啡 回答

vue里直接修改數(shù)組某項(xiàng)的值,vue檢測不到變化,不知道你說的修改不了是不是console.log打印出來的值沒有變,還是頁面上的數(shù)據(jù)沒有變
https://cn.vuejs.org/v2/guide...

互擼娃 回答

你不要把寬度寫死么,用個(gè)百分比,配合媒體查詢,ie8不支持要引入Respond.js

傻丟丟 回答
  • 問題描述不清晰
  • 你要列舉遇到了哪些問題,才能給你準(zhǔn)確的建議
  • 直接貼代碼,沒有任何說明,看不明白你到底要問什么
  • 建議先描述一下具體問題
你好胸 回答
window.addEventListener("scroll",function(){
            var stop = document.documentElement.clientHeight;
                console.log(stop)
            if(stop > 100 &&  stop< 500){
                
            }
        })

這樣沒問題啊

熟稔 回答

你把res.status打印出來看看,alert應(yīng)該不會有問題。

亮瞎她 回答

arr.sort(a => a%2 === 0); 但這種是不穩(wěn)定排序, 因?yàn)閟ort內(nèi)部使用快排, 快排本身不穩(wěn)定.
需要穩(wěn)定排序的話就歸并或者冒泡這些, 判斷條件改一下即可

鹿惑 回答

加載順序Listener -> Filter -> servlet , 你的service層的實(shí)例化是通過ContextLoaderListener或者DispatchServlet為入口的,你自定義的Listener去獲取Bean的時(shí)候還沒創(chuàng)建,因?yàn)閘istener的加載順序并不是按照web.xml里的配置順序來的。
方案一:你要是想獲取Bean可以用spring 的 ApplicationListener ,這個(gè)類的用法網(wǎng)上很多可以去搜搜
方案二:既然listener的順序是不固定的,那么我們可以整合兩個(gè)listener到一個(gè)類中,這樣就可以讓初始化的順序固定了。繼承org.springframework.web.context.ContextLoaderListener然后重寫了這個(gè)類的 contextInitialized方法.大致代碼如下:

public class MyContextLoaderListener extends ContextLoaderListener {  
    private ECSManageService ecsManageService;
    @Override  
    /** 
     * 重寫ContextLoaderListener的contextInitialized方法 
     */  
    public void contextInitialized(ServletContextEvent event) { 
        //保證spring的初始化在前 
        super.contextInitialized(event);  
        ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());  
        //獲取bean  
        ecsManageService = (ECSManageService)applicationContext.getBean("stationService");    
        /*具體地業(yè)務(wù)代碼 */  
    }  
} 

試試吧,希望能夠幫到你

雅痞 回答

用iframe全部重新實(shí)現(xiàn)一遍

夢若殤 回答

viewport 設(shè)置沒

熟稔 回答

getDetailInfo中echo的字符串作為結(jié)果返回給上層的detail_info變量了。 bash-x不是看得很清楚嗎