文档库 最新最全的文档下载
当前位置:文档库 › Parallel Bat Algorithm Using MapReduce Model(IJITCS-V9-N11-8)

Parallel Bat Algorithm Using MapReduce Model(IJITCS-V9-N11-8)

Parallel Bat Algorithm Using MapReduce Model(IJITCS-V9-N11-8)
Parallel Bat Algorithm Using MapReduce Model(IJITCS-V9-N11-8)

I.J. Information Technology and Computer Science, 2017, 11, 72-78

Published Online November 2017 in MECS (https://www.wendangku.net/doc/9a8474115.html,/)

DOI: 10.5815/ijitcs.2017.11.08

Parallel Bat Algorithm Using MapReduce Model

Kapil Sharma

Department of Computer Engineering, Delhi Technological University, Delhi, India

E-mail: kapil@https://www.wendangku.net/doc/9a8474115.html,

Sanchi Girotra

Department of Computer Engineering, Delhi Technological University, Delhi, India

E-mail: sanchi.girotra@https://www.wendangku.net/doc/9a8474115.html,

Received: 04 June 2017; Accepted: 10 August 2017; Published: 08 November 2017

Abstract—Bat Algorithm is among the most popular meta-heuristic algorithms for optimization. Traditional bat algorithm work on sequential approach which is not scalable for optimization problems involving large search space, huge fitness computation and having large number of dimensions E.g. stock market strategies therefore parallelizing meta-heuristics to run on parallel machines to reduce runtime is required. In this paper, we propose two parallel variants of Bat Algorithm (BA) using MapReduce parallel programming model proposed by Google and have used these two variants for solving the Software development effort optimization problem. The experiment is conducted using Apache Hadoop implementation of MapReduce on a cluster of 6 machines. These variants can be used to solve various complex optimization problems by simply adding more hardware resources to the cluster and without changing the proposed variant code.

Index Terms—Bat Algorithm, Big Data, COCOMO Model, Distributed System, Hadoop MapReduce Model, Parallel Algorithms.

I.I NTRODUCTION

Over the last few years, Meta-heuristic (discover solution by trial and error) approximation algorithms are widely used to solve many continuous and combinatorial optimization problems. And these algorithms often find good solution with less computation effort than exhaustive, iterative and simple heuristic methods. Some of the meta-heuristic algorithms are virus optimization algorithm (VOA), symbiotic organism search (SOS), particle swam optimization (PSO), genetic algorithm (GA), cuckoo search (CS) etc. These algorithms are problem independent thus suits many optimization problems. Bat Algorithm is one of the swarm intelligence based nature inspired Meta - heuristic algorithm proposed by X.-S. Yang [1] in 2010 and it is based on the echolocation behavior of bats to detect its prey, avoid obstacle and to find its dwell in caves. BA has been successfully applied on many continuous optimization problems of topology design [2], effort estimation [3], economic dispatch [4], Medical Image Segmentation [15], Training Feed forward Neural Networks in e-Learning Context [14], Task Scheduling [16] etc. and it has shown better convergence to optimal solution than other meta - heuristic algorithms.

But BA takes reasonable amount of time to solve problems involving large volume of data (big data), involving huge fitness computation or having large number of dimensions. One solution to handle this would be to parallelize bat algorithm and scale it to large number of processors. But after program successfully parallelize, it must still needs to focus on communication of best bat across all the processors this can be done through shared memory which provides a global address space which parallel tasks can access asynchronously but it lacks locality of reference thus takes much time as compare to message passing interface (MPI) which provides an interface, protocol and semantic specifications to pass messages between parallel processes. These parallelized programs still need to handle distribution of data and node failure explicitly. In order to deal with these concerns, Google’s Dean and Ghemawat [5] introduced an abstraction called MapReduce that provides a parallel design pattern for simplifying application development for distributed environments i.e. allows expressing the simple computation in that design model with hiding complex details of parallelization i.e. fault-tolerance, data distribution and load balancing in a library. These abstractions are inspired by map and reduce primitives present in Lisp and many other functional languages. This paper makes the following research contributions:

1.It demonstrates the modification of bat algorithms

into the MapReduce Programming Model.

2.It proposes 2 variants of parallel bat algorithm.

3.It implements these variants on software effort

estimation problem and demonstrates its

scalability on different experimental set up.

From this proposed work, many complex optimization problems based on BA can easily be scaled only by increasing the no. of hardware resources.

The rest of the paper is organized as follows. Section II presents the study of BA and MapReduce in literature. In Section III, we revisit the Bat Algorithm. Section IV

provides more detailed explanation of MapReduce Model. In section V, we discuss how bat algorithm can be parallelized using the MapReduce Model. Section VI provides implementation details and we conclude with results in section VII and VIII.

II.R ELATED W ORK

In 2004, Google’s Dean and Ghemawat [5] published a white paper to parallelize large data on clusters by using map reduce model. After that MapReduce became widely-used parallel programming model and was employed on various large processing applications like Mining Interesting Infrequent Item sets from Very Large Data [17] etc. Nowadays, heuristic algorithms have started using Hadoop Map Reduce Model to scale data intensive problems as McNabb, et al. [6] have successfully parallelized Particle Swarm optimization Algorithm PSO on a MapReduce framework and evaluated it on RBF Network Training function and sphere function then in 2014 Wang, et al. [2] proposed MPSO (Map-PSO) and applied this on Performance-based Reward Strategy in stock markets which took less running time then sequential and MRPSO. Jin, et al. [7] used MapReduce model to parallelize GA and proposed MRPGA. Verma, et al. [13] presented parallel model of GA for data-intensive computing and tested it on one max problem. Keco and Subasi [14] proposed Model 2 and compared it with model 1 for same one max problem implementation. Then these models were used for various problems like Job Shop Scheduling Problem [3], automatic generation of JUnit Test Suites [12] etc. Lin, et al. [8] scaled Modified Cuckoo Search using MapReduce Architecture and evaluated it on Griewank function, Rastrigrin function, Rosenbrock function and Sphere function.

III.B AT A LGORITHM

BA is swarm intelligence based meta-heuristic optimization algorithm proposed by X.-S. Yang [1] in 2010. BA finds the solution in the search space by exploiting the echolocation behavior of bats in which they locate their prey by emitting a short - loud sound pulse and listen for the echo that bounces back from the surrounding obstacle from which they see the time delay from the emission of sound pulse to perception of the echo and the time difference between their two ears and also the loudness variations (signal intensity) of the echo’s to get a view about surrounding and prey size.

In addition to this, BA uses a dynamic strategy for exploration (global search) and exploitation (local search) to improve the solution. Like the variations in pulse emission rates r and loudness A0 controls exploration and exploitation in BA.

In original bat algorithm, the bat behaviour of finding the best location is captured to optimize the fitness function of the problem to be solved. It consists of the following steps: Step 1: Initialization of Bat Population

Initially, N bats are randomly spread over the search space as they have no idea where the prey is located thus population is randomly generated for each dimension d with default values for frequency, velocity, pulse emission rate and loudness.

()

mi max min

n

0, ()

1

ij j j j

x x rand x x

-

=+ (1)

Where i= 1, 2 … N, j= 1, 2… d,

min j

x and

max j

x are lower and upper boundaries for dimension j respectively.

Step 2: Update Process of Frequency, Velocity and Solution

In the iterations of BA, each bat in the population emits sound pulses of random frequency dispersed between [f min, f max] and this frequency controls the speed and new position of bat using below equations:

min max min

()

i

f f f fβ

=+- (2)

11

(*)

t t t

i i i i

v v x x f

--

=+- (3)

1

t t t

i i i

x x v

-

=+ (4)

Where βdenotes a randomly generated number with in the interval [0, 1] and x* is the current global best solution which is located after comparing all the solutions. Upper and lower bounds of frequency are chosen such that it is comparable to the size of search space of that variable.

Step 3: Local Search

Each bat performs Random walk in order to exploit a position around the best solution.

t

new old

x x A

ε

=+(5)

Here

old

x is selected best solution from current best solutions, ε denotes a random number within the interval [-1, 1], while t A is the average loudness of all the bats at that time step.

Step 4: Updating Loudness and Pulse Emission Rate

If new solution is improved than previous solution i.e. as the bat approach their prey, loudness of emitted sound pulse decreases and pulse emission rate increases so loudness and pulse rate needs to be updated using below equations:

1

t t

i i

A A

α

+= (6)

10(1)

t t

i i

r r eγ

+-

=- (7)

Where α and γ are constants.0

i

r & 0

i

A consist of random

values and 0i r ∈[0, 1] and 0i A ∈[1, 2]. Step 5: Find the current best solution.

Find the current best bat by comparing last best fitness value with improved bat fitness if its better then update the best bat solution.

After all the iterations, the current best bat x * gets improved and acts as the solution to the problem.

IV. M AP R EDUCE M ODEL

Map Reduce is programming model and an abstraction proposed by Google - Dean and Ghemawat [5] for processing large volumes of data in parallel. This Model exploits parallelism by splitting the input data into blocks which are processed by the map and reduce tasks in a completely parallel manner. And it is applicable to those parallel computing problems in which same operation is applied on each data item and whose output is consumed by other operations in groups.

MapReduce Programming Model takes the input in the form of (key; value) pairs and operate on data in mainly three stages: 1. Map Stage:

In the map stage, the user defined map () function takes as input a single (key; value) pair and produces as output any number of intermediate (key; value) pairs. It is crucial that the map operation is stateless - that is, it operates on one pair at a time. This allows for easy parallelization as different inputs for the map can be processed in different machines.

1122:(,)(,)MAP K V LIST K V ? (8) 2. Shuffle Stage:

In shuf fle phase, all of the map’s output (key; value) pairs are sorted and all values associated with same key is grouped together in a value lists which is then send to reduce () function. This occurs automatically without any programmer intervention. 3. Reduce Stage

In the reduce stage, each user defined reduce () function takes all of the values associated with a single key k and outputs a multi set of (key; value) pairs with the same key k. This highlights one of the sequential aspects of MapReduce computation i.e. all of the maps need to finish before the reduce stage can begin. And in the reduce step, the parallelism is exploited by observing that reducers operating on different keys can be executed simultaneously.

222:(,())()REDUCE K list V LIST V ? (9)

Apache Hadoop is an open source software framework for distributed processing which has successfully implemented Google’s MapReduce and file system in its modules.

V. P ARALLEL B AT A LGORITHM USING M AP R EDUCE

M ODEL As have seen that in each iteration of original BA, all bats find a new location either by flying randomly using equation (5) or by adjusting their frequency and updating their velocity, location using equation (2), (3), (4). Each bat then evaluates the fitness of new solution and accordingly move to new position if that’s better than the current position.

In original BA, the steps that can be parallelized i.e. can be executed independently are:

? Each bat updating its position.

? Iterations of generations can be executed in

parallel.

But iteration s can’t be parallelized as population of bat should improve from generation to generation and initial iteration results should be utilized in the next iterations. Based on above idea, to transform BA into map and reduce primitives following points need to be defined:

? Determine the input to MapReduce Model.

? Determine the jobs of mapper and reducer tasks. ? Exchange information between parallel map tasks. A. Input Representation

In Parallel BA, large initial random population of bats is given as input to MapReduce framework which splits them into chunks and distributes them across the map tasks.Each bat in input population is represented by key/value pairs:

K 1: String representing individual bat V 1: fitness

Here the key consists of set of attributes representing bat like position, frequency and velocity whereas value is the fitness of that bat. For e.g. in our software effort optimization problem (K 1: V 1) are:

Coefficient a; Coefficient b; Frequency; Velocity a; Velocity b: Fitness

And g best bat of initial population is also sent in the following form:

Coefficient a; Coefficient b: Fitness B. Mapper in Parallel Bat Algorithm

Job tracker initiates map tasks equal to the no. of population split and assign map task to each of these population splits. Then each mapper (map task) calls the user defined map () function for each individual (bat: fitness pair) in the population split.

In this paper, we present two variants of parallel bat algorithm. Both variants have corresponding map () algorithms which encapsulates bat updating process. First variant uses one map phase for one generation of bat algorithm i.e. population is evolving generation by generation while in second variant, one map phase for all the generations is used i.e. each bat is evolving for N

generations with in a map () function. That means in variant 1, N Map cycle execute whereas in Variant 2 only one map cycle will generate the optimum output.

As shown in Fig. 1 pseudo code of variant 1, map () function explores and exploits new solution for given bat (input key) using x * representing m best . And outputs improved bat which is used as input in the next generations (loop cycle). This map () function is called for each bat in the population for N generations.

And as shown in pseudo code in Fig. 2, map () function evolves the given bat for N generations using m best (mapper best) as x*. In this no intermediate data are emitted by any Mapper and final evaluated g best is considered as the output of the job.

At the end of each map task these improved m best are written to the distributed file system which are then evaluated at the end of map phase to calculate g best .

Fig.1. Pseudo Code of Variant 1

Fig.2. Pseudo Code of Variant 2

C. Exchange of Information between Bats

In original bat algorithm, bats use the shared current best x * in their position updating process but Parallel BA,

share generation best bat (g best ) across all the parallel map tasks which is used to initialize mapper level best (m best ) bat. This m best bat is updated in map () if a better bat is found in map task thus updated m best is used for other bats in the same population split.

In this research, we have explored 2 approaches to generate g best bat:

1. Map Reduce Bat Algorithm (MRBA)

In MRBA, both map and reduce tasks are used. Improved bat as output of all the map tasks are combined and sent to a single Reducer (using same key for all the improved bats). Reduce task sorts all the improved bats and output g best bat which which is used for next iterations as shown in Fig. 3.

Fig.3. Operation phases in MRBA

Fig.4. Operation phases in MBA

2. Map Bat Algorithm (MBA)

In MBA, only mapper is used and during the clean-up of each map task this improved m best bat is stored in distributed file system. As there are zero reduce tasks so no mapper output will be sorted/ shuffled thus is directly sent for output. And after every iteration, g best is evaluated from these mapper level bats (m best ) as shown in Fig. 4. Thus MBA find the g best with less no. of comparison than MRBA therefore in our proposed algorithm MBA is preferred over MRBA.

VI. E XPERIMENTAL S ETUP

This section discusses the problem statement on which this proposed algorithm needs to be tested and the environment being set up to emulate the Map Reduce Model.

A. Implementation

These proposed variants are tested on optimization of COCOMO II parameters (a, b) such that calculated efforts approximate to actual efforts for NASA 63 project Dataset.

Formally, this problem can be framed as finding parameter 12{,}X x x = where, {0,5}i x ∈ that minimizes the following equation:

()2

123151[()– /]x

EM EM E MRE Actual M EM x KLOC Actual ???=??

(10)

1

1n

i ij j MMRE MRE n ==∑ (11)

Here MMRE is Mean Magnitude of Relative Error which is used as evaluation criteria for assessment of optimized parameters. And since parameter x 1 and x 2 are specific to project modes therefore we execute program for each mode separately.

B. Environment

These variants are implemented on Apache Hadoop (0.19) and ran on 6 node cluster in which one node act as master and other acts as slaves. Each node had Intel 5 dual core, 4GB RAM and 250 GB hard disks. The nodes are integrated with Hadoop Distributed File System (HDFS) giving a potential single image storage space of 2 * 250/3 = 166 GB (since the replication factor of HDFS is set to 3). And execution of no. of mappers and reducer in parallel depends on hardware configuration.

VII. R ESULTS

This section discuss results obtained using the developed algorithm and in those experiments, we have used population size of 2 lakhs (input size 13MB), number of iterations as 5, number of nodes as 6 and block size of 5MB.

?

Scalability of MBA for effort estimation problem with increasing the no. of Map Tasks (Mapper): Fig. 5 compares the run time of MBA (Variant 1) with different number of map task i.e. setting different block size. On taking block size of 1 MB i.e. 13 map tasks, execution time is 16.84 which decreased with increase in block size due to less no of task distribution among the nodes. But on further decreasing the number of tasks (< no of nodes), run time became almost constant due to decrease in communication overhead.

Fig.5. Scalability of MBA for effort estimation problem with increasing

the number of mappers

?

Comparison between MRBA and MBA: Fig. 6 compares the running time of Map Reduce Bat Algorithm (MRBA) and Map Bat Algorithm (MBA) for variant 1. And as shown, MBA takes less time as compare to MRBA by saving time in intermediate bat’s storage with no initialization of Reducer tasks. And also MRBA requires whole population (2 Lakh) sorting to get the g best whereas MBA reads at most 13 m best from the HDFS to find the g best .

?

Scalability of MBA for effort estimation problem with increasing the number of nodes: Fig. 7 compares the run time of both MBA based variants by increasing the number of nodes in the cluster. Variant 2 took less time than Variant 1 due to less no. of map cycles and no intermediate generation data handling. And for variant 2, single node cluster took less time than 3 node cluster as there was no communication/task distribution overhead but on further increasing the number of nodes, the execution time reduced and became almost constant.

?

Performance tuning with increase in population size: Fig. 8 compares the MMRE of embedded projects for both variants by increasing the size of population. As shown, MMRE reduces with increase in population and became constant after 1500.

?

Performance tuning with increase in number of generations: In this experiment, we have taken population size as 10,000 and block size of 5MB and compared the MMRE of embedded projects for both variants by increasing the number of

iterations. As shown in Fig. 9, both variants give better MMRE than COCOMO Model (0.3921) and MMRE decreases with increase in generation due to more refining of output.

Fig.6. Comparison between MRBA and MBA

Fig.7. Scalability of MBA for effort estimation problem with increasing

the number of nodes

Fig.8. Performance tuning with increase in population size

Fig.9. Performance tuning with increase in number of Generations

VIII. C ONCLUSION AND F UTURE W ORK

The proposed variants can easily parallelize BA which than can be used to solve problems involving large search space by simply adding more hardware resources to the cluster and without changing the proposed variant code. And according to experimental results variant 2 shows better convergence than variant 1 and also take less time for execution.

It has been seen that lots of communication, task start up overhead is associated with Hadoop Map Reduce Architecture thus is not suitable for problems involving small search space, few dimension and less computation. And map reduce is suitable for parallel computing problem having huge data with having same processing for each item.

Due to the update process in BA, Parallel BA Variants can’t be used for given large dataset in order to find the optimal result from them. So further study on BA modification is required to find best results from given dataset for e.g. getting best quotation from large dataset of quotations.

In future work, both variants should be applied on problems involving large search space, big computation, and large no. of dimensions like in stock market strategies. And these variants running time can also be further improved by examining other features of MapReduce architecture like partitioner, combiner, shuffler etc. which may reduce the processing. We can also compare these variants with existing MPI-based implementation or the results can be compared with other parallel meta-heuristic algorithms.

R EFERENCES

[1] X.-S. Yang, "A New Metaheuristic Bat-Inspired

Algorithm," Studies in Computational Intelligence, Springer Berlin, pp. 65-74, 2010.

[2] X. S. Yang, M. Karamanoglu, and S. Fong, "Bat

aglorithm for topology optimization in microelectronic applications," presented at the IEEE International Conference on Future Generation Communication Technology (FGCT2012) London, 2012.

[3] N. Gupta and K. Sharma, "Optimizing intermediate

COCOMO model using BAT algorithm," presented at the 2015 2nd International Conference on Computing for Sustainable Global Development (INDIACom), New Delhi, India 2015.

[4] Y. A. Gherbi, H. Bouzeboudja, and F. Lakdja, "A

Economic dispatch problem using bat algorithm," Leonardo Journal of Sciences, pp. 75–84, June 2014 2014. [5] J. Dean and S. Ghemawat, "Mapreduce simplified data

processing on large clusters," Sixth Symposium on Operating System Design and Implementation, vol. 51, pp. 107-113, 2004.

[6] A. W. McNabb, C. K. Monson, and K. D. Seppi, "Parallel

PSO Using MapReduce," presented at the IEEE Congress on Evolutionary Computation, 2007. CEC 2007, Singapore, 2007.

[7] C. Jin, C. Vecchiola, and R. Buyya, "MRPGA An

Extension of MapReduce for Parallelizing Genetic Algorithms," presented at the IEEE Fourth International Conference on eScience, 2008., Indianapolis, IN 2008.

[8] C.-Y. Lin, Y.-M. Pai, K.-H. Tsai, C. H.-P. Wen, and L.-C.

Wang, "Parallelizing Modified Cuckoo Search on MapReduce Architecture," Journal of Electronic Science and Technology, vol. 11, 2013.

[9] F. Wang, P. L. H. Yu, and D. W. Cheung, "Combining

Technical Trading Rules Using Parallel Particle Swarm Optimization based on Hadoop," presented at the International Joint Conference on Neural Networks (IJCNN), Beijing, China, 2014.

[10] D.-W. Huang and J. Lin, "Scaling Populations of a

Genetic Algorithm for Job Shop Scheduling Problems using MapReduce," presented at the 2010 IEEE Second International Conference on Cloud Computing Technology and Science (CloudCom), Indianapolis, IN, 2010.

[11] W. Zhao, H. Ma, and Q. He, "Parallel k-means clustering

based on mapreduce," vol. 5931, pp. 674-679, 2009.

[12] L. Di Geronimo, F. Ferrucci, A. Murolo, and F. Sarro, "A

Parallel Genetic Algorithm Based on Hadoop MapReduce for the Automatic Generation of JUnit Test Suites " presented at the 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation (ICST), Montreal, QC, 2012. [13] A. Verma, X. Llorà, D. E. Goldberg, and R. H. Campbell,

"Scaling Genetic Algorithms Using MapReduce," presented at the ISDA '09. Ninth International Conference on Intelligent Systems Design and Applications, 2009, Pisa 2009.

[14] D. Keco and A. Subasi, "Parallelization of genetic

algorithms using Hadoop Map/Reduce," SouthEast Europe Journal of Soft Computing, vol. 1, 2012.

[15] Rabiu O. Isah, Aliyu D. Usman,A. M. S. Tekanyi,

"Medical Image Segmentation through Bat-Active Contour Algorithm," I.J. Intelligent Systems and Applications, pp. 30-36, 2017

[16] M.Jaeyalakshmi, Dr.P.Kumar, "Task Scheduling Using

Meta-Heuristic Optimization Techniques in Cloud Environment," I.J. Intelligent Systems and Applications, vol. 5, Nov 2016

[17] T Ramakrishnudu, R B V Subramanyam, "Mining

Interesting Infrequent Itemsets from Very Large Data based on MapReduce Framework," I.J. Intelligent Systems and Applications, 2015, 07,pp. 44-49

Authors ’ Profiles

Dr. Kapil Sharma is Associate Professor at the Department of Computer Engineering, Delhi Technological University (formerly Delhi College of Engineering), Delhi, India. He has completed Doctors Degree in Computer Science and Engineering under the Faculty

of Engineering and Technology at the M. D. University, Rohtak (Haryana), India. He has obtained his Bachelor of Engineering and Master of Technology Degrees in Computer Science & Engineering and Information Technology.

Sanchi Girotra is Senior Software Engineer at Bureau Veritas, Noida, India. She has completed her Master’s Degree from Department of Computer Engineering, Delhi Technological University (formerly Delhi College of Engineering), Delhi, India. She has

obtained her Bachelor of Engineering in Computer Science & Engineering at M. D. University, Rohtak (Haryana), India.

How to cite this paper: Kapil Sharma, Sanchi Girotra, "Parallel Bat Algorithm Using MapReduce Model", International Journal of Information Technology and Computer Science(IJITCS), Vol.9, No.11, pp.72-78, 2017. DOI: 10.5815/ijitcs.2017.11.08

红头文件的制作及标准

一、红头文件的制作及标准 1、进行页面设置 选择“文件”——“页面设置”选择“页边距”附签,上:3.7厘米下:3.5厘米左:2.8厘米右:2.6厘米。选择“版式”附签,将“页眉和页脚”设置成“奇偶页不同”,在该选项前打“√”。选择“文档网格”附签,“字体设置”,“中文字体”设置为“仿宋”;“字号”设置成“三号”,单击“确定”按钮,选中“指定行网格和字符网格”;将“每行”设置成“28”个字符;“每页”设置成“22”行。然后单击“确定”按钮,这样就将版心设置成了以三号字为标准、每页22行、每行28个汉字的国家标准。 2、插入页号 选择“插入”——“页码”,“位置”设置为“页面底端(页脚)”,“对齐方式”设置为“外侧”。然后单击“格式”按钮,“数字格式”设置为全角的显示格式,单击“确定”按钮,再次单击“确定”按钮完成页码设置。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设置成“四号”;字体任意;奇数页的页码设置成右空一个汉字,偶数页的页码设置成左空一个汉字。 3、发文机关标识制作

选择“插入”——“文本框”——“横排”菜单项,鼠标将会变成“┼”,在Word 2000版面上单击鼠标左键,出现一个文本框,在该文本框内输入发文机关标识,输入完成后,选中该文本框,单击鼠标右键——“设置文本框格式”,在这里来设置红头的属性。 选择“颜色和线条”附签,“颜色”设置成“无填充颜色”。选择“大小”附签,“高度”设置成“2cm”;宽度设置成“15.5cm”。注:用户可根据实际情况调节尺寸。选择“版式”附签,单击“高级”按钮,水平对齐:“对齐方式”设置成“居中”,“度量依据”设置成“页面”;垂直对齐:“绝对位置”设置成“页边距”,“下侧”设置成“2.5cm”——平行文标准,“8.0cm”——上行文标准,注:用户可根据实际情况调节尺寸。然后单击“确定”。 选择“文本框”附签,左、右、上、下都设置成“0cm”,单击“确定”完成。文本框属性全部设置完成,单击“确定”按钮。选中文本框内的全部文字,将颜色设置成“红色”,字体设置成“小标宋简体”,字号根据文本框的大小设置成相应字号,但要尽量充满该文本框,这样,宽为155mm、高为20mm、距上25mm的红头制作完成。 4、红线制作 首先将“视图”——“工具栏”——“绘图”选中,单击“绘图”工具条的直线工具,鼠标会变成“十”字形,左手按住键盘上的Shift键,右手拖动鼠标从左到右划一条水平线,然后选中直线单击鼠

红头文件的制作标准和排版

红头文件的制作标准和排版 一、红头文件的制作标准 1、进行页面设置 选择文件”一一页面设置”选择页边距”附签,上:3.7厘米下:3.5厘米左:2.8厘米右:2.6厘米。选择版式”附签,将页眉和页脚”设置成奇偶页不同”,在该选项前打“七”选择文档网格”附签,字体设置”,中文字体”设置为仿宋”;字号”设置成三号”,单击确定”按钮,选中指定行网格和字符网格”; 将每行”设置成28”个字符;每页”设置成22 ”行。然后单击确定”按钮,这样就将版心设置成了以三号字为标准、每页22行、每行28个汉字的国家标准。 2、插入页号 选择插入”一一页码”,位置”设置为页面底端(页脚)”,对齐方式”设置为外侧”。然后单击格式”按钮,数字格式”设置为全角的显示格式,单击确定”按钮,再次单击确定”按钮完成页码设置。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设置成四号”;字体任意;奇数页的页码设置成右空一个汉字,偶数页的页码设置成左空一个汉字。 3、发文机关标识制作 选择插入”一一文本框”一一横排”菜单项,鼠标将会变成“七”在Word 2000版面上单击鼠标左键,出现一个文本框,在该文本框内输入发文机关标识,输入完成后,选中该文本框,单击鼠标右键一一设置文本框格式”,在这里来设置红头的属性。 选择颜色和线条”附签,颜色”设置成无填充颜色”。选择大小”附签,高度”设置成2cm”;宽度设置成15.5cm”。注:用户可根据实际情况调节尺寸。选择版式”附签,单击高级”按钮,水平对齐:对齐方式”设置成居中”,度量依据”设置成页面”;垂直对齐:绝对位置”设置成页边距”,下侧”设置成 2.5cm” 一-行文标准,8.0cm;行文标准,注:用户可根据实际情况调节尺寸。然后单击确定”

自制一键清理系统垃圾bat

自制一键清理系统垃圾bat 大多数人都知道随着电脑使用时间边长,电脑中积累的垃圾文件会越来越多。通过安全软件来清除电脑中的垃圾是不错的方法,但是对于部分喜欢“轻量”应用的用户来说能够轻松一键的清理电脑垃圾是最理想的操作。 在Windows在安装和使用过程中都会产生相当多的垃圾文件,包括临时文件(如:*.tmp、*._mp)、临时帮助文件(*.gid)、磁盘检查文件(*.chk)、临时备份文件(如:*.old、*.bak)以及其他临时文件。特别是如果一段时间不清理IE的临时文件夹“TemporaryInternetFiles”,其中的缓存文件有时会占用上百MB的磁盘空间。这些LJ文件不仅仅浪费了宝贵的磁盘空间,严重时还会使系统运行慢如蜗牛。这点相信你肯定忍受不了吧!所以应及时清理系统的LJ文件的淤塞,保持系统的“苗条”身材,轻松流畅上网!朋友来吧,现在就让我们一起来快速清除系统垃圾吧!!下面是步骤很简单就两步! 在电脑屏幕的左下角按“开始→程序→附件→记事本”,把下面的文字复制进去,点“另存为”,路径选“桌面”,保存类型为“所有文件”,文件名为“清除系统LJ.bat”,就完成了。记住后缀名一定要是.bat,ok!你的垃圾清除器就这样制作成功了!双击它就能很快地清理垃圾文件,大约一分钟不到。 复制下面代码粘贴到笔记本上: @echo offecho 《清理垃圾文件》 echo 正在清理系统垃圾文件,请稍等……echo 删除文件或目 录:%systemdrive%\*.tmpdel /f /s /q “%systemdrive%\*.tmp” echo 删除文件或目录:%systemdrive%\*._mpdel /f /s /q “%systemdrive%\*._mp” echo 删除文件或目录:%systemdrive%\*.giddel /f /s /q “%systemdrive%\*.gid” echo 删除文件或目录:%systemdrive%\*.chkdel /f /s /q “%systemdrive%\*.chk” echo 删除文件或目录:%systemdrive%\*.olddel /f /s /q “%systemdrive%\*.old” echo 删除文件或目录:%systemdrive%\recycled\*.*del /f /s /q “%systemdrive%\recycled\*.*” echo 删除文件或目录:%windir%\*.bakdel /f /s /q “%windir%\*.bak” echo 删除文件或目录:%windir%\prefetch\*.*del /f /s /q “%windir%\prefetch\*.*” echo 删除文件或目录:%windir%\temprd /s /q “%windir%\temp” & md “%windir%\temp” echo 删除文件或目录:%userprofile%\cookies\*.*del /f /q “%userprofile%\cookies\*.*”

最全批处理命令学习资料【完美版】

一:批处理文件 批处理文件是扩展名为·bat或·cmd的文本文件,包含一条或多条命令,由DOS或Windows系统内嵌的命令解释器来解释运行。 批处理的本质,是一堆DOS命令按一定顺序排列而形成的集合。 二:常用命令: 1.echo 和@: @ #关闭单行回显 echo off #从下一行开始关闭回显 @echo off #从本行开始关闭回显,一般批处理第一行都是这个 echo on #从下一行开始打开回显 echo #显示当前是echo off 状态还是echo on 状态 echo. #输出一个”回车换行”,空白行 #(同echo, echo; echo+ echo[ echo] echo/ echo") 2.errorlevel echo %errorlevel% 每个命令运行结束,可以用这个命令行格式查看返回码 默认值为0,一般命令执行出错会设errorlevel 为1 目录操作类命令: 3.dir 显示磁盘目录命令 dir #显示当前目录中的文件和子目录 dir /a #显示当前目录中的文件和子目录,包括隐藏文件和系统文件

dir c: /a:d #显示C 盘当前目录中的目录 dir c: /a:-d #显示C 盘根目录中的文件 dir c:" /b/p #/b只显示文件名,/p分页显示 dir c:" /b/p #/w不显示详细信息 dir *.exe /s #显示当前目录和子目录里所有的.exe文件 4.以树形显示当前路径文件夹结构 tree /f #显示每个文件夹中文件的名字。 5.md 建立子目录 md d:"a"b"c #如果d:"a 不存在,将会自动创建中级目录 #如果命令扩展名被停用,则需要键入mkdir "a"b"c 6.cd 改变当前目录(进入) cd \ #进入根目录 cd #显示当前目录 cd /d d:\sdk #可以同时更改盘符和目录 cd .. #返回上一级目录 7.rd 删除子目录命令 rd abc #删除当前目录里的abc 子目录,要求为空目录rd /s/q d:\temp #删除d:"temp 文件夹及其子文件夹和文件/q安静模式 磁盘操作类命令: 8.format 磁盘格式化命令 9.chkdsk 检查磁盘当前状态命令

红头文件模板及制作方法与格式规范

红头文件模板及制作方法与格式规范 篇一:政府红头文件制作标准 一、红头文件的制作及标准1、进行页面设臵 选择“文件”——“页面设臵”选择“页边距”附签,上:3.7厘米,下:3.5厘米,左:2.8厘米,右:2.6厘米。选择“版式”附签,将“页眉和页脚”设臵成“奇偶页不同”,在该选项前打“√”。选择“文档网格”附签,“字体设臵”,“中文字体”设臵为“仿宋”;“字号”设臵成“三号”,单击“确定”按钮,选中“指定行网格和字符网格”;将“每行”设臵成“28”个字符;“每页”设臵成“22”行。然后单击“确定”按钮,这样就将版心设臵成了以三号字为标准、每页22行、每行28个汉字的国家标准。 2、插入页号 选择“插入”——“页码”,“位臵”设臵为“页面底端(页脚)”,“对齐方式”设臵为“外侧”。然后单击“格式”按钮,“数字格式”设臵为全角的显示格式,单击“确定”按钮,再次单击“确定”按钮完成页码设臵。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设臵成“四号”;字体任意;奇数页的页码设臵成右空一个汉字,偶数页的页码设臵成左空一个汉字。 3、发文机关标识制作 选择“插入”——“文本框”——“横排”菜单项,鼠标将会变成“┼”,在Word 2000版面上单击鼠标左键,出现一个文本框,在该文本框内输入发文机关标识,输入完成后,选中该文本框,单击鼠标右键——“设臵文本框格式”,在这里来设臵红头的属性。 选择“颜色和线条”附签,“颜色”设臵成“无填充颜色”。选择“大小”附签,“高度”设臵成“2cm”;宽度设臵成“15.5cm”。注:用户可根据实际情况调节尺寸。选择“版式”附签,单击“高级”按钮,水平对齐:“对齐方式”设臵成“居中”,“度量依据”设臵成“页面”;垂直对齐:“绝对位臵”设臵成“页边距”,“下侧”设臵成“2.5cm”——平行文标准,“8.0cm”——上行文标准,注:用户可根据实际情况调节尺寸。然后单击“确定”。 选择“文本框”附签,左、右、上、下都设臵成“0cm”,单击“确定”完成。文本框属性全部设臵完成,单击“确定”按钮。选中文本框内的全部文字,将颜色设臵成“红色”,字体设臵成“小标宋简体”,字号根据文本框的大小设臵成相应字号,但要尽量充满该文本框,这样,宽为155mm、高为20mm、距上25mm的红头制作完成。 4、红线制作 首先将“视图”——“工具栏”——“绘图”选中,单击“绘图”工具条的直线工具,鼠标会变成“十”字形,左手按住键盘上的Shift键,右手拖动鼠标从左到右划一条水平线,然后选中直线单击鼠标右键,选择“设臵自选图形格式”,红线的属性在这里进行设臵。选择“颜色和线条”附签,“颜色”设臵为“红色”;“虚实”设臵为“实线”;“粗线”设臵为“2.25磅”。选择“大小”附签,“宽度”设臵为“15.5cm”。选择“版式”附签,单击“高级”按钮,水平对齐:“对齐方式”设臵成“居中”,“度量依据”设臵成“页面”,垂直对齐:“绝对位臵”设臵成“页边距”,“下侧”设臵成“7cm” ——平行文标准,“13.5cm”——上行文标准,注:用户可根据实际情况进行调节。单击确定。 5、文号制作

一键垃圾清理完整代码-超强悍代码

@echo off title @echo off color 2 echo. echo. echo 请不要关闭此窗口! echo. echo 开始清理垃圾文件,请稍等...... echo. echo 正在清理Thumbs.db数据库文件,请稍等...... del c:\Thumbs.db /f/s/q/a del d:\Thumbs.db /f/s/q/a del e:\Thumbs.db /f/s/q/a del f:\Thumbs.db /f/s/q/a del g:\Thumbs.db /f/s/q/a del h:\Thumbs.db /f/s/q/a del i:\Thumbs.db /f/s/q/a echo. echo 清理Thumbs.db数据库完成! echo. echo 正在清理系统分区根目录下tmp文件,请稍等...... del /f /s /q %systemdrive%\*.tmp echo. echo 清理系统分区根目录下tmp文件完成! echo. echo 正在清理系统分区根目录下_mp文件,请稍等...... del /f /s /q %systemdrive%\*._mp echo. echo 清理系统分区根目录下_mp文件完成! echo. echo 正在清理系统分区根目录下日志文件,请稍等...... del /f /s /q %systemdrive%\*.log echo. echo 清理系统分区根目录下日志文件完成! echo. echo 正在清理系统分区根目录下gid文件,请稍等...... del /f /s /q %systemdrive%\*.gid echo. echo 清理系统分区根目录下gid文件完成! echo. echo 正在清理系统分区根目录下chk文件,请稍等...... del /f /s /q %systemdrive%\*.chk echo. echo 清理系统分区根目录下chk文件完成!

非常经典BAT知识教程

手把手教你写批处理(willsort题注版) Climbing兄可谓用心良苦,受其感昭,略紧微薄之力;原文内容一字未易,仅于每段之下另加题注,其文大多非为纠错,多是年来体会,或偶得,或渐悟,未免偏颇;又加近来俗事渐多,闲情愈少,心浮气燥,一蹴而就。义理悖逆,敬请斧正;措辞不当,尚请莫怪。 另,建议Climbing兄取文不用拘泥于国内,此类技术文章,内外水平相差极大;与其修正国内只言片语,不如翻译国外优秀著述。 -------------------------------------------------------- 标题:手把手教你写批处理-批处理的介绍 作者:佚名 编者:Climbing 出处:中国DOS联盟之联合DOS论坛 题注:willsort 日期:2004-09-21 -------------------------------------------------------- 批处理的介绍 扩展名是bat(在nt/2000/xp/2003下也可以是cmd)的文件就是批处理文件。 ====willsort编注===================================================== .bat是dos下的批处理文件 .cmd是nt内核命令行环境的另一种批处理文件 从更广义的角度来看,unix的shell脚本以及其它操作系统甚至应用程序中由外壳进行解释执行的文本,都具有与批处理文件十分相似的作用,而且同样是由专用解释器以行为单位解释执行,这种文本形式更通用的称谓是脚本语言。所以从某个程度分析,batch,unix shell,awk, basic,perl等脚本语言都是一样的,只不过应用的范围和解释的平台各有不同而已。甚至有些应用程序仍然沿用批处理这一称呼,而其内容和扩展名与dos的批处理却又完全不同。====================================================================== == 首先批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。 ====willsort题注==================================== 批处理文件中完全可以使用非dos命令,甚至可以使用不具有可执行特性的普通数据性文件,这缘于windows系统这个新型解释平台的涉入,使得批处理的应用越来越“边缘化”。所以我们讨论的批处理应该限定在dos环境或者命令行环境中,否则很多观念和设定都需要做比较大的变动。 ====================================================================== ==

bat文件语句语法

BAT文件语法和技巧(bat文件的编写及使用)(转载一) 比较有用的东比较有用的东西 首先,批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows 的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。 其次,批处理文件是一种简单的程序,可以通过条件语句(if)和流程控制语句(goto)来控制命令运行的流程,在批处理中也可以使用循环语句(for)来循环执行一条命令。当然,批处理文件的编程能力与C语言等编程语句比起来是十分有限的,也是十分不规范的。批处理的程序语句就是一条条的DOS命令(包括内部命令和外部命令),而批处理的能力主要取决于你所使用的命令。 第三,每个编写好的批处理文件都相当于一个DOS的外部命令,你可以把它所在的目录放到你的DOS搜索路径(path)中来使得它可以在任意位置运行。一个良好的习惯是在硬盘上建立一个bat或者batch目录(例如C:\BATCH),然后将所有你编写的批处理文件放到该目录中,这样只要在path中设置上c:\batch,你就可以在任意位置运行所有你编写的批处理程序。 第四,在DOS和Win9x/Me系统下,C:盘根目录下的AUTOEXEC.BAT批处理文件是自动运行批处理文件,每次系统启动时会自动运行该文件,你可以将系统每次启动时都要运行的命令放入该文件中,例如设置搜索路径,调入鼠标驱动和磁盘缓存,设置系统环境变量等。下 面是一个运行于Windows 98下的autoexec.bat的示例: ? 1 2 3 4 5 6 7 @ECHOOFF PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\UCDOS;C:\DOSTools;C:\SYSTOOLS;C:\WINTOOLS;C:\B LH SMARTDRV.EXE /X LH https://www.wendangku.net/doc/9a8474115.html, /INSERT LH CTMOUSE.EXE SETTEMP=D:\TEMP SETTMP=D:\TEMP 批处理的作用 简单的说,批处理的作用就是自动的连续执行多条命令。 这里先讲一个最简单的应用:在启动wps软件时,每次都必须执行(>前面内容表示DOS

如何制作红头文件

办公文秘人员必须掌握的电脑技巧 如何制作红头文件 一、红头文件的制作及标准 1、进行页面设置 选择“文件”——“页面设置”选择“页边距”附签,上:3.7厘米下:3.5厘米左:2.8厘米右:2.6厘米。选择“版式”附签,将“页眉和页脚”设置成“奇偶页不同”,在该选项前打“√”。选择“文档网格”附签,“字体设置”,“中文字体”设置为“仿宋”;“字号”设置成“三号”,单击“确定”按钮,选中“指定行网格和字符网格”;将“每行”设置成“28”个字符;“每页”设置成“22”行。然后单击“确定”按钮,这样就将版心设置成了以三号字为标准、每页22行、每行28个汉字的国家标准。 2、插入页号 选择“插入”——“页码”,“位置”设置为“页面底端(页脚)”,“对齐方式”设置为“外侧”。然后单击“格式”按钮,“数字格式”设置为全角的显示格式,单击“确定”按钮,再次单击“确定”按钮完成页码设置。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设置成“四号”;字体任意;奇数页的页码设置成右空一个汉字,偶数页的页码设置成左空一个汉字。

3、发文机关标识制作 选择“插入”——“文本框”——“横排”菜单项,鼠标将会变成“┼”,在Word 2000版面上单击鼠标左键,出现一个文本框,在该文本框内输入发文机关标识,输入完成后,选中该文本框,单击鼠标右键——“设置文本框格式”,在这里来设置红头的属性。 选择“颜色和线条”附签,“颜色”设置成“无填充颜色”。选择“大小”附签,“高度”设置成“2cm”;宽度设置成“15.5cm”。注:用户可根据实际情况调节尺寸。选择“版式”附签,单击“高级”按钮,水平对齐:“对齐方式”设置成“居中”,“度量依据”设置成“页面”;垂直对齐:“绝对位置”设置成“页边距”,“下侧”设置成“2.5cm”——平行文标准,“8.0cm”——上行文标准,注:用户可根据实际情况调节尺寸。然后单击“确定”。 选择“文本框”附签,左、右、上、下都设置成“0cm”,单击“确定”完成。文本框属性全部设置完成,单击“确定”按钮。选中文本框内的全部文字,将颜色设置成“红色”,字体设置成“小标宋简体”,字号根据文本框的大小设置成相应字号,但要尽量充满该文本框,这样,宽为155mm、高为20mm、距上25mm的红头制作完成。 4、红线制作 首先将“视图”——“工具栏”——“绘图”选中,单击“绘图”工具条的直线工具,鼠标会变成“十”字形,左手按住键盘上的Shift键,右手拖动鼠标从左到右划一条水平线,然后选中直线单击鼠标右键,选择

一键清理系统垃圾,清理系统垃圾bat

一键清理系统垃圾 制作bat文件达到一键清理系统垃圾的目的 步骤: 1、新建一个记事本; 2、将以下红线中间部分代码复制进去; --------------------------------------------------------------------------- @echo off echo LYG提示:正在清理系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" --------------------------------------------------------------------------- 3、将该记事本文件另存为所有文件、名称填写“清理垃圾.bat”。看图 4、双击运行“清理垃圾.bat”就能开始自动清理系统垃圾了。全自动的,清理完毕会自动退出。

windows批处理文件(.bat&)

bat是dos下的批处理文件 .cmd是nt内核命令行环境的另一种批处理文件 从更广义的角度来看,unix的shell脚本以及其它操作系统甚至应用程序中由 外壳进行解释执行的文本,都具有与批处理文件十分相似的作用,而且同样是 由专用解释器以行为单位解释执行,这种文本形式更通用的称谓是脚本语言。 所以从某个程度分析,batch, unix shell, awk, basic, perl 等脚本语言都 是一样的,只不过应用的范围和解释的平台各有不同而已。甚至有些应用程序 仍然沿用批处理这一称呼,而其内容和扩展名与dos的批处理却又完全不同。 =================================== 首先批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部 分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批 处理文件。 ==== 注 =================== 批处理文件中完全可以使用非dos命令,甚至可以使用不具有可执行特性的普 通数据性文件,这缘于windows系统这个新型解释平台的涉入,使得批处理的 应用越来越"边缘化"。所以我们讨论的批处理应该限定在dos环境或者命令行 环境中,否则很多观念和设定都需要做比较大的变动。 ======================== 其次,批处理文件是一种简单的程序,可以通过条件语句(if)和流程控制语句(goto)来控制命令运行的流程,在批处理中也可以使用循环语句(for)来循环执行一条命令。当然,批处理文件的编程能力与C语言等编程语句比起来是十分 有限的,也是十分不规范的。批处理的程序语句就是一条条的DOS命令(包括 内部命令和外部命令),而批处理的能力主要取决于你所使用的命令。 ==== 注 ================== 批处理文件(batch file)也可以称之为批处理程序(batch program),这一点与编译型语言有所不同,就c语言来说,扩展名为c或者cpp的文件可以称之为 c语言文件或者c语言源代码,但只有编译连接后的exe文件才可以称之为c 语言程序。因为批处理文件本身既具有文本的可读性,又具有程序的可执行性,这些称谓的界限是比较模糊的。 =========================== 第三,每个编写好的批处理文件都相当于一个DOS的外部命令,你可以把它所 在的目录放到你的DOS搜索路径(path)中来使得它可以在任意位置运行。一个

的制作红头文件及方法

word的制作红头文件及方法 一、基本设置 1、进行页面设置 选择“文件”——“页面设置”选择“页边距”附签,上:厘米下:厘米左:厘米右:厘米。选择“版式”附签,将“页眉和页脚”设置成“奇偶页不同”,在该选项前打“√”。选择“文档网格”附签,“字体设置”,“中文字体”设置为“仿宋”;“字号”设置成“三号”,单击“确定”按钮,选中“指定行网格和字符网格”;将“每行”设置成“28”个字符;“每页”设置成“22”行。然后单击“确定”按钮,这样就将版心设置成了以三号字为标准、每页22行、每行28个汉字的国家标准。 2、插入页号 选择“插入”——“页码”,“位置”设置为“页面底端(页脚)”,“对齐方式”设置为“外侧”。然后单击“格式”按钮,“数字格式”设置为全角的显示格式,单击“确定”按钮,再次单击“确定”按钮完成页码设置。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设置成“四号”;字体任意;奇数页的页码设置成右空一个汉字,偶数页的页码设置成左空一个汉字。 3、发文机关标识制作 选择“插入”——“文本框”——“横排”菜单项,鼠标将会

变成“┼”,在Word 2000版面上单击鼠标左键,出现一个文本框,在该文本框内输入发文机关标识,输入完成后,选中该文本框,单击鼠标右键——“设置文本框格式”,在这里来设置红头的属性。 选择“颜色和线条”附签,“颜色”设置成“无填充颜色”。选择“大小”附签,“高度”设置成“2cm”;宽度设置成“”。注:用户可根据实际情况调节尺寸。选择“版式”附签,单击“高级”按钮,水平对齐:“对齐方式”设置成“居中”,“度量依据”设置成“页面”;垂直对齐:“绝对位置”设置成“页边距”,“下侧”设置成“”——平行文标准,“”——上行文标准,注:用户可根据实际情况调节尺寸。然后单击“确定”。 选择“文本框”附签,左、右、上、下都设置成“0cm”,单击“确定”完成。文本框属性全部设置完成,单击“确定”按钮。选中文本框内的全部文字,将颜色设置成“红色”,字体设置成“小标宋简体”,字号根据文本框的大小设置成相应字号,但要尽量充满该文本框,这样,宽为155mm、高为20mm、距上25mm的红头制作完成。 4、红线制作 首先将“视图”——“工具栏”——“绘图”选中,单击“绘图”工具条的直线工具,鼠标会变成“十”字形,左手按住键盘上的Shift键,右手拖动鼠标从左到右划一条水平线,然后选中直线单击鼠标右键,选择“设置自选图形格式”,红线的属性在这里进行设置。选择“颜色和线条”附签,“颜色”设置为“红色”;“虚

如何编写bat文件

如何编写bat文件 第一节:(主要是一些界面形式功能的实现以及初始化) 1.“@echo off”--我们所写的BAT一开始一般都有这一句,这一句的作用是:使所有的命令响应隐藏。“@”--本行命令不回显 。(本来如果你用echo off就可以了,但是还是能够看到echo off这条命令在CMD下, 影响美观) 2.“color 1e”--设置默认的控制台前景和背景颜色。当前我设为蓝底黄字,具体颜色请在CMD下用“color /?”查询。 --这里又提到了这个参数“/?”,一般CMD下命令后加“/?”就会显示这条命令的帮助。 3.“rem”--注释作用,批处理执行过程中前不执行它,rem 后的字符只作注释作用。 4.“title”--设置命令提示窗口的窗口标题。默认为“cmd”。改成自己喜欢的多有个性,嘿嘿。 5.“cls”--不多说,清屏命令。主要是怕前面的一些空白或字符出现影响美观。 6.“set”--这个命令的作用很大,请用“set /?”查询具体使用方法。本例“settopip=172.16.”是 将一个名为“topip”的变量值设为“172.16.”。注意CMD下变量的设置不区别数字与字符, 能够自动根据提供的值调整。下行“settheip=0.0”同理。 7.“echo .”--在新行中显示一个“.”。echo命令能显示其后的comment。这里提几个有趣实用的用法--“echo.”,注意与前面的不同,“echo”与“.”间无空格。这条命令如同一个回车,在 新行不显示任何信息并换行。“echo ”,实现响铃的提示音。后面一个字符的输入方法是 在CMD下用“ctrl+G”,而这个字符得到的方法是CMD下用命令“echo "ctrl+G" >ex.txt”, 存入ex.txt文件,再从那里提取出来的。嘿嘿,如果你懒得做,就copy我在上面提供的 字符喽。 8.“if”--这条命令也会经常用到,请用“if /?”学习更多信息。本例“if not exist scanipc.exe (echo 文件错误!……)”,实现功能:当同级目录下不存在“scanipc.exe”时,提示“文件错误!……”。否则不提示。“if not exist filename”在批处理中使用比较多些。 9.“:top”,设置一个标志点,标志名为“top”。“:”的作用就是设置标志。网上有文章说“使用"::comment"作为注释比"rem comment"执行效率更高。”我相信,这里也建议大家,如果BAT中注释较多时,请使用“::comment”设置。 10.“set /p pno=”--设置一个变量,并接受用户输入。BAT不需要预先声明变量,只在需要 时设置。参数“/p”:将变量数值设成用户输入的一行输入。 11.“if %pno% gtr 9 gotoonerrorspno”--检验用户输入值是否大于9,是,则转到一个指定标 志点。这里注意BAT中变量引用时要在前后加“%”,但在if语句中可有可无,具体应用 大家多写几遍就有体会。 12.“goto label”--无条件跳转到指定标志位并向后执行。BAT好像只有这么一个跳转语句了,作用不用我说,用了就知道。注意不要构成死循环。

红头文件制作及标准

公文规范有关知识 一、公文的种类 1、决议; 2、决定; 3、命令; 4、公报; 5、公告; 6、通告; 7、意见; 8、通知; 9、通报;10、报告;11、请示; 12、批复;13、议案;14、函;15、纪要 二、红头文件的制作及标准 1、页面设置 选择“文件”——“页面设置”选择“页边距”附签,上:3.7厘米下:3.5厘米左:2.8厘米右:2.6厘米。选择“版式”附签,将“页眉和页脚”设置成“奇偶页不同”,在该选项前打“√”。选择“文档网格”附签,“字体设置”,“中文字体”设置为“仿宋”;“字号”设置成“三号”,单击“确定”按钮,选中“指定行网格和字符网格”;将“每行”设置成“28”个字符;“每页”设置成“22”行,然后单击“确定”按钮。 2、插入页号选择“插入”——“页码”,“位置”设置为“页面底端(页脚)”,“对齐方式”设置为“外侧”。然后单击“格式”按钮,“数字格式”设置为全角的显示格式,单击“确定”按钮,再次单击“确定”按钮完成页码设置。双击页码,在页码两边各加上一条全角方式的短线;并将页码字号设置成“四号”;奇数页的页码设置成右空一个汉字,偶数页的页码设置成左空一个汉字。

. 3、文号制作 平行文文号:文号——三号仿宋、居中显示。 上行文文号:文号——三号仿宋字体、左空一个字的距离;签发人——三号仿宋字体;签发人姓名——三号楷体、右空一个字的距离。 (注:文号一定要使用六角符号〔〕。) 4、版记制作 选择“表格”——“插入”——“表格”,选中表格,单击鼠标右键——表格属性——“表格”附签,“对齐方式”设置为“居中”;然后单击“边框和底纹”按钮,在“预览”窗口中将每行的下线选中,其它线取消。 5、保存成模板文件 单击“文件”——“另存为”,“保存类型”:选择“文档模板(*.dot)”;“文件名”:给模板命名;“保存位置”:模板所在路径(一般不做,默认即可)。以后所有属于此种类型的公文都可以调用该模板,直接进行公文正文的排版。要对该模板进行修改,可以调出相应模板,方法是:选择“文件”——“打开”,找到相应的模板路径,若模板保存时按系统默认设置的,然后单击“打开”按钮调出模板即可进行修改。 三、公文排版 1、标题:一般用20号方正小标宋简体,编排在红色分隔线下空二行位置,分一行或多行居中排布;回行时,要做到词意完整,排列对称,长短适宜,间距恰当,标题排列应

一键清理系统垃圾[1].bat__超级一键删除垃圾.bat__高郊级一键清理C盘垃圾.bat

文章由情难枕精心整理,希望对大家的学习和工作带来帮助 @echo off echo ----------------------------------------------------------------------------- echo 清空IE临时文件目录... del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" echo 正在清除系统临时文件 *.tmp *._tmp *.log *.chk *.old ,请稍等... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp rem .log大部分有可能有用 rem del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid

del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old echo 清空垃圾箱,备份文件和预缓存脚本... del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp rem cooke和最近历史还是保留吧... rem del /f /q %userprofile%\COOKIES s\*.* rem del /f /q %userprofile%\recent\*.* echo 清理系统盘无用文件... %windir%\system32\sfc.exe /purgecache echo 优化预读信息... %windir%\system32\defrag.exe %systemdrive% -b echo 清除系统完成! echo -----------------------------------------------------------------------------

bat批处理文件

批处理文件bat 语法备忘 需要用到的脚本语言还真是多,从系统管理、数据管理、程序开发。脚本语言的影子真是无处不在,孱弱的windows上的可怜的bat也是不得不时常备忘得东东。现在渐渐习惯了把一些零碎的需要整理的文档放在writely上面,即方便自己移动处理文档,还可以跟他们协作或者讨论之用。而且能支持word文档的直接导入,之前用的时候稳定性不很理想,有发生过几次文件不能保存或者保存了无效的问题,发信给他们管理员,倒是很快得到了答复和解决。最近用的时候才发现出现了下列的文字。Writely is now part of Google! 看来有钱就是好啊,想买啥就买啥。估计用不了多久,google也会变成跟ms一样被骂得对象了。没办法,有钱的,横看竖看都是一副欠扁的样。好了,切入正题,把google借来的文章先放着自己备用!:) 扩展名是bat(在nt/2000/xp/2003下也可以是cmd)的文件就是批处理文件。 ==== 注======================================= .bat是dos下的批处理文件 .cmd是nt内核命令行环境的另一种批处理文件 从更广义的角度来看,unix的shell脚本以及其它操作系统甚至应用程序中由外壳进行解释执行的文本,都具有与批处理文件十分相似的作用,而且同样是由专用解释器以行为单位解释执行,这种文本形式更通用的称谓是脚本语言。所以从某个程度分析,batch, unix shell, awk, basic, perl 等脚本语言都是一样的,只不过应用的范围和解释的平台各有不同而已。甚至有些应用程序仍然沿用批处理这一称呼,而其内容和扩展名与dos的批处理却又完全不同。 =================================== 首先批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。 ==== 注=================== 批处理文件中完全可以使用非dos命令,甚至可以使用不具有可执行特性的普通数据性文件,这缘于windows系统这个新型解释平台的涉入,使得批处理的应用越来越"边缘化"。所以我们讨论的批处理应该限定在dos环境或者命令行环境中,否则很多观念和设定都需要做比较大的变动。 ======================== 其次,批处理文件是一种简单的程序,可以通过条件语句(if)和流程控制语句(goto)来控制命令运行的流程,在批处理中也可以使用循环语句(for)来循环执行一条命令。当然,批处理文件的编程能力与C语言等编程语句比起来是十分有限的,也是十分不规范的。批处理的程序语句就是一条条的DOS命令(包括内部命令和外部命令),而批处理的能力主要取决于你所使用的命令。 ==== 注==================

