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

鍍金池/ 問答
初念 回答

答:

lis = [1, 3, 4, 533, 2333, 8]

def whateveryoucallit(lis):

    copylis = lis[:]
    copylis.sort(reverse=True)
    dic = { v:i+1 for i,v in enumerate(copylis) }
    return [ {v:dic[v]} for i,v in enumerate(lis) ]

result = whateveryoucallit(lis)

print(result)

結(jié)果:

[{1: 6}, {3: 5}, {4: 4}, {533: 2}, {2333: 1}, {8: 3}]

由于題主沒有描述清楚以下回答作廢

用例子補充一下樓上的答案

lis = [1, 3, 4, 533, 2333, 8]
for i, val in enumerate(lis):
    print '{}-{}'.format(i, val)

結(jié)果:

0-1
1-3
2-4
3-533
4-2333
5-8
不討囍 回答

1.這種不需要用遞歸,用do-while就行
2.答案是合法的,但是你的理解是錯誤的

因為當(dāng)不合法的時候,return 保留執(zhí)行(沒有立即執(zhí)行),當(dāng)合法的時候,立即執(zhí)行 return ,函數(shù)在return后立即終止,不會再去執(zhí)行之前未執(zhí)行的 return …

return只會終止當(dāng)前調(diào)用,不會終止父調(diào)用,所以return會一直執(zhí)行

哎呦喂 回答

1.你點擊時跳轉(zhuǎn)時傳入的參數(shù)是否有問題?
2.建議你可以把這部分代碼貼出來,這樣大家也能更好幫你定位問題所在!

老梗 回答
  1. 在地址欄輸入 chrome://version/
  2. 找到 個人資料路徑
  3. 打開目錄,再點開 Extensions,里面就是你的插件列表了
哚蕾咪 回答

list=['1':'str','2':'str','3':'str'];js沒有這種格式
list = {'1':'str','2':'str','3':'str'} 對象
list = [{'1':'str'},{'2':'str'},{'3':'str'}] 數(shù)組

var json = {};
list.forEach(v=>{
    json[v.id] = v.val
})
console.log(json)//{1:'str',2:str,3:'str'}
溫衫 回答

session
在你用戶沒有訪問權(quán)限,然后重定向之前,這個時候你將當(dāng)前路徑存入session
在你登錄之后再取出session里面的路徑,重定向到該路徑即可

安淺陌 回答

跟閉包沒關(guān)系啊,你下面的那個返回的是一個函數(shù),上面的返回的n是一個值,肯定不行了。

汐顏 回答

在生成的框架中,打開.webppackrc文件,在其中添加如下配置:
"publicPath":"/", //參數(shù)填寫CDN地址即可

傻叼 回答

Run npm install --save intl.
Run npm install --save classlist.js.
然后找到src里面的polyfills.ts文件,將注釋打開

然后找到src里面的polyfills.ts文件,將注釋打開

/**
 * This file includes polyfills needed by Angular and is loaded before the app.
 * You can add your own extra polyfills to this file.
 *
 * This file is divided into 2 sections:
 *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
 *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
 *      file.
 *
 * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
 *
 * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
 */

/***************************************************************************************************
 * BROWSER POLYFILLS
 */

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js';  // Run `npm install --save classlist.js`.

/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';


/**
 * Required to support Web Animations `@angular/animation`.
 * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
 **/
// import 'web-animations-js';  // Run `npm install --save web-animations-js`.



/***************************************************************************************************
 * Zone JS is required by Angular itself.
 */
import 'zone.js/dist/zone';  // Included with Angular CLI.



/***************************************************************************************************
 * APPLICATION IMPORTS
 */

/**
 * Date, currency, decimal and percent pipes.
 * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
 */
import 'intl';  // Run `npm install --save intl`.
/**
 * Need to import at least one locale-data with intl.
 */
import 'intl/locale-data/jsonp/en';
笑浮塵 回答

后端做微信授權(quán)跳轉(zhuǎn)時,使用的協(xié)議與訪問的協(xié)議不一致導(dǎo)致的。

青瓷 回答

請求頭里面加個 “referer”:“當(dāng)前頁面的URL”

圖片描述

糖果果 回答

明顯的區(qū)別:靜態(tài)屬性被多個實例共享,繼承(成員變量)是每個實例獨立的。

例如用$tao->president = "A"不會改變$jun->president。

有一定的區(qū)別,如果沒有特殊需求,也沒有用到new String("123") 的需求。

String str1="ABC"; 和String str2 = new String("ABC");

String str1="ABC" 可能創(chuàng)建一個對象或者不創(chuàng)建對象,如果"ABC"這個字符串在java String池里不存在,會在java String池創(chuàng)建這個一個String對象("ABC").如果已經(jīng)存在,str1直接reference to 這個String池里的對象。

String str2 = new String("ABC") 至少創(chuàng)建一個對象,也可能兩個。因為用到new 關(guān)鍵字,會在heap創(chuàng)建一個 str2 的String 對象,它的value 是 "ABC".同時,如果"ABC"這個字符串在java String池里不存在,會在java String池創(chuàng)建這個一個String對象("ABC").

悶油瓶 回答

1.定義一個數(shù)組arr
2.下拉組件的下拉event
3.event觸發(fā)的時候,向獲取商品列表的api發(fā)請求(一般這種需求的api都做好分頁)
page是0的時候,把獲取的數(shù)據(jù)push進(jìn)arr
page不是0的時候,把獲取的數(shù)據(jù)concat到arr上

就醬

挽青絲 回答

VueRouter跳轉(zhuǎn)的時候 ,是可以傳遞參數(shù)的,注意需要使用named router,如:

router.push({ name: 'user', params: { userId: 123 }})

另外,就你描述的場景,個人覺得沒必要定義為兩個Vue組件,組件粒度太細(xì)了,開發(fā)起來反而麻煩。

解夏 回答

不是輸入模式下
:set highlight 設(shè)置語法高亮的.試試json能不能高亮

空白格 回答

decltype(*t1)的結(jié)果不是函數(shù),而是函數(shù)引用,這是因為*t1返回一個lvalue,對于lvalue,decltype返回引用類型。
也就是說,不是

void()

而是

void (&) ()

由于是引用,is_function自然不能生效。使用remove_reference去除這個引用即可。

#include <iostream>
#include <type_traits>
#include <typeinfo>
void test1() {}
typedef void TEST();

int main()
{
        TEST* t1 = test1;
        std::cout << std::is_reference<decltype(*t1)>::value << std::endl; //1
        std::cout << std::is_function<std::remove_reference<decltype(*t1)>::type>::value << std::endl; // 1
                        
        return 0;
}
淡墨 回答

推薦下Dingo API

技術(shù)不夠的話隨便用個框架或者原生 PHP 在統(tǒng)一輸出 json_encode()