鍍金池/ 問答/ 網(wǎng)絡(luò)安全問答
枕邊人 回答

如果還是一直沒好的話 可以和我一樣 下載一個(gè) 逍遙安卓模擬器,也可以使用。前提要下載好android sdk等工具

故林 回答

以下方案:

  1. tcp server/ws server提供一個(gè)http接口。

    比如我nodejs寫的websocket服務(wù)器,php要發(fā)消息怎么辦,PHP不能直接連接,那只能nodejs給個(gè)接口,php去請求了。
  2. 基于消息隊(duì)列

    tcp server/ws server連接到一個(gè)消息隊(duì)列作為消費(fèi)者,php端將要發(fā)生的消息寫入消息隊(duì)列
咕嚕嚕 回答

我也是這樣做,先把頁面隱藏起來,但是箱問個(gè)問題,如果想在動畫結(jié)束后在聚焦的h話,要怎么實(shí)現(xiàn)呢

背叛者 回答

你這個(gè)18位的timestamp 是怎么生成的,一搬 uinx_timestamp 13位就精確到毫秒級了

爛人 回答

@凌云識木 slice的零值是nil,轉(zhuǎn)化后就是json的null,文檔是ok的.

@xialeistudio 你的data["a"]是有值的, 且不是零值, 這種情況下轉(zhuǎn)成null才是有問題.

撿肥皂 回答

ab沒這個(gè)能力,用高級一點(diǎn)的工具,比如jmeter、neoload之類的吧

撿肥皂 回答

我也遇到同樣的問題,求解。

冷眸 回答

你把 sport 22改為 dport 22

不討囍 回答

你的中文編碼是UTF8的?如果是查看一下你對應(yīng)的要匹配的中文的UTF8編碼,然后在regex正則表達(dá)式中使用對應(yīng)的UTF8編碼匹配。

尛憇藌 回答

可以用 httpClient 這個(gè) java 庫寫測試程序。
可以用 pythonshell 寫自動化測試腳本

笑浮塵 回答

我有遇到過啊,不過當(dāng)時(shí)是因?yàn)榫W(wǎng)絡(luò)的問題,網(wǎng)絡(luò)丟包了,導(dǎo)致少了文件,但是換了網(wǎng)絡(luò)環(huán)境,就好了,再沒出現(xiàn)過,你是否排除過網(wǎng)絡(luò)狀況?

安淺陌 回答

你能提供更詳細(xì)的 HTTP 請求信息嗎?

這種速度差異很可能是緩存導(dǎo)致。

愛礙唉 回答

不用 inplace (直接分成兩個(gè)數(shù)組排序,再合并) 的話就太簡單了,要 inplace 的話其實(shí)也可以不用手寫 iterator,手寫一個(gè) reference 的 wrapper 就行了(然后直接調(diào)用任意 常規(guī) inplace 排序算法即可):

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

template <typename T>
class Ref {
  T & t;

public:

  Ref(T & t) : t(t) {
  }

  Ref(Ref & o) : t(o.t) {
  }

  Ref(Ref && o) : t(o.t) {
  }

  Ref & operator = (Ref & o) {
    t = o.t;
    return *this;
  }

  Ref & operator = (Ref && o) {
    t = move(o.t);
    return *this;
  }

  bool operator < (Ref const & o) const {
    return t < o.t;
  }

  friend void swap(Ref & a, Ref & b) {
    using std::swap;
    swap(a.t, b.t);
  }
};

void solution(vector<string> & ret) {
  vector<Ref<string>> a;
  vector<Ref<string>> b;

  for (auto & c : ret) {
    bool numeric = true;
    for (auto const & d : c) {
      if (!isdigit(d)) numeric = false;
    }
    if (numeric) a.emplace_back(c); else b.emplace_back(c);
  }

  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  vector<string> v;

  string l;
  getline(cin, l);

  stringstream ss;
  ss << l;

  string s;
  while (ss >> s) {
    v.emplace_back(move(s));
  }

  solution(v);

  bool first = true;
  for (auto const & c : v) {
    if (first) first = false; else cout.put(' ');
    cout << c;
  }
  cout << '\n';
}

測試:

輸入

2 Banana 1 Apple 3 Pear

輸出

1 Apple 2 Banana 3 Pear

舊酒館 回答

時(shí)間是LogEvent創(chuàng)建時(shí)間, 多線程時(shí),寫入的順序可能與事件的創(chuàng)建時(shí)間不一致.

下面是我寫的一個(gè)測試程序


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;

public class LogTest {
    final Log log = LogFactory.getLog(this.getClass());

    Object o = new Object() {
        public String toString() {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return "this is slow! " + System.currentTimeMillis();
        }
    };

    @Test
    public void testFIFO() throws InterruptedException {
         
            new Thread() {
                public void run() {
                    log.info(o);
                }
            }.start();
            
            Thread.sleep(100);
            
            new Thread() {
                public void run() {
                    log.info("this is fast! " + System.currentTimeMillis());
                }
            }.start();
            
            Thread.sleep(2000);

    }
    

    @Test
    public void testFILO() throws InterruptedException {
         
            new Thread() {
                public void run() {
                    log.info(o.toString());
                }
            }.start();
            
            Thread.sleep(100);
            
            new Thread() {
                public void run() {
                    log.info("this is fast! " + System.currentTimeMillis());
                }
            }.start();
            
            Thread.sleep(2000);

    }

}

這里用的是commons-logging 來間接使用Log4j. 原理上是一樣的

輸出如下:

FIFO

INFO  2018-03-02 12:43:26,846 LogTest$2:run - this is slow! 1519965807848
INFO  2018-03-02 12:43:26,946 LogTest$3:run - this is fast! 1519965806946

FILO


INFO  2018-03-02 12:43:29,048 LogTest$5:run - this is fast! 1519965809048
INFO  2018-03-02 12:43:29,948 LogTest$4:run - this is slow! 1519965809948

第一個(gè)測試和第二個(gè)不同在于一個(gè)(FILO)是 log.info(o.toString());, 一個(gè)(FIFO)是log.info(o);
我故意把toString方法變慢. 對比兩個(gè)結(jié)果, 可以看到發(fā)生時(shí)間和寫出時(shí)間的差異.

焚音 回答

1.看到你說的是頁面跳轉(zhuǎn)了,在跳轉(zhuǎn)之前發(fā)送事件,這個(gè)時(shí)候apple組件還不在內(nèi)存里,所以接收不到數(shù)據(jù),跳轉(zhuǎn)之后hello組件的生命周期結(jié)束,也不在生命周期里了
2.eventbus只能在都掛載在內(nèi)存里的組件之間傳遞數(shù)據(jù),像你這種需求可以用vuex,或者在路由之間傳遞數(shù)據(jù)

自定義handler或者自定義toolbar,把圖片添加按鈕改成你自己的上傳邏輯,上傳文件只會,把圖片插入到富文本編輯器里