In linux, the meanings of shell variables $ #, $ @, $0, $1, $2,
Variable description
$
Shell PID (processID)
$!
The background ProcessID of the last shell Running
$?
End code of the last command (return value)
$-
Flag overview Set by using
Link: HDU 2602 Bone Collector Bone Collector Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 28903 accepted submission (s): 11789 Problem descriptionpolicyears ago, in Teddy's hometown there
0/1 the Dynamic Programming Method for Solving the knapsack problem was described by our predecessors. What we did here was to implement it based on our own understanding. The main purpose was to train our thinking and programming skills. At the
printf "The complete list is%s\n" "$$" 24520 the shell itself PIDprintf "The complete list is%s\n" "$!" PID of the last running background process of the empty shellprintf "The complete list is%s\n" "$?" 0 end code of the last Run command (return
$ file name and path$1,$2 parameter 1, parameter 2$# The number of arguments passed to the script or function $$ current shell process ID $? judge execution succeeded or not 0 for success [email protected] Pass all
for these things, the gods are already in the chest, but there are some just contact Linux , Unix people like these systems may not be familiar with these variables, so I'll share them with you today. What problem can add QQ Group, we discuss
1. Modify host name hostname view hostname vi/etc/sysconfig/network Modify hostname= hostname vi/etc/hosts Modify 127.0.1 hostname service Network restart #/etc/ Hosts in the domain name resolution precedence over DNS server 2.IP address Ifconfig
Reference: https://www.jianshu.com/p/9e72b3942c59The reason is Num.patitions = 1 in the Kafka cluster kafka/config/server.properties file. The partition default value needs to be modified.Partitions the number of partitions nodes created by default
$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the Case of "" ", in the
/*** Book: "Algorithmic Analysis and Design" * Function: given n items and a backpack, the weight of item I is WI, its value is VI, ask how to choose the items loaded into the backpack, so that the total value of the items loaded into the backpack? *
Creating Classes and objectsObject-oriented programming is a way of programming, which requires "classes" and "objects" to be implemented, so object-oriented programming is actually the use of "classes" and "objects".A class is a template that can
This paper illustrates the method of using PHP backtracking to solve 0-1 knapsack problem. Share to everyone for your reference. The specific analysis is as follows:
This code is written according to the pseudocode of the Software designer tutorial;
Today, mainly to explain 0/1 knapsack problem using dynamic programming algorithm to solve, but there is a problem for the temporary solution, that is, how to return the selected items index, follow-up will be improved to solve this problem.
The meaning of shell variable $#,$@,$0,$1,$2 in Linux is explained:
Variable Description:
$$
The shell itself PID (ProcessID)
$!
The PID of the Shell's last running background process
$?
End code of the last command to run (return value)
$-
Flag
1. Questions
Known existing items m pieces (item 0,1,2,3,... m-1), the maximum load bearing of the backpack is N, calculate the maximum value that can be achieved by putting this m-item into this backpack.
The name, weight, and value of each item
Test instructions: for a given n two-dollar number, select N-k Two-dollar combination, making Sigma (A[i])/sigma (B[i]) the largest. Idea: So this is the most naked 0-1 score planning problem, directly on the template, pay attention to read when
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.