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

鍍金池/ 問(wèn)答
初念 回答

答:

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}]

由于題主沒(méi)有描述清楚以下回答作廢

用例子補(bǔ)充一下樓上的答案

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.答案是合法的,但是你的理解是錯(cuò)誤的

因?yàn)楫?dāng)不合法的時(shí)候,return 保留執(zhí)行(沒(méi)有立即執(zhí)行),當(dāng)合法的時(shí)候,立即執(zhí)行 return ,函數(shù)在return后立即終止,不會(huì)再去執(zhí)行之前未執(zhí)行的 return …

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

哎呦喂 回答

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

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

list=['1':'str','2':'str','3':'str'];js沒(méi)有這種格式
list = {'1':'str','2':'str','3':'str'} 對(duì)象
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
在你用戶沒(méi)有訪問(wèn)權(quán)限,然后重定向之前,這個(gè)時(shí)候你將當(dāng)前路徑存入session
在你登錄之后再取出session里面的路徑,重定向到該路徑即可

安淺陌 回答

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

汐顏 回答

在生成的框架中,打開.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)時(shí),使用的協(xié)議與訪問(wèn)的協(xié)議不一致導(dǎo)致的。

青瓷 回答

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

圖片描述

糖果果 回答

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

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

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

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

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

String str2 = new String("ABC") 至少創(chuàng)建一個(gè)對(duì)象,也可能兩個(gè)。因?yàn)橛玫絥ew 關(guān)鍵字,會(huì)在heap創(chuàng)建一個(gè) str2 的String 對(duì)象,它的value 是 "ABC".同時(shí),如果"ABC"這個(gè)字符串在java String池里不存在,會(huì)在java String池創(chuàng)建這個(gè)一個(gè)String對(duì)象("ABC").

悶油瓶 回答

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

就醬

挽青絲 回答

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

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

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

解夏 回答

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

react不用setState是不會(huì)觸發(fā)改變的

  class Content extends React.Component {
        constructor(props) {
            super(props);
            this.state={
                majors:[{"name":"****","state":0},{"name":"****","state":0},{"name":"****","state":0}]
            }
         }
        navchange(ind,event){
                this.state.majors[ind].state = 1;
        this.setState({
            majors:this.state.majors
        });
            }
        render(){
        return (
        <div>
            <div className="top">
                <div className="search">
                    <input type="text" placeHolder="請(qǐng)輸入搜索內(nèi)容" />
                    <span><img src="img/search.png" alt="" /></span>
                </div>
            <div className="majors">{
                this.state.majors.map(function(item,index){
                return<span className="major" key={index} onClick={this.navchange.bind(this,index)}><span className={item.state == "0" ? 'in':''} >{item.name}</span></span>
            }.bind(this))
            }
            </div>
             </div>
              </div>
            )
        }
        }
抱緊我 回答
package com.elyong.noway;

/**
 * Created by ely ong on 2017/11/27.
 */
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SimpleGui3C implements ActionListener{
    JFrame frame;
    public static void main(String[] args){
        SimpleGui3C gui=new SimpleGui3C();
        gui.go();
    }
    public void go(){
        //你的這里沒(méi)有賦值
        frame=new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton button=new JButton("Change colors");
        button.addActionListener(this);
        MyDrawPanel drawPanel=new MyDrawPanel();
        frame.getContentPane().add(BorderLayout.SOUTH,button);
        frame.getContentPane().add(BorderLayout.CENTER,drawPanel);
        frame.setSize(300,300);
        frame.setVisible(true);
    }
    public void actionPerformed(ActionEvent event){
        frame.repaint();
    }
}
class MyDrawPanel extends JPanel{
    public void paintComponent(Graphics g){
        Graphics2D g2d=(Graphics2D) g;
        int red=(int)(Math.random()*255);
        int green=(int)(Math.random()*255);
        int blue=(int)(Math.random()*255);
        Color startColor=new Color(red,green,blue);
        red=(int)(Math.random()*255);
        green=(int)(Math.random()*255);
        blue=(int)(Math.random()*255);
        Color endColor=new Color(red,green,blue);
        GradientPaint gradient=new GradientPaint(70,70,startColor,150,150,endColor);
        g2d.setPaint(gradient);
        g2d.fillOval(70,70,100,100);
    }
}