鍍金池/ 問(wèn)答
涼汐 回答

11 里面就有 1 啊,按照你的問(wèn)題這樣是對(duì)的啊

不舍棄 回答

debugger時(shí),console當(dāng)前作用域是確實(shí)是函數(shù)內(nèi)部的局部作用域(也是斷點(diǎn)處右鍵evaluate in console可行的原因),因此可以訪(fǎng)問(wèn)name。debugger通過(guò)后,console作用域是全局的,此時(shí)name是window.name瀏覽器自帶的屬性。如果把name改成其他的,就會(huì)報(bào)錯(cuò)了。

不討喜 回答

已解決,const websiteOptions = autoCompleteResult.map(website => {

        <AutoCompleteOption key={website}>{website}</AutoCompleteOption>
    })
   應(yīng)改成:
   const websiteOptions = autoCompleteResult.map(website => (
        <AutoCompleteOption key={website}>{website}</AutoCompleteOption>
    ))
    
    因?yàn)榧^函數(shù)沒(méi)有默認(rèn)return
撥弦 回答

確實(shí),點(diǎn)開(kāi)可以彈出Alert,但是存在執(zhí)行Js不一定就可以拿到cookie,比如HTTP-only

把調(diào)用函數(shù)與回調(diào)函數(shù)分開(kāi)寫(xiě),在window下注冊(cè)回調(diào)函數(shù),讓app去調(diào)用,這樣就可以拿到回調(diào)結(jié)果了。

神曲 回答
var map = new BMap.Map("allmap");
var start = new BMap.Point(114.02597366,22.54605355);
var end = new BMap.Point(114.22597366, 22.59605355);
var driving = new BMap.DrivingRoute(map, { 
    renderOptions: { 
        map: map, 
        autoViewport: true
    },
    onMarkersSet:function(routes) {
        map.removeOverlay(routes[0].marker); //刪除起點(diǎn)
        map.removeOverlay(routes[1].marker);//刪除終點(diǎn)
    }
});
driving.search(start, end);

參考http://lbsyun.baidu.com/cms/j...
onMarkersSet是DrivingRouteOptions的參數(shù),不是renderOptions的

青裙 回答
{
  // `data` is the response that was provided by the server
  data: {},

  // `status` is the HTTP status code from the server response
  status: 200,

  // `statusText` is the HTTP status message from the server response
  statusText: 'OK',

  // `headers` the headers that the server responded with
  // All header names are lower cased
  headers: {},

  // `config` is the config that was provided to `axios` for the request
  config: {},

  // `request` is the request that generated this response
  // It is the last ClientRequest instance in node.js (in redirects)
  // and an XMLHttpRequest instance the browser
  request: {}
}

axios

久礙你 回答

o是生產(chǎn)環(huán)境中壓縮后的變量名
你需要在開(kāi)發(fā)環(huán)境測(cè)一測(cè),看看到底是哪個(gè)變量有問(wèn)題

主要問(wèn)題在于這語(yǔ)句:

<%= form_for([@comment.commentable,@comment]) do |f| %>

這句實(shí)質(zhì)就是<%= form_for([@question, @comment]) do |f| %>
url: "/questions/2/comments" (post請(qǐng)求)
也就是說(shuō)你是給這個(gè)question添加評(píng)論,需要comments控制器,并定義create方法
但是你沒(méi)有定義

選擇 回答

select sum(sl) as sum from (你上面的sql) group by type order by sum;

不將就 回答

這是因?yàn)槟闶褂昧藙?dòng)態(tài)加載組件

傻丟丟 回答

我建議把

os.chdir('/home/nlp/model/IF')
from sklearn.externals import joblib
clf = joblib.load("model.m")
vec = joblib.load("vec.m")
transformer = joblib.load("tfidf.m")
ch2 = joblib.load("ch2.m")

中的os.chdir('/home/nlp/model/IF')刪掉
使用絕對(duì)路徑導(dǎo)入包:

from sklearn.externals import joblib
basedir = '/home/nlp/model/IF'
clf = joblib.load(os.path.join(basedir,"model.m"))
vec = joblib.load(os.path.join(basedir, "vec.m"))
transformer = joblib.load(os.path.join(basedir, "tfidf.m"))
ch2 = joblib.load(os.path.join(basedir, "ch2.m"))

os.path.join(basedir, "filename.m")寫(xiě)成一個(gè)函數(shù)也是個(gè)不錯(cuò)的選擇:

def abspath(filename):
    basedir = '/home/nlp/model/IF'
    return os.path.join(basedir, filename)

vec = joblib.load(abspath("vec.m"))

之所以會(huì)出現(xiàn)can't open file 'RFIFL.py': [Errno 2] No such file or directory, 是因?yàn)橐婚_(kāi)始用os.chdir()改變了基礎(chǔ)路徑, 而app = Flask(__name__), 在修改的路徑中我們找不到/home/nlp/model/IF/RFIFL.py入口文件.

有你在 回答

其實(shí) es6 的 let 根本沒(méi)抓住問(wèn)題的本質(zhì)

關(guān)鍵在于 js 作為一個(gè)允許副作用的語(yǔ)言,它的 closure 卻只支持引用外層作用域的變量,而不支持「引用」外層作用域中變量的值

C++ 就沒(méi)有這個(gè)問(wèn)題~

#include <functional>
#include <iostream>

using namespace std;

int main() {
  function<void()> a[10];
  for (int i = 0; i < 10; i++) {
    a[i] = [i] () {
      cout << i << '\n';
    };
  }
  a[6](); // 6
}

之所以出現(xiàn)這個(gè)反直覺(jué)的現(xiàn)象,就是因?yàn)槟隳?10 個(gè)函數(shù)引用的都是同一個(gè) i 變量,而這個(gè)變量的值是 for 循環(huán)最后一次執(zhí)行時(shí)的值,也就是 10。

硬扛 回答

Already installed……不行就先移除一下重裝唄