Java programming idea enumeration type
Java programming idea enumeration type
Basic enum characteristics
Call the values() method of enum to traverse the Enum instance. The values method returns the Enum instance array, and the elements in the array are strictly kept in the order when they are declared in enum
public enum Shrubbery {
...
Posted by orionblue on Sun, 12 Jan 2020 07:10:41 -0800
The program written by Golang injects some version information, and the debugging speed is naturally several times faster!
background
Print git submission information compilation information when Go program runs
Golang compiling information injection program
When debug ging, we need to know what version of go program is currently running
Don't waste time trying to confirm the version
External parameters can be injected during go build compilation
Let go progra ...
Posted by dcav on Sun, 12 Jan 2020 06:05:50 -0800
C programming (Fifth Edition) Tan Haoqiang -- Chapter four exercises after class
C programming (Fifth Edition) Tan Haoqiang -- Chapter four exercises after class
4. There are three integers a, B and C, which are input by keyboard and output the largest number.
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(){
int a,b,c;
printf("Please ente ...
Posted by malcome_thompson on Sun, 12 Jan 2020 03:42:10 -0800
Process oriented and object-oriented programming ideas
1. Process oriented: all work is written and used now. The way of thinking is analysis and synthesis. The object-oriented way of thinking is construction.
2. Object oriented: it is a kind of programming idea. Many functions have been written in advance. When using it, you only need to pay attention to the use of the function, r ...
Posted by Karamja on Sat, 11 Jan 2020 07:36:19 -0800
Implement a simple frame by frame animation in Android (with code download)
scene
In Android, frame by frame animation is composed of consecutive pictures.
Effect
Note:
Blog: https://blog.csdn.net/badao_liumang_qizhi
Pay attention to the public address Domineering procedural ape Get programming related ebooks, tutorials and free downloads.
Realization
First, prepare a group of photos with different expressions, ...
Posted by Bah! Name on Sat, 11 Jan 2020 07:08:12 -0800
windows socket programming demo
WINDOWS SOCKET programming example
Important points:
Server side
Client
Code
See? You don't need to know the ip and port of the client in the whole process of socket programming at the code level. The following protocol stack will detect it by itself. But socket is actually to use the client's ip a ...
Posted by GreyFilm on Sat, 11 Jan 2020 07:02:12 -0800
Spring web series RestTemplate 4xx/5xx exception information capture
200104 spring web series tutorialresttemplate 4xx / 5xx exception information capture
Recently, when using RestTemplate to access external resources, an interesting problem was found. Because the permission verification fails, the http code of 401 returned by the other party will also contain some exception prompt information in the returned ...
Posted by jsucupira on Fri, 10 Jan 2020 23:03:45 -0800
An analysis of leetcode's solution 37-42 questions
Solution independence
Write a program to solve Sudoku problem through filled space.
This problem is mainly solved by backtracking. Select the row, column and block with the least space, and then fill in them. If there is a problem, backtracking is needed
class Solution {
public:
// Line, column an ...
Posted by corcode on Fri, 10 Jan 2020 20:38:26 -0800
JAVA series - > StringBuilder class
String splicing problem
Because the object content of the String class cannot be changed, a new object is always created in memory whenever String splicing is performed. For example:
public static void main(String[] args) {
String s = "Hello";
s += "World";
System.out.println(s);
}
The Stri ...
Posted by tpearce2 on Fri, 10 Jan 2020 20:33:21 -0800
Drawing a rectangle with a brush and canvas in Android
scene
In Android, the brush uses the Paint class, and the Canvas uses the Canvas class to represent it.
Basic steps of drawing
First, write a custom view class inherited from view, then rewrite its onDraw method, and finally add the custom view to actvity.
Effect
Note:
Blog: https://blog.csdn.net/badao_liumang_qizhi
Pay attention to the ...
Posted by o2cathy on Fri, 10 Jan 2020 09:56:39 -0800