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

鍍金池/ 問答/ 網(wǎng)絡(luò)安全問答
拮據(jù) 回答

@oxf1992

按照你所說,在controller 中執(zhí)行休眠的時(shí)候,符合差不多同時(shí)執(zhí)行的規(guī)律
但是如果在controller 調(diào)用service,service執(zhí)行休眠的時(shí)候,兩個(gè)間隔時(shí)間比較長,但又小于休眠時(shí)間,具體代碼如下

@RestController
@RequestMapping("/test")
public class TestController {
    private static final Logger logger = LoggerFactory.getLogger(TestController.class);
    @Autowired
    private IUserService userService;

    @GetMapping("/user")
    public Object testUser() {
        logger.info("testController:{}", this.toString());
        logger.info("userService:{}", userService.toString());
        userService.get(1l);
        return "ok";
    }

    @RequestMapping("/foo2")
    public Object foo2(HttpServletRequest request) throws InterruptedException {
        String param = request.getParameter("p");
        logger.error("param:{}", param);
        long start = System.currentTimeMillis();
        Thread.sleep(10000);
        long end = System.currentTimeMillis();
        logger.error("time:{}", end - start);
        return end - start;
    }
}


    @Override
    public void get(Long id) {
        logger.error("get start...{}", this.toString());
        try {
            Thread.sleep(30000l);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.error("get end...{}", this.toString());
    }

結(jié)果如下:

2018-03-28 15:53:04.559  INFO 21776 --- [io-8080-exec-10] c.e.m.web.controller.TestController      : testController:com.example.multimodule.web.controller.TestController@189ebbd
2018-03-28 15:53:04.559  INFO 21776 --- [io-8080-exec-10] c.e.m.web.controller.TestController      : userService:com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:53:04.559 ERROR 21776 --- [io-8080-exec-10] c.e.m.s.service.impl.UserServiceImpl     : get start...com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:53:25.665  INFO 21776 --- [nio-8080-exec-4] c.e.m.web.controller.TestController      : testController:com.example.multimodule.web.controller.TestController@189ebbd
2018-03-28 15:53:25.665  INFO 21776 --- [nio-8080-exec-4] c.e.m.web.controller.TestController      : userService:com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:53:25.665 ERROR 21776 --- [nio-8080-exec-4] c.e.m.s.service.impl.UserServiceImpl     : get start...com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:53:34.559 ERROR 21776 --- [io-8080-exec-10] c.e.m.s.service.impl.UserServiceImpl     : get end...com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:53:55.665 ERROR 21776 --- [nio-8080-exec-4] c.e.m.s.service.impl.UserServiceImpl     : get end...com.example.multimodule.service.service.impl.UserServiceImpl@2a12ba65
2018-03-28 15:54:01.853 ERROR 21776 --- [nio-8080-exec-8] c.e.m.web.controller.TestController      : param:aaaaa
2018-03-28 15:54:03.788 ERROR 21776 --- [nio-8080-exec-5] c.e.m.web.controller.TestController      : param:bbbb
2018-03-28 15:54:11.854 ERROR 21776 --- [nio-8080-exec-8] c.e.m.web.controller.TestController      : time:10000
2018-03-28 15:54:13.788 ERROR 21776 --- [nio-8080-exec-5] c.e.m.web.controller.TestController      : time:10000

可以看到兩次執(zhí)行foo2請(qǐng)求,基本是同時(shí)執(zhí)行,但兩次執(zhí)行user,中間間隔時(shí)間較長

巫婆 回答

問題解決了,啟動(dòng)腳本sh文件沒有配置新加入的jar包信息,更新后即可正常運(yùn)行

掛念你 回答

因?yàn)檫@個(gè)范圍內(nèi)的任何兩個(gè)數(shù)相除得到的結(jié)果中,誤差最小的也比浮點(diǎn)數(shù)的精度要大。

壞脾滊 回答

session默認(rèn)配置文件讀寫。也可以設(shè)置存到memcache,redis。那么問題來了。一個(gè)用戶占多少個(gè)值,然后一個(gè)用戶大概需要占用到多少空間。如果同時(shí)在線人數(shù)不是很多,且session回收做好,其實(shí)用session來做是很合理的。

終相守 回答

最近項(xiàng)目中剛用到

