Kafka实战笔记
关于这份笔记,为了不影响大家的阅读体验,我只能在文章中展示部分的章节内容和核心截图
- Kafka入门
- 为什么选择Kafka
- Karka的安装、管理和配置
- Kafka的集群
- 第一个Kafka程序
afka的生产者
- Kafka的消费者
- 深入理解Kafka
- 可靠的数据传递
- Spring和Kalka的整合
- Sprinboot和Kafka的整合
- Kafka实战之削峰填谷
- 数据管道和流式处理(了解即可)
- Kafka实战之削峰填谷
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter the amount of water in kilograms:”);
double m = input.nextDouble();
System.out.print(“Enter the initial temperature:”);
double it = input.nextDouble();
System.out.print(“Enter the final temperature:”);
double ft = input.nextDouble();
double q = m*(ft-it)*4184;
System.out.println(“The energy needed is “+q+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter the number of years:”);
int year = input.nextInt();
double base = 312032486;
int secnum = 365243600;
for(int i=1;i<=year;i++)
base=base+secnum/7.0-secnum/13.0+secnum/45.0;
System.out.println(“The population in “+year+” years is “+base+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter speed and acceleration:”);
double v = input.nextDouble();
double a = input.nextDouble();
double l = vv/(2a);
System.out.println(“The minimum runway length for this airplane is “+l+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter the monthly saving amount:”);
double m = input.nextDouble();
double sum = 0.0;
for(int i=0;i<6;i++)
sum = (m+sum)*(1+0.00417);
System.out.println(“After the sixth month, the account value is $”+sum+“.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter weight in pounds:”);
double pounds = input.nextDouble();
System.out.print(“Enter height in inches:”);
double inches = input.nextDouble();
double bmi = pounds0.4535927/(inchesinches0.02540.0254);
System.out.println(“BMI is “+bmi+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter x1 and y1:”);
double x1 = input.nextDouble();
double y1 = input.nextDouble();
System.out.print(“Enter x2 and y2:”);
double x2 = input.nextDouble();
double y2 = input.nextDouble();
double d = Math.pow((x2-x1)(x2-x1)+(y2-y1)(y2-y1),0.5);
System.out.println(“The distance between the two points is “+d+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter the length of the side:”);
double s = input.nextDouble();
double a = 3Math.pow(3,0.5)/2s*s;
System.out.println(“The area of the hexagon is “+a+”.”);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter the temperature in Fahrenheit:”);
double ta = input.nextDouble();
System.out.print(“Enter the wind speed (>=2) in miles per hour:”);
double v = input.nextDouble();
double twc = 35.74+0.6215ta-35.75Math.pow(v,0.16)+0.4275taMath.pow(v,0.16);
System.out.println("The wind chill is "+twc);
}
}
=================================================================
public class dierzhang {
public static void main(String[] args){
System.out.println(“a b pow(a,b)”);
for(int i = 1;i <= 5;i++)
System.out.println(i+" “+(i+1)+” "+(int)Math.pow(i,i+1));
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println(“Enter the coordinates of three points separated by spaces”);
System.out.print(“like x1 y1 x2 y2 x3 y3:”);
double x1 = input.nextDouble();
double y1 = input.nextDouble();
double x2 = input.nextDouble();
double y2 = input.nextDouble();
double x3 = input.nextDouble();
double y3 = input.nextDouble();
double s1 = Math.pow((x1-x2)(x1-x2)+(y1-y2)(y1-y2),0.5);
double s2 = Math.pow((x2-x3)(x2-x3)+(y2-y3)(y2-y3),0.5);
double s3 = Math.pow((x1-x3)(x1-x3)+(y1-y3)(y1-y3),0.5);
double s = (s1+s2+s3)/2;
double a = Math.pow(s*(s-s1)(s-s2)(s-s3),0.5);
System.out.println("The area of the triangle is "+a);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter balance and interest rate:”);
double balance = input.nextDouble();
double rate = input.nextDouble();
double interest = balance*(rate/1200);
System.out.println("The interest is "+interest);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter investment amount:”);
double amount = input.nextDouble();
System.out.print(“Enter annual interest rate in percentage:”);
double ar = input.nextDouble();
System.out.print(“Enter number of years:”);
int y = input.nextInt();
double fv = amountMath.pow(1+ar/1200,y12);
System.out.println(“Future value is $”+fv);
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print(“Enter an amount in int, for example 114514:”);
int amount = input.nextInt();
int old = amount;
int numberOfOneDollars = amount/100;
amount%=100;
int numberOfQuarters = amount/25;
amount%=25;
int numberOfDimes = amount/10;
amount%=10;
int numberOfNickles = amount/5;
amount%=5;
int numberOfPennies = amount;
System.out.println(“Your amount “+old+” consists of”);
System.out.println(" “+numberOfOneDollars+” dollars");
System.out.println(" “+numberOfQuarters+” quarters");
System.out.println(" “+numberOfDimes+” dimes");
System.out.println(" “+numberOfNickles+” nickels");
System.out.println(" “+numberOfPennies+” pennies");
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
最近我根据上述的技术体系图搜集了几十套腾讯、头条、阿里、美团等公司21年的面试题,把技术点整理成了视频(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,这里以图片的形式给大家展示一部分
ls");
System.out.println(" “+numberOfPennies+” pennies");
}
}
=================================================================
import java.util.Scanner;
public class dierzhang {
[外链图片转存中…(img-2NWNkZFn-1715148714626)]
最近我根据上述的技术体系图搜集了几十套腾讯、头条、阿里、美团等公司21年的面试题,把技术点整理成了视频(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,这里以图片的形式给大家展示一部分
[外链图片转存中…(img-Sjk9rQU8-1715148714626)]