[winter vacation 2020] Day1 Java advanced
What java needs to learn today is:
1. Junit unit test
2. reflection
3. notes
Junit unit test:
Test classification:
Black box test: no need to write code, give input value, see whether the program can output the expected value.
White box test: need to write code. Pay attention to the specifi ...
Posted by curtis_b on Sun, 12 Jan 2020 19:38:07 -0800
javacc5.0 implementation of four calculator scripts
options{
STATIC=false;
LEXER_CLASS="ExpCalcParserTokenManager";
}
PARSER_BEGIN(ExpCalcParser)
import java.io.*;
import java.io.PrintStream;
import java.math.BigDecimal;
public class ExpCalcParser{
private static final int DEF_DIV_SCALE = 16;//Result precision set to 16 bits
private String exp;
public static ExpCalcPars ...
Posted by Hangston on Sat, 04 Jan 2020 08:58:17 -0800
Sword finger offer -- the moving range of robot
Summary
Title Description
There is a grid of m rows and n columns on the ground. A robot starts to move from the grid of coordinates 0,0. Each time, it can only move one grid to the left, right, up and down directions, but it can't enter the grid where the sum of the row coordinates and the column coordinates is greater than k ...
Posted by terfle on Fri, 03 Jan 2020 22:16:24 -0800
[python learning] don't worry about the progress and contents of python learning
Catalog
Python Basics
install
install
Basic use
print function
Basic mathematical operation
variable
while and for loops
while cycle
for cycle
if judgement
if judgement
if else judgment
if elif else judgment
Defining function
def function
Function parameter
Function default parameters
Variable form
...
Posted by mykmallett on Thu, 02 Jan 2020 23:36:29 -0800
[reading notes] only simple but not in-depth data analysis (10)
This chapter is a continuation of the previous chapter. This chapter is mainly about regression problem. It designs a "salary increase calculator", which is a salary increase algorithm.
Here is still the data. First, let's make a histogram of the requirements and results of the salary raiser:
import pandas as pd
imp ...
Posted by kparish on Mon, 30 Dec 2019 23:10:32 -0800
[UWP] occupy title block
1. Preface
Every application with ideal UWP will make the idea of title block, especially when Microsoft provides Extend Acrylic to the title block After this function, most of Windows 10's native applications are not obedient, occupying one mu and three Fen of the title bar. This blog will show you how to customize the title block in UWP.
2. ...
Posted by JD-AM on Mon, 23 Dec 2019 02:24:09 -0800
Node.js automated test (Mocha+Istanbul)
Based on Express, Mocha + Istanbul
1. Unit Test
1.1 Install Mocha
npm i -D mocha
1.2 Create test/test.js
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal([1,2,3].indexOf(4), -1);
}) ...
Posted by wama_tech on Sun, 15 Dec 2019 08:45:30 -0800
TCP based calculator (Java)
A calculator based on TCP communication, the client sends data to the server through the button, the server calculates and processes the data, and sends the calculation result back to the client. It uses multithreading to enable.
Server thread:
package com.netproject2;
import java.io.DataInputStream;
import java.io.DataOutputStr ...
Posted by JAM on Fri, 13 Dec 2019 12:19:39 -0800
vue-day1 of front end and mobile development
Abbreviation and event modifier for v-on of Vue instruction event modifier:. stop prevents bubbling. prevent block default events. capture use event capture mode when adding event listeners. self triggers the callback only when the event is triggered by the element itself (for example, not a child element). once event is triggered only once
v- ...
Posted by schandhok on Sun, 08 Dec 2019 12:00:45 -0800
Interpreter pattern of design pattern
introduce
Role:
It mainly includes the following roles:
Expression: abstract expression.
TerminalExpression: Terminator expression - is a symbolic expression.
NonTerminalExpression: non terminator expression - numeric expression.
Calculator: calculation class.
Code
Code scenario
Interpreter to add and subtract.
Specific code
Expression
/**
* ...
Posted by dsdintn on Tue, 03 Dec 2019 07:54:13 -0800