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

鍍金池/ 問答/ C++問答
冷眸 回答

V8曾經(jīng)有尾遞歸優(yōu)化,但現(xiàn)在已經(jīng)刪掉了
因?yàn)槲策f歸優(yōu)化會(huì)破壞函數(shù)的調(diào)用棧信息

賤人曾 回答

不用這些之前,前端界的界面組件很多是基于jQuery實(shí)現(xiàn)的,當(dāng)然還有一些自成一體的ui組件不依賴jQuery或使用其他一些框架,但基于jQuery的組件最為豐富。

兮顏 回答

去掉鏈接參數(shù),在代碼中加入#pragma comment(lib,"xxx.lib").
你把xxx.lib加入到你項(xiàng)目的目錄下再調(diào)試。

陪我終 回答

如果你非要用這種方法來修改的話……,首先要明確一個(gè),就是LocalStorage存儲(chǔ)的是字符串
所以我假設(shè)你的LocalStorage里面存的對(duì)象是JSON.stringify()轉(zhuǎn)出的json

function RewriteLS(LSkey,fn){
    //Write接收一個(gè)回調(diào)函數(shù)作為參數(shù),回調(diào)函數(shù)的參數(shù)為要修改的obj
    if(!localStorage[LSkey]){
        localStorage[LSkey] = JSON.stringify({});
    }
    let Obj = JSON.parse(localStorage[LSkey]);//這里應(yīng)當(dāng)先判斷isJSON,我就省略了,懶得寫
    Obj = fn(Obj)||Obj; //這里可以隨你return,直接用引用修改的話就不用return了
    console.log(Obj);
    localStorage[LSkey] = JSON.stringify(Obj)
}
function editFn(path,value){
    let pathArr = path.split(".");
    RewriteLS(pathArr.splice(0,1),(obj)=>{
        try{
            eval("obj."+pathArr.join(".")+"=value");
        }catch(e){
            //中間的path可能出錯(cuò)。
            throw e;
        }
    })
}

我直接使用了eval來處理賦值,如果你想的話,循環(huán)或者遞歸來resolve路徑也是可以的。
但是你所說的傳遞一個(gè)字符串路徑的方式我十分不推薦。

你可以看到我單獨(dú)封裝了一個(gè)RewriteLS函數(shù),使用該函數(shù)

RewriteLS("userInfo",obj=>{
    //在這里對(duì)obj的屬性進(jìn)行處理
});

來處理的話會(huì)更加靈活,也更安全。

執(zhí)念 回答
let root = [{
  id: '1',
  name: '姓名1',
  items: [
    {
      id: '2',
      name: '姓名2',
      items: [
        {
          id: '3',
          name: '姓名3',
          items: [
            {
              id: '4',
              name: '姓名4',
            },
          ],
        },
      ],
    },
    {
      id: '5',
      name: '姓名5',
    },
    {
      id: '6',
      name: '姓名6',
    },
  ],
}];

function search(root, id) {
  for (let i = 0; i < root.length; i += 1) {
    if (root[i].id === id) {
      return [{ id, name: root[i].name }];
    }
  }
  for (let i = 0; i < root.length; i += 1) {
    if (root[i].items && Array.isArray(root[i].items)) {
      const res = search(root[i].items, id);
      if (res.length) return [...res, { id: root[i].id, name: root[i].name }];
    }
  }
}

console.log(search(root, '5'));
console.log(search(root, '3'));
淚染裳 回答

data中聲明變量不是應(yīng)該在return中嗎?
獲取后臺(tái)數(shù)據(jù)應(yīng)該在mounted 調(diào)用 ,
個(gè)人感覺,這個(gè)代碼結(jié)構(gòu)有點(diǎn)混亂

methods:{
    addPage(){
    this.page++;
    this.xxx()
    }
} 

page ++后,再次調(diào)用那個(gè)依賴page參數(shù)的方法

尋仙 回答

兩天才通過審核……,自己找到了解決方法,之前剛開始學(xué)習(xí)qt,使用多線程就可以解決了。

夏木 回答

這些數(shù)字并不是代碼,是類似 R.id.xxx,R.layout.xxx 之類的,本身就是 int 值,代表資源id

短嘆 回答

注意在insert()中, last是有++操作的, 所以你在用這個(gè)順序表插入的時(shí)候last會(huì)自己更新.

且在初始化時(shí)令last=-1,表示初始化為一個(gè)空表(我的理解是只有一個(gè)元素,表中最后位置就是0,所以-1就表示一個(gè)空表,應(yīng)該是這樣吧)

last = -1只是說明里面沒有元素. 這是在構(gòu)造函數(shù)里完成的.

至于你在find()里提到的疑惑, 是因?yàn)槟憧隙ㄏ纫?code>insert(), 再find(), 這時(shí)last已經(jīng)不是-1了, 因?yàn)楹戏ǖ?code>insert()過了.

PS: 不過這本書的碼風(fēng)很糟糕, 窩覺得或許你該找好一點(diǎn)的材料學(xué)習(xí)(不過講道理, 數(shù)據(jù)結(jié)構(gòu)/算法的書基本碼風(fēng)都一塌糊涂...至少國(guó)外的書是這樣(除了clrs這樣用偽碼的), 國(guó)內(nèi)不清楚.

你的瞳 回答

二次分享時(shí),微信會(huì)自動(dòng)在url后加上from=singlemessage&isappinstalled=0
在連接后加上your url?&from=singlemessage&isappinstalled=0再進(jìn)行分享,即可分享成功

笨笨噠 回答

C++中不建議使用裸指針,最好使用shared_ptr或者unique_ptr

懶豬 回答

Remarks

The color format of the bitmap created by the CreateCompatibleBitmap function matches the color format of the device identified by the hdc parameter. This bitmap can be selected into any memory device context that is compatible with the original device.
Because memory device contexts allow both color and monochrome bitmaps, the format of the bitmap returned by the CreateCompatibleBitmap function differs when the specified device context is a memory device context. However, a compatible bitmap that was created for a nonmemory device context always possesses the same color format and uses the same color palette as the specified device context.
Note: When a memory device context is created, it initially has a 1-by-1 monochrome bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the HDC that was used to create the memory device context

MSDN 里說了CreateCompatibleBitmap創(chuàng)建的是monochrome(單色的)

傲寒 回答
  1. 模板盡量還是不要分離寫
  2. 針對(duì)你的問題,其中最簡(jiǎn)單的解決辦法是main.cpp里面#include"TemplateArray.cpp"
  3. 或者把全部的實(shí)現(xiàn)都放在TemplateArray.hpp

js
data() {return {content: '<a href="xxx">點(diǎn)擊進(jìn)入</a> <span>Hello 你好</span>'}}`
模板
<div>{{content}}</div>

孤島 回答

      path:'/index',
      name:'index',
      component:index,
      redirect:'/device/deviceDisplay',
      children:[
        {
          path:'/device/user',
          name:'user',
          component:user,
            children:[
             {
              path: '/device/deviceDisplay',
              name: 'deviceDisplay',
              component: deviceDisplay
             }
           ]
        }

我理解的是默認(rèn)選中第一個(gè),用重定向

clipboard.png

https://router.vuejs.org/zh/g...