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

鍍金池/ 問答/ 網(wǎng)絡(luò)安全問答
荒城 回答

假設(shè)有對(duì)象A,里面有屬性name,age,password,對(duì)象查詢似乎只能全部查出來,無法查出指定對(duì)象,而且查一個(gè)字段和查全部字段性能幾乎無差,個(gè)人認(rèn)為你這是偽需求。

假設(shè)有對(duì)象A,B.
A里面有屬性name,age,b,同時(shí)A與B配置了一對(duì)多的關(guān)系,默認(rèn)情況下查詢A對(duì)象,B對(duì)象不會(huì)被立即查出,原因是一對(duì)多的情況下,FetchType fetch() default LAZY;,如果想B這個(gè)集合也被全部查出來,只需設(shè)置@OneToMany(fetch = FetchType.EAGER);
如果A和B是多對(duì)一的關(guān)系,默認(rèn)查詢A對(duì)象,B對(duì)象也會(huì)被查詢出來,只需要設(shè)置@ManyToOne(fetch = FetchType.LAZY),B對(duì)象就會(huì)被立即查詢。你可以設(shè)置完設(shè)計(jì)好日志看控制臺(tái)打印的sql語句測(cè)試一下。

久舊酒 回答

一樓的辦法可以,不過我是這么解決的:
寫一個(gè)splash.vue組件,放在app.vue根組件里面,與vue-router平級(jí):
fixed定位,讓他蓋在vue-router上面
Splash.vue

<template>
  <div id="splash">
      <img src="">
  </div>
</template>

<script>

</script>

<style lang="stylus" rel="stylesheet/stylus">
  #splash
    position fixed
    top 0
    left 0
    z-index 6
    width 100%
    height 100%
    opacity 1
    transition opacity .3s ease
    box-sizing border-box
    &.fade-enter,&.fade-leave-to
      opacity 0;
</style>

App.vue

<template>
  <div id="app">
    <transition name="fade">
      <v-splash v-show="splash"></v-splash>
    </transition>
    <keep-alive>
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

之后在一定時(shí)間后將splash變成false就可以讓splash組件隱藏,使內(nèi)容顯示出來

冷咖啡 回答

客戶端輪詢
如果客戶端是瀏覽器,起一個(gè)定時(shí)器,每隔一段時(shí)間去請(qǐng)求下服務(wù)端數(shù)據(jù),知道處理完為止。app的話,起一個(gè)線程去干。。
長(zhǎng)連接推送
http2或者websocket甚至js實(shí)現(xiàn)的comet都可以。

鐧簞噯 回答

先設(shè)置post,并將url填好。

1、設(shè)置請(qǐng)求頭
SouthEast

2、設(shè)置請(qǐng)求體
SouthEast

比如后臺(tái)PHP服務(wù)器接受upload字段的文件:

echo $_FILES["upload"];

逗婦惱 回答

如果用于網(wǎng)絡(luò)傳輸,用json序列化,不需要實(shí)現(xiàn)Java序列化接口

this.props.form.validateFields((err, values) => {
  if (!err) {
    const data = new URLSearchParams(values);
    }
})



if (newOptions.method === "POST" || newOptions.method === "PUT") {
if (!(newOptions.body instanceof FormData) && !(newOptions.body instanceof URLSearchParams)) {
  newOptions.headers = {
    Accept: "application/json",
    "Content-Type": "application/json; charset=utf-8",
    ...newOptions.headers
  };
  newOptions.body = JSON.stringify(newOptions.body);
} else {
  // newOptions.body is FormData
  newOptions.headers = {
    Accept: "application/json",
    "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
    ...newOptions.headers
  };
}

}

菊外人 回答

1.這是創(chuàng)建索引分詞造成的,可以不使用分詞
2.在使用的時(shí)候使用“”全詞匹配精確查找

你的瞳 回答

你看看這個(gè)行不行, 大概也就這樣思路.

