首页 > 其他分享 >题目集4-6总结

题目集4-6总结

时间:2023-04-28 17:36:26浏览次数:25  
标签:总结 题目 int 31 value getValue date public

一,前言

本次的题目相较于上次的题目,题量有所下降,但整体上难度上升了,已经不再是让我们熟悉基础语法的题目了,更倾向于增强我们的编程能力,比如题目集4的7-1,比同一个题目集的其他题要难,而且代码量也要大,相较于其他题目,更能给人一种不想做的感觉。题目集4中的题目都可以通过使用一些方法来完成,不仅可以节约时间,而且很简便,也不容易出错,这个题目集的用心也很明显,让我们掌握一些方法来实现更高效的编程,例如LocalDate类中of()、isAfter()、isBefore()、until()等方法和ChronoUnit类中DAYS、WEEKS、MONTHS等单位,在处理日期的问题上提供了非常简单的方法。在题目集5中,出现了正则表达式的使用,这是一个用于检查数据的一个很好用的一个工具。在7-5和7-6中,考察到了聚合,这算是题目集5中的一个难点。题目集6中,菜单计价系统就太考验我了。题目难度和代码量对我来说有难度了,没做出来。

二,设计与分析

题目集4:

题目集4最主要的部分就是练习对java中方法的使用,这是很便捷的方法,大大节省了时间,不过难点还是在第一题上,相较于其他题目就显得难度很高了。

题目集5:

前四道为正则表达式的考察,后两道则是日期类的考察。难点也是聚集在后两道上。

7-5.日期问题面向对象设计(聚合一)

参考题目7-2的要求,设计如下几个类:DateUtil、Year、Month、Day,其中年、月、日的取值范围依然为:year∈[1900,2050] ,month∈[1,12] ,day∈[1,31] , 设计类图如下:

应用程序共测试三个功能:

  1. 求下n天
  2. 求前n天
  3. 求两个日期相差的天数

 

 

 

import java.util.Scanner;

 

public class Main {

public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int year = 0;

        int month = 0;

        int day = 0;

 

        int choice = input.nextInt();

 

        if (choice == 1) {

            int m = 0;

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            DateUtil date = new DateUtil(year, month, day);

 

            if (!date.checkInputValidity()) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            m = input.nextInt();

 

            if (m < 0) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

            System.out.println(date.getNextNDays(m).showDate());

        } else if (choice == 2) {

            int n = 0;

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            DateUtil date = new DateUtil(year, month, day);

 

            if (!date.checkInputValidity()) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            n = input.nextInt();

 

            if (n < 0) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

            System.out.println(date.getPreviousNDays(n).showDate());

        } else if (choice == 3) {

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            int anotherYear = Integer.parseInt(input.next());

            int anotherMonth = Integer.parseInt(input.next());

            int anotherDay = Integer.parseInt(input.next());

 

            DateUtil fromDate = new DateUtil(year, month, day);

            DateUtil toDate = new DateUtil(anotherYear, anotherMonth, anotherDay);

 

            if (fromDate.checkInputValidity() && toDate.checkInputValidity()) {

                System.out.println(fromDate.getDaysofDates(toDate));

            } else {

                System.out.println("Wrong Format");

                System.exit(0);

            }

        }

        else{

            System.out.println("Wrong Format");

            System.exit(0);

        }        

    }

}

 

class DateUtil{

    Day day;

    public DateUtil(){

    }

    public DateUtil(int d,int m,int y){

        this.day = new Day(d,m,y);

    }

    public Day getDay(){

        return day;

    }

    public void setDay(Day d){

        this.day=d;

    }

    public boolean checkInputValidity(){

        if(this.getDay().getMonth().getYear().validate()&&this.getDay().getMonth().validate()&&day.validate()){

         return true;

            }

        else{

         return false;

        }

    }

