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

鍍金池/ 問(wèn)答
枕頭人 回答

創(chuàng)建一個(gè) object URL, 然后將其設(shè)置為video標(biāo)簽src屬性的值:

var URL = window.URL || window.webkitURL
videoNode.src = URL.createObjectURL(file)
陌顏 回答

問(wèn)題描述的不夠清晰啊,32->16 16->16 冪等?

萌小萌 回答

你直接將txt的代碼復(fù)制出來(lái)、

在vs新建一個(gè)cs文件,將代碼復(fù)制進(jìn)去,編譯不就行了、

憶往昔 回答

建議在flvjs.isSupported()后接個(gè)判斷 看看是否機(jī)器不支持

if(flvjs.isSupported()){
    //balabala
}else{
    alert("this phone is not support")
}
舊顏 回答

一、reduce

var total = [0,1,2,3,4].reduce((a, b)=>a + b); //10
reduce接受一個(gè)函數(shù),函數(shù)有四個(gè)參數(shù),分別是:
  • 1、上一次的值;
  • 2、當(dāng)前值;
  • 3、當(dāng)前值的索引;
  • 4、數(shù)組;
我們還是以上面那個(gè)數(shù)組為例,把這幾個(gè)參數(shù)打印出來(lái)看看:
[0, 1, 2, 3,4].reduce(function(previousValue, currentValue, index, array){
 return previousValue + currentValue;
});
reduce 還可以扁平化一個(gè)二維數(shù)組
var flattened = [[0, 1], [2, 3], [4, 5]].reduce(function(a, b) {
 return a.concat(b);
}, []);
// flattened == [0, 1, 2, 3, 4, 5]

二、splice

splice()
方法向/從數(shù)組中添加/刪除項(xiàng)目,然后返回被刪除的項(xiàng)目
[1,2,3,4,5].splice(2,0,9);
//[1,2,9,3,4,5]
[1,2,3,4,5].splice(2,2,9);
//[1,2,9,5]

三、concat

在現(xiàn)有數(shù)組后面追加數(shù)組,并返回新數(shù)組,不影響現(xiàn)有數(shù)組。
var arra = [1,2,3];
var arrb = [4,5,6];
var arrc = arra.concat(arrb);
//[1, 2, 3, 4, 5, 6]

四、join

用指定間隔符連起來(lái),把數(shù)組轉(zhuǎn)為字符串。
var arrstr = ['a','b','c','d','e','f','g'];
arrstr.join("*");
///"a*b*c*d*e*f*g"
但需要注意的是只轉(zhuǎn)換一維數(shù)組里面,如果數(shù)組里面還有數(shù)組,將不是采用join指定的字符串接,而是采用默認(rèn)的toString();
var a = ['a','b','c','d','e','f','g',[11,22,33]];
a.join("*");  
// -> a * b * c * d * e * f * g *    11,22,33

五、pop shift unshift

1.pop:刪除數(shù)組最后一個(gè)元素,并返回該元素

var a = ["aa","bb","cc"];
a.pop();  //cc

2.shift:刪除數(shù)組第一個(gè)元素,并返回該元素

var a = ["aa","bb","cc"];
a.shift();   
// -> aa
a
// -> bb,cc

==注:當(dāng)數(shù)組為空時(shí),返回undefined==

3.unshift:跟shift相反,往數(shù)組最前面添加元素,并返回?cái)?shù)組新長(zhǎng)度。

var a = ["aa","bb","cc"];
a.unshift();
//4 注:IE下返回undefined

六、sort reverse

1.sort: ANSI碼正序;

var a = [11,2,3,33445,5654,654,"asd","b"];
a.sort() // -> 11,2,3,33445,5654,654,asd,b

2.reverse :ANSI碼倒序;