import Editor from 'wangeditor'

export default {
    methods: {
        initEditor() {
            var editor = new Editor('#editor')
            // editor.customConfig.uploadImgShowBase64 = true
            // editor.customConfig.uploadImgServer = '/upload'
            editor.customConfig.uploadImgServer = '/upload';
            editor.customConfig.uploadFileName = 'uploadfile';
            editor.customConfig.uploadImgHooks = {
                customInsert: function (insertImg, result, editor) {
                    var url = result.url
                    insertImg(url)
                }
            }
            editor.customConfig.customAlert = (info) => {
                this.$Notice.info({title: info})
            }
            editor.customConfig.onchange = (html) => {
                this.form.content = html
            }
            editor.create()
        }
    },
    mounted() {
        this.initEditor()
    }
懶洋洋 回答

centos哈?

命令:vi /etc/hosts

在最后一行:127.0.0.1 iZuf66j5nlb2arg99viiuyZ

保存,退出。

單眼皮 回答

解決了,是因?yàn)樵谙鄳?yīng)地方要引用相應(yīng)的上下文

厭遇 回答

case中要求的是常量,一般是不能進(jìn)行邏輯判斷的, 所以這也是if語句優(yōu)于switch語句的地方!

綰青絲 回答

不解,這種DOM操作,更新頻率不大,一般用不到requestAnimationFrame,直接通過setInterval(func, 1000)不可以嗎?

針對(duì)只有第一條價(jià)格會(huì)動(dòng),可能是DOM查詢的不對(duì)。

用jq的話,大概代碼如下:

setInterval(function() {
    var time = new Date().getTime()
    $('.price').each(function() {
        if(time > $(this).attr('data-starttime')) {
             $(this).text(parseInt($(this).text()) - 0.1);
        }
    })
}, 1000)
敢試 回答

div2加overflow:scroll就行了,正常應(yīng)該是div2寬度等于ul寬度2000,多出來的40應(yīng)該是ul的margin。

逗婦惱 回答

是不是可以點(diǎn)擊還原按鈕的時(shí)候,改變一下state,在shouldComponentUpdate里面不止做props變化的檢測,也考慮state的變化。

shouldComponentUpdate(nextProps, nextState)
帥到炸 回答

一樓正解,用java8的lambda表達(dá)式可以很簡練的實(shí)現(xiàn):

Map<Integer, B> bMap = arr2.stream().collect(Collectors.toMap(B::getA1, Function.identity()));
arr.forEach(a -> {
            B b = bMap.get(a.getA1());
            a.setB(b);
        });
話寡 回答

checkbox group應(yīng)該返回的數(shù)組吧, 如果不是, 你把它組合一下, render函數(shù)循環(huán)這個(gè)數(shù)組:

{
  勾選過的數(shù)組state.map(item => (
    <div></div>
  ))
}
撿肥皂 回答

對(duì)象是正序添加到符號(hào)表中的,在請(qǐng)求結(jié)束清理階段會(huì)反向遍歷符號(hào)表,逐一釋放內(nèi)存
php中的變量是存儲(chǔ)在堆內(nèi)存的,內(nèi)核的局部變量是存儲(chǔ)在棧上的
php內(nèi)核的有些地方是模擬棧的操作

熟稔 回答
echo '<button class="user_signup_btn_facebook" onclick="' . htmlspecialchars($loginUrl) . '">Facebook</button>';

這樣呢

萌面人 回答

child_process.exec可以執(zhí)行指令。但是windows具體的指令我就不會(huì)了。

官網(wǎng)文檔

風(fēng)畔 回答

兩種方法

.box li,.box2 li{
    width: 100px;
    height: 30px;
    display: inline-block;
    background: red;
}
.box li:nth-child(2n),
.box2 li:nth-child(2n){
    background: blue;
}
        
.box{
    width: 300px;
    white-space: nowrap;
    overflow-x: auto;
    border:1px solid #999
}
        
.box2{
    width: 300px;
    overflow-x: auto;
    border:1px solid #999
}
.box2{
    display: flex;
}
.box2 li{
    flex-shrink:0
}

<ul class="box">
    <li></li><li></li><li></li><li></li><li></li><li></li>
</ul>

<ul class="box2">
    <li></li><li></li><li></li><li></li><li></li><li></li>
</ul>