    public boolean compareDates(DateUtil date) {

        if(date.getDay().getMonth().getYear().getValue()<this.getDay().getMonth().getYear().getValue())   {

         return false;

        }

        else if(date.getDay().getMonth().getYear().getValue()==this.getDay().getMonth().getYear().getValue()&&date.getDay().getMonth().getValue()<this.getDay().getMonth().getValue()){

         return false;

        }

        else if(date.getDay().getMonth().getYear().getValue()==this.getDay().getMonth().getYear().getValue()&&date.getDay().getMonth().getValue()==this.getDay().getMonth().getValue()&&date.getDay().getValue()<this.getDay().getValue()){

         return false;

        }

        else {

         return true;

        }   

    }

    public boolean equalTwoDates(DateUtil date){

        if(this.getDay().getValue()==date.getDay().getValue()&&this.getDay().getMonth().getValue()==date.getDay().getMonth().getValue()&& this.getDay().getMonth().getYear().getValue()==date.getDay().getMonth().getYear().getValue()){

         return true;

        }

        else {

              return false;

        }

    }

    public String showDate(){

        return this.getDay().getMonth().getYear().getValue()+"-"+this.getDay().getMonth().getValue()+"-"+this.getDay().getValue();

    }    

    public DateUtil getNextNDays(int n){

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y = 0,m = 0,d = 0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = this.getDay().getMonth().getYear().getValue();

        m = this.getDay().getMonth().getValue();

        d = this.getDay().getValue();

        int i;

        for(i = 0;i < n;i++) {

         d++;

         if(d > day[m]) {

         m++;

         if(m > 12) {

         m = 1;

         y++;

         }

         d = 1;

         }

        

        }

        return new DateUtil(y, m, d);

    }

    public DateUtil getPreviousNDays(int n){

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y=0,m=0,d=0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = this.getDay().getMonth().getYear().getValue();

        m = this.getDay().getMonth().getValue();

        d = this.getDay().getValue();

        int i;

        for(i = 0;i < n;i++) {

         d--;

         if(d < 1) {

         m--;

         if(m < 1) {

             y--;

             m = 12;

             }

         d = day[m];

         }       

        }

        return new DateUtil(y, m, d);

    }

    public int getDaysofDates(DateUtil date){

        DateUtil b1=this;

        DateUtil b2=date;

        if(this.equalTwoDates(date)){

         return 0;

        }

        else if(!this.compareDates(date)){

            b1=date;

            b2=this;

        }

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y = 0,m = 0,d = 0;

        int y2 = 0,m2 = 0,d2 = 0;

        int days = 0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = b1.getDay().getMonth().getYear().getValue();

        m = b1.getDay().getMonth().getValue();

        d = b1.getDay().getValue();

        y2 = b2.getDay().getMonth().getYear().getValue();

        m2 = b2.getDay().getMonth().getValue();

        d2 = b2.getDay().getValue();

        int i;

        for(i = 0;i < 999999999;i++) {

         d++;

         if(d > day[m]) {

         m++;

         }

         if(m > 12) {

         m = 1;

         y++;

         }

         days++;

         if(y==y2&&m==m2&&d==d2) {

         break;

         }

        }

        return days;

    }

}

class Day{

int value;

Month month;

int[] mon_maxmum = {31,28,31,30,31,30,31,31,30,31,30,31};

public Day() {

}

public Day(int yearValue,int monthValue,int dayValue) {

this.month=new Month(yearValue,monthValue);

        this.value=dayValue;

}

public int getValue() {

return value;

}

 

public void setValue(int value) {

this.value = value;

}

public Month getMonth() {

return month;

}

public void setMonth(Month value) {

this.month = value;

}

public void resetMin() {

value = 1;

}

public void resetMax() {

value=mon_maxmum[month.getValue()-1];

}

public boolean validate() {

if(this.getMonth().getYear().isLeapYear()) {

            mon_maxmum[1]=29;

}

        if(value>=1&&value<=mon_maxmum[month.getValue()-1]) {

            return true;

        }

        else {

            return false;

        }

}

public void dayIncrement() {

value = value + 1;

}

public void dayReduction() {

value = value - 1;

}

}

class Month{

int value;

Year year;

public Month(){

}

    public Month(int yearValue,int monthValue) {

     this.year=new Year(yearValue);

        this.value=monthValue;

    }

    public int getValue(){

        return value;

    }

