How to calculate line count for project [closed] - line-count

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am taking a software engineering class right now. Our assignment is to evaluate Mozilla's Thunderbird. Our assignment is to evaluate the size of Thunderbird. One metric that we need to use is the number of lines of code in the project. (Lines of code meaning not including comments or new lines).
Is there a standard way to find the number of lines or am I better off just cracking out a script to do this?
I think that I could do something like this:
# remove all comments
find -name *.java | \
sed "/\/*/,\*\// s/.*//g | \ # remove multiline comments
sed s/\/\///g # remove single line comments
# count not empty lines
find -name *.java | grep -c "<character>"
But I would need to do that for each file type. It seems like there should be some utility that does that already. (something mac/unix compatible would be preferable).

Use CLOC.. it is written in Perl and it supports almost every programming language, it's easily configurable and very fast.

One of my favorite tools to count SLOC is cloc, written in Perl. Without any extra configuration on your part, it will tell you the number of blank lines, the number of commented lines, and the number of source lines over an entire tree of source files. It breaks down the numbers by file extension as well.

The ohloh.net website uses a nice LOC calculator for their stats, which is freely available:
https://www.ohloh.net/p/loc-calculator

Related

How to remove hyperlink symbol in latex? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I am trying to make a new CV on overleaf using the modern Deedy template - here
Currently, it looks like this
Under the first project - desktop application for pair trading, I don't have a link to provide for the code so I just want to remove the small symbol which leads to another link.
In the code, the segment for this part is like this
\projectHeadingwithoutLink{DESKTOP APPLICATION FOR PAIR TRADING}{https://github.com/devangmukherjee/random-zomato-restaurant}{Python, Selenium, Tkinter, Yahoo Finance API}
Made a desktop application for finding correlation between two stocks and looking for divergence using density curve formula which sold multiple copies at 500 USD each.\\
\sectionsep
\projectHeading{LOCATION BASED RESTAURANT SUGGESTION}{https://github.com/devangmukherjee/random-zomato-restaurant}{NodeJS, ExpressJS, Mongoose, MongoDB}
A full-stack website which can suggest the best restaurants in an area using Zomato API and filtered according to user ratings.\\
\sectionsep
and the section of projectHeading looks like this
% Create project heading. Parameters: Name, link, Tech stack
\newcommand{\projectHeading}[3]{\Project{#1}{#2}
\descript{#3}\\}
How can I edit it to remove the hyperlink symbol while keeping the names of the languages on the right?
Modify the resume-openfont.cls file.
At line 125 of the resume-openfont.cls comment the command \faExternalLink, which inserts such symbol and the link. The \Project command is the one that inserts the hyperlink.
% Project command
\newcommand{\Project}[2]{
\runsubsection{%
\href{#2}{\uppercase{#1}} %\,\faExternalLink}
}
\hfill
}

Is there a way to label Python code in LaTeX? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
We have made a few examples of code in Python and inserted them into a LaTeX/overleaf document. We are currently looking into making a label for them, so they can be referenced at various points, however using the \begin(python) doesn't seem to allow us to add a \label{}, which works and can be referenced.
A similar example of what we are looking for would be
\documentclass[11pt,a4paper,twoside,openany,english]{book}
\usepackage{pythonhighlight}
\begin{python}\label{SO-test}
value_a = 1
value_b = 2
print(value_a + value_b)
\end{python}
Any tips or tricks are appreciated.
Behind the scenes the pythonhighlight uses the much more common listings package. The listings package allows you to add a caption and label as optional argument of the lstlistings environment.
However even though the pythonhighlight sets up its python environment with the possibility to add an optional argument, it never uses this argument. Thus the information is never forwarded to the lstlistings environment.
To work around this, you can set up your own environment:
\documentclass[11pt,a4paper,twoside,openany,english]{book}
\usepackage{pythonhighlight}
\lstnewenvironment{mypython}[1][]{\lstset{style=mypython,#1}}{}
\begin{document}
\begin{mypython}[caption={some text to produce a caption},label=SO-test]
value_a = 1
value_b = 2
print(value_a + value_b)
\end{mypython}
Reference: \ref{SO-test}
\end{document}
I tried to just include this in a comment, but I'm too new to stack overflow.
Have you tried just using regular verbatim instead of making it explicitly python? Is there something wrong with that?
\begin{verbatim}
Text enclosed inside \texttt{verbatim} environment
is printed directly
and all \LaTeX{} commands are ignored.
\end{verbatim}
I also saw this thing about minted in their library.
It makes a reference to \begin{minted}{python}
https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted

How can I highlight text in latex [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
How can i highlit text in latex.
Thank you.
As is pictured here(in red circle):
If you mean making the text bold by Highlighting you can use \textbf for making the text bold but highlighting has a different general meaning that is implemented by \hl keyword.
\documentclass{report}
\usepackage{color} % for the command \textcolor
\usepackage{soul} % for the command \hl
\begin{document}
\hl{foo}
\hl{\textbf{foo}}
{my garden }
\textbf{black}{foo}
{my good job}
\textbf{\textcolor{red}{\hl{foo}}}
\textcolor{red}{\textbf{\hl{foo}}}
\end{document}
this is the result :
As you can see the word "black" is highlighted the way you desired.
The word "foo" is highlighted in the general meaning of highlighting.
This links look useful:
Insert symbols inside verbatim mode LaTeX
Putting math inside a verbatim environment without altering the formatting
If you just wanted graph.exe I would suggest using \begin{verbatim} graph.exe \end{verbatim} or \verb+graph.exe+ .
However you want to use the <..> expression which can be created with $ \langle ... \rangle $ . The $..$ indicates inline math mode. Those two links discuss getting verbatim text in math environments.
I think tex.stackexchange.com will be more helpful rather than stack overflow.

How to keep symbols, slash, ... in your document? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I want to keep all the symbols in my following text in LaTeX. but I don't know which syntax I should use to keep them. Can anybody give a suggestion?
/forest # search for forest
/<\/way> # find the tag </way>
v # start the visual mode
?<way # find the begin of the tag -> mark <way> until </way>
D # delete that tag
Just put them in verbatim environment, like this:
\begin{verbatim}
...
things you want to keep them as is
...
\end{verbatim}
For inline mode, you can use \verb command:
\verb=...things you want to keep them as is...=
Check out here for more info:
[...] If you use the verbatim environment, everything input between the begin and end commands are processed as if by a typewriter. All spaces and new lines are reproduced as given, and the text is displayed in an appropriate fixed-width font. Any LaTeX command will be ignored and handled as plain text. This is ideal for typesetting program source code. [...]

Why do search engines ignore symbols? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Searching for symbols is a common in programming, especially when you are new to a language.
For example, I had a question about the :: operator in Python, and that is not searchable. People looking for things like this or Object [] (array of Objects), would not find what they want.
Why do search engines seem to ignore symbols completely? They are just characters like any others. I can see why
it would be hard to extract semantics from symbols compared to words (eg: a search engine can figure out that "find," "finds," "found" are all related, if not the same word),
but is it really that hard to search for them?
I can also see why in everyday use you'd want symbols to be ignored, but how hard would it
be to make it look for something explicitly (eg: "::" would search for ::)
Check out this article on Interpreting Google Search Queries.
Specifically, section 9
Google ignores some punctuation and special characters, including ! ?
, . ; [ ] # / # < > .
Because punctuation is typically not
as important as the text around it,
Google ignores most punctuation in
your search terms. There are
exceptions, e.g., C++ and $99.
Mathematical symbols, such as /, <,
and >, are not ignored by Google's
calculator.
[ Dr. Ruth ] returns the same results
as [ Dr Ruth ]
What if you're seeking information
that includes punctuation that Google
ignores, e.g., an email address? Just
enter the whole thing including the
punctuation.
* [ info#amazon.com ]
Be aware that web pages sometimes
camouflage email addresses to make
collecting such information difficult
for spammers. For example, on some
sites you'll find the # sign in an
email address replaced with the word
“at.”
Now we'll look at some special
characters that Google doesn't ignore.
To minimize the number of entries in the index.
A search engine doesn't have to ignore them though. For example, it seems Google Code doesn't.

Resources