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

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

這是由 Vim 的 colorschme 決定的,換個看得順眼的應(yīng)該就行了。如果非要改的話,大概是這幾個元素:

  • Pmenu
  • PmenuSel
  • PmenuSbar
  • PmenuThumb

具體查看 :h Pmenu。

clipboard.png

顏色很奇怪的話,有設(shè)置 set t_Co=256 嗎? 使用 256 色。

浪婳 回答

那簡單,不用數(shù)據(jù)庫那就放在內(nèi)存吧。建個字典 dict 存放待用戶待推送的消息:

wait_push = {
    <user_id> : ['text', 'text', ...]
}

用戶 self.accept() 接受websocket請求后,檢測下是否有消息再 self.send() 。為了避免內(nèi)存高占用,字典可以僅保存一定數(shù)量的推送,超過的話就頂?shù)襞f的。

墻頭草 回答
  1. 雙擊導(dǎo)入你的服務(wù)器證書到鑰匙串
  2. 找到你的證書

clipboard.png

小曖昧 回答
  1. 問題一 還記得你注釋過以下代碼嗎,在注釋后新增兩行代碼

    //ScaleSlider();
    
    //$(window).bind("load", ScaleSlider);
    //$(window).bind("resize", ScaleSlider);
    //$(window).bind("orientationchange", ScaleSlider);
    $('.sliders').css('width','100%');   //添加
    $('.jssorLayout').css('width','100%'); //添加
  2. 問題二 之前給你解答過: 在css中定義寬度會被slider自己的腳本覆蓋,因為slider腳本將100%解析成為100px展示,這是個bug.
    如果你想修改他們的寬度,請用js腳本控制,
  $('.sliders').css('width','100%');
  $('.jssorLayout').css('width','100%');
柒槿年 回答

注意下 this 指向問題, 沒有使用箭頭函數(shù)要注意 this

情皺 回答

Jenkins Master節(jié)點不建議放在容器里面去。

你可以在一個構(gòu)建任務(wù)里面通過含有不同環(huán)境的Docker去完成不同的構(gòu)建任務(wù),只把Master作為一個調(diào)度節(jié)點

pipeline {
    agent none
    stages {
        stage('Back-end') {
            agent {
                docker { image 'maven:3-alpine' }
            }
            steps {
                sh 'mvn --version'
            }
        }
        stage('Front-end') {
            agent {
                docker { image 'node:7-alpine' }
            }
            steps {
                sh 'node --version'
            }
        }
    }
}

參考鏈接:Using Docker with Pipeline

吢涼 回答

@LieRabbit 那樣是行不通的,提示的錯誤信息在下面:
圖片描述

你的瞳 回答

你看看這個行不行, 大概也就這樣思路.

/**
 * 紅包分配算法
 *
 * 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;

    /**
     * 紅包個數(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        紅包個數(shù)
     * @param float $coupon_min 每個至少領(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. 驗證
        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;  // 剩余可分配的紅包個數(shù)
        $amount = $this->amount;  //剩余可領(lǐng)取的紅包金額

        while ($num >= 1) {
            // 剩余一個的時候,直接取剩余紅包
            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);  //隨機打亂
    }

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

        // 浮動計算
        $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;
    }

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

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

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

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

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

半心人 回答

你組件里加了<router-view></router-view>嗎

陌上花 回答

查了一下這些文獻(xiàn):確認(rèn)了 Ubuntu 16.04 LTS 默認(rèn)源安裝的的 samba 4.3.11 版本是修復(fù)過漏洞的

愛是癌 回答

你好

  • 首先為了觀察方便,先使用redis

  • 然后抓請求觀察sid(express-session默認(rèn)是connect_sid)

  • 觀察redis存儲session情況,和前端是否匹配

賤人曾 回答

已解決,重寫MappingJackson2HttpMessageConverterwriteInternal方法即可,完整配置如下:

@Configuration
public class HttpConverterConfig extends WebMvcConfigurerAdapter {

    public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(){
        return new MappingJackson2HttpMessageConverter(){
            @Override
            protected void writeInternal(Object object, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
                if(object instanceof String){
                    Charset charset = this.getDefaultCharset();
                    StreamUtils.copy((String)object, charset, outputMessage.getBody());
                }else{
                    super.writeInternal(object, type, outputMessage);
                }
            }
        };
    }

    @Override
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        MappingJackson2HttpMessageConverter converter = mappingJackson2HttpMessageConverter();
        converter.setSupportedMediaTypes(new LinkedList<MediaType>(){{
            add(MediaType.TEXT_HTML);
            add(MediaType.APPLICATION_JSON_UTF8);
        }});
        converters.add(new StringHttpMessageConverter());
        converters.add(converter);
    }
}
寫榮 回答

這里沒人嗎 要石沉大海了??

凝雅 回答

大致上跟其它編譯到機器碼的語言一樣:別人只能看匯編了。

不過,「故考慮把核心部分換語言重構(gòu)」,如果你考慮在同一進(jìn)程里同時使用 Go 和另一種語言,特別是解釋型語言的話,還是放棄吧。Go 和 C 之間的調(diào)用已經(jīng)被 Go 核心開發(fā)者警告了(請搜索「cgo is not go」;你沒看到 Go 語言的項目都是自個兒干活,極少有混編的情況),和其它大運行時的程序調(diào)……你饒了你自己吧。

出于代碼保護(hù)目的,建議使用 Rust,和 Python、Ruby、Lua、NodeJS、Haskell、C、C++ 等等語言相互調(diào)用都容易得多。

祈歡 回答

沒區(qū)別,在支持Object.assign的環(huán)境下,_.assign就是調(diào)用的Object.assign

傻丟丟 回答

Windows下沒必要用nginx反代Apache
因為Windows下的nginx效率較低,不建議用于生產(chǎn)環(huán)境
直接用Apache跑php和靜態(tài)就行

大濕胸 回答

new.target屬性允許你檢測函數(shù)或構(gòu)造方法是否是通過new運算符被調(diào)用的。在通過new運算符被初始化的函數(shù)或構(gòu)造方法中,new.target返回一個指向構(gòu)造方法或函數(shù)的引用。在普通的函數(shù)調(diào)用中,new.target 的值是undefined。

new.target語法由一個關(guān)鍵字"new",一個點,和一個屬性名"target"組成。通常"new."的作用是提供屬性訪問的上下文,但這里"new."其實不是一個真正的對象。不過在構(gòu)造方法調(diào)用中,new.target指向被new調(diào)用的構(gòu)造函數(shù),所以"new."成為了一個虛擬上下文。

new.target屬性是一個可以被所有函數(shù)訪問的元屬性。在箭頭函數(shù)中,new.target指向外圍函數(shù)的new.target。

艷骨 回答

如果確認(rèn)代碼都沒有動過,那么要確認(rèn)下環(huán)境是否有異常,比如創(chuàng)建文件的權(quán)限有沒有。