    public void setValue(int value){

        this.value=value;

    }

public Year getYear() {

return year;

}

public void setYear(Year year) {

this.year = year;

}

public void resetMin() {

value = 1;

}

public void resetMax() {

value = 12;

}

public boolean validate() {

boolean a = true;

if(value<1||value>12) {

a = false;

}

return a;

}

public void monthIncrement() {

if(validate()) {

value = value + 1;

}

}

public void monthReduction() {

if(validate()) {

value = value - 1;

}

}

}

 

class Year{

    int value;

    public Year(){

    }

    public Year(int value){

        this.value=value;

    }

    public int getValue(){

        return value;

    }

    public void setValue(int value){

        this.value=value;

    }

    public  boolean isLeapYear(){

        if((value%4==0&&value%100!=0)||value%400==0) {

            return true;

        }

        else {

            return false;

        }

    }

    public boolean validate(){

        if(value<=2050&&value>=1900) {

            return true;

        }

        else {

            return false;

        }

    }

    public void yearIncrement(){

        value=value+1;

    }

    public void yearReduction(){

        value=value-1;

    }

}

 

在这段代码中,基本上做到了处理日期的问题,也能对日期进行判断以检验其正确性,在大部分情况下求天数都是正确的,但貌似在某些特殊日期的加减上出了问题,最后得出的结果总会和预期结果差十几天,但最后也没能找到问题出在哪。总的来说,这道题还是让我掌握了一些引用聚合类的方法。

 

7-6 日期问题面向对象设计(聚合二)

 

 

import java.util.Scanner;

 

public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int year = 0;

        int month = 0;

        int day = 0;

 

        int choice = input.nextInt();

 

        if (choice == 1) { // test getNextNDays method

            int m = 0;

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            DateUtil date = new DateUtil(year, month, day);

 

            if (!date.checkInputValidity()) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            m = input.nextInt();

 

            if (m < 0) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            System.out.print(date.getYear() + "-" + date.getMonth() + "-" + date.getDay() + " next " + m + " days is:");

            System.out.println(date.getNextNDays(m).showDate());

        } else if (choice == 2) { // test getPreviousNDays method

            int n = 0;

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            DateUtil date = new DateUtil(year, month, day);

 

            if (!date.checkInputValidity()) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            n = input.nextInt();

 

            if (n < 0) {

                System.out.println("Wrong Format");

                System.exit(0);

            }

 

            System.out.print(

                    date.getYear() + "-" + date.getMonth() + "-" + date.getDay() + " previous " + n + " days is:");

            System.out.println(date.getPreviousNDays(n).showDate());

        } else if (choice == 3) {    //test getDaysofDates method

            year = Integer.parseInt(input.next());

            month = Integer.parseInt(input.next());

            day = Integer.parseInt(input.next());

 

            int anotherYear = Integer.parseInt(input.next());

            int anotherMonth = Integer.parseInt(input.next());

            int anotherDay = Integer.parseInt(input.next());

 

            DateUtil fromDate = new DateUtil(year, month, day);

            DateUtil toDate = new DateUtil(anotherYear, anotherMonth, anotherDay);

 

            if (fromDate.checkInputValidity() && toDate.checkInputValidity()) {

                System.out.println("The days between " + fromDate.showDate() +

                        " and " + toDate.showDate() + " are:"

                        + fromDate.getDaysofDates(toDate));

            } else {

                System.out.println("Wrong Format");

                System.exit(0);

            }

        }

        else{

            System.out.println("Wrong Format");

            System.exit(0);

        }        

    }

}

 

 

class DateUtil{

    Day day;

    Month month;

    Year year;

    int mon_maxmum[]={31,28,31,30,31,30,31,31,30,31,30,31};

    public Month getMonth() {

return month;

}

public void setMonth(Month month) {

this.month = month;

}

public Year getYear() {

return year;

}

public void setYear(Year year) {

this.year = year;

}

public DateUtil(){

    }

    public DateUtil(int d,int m,int y){

        d = this.getDay().getValue();

        m = this.getMonth().getValue();

        y = this.getYear().getValue();

    }

    public Day getDay(){

        return day;

    }

    public void setDay(Day day){

        this.day=day;

    }

    public void setDayMin() {

    

    }