var a = [11,3,5,66,4];
a.reverse();  
// -> 4,66,5,3,11
==如果數(shù)組里面還包含數(shù)組,則當(dāng)為對(duì)象處理,并不會(huì)把元素解出來(lái)==
var a = ['a','b','c','d','e','f','g',[4,11,33]];
a.reverse(); 
// -> 4,11,33,g,f,e,d,c,b,a
a.join(" * "); 
// -> 4,11,33 * g * f * e * d * c * b * a

七、slice splice

1.slice:返回?cái)?shù)組片段

var a = ['a','b','c','d','e','f','g'];
alert(a.slice(1,2));  // -> b
alert(a.slice(2));    // -> c,d,e,f,g
alert(a.slice(-4));   // -> d,e,f,g
alert(a.slice(-2,-6));    // -> 空

2.splice:從數(shù)組刪除某片段的元素,并返回刪除的元素

var a = [1,2,3,4,5,6,7,8,9];
document.write(a.splice(3,2));    // -> 4,5
document.write(a);        // -> 1,2,3,6,7,8,9
document.write(a.splice(4));  // -> 7,8,9 注:IE下返回空
document.write(a);        // -> 1,2,3,6
document.write(a.splice(0,1));    // -> 1
document.write(a);        // -> 2,3,6
document.write(a.splice(1,1,["aa","bb","cc"]));   // -> 3
document.write(a);        // -> 2,aa,bb,cc,6,7,8,9
document.write(a.splice(1,2,"ee").join("#")); // -> aa,bb,cc#6
document.write(a);        // -> 2,ee,7,8,9
document.write(a.splice(1,2,"cc","aa","tt").join("#"));  // -> ee#7
document.write(a);        // -> 2,cc,aa,tt,8,9
==注:注意該方法在IE下,第二個(gè)參數(shù)是必須的,不填則默認(rèn)為0,例如a.splice(4),在IE下則返回空,效果等同于a.splice(4,0)==

八、toString toLocaleString valueOf

1.toString:把數(shù)組轉(zhuǎn)為字符串,不只數(shù)組,所有對(duì)象均可使用該方法

var a = [1,2,[3,4],5];
a.toString();
//1,2,3,4,5

var b = 10;
b.toString(2);
// 1010   2進(jìn)制轉(zhuǎn)換

var a =    [5,6,7,8,9,["A","BB"],100];
document.write(a.toString());    // -> 5,6,7,8,9,A,BB,100
var b = new Date()
document.write(b.toString());    // -> Sat Aug 8 17:08:32 UTC+0800    2009
var c = function(s){
alert(s);
}
document.write(c.toString());    // -> function(s){ alert(s); }
布爾值則返回true或false,對(duì)象則返回[object objectname]
相比join()方法,join()只對(duì)一維數(shù)組進(jìn)行替換,而toString()則把整個(gè)數(shù)組(不管一維還是多維)完全平面化
同時(shí)該方法可用于10進(jìn)制、2進(jìn)制、8進(jìn)制、16進(jìn)制轉(zhuǎn)換,例如:
var a =  [5,6,7,8,9,"A","BB",100];
for(var i=0; i<a.length; i++){
document.write(a[i].toString()    + " 的二進(jìn)制是 "    + a[i].toString(2) + " ,八進(jìn)制是 " + a[i].toString(8) + " ,十六進(jìn)制是 " + a[i].toString(16));  //    -> 4,5
}
/**
5 的二進(jìn)制是 101 ,八進(jìn)制是 5 ,十六進(jìn)制是 5
6 的二進(jìn)制是 110 ,八進(jìn)制是 6 ,十六進(jìn)制是 6
7 的二進(jìn)制是 111 ,八進(jìn)制是 7 ,十六進(jìn)制是 7
8 的二進(jìn)制是 1000 ,八進(jìn)制是 10 ,十六進(jìn)制是 8
9 的二進(jìn)制是 1001 ,八進(jìn)制是 11 ,十六進(jìn)制是 9
A 的二進(jìn)制是 A ,八進(jìn)制是 A ,十六進(jìn)制是 A
BB 的二進(jìn)制是 BB ,八進(jìn)制是 BB ,十六進(jìn)制是 BB
100 的二進(jìn)制是 1100100 ,八進(jìn)制是 144 ,十六進(jìn)制是 64
*/
==注:轉(zhuǎn)換只能在元素進(jìn)行,如果對(duì)整個(gè)數(shù)組進(jìn)行轉(zhuǎn)換,則原封不動(dòng)返回該數(shù)組==

