200 lines of Java code for calculator program
I found a calculator program written in college, and a graphical interface, which can graphically display the expression syntax tree, ha ha;)
There are only 200 lines of Java code, which can not only calculate addition, subtraction, multiplication and division, but also match parentheses~
Code comments:
From simple interface color matching to ...
Posted by aznkidzx on Sun, 17 May 2020 09:14:50 -0700
The realization of moving average filter in hand-held teaching series
[introduction]: in the previous article about IIR design, some friends are still reading it. Although I don't know how the officials feel, I think there is always a reward to read, so I decided to continue this series. This article talks about average filter, which is very easy at first glance. But I don't think some of the key points are clear ...
Posted by embtech on Sat, 16 May 2020 23:08:17 -0700
C language reconstruction function encapsulation of airplane game (advanced version)
code refactoring
This can provide a simplified game framework and realize code reuse
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int x, y;
int high, width;
void startup()
{
high = 20;
width = 30;
x = high / 2;
y = width / 2;
}
void show()
{
system("cls");
int i, j;
for(i = 0; i < high; i++) //Show ...
Posted by ali_p on Wed, 06 May 2020 07:57:43 -0700
The skill of quickly locating header file in linux Programming powerful grep command
This skill comes from my actual development:
This function is used to convert ip address into network byte order. Its prototype is in addr INET addr (const char * CP);
The return value is an in ﹣ addr ﹣ T type. Obviously, this is not a standard data type of c language. If you want to find out what type it is, you must find the header file. ...
Posted by alsouno on Tue, 05 May 2020 01:02:17 -0700
warshall judge whether an undirected graph is a tree
Determine whether a graph is a tree
problem
Given an undirected graph, we can judge whether the graph is a tree.
input
The input has several test samples. The first line is the number of test samples, followed by several test samples. The first line of each test sample is the node number n, and the nodes use 1,2 , n number. The second line is t ...
Posted by jasonhardwick on Mon, 04 May 2020 11:39:18 -0700
Instructions for Python [map, reduce, filter] built-in functions
notes preceding the text of a book or following the title of an article
Introduce the methods of map, reduce, and filter built-in functions in Python
1: map
map(...)
map(function, sequence[, sequence, ...]) -> list
Execute function(item) for item in sequence, and output the result as list.
>>> map(str, range(5)) #st ...
Posted by karassik on Thu, 30 Apr 2020 08:22:15 -0700
The number of times in the array of sword finger offer exceeds half of the array length
Title:There is a number in the array that appears more than half the length of the array. Please find this number. For example, enter an array of length 9 {1,2,3,2,2,2,5,4,2}. Since the number 2 appears five times in the array, more than half the length of the array, output 2. Output 0 if it does not exist. Resolution:Seeing this problem, ...
Posted by kender on Sun, 26 Apr 2020 09:07:32 -0700
python crawler (xpath parsing web page, download photos)
XPath (XML Path
Language) is a language for finding information in XML documents, which can be used to traverse elements and attributes in XML documents.
lxml
Is an HTML/XML parser, the main function is how to parse and extract HTML/XML data. lxml, like regular, also uses
C is a high-performance Python HTML/XML parser. We can use the XPa ...
Posted by HERATHEIM on Fri, 24 Apr 2020 08:22:55 -0700
where clause of Oracle
The where clause is used to find records from tables or temporary datasets that meet the specified conditions, and can be used for conditions in select, update, and delete statements.
1, Generate test data
Use the following SQL to create the super girl basic information table (t? Girl) and insert some test data.
create table T_GIRL
(
id ...
Posted by banacan on Thu, 23 Apr 2020 05:19:05 -0700
freecplus framework - log file operation
1, Source code description
Freecplus is a C/C + + open source framework under Linux system. Please go to the C language technology network (www.freecplus.net) to download the source code.
This paper introduces the method of log file operation in freecplus framework.
The declaration file for functions and classes is freecplus / 65124; freecplus ...
Posted by Kardall on Mon, 20 Apr 2020 10:56:26 -0700