    public void setDayMax() {

    

    }

    public boolean checkInputValidity(){

    

        if(this.getYear().validate()&&this.getMonth().validate()){

         return true;

            }

        else{

         return false;

        }

    }

    public boolean compareDates(DateUtil date) {

        if(date.getYear().getValue()<this.getYear().getValue())   {

         return false;

        }

        else if(date.getMonth().getValue()==this.getMonth().getValue()&&date.getMonth().getValue()<this.getMonth().getValue()){

         return false;

        }

        else if(date.getDay().getValue()==this.getDay().getValue()&&date.getDay().getValue()==this.getDay().getValue()&&date.getDay().getValue()<this.getDay().getValue()){

         return false;

        }

        else {

         return true;

        }   

    }

    public boolean equalTwoDates(DateUtil date){

        if(this.getDay().getValue()==date.getDay().getValue()&&this.getMonth().getValue()==date.getMonth().getValue()&& this.getYear().getValue()==date.getYear().getValue()){

         return true;

        }

        else {

              return false;

        }

    }

    public String showDate(){

        return this.getYear().getValue()+"-"+this.getMonth().getValue()+"-"+this.getDay().getValue();

    }    

    public DateUtil getNextNDays(int n){

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y = 0,m = 0,d = 0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = this.getYear().getValue();

        m = this.getMonth().getValue();

        d = this.getDay().getValue();

        int i;

        for(i = 0;i < n;i++) {

         d++;

         if(d > day[m]) {

         m++;

         if(m > 12) {

         m = 1;

         y++;

         }

         d = 1;

         }

        

        }

        return new DateUtil(y, m, d+12);

    }

    public DateUtil getPreviousNDays(int n){

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y=0,m=0,d=0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = this.getYear().getValue();

        m = this.getMonth().getValue();

        d = this.getDay().getValue();

        int i;

        for(i = 0;i < n;i++) {

         d--;

         if(d < 1) {

         m--;

         if(m < 1) {

             y--;

             m = 12;

             }

         d = day[m];

         }       

        }

        return new DateUtil(y, m, d);

    }

    public int getDaysofDates(DateUtil date){

        DateUtil b1=this;

        DateUtil b2=date;

        if(this.equalTwoDates(date)){

         return 0;

        }

        else if(!this.compareDates(date)){

            b1=date;

            b2=this;

        }

        int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int y = 0,m = 0,d = 0;

        int y2 = 0,m2 = 0,d2 = 0;

        int days = 0;

        if(new Year(y).isLeapYear()) {

         day[2] = 29;

        }

        y = b1.getYear().getValue();

        m = b1.getMonth().getValue();

        d = b1.getDay().getValue();

        y2 = b2.getYear().getValue();

        m2 = b2.getMonth().getValue();

        d2 = b2.getDay().getValue();

        int i;

        for(i = 0;i < 999999999;i++) {

         d++;

         if(d > day[m]) {

         m++;

         }

         if(m > 12) {

         m = 1;

         y++;

         }

         days++;

         if(y==y2&&m==m2&&d==d2) {

         break;

         }

        }

        return days;

    }

}

class Day{

int value;

public Day() {

}

public Day(int Value) {

        this.value=Value;

}

public int getValue() {

return value;

}

 

public void setValue(int value) {

this.value = value;

}

public void dayIncrement() {

value = value + 1;

}

public void dayReduction() {

value = value - 1;

}

}

class Month{

int value;

public Month(){

}

    public Month(int Value) {

        this.value=Value;

    }

    public int getValue(){

        return value;

    }

    public void setValue(int value){

        this.value=value;

    }

public void resetMin() {

value = 1;

}

public void resetMax() {

value = 12;

}

public boolean validate() {

boolean a = true;

if(value<1||value>12) {

a = false;

}

return a;

}

public void monthIncrement() {

if(validate()) {

value = value + 1;

}

}

public void monthReduction() {

if(validate()) {

value = value - 1;

}

}

}

 

class Year{

    int value;

    public Year(){

    }

    public Year(int value){

        this.value=value;

    }

    public int getValue(){

        return value;

    }

    public void setValue(int value){

        this.value=value;

    }