/**
 * 紅包分配算法
 *
 * example
 *      $coupon = new Coupon(200, 5);
 *      $res = $coupon->handle();
 *      print_r($res);
 *
 * @author Flc <2018-04-06 20:09:53>
 * @see http://flc.ren | http://flc.io | https://github.com/flc1125
 */
class Coupon
{
    /**
     * 紅包金額
     *
     * @var float
     */
    protected $amount;

    /**
     * 紅包個(gè)數(shù)
     *
     * @var int
     */
    protected $num;

    /**
     * 領(lǐng)取的紅包最小金額
     *
     * @var float
     */
    protected $coupon_min;

    /**
     * 紅包分配結(jié)果
     *
     * @var array
     */
    protected $items = [];

    /**
     * 初始化
     *
     * @param float $amount     紅包金額(單位:元)最多保留2位小數(shù)
     * @param int   $num        紅包個(gè)數(shù)
     * @param float $coupon_min 每個(gè)至少領(lǐng)取的紅包金額
     */
    public function __construct($amount, $num = 1, $coupon_min = 0.01)
    {
        $this->amount = $amount;
        $this->num = $num;
        $this->coupon_min = $coupon_min;
    }

    /**
     * 處理返回
     *
     * @return array
     */
    public function handle()
    {
        // A. 驗(yàn)證
        if ($this->amount < $validAmount = $this->coupon_min * $this->num) {
            throw new Exception('紅包總金額必須≥'.$validAmount.'元');
        }

        // B. 分配紅包
        $this->apportion();

        return [
            'items' => $this->items,
        ];
    }

    /**
     * 分配紅包
     */
    protected function apportion()
    {
        $num = $this->num;  // 剩余可分配的紅包個(gè)數(shù)
        $amount = $this->amount;  //剩余可領(lǐng)取的紅包金額

        while ($num >= 1) {
            // 剩余一個(gè)的時(shí)候,直接取剩余紅包
            if ($num == 1) {
                $coupon_amount = $this->decimal_number($amount);
            } else {
                $avg_amount = $this->decimal_number($amount / $num);  // 剩余的紅包的平均金額

                $coupon_amount = $this->decimal_number(
                    $this->calcCouponAmount($avg_amount, $amount, $num)
                );
            }

            $this->items[] = $coupon_amount; // 追加分配

            $amount -= $coupon_amount;
            --$num;
        }

        shuffle($this->items);  //隨機(jī)打亂
    }

    /**
     * 計(jì)算分配的紅包金額
     *
     * @param float $avg_amount 每次計(jì)算的平均金額
     * @param float $amount     剩余可領(lǐng)取金額
     * @param int   $num        剩余可領(lǐng)取的紅包個(gè)數(shù)
     *
     * @return float
     */
    protected function calcCouponAmount($avg_amount, $amount, $num)
    {
        // 如果平均金額小于等于最低金額,則直接返回最低金額
        if ($avg_amount <= $this->coupon_min) {
            return $this->coupon_min;
        }

        // 浮動(dòng)計(jì)算
        $coupon_amount = $this->decimal_number($avg_amount * (1 + $this->apportionRandRatio()));

        // 如果低于最低金額或超過可領(lǐng)取的最大金額,則重新獲取
        if ($coupon_amount < $this->coupon_min
            || $coupon_amount > $this->calcCouponAmountMax($amount, $num)
        ) {
            return $this->calcCouponAmount($avg_amount, $amount, $num);
        }

        return $coupon_amount;
    }

    /**
     * 計(jì)算分配的紅包金額-可領(lǐng)取的最大金額
     *
     * @param float $amount
     * @param int   $num
     */
    protected function calcCouponAmountMax($amount, $num)
    {
        return $this->coupon_min + $amount - $num * $this->coupon_min;
    }

    /**
     * 紅包金額浮動(dòng)比例
     */
    protected function apportionRandRatio()
    {
        // 60%機(jī)率獲取剩余平均值的大幅度紅包(可能正數(shù)、可能負(fù)數(shù))
        if (rand(1, 100) <= 60) {
            return rand(-70, 70) / 100; // 上下幅度70%
        }

        return rand(-30, 30) / 100; // 其他情況,上下浮動(dòng)30%;
    }

