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

鍍金池/ 問答/ Java問答
敢試 回答

問題已解決。docker不識別linux物理路徑。直接把路徑寫個文件名。然后去判斷這個路徑是否存在,如果不存在則系統(tǒng)自己創(chuàng)建一個。這樣docker就能識別了。

默念 回答

我這里是可以查出來的,你可以檢查下你的query,或者查看elasticsearch中是否存在你保存的數(shù)據(jù)

clipboard.png

clipboard.png

兔寶寶 回答

數(shù)據(jù)庫查詢時間粗略地可以分為:

  1. 建立網(wǎng)絡(luò)連接
  2. sql語句傳輸
  3. sql語句解析
  4. sql語句執(zhí)行
  5. 數(shù)據(jù)傳輸
  6. 客戶端數(shù)據(jù)處理等

這里(1)可能因使用連接池,使得時間不盡相同,取決于連接池的實現(xiàn)和參數(shù)設(shè)置, 可能某一次與其他次建立連接時間不一樣; (2)基本為定值, 但也有可能在客戶端進行PreparedStatement緩存而不一致; (3)同(2), 數(shù)據(jù)庫會對解析進行緩存, 第一次可能和第二次不一樣; (4)數(shù)據(jù)庫一會對執(zhí)行過的sql進行短時間緩存; (5)取決于數(shù)據(jù)量和網(wǎng)速, 對于同樣的數(shù)據(jù)量變化不大; (6)取決于客戶端代碼, 但一般會小于ms級.

這里還沒有考慮數(shù)據(jù)庫服務(wù)器端的配置和是否有主從及負載均衡的配置等等.

所以你測試的數(shù)據(jù)是變化的很正常不過了, 需要采集大量數(shù)據(jù),最好是與業(yè)務(wù)相似的使用場景才有價值.

影魅 回答

DEBUG日志,忽略。

別硬撐 回答

clipboard.png

localhost和你服務(wù)器肯定不是一個域名啊
而且wamp是http協(xié)議,你的服務(wù)器是ftp協(xié)議怎么可以隨便通信呢?

朽鹿 回答

報錯 Address already in use是不是你的進程不是正常退出導(dǎo)致的?
lsof -i:端口 看看是哪個進程占用的

艷骨 回答
提問前還是多翻翻文檔或者源代碼吧

xml方法:

appcompat:itemBackground="@drawable/menu_background_color" //background

代碼方法:

public class NavigationView extends ScrimInsetsFrameLayout {
    public void setItemBackgroundResource(@DrawableRes int resId) {}
    public void setItemBackground(@Nullable Drawable itemBackground) {}
}

How to customize item background and item text color inside NavigationView?

有點壞 回答