2.toLocaleString:返回本地格式字符串,主要用在Date對(duì)象上

var a = new Date();
document.write(a.toString());    // -> Sat Aug 8 17:28:36 UTC+0800    2009
document.write(a.toLocaleString());   // -> 2009年8月8日 17:28:36
document.write(a.toLocaleDateString());   // -> 2009年8月8日

區(qū)別在于,toString()返回標(biāo)準(zhǔn)格式,toLocaleString()返回本地格式完整日期(在【控制面板】>>【區(qū)域和語(yǔ)言選項(xiàng)】,通過(guò)修改[時(shí)間]和[長(zhǎng)日期]格式),toLocaleDateString()跟toLocaleString()一樣,只是少了時(shí)間

3.valueOf:根據(jù)不同對(duì)象返回不同原始值,用于輸出的話(huà)跟toString()差不多,但是toString()是返回string類(lèi)型,而valueOf()是返回原對(duì)象類(lèi)型

var a = [1,2,3,[4,5,6,[7,8,9]]];
var b = new Date();
var c = true;
var d = function(){
alert("sunnycat");
};
document.write(a.valueOf());    // -> 1,2,3,4,5,6,7,8,9
document.write(typeof (a.valueOf()));  // -> object
document.write(b.valueOf());    // -> 1249874470052
document.write(typeof(b.valueOf()));  // -> number
document.write(c.valueOf());    // -> true
document.write(typeof(c.valueOf()));  // -> boolean
document.write(d.valueOf());    // -> function () {    alert("sunnycat"); }
document.write(typeof(d.valueOf()));  // -> function
數(shù)組也是對(duì)象,所以typeof (a.valueOf())返回object,返回的依然是個(gè)多維數(shù)組
var a = [1,2,3,[4,5,6,[7,8,9]]];
var aa = a.valueOf();
document.write(aa[3][3][1]); // -> 8
==注:Date對(duì)象返回的是距離1970年1月1日的毫秒數(shù),Math和Error對(duì)象沒(méi)有valueOf方法==

九、every() filter() find() some() includes()

1.every

array.every(function(currentValue,index,arr), thisValue)
  • currentValue 必須。當(dāng)前元素的值
  • index 可選。當(dāng)期元素的索引值
  • arr 可選。當(dāng)期元素屬于的數(shù)組對(duì)象

  • every() 方法用于檢測(cè)數(shù)組所有元素是否都符合指定條件(通過(guò)函數(shù)提供)。
  • every() 方法使用指定函數(shù)檢測(cè)數(shù)組中的所有元素:
如果數(shù)組中檢測(cè)到有一個(gè)元素不滿(mǎn)足,則整個(gè)表達(dá)式返回 false ,且剩余的元素不會(huì)再進(jìn)行檢測(cè)。
如果所有元素都滿(mǎn)足條件,則返回 true。
  • 注意: every() 不會(huì)對(duì)空數(shù)組進(jìn)行檢測(cè)。
  • 注意: every() 不會(huì)改變?cè)紨?shù)組。
var a = [1,2,3,4,5];
function checkAdult(num){
    return num > 0
}
a.every(checkAdult);
//true
/**
array.every(function(currentValue,index,arr), thisValue)
currentValue    必須。當(dāng)前元素的值
index            可選。當(dāng)期元素的索引值
arr                可選。當(dāng)期元素屬于的數(shù)組對(duì)象
*/

