鍍金池/ 問答
離觴 回答

webpack-dev-server后面有個逗號,你的編輯器不報錯嗎

憶當年 回答

把java達成jar包提交到spark上.
把結(jié)果輸入到hdfs集群上.

嘟尛嘴 回答

根據(jù)您提出胡思路,有了自己的解決方案。
先用BS獲取到目標網(wǎng)頁數(shù)據(jù)段信息,再用正則表達取得里面的數(shù)據(jù)。


from bs4 import BeautifulSoup


# 定義一個通知新聞的類型
class News(object):
    def __init__(self):
        self.__url = None
        self.__title = None
        self.__posttime = None

    def print_info(self):
        print('%s: %s:%s' % (self.__title, self.__posttime, self.__url))

    def set_url(self, url):
        self.__url = url

    def set_title(self, title):
        self.__title = title

    def set_posttime(self, posttime):
        self.__posttime = posttime

    def get_url(self):
        return self.__url

    def get_title(self):
        return self.__title

    def get_posttime(self):
        return self.__posttime



newslist = []
# 保存最新的通知列表
for link in soup.find_all(attrs={'id': '494'}):
    # print(link)
    # 獲取兩個td里面的內(nèi)容
    tr=re.findall(r'<tr[^>]*>(.*?)</tr>',str(link),re.I|re.M)
    #print(tr)
    for trs in tr:
        notice = News()
        #print(trs)
        td = re.findall(r'<td[^>]*>(.*?)</td>', str(trs), re.I | re.M)
        # print(td)
        i = 1
        for newid in td:
            # 第一個TD里面的內(nèi)容存放的是網(wǎng)址和標題
            # print(newid)
            # 第二個TD里面的內(nèi)容存放的是發(fā)布日期
            if (i % 2) == 0:
                posttime = newid
                notice.set_posttime(posttime)
                i = i + 1
                #notice.print_info()
                newslist.append(notice)
            else:
                # 進一步分解第一個TD里面的內(nèi)容,分別獲取鏈接和標題屬性
                url = re.findall(r'href=\'(\S+)\'', str(newid))
                finalurl = "http://www.zjedu.org" + str(url[0])
                # print(finalurl)
                title = re.findall(r'title=\'(.*?)\'', str(newid))
                stitle=str(title[0]).strip()
                notice.set_url(finalurl)
                print(stitle)
                notice.set_title(stitle)
                i = i + 1
                      
                
                

輸出的結(jié)果如下:
2017年度學科帶頭人考核合格名單的通知: [2018-01-02]:/art/2018/1/2/art_275_33408.html
祉小皓 回答

你這個網(wǎng)址是bug做的

clipboard.png

哈哈,當然是打開控制臺一頓看了呀。

clipboard.png

怣人 回答

不用 耳機域名就好了!
例如:demo.com 后臺可以用api.demo.com

安若晴 回答

你使用什么框架?vue的話,推薦vux組件庫

小曖昧 回答

占個坑。哪天發(fā)現(xiàn)了再來更。

貓小柒 回答

額,知道啦,掃一掃可以識別出號碼...

故人嘆 回答
本系列文章所講解內(nèi)容,依賴于https://github.com/icarusion/... 這套架構(gòu)
熊出沒 回答

試試這個想法行不行:

handleEdit: function(index) {
    let that = this;
    taht.id = that.tableData3[index].id;
    setTimeout(() => {
        that.$refs.showdetail.getid();
        that.$refs.showdetail.showdetail();
    },0);
}
刮刮樂 回答

那你的對象就要是{a:"1",b:"name"},a的值是字符串類型"1"而不是數(shù)字1

無標題 回答

我看了下源代碼. 剛才說錯了. 除了password這個字段是固定的, 別的都可以加.
表里面有phone字段, 就可以加phone.

現(xiàn)在這種情況, 你需要看一下sql日志, 再確定你用的這個phone的密碼是對的.
檢查密碼是用 Hash::check() 函數(shù).

誮惜顏 回答

當然可以,使用validate方法就可以了。在文檔中有鏈接。

尋仙 回答
package main

import (
    "fmt"
    "math"
    "runtime"
    "sync"
)

type S struct {
    a int
    b int
    c int
    p int
}

func NewS(pa, pb, pc, pp int) *S {
    return &S{
        a: pa,
        b: pb,
        c: pc,
        p: pp,
    }
}

func (s *S) isMatch() bool {
    return s.a*s.a+s.b*s.b+s.c*s.c == s.p
}

func abcasync(ch chan *S, chResult chan *S, p int) *S {
    na := int(math.Sqrt(float64(p))) + 2
    for a := 0; a < na; a++ {
        for b := 0; b < na; b++ {
            for c := 0; c < na; c++ {
                select {
                case r := <-chResult:
                    close(ch)
                    return r
                default:
                    ch <- (NewS(a, b, c, p))
                }
            }
        }
    }
    return nil
}

func main() {
    pNum := runtime.NumCPU()
    ch := make(chan *S, 100)
    chResult := make(chan *S)

    var wg sync.WaitGroup
    wg.Add(pNum)
    for i := 0; i < pNum; i++ {
        go func() {
            defer wg.Done()
            for s := range ch {
                if s.isMatch() {
                    chResult <- s
                }
            }
        }()
    }
    d := abcasync(ch, chResult, 10000)
    if d == nil {
        fmt.Println("not found")
    } else {
        fmt.Println(d)
    }
    wg.Wait()
}

計算密集型的,攜程多了不管用,你可以增加協(xié)程數(shù)benchmark一下

亮瞎她 回答

import re
text = '{"熱門":[{display:"北京",data:"Beijing|北京(BJS)|1|BJS"},{display:"上海",data:"Shanghai|上海(SHA)|2|SHA"}]}'
find = re.findall(r'display:"(.?)".?([A-Z]{3})',text)
print(find)

注意沒顯示的星號

運行結(jié)果:
[('北京', 'BJS'), ('上海', 'SHA')]
圖片描述

你的瞳 回答

可以修改 hosts 文件,將 www.xxxxx.com 映射到本地測試服務(wù)器 ip。

愿如初 回答

就是一個字符串前綴(如果a非null取a,為null就取空字符串)+加上一個計數(shù)器

拽很帥 回答

由于微信接口響應(yīng)結(jié)果是xml,瀏覽器解析失敗。
你可以通過查看源碼或在代碼中增加如下代碼查看響應(yīng)結(jié)果:

$error = htmlspecialchars($info);
echo "$error";