所以修改矩陣如下:
mirrorMatrix.set(
3, 0, 0, 20, 0, 3, 0, 4, 0, 0, 3, 2, 0, 0, 0, 1
);
Update1:
因為使用數組來存儲矩陣,矩陣是二維的,如果用一維數組存儲的話,肯定會涉及一個順序問題,即一行行的存儲還是一列列的存儲;
官網的說明是set方法使用的是行主序
,元素中的矩陣是列主序
,舉例如下:
矩陣
3 0 0 20
0 3 0 4
0 0 3 2
0 0 0 1
如果使用行主序
存儲在數組中,那么這個數組是[3, 0, 0, 20, 0, 3, 0, 4, 0, 0, 3, 2, 0, 0, 0, 1]
如果使用列主序
存儲在數組中,那么這個數組是[3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 20, 4, 2, 1]
User.findOne()的內容能發(fā)一下嗎?User.findOne()是不是返回Promise?你這樣寫試試:
user.post('/register', async(ctx) => {
let {username, password, rePassword} = ctx.request.body;
if (!username) {
responseClient(ctx, 400, 2, '用戶名不可為空');
return;
}
if (!password) {
responseClient(ctx, 400, 2, '密碼不可為空');
return;
}
if (password !== rePassword) {
responseClient(ctx, 400, 2, '兩次密碼不一致');
return;
}
try{
User.findOne({username}).then(function(doc,err){
if(err){
responseClient(ctx);
}
if(doc){
responseClient(ctx, 200, 1, '用戶名已存在');
return;
}else{
//保存到數據庫
let user = new User({
username: username,
password: password,
type: 'user'
});
user.save(function(err, doc){
if(err){
console.log(err);
}
if(doc){
let data = {};
data.username = doc.username;
data.userType = doc.type;
data.userId = doc._id;
responseClient(ctx, 200, 0, '注冊成功', data);
return;
}
});
}
})
}
}catch(e){
responseClient(ctx);
}
})
前端木有安全
pip沒有安裝吧
如果是ubuntudebian的話sudo apt-get install python-pip
前后請求是否對返回的數據有依賴
添加一個loading狀態(tài),滾動到底部時loading = true并開始加載,加載結束(成功或失?。┖髄oading=false,
加載分頁數據的方法中需要確保不在loading狀態(tài)否則不加載,怕方法調用頻繁可以加個debounce。
nrm
: npm install nrm -g
;nrm ls
;nrm use taobao
; // 我用的淘寶npm install <package-name>
;npm install
;// 有問題再call我
你把這段刪掉
# sitemap:
# path: sitmap.xml
# baidusitemap:
# path: baidusitemap.xml
應該是不用加也就可以生成的了。
前提是你的# URL 是配置對了的。
<span :class="{active:priceIndex[index]===index}"></span>
dev-server的地址是localhost:7777
,API地址是localhost:3306
,你請求的時候請求localhost:7777/api/newStu/searchNewStu
應該就好了
this.data.num1 是字符串吧?檢查下
400錯誤,你的請求不對,接口寫的沒問題的話,那就是參數傳的不對了。
axios的post參數提交是這樣寫的:
axios.post('query', {C: code, Q: arg}).then().catch()
get提交參數則又是這樣的:
axios.get('query', {params: {C: code, Q: arg}}).then().catch()
https://github.com/ElemeFE/el...
最左邊有 License 類型,這個項目是 MIT
參考 https://baike.baidu.com/item/...
阮一峰 的 blog 里有個一圖流,可以看
http://www.ruanyifeng.com/blo...
index做key會存在這個問題,當你刪除再添加的時候,就會出現(xiàn)key重復的情況
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
width: 300px;
height: 300px;
border: 2px solid #000;
}
</style>
</head>
<body oncontextmenu="return false">
<div id='div' onmousedown='divClick(event)'></div>
<script>
var bgColor = ['00', '11', '22', '33', '44', '55', '66', '77', '88', '99', 'aa', 'bb', 'cc', 'dd', 'ee', 'ff'];
var div = document.getElementById('div');
function changeBg(index) {
div.setAttribute('style', 'background-color: #' + bgColor[index] + '0000')
div.setAttribute('data-index', index)
}
changeBg(0);
function divClick(event) {
var mouse = event.button
var index = div.getAttribute('data-index')
if(index == 0 && mouse == 0){
index++
}else if(index == (bgColor.length - 1) && mouse == 2){
index--
}else if (index > 0 && index < (bgColor.length - 1)) {
if (mouse == 0) {//左鍵
index++
} else if (mouse == 2) {//右鍵
index--
}
}
changeBg(index);
}
</script>
</body>
</html>
你這2個頁面是同一個嘛
n
是一個全局變量。
changePic
并沒有修改圖片,他只是修改了n
。
在change
里面,邏輯是:將圖片的編號替換為n,然后將n修改為下一次的編號。
那么在下一個change
執(zhí)行之前呢,changePic
提前修改了n的值,導致change
將點擊的編號展示了出來。
這個n就是點擊時傳入的。
所以這是一個全局變量的運用問題。changePic
沒有改圖片,只是改了一個變量,這個變量用于描述下一張圖片的編號。
點擊也沒有立即換圖,換圖還是等到了Interval
的兩秒到了,才通過change
換圖
mysql安裝過程有個交互式操作讓你輸入root密碼的,如果你沒有輸入的話(可能是關閉了apt的交互式選項,跳過了交互式操作),那么應該是空的。
另外我記得ubuntu 18.04默認的mysql是5.7,我記得mysql 5.7應該是自動生成一個密碼,你在/var/log/mysqld.log
日志文件(不是的話就是在/var/log/mysql/*.log
找一下),應該是有打印一個默認密碼的
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數據專業(yè)的國家
北大青鳥中博軟件學院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網學院和江蘇省首批服務外包人才培訓基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團創(chuàng)建于1999年,經過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術與教育服務機構,發(fā)展為教育服務業(yè)的綜合性企業(yè)集團,成為集合面授教學培訓、網
達內教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構,是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經理從事移動互聯(lián)網管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經理職務負責iOS教學及管理工作。
浪潮集團項目經理。精通Java與.NET 技術, 熟練的跨平臺面向對象開發(fā)經驗,技術功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網頁制作和網頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經驗。曾經歷任德國Software AG 技術顧問,美國Dachieve 系統(tǒng)架構師,美國AngelEngineers Inc. 系統(tǒng)架構師。