2.filter

filter() 方法創(chuàng)建一個(gè)新的數(shù)組,新數(shù)組中的元素是通過(guò)檢查指定數(shù)組中符合條件的所有元素。

  • 注意: filter() 不會(huì)對(duì)空數(shù)組進(jìn)行檢測(cè)。
  • 注意: filter() 不會(huì)改變?cè)紨?shù)組。
ar ages = [32, 33, 16, 40];

function checkAdult(age) {
    return age >= 18;
}

function myFunction() {
    document.getElementById("demo").innerHTML = ages.filter(checkAdult);
}
//32,33,40

3.find

array.find(function(currentValue, index, arr),thisValue)

find() 方法返回傳入一個(gè)測(cè)試條件(函數(shù))符合條件的數(shù)組第一個(gè)元素。
find() 方法為數(shù)組中的每個(gè)元素都調(diào)用一次函數(shù)執(zhí)行:
當(dāng)數(shù)組中的元素在測(cè)試條件時(shí)返回 true 時(shí), find() 返回符合條件的元素,之后的值不會(huì)再調(diào)用執(zhí)行函數(shù)。
如果沒(méi)有符合條件的元素返回 undefined

  • 注意: find() 對(duì)于空數(shù)組,函數(shù)是不會(huì)執(zhí)行的。
  • 注意: find() 并沒(méi)有改變數(shù)組的原始值。
var ages = [3, 10, 18, 20];
 
function checkAdult(age) {
    return age >= 18;
}
 
function myFunction() {
    document.getElementById("demo").innerHTML = ages.find(checkAdult);
}
//18

4.some

array.some(function(currentValue,index,arr),thisValue)
  • some() 方法用于檢測(cè)數(shù)組中的元素是否滿(mǎn)足指定條件(函數(shù)提供)
  • 如果有一個(gè)元素滿(mǎn)足條件,則表達(dá)式返回true , 剩余的元素不會(huì)再執(zhí)行檢測(cè)。

5.includes

Array.prototype.includes方法返回一個(gè)布爾值,表示某個(gè)數(shù)組是否包含給定的值,與字符串的includes方法類(lèi)似。ES2016 引入了該方法。
  • indexOf方法有兩個(gè)缺點(diǎn),一是不夠語(yǔ)義化,它的含義是找到參數(shù)值的第一個(gè)出現(xiàn)位置,所以要去比較是否不等于-1,表達(dá)起來(lái)不夠直觀。二是,它內(nèi)部使用嚴(yán)格相等運(yùn)算符(===)進(jìn)行判斷,這會(huì)導(dǎo)致對(duì)NaN的誤判。[NaN].indexOf(NaN)

// -1

[1, 2, 3].includes(2)     // true
[1, 2, 3].includes(4)     // false
[1, 2, NaN].includes(NaN) // true
下面代碼用來(lái)檢查當(dāng)前環(huán)境是否支持該方法,如果不支持,部署一個(gè)簡(jiǎn)易的替代版本。
const contains = (() =>
  Array.prototype.includes
    ? (arr, value) => arr.includes(value)
    : (arr, value) => arr.some(el => el === value)
)();
contains(['foo', 'bar'], 'baz'); // => false
另外,Map 和 Set 數(shù)據(jù)結(jié)構(gòu)有一個(gè)has方法,需要注意與includes區(qū)分。
  • Map 結(jié)構(gòu)的has方法,是用來(lái)查找鍵名的,比如Map.prototype.has(key)、WeakMap.prototype.has(key)、Reflect.has(target, propertyKey)。
  • Set 結(jié)構(gòu)的has方法,是用來(lái)查找值的,比如Set.prototype.has(value)、WeakSet.prototype.has(value)。

十、fill

array.fill(value, start, end)
  • fill() 方法用于將一個(gè)固定值替換數(shù)組的元素
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.fill("Runoob");
//Runoob,Runoob,Runoob,Runoob

