2.4n/M 25cm等于多少英寸n

你好,采购会员
采购会员中心
采购经理常用工具
扫一扫 关注工厂网
采购需求发布后
一个小时行业专家响应
每一个报价单
覆盖专家分析和优质供应商报价
每一个采购需求
至少10个优质供应商回应
95%以上的采购需求
收获了合适的供应商
供米格伺服电机80ST-M0W 2.4N 机械手自动化专用
品牌:杭州米格
型号:80ST-M02430
额定电压:220(V) V
产品认证:CCC CE
产品类型:永磁同步电动机
极数:橙色
额定功率:750W
额定转速:3000(rpm)
“供米格伺服电机80ST-M0W 2.4N 机械手自动化专用”的详细描述:
因为您的浏览器禁止了java脚本,请您在地址栏输入//202.120.95.235,然后按回车键。
温馨提示: 以上是关于供米格伺服电机80ST-M0W 2.4N 机械手自动化专用的详细介绍, 产品由东莞市旭隆工控设备有限公司为您提供,如果您对东莞市旭隆工控设备有限公司产品信息感兴趣可以
或者 ,您也可以查看更多与供米格伺服电机80ST-M0W 2.4N 机械手自动化专用相关的产品!
品牌:杭州米格
型号:80ST-M02430
额定电压:220(V) V
产品认证:CCC CE
产品类型:永磁同步电动机
极数:橙色
额定功率:750W
额定转速:3000(rpm)
应用范围:机械设备类
黄清南先生
联系我时务必告知是在世界工厂网上看到的
地址:广东省东莞市
86-9传真:86-9
快速获取联系方式
扫一下快速获取该企业联系方式
推荐使用 微信 我查查 等扫码工具
扫描后可直接保存为手机联系人(推荐)
本企业推荐
热门产品推荐:
相关产品推荐
| | | | | |您好!请&&或&CLOC -- Count Lines of Code
cloc is now being
developed at
perl -MCPAN -e shell
cpan> install PAR::Packer
cpan> exit
C:> pp cloc-1.64.pl
A variation on the above is if you installed the portable version
of Strawberry Perl, you will need to run portableshell.bat
first to properly set up your environment.
The Strawberry Perl
derived executable on the SourceForge download area was created
with the portable version on a Windows 7 computer.
cloc is a command line program that takes file, directory, and/or archive
names as inputs.
Here's an example of running cloc against
the Perl v5.10.0 source distribution:
prompt& cloc perl-5.10.0.tar.gz
4076 text files.
3883 unique files.
1521 files ignored.
http://cloc.sourceforge.net v 1.50
T=12.0 s (209.2 files/s, 70472.1 lines/s)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
To run cloc on Windows computers, one must first open up a command
(aka DOS) window and invoke cloc.exe from the command line there.
prompt& cloc
Usage: cloc [options] &file(s)/dir(s)& | &set 1& &set 2& | &report files&
Count, or compute differences of, physical lines of source code in the
given files (may be archives such as compressed tarballs or zip files)
and/or recursively below the given directories.
Input Options
--extract-with=&cmd&
This option is only needed if cloc is unable
to figure out how to extract the contents of
the input file(s) by itself.
Use &cmd& to extract binary archive files (e.g.:
.tar.gz, .zip, .Z).
Use the literal '&FILE&' as
a stand-in for the actual file(s) to be
extracted.
For example, to count lines of code
in the input files
gcc-4.2.tar.gz
perl-5.8.8.tar.gz
on Unix use
--extract-with='gzip -dc &FILE& | tar xf -'
or, if you have GNU tar,
--extract-with='tar zxf &FILE&'
and on Windows use, for example:
--extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o &FILE& ."
(if WinZip is installed there).
--list-file=&file&
Take the list of file and/or directory names to
process from &file&, which has one file/directory
name per line.
Only exact
relative path names will be resolved starting from
the directory where cloc is invoked.
See also --exclude-list-file.
Check binary files to see if they contain Unicode
expanded ASCII text.
This causes performance to
drop noticably.
Processing Options
--autoconf
Count .in files (as processed by GNU autoconf) of
recognized languages.
Report results for every source file encountered.
--by-file-by-lang
Report results for every source file encountered
in addition to reporting by language.
--count-and-diff &set1& &set2&
First perform direct code counts of source file(s)
of &set1& and &set2& separately, then perform a diff
Inputs may be pairs of files, directories,
or archives.
See also --diff, --diff-alignment,
--diff-timeout, --ignore-case, --ignore-whitespace.
--diff &set1& &set2&
Compute differences in code and comments between
source file(s) of &set1& and &set2&.
The inputs
may be pairs of files, directories, or archives.
Use --diff-alignment to generate a list showing
which file pairs where compared.
--count-and-diff, --diff-alignment, --diff-timeout,
--ignore-case, --ignore-whitespace.
--diff-timeout &N&
Ignore files which take more than &N& seconds
to process.
Default is 10 seconds.
(Large files with many repeated lines can cause
Algorithm::Diff::sdiff() to take hours.)
--follow-links
[Unix only] Follow symbolic links to directories
(sym links to files are always followed).
--force-lang=&lang&[,&ext&]
Process all files that have a &ext& extension
with the counter for language &lang&.
example, to count all .f files with the
Fortran 90 counter (which expects files to
end with .f90) instead of the default Fortran 77
counter, use
--force-lang="Fortran 90",f
If &ext& is omitted, every file will be counted
with the &lang& counter.
This option can be
specified multiple times (but that is only
useful when &ext& is given each time).
See also --script-lang, --lang-no-ext.
--force-lang-def=&file&
Load language processing filters from &file&,
then use these filters instead of the built-in
languages which map to the same
file extension (for example:
MATLAB/Objective C/MUMPS/M
Pascal/PHP;
Lisp/OpenCL; Lisp/J Perl/Prolog) will be
ignored as these require additional processing
that is not expressed in language definition
Use --read-lang-def to define new
language filters without replacing built-in
filters (see also --write-lang-def).
--ignore-whitespace
Ignore horizontal white space when comparing files
with --diff.
See also --ignore-case.
--ignore-case
Ig consider upper- and lower-
case letters equivalent when comparing files with
See also --ignore-whitespace.
--lang-no-ext=&lang&
Count files without extensions using the &lang&
This option overrides internal logic
for files without extensions (where such files
are checked against known scripting languages
by examining the first line for #!).
--force-lang, --script-lang.
--max-file-size=&MB&
Skip files larger than &MB& megabytes when
traversing directories.
By default, &MB&=100.
cloc's memory requirement is roughly twenty times
larger than the largest file so running with
files larger than 100 MB on a computer with less
than 2 GB of memory will cause problems.
this check does not apply to files
explicitly passed as command line arguments.
--read-binary-files
Process binary files in addition to text files.
This is usually a bad idea and should only be
attempted with text files that have embedded
binary data.
--read-lang-def=&file&
Load new language processing filters from &file&
and merge them with those already known to cloc.
If &file& defines a language cloc already knows
about, cloc's definition will take precedence.
Use --force-lang-def to over-ride cloc's
definitions (see also --write-lang-def ).
--script-lang=&lang&,&s&
Process all files that invoke &s& as a #!
scripting language with the counter for language
For example, files that begin with
#!/usr/local/bin/perl5.8.8
will be counted with the Perl counter by using
--script-lang=Perl,perl5.8.8
The language name is case insensitive but the
name of the script language executable, &s&,
must have the right case.
This option can be
specified multiple times.
See also --force-lang,
--lang-no-ext.
--sdir=&dir&
Use &dir& as the scratch directory instead of
letting File::Temp chose the location.
written to this location are not removed at
the end of the run (as they are with File::Temp).
--skip-uniqueness
Skip the file uniqueness check.
This will give
a performance boost at the expense of counting
files with identical contents multiple times
(if such duplicates exist).
--stdin-name=&file&
Give a file name to use to determine the language
for standard input.
--strip-comments=&ext&
For each file processed, write to the current
directory a version of the file which has blank
lines and comments removed.
The name of each
stripped file is the original file name with
.&ext& appended to it.
It is written to the
current directory unless --original-dir is on.
--original-dir
[Only effective in combination with
--strip-comments]
Write the stripped files
to the same directory as the original files.
--sum-reports
Input arguments are report files previously
created with the --report-file option.
a cumulative set of results containing the
sum of data from the individual report files.
Override the operating system autodetection
logic and run in UNIX mode.
--windows, --show-os.
Override the operating system autodetection
logic and run in Microsoft Windows mode.
See also --unix, --show-os.
Filter Options
--exclude-dir=&D1&[,D2,]
Exclude the given comma separated directories
D1, D2, D3, et cetera, from being scanned.
--exclude-dir=.cache,test
all files that have /.cache/ or /test/ as part
of their path.
Directories named .bzr, .cvs, .hg, .git, and
.svn are always excluded.
--exclude-ext=&ext1&[,&ext2&[...]]
Do not count files having the given file name
extensions.
--exclude-lang=&L1&[,L2,] Exclude the given comma separated languages
L1, L2, L3, et cetera, from being counted.
--exclude-list-file=&file&
Ignore files and/or directories whose names
appear in &file&.
&file& should have one file
name per line.
Only exact
relative path names will be resolved starting from
the directory where cloc is invoked.
See also --list-file.
--include-lang=&L1&[,L2,] Count only the given comma separated languages
L1, L2, L3, et cetera.
--match-d=&regex&
Only count files in directories matching the Perl
For example
--match-d='/(src|include)/'
only counts files in directories containing
/src/ or /include/.
--not-match-d=&regex&
Count all files except those in directories
matching the Perl regex.
--match-f=&regex&
Only count files whose basenames match the Perl
For example
--match-f='^[Ww]idget'
only counts files that start with Widget or widget.
--not-match-f=&regex&
Count all files except those whose basenames
match the Perl regex.
--skip-archive=&regex&
Ignore files that end with the given Perl regular
expression.
For example, if given
--skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)'
the code will skip files that end with .zip,
.tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
--skip-win-hidden
On Windows, ignore hidden files.
Debug Options
--categorized=&file&
Save names of categorized files to &file&.
--counted=&file&
Save names of processed source files to &file&.
--explain=&lang&
Print the filters used to remove comments for
language &lang& and exit.
In some cases the
filters refer to Perl subroutines rather than
regular expressions.
An examination of the
source code may be needed for further explanation.
--diff-alignment=&file&
Write to &file& a list of files and file pairs
showing which files were added, removed, and/or
compared during a run with --diff.
This switch
forces the --diff mode on.
Print this usage information and exit.
--found=&file&
Save names of every file found to &file&.
--ignored=&file&
Save names of ignored files and the reason they
were ignored to &file&.
--print-filter-stages
Print processed source code before and after
each filter is applied.
--show-ext[=&ext&]
Print information about all known (or just the
given) file extensions and exit.
--show-lang[=&lang&]
Print information about all known (or just the
given) languages and exit.
Print the value of the operating system mode
See also --unix, --windows.
Verbose switch (optional numeric value).
Print the version of this program and exit.
--write-lang-def=&file&
Writes to &file& the language processing filters
then exits.
Useful as a first step to creating
custom language definitions (see also
--force-lang-def, --read-lang-def).
Output Options
Print third-generation language output.
(This option can cause report summation to fail
if some reports were produced with this option
while others were produced without it.)
--by-percent
Instead of comment and blank line counts, show
these values as percentages based on the value
of X in the denominator:
-& # lines of code
-& # lines of code + comments
-& # lines of code + blanks
X = 'cmb' -& # lines of code + comments + blanks
For example, if using method 'c' and your code
has twice as many lines of comments as lines
of code, the value in the comment column will
The code column remains a line count.
Write the results as comma separated values.
--csv-delimiter=&C&
Use the character &C& as the delimiter for comma
separated files instead of ,.
This switch forces
--out=&file&
Synonym for --report-file=&file&.
--csv to be on.
--progress-rate=&n&
Show progress update after every &n& files are
processed (default &n&=100).
Set &n& to 0 to
suppress progress output (useful when redirecting
output to STDOUT).
Suppress all information messages except for
the final report.
--report-file=&file&
Write the results to &file& instead of STDOUT.
--sql=&file&
Write results as SQL create and insert statements
which can be read by a database program such as
If &file& is -, output is sent to STDOUT.
--sql-append
Append SQL insert statements to the file specified
by --sql and do not generate table creation
statements.
Only valid with the --sql option.
--sql-project=&name&
Use &name& as the project identifier for the
current run.
Only valid with the --sql option.
--sql-style=&style&
Write SQL statements in the given style instead
of the default SQLite format.
Currently, the
only style option is Oracle.
For plain text reports, show the SUM: output line
even if only one input file is processed.
Write the results in XML.
--xsl=&file&
Reference &file& as an XSL stylesheet within
the XML output.
If &file& is 1 (numeric one),
writes a default stylesheet, cloc.xsl (or
cloc-diff.xsl if --diff is also given).
This switch forces --xml on.
Write the results in YAML.
prompt& cloc --show-lang
ActionScript
(ada, adb, ads, pad)
(ample, dofile, startup)
(build.xml)
Apex Trigger
Arduino Sketch
(ino, pde)
(asa, asp)
(asax, ascx, asmx, aspx, config, master, sitemap, webinfo)
(asm, s, S)
AutoHotkey
Bourne Again Shell
Bourne Shell
(c, ec, pgc)
(csh, tcsh)
(C, c++, cc, cpp, cxx, pcc)
C/C++ Header
(h, H, hh, hpp)
ClojureScript
(cmake, CMakeLists.txt)
(cbl, CBL, cob, COB)
CoffeeScript
ColdFusion
ColdFusion CFScript
(bat, BAT, btm, BTM, cmd, CMD)
(ERB, erb)
(erl, hrl)
Fortran 77
(f, F, f77, F77, for, FOR, FTN, ftn, pfo)
Fortran 90
(f90, F90)
Fortran 95
(f95, F95)
(gant, gradle, groovy)
Handlebars
(handlebars, hbs)
(cg, cginc, shader)
(htm, html)
IDL/Qt Project/Prolog
InstallShield
Javascript
JavaServer Faces
(jsf, xhtml)
(jsp, jspf)
Korn Shell
(el, lisp, lsp, sc)
Lisp/Julia
Lisp/OpenCL
LiveLink OScript
(am, gnumakefile, Gnumakefile, makefile, Makefile)
(pom, pom.xml)
(i3, ig, m3, mg)
MSBuild script
(csproj, vbproj, vcproj, wdproj, wixproj)
(mustache)
NAnt script
NASTRAN DMAP
Objective C
Objective C++
(ml, mli, mll, mly)
Oracle Forms
Oracle Reports
(dpr, p, pas)
Pascal/Puppet
Patran Command Language
(pcl, ses)
(perl, plh, plx, pm)
Perl/Prolog
(php, php3, php4, php5)
PHP/Pascal
PowerShell
Protocol Buffers
PureScript
(rkt, rktl, sch, scm, scrbl, ss)
RobotFramework
(robot, tsv)
(rake, rb)
(sass, scss)
(smarty, tpl)
Softbridge Basic
(sbl, SBL)
(psql, sql, SQL)
(data.sql)
SQL Stored Procedure
(spc.sql, spoc.sql, sproc.sql, udf.sql)
Standard ML
(fun, sig, sml)
(itk, tcl, tk)
Teamcenter met
Teamcenter mth
Titanium Style Sheet
TypeScript
Unity-Prefab
(mat, prefab)
Vala Header
Velocity Template Language (vm)
Verilog-SystemVerilog
(sv, svh, v)
(VHD, vhd, vhdl, VHDL)
vim script
Visual Basic
(bas, cls, ctl, dsr, frm, VB, vb, VBA, vba, vbs, VBS)
Visual Fox Pro
(sca, SCA)
Visualforce Component
(component)
Visualforce Page
Windows Message File
Windows Module Definition
Windows Resource File
WiX include
WiX source
WiX string localization
xBase Header
(XML, xml)
(xq, xquery)
(xsd, XSD)
(xsl, XSL, xslt, XSLT)
(yaml, yml)
The above list can be customized by reading language definitions
from a file with the
--read-lang-def
--force-lang-def
Eight file extensions have multiple language mappings:
.cl files could be Lisp or OpenCL
.inc files could be PHP or Pascal
.jl files could be Lisp or Julia
.m files could be MATLAB, Mercury, MUMPS, or Objective C
.p files could be D or dtrace
.pl files could be Perl or Prolog
.pp files could be Pascal or Puppet
.pro files could be IDL, Prolog, or a Qt Project
cloc has subroutines
that attempt to identify the correct language
based on the file's contents for these special cases.
Language identification
accuracy is a function of how much co .m
files with just one or two lines for example, seldom have enough
information to correctly distinguish between MATLAB, Mercury,
MUMPS, or Objective C.
Languages with file extension collisions are difficult to
customize with --read-lang-def or
--force-lang-def as they have no mechanism
to identify languages with common extensions.
situation one must modify the cloc source code.
cloc's method of operation resembles SLOCCount's:
First, create
a list of files to consider.
Next, attempt to determine whether or not
found files contain recognized computer language source code.
for files identified as source files, invoke language-specific routines
to count the number of source lines.
A more detailed description:
If the input file is an archive (such as a .tar.gz or
.zip file), create a temporary directory and expand the
archive there
using a system call to an appropriate underlying utility (tar,
bzip2, unzip, etc) then add this temporary directory
as one of the inputs.
(This works more reliably on Unix than on
Use File::Find to recursively descend the input directories and
make a list of candidate file names.
Ignore binary and zero-sized files.
Make sure the files in the candidate list have unique contents
(first by comparing file sizes, then, for similarly sized files,
compare MD5 hashes of the file contents with Digest::MD5).
For each set of identical files, remove all but the first copy,
as determined by a lexical sort, of identical files from the set.
The removed files are not included in the report.
(The --skip-uniqueness switch disables the uniqueness
tests and forces all copies of files to be included in the report.)
See also the --ignored= switch to see which files
were ignored and why.
Scan the candidate file list for
file extensions which cloc associates with programming languages
and --show-ext options).
Files which match are
classified as containing source code for that language.
Each file without an extensions is opened and its first
line read to see
if it is a Unix shell script (anything that begins with #!).
If it is shell script, the file is classified by that scripting
language (if the language is recognized).
If the file does not
have a recognized extension or is not a recognzied
scripting language, the file is ignored.
All remaining files in the candidate list should now be source
files for known programming languages.
For each of these files:
Read the entire file into memory.
Count the number of lines (= Loriginal).
Remove blank lines, then count again (= Lnon_blank).
Loop over the comment filters defined for
this language.
(For example, C++ has two filters:
(1) remove lines that start with optional whitespace
followed by //
(2) remove text between /* and */)
Apply each filter to the code to remove comments.
Count the left over lines (= Lcode).
Save the counts for this language:
blank lines = Loriginal - Lnon_blank
comment lines = Lnon_blank - Lcode
code lines = Lcode
The options modify the algorithm slightly.
--read-lang-def option for example allows the user to
read definitions of comment filters, known file extensions, and known
scripting languages from a file.
The code for this option is processed
between Steps 2 and 3.
How can you tell if cloc correctly identifies comments?
One way to convince yourself cloc is doing the right thing is to
use its --strip-comments option to
remove comments and blank lines from files, then compare the
stripped-down files to originals.
Let's try this out with the SQLite
a C file containing all code needed to build the SQLite library along
with a header file:
prompt& tar zxf sqlite-amalgamation-3.5.6.tar.gz
prompt& cd sqlite-3.5.6/
prompt& cloc --strip-comments=nc sqlite.c
1 text file.
1 unique file.
Wrote sqlite3.c.nc
0 files ignored.
http://cloc.sourceforge.net v 1.03
T=1.0 s (1.0 files/s, 82895.0 lines/s)
-------------------------------------------------------------------------------
3rd gen. equiv
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
The extention argument given to --strip-comments
here nc was used as an abbreviation for "no comments".
cloc removed over 31,000 lines from the file:
prompt& wc -l sqlite3.c sqlite3.c.nc
82895 sqlite3.c
50901 sqlite3.c.nc
133796 total
prompt& echo "82895 - 50901" | bc
We can now compare the orignial file,
sqlite3.c and the one stripped of comments,
sqlite3.c.nc with tools like diff or vimdiff and see
what exactly cloc considered comments and blank lines.
A rigorous proof that the stripped-down file contains the same C code
as the original is to compile these files and compare checksums of the
resulting object files.
First, the original source file:
prompt& gcc -c sqlite3.c
prompt& md5sum sqlite3.o
cce5f1a2ea27c7e44b2e
Next, the version without comments:
prompt& mv sqlite3.c.nc sqlite3.c
prompt& gcc -c sqlite3.c
prompt& md5sum sqlite3.o
cce5f1a2ea27c7e44b2e
cloc removed over 31,000 lines of comments and blanks but did not modify
the source code in any significant way since the resulting object file
matches the original.
Versions of cloc before v1.07 required an
--extract-with=&cmd& option to tell cloc how
to expand an archive file.
Beginning with v1.07 this is extraction is
attempted automatically.
At the moment the automatic extraction method works
reasonably well on Unix-type OS's for the following file types:
Some of these extensions work on Windows if one has WinZip installed
in the default location (C:\Program Files\WinZip\WinZip32.exe).
Additionally, with newer versions of WinZip, the
is needed f in this case one would invoke cloc with
something like
--extract-with="\"c:\Program Files\WinZip\wzunzip\" -e -o &FILE& ."
In situations where the automatic extraction fails, one can try the
--extract-with=&cmd&
option to count lines of code within tar files, Zip files, or
other compressed archives for which one has an extraction tool.
cloc takes the user-provided extraction command and expands the archive
to a temporary directory (created with File::Temp),
counts the lines of code in the temporary directory,
then removes that directory.
While not especially helpful when dealing
with a single compressed archive (after all, if you're going to type
the extraction command anyway why not just manually expand the archive?)
this option is handy for working with several archives at once.
For example, say you have the following source tarballs on a Unix machine
& perl-5.8.5.tar.gz
& Python-2.4.2.tar.gz
and you want to count all the code within them.
The command would be
cloc --extract-with='gzip -dc &FILE& | tar xf -' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
If that Unix machine has GNU tar (which can uncompress and extract in one step) the command can be shortened to
cloc --extract-with='tar zxf &FILE&' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
On a Windows computer with WinZip installed in c:\Program Files\WinZip the command would look like
cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o &FILE& ." perl-5.8.5.tar.gz Python-2.4.2.tar.gz
Java .ear files are Zip files that contain additional Zip
cloc can handle nested compressed archives without
difficulty--provided all such files are compressed and archived in the
Examples of counting a
Java .ear file in Unix and Windows:
Unix& cloc --extract-with="unzip -d . &FILE& " Project.ear
DOS& cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o &FILE& ." Project.ear
The --diff switch allows one to measure the relative change in
source code and comments between two versions of a file, directory,
or archive.
Differences reveal much more than absolute code
counts of two file versions.
For example, say a source file
has 100 lines and its developer delivers a newer version with
102 lines.
Did he add two comment lines, or delete seventeen source
lines and add fourteen source lines and five comment lines, or did he
do a complete rewrite, discarding all 100 original lines and
adding 102 lines of all new source?
The diff option tells how
many lines of source were added, removed, modified or stayed
the same, and how many lines of comments were added, removed,
modified or stayed the same.
In addition to file pairs, one can give cloc pairs of
directories, or pairs of file archives, or a file archive
and a directory.
cloc will try to align
file pairs within the directories or archives and compare diffs
for each pair.
For example, to see what changed between
GCC 4.4.0 and 4.5.0 one could do
cloc --diff gcc-4.4.0.tar.bz2
gcc-4.5.0.tar.bz2
Be prepared to wait a while fo the --diff
option runs much more slowly than an absolute code count.
To see how cloc aligns files between the two archives, use the
--diff-alignment option
cloc --diff-aligment=align.txt gcc-4.4.0.tar.bz2
gcc-4.5.0.tar.bz2
to produce the file align.txt which shows the file pairs as well
as files added and deleted.
The symbols == and != before each
file pair indicate if the files are identical (==)
or if they have different content (!=).
Here's sample output showing the difference between the Python 2.6.6 and 2.7
prompt& cloc --diff
Python-2.6.6.tar.bz2 Python-2.7.tar.bz2
3870 text files.
4130 text files.s
2177 files ignored.
Diff error (quoted comments?):
/tmp/4QAqkrHN7Z/Python-2.6.6/Mac/Modules/qd/qdsupport.py
Diff error (quoted comments?):
/tmp/LvStB1lQxd/Python-2.7/Mac/Modules/qd/qdsupport.py
http://cloc.sourceforge.net v 1.52
T=422.0 s (0.0 files/s, 0.0 lines/s)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
vim script
Visual Basic
NAnt scripts
Objective C
Bourne Shell
Teamcenter def
C/C++ Header
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Note the two errors for the file
Python-X/Mac/Modules/qd/qdsupport.py.
This file has Python docstrings (text between pairs of triple quotes) that
contain C comments.
cloc treats docstrings as comments and handles them
by first converting them to C comments, then using the C comment removing
regular expression.
Nested C comments yield erroneous results however.
There's also output for the language "(unknown)".
Files in this
category are non-source files and t their
presence is merely noted as having been removed, added, or modified.
cloc can write its language comment definitions to a file or can read
comment definitions from a file, overriding the built-in definitions.
This can be useful when you want to use cloc to count lines of a
language not yet included, to change association of file extensions
to languages, or to modify the way existing languages are counted.
The easiest way to create a custom language definition file is to
make cloc write its definitions to a file, then modify that file:
Unix& cloc --write-lang-def=my_definitions.txt
creates the file my_definitions.txt which can be modified
then read back in with either the --read-lang-def or
--force-lang-def option.
The difference between the options is
former merges language definitions from the given file in with
cloc's internal definitions with cloc'taking precedence
if there are overlaps.
The --force-lang-def option, on the
other hand, replaces cloc's definitions completely.
This option has a disadvantage in preventing cloc from counting
as these languages require additional logic that is not easily
expressed in a definitions file.
Unix& cloc --read-lang-def=my_definitions.txt
file1 file2 dir1 ...
Each language entry has four parts:
The language name starting in column 1.
One or more comment filters starting in column 5.
One or more filename extensions starting in column 5.
A 3rd generation scale factor starting in column 5.
This entry must be provided
but its value is not important
unless you want to compare your language to a hypothetical
third generation programming language.
A filter defines a method to remove comment text from the source file.
For example the entry for C++ looks like this
filter remove_matches ^\s*//
filter call_regexp_common C
extension C
extension cc
extension cpp
extension cxx
extension pcc
3rd_gen_scale 1.51
C++ has two filters:
first, remove lines that start with optional
whitespace and are followed by //.
Next, remove all C comments.
C comments are difficult to express
as regular expressions so a call is made to Regexp::Common to get the
appropriate regular expression to match C comments which are then removed.
A more complete discussion of the different filter options may appear
here in the future.
The output of cloc's
--write-lang-def option should provide enough examples
for motivated individuals to modify or extend cloc's language definitions.
If you manage multiple software projects you might be interested in
seeing line counts by project, not just by language.
Say you manage three software projects called MySQL, PostgreSQL, and SQLite.
The teams responsible for each of these projects run cloc on their
source code and provide you with the output.
For example MySQL team does
cloc --report-file=mysql-5.1.42.txt mysql-5.1.42.tar.gz
and provides you with the file mysql-5.1.42.txt.
The contents of the three files you get are
Unix& cat mysql-5.1.42.txt
http://cloc.sourceforge.net v 1.50
T=26.0 s (108.1 files/s, 65774.5 lines/s)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
Teamcenter def
Javascript
Bourne Again Shell
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Unix& cat sqlite-3.6.22.txt
http://cloc.sourceforge.net v 1.50
T=3.0 s (4.7 files/s, 53833.7 lines/s)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Bourne Shell
C/C++ Header
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Unix& cat postgresql-8.4.2.txt
http://cloc.sourceforge.net v 1.50
T=16.0 s (129.1 files/s, 64474.9 lines/s)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
Teamcenter def
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
While these three files are interesting, you also want to see
the combined counts from all projects.
That can be done with cloc's --sum_reports
Unix& cloc --sum-reports --report_file=databases mysql-5.1.42.txt
postgresql-8.4.2.txt
sqlite-3.6.22.txt
Wrote databases.lang
Wrote databases.file
The report combination produces two output files, one for sums by
programming language (databases.lang) and one by project
(databases.file).
Their contents are
Unix& cat databases.lang
http://cloc.sourceforge.net v 1.50
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
Teamcenter def
Javascript
Bourne Again Shell
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Unix& cat databases.file
----------------------------------------------------------------------------------
Report File
----------------------------------------------------------------------------------
mysql-5.1.42.txt
postgresql-8.4.2.txt
sqlite-3.6.22.txt
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Report files themselves can be summed together.
Say you also manage
development of Perl and Python and you want to keep track
of those line counts separately from your database projects.
create reports for Perl and Python separately:
cloc --report-file=perl-5.10.0.txt perl-5.10.0.tar.gz
cloc --report-file=python-2.6.4.txt Python-2.6.4.tar.bz2
then sum these together with
Unix& cloc --sum-reports --report_file=script_lang perl-5.10.0.txt python-2.6.4.txt
Wrote script_lang.lang
Wrote script_lang.file
Unix& cat script_lang.lang
http://cloc.sourceforge.net v 1.50
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
Teamcenter def
Objective C
vim script
NAnt scripts
Visual Basic
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Unix& cat script_lang.file
-------------------------------------------------------------------------------
Report File
-------------------------------------------------------------------------------
python-2.6.4.txt
perl-5.10.0.txt
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Finally, combine the combination files:
Unix& cloc --sum-reports --report_file=everything databases.lang script_lang.lang
Wrote everything.lang
Wrote everything.file
Unix& cat everything.lang
http://cloc.sourceforge.net v 1.50
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
C/C++ Header
Bourne Shell
Teamcenter def
Objective C
Javascript
vim script
Bourne Again Shell
NAnt scripts
Visual Basic
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Unix& cat everything.file
-------------------------------------------------------------------------------
Report File
-------------------------------------------------------------------------------
databases.lang
script_lang.lang
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Cloc can write results in the form of SQL table create and insert
statements for use
with relational database programs such as SQLite, MySQL,
PostgreSQL, Oracle, or Microsoft SQL.
Once the code count information is in a database,
the information can be interrogated and displayed in interesting ways.
A database created from cloc SQL output has two tables,
metadata and t:
& timestamp & &
& elapsed_s
& & & & & &
& & & & & &
& project & &
& language
& nComment
The metadata table contains information about when the cloc run
The --sql-append switch allows one to combine
each run adds a
row to the metadata table.
The code count information resides in table t.
Let's repeat the code count examples of Perl, Python, SQLite, MySQL and
PostgreSQL tarballs shown in the
example above, this time
using the SQL output options and the
database engine.
The --sql switch tells cloc to generate output in the form
of SQL table create and insert commands.
The switch takes
an argument of a file name to write these SQL statements into, or,
if the argument is 1 (numeric one), streams output to STDOUT.
Since the SQLite command line program, sqlite3, can read
commands from STDIN, we can dispense with storing SQL statements to
a file and use --sql 1 to pipe data directly into the
SQLite executable:
cloc --sql 1 --sql-project mysql mysql-5.1.42.tar.gz
| sqlite3 code.db
The --sql-project mysql there's no need
to specify a project name when working with just one code base.
since we'll be adding code counts from four other tarballs, we'll only
be able to identify data by input source if we supply a
project name for each run.
Now that we have a database we will need to pass in the
--sql-append switch to tell cloc not to wipe out this
database but instead add more data:
cloc --sql 1 --sql-project postgresql --sql-append postgresql-8.4.2.tar.bz2
| sqlite3 code.db
cloc --sql 1 --sql-project sqlite
--sql-append sqlite-amalgamation-3.6.22.tar.gz | sqlite3 code.db
cloc --sql 1 --sql-project python
--sql-append Python-2.6.4.tar.bz2
| sqlite3 code.db
cloc --sql 1 --sql-project perl
--sql-append perl-5.10.0.tar.gz
| sqlite3 code.db
Now the fun begins--we have a database, code.db, with lots of
information about the five projects and can begin querying it for all
manner of interesting facts.
Which is the longest file over all projects?
sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t where nL = (select max(nBlank+nComment+nCode) from t)'
sqlite|sqlite-3.6.22/sqlite3.c|110860
sqlite3's default output format leaves a bit to be desired.
We can add an option to the program's rc file, ~/.sqliterc,
to show column headers:
.header on
One might be tempted to also include
.mode column
in ~/.sqliterc
but this causes problems when the output has more than one row
since the widths of entries in the first row govern
the maximum width for all subsequent rows.
Often this leads
to truncated output--not at all desireable.
One option is to write a custom SQLite output formatter such
It is used like so:
sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t where nL = (select max(nBlank+nComment+nCode) from t)' | sqlite_formatter
Project File
_______ _______________________ ______
sqlite-3.6.22/sqlite3.c 110860
Note also that sqlite3 has an HTML output option, --html,
that might also prove useful.
Which is the longest file in each project?
& sqlite3 code.db 'select project,file,max(nBlank+nComment+nCode) as nL from t group by project order by nL;' | sqlite_formatter
__________ _____________________________________________ ______
perl-5.10.0/t/op/mkdir.t
Python-2.6.4/Lib/email/quoprimime.py
postgresql postgresql-8.4.2/contrib/pgcrypto/pgp-pgsql.c
mysql-5.1.42/netware/mysqldump.def
sqlite-3.6.22/config.sub
Which files in each project have the most code lines?
& sqlite3 code.db 'select project,file,max(nCode) as nL from t group by project order by nL' | sqlite_formatter
__________ _____________________________________________ _____
sqlite-3.6.22/config.sub
mysql-5.1.42/netware/mysqldump.def
postgresql postgresql-8.4.2/contrib/pgcrypto/pgp-pgsql.c 36905
Python-2.6.4/Lib/email/quoprimime.py
perl-5.10.0/t/op/mkdir.t
Which C source files with more than 300 lines have a comment ratio below 1%?
& sqlite3 code.db 'select project, language, file, nCode, nComment, (100.0*nComment)/(nComment+nCode) as comment_ratio from t
where language="C" and nCode & 300 and comment_ratio & 1 order by comment_' | sqlite_formatter
Language File
nCode nComment comment_ratio
__________ ________ _____________________________________________________________________________ _____ ________ __________________
mysql-5.1.42/scripts/mysql_fix_privilege_tables_sql.c
Python-2.6.4/Python/graminit.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_turkish.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_french.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_french.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_hungarian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_hungarian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_english.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_english.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_spanish.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_spanish.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_italian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_italian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_portuguese.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_portuguese.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_romanian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_2_romanian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_finnish.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_porter.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_finnish.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_porter.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_KOI8_R_russian.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_russian.c
Python-2.6.4/Mac/Modules/qt/_Qtmodule.c
Python-2.6.4/Mac/Modules/icn/_Icnmodule.c
mysql-5.1.42/strings/ctype-extra.c
Python-2.6.4/Python/Python-ast.c
Python-2.6.4/Mac/Modules/menu/_Menumodule.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_dutch.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_dutch.c
perl-5.10.0/x2p/a2p.c
Python-2.6.4/Mac/Modules/qd/_Qdmodule.c
Python-2.6.4/Mac/Modules/win/_Winmodule.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_german.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_german.c
perl-5.10.0/x2p/walk.c
Python-2.6.4/Mac/Modules/ctl/_Ctlmodule.c
Python-2.6.4/Mac/Modules/ae/_AEmodule.c
Python-2.6.4/Mac/Modules/app/_Appmodule.c
mysql-5.1.42/strings/ctype-euc_kr.c
mysql-5.1.42/storage/archive/archive_reader.c
Python-2.6.4/Mac/Modules/evt/_Evtmodule.c
Python-2.6.4/Modules/expat/xmlrole.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_UTF_8_danish.c
mysql-5.1.42/strings/ctype-gbk.c
postgresql C
postgresql-8.4.2/src/backend/snowball/libstemmer/stem_ISO_8859_1_danish.c
mysql-5.1.42/strings/ctype-gb2312.c
Python-2.6.4/Mac/Modules/res/_Resmodule.c
Python-2.6.4/Mac/Modules/drag/_Dragmodule.c
postgresql C
postgresql-8.4.2/contrib/hstore/hstore_op.c
Python-2.6.4/Mac/Modules/list/_Listmodule.c
Python-2.6.4/Mac/Modules/te/_TEmodule.c
Python-2.6.4/Mac/Modules/cg/_CGmodule.c
postgresql C
postgresql-8.4.2/contrib/hstore/hstore_io.c
postgresql C
postgresql-8.4.2/src/interfaces/ecpg/preproc/preproc.c
Python-2.6.4/Modules/clmodule.c
Python-2.6.4/Mac/Modules/folder/_Foldermodule.c
What are the ten longest files (based on code lines) that have no comments at all?
Exclude header and YAML files.
& sqlite3 code.db 'select project, file, nCode from t where nComment = 0 and language not in ("C/C++ Header", "YAML") order by nCode desc limit 10;' | sqlite_formatter
Project File
_______ _____________________________________________________ _____
Python-2.6.4/PC/os2emx/python26.def
Python-2.6.4/Lib/test/cjkencodings_test.py
Python-2.6.4/Tools/msi/schema.py
Python-2.6.4/Lib/msilib/schema.py
perl-5.10.0/symbian/config.sh
perl-5.10.0/uconfig.sh
Python-2.6.4/Tools/pybench/Lookups.py
mysql-5.1.42/scripts/mysql_fix_privilege_tables_sql.c
Python-2.6.4/Tools/pybench/Numbers.py
Python-2.6.4/Tools/pybench/Arithmetic.py
What are the most popular languages (in terms of lines
of code) in each project?
& sqlite3 code.db 'select project, language, sum(nCode) as SumCode from t group by project,language order by project,SumC' | sqlite_formatter
__________ __________________ _______
C/C++ Header
Bourne Shell
Teamcenter def
Javascript
Bourne Again Shell
C/C++ Header
Bourne Shell
postgresql C
postgresql C/C++ Header
postgresql Bourne Shell
postgresql SQL
postgresql yacc
postgresql Perl
postgresql lex
postgresql make
postgresql m4
postgresql Teamcenter def
postgresql HTML
postgresql DOS Batch
postgresql XSLT
postgresql Assembly
postgresql D
postgresql CSS
postgresql sed
postgresql Python
C/C++ Header
Bourne Shell
Teamcenter def
Objective C
vim script
NAnt scripts
Visual Basic
Bourne Shell
C/C++ Header
cloc versions before 1.50 by default computed, for the provided inputs, a
rough estimate of how many lines of code would be needed to write the
same code in a hypothetical third-generation computer language.
To produce this output one must now use the --3 switch.
Scale factors were derived from the 2006 version of language gearing ratios
listed at Mayes Consulting web site, , using this equation:
cloc scale factor for language X = 3rd generation default gearing ratio / language X gearing ratio
for example,
cloc 3rd generation scale factor for DOS Batch = 80 / 128 = 0.625
The biggest flaw with this approach is that gearing ratios
are defined for logical lines of source code not physical lines (which cloc counts).
The values in cloc's 'scale' and '3rd gen. equiv.' columns should be taken
with a large grain of salt.
Identifying comments within source code is trickier than one might expect.
Many languages would need a complete parser to be counted correctly.
cloc does not attempt to parse any of
the languages it aims to count and therefore is an imperfect tool.
The following are known problems:
Lines containing both source code and comments are counted as lines of code.
Comment markers within strings or
are treated as actual comment markers and not string literals.
For example the following lines of C code
printf(" /* ");
for (i = 0; i & 100; i++) {
printf(" */ ");
appear to cloc as two lines of C code (the lines with black text) and three
lines of comments (the lines which have only red text--lines with both
black and red text are treated as code).
Lua long comments are not recognized.
If cloc does not recognize a language you are interested in counting,
post the following information to a
at cloc's SourceForge page:
File extensions associated with the language.
If the language does
not rely on file extensions and instead works with fixed file names or
with #! style program invocations, explain what those are.
A description of how comments are defined.
Links to sample code.
Wolfram R?sler provided most of the code examples in the test suite.
These examples come from his .
Ismet Kursunoglu found errors with the MUMPS counter and provided
access to a computer with a large body of MUMPS code to test cloc.
Tod Huggins gave helpful suggestions for the Visual Basic filters.
Anton Demichev found a flaw with the JSP counter in cloc v0.76
and wrote the XML ouput generator for the --xml option.
Reuben Thomas pointed out that ISO C99 allows // as a comment
marker, provided code for the --no3 and --stdin-name
options, counting the m4 language,
and suggested several user-interface enhancements.
Michael Bello provided code for the --opt-match-f,
--opt-not-match-f,
--opt-match-d, and --opt-not-match-d
Mahboob Hussain inspired the --original-dir and
--skip-uniqueness options, found a
bug in the duplicate file detection logic and improved the JSP filter.
Randy Sharo found and fixed an uninitialized variable bug for shell
scripts having only one line.
Steven Baker found and fixed a problem with the YAML output generator.
Greg Toth provided code to improve blank line detection in COBOL.
Joel Oliveira provided code to let --exclude-list-file handle
directory name exclusion.
Blazej Kroll provided code to produce an XSLT file, cloc-diff.xsl,
when producing XML output for the --diff option.
Denis Silakov enhanced the code which generates cloc.xsl when
using --by-file and --by-file-by-lang options, and
provided an XSL file that works with --diff output.
Andy () provided code to fix several bugs:
correct output of --counted
so that only files that are used in the code count appear and
that results are shown by language r
allow --diff output from multiple runs to be summed
together with --sum-reports.
Jari Aalto created the initial version of cloc.1.pod and
maintains the Debian package for cloc.
Mikkel Christiansen () provided counter definitions
for Clojure and ClojureScript.
Vera Djuraskovic from
provided the
translation.
Gill Ajoft of
provided the
translation.
provided the
translation.
Erik Gooven Arellano Casillas provided an update to the MXML counter to
recognize Actionscript comments.
created the
Mary Stefanova provided the
translation.
Ryan Lindeman implemented the --by-percent feature.
Kent C. Dodds, ,
created and maintains the npm package of cloc.
provided the
translation.
provided the
translation.
Natalie Harmann provided the
translation.
The development of cloc was partially funded by the Northrop Grumman
Corporation.
Copyright (c) , .
This prog you can redistribute it and/or modify
it under the terms of the
as published by
the Free Software F either version 2 of the License, or
(at your option) any later version.

我要回帖

更多关于 25cm等于几寸 的文章

 

随机推荐