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

鍍金池/ 問答/ Java問答
吢涼 回答

diff 這種邏輯盡量放在應(yīng)用中去維護,而不是在vm模板中維護,在data 中增加一個diff屬性,重寫getter方法:

getDiff(){
return String.format("%.2f", Double.valueOf(this.getValue()) - Double.valueOf(this.getPreValue()));
} 

頁面上直接展示即可:

 <span id="aaa" class="l fn-diff">${data.diff}</span>
祈歡 回答

思路就是首先你得生成結(jié)構(gòu)化數(shù)據(jù),然后需要的時候再轉(zhuǎn)成string

let demo = [{
        date: '2018-08-08',
        ranges: [
            ['08:00', '09:00'],
            ['12:00', '13:00']
        ]
    },
    {
        date: '2018-08-09',
        ranges: [
            ['08:00', '09:00'],
            ['12:00', '13:00']
        ]
    }
]

 demo.map(d => {
    return d.date + '|' + d.ranges.map(r => r.join('-')).join('|')
}).join(',')
巷尾 回答

python
a += 4 其實就是a = a + 4

此時 相當(dāng)于在函數(shù)內(nèi)部聲明了變量 a, 所以是調(diào)用不到外部的a的。

而在 js 中 a 并不是聲明的新變量,所以結(jié)果會不同。

js 中聲明變量是需要 var 之類的關(guān)鍵字的,python 不需要

如果想要python 中的 a 的指向全局需要明確指定

a = 3
def f():
    global a // 明確指定是全局變量
    a += 4
    print(a)
f()

python 的代碼轉(zhuǎn)換為 js 代碼其實是這樣的:

var a = 3;
const f = () => {
    var a;
    a += 4;
    console.log(a) // NaN 因為js的容錯機制,所以并沒有報錯。
}
孤酒 回答

建議單獨創(chuàng)建表保存最近聯(lián)系人。
1、從功能設(shè)計上看,最近聯(lián)系人是個獨立的功能,不依賴于聊天記錄,這一點你已經(jīng)說過了。
2、從系統(tǒng)性能方面考慮,每次從聊天日志表從計算最近聯(lián)系人,數(shù)據(jù)量大的時候會存在性能瓶頸。

情皺 回答

正則表達式不正確,匹配不了數(shù)據(jù),才導(dǎo)致hbase數(shù)據(jù)無法寫入

尋仙 回答

ajax輪詢和websocket都可以,但是我感覺還是websocket更好,輪詢是因為沒有websocket的時候一種長連接通信技術(shù)

擱淺 回答

應(yīng)該是:以一到兩位數(shù)字(0-9)后跟一個冒號(:)和一個空格( )開頭,并以非貪婪模式匹配任意字符(不包括換行符),最后是一個冒號(:)


你可以使用這個在線工具來測試你的正則,它也會給你詳盡的解釋

我甘愿 回答

你在服務(wù)器命令行php -v以及當(dāng)前你電腦執(zhí)行一下php -v看一下PHP版本,然后下一步稍后再說。

痞性 回答

原來是自己一直在轉(zhuǎn)牛角尖 獲取不了數(shù)據(jù)跟前后端約定的回調(diào)函數(shù)名稱有關(guān),還有不需添加response的頭文件信息(具體原理沒有研究過)

小曖昧 回答

1.首先 小程序 生成 date 對象需要使用 getDate函數(shù), 返回一個當(dāng)前時間的對象。
2.小程序let會報錯

module.exports = function (value) {
  if (!value) {
    return ''
  }
  var date = getDate(value)
  var time = getDate().getTime() - date.getTime() // 現(xiàn)在的時間-傳入的時間 = 相差的時間(單位 = 毫秒)
  if (time < 0) {
    return ''
  } else if ((time / 1000 < 30)) {
    return '剛剛'
  } else if (time / 1000 < 60) {
    return parseInt((time / 1000)) + '秒前'
  } else if ((time / 60000) < 60) {
    return parseInt((time / 60000)) + '分鐘前'
  } else if ((time / 3600000) < 24) {
    return parseInt(time / 3600000) + '小時前'
  } else if ((time / 86400000) < 31) {
    return parseInt(time / 86400000) + '天前'
  } else if ((time / 2592000000) < 12) {
    return parseInt(time / 2592000000) + '月前'
  } else {
    return parseInt(time / 31536000000) + '年前'
  }
}
 <wxs src="./ccc.wxs" module="time" /> 
 <view>{{time('2018-04-26T09:51:19.808Z')}}</view>

