鍍金池/ 問(wèn)答/ 網(wǎng)絡(luò)安全問(wèn)答
不討喜 回答

redirect: '/product'放到第一個(gè)路由對(duì)象上就好了
改成這樣

routes: [
    {
      path: '/',
      name: 'Index',
      redirect: '/product',
      component: Index,
      children: [
        {
          path: '/product',
          name: 'Product',
          component: Product
        },
        {
          path: '/work',
          component: Work
        },
        {
          path: '/contact',
          component: Contact
        }
      ]
    },
  ]
未命名 回答

是不是沒(méi)有權(quán)限寫呀

局外人 回答

我記得weex debug是不支持windows的,不知道是不是記錯(cuò)了...

凝雅 回答

nums = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > span:nth-of-type(3) > strong:nth-of-type(1)')
titles = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > a:nth-of-type(4)')
times = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > span:nth-of-type(5) > span:nth-of-type(4)')

這個(gè)數(shù)據(jù)解析有問(wèn)題啊,所以當(dāng)然沒(méi)有打印輸出了
你覺(jué)得卡住,每次循環(huán)要sleep 7秒,而且輸出為空造成的假象吧
以下代碼供參考:
import requests
from bs4 import BeautifulSoup

url='http://www.kugou.com/yy/rank/...{}-8888.html?from=rank'

def get_info(url):

res=requests.get(url)
soup=BeautifulSoup(res.text,'lxml')
infoes=soup.select('div.pc_temp_songlist ul li ')
for info in infoes:
    nums=info.select('span.pc_temp_num')[0].text.strip()
    singer,name=info['title'].split('-',1)
    times=info.select('span.pc_temp_tips_r span.pc_temp_time')[0].text.strip()
    print({'名次':nums,'歌手':singer,'歌名':name,'時(shí)長(zhǎng)':times})

if __name__=='__main__':

urls = [url.format(i) for i in range(1, 24)]
for url in urls:
    get_info(url)

話寡 回答
  1. grep 需要添加參數(shù) --line-buffered,才能過(guò)濾 continuous stream.
  2. docker logs 使用 grep 某些環(huán)境下需要添加 2>&1 才有效果, docker logs xx -f 2>&1| grep --line-buffered xxx

參考
How to 'grep' a continuous stream?
docker logs <container id> | grep <some value> doesn't work

笑浮塵 回答

!previous條件被你吃了?怎么會(huì)每次都為now呢?

淡墨 回答

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.
初心 回答

你的情況用acl來(lái)分配權(quán)限比較好

落殤 回答

例如 nginx 配置
處理接口
location ^ ~ /apiA {
proxy_pass http://127.0.0.3000;
}
location ^ ~ /apiB {
proxy_pass http://127.0.0.3004;
}

影魅 回答

解決了,因?yàn)間ithub登錄成功后是 http 方式跳轉(zhuǎn)過(guò)去的,所以 express-session 需要設(shè)置下 secure: false

app.use(session({
    secret: 'Stefanie Sun',
    store: sessionStore,
    resave: true, // 強(qiáng)制更新 session
    saveUninitialized: true,  // 
    cookie: { 
        maxAge: 3 * 3600 * 1000,  // 過(guò)期時(shí)
        secure: false // http 訪問(wèn)時(shí) secure 為 false
  }, 
    rolling: true
}))

怪我沒(méi)有仔細(xì)看文檔=。=

冷眸 回答
docker run -it 鏡像:版本 /bin/bash

生成容器后可以進(jìn)去看有哪些軟件。

Dockerfile看不到的。

喜歡你 回答

如果你這個(gè)頁(yè)面的數(shù)據(jù)不是實(shí)時(shí)更新變化的,進(jìn)入頁(yè)面獲取數(shù)據(jù)應(yīng)該是在ionViewDidLoad()函數(shù),會(huì)被緩存起來(lái),這樣就可以避免返回刷新出現(xiàn)卡頓,你用Enter之類的函數(shù)是重新獲取數(shù)據(jù)的。

兔囡囡 回答

謝邀~問(wèn)題是否解決?
可能是提取插件ExtractPlugin版本的問(wèn)題。

落殤 回答

跟名字空間有關(guān), eval() 官方文檔是這樣的:

eval(expression, globals=None, locals=None)

其中有:

  • globals: 全局名字空間
  • locals: 局部名字空間

兩個(gè)可選屬性.如果這兩個(gè)都不寫, eval 默認(rèn)只能識(shí)別標(biāo)準(zhǔn)的 builtins 模塊.

你定義的 f() 函數(shù)的局部名字空間不包含實(shí)例 o:

class A:
    def __init__(self):
        self.a = 10

o = A()
o.a    # 10

def f(o, a):
    print(eval(o + '.' + a, globals())

f('o', 'a')
久不遇 回答

Ai好像只支持Flash導(dǎo)出吧,我記得Adobe有個(gè)Animate CC是用來(lái)做動(dòng)畫的,還可以直接輸出網(wǎng)頁(yè)不過(guò)沒(méi)試過(guò)……感覺(jué)SVG動(dòng)畫還是手寫方便。

拮據(jù) 回答

@oxf1992

按照你所說(shuō),在controller 中執(zhí)行休眠的時(shí)候,符合差不多同時(shí)執(zhí)行的規(guī)律
但是如果在controller 調(diào)用service,service執(zhí)行休眠的時(shí)候,兩個(gè)間隔時(shí)間比較長(zhǎng),但又小于休眠時(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í)間較長(zhǎng)

硬扛 回答

因?yàn)槲以?agent 里邊做了一下處理,所有我懷疑是不是 javassist 沒(méi)有被加載,導(dǎo)致我獲取不到 ClassPool