QA Official

3 netty5 examples to briefly introduce the usage of netty

https://qaofficial.com/post/2019/04/25/68712-3-netty5-examples-to-briefly-introduce-the-usage-of-netty.html 2019-04-25
This is an example of netty's quick start, and it is also my study note. It is relatively simple. After translating into official documents, put all code comments in the middle of each line of code, and introduce some basic usage simply and clearly. Home Page This is an example based on netty5. Please rely on netty5 packages if necessary.Maven reference method 0.Netty Server 1.DISCARD service (discard service refers to a protocol that ignores all received data) The above is a disposal method for discarding services.

Common Usage of lower_bound () and upper_bound ()

https://qaofficial.com/post/2019/04/25/68639-common-usage-of-lower_bound-and-upper_bound.html 2019-04-25
lower_bound () and upper_bound () are both searched in an ordered array by binary search. In a sorted array from small to large, lower_bound( begin,end,num): binary search for the first number greater than or equal to num from the begin position to the end-1 position of the array, find the address that returns the number, or return end if it does not exist.The index of the found number in the

Data Fingerprint

https://qaofficial.com/post/2019/04/25/40041-data-fingerprint.html 2019-04-25
String s = UUID.randomUUID().toString(); //先进行MD5加密 MessageDigest md = MessageDigest.getInstance("MD5"); //对数据进行加密 byte[] bs = md.digest(s.getBytes()); /** * 三字解变四字节 * 00111100 01011010 00111110 * 00001111 00000101 00101000 00111110 */ //采用数据指纹进一步加密,拿到的数据称

Hangdian 1005

https://qaofficial.com/post/2019/04/25/68682-hangdian-1005.html 2019-04-25
The first time I did it, I used a recursive method to solve it. #include "stdio.h" int a(int A,int B,int n) { int m; if(n==1||n==2) { return 1; } else { return (A*a(A,B,n-1)+B*a(A,B,n-2))%7; } } int main() { int A,B,n; scanf("%d%d%d",&A,&B,&n); if((A>=1&&A<=1000)&&(B>=1&&B<=1000)&&(n>=1&&n<=100000000)) { printf("%d\n",a(A,B,n)); } return 0; } However, this method requires very large memory and very slow speed when N is large and cannot be passed. and then find the rule, found that f(n) is a regular occurrence, several numbers form a cycle, so I want to find out this cycle, can quickly get the result.

Latest Netty5 QuickStart and Examples (Video+Source+Notes)

https://qaofficial.com/post/2019/04/25/68734-latest-netty5-quickstart-and-examples-video-source-notes.html 2019-04-25
Netty5 QuickStart and Example Video Tutorial (Video+Source+Notes) Course Catalog: 01, lesson 1 NIO 1, traditional socket analysis 2, NIO Code Analysis 3, some doubts about NIO online 02, Lesson 2 netty Server 1, netty Server helloWorld Beginner-Level ~ 1 2, netty Server Beginner-Level Supplement ~ 1 03, Lesson 3 netty Client 1, Netty Client Getting Started ~ 1 04, Lesson 4 netty Thread Model Source Code Analysis (1)

My Opinion---Kmeans and PCA

https://qaofficial.com/post/2019/04/25/68789-my-opinion-kmeans-and-pca.html 2019-04-25
pca code: # -*- coding: utf-8 -*- import numpy as np def pca(data):#data:m*n data=np.transpose(data)#变成 特征*样本 mean_data=data-np.average(

On Understanding Principal Component Analysis (PCA) Algorithm

https://qaofficial.com/post/2019/04/25/68777-on-understanding-principal-component-analysis-pca-algorithm.html 2019-04-25
The PCA algorithm has been studied for a period of time before, but it has not been compiled into articles. Recently, the project plans to use PCA algorithm again, so strike while the iron is hot to consolidate the knowledge of PCA algorithm.The point of view of this article is to throw bricks to attract jade. It is not an authority, nor can it be fully believed. It is only my own experience.

Stores tensorflow&amp;#x27;s ckpt model as npy

https://qaofficial.com/post/2019/04/25/68703-stores-tensorflowamp#x27s-ckpt-model-as-npy.html 2019-04-25
#coding=gbk import numpy as np import tensorflow as tf from tensorflow.python import pywrap_tensorflow checkpoint_path='model.ckpt-5000'#your ckpt path reader=pywrap_tensorflow.NewCheckpointReader(checkpoint_path) var_to_shape_map=reader.get_variable_to_shape_map() alexnet={} alexnet_layer = ['conv1','conv2','conv3','conv4','conv5','fc6','fc7','fc8'] add_info = ['weights','biases'] alexnet={'conv1':[[],[]],'conv2':[[],[]],'conv3':[[],[]],'conv4':[[],[]],'conv5':[[],[]],'fc6':[[],[]],'fc7':[[],[]],'fc8':[[],[]]} for key in var_to_shape_map: #print ("tensor_name",key) str_name = key # 因为模型使用Adam算法优化的,在生成的ckpt中,有Adam后缀的

UVA 12168-Cat vs. Dog (bipartite matching+Maximum Independent Set)

https://qaofficial.com/post/2019/04/25/68678-uva-12168-cat-vs.-dog-bipartite-matching-maximum-independent-set.html 2019-04-25
UVA 12168 - Cat vs. Dog topic link question meaning: given some cat lovers and some dog lovers, everyone has a favorite cat (dog) and a hated dog (cat), ask now to give a plan so that as many people as possible can be satisfied. train of thought: bipartite matching's largest independent set, the contradiction between cat lovers and dog lovers, do a maximum independent set code: #include <cstdio> #include <cstring> #include <vector> using namespace std; const int N = 505; int t, c, d, n; struct People { int a, b; People() {} People(int a, int b) { this->a = a; this->b = b; } } cat[N], dog[N]; int cn, dn; vector<int> g[N]; char A[105], B[105]; int match[N], vis[N]; bool dfs(int u) { for (int i = 0; i < g[u].

bn layer and scale layer in caffe

https://qaofficial.com/post/2019/04/25/68649-bn-layer-and-scale-layer-in-caffe.html 2019-04-25
From: https://zhidao.baidu.com/question/621624946902864092.html why should bn layer be used with scale layer in caffe 这个问题首先你要理解batchnormal是做什么的。它其实做了两件事。1) 输入归一化 x_norm = (x-u)/std, 其中u和std是个累计