我有一个端点在最近5分钟中被击中100次。端点响应 2xx 90次, 5xx 10次。因此,我们可以将错误率称为 100/10 = 10%。
//To store even and odd element in 2 diifferent array Aand print it//
import java.util.*;
class main11
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the range");
int no=sc.nextInt();
int a[]=new int[no];
int i,j=0,k=0;
System.out.println("Enter the elements");
for(i=0;i<no;i++)
{
a[i]=sc.nextInt();
}
int even[]=new int[no];
int odd[]=new int[no];
System.out.println("Even nos are");
for(i=0;i<no;i++)
{
if(a[i]%2==0)
{
even[i]=a[i];//to store element in even array//
System.out.println(even[i]+" ");
}
}
System.out.println("The odd nos are");
for(i=0;i<no;i++)
{
if(a[i]%2!=0)
{
odd[i]=a[i];//to store element in odd array//
System.out.println(odd[i]+" ");
}
}
}
}
我的第一个查询是如何检查我的错误率是否为10%或更大 最近5分钟内的比重是10%?
现在我有一个全新的应用程序,该应用程序获取下面描述的请求数(每个请求均从0开始)。
city_list = []
def loopJson():
arrs = ['Đường Lê Quang Định', 'Phường 11', 'Bình Thạnh', 'Hồ Chí Minh']
with open('reform_address.json','r') as jfile:
j_data = json.load(jfile)
for x in j_data:
new_cities = {}
city_name = x
city_code = (j_data[x]['cityCode'])
for d_name in j_data[x]['districts']:
district_name = d_name
district_code = (j_data[x]['districts'][d_name]['districtCode'])
for w_name,w_code in j_data[x]['districts'][d_name]['wards'].items():
if w_name in arrs:
ward_name = w_name
ward_code = w_code
for s_name,s_code in j_data[x]['districts'][d_name]['streets'].items():
if s_name in arrs:
street_name = s_name
street_code = s_code
new_cities.update({city_name: city_code, district_name: district_code, ward_name: ward_code, street_name: street_code})
city_list.append(new_cities)
loopJson()
print(city_list)
我的第二个查询是如何根据 端点或方法还是两者?