圖片描述


    class User {
        private String country;
        private String province;
        private String name;

        public User(String country, String province, String name) {
            this.country = country;
            this.province = province;
            this.name = name;
        }

        public String getCountry() {
            return country;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
    class Res {
        private String country;
        private String province;
        private Integer count;

        public Res(String country, String province, Integer count) {
            this.country = country;
            this.province = province;
            this.count = count;
        }

        public String getCountry() {
            return country;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public Integer getCount() {
            return count;
        }

        public void setCount(Integer count) {
            this.count = count;
        }
    }

    @Test
    public void test1() throws Exception {
        List<Res> result = new ArrayList<>();

        List<User> list = new ArrayList<>();
        list.add(new User("中國", "北京", "張三"));
        list.add(new User("中國", "北京", "張三"));
        list.add(new User("中國", "北京", "李四"));
        list.add(new User("中國", "北京", "李四"));
        list.add(new User("中國", "北京", "李四"));
        list.add(new User("中國", "北京", "王五"));
        list.add(new User("中國", "湖南", "張三"));
        list.add(new User("中國", "湖南", "張三"));
        list.add(new User("中國", "湖南", "張三"));

        list.stream()
                .collect(Collectors.groupingBy(e -> e.getProvince()))
                .forEach((k, v) -> {
                    StringBuilder count = new StringBuilder("0");
                    v.stream().
                            collect(Collectors.groupingBy(e -> e.getName()))
                            .forEach((k2, v2) -> {
                                if (v2.size() > 1) {
                                    int c = Integer.parseInt(count.toString());
                                    count.delete(0, count.length());
                                    count.append(c + v2.size());
                                }
                            });
                    result.add(new Res(v.get(0).getCountry(), v.get(0).getProvince(), Integer.parseInt(count.toString())));
                    count.delete(0, count.length());
                });
        System.out.println(new ObjectMapper().writeValueAsString(result));
    }

StringBuilder只是起了一個計數(shù)的作用, 雖然有點low~

別硬撐 回答

因為你先創(chuàng)建的對象, 舊的原型鏈已經(jīng)建立好了.

        function Person(){}
        // var friend=new Person(); 注釋掉
        console.log(Person.prototype);            
        Person.prototype={                        
            constructor:Person,
            name:'ytf',
            age:'20',
            job:'student',
            sayName:function(){
                console.log(this.name);
            }
        }
        var friend=new Person(); // 在這里創(chuàng)建
        console.log(Person.prototype);
        console.log(friend.sayName());
故人嘆 回答

緩存的key值錯誤,重寫key的命名生成,并且在mapper(dao) 里面@Cacheable 不要設(shè)置自己的key,可以解決以上錯誤。

陌如玉 回答

不貼代碼只能純憑想象了

要不你試試hget("gvs:blackeggs:bw", "2")

詆毀你 回答

這樣的 json 結(jié)果,需要你用 Python 的數(shù)據(jù)庫類里設(shè)置好相應(yīng)的輸出 json 函數(shù)。


不敢再發(fā)我的項目鏈接,老是被那些不認真,不仔細,或者說一知半解的人舉報。

如果你想學(xué)習(xí) sql to sqlalchemy,你可以查看我的資料,然后找到相關(guān) github 項目的鏈接。

何蘇葉 回答

沒準(zhǔn)是重復(fù)利用線程了,先新增到最大線程20個,然后來一個請求復(fù)用就行了

爆扎 回答

@media不會改變css的優(yōu)先級,你需要確保這部分的css是優(yōu)先級最高的,或者加!important

懷中人 回答

你小程序中是使用的官方api發(fā)起的接口請求嘛。如果是的話請看下面。

wx.request({
            url: 'xxxxx',
            success: res => {
                if (res.statusCode == 200) {
                    res = res.data; // 這res就是對象而不是json字符串了
                }
            }
        })

如果不是的話可以使用JSON.parse(res)處理返回的json數(shù)據(jù)即可。

哚蕾咪 回答

先確認一下mysql workbench和應(yīng)用程序中是不是連的一個數(shù)據(jù)庫;
然后在日志中打印一下sql運行的語句,看是否存在漢字亂碼的問題。

舊酒館 回答

我有幾個問題想問你,
1.recyclerview是在popwindows里面嗎?
2.你是列表的內(nèi)容不能顯示,還是popwindow根本彈不出來?

你是不是這里沒有

clipboard.png
沒有設(shè)置背景?

下面是我做的一個demo,這個是效果
clipboard.png
代碼路徑為:
https://github.com/love0829/l...

歡迎star

解夏 回答

題主首先先回答你的問題
直接改為:

students.stream()
        .filter(student -> "土木工程".equals(student.getMajor()))
        .limit(2)
        .forEach(System.out::println);

這里解釋哈,采用Stream對數(shù)據(jù)進行收集完之后,collect是把Stream中的數(shù)據(jù)收集起來,而forEach才是遍歷每一個數(shù)據(jù)進行遍歷處理的,這樣就可以直接打印出來了

clipboard.png

不過有幾點需要指出的是,題主這個貼的代碼問題有點小多,copy過來編譯都不過

  1. 既然對students進行靜態(tài)模塊的賦值,但是students竟然不是static的,所以private List<Student> students改為private static List<Student> students
  2. 竟然static模塊在給students屬性賦值的,那就不應(yīng)該重新再聲明一個屬性List<Student> students了,List<Student> students = new ArrayList<Student>()改為students = new ArrayList<Student>()
  3. 最后有個小點... 類名studentStream 首字母請大寫...非常別扭...studentStream改為StudentStream

以上就是答案哈~