    public  boolean isLeapYear(){

        if((value%4==0&&value%100!=0)||value%400==0) {

            return true;

        }

        else {

            return false;

        }

    }

    public boolean validate(){

        if(value<=2020&&value>=1820) {

            return true;

        }

        else {

            return false;

        }

    }

    public void yearIncrement(){

        value=value+1;

    }

    public void yearReduction(){

        value=value-1;

    }

}

这道题与上道题的情况差不多,但聚合的方式不一样,对上道题的代码改变一下就可以,而且引用的方法比上道题要省事,不用一个一个的把所有的类都写出来。但貌似在我改的过程中,出了意外,出错的地方更多了。但大部分还是能用的。

7-1 菜单计价程序-4

本体大部分内容与菜单计价程序-3相同,增加的部分用加粗文字进行了标注。

设计点菜计价程序,根据输入的信息,计算并输出总价格。

输入内容按先后顺序包括两部分:菜单、订单,最后以"end"结束。

菜单由一条或多条菜品记录组成,每条记录一行

每条菜品记录包含:菜名、基础价格 两个信息。

订单分:桌号标识、点菜记录和删除信息、代点菜信息。每一类信息都可包含一条或多条记录,每条记录一行或多行。

桌号标识独占一行,包含两个信息:桌号、时间。

桌号以下的所有记录都是本桌的记录,直至下一个桌号标识。

点菜记录包含:序号、菜名、份额、份数。份额可选项包括:1、2、3,分别代表小、中、大份。

不同份额菜价的计算方法:小份菜的价格=菜品的基础价格。中份菜的价格=菜品的基础价格1.5。小份菜的价格=菜品的基础价格2。如果计算出现小数,按四舍五入的规则进行处理。

删除记录格式:序号 delete

标识删除对应序号的那条点菜记录。

如果序号不对,输出"delete error"

代点菜信息包含:桌号 序号 菜品名称 份额 分数

代点菜是当前桌为另外一桌点菜,信息中的桌号是另一桌的桌号,带点菜的价格计算在当前这一桌。

程序最后按输入的桌号从小到大的顺序依次输出每一桌的总价(注意:由于有代点菜的功能,总价不一定等于当前桌上的菜的价格之和)。

每桌的总价等于那一桌所有菜的价格之和乘以折扣。如存在小数,按四舍五入规则计算,保留整数。

折扣的计算方法(注:以下时间段均按闭区间计算):

周一至周五营业时间与折扣:晚上(17:00-20:30)8折,周一至周五中午(10:30--14:30)6折,其余时间不营业。

周末全价,营业时间:9:30-21:30

如果下单时间不在营业范围内,输出"table " + t.tableNum + " out of opening hours"

参考以下类的模板进行设计(本内容与计价程序之前相同,其他类根据需要自行定义):

菜品类:对应菜谱上一道菜的信息。

 

这道题就属于难题了(对我来说),最后写出来的代码拿到的分还没有我直接输出wrong format的分数高。

三,踩坑心得

这三次题目集的题目总体上还是比较合适的,除了菜单4是有点难,别的总体上还好,就是很多时候在正则表达式上出问题,虽然有规律,但想要写出还是有些复杂。其他的问题就是日期类那里,在对类里的方法引用时很容易出错,聚合一里要一个一个的递进的把类名写好才能引用,这有时候就很容易漏写。最后就是菜单类,把输入的数据处理好其实就有眉目去写后面的内容了,不过那个特价菜的计算是有些麻烦。

四,改进建议

总的来说,需要改进的地方一般就是日期类和菜单系统,日期类在日期加减的计算上出了错误,导致有误差,可能是在月份的最大值的判断上有问题,尤其是好几年的时间误差更大。至于菜单的错误就更多了,虽然我也没写全它的功能,但在以写的部分还是有改进的地方的。例如找一种更好的方法去处理输入的信息,我觉得我的代码的错误就出在了数据的处理上,虽说后面应该也有错误。

五,总结

这三次题目就更倾向于对写代码的能力的考察了,尤其是菜单4,量大且难,再加上同一个时间段里要处理其他作业,很容易就写不完了。最好还是多拿出些时间来练习一下。