    /**
     * 格式化金額,保留2位
     *
     * @param float $amount
     *
     * @return float
     */
    protected function decimal_number($amount)
    {
        return sprintf('%01.2f', round($amount, 2));
    }
}

此代碼轉(zhuǎn)載至PHPhuo.org用戶葉子坑, 侵刪!
PHP 實(shí)現(xiàn)微信紅包拆分算法

浪婳 回答

找到原因了,使用翻譯語言的原因,arc diff 表單的單詞不能翻譯

孤島 回答

這樣的話你需要記錄每個(gè)ip地址的訪問次數(shù),以此來判斷是否響應(yīng),但是你要想清楚這種限制是對(duì)單個(gè)應(yīng)用實(shí)例的,還是對(duì)所有應(yīng)用實(shí)例集群的,還有這種限制的具體業(yè)務(wù)需求,是每天限制、第二天刷新次數(shù)呢,還是永久限制呢等等。

心悲涼 回答

代碼2:
你把Function.call當(dāng)成一個(gè)function看待。這個(gè)function上調(diào)用apply方法,那么第一個(gè)參數(shù)就是this對(duì)象,而Function.call所需要的this對(duì)象必須是一個(gè)funtion,你傳遞的{},是一個(gè)空的對(duì)象,那么就要做類型轉(zhuǎn)換,也就是從{}轉(zhuǎn)換成一個(gè)function,那么肯定是會(huì)報(bào)類型轉(zhuǎn)換錯(cuò)誤,所以safari的報(bào)錯(cuò)是最嚴(yán)謹(jǐn)?shù)摹?/p>

淡墨 回答

Because the spec says so.

Note. This property applied to all elements in CSS1. Implementations may therefore have supported this property on all elements. In CSS2 and CSS 2.2 the 'clear' property only applies to block-level elements.
女流氓 回答

一種是你把參數(shù)暴露到父級(jí)地址欄上面保存。每次刷新時(shí)讀取地址欄參數(shù)。二是你存到sessionStorage里面,每次刷新時(shí)獲取賦值。

孤毒 回答

問題一:限定顯示

setBounds可以設(shè)置當(dāng)前顯示范圍
setLimitBounds可以限制地圖的顯示范圍
實(shí)例:https://lbs.amap.com/api/java...

問題二:界面自適應(yīng)

//高度固定,寬度自適應(yīng)(Bootstrap 自適應(yīng))
<div class="col-lg-8 col-md-8 col-xs-8" style="height: 550px;">
//放置地圖區(qū)域

</div>
魚梓 回答

React.Children.map != Array.map
這個(gè)是react封裝的map并不是js數(shù)組的map方法

荒城 回答

直接在 navigationBar 上添加 view,我這邊可以,LZ試下
UINavigationBar *navigationBar = self.navigationController.navigationBar;

    [navigationBar.superview insertSubview:self.navigationBarBGView belowSubview:navigationBar];
雅痞 回答

得先把rxjs的包引進(jìn)來

舊酒館 回答
.opacity(@number){
  /* older safari/Chrome browsers */
  -webkit-opacity: @number/100;
  /* Netscape and Older than Firefox 0.9 */
  -moz-opacity: @number/100;
  /* Safari 1.x (pre WebKit!) 老式khtml內(nèi)核的Safari瀏覽器*/
  -khtml-opacity: @number/100;
  /* IE9 + etc...modern browsers */
  opacity: @number/100;
  /* IE 4-9 */
  filter:alpha(opacity=@number);
  /*This works in IE 8 & 9 too*/
  -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=@number);
  /*IE4-IE9*/
  filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=@number);

}
半心人 回答

返回值并不是一個(gè)數(shù)組,但是可以定義方法來操作數(shù)組,例如下面的例子

class Result {
constructor(room){
this.data = room;
}
addVal() {
return this.data.map((item) => ++item);
}
}
var result = new Result([1,2,3]);
console.log(result);
console.log(result.addVal()); // [2, 3, 4]