 |
|
 |
hi,
How can i find resource leak, I have allready tried deleaker it is not showing any leak can u tell me any other way?
Thanks,
Rushiraj
|
|
|
|
 |
|
 |
another sample written by C#.;P
counting source code lines, comment lines, space lines.
Just select the project file, then you can get summary for all files included in this project.
Now support C#(.csproj), VB.Net(.vbproj), VC.Net(.vcproj), VC6 project file(DSW,DSP)
you can download it from [here]
enjoy it.
sun shaodi
|
|
|
|
 |
|
 |
i tried this and it crashed on me soon after i clicked the calculate button.
.dan.g.
AbstractSpoon Software
abstractspoon2_at_optusnet_dot_com_dot_au
|
|
|
|
 |
|
 |
buddy your site is Chinese and i can't make out anything there...
can you please post url where u hv latest version of the same?
|
|
|
|
 |
|
 |
Hi,
when counting, what do you consider as one line? Are line breaks included or do you only consider executable statements? Any whitespace should not influence the counting!
How are control structures considered? An if/else or switch/case is not executable - is it counted or not?
When writing a similar tool I decided to count semicolons outside of line or block comments. This ignores control structures but includes the semicolons after the clauses of a for(bla; bla; bla++) or do/while loop.
Would be nice to get some explanation of what's a "line of code" in your software.
And of course: thanks for this tool - I find it useful!
Regards,
Thomas
|
|
|
|
 |
|
 |
Thanks for your comments!
The program counts for physical lines, so it considers a line wherever it finds a return. For example, the following source code consider as 3 lines, not 1 line:
sprintf(buf,
"the number is %d",
nTotal);
Also, it treats any lines only containing whitespace or tab as Blank Lines, whether or not those lines lie between /* and */.
What's more, the program can't be used to count such as Class, Structure.
For your problem, I think that treating source code char by char may be helpful. Thus you can seperate semicolons in for(bla;bla;bla++) or do/while from others sourcecode.
Sorry for my poor English!
I am wondering if you can understand my meaning.
xiaogi
|
|
|
|
 |
|
 |
Interesting as programming exersize. But what can you say about manager who counts program lines?
|
|
|
|
 |
|
 |
Hahaha
I'd say any manager who counted program lines was about as useful as tits on a bull.
It's always been my personal programming style to code with the most effective and efficient use of the language... and that results in fewer lines of code compared to... say what a beginner might do.
|
|
|
|
 |
|
 |
What a maroon! What a maroon!
That makes absolutely no sense whatsoever.
I am reminded of a project that some students worked on a long time ago. All of the students but one turned in programs that were at least 10 pages long, and filled with bugs. The one exception turned in a one-page program that worked perfectly.
Now, tell me please, who did the better job?
DUH!
That manager needs a brain transplant, or rather a brain implant, since he obviously has no brain at present.
<img src="http://img.timeinc.net/time/2007/fall_preview_2007/young_frankenstein.jpg" />
Tell him to get in touch with Igor.
|
|
|
|
 |
|
 |
Not only the manager, but also many others want to know our program lines.
For example, authorities always want the number of lines if we apply for copyright.
xiaogi
|
|
|
|
 |
|
 |
Hi,
one shouldn't overestimate the meaning of a lOC number, but it can give some hints about the size of the monster. When estimating maintenance efforts of *similiar* systems it can be a first indicator of what's bigger than the other one. Of course there is verbose programming with a lot of copy and paste instead of cute refactoring and traces of the genius but the bottom line is that a bigger system is nearly always more cumbersome to maintain.
The lines of comment tell nothing about the semantic quality of the comments, but if the ratio between comments and code lines is considerably low I would take a closer look at such files to find out if there is a problem with the comments. So IMHO counting can give hints for spot check inspection of the code in larger systems. When reviewing a 75000 LOC system with some megabytes of source code, I found a homegrown counting tool very helpful to find the "hot spots". Not to my surprise we found a lot of bad techniques in the largest, poor commented files. Counting is not "the truth", but it is helpful.
By the way, I had to set another LANGUAGE definition in the resource file since I'm not running a chinese Windows. For use on CodeProject, English might be the better choice.
Happy programming,
Thomas
|
|
|
|
 |
|
 |
Hi, the "animation" as dialog-icon is a very good idea. But it would also be a good idea, to free the gdi resources after using or to keep the HICON objects for idling.
please watch your prog with task manger (don't forget to check "gdi-objects" in task manager)
HICON hPrevIcon = (HICON)AfxGetMainWnd()->SendMessage(WM_SETICON,ICON_SMALL,(LPARAM)hIcon);
DestroyIcon( hPrevIcon); // insert this line
|
|
|
|
 |
|
 |
thank you very much!
Can you do me another favor? Counting ver1.1 may have a serious problem. When it count more than 5000 files, the windows will be crash down possibly.
I coundn't find where the problem lied?
xiaogi
|
|
|
|
 |