這個前端判斷吧?你把圖片都取出來
用到1張的時候 輸出1張,用到多張的時候輸出多張
我的理解哈
class Main extends egret.DisplayObjectContainer {
constructor() {
super();
this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
}
private _txInfo11:egret.TextField;
private container1;
private onAddToStage(event:egret.Event) {
this.container1 = new egret.DisplayObjectContainer();
var robot:Robot = new Robot();
this.container1.addChild(robot);
this._txInfo11 = new egret.TextField;
this.addChild( this._txInfo11 );
this._txInfo11.size = 28;
this._txInfo11.x = 400;
this._txInfo11.y = 10;
this._txInfo11.text = "換頁";
var _bgInfo11:egret.Sprite = new egret.Sprite();
this.addChildAt(_bgInfo11, this.numChildren - 1 );
_bgInfo11.x = this._txInfo11.x;
_bgInfo11.y = this._txInfo11.y;
_bgInfo11.graphics.clear();
_bgInfo11.graphics.beginFill( 0xff7f50, .5 );
_bgInfo11.graphics.drawRect( 0, 0, this._txInfo11.width, this._txInfo11.height );
_bgInfo11.graphics.endFill();
_bgInfo11.touchEnabled = true;
_bgInfo11.addEventListener( egret.TouchEvent.TOUCH_TAP, ()=>{
if(this.contains(this.container1)){
this.removeChild(this.container1);
}else{
this.addChild(this.container1);
}
}, this );
}
}
manytomanyfield操作出了問題
belondplanid 字段在 model 里出現(xiàn)了兩次
貼一下你的 tb_Lesson model 代碼
我反對第一個回答,根本都沒有仔細分析程序和頁面就胡扯。
樓主你注意一下大鬧天宮的上映時間就知道了,它的格式跟其他電影的格式不一樣。
這一步匹配錯了,導(dǎo)致了后面的一連串問題。
其中還包括一個問題就是,從大鬧天宮開始到第99個電影,程序里打印的上映時間都與頁面顯示的不一樣。
這個頁面的html很整齊,用正則不如用xpath,正則要考慮的問題太多。
百度看下xpath怎么用吧。
那個文件沒有找到,應(yīng)該是沒有裝完整
a = 1 if 2 == 3 else 0
下劃線放錯位置了啊。。。。。
lis = soup.find_all('li', class_='video matrix')修改配置文件后
應(yīng)該是重啟命令不能用service postgresql restart
service postgresql reload
service postgresql reload才可以https://jingyan.baidu.com/art...
似乎是 postgres.conf 使用restart pg_hba使用reload
我是使用如下的方法進行的,同時修改配置文件后不,使用service postgresql reload命令來重啟,最后使用登錄成功
第二種方法,使用shell命令行。
添加新用戶和新數(shù)據(jù)庫,除了在PostgreSQL控制臺內(nèi),還可以在shell命令行下完成。這是因為PostgreSQL提供了命令行程序createuser和createdb。還是以新建用戶dbuser和數(shù)據(jù)庫exampledb為例。
首先,創(chuàng)建數(shù)據(jù)庫用戶dbuser,并指定其為超級用戶。
sudo -u postgres createuser --superuser dbuser
然后,登錄數(shù)據(jù)庫控制臺,設(shè)置dbuser用戶的密碼,完成后退出控制臺。
sudo -u postgres psql
password dbuser
q
接著,在shell命令行下,創(chuàng)建數(shù)據(jù)庫exampledb,并指定所有者為dbuser。
sudo -u postgres createdb -O dbuser exampledb
登錄數(shù)據(jù)庫
添加新用戶和新數(shù)據(jù)庫以后,就要以新用戶的名義登錄數(shù)據(jù)庫,這時使用的是psql命令。
psql -U dbuser -d exampledb -h 127.0.0.1 -p 5432
上面命令的參數(shù)含義如下:-U指定用戶,-d指定數(shù)據(jù)庫,-h指定服務(wù)器,-p指定端口。
輸入上面命令以后,系統(tǒng)會提示輸入dbuser用戶的密碼。輸入正確,就可以登錄控制臺了。
bin下的文件通常是python以及模塊的可行執(zhí)行文件。部分python模塊可以當(dāng)成普通工具使用,可執(zhí)行文件會放在這個目錄里面。
import cv2
import time
old = cv2.imread('1.jpg')
new = cv2.imread('2.jpg')
cv2.imshow('image', old)
cv2.waitKey() #按任意鍵切換
t = 1000 #時間ms
fps = 60 #幀數(shù)低于60
step = 1000 / fps
i = 0
while i < t:
cv2.imshow('image', cv2.addWeighted(old, 1 - i / t, new, i / t, 0)) #通過更改圖像透明度切換
if cv2.waitKey(1) &0xFF == ord('q'):
break
i += step
time.sleep(0.001)
cv2.imshow('image', new)
cv2.waitKey() #按任意鍵退出
cv2.destroyAllWindows()
你確定 generate_notify_resp 這個函數(shù)可以直接傳入字典,而不是 json 字符串?
import json
ret_xml = qr_wxpay.generate_notify_resp(json.dumps(ret_dict))document監(jiān)聽點擊事件
e.target!=彈窗 的時候,關(guān)閉
|--models
|--__init__.py
|-- User.py
|-- Article.py
|-- ...
|--...
然后,在__init__.py 里設(shè)置個 __all__ = ['其中,你要顯示的數(shù)據(jù)庫的各個表明']
可以用gevet啊
from gevent import monkey
from gevent.pywsgi import WSGIServer
monkey.patch_all()
from flask import Flask
import time
app = Flask(__name__)
@app.route('/test',methods=['GET'])
def sayHello():
time.sleep(10)
return 'hello'
@app.route('/hi',methods=['GET'])
def sayHi():
return 'hi'
if __name__ =='__main__':
http_server = WSGIServer(('', 5000), app)
http_server.serve_forever()
測試結(jié)果:
127.0.0.1 - - [2017-12-12 22:35:10] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:11] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:11] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:12] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:12] "GET /test/ HTTP/1.1" 200 126 0.000998
127.0.0.1 - - [2017-12-12 22:35:13] "GET /test/ HTTP/1.1" 200 126 0.001001
127.0.0.1 - - [2017-12-12 22:35:14] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:14] "GET /test/ HTTP/1.1" 200 126 0.001014
127.0.0.1 - - [2017-12-12 22:35:15] "GET /test/ HTTP/1.1" 200 126 0.001000
127.0.0.1 - - [2017-12-12 22:35:15] "GET /test/ HTTP/1.1" 200 126 0.000000
127.0.0.1 - - [2017-12-12 22:35:18] "GET /asyn/ HTTP/1.1" 200 126 10.000392
給tablewidget添加右鍵監(jiān)聽事件
var {...newData} = this.data
如果是數(shù)組
var [...newData] = this.data
這是es6的語法
你得考慮意外退出的情況,比如ctrl-c
不清楚什么原因,后來又試了一遍就好了
可以簡單的通過Array.prototype.find()來判斷
const item = res.list.find(({us_id}) => '7' === us_id);
if (item){
console.log(item)
} 北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負責(zé)iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。