十一、entries() keys() values()

ES6 提供三個(gè)新的方法——entries(),keys()和values()——用于遍歷數(shù)組。它們都返回一個(gè)遍歷器對(duì)象(詳見(jiàn)《Iterator》一章),可以用for...of循環(huán)進(jìn)行遍歷,唯一的區(qū)別是keys()是對(duì)鍵名的遍歷、values()是對(duì)鍵值的遍歷,entries()是對(duì)鍵值對(duì)的遍歷。
for (let index of ['a', 'b'].keys()) {
  console.log(index);
}
// 0
// 1

for (let elem of ['a', 'b'].values()) {
  console.log(elem);
}
// 'a'
// 'b'

for (let [index, elem] of ['a', 'b'].entries()) {
  console.log(index, elem);
}
// 0 "a"
// 1 "b"

十二、Array.from()

類(lèi)數(shù)組對(duì)象轉(zhuǎn)數(shù)組
let arrayLike = {
  '0': 'a',
  '1': 'b',
  '2': 'c',
  length: 3
};

// TypeError: Cannot spread non-iterable object.
let arr = [...arrayLike];

十三、Array.of()

  • Array.of方法用于將一組值,轉(zhuǎn)換為數(shù)組
Array.of(3, 11, 8) // [3,11,8]
Array.of(3) // [3]
Array.of(3).length // 1
Array.of() // []
Array.of(undefined) // [undefined]
Array.of(1) // [1]
Array.of(1, 2) // [1, 2]

//模擬實(shí)現(xiàn)
function ArrayOf(){
  return [].slice.call(arguments);
}
初心 回答

可以在input[name="max"]輸入后blur時(shí)加個(gè)判斷,如果輸入小于input[name="min"]就清空或設(shè)定默認(rèn)值,提示用戶(hù)重新輸入。同理在input[name="min"]輸入后blur時(shí)加個(gè)判斷,如果輸入大于input[name="max"]時(shí)也清空或設(shè)定默認(rèn)值,提示用戶(hù)重新輸入。

ie8,不要用flex,不要用CSS3,不要用漸變背景……
基本只能按照上世紀(jì)float去寫(xiě)頁(yè)面吧。

拽很帥 回答

這是一個(gè)react-native的腳手架工具,比官方的腳手架工具多了很多東西,可以快速創(chuàng)建react native的項(xiàng)目,同時(shí)包含了react-native的最佳實(shí)踐,能快速添加刪除插件

乖乖噠 回答

1. 關(guān)于 pyo 優(yōu)化:

參考鏈接

  • When the Python interpreter is invoked with the -O flag, optimized code is generated and stored in .pyo files. The optimizer currently doesn't help much; it only removes assert statements. When -O is used, all bytecode is optimized; .pyc files are ignored and .py files are compiled to optimized bytecode.
  • Passing two -O flags to the Python interpreter (-OO) will cause the bytecode compiler to perform optimizations that could in some rare cases result in malfunctioning programs. Currently only __doc__ strings are removed from the bytecode, resulting in more compact .pyo files. Since some programs may rely on having these available, you should only use this option if you know what you're doing.
  • Your program doesn't run any faster when it is read from a .pyc or .pyo file than when it is read from a .py file; the only thing that's faster about .pyc or .pyo files is the speed with which they are loaded.
  • When a script is run by giving its name on the command line, the bytecode for the script is never written to a .pyc or .pyo file. Thus, the startup time of a script may be reduced by moving most of its code to a module and having a small bootstrap script that imports that module. It is also possible to name a .pyc or .pyo file directly on the command line.

2. 關(guān)于 pyd:

pyd 可以理解為 Windows DLL 文件。