bat命令大全 清理系统垃圾更简单

1.Echo 命令 打开回显或关闭请求回显功能,或显示消息。如果没有任何参数,echo 命令将显示当前回显设置。 语法 echo [{on|off}] [message] Sample:echo off / echo hello world 在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。 2.@ 命令 表示不显示@后面的命令,在入侵过程中(例如使用批处理来格式化敌人的硬盘)自然不能让对方看到你使用的命令啦。 Sample:@echo off @echo Now initializing the program,please wait a minite... @format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的,可喜的是微软留了个autoset这个参数给我们,效果和/y是一样的。) 3.Goto 命令 指定跳转到标签,找到标签后,程序将处理从下一行开始的命令。 语法:goto label (label是参数,指定所要转向的批处理程序中的行。) Sample: if {%1}=={} goto noparms if {%2}=={} goto noparms(如果这里的if、%1、%2你不明白的话,先跳过去,后面会有详细的解释。) @Rem check parameters if null show usage :noparms echo Usage: monitor.bat ServerIP PortNumber goto end 标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。 4.Rem 命令 注释命令,在C语言中相当与/*--------*/,它并不会被执行,只是起一个注释的作用,便于别人阅读和你自己日后修改。 Rem Message Sample:@Rem Here is the description. 5.Pause 命令 运行Pause 命令时,将显示下面的消息: Press any key to continue . . . Sample: @echo off

相关文档
相关文档 最新文档