這說明safri中的tr不支持背景漸變。
可以嘗試用tr背景透明,并給其加上偽元素::after,然后將偽元素設(shè)置為z-index=-1的塊級(jí)元素,在這個(gè)div上應(yīng)用背景漸變。
利用es6的Set吧
求并集,判斷size
const s1 = 'abcsk'
const s2 = 'abnn'
if (new Set(s1).size === new Set(s1 + s2).size) {
// 說明s2里面只有s1的元素
} else {
// 說明s2里面含有s1意外的元素
}閉包是函數(shù)內(nèi)部有權(quán)訪問函數(shù)外部的變量,不是外部訪問內(nèi)部
首先看下完整版 破解前端面試(80% 應(yīng)聘者不及格系列):從 閉包說起
其實(shí)主要利用了基本類型在函數(shù)調(diào)用時(shí),按值傳遞的,所以就能拿到不同時(shí)期 i 對(duì)應(yīng)的值,跟閉包沒多大關(guān)系。
在頁面引入store 例如:import store from '../vuex/index'
不同語言前臺(tái)可后臺(tái)獲取到的date格式不同,直接給前端不見得能解析成功,然而時(shí)間戳都是一樣的。
https://segmentfault.com/q/10...
——————————————————————————————
第一次回復(fù)時(shí)沒看你的內(nèi)容,只回應(yīng)了標(biāo)題所以貼了個(gè)網(wǎng)址
下面正式回復(fù)
你的問題不是cookies的問題,我根據(jù)那篇文章改了下運(yùn)行成功了,你自己對(duì)照下
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"regexp"
"strings"
)
var cookies_lagou []*http.Cookie
const (
login_url_lagou string = "https://passport.lagou.com/login/login.html"
post_login_info_url_lagou string = "https://passport.lagou.com/login/login.json"
username_lagou string = "13330295142"
password_lagou string = "4525674692ac06e619cdb3f1b4b65b08"
)
func getToken(contents io.Reader) (string, string) {
data, _ := ioutil.ReadAll(contents)
regCode := regexp.MustCompile(`X_Anti_Forge_Code = '(.*?)';`)
if regCode == nil {
log.Fatal("解析Code出錯(cuò)...")
}
//提取關(guān)鍵信息
code := regCode.FindAllStringSubmatch(string(data), -1)[0][1]
regToken := regexp.MustCompile(`X_Anti_Forge_Token = '(.*?)';`)
if regToken == nil {
fmt.Println("MustCompile err")
}
//提取關(guān)鍵信息
token := regToken.FindAllStringSubmatch(string(data), -1)[0][1]
return token, code
}
func login_lagou() {
//獲取登陸界面的cookie
jar, _ := cookiejar.New(nil)
client := &http.Client{
Jar: jar,
}
req, _ := http.NewRequest("GET", login_url_lagou, nil)
res, _ := client.Do(req)
// for k, v := range res.Cookies() {
// fmt.Printf("%v=%v\n", k, v)
// }
token, code := getToken(res.Body)
fmt.Println(token, code)
//post數(shù)據(jù)
postValues := url.Values{}
postValues.Add("isValidate", "true")
postValues.Add("username", username_lagou)
postValues.Add("password", password_lagou)
postValues.Add("request_form_verifyCode", "")
postValues.Add("submit", "")
// body := ioutil.NopCloser(strings.NewReader(postValues.Encode())) //把form數(shù)據(jù)編下碼
// requ, _ := http.NewRequest("POST", post_login_info_url_lagou, nil)
requ, _ := http.NewRequest("POST", post_login_info_url_lagou, strings.NewReader(postValues.Encode()))
requ.Header.Set("Referer", "https://passport.lagou.com/login/login.html")
requ.Header.Set("X-Requested-With", "XMLHttpRequest")
requ.Header.Set("X-Anit-Forge-Token", token)
requ.Header.Set("X-Anit-Forge-Code", code)
requ.Header.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0")
requ.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
//for _, v := range res.Cookies() {
// requ.AddCookie(v)
//}
res, _ = client.Do(requ)
//cookies_lagou = res.Cookies()
data, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
fmt.Println(string(data))
}
func main() {
login_lagou()
}
運(yùn)行結(jié)果
15f131a3-74b0-4914-bd6e-2672f36675e1 28747049
{"content":{"rows":[]},"message":"該帳號(hào)不存在或密碼(驗(yàn)證碼)誤,請(qǐng)重新輸入","state":400,"submitCode":23207051,"submitToken":"666f51d4-ccef-462a-bb56-55cb97c5231a"}
Process finished with exit code 0決定并發(fā)的根本原因是數(shù)據(jù)庫存取,其次一個(gè)服務(wù)器能承載的并發(fā)量并非軟件決定,還是要看硬件性能
不知道你解決了沒有, 推薦一個(gè)項(xiàng)目里曾經(jīng)用過的方式, 不需要直接操作dom元素, 使用Subject來傳遞輸入值, 然后通過rxjs的操作符完成具體的操作.
<input type="text" #searchInput (keyup)="search.next(searchInput.value)">
search: Subject<string> = new Subject<string>();
ngOnInit() {
this.search.asObservable().debounceTime(400).filter().map().subscribe();
}那就改權(quán)限唄sudo chmod -R 755 /public/download/
1.node 8.9.3支持
node --experimental-modules a.mjs
2.瀏覽器未支持
你解決了嗎,我也遇到這個(gè)問題,窗口大小調(diào)整就正常了,但是不調(diào)整就不出來分頁條
可以通過Logrotate將日志每天定時(shí)進(jìn)行切割。
需要維護(hù)如下的一份配置文件:
/var/log/mysql/*.log {
create 644 mysql mysql
notifempty
daily
rotate 5
missingok
nocompress
sharedscripts
postrotate
# run if mysqld is running
if test -n "`ps acx|grep mysqld`"; then
/usr/bin/mysqladmin flush-logs
fi
endscript
}網(wǎng)上查了好多帖子,終于搞定了,以饗后來者~
PS.如果確認(rèn)自己各項(xiàng)參數(shù)都對(duì),但是還是提示簽名錯(cuò)誤,更新一下API密鑰,然后就ok了,微信那邊好像有緩存
創(chuàng)建一個(gè)沙箱驗(yàn)收的類,擴(kuò)展自WxPayDataBase
class Sandbox extends WxPayDataBase{
//設(shè)置對(duì)象的屬性
public function s_setValues($k, $v){
$this->values[$k] = $v;
}
//讀取對(duì)象的屬性
public function s_getValues($k){
return $this->values[$k];
}
//獲取密鑰API
public static function getSignKey($input, $mch_key){
console_log( '1:'.json_encode($input->values) );
//提交業(yè)務(wù)
$url = 'https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey';
//生成簽名
$input->setSign($mch_key);
console_log( '2:'.json_encode($input->values) );
//$values = $input->GetValues();
//console_log( '3:'.json_encode($values) );
$xml = $input->array2xml();
console_log( '4:'.$xml );
//向微信請(qǐng)求接口
$result = self::postXmlCurl($xml, $url);
console_log( json_encode($result) );
$result = $input->xml2array($result);
console_log( json_encode($result) );
return $result;
}
/**
*
* 產(chǎn)生隨機(jī)字符串,不長于32位
* @param int $length
* @return 產(chǎn)生的隨機(jī)字符串
*/
public static function getNonceStr($length = 32)
{
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
$str ="";
for ( $i = 0; $i < $length; $i++ ) {
$str .= substr($chars, mt_rand(0, strlen($chars)-1), 1);
}
return $str;
}
/**
* 以post方式提交xml到對(duì)應(yīng)的接口url
*
* @param string $xml 需要post的xml數(shù)據(jù)
* @param string $url url
* @param bool $useCert 是否需要證書,默認(rèn)不需要
* @param int $second url執(zhí)行超時(shí)時(shí)間,默認(rèn)30s
* @throws WxPayException
*/
private static function postXmlCurl($xml, $url, $useCert = false, $second = 30)
{
$ch = curl_init();
//設(shè)置超時(shí)
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
//設(shè)置訪問的網(wǎng)址
curl_setopt($ch, CURLOPT_URL, $url);
//skysowe_modifid
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
//設(shè)置header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//要求結(jié)果為字符串且輸出到屏幕上
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
console_log( 'cert:'.$useCert );
if($useCert == true){
//設(shè)置證書
//使用證書:cert 與 key 分別屬于兩個(gè).pem文件
curl_setopt($ch,CURLOPT_SSLCERTTYPE,'PEM');
curl_setopt($ch,CURLOPT_SSLCERT, WxPayConfig::SSLCERT_PATH);
curl_setopt($ch,CURLOPT_SSLKEYTYPE,'PEM');
curl_setopt($ch,CURLOPT_SSLKEY, WxPayConfig::SSLKEY_PATH);
}
//post提交方式
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
//console_log( 'xml:'.json_encode($xml) );
//運(yùn)行curl
$data = curl_exec($ch);
//console_log( 'curl_result:'.json_encode($data) );
//返回結(jié)果
if($data){
curl_close($ch);
return $data;
} else {
$error = curl_errno($ch);
curl_close($ch);
throw new WxPayException("curl出錯(cuò),錯(cuò)誤碼:$error");
//console_log( 'curl_error:'.$error );
}
}
/**
* 輸出xml字符
* @throws WxPayException
**/
public function array2xml()
{
if(!is_array($this->values)
|| count($this->values) <= 0)
{
throw new WxPayException("數(shù)組數(shù)據(jù)異常!");
}
$xml = "<xml>";
foreach ($this->values as $key=>$val)
{
if (is_numeric($val) || $key=="nonce_str" || $key=="sign" ){
$xml.="<".$key.">".$val."</".$key.">";
}else{
$xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
}
}
$xml.="</xml>";
return $xml;
}
/**
* 將xml轉(zhuǎn)為array
* @param string $xml
* @throws WxPayException
*/
public function xml2array($xml)
{
if(!$xml){
throw new WxPayException("xml數(shù)據(jù)異常!");
}
//將XML轉(zhuǎn)為array
//禁止引用外部xml實(shí)體
libxml_disable_entity_loader(true);
$this->values = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
return $this->values;
}
}
然后獲取sandbox_signkey
//沙箱用例:0 獲取驗(yàn)簽秘鑰
$sandbox_test = new Sandbox();
$sandbox_test->s_setValues('mch_id', WxPayConfig::MCHID);
$sandbox_test->s_setValues('nonce_str', $sandbox_test->getNonceStr());
//debug
console_log( $sandbox_test->s_getValues('mch_id') );
console_log( $sandbox_test->s_getValues('nonce_str') );
console_log( WxPayConfig::KEY );
$rs = Sandbox::getSignKey($sandbox_test, WxPayConfig::KEY);
//debug
echo json_encode($rs);
echo $rs['sandbox_signkey'];
exit;寫的很亂啊
shouldComponentUpdate(nextProps, nextState) {
14 | if( nextProps.states.set.title !== "undefined"){ // 這里set是個(gè)對(duì)象
> 15 | this.setState({set:[nextProps.states.set[0]]}) // 這里set怎么變成數(shù)組了?
16 | console.log(nextProps.states)
17 | return true
18 | }
而且一般的組件更新并不使用shouldComponentUpdate,這個(gè)方法通常用在無法利用組件機(jī)制自動(dòng)更新或某些特殊情況時(shí),手動(dòng)更新的,直接通過props傳過來的值,父級(jí)改變,子集也會(huì)自動(dòng)render,不應(yīng)該把props值重新用state管理,參考下官方給教程:
https://reactjs.org/tutorial/...
Unknown column 'ys170606100349' in 'where clause' 他都說不識(shí)別的ys170606100349是不是ys這個(gè)的緣故
你打印sql看看能不能運(yùn)行
知道了:
@NonNull @Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = null;
// inflate 的第2個(gè)參數(shù)要傳入 parent
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_1, parent, false);
return new MyViewHolder2(view);
}先理清表之間的關(guān)系,及各字段的含義,然后再進(jìn)行操作
建議將表結(jié)構(gòu)及個(gè)字段含義,目標(biāo)結(jié)果貼下
在編譯的時(shí)候,變量就已經(jīng)和內(nèi)函數(shù)綁定了 另外25在程序中十分常用,引用數(shù)的變化可能不同于預(yù)想 (變量在編譯階段時(shí)計(jì)算"引用數(shù)"而不是執(zhí)行時(shí)計(jì)數(shù))
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。