參考鏈接

  • Yes, .pyd files are dll’s, but there are a few differences. If you have a DLL named foo.pyd, then it must have a function PyInit_foo(). You can then write Python "import foo", and Python will search for foo.pyd (as well as foo.py, foo.pyc) and if it finds it, will attempt to call PyInit_foo() to initialize it. You do not link your .exe with foo.lib, as that would cause Windows to require the DLL to be present.
  • Note that the search path for foo.pyd is PYTHONPATH, not the same as the path that Windows uses to search for foo.dll. Also, foo.pyd need not be present to run your program, whereas if you linked your program with a dll, the dll is required. Of course, foo.pyd is required if you want to say import foo. In a DLL, linkage is declared in the source code with __declspec(dllexport). In a .pyd, linkage is defined in a list of available functions.
小眼睛 回答

input不設(shè)置confirm-hold這個(gè)屬性輸入完成后可以收起輸入鍵盤(pán),或者在data里面給一個(gè) confirmHold: false,在input里面設(shè)置 confirm-hold="{{confirmHold}}"這樣也是可以的,直接寫(xiě)成confirm-hold="false"好像有點(diǎn)問(wèn)題的,confirm-hold接受Boolean類(lèi)型的參數(shù),直接寫(xiě)出這樣會(huì)把這個(gè)當(dāng)字符串.type是number時(shí),你可以綁定input輸入框,檢測(cè)到你想要的結(jié)果時(shí)直接調(diào)用wx.hideKeyboard()

懶洋洋 回答

ELK吧?官方的文檔沒(méi)毛病啊我就是這么掛載的,我這里還新增了log的掛載。

- /elasticsearch/data:/usr/share/elasticsearch/data
- /elasticsearch/logs:/usr/share/elasticsearch/logs

另外可以參考docker-elk

初心 回答

首先看文檔的例子 https://reacttraining.com/rea...

然后是我自己寫(xiě)的

<div className="App">

      <Router>
          {/*<div>*/}
          {/*<div>*/}
              {/*<NavLink to='/' > one_ </NavLink>*/}
              {/*<Link to='/page2' children='halo'  />*/}
          {/*</div>*/}
        {/*<Route path='/' component={Page1} />*/}
          {/*</div>*/}
         <Route  render={ ({location}) => (
             <div style={{'position': 'absolute', 'top': 0}} >
                 <div>
                     <ul>
                         <li> <Link to='/page1' children='page1' /> </li>
                         <li> <Link to='/page2' children='page2' /> </li>
                     </ul>
                 </div>
             <Route exact={true} to='/' render={ () => (
                 <Redirect to='/page1' />
             ) } />
                 <div style={{'position': 'absolute', 'top': '60px'}} >
                     <CSSTransitionGroup
                         transitionName="example"
                         transitionEnterTimeout={500}
                         transitionLeaveTimeout={500}
                     >
                         <Route
                            location={location}
                            key={location.key}
                            path='/:path'
                            component={getCom}
                         />
                     </CSSTransitionGroup>
                 </div>
             </div>
         ) }  />
      </Router>
  </div>
  
  我之前用的方法不可以, 是因?yàn)槟莻€(gè)Layout里面接受的this.props.children 是一個(gè)數(shù)組, 那個(gè)數(shù)組里面的兩個(gè)值就是 Page1 和Page2 的兩個(gè)組件  不管我怎么點(diǎn)擊切換那里面的children 都是那個(gè)數(shù)組, 不會(huì)改變,  那么key也就不會(huì)改變, 在動(dòng)畫(huà)組件里面的key不改變就意味著沒(méi)有動(dòng)畫(huà)發(fā)生。  因?yàn)樗强縦ey來(lái)識(shí)別不同的組件的。   然后是官網(wǎng)的方法。 關(guān)鍵的地方在于那個(gè) getCom的無(wú)狀態(tài)組件   通過(guò)當(dāng)前的pathname去 返回相應(yīng)的組件  然后的key也改變了  就有動(dòng)畫(huà)了。   
  
  
    以上是我的理解,  很粗糙,   希望大家指正