測試 這樣是可以實現(xiàn)的

汐顏 回答

一般云服務(wù)的對象存儲只有簡單的防盜鏈設(shè)置(也就是信任域名),針對你的情況我覺得可以先設(shè)置信任域名,只能在你的網(wǎng)站上訪問,再在自己的網(wǎng)站上設(shè)置不登錄看不到圖片(用統(tǒng)一的圖片代替)或者干脆不登錄看不到文章。

掛念你 回答

原答案里也沒什么 es5 寫不出來的東西吧...

var times = fieldsDatas.map(function (field) {
    var data = {};
    data[field['_state']] = field['_column'];
    return data;
})

if (times[_valueStatu[1]]) {
    // 存在第二個時間
} else {
    var offset = Object.keys(times).indexOf(_valueStatu[1]));
    var noneNull = Object.keys(times)
                        .map(function (key, index) { 
                            // 檢查是否已經(jīng)到了第二個查詢字段之后,因為你題目中說是紅框中
                            return index <= offset ? null
                                            : times[key] === null})
                        .indexOf(true) === -1;
     if (noneNull) {
         // 都有時間值
     } else {
         // 存在 null 值
     }
}

先把第二個數(shù)組轉(zhuǎn)換一下:

let times = fieldsDatas.map(field => {
    let data = {};
    data[field['_state']] = field['_column'];
    return data;
})

然后就可以直接讀取了

if (times[_valueStatu[1]]) {
    // 存在第二個時間
} else {
    let offset = Object.keys(times).indexOf(_valueStatu[1]));
    let noneNull = Object.keys(times)
                        .map((key, index) => 
                            // 檢查是否已經(jīng)到了第二個查詢字段之后,因為你題目中說是紅框中
                            index <= offset ? null
                                            : times[key] === null)
                        .indexOf(true) === -1;
    /**
     * 對 times 數(shù)組進行一次映射
     * 比如按照此題會得到
     * [null, null, null, null, null,
     *  true, false, false, false, true]
     * 那么這個數(shù)組中只要存在 true 
     * 即意味著原來的 times 數(shù)組里 InlabbingTime 之后的時間里有 null 值, 
     * 換句話說,如果找不到 true 那么原來的 times 數(shù)組里 InlabbingTime 之后的時間里全都不為空。
     **/
     if (noneNull) {
         // 都有時間值
     } else {
         // 存在 null 值
     }
}
雨萌萌 回答

LockSupport#unPark()
方法注釋有說明,如下:
Makes available the permit for the given thread, if it was not already available. If the thread was blocked on park then it will unblock. Otherwise, its next call to park is guaranteed not to block. This operation is not guaranteed to have any effect at all if the given thread has not been started.

加粗斜體部分已經(jīng)說明,不會保證方法功能,如果線程未啟動之前操作。
所以先要t1.start()

撥弦 回答

你可以去我的主頁看看這篇文章,里面有關(guān)于git設(shè)置的章節(jié)。https://segmentfault.com/a/11...

病癮 回答

因為開啟了斷點續(xù)傳 關(guān)閉就行了

chunked : false,
陌南塵 回答
case <-ch:
            fmt.Println("receive:", <-ch)

你這里連續(xù)取了兩次值. 所以只需要五次循環(huán) ch 就已經(jīng)空了, 后面五次自然都是 timeout 了.

改成:

select {
        case c := <-ch: // 只取一次
            fmt.Println("receive:", c)
        case <-timeout:
            fmt.Println("timeout")
        }