我調(diào)用正常, 你檢查一下weexpack版本
你先把body打出來看看
改成ssh方式clone,或者改下http.postBuffer的值
按照你的寫法需要更換stars數(shù)組的值,但是你不是就一個(gè)評(píng)分,所以一個(gè)數(shù)組肯定是不行的,所以這個(gè)思路并不好
換個(gè)思路,就兩種圖片,黃色的總在前面,灰色的總在后面,那可以這么實(shí)現(xiàn)
data = ["5", "1", "3", "2", "1"]
imgs = {
off: './img/net_more/star_off.png',
on: './img/net_more/star_on.png'
}
<li v-for="(item,index) of data">
<img class="stars" v-for="star in 5" :src="star <= item ? imgs.off : imgs.on" alt="1">
</li>
使用聚合查詢
db.projects.aggregate([{
$lookup:{
from:'users',
localField: 'userId',
foreignField: '_id',
as: 'userinfo'
}
},{
$match:{
'userinfo.sex': '0'
}},{"$unwind": "$remark"}])
好像沒有這種api。
但是不知道你是什么需求,一定要分開放置script標(biāo)簽。
因?yàn)榉旁趆ead里面的標(biāo)簽會(huì)阻塞頁面加載,拖慢渲染速度,一般都會(huì)把css放頭部,js放底部
單頁面本身html就少,放頭部底部關(guān)系不大。
你可以f12調(diào)試
查看html結(jié)構(gòu)
看看label的css類名
然后 重新寫一份
let reg=/w+-w+/g;
看來是跟透明度有關(guān)系,非常不理解
用re.sub直接替換空格感覺更方便些
import re
text = "I am an handsome boy"
print(re.sub(r'\s+', '', text))
const str="1232{按鈕1}{按鈕2}765432";
const result=str.split(/(?=\{)|(?<=})/g);
//?["1232", "{按鈕1}", "{按鈕2}", "765432"]
然后把數(shù)字字符串轉(zhuǎn)成數(shù)字。
result.map(str=>{let num=parseInt(str); if(num)return num; return str;});
使用了向前匹配和向后匹配,看這篇
可以用函數(shù)處理,逐個(gè)字符串進(jìn)行判斷。
最好自己嘗試實(shí)現(xiàn)以下這個(gè)函數(shù)...
const str = "1232{按鈕1}{按鈕2}765432";
function handleStr(str) {
const result = [];
//表示是否在處理花括號(hào)內(nèi)的字符
let inBraceNow = false;
for (let i = 0; i < str.length; i++) {
const currentChar = str[i];
if (inBraceNow) {
result[result.length - 1] += currentChar;
if (currentChar == "}") {
inBraceNow = false;
}
} else {
//遇到"{"開始進(jìn)入花括號(hào)處理階段...
if (currentChar == "{") {
result.push("{");
inBraceNow = true;
} else {
// result數(shù)組為空時(shí),需要初始化
//如果數(shù)組最后一個(gè)不能轉(zhuǎn)為數(shù)字,說明是剛進(jìn)入數(shù)字處理階段,需要傳入一個(gè)0
if (result.length == 0||(!+result[result.length-1])) {
result.push(0);
}
result[result.length - 1] =10*result[result.length - 1]+(+currentChar);
}
}
}
return result;
}
console.log(handleStr(str));
自己回答一下吧, 翻看了django1.7 bulk_create 的源碼, 上面有一段有意思的注釋:
# So this case is fun. When you bulk insert you don't get the primary
# keys back (if it's an autoincrement), so you can't insert into the
# child tables which references this. There are two workarounds, 1)
# this could be implemented if you didn't have an autoincrement pk,
# and 2) you could do it by doing O(n) normal inserts into the parent
# tables to get the primary keys back, and then doing a single bulk
# insert into the childmost table. Some databases might allow doing
# this by using RETURNING clause for the insert query. We're punting
# on these for now because they are relatively rare cases.
解決方法有兩種, 1)主鍵不設(shè)置為自增長(zhǎng),意思是需要自己指定主鍵的值嘍?沒理解錯(cuò)吧
2)老老實(shí)實(shí)的一條條的插入吧
想了一下還是一條條插入,放到事務(wù)里面去操作. 不知道還有沒有更好的辦法
問題已經(jīng)解決了
這個(gè)問題的 關(guān)鍵點(diǎn) 是 setSelection()
方法的執(zhí)行時(shí)機(jī)
<RelativeLayout
<!-- 這兩個(gè)設(shè)置不需要了,因?yàn)榻酉聛硪诔绦蚩傇O(shè)定 -->
android:focusable="false"
android:focusableInTouchMode="true" />
<EditText />
</RelativeLayout>
public class MainActivity extends AppCompatActivity {
private boolean isFirst = true; // 是否是第一次點(diǎn)擊 EditText
private InputMethodManager mIMM; // 第一次點(diǎn)擊時(shí),軟鍵盤不自動(dòng)彈出,所以要手動(dòng)彈出
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mIMM = (InputMethodManager) (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
mEditText = findViewById(R.id.xxx);
// 關(guān)鍵部分
mEditText.setFocusable(false);
mEditText.setOnClickListener( v -> {
if(isFirst) {
mEditText.setFocusableInTouchMode(true);
mEditText.requestFocus();
mEditText.setSelection(mEditText.getText().length());
mIMM.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
isFirst = false;
}
});
}
}
1. 直接設(shè)置 setSelection()
因?yàn)橹霸O(shè)置了 android:focusabelInTouchMode="true",所以直接設(shè)置是沒有效果的,第一次點(diǎn)擊EditText區(qū)域,會(huì)自動(dòng)彈出軟鍵盤,并且光標(biāo)位置是手指點(diǎn)擊的位置
2. 自定義 EditText
,重寫 onSelectionChanged(int selStart, int selEnd)
方法
這個(gè)方法感知光標(biāo)位置的變化,編寫如下代碼,可控制光標(biāo)始終在結(jié)尾處:
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
super.onSelectionChanged(selStart, selEnd);
if (selStart == selEnd) { // 不考慮多個(gè)文字被選中
setSelection(getText().length());
}
}
這個(gè)方法的執(zhí)行時(shí)機(jī)在自定義EditText對(duì)象初始化之前,并且在沒點(diǎn)擊之前,或者點(diǎn)擊時(shí)會(huì)多次執(zhí)行該方法,不好控制是否是第一次點(diǎn)擊。因此也沒有嘗試成功
不知道有沒有更好的解決方案?期待你的回答。
實(shí)際項(xiàng)目總可能會(huì)遇到一個(gè)頁面中有多個(gè)EditText,那么 isFirstTouch
就可能被多個(gè)EditText共用,如果有這個(gè)問題存在的話,一種解決方案是自定義EditText:
public class MyEditText extends EditText {
private boolean isFirstTouch = true;
// 構(gòu)造方法中調(diào)用 init() 方法
private void init() {
post( () -> {
setFocusable(false);
if(isFirst) {
setFocusableInTouchMode(true);
requestFocus();
setSelection(mEditText.getText().length());
inputMethodManger.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
isFirst = false;
}
});
}
}
將file:///
訪問模式換成http://xxxxxx
應(yīng)該是android打包環(huán)境的問題
因?yàn)槟阌昧藃edirect, 可以與此有關(guān)
在nginx配置里增加proxy_redirect
試試:
location /{
...
proxy_redirect / /;
...
}
openssl 確實(shí)有點(diǎn)小特殊,我也沒弄過,但是授人以漁,教你方法。
看到開源代碼,第一反應(yīng)是在configure中配置,但是下載代碼了發(fā)現(xiàn)沒有configure,還好我比較聰明,他有config,其實(shí)也有configure,只是Configure,首字母大寫。
然后發(fā)現(xiàn)他沒有配置選項(xiàng),我就 grep -r "-m64" ./ 看是在哪里配置的,結(jié)果發(fā)現(xiàn)在Configure中有大量的的-m64。
再看前面的linux-ppc64,我就明白了,原來他是根據(jù)目標(biāo)系統(tǒng)預(yù)先設(shè)定好編譯選項(xiàng),那么出現(xiàn)-m64 的原因是識(shí)別錯(cuò)了編譯器。
再反過來查找,發(fā)現(xiàn)編譯器的識(shí)別是在config里面做的,識(shí)別完成了,最后幾行的代碼是perl ./Configure $OUT,看明白了吧,要么讓config識(shí)別正確的編譯器,要么干脆根據(jù)你的系統(tǒng)寫死$OUT算了。
已經(jīng)解決,謝謝各位大神,如圖
修改url_mode
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。