mark關(guān)注一下問(wèn)題,沒(méi)有經(jīng)歷過(guò)這樣的項(xiàng)目,所以不清楚具體怎么解決的.
然后提一下自己的一些想法:
他們可能沒(méi)有緩存各種組合條件的查詢(xún)結(jié)果,我認(rèn)為商品單項(xiàng)是被緩存了,比如 "全聚德烤鴨","肯德基五折券" 這種具體單個(gè)商品是緩存了.但是各種條件組合的查詢(xún)結(jié)果應(yīng)該不會(huì)被緩存.
如果單品被緩存,那么只要能保證一個(gè)高效的多條件查詢(xún)引擎就可以了,查詢(xún)出來(lái)的結(jié)果就是各種商品的id,然后從緩存高速獲取到這些商品就ok了.這種高速的多面查詢(xún)引擎可以通過(guò)elasticsearch來(lái)實(shí)現(xiàn).

僅僅是個(gè)人想法 , 持續(xù)關(guān)注該問(wèn)題 , 希望看到合適的答案.

傲嬌范 回答

我倒是寫(xiě)過(guò)一個(gè)簡(jiǎn)單的:http://show.bestime.live/projects/js-demos/scroll.html

挽歌 回答

同是新手,沒(méi)有用過(guò)你說(shuō)的那個(gè)插件。但是多頁(yè)面的話(huà),直接指定多個(gè)entry,用html-webpack-plugin提取多個(gè)html文件都是可以的

淡墨 回答

1、如果你所有的變量都定義在最外層,也就是window環(huán)境下,你要想一想,如果程序變得越來(lái)越大,你一個(gè)不小心就把某一個(gè)變量修改了,bug很難定位
2、閉包簡(jiǎn)單來(lái)說(shuō),就是內(nèi)層函數(shù)能夠訪問(wèn)到作用域鏈上的變量。你的例子太簡(jiǎn)單了,如果單單只返回值,怎么返回都沒(méi)什么區(qū)別,但是如果你是暴露接口方法,使之能操作你函數(shù)里面的變量呢?這就又不一樣了,只返回值你永遠(yuǎn)不能在外層對(duì)這個(gè)變量進(jìn)行修改,相當(dāng)于把你的變量封裝了起來(lái),外層不能改變他,也就解決了1里的問(wèn)題
3、如2中所說(shuō),你可以

function func3 () {
    var num = 1
    function add () {
        num++
    }
    function getNum () {
        return num
    }
    return {
        add: add,
        getNum: getNum
    }
}
var t = func3()
t.add()
t.getNum()

這樣是不是就封裝了一些操作了,也變得更加有意義呢?例子還是太簡(jiǎn)單,只是說(shuō)明對(duì)變量的封裝。

裸橙 回答

把這兩行放在前面:

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=abc.xlsx");

然后再是下面兩行:

InputStream is = new FileInputStream("c:\\abc.xlsx");
org.apache.commons.io.IOUtils.copy(is, response.getOutputStream());

這樣就能正常下載文件了。

紓惘 回答

growing io 無(wú)代碼埋點(diǎn)

老梗 回答

你這個(gè)的問(wèn)題不僅僅是匹配17091217297錯(cuò)誤,其實(shí)還有很多錯(cuò)誤的比如17097077297也會(huì)錯(cuò)誤,其實(shí)應(yīng)該寫(xiě)成這樣就好了
String pattern = "^(?=\\d*(\\d)\\1\\1\\1\\d*$)1[35789]\\d{9}$";

其實(shí)還有一個(gè)笨辦法,就是把所有重復(fù)4個(gè)的都標(biāo)識(shí)出來(lái),比如:
String pattern = "^(?=\\d*(0000|1111|2222|3333|4444|5555|6666|7777|8888|9999)\\d*)1[35789]\\d{9}$";