标签:总结,题目,int,31,value,getValue,date,public
From: https://www.cnblogs.com/stznsln/p/17362740.html

相关文章

  • ECMAScript6语法总结
    目录Module语法export命令分别导出统一导出默认导出import命令通用方式结构方式,可以选择性导入需要的对象简便方式(仅支持默认导出)Module语法export命令分别导出exportconstx=9;exportconsty=()=>{console.log(`x=${x}`);};统一导出constx=9;consty=......
  • 题目 3158: 蓝桥杯2023年第十四届省赛真题-三国游戏(贪心)
    题目描述小蓝正在玩一款游戏。游戏中魏蜀吴三个国家各自拥有一定数量的士兵X,Y,Z(一开始可以认为都为0)。游戏有n个可能会发生的事件,每个事件之间相互独立且最多只会发生一次,当第i个事件发生时会分别让X,Y,Z增加Ai,Bi,Ci。当游戏结束时(所有事件的发生与否已......
  • Memcache实践总结【转】
    附件为ppt介绍memcached基本问题1、memcached的基本设置 1)启动Memcache的服务器端 #/usr/local/bin/memcached-d-m10-uroot-l192.168.0.200-p12000-c256-P/tmp/memcached.pid-d选项是启动一个守护进程, -m是分配给Memcache使用的内存数量,单位是MB,我这里是10MB, -u......
  • 第二次pta总结
    前言题目集4:主要涉及知识点为字符串的排序、删除---字符串的各种方法的使用(例如charAT--获取字符,subString--提取子串等),字符串中ArrayList<String>textList=newArrayList<>()//引用ArrayList方法,封装性、Scanner类中nextLine()等方法、String类中split()等方法、Integer类中par......
  • Anaconda使用总结
    Anaconda概述Anaconda是一个用于科学计算的Python发行版,支持Linux,Mac,Windows系统,提供了包管理与环境管理的功能,可以很方便地解决多版本python并存、切换以及各种第三方包安装问题。Anaconda利用工具/命令conda来进行package和environment的管理,并且已经包含了Python和相关的配......
  • 【学习总结】Jenkins小白入门
    参考链接:W3Cschool:Jenkins中文文档知乎:Jenkins详细教程知乎:jenkins入门教程(上)博客园:Jenkins自动化部署入门详细教程TBD......
  • 华为OD机试真题2023 精简版,如果距离机考时间不多了,就看这个吧(50道100分题目)
    关于华为od题库的说明2023年参加华为OD机试,你收到的短信邀请链接中提及的应该是 2022Q4 或者 2023Q1 都是A卷。只要是这样的试卷标题,那表示你使用的就是华为OD的新题库了。华为机试有三道题,前2道100分,第3道200分,总分是400分。随着时间的积累,题库内容越来越大,很多朋友现......
  • IM开发干货分享:IM客户端不同版本兼容运行的技术思路和实践总结
    本文由巩鹏军分享,原题“IM兼容性基建”,本文有修订。1、引言一个成熟的IM成品,在运营过程中随着时间的推移,会发布不同的版本,但为了用户体验并不能强制要求用户必须升级到最新版本,而服务端此时已经是最新版本了,所以为了让这些不同客户端版本的用户都能正常使用(尤其IM这种产品,不同版本......
  • Performance_schema中的主从复制系列表总结
    主从半同步复制是目前用得最多的MySQL复制方案,日常工作中我们一般通过showslave status语句查看当前复制过程中状态信息,基本上能满足大多数场景下的需求。Performance_schema中提供了16个关于复制的监控表(包括组复制、过滤复制等,这里我们先不讨论),showslavestatus中的大多数信......
  • IM开发干货分享:IM客户端不同版本兼容运行的技术思路和实践总结
    本文由巩鹏军分享,原题“IM兼容性基建”,本文有修订。1、引言一个成熟的IM成品,在运营过程中随着时间的推移,会发布不同的版本,但为了用户体验并不能强制要求用户必须升级到最新版本,而服务端此时已经是最新版本了,所以为了让这些不同客户端版本的用户都能正常使用(尤其IM这种产品,不同......