Results 1 to 21 of 21

Thread: updated-March 16-Line counter program... if you want

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    updated-March 16-Line counter program... if you want

    Simple app, works with vb and c#. Just choose your VS.NET solution file and it does the rest.




    Also don't forget to donate (see the about menu)

    Fixed Issues:
    -Loads ASP.NET projects now (hope everything goes fine with this)
    -Detects the linked files in a project




    Download Here

    Download Source Code (kinda useless)
    Last edited by MrPolite; Mar 16th, 2004 at 04:33 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    source code

    it's a bit messy, sorry
    Attached Files Attached Files
    Last edited by MrPolite; Mar 16th, 2004 at 04:24 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210
    i already got it from the other thread but thanks again

    wow thanks for the source
    [vbcode]
    Me.Hide()
    [/vbcode]

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by nahya^^
    i already got it from the other thread but thanks again

    wow thanks for the source
    hehe np, umm the source is a bit messy, especially the main function that loads the solution
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    MrPolite , why don't you post the this tool in the VBForums UtilityBank !!

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Pirate
    MrPolite , why don't you post the this tool in the VBForums UtilityBank !!
    umm ok
    in my opinon no ones checks those forums out though, at least I don't
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    The C# section has some errors when identifying comments.
    You can have a comment section like this (IDE does this for you):
    /*
    *
    *
    *
    */

    Also, you can have (which is basically the same as above):
    /*

    ANY THING CAN GO HERE.

    */

    I know you are doing this for yourself, but just thought I would state that in case someone else is using it as a accurate solution.

  8. #8

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by hellswraith
    The C# section has some errors when identifying comments.
    You can have a comment section like this (IDE does this for you):
    /*
    *
    *
    *
    */

    Also, you can have (which is basically the same as above):
    /*

    ANY THING CAN GO HERE.

    */

    I know you are doing this for yourself, but just thought I would state that in case someone else is using it as a accurate solution.
    actually I was wacthing a movie and I was thinking of the same thing I think it only doesn account for the comment lines that start with "*". I'll fix it, thanks

    umm also, hellswraith, give me some of your pro advice, hows the app?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    changed it to this, it should work fine now, I guess:
    VB Code:
    1. While sr.Peek <> -1
    2.                 aLine = sr.ReadLine().Trim()
    3.                 If aLine.Length = 0 Then
    4.                     codeInfo.EmptiesCount += 1
    5.                 ElseIf aLine.StartsWith("/*") Then
    6.                     While sr.Peek <> -1
    7.                         codeInfo.CommentCount += 1
    8.                         If aLine.IndexOf("*/") <> -1 Then
    9.                             Exit While
    10.                         End If
    11.  
    12.                         aLine = sr.ReadLine
    13.                     End While
    14.  
    15.                 ElseIf aLine.StartsWith("//") Then
    16.                     codeInfo.CommentCount += 1
    17.                 Else
    18.                     codeInfo.CodeCount += 1
    19.                 End If
    20.             End While

    I'd appreciate some more testers
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  10. #10
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by MrPolite
    actually I was wacthing a movie and I was thinking of the same thing I think it only doesn account for the comment lines that start with "*". I'll fix it, thanks

    umm also, hellswraith, give me some of your pro advice, hows the app?
    Looks like it will work.

    I didn't get to spend a lot of time looking through, I just wanted to see what you were doing about comments in the code vs. whitespace vs actual code. It looked good from what I seen. I am sure if lots of time were spent on it, it could be refactored a tad, but it works, and I am all about if it works, it is good.

    There was another thought about counting C# (and VB for that matter). What about this:
    PHP Code:
    myVariable myVariable "blahblah" +
                     
    "Somemore string text, etc"
    Is that counted as two lines of code? Should be one (at least from my perspective. Same could be said for VB like so:
    VB Code:
    1. myVariable = myVariable & "blahblah" & _
    2.                "Somemore string text, etc"

    Don't take this as criticism, I am perfectly happy with what you provided us. I was just thinking about what has to be done to get a completely accurate count. I am not knocking your app, it works quite well, just a couple cases that it could produce different results. Even the one above is a controversal one. I mean, someone could call it two lines, I call it one. All in how you look at it I guess....lol.

    Thanks for the app, I like it.

  11. #11

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hehe yeah thought of that too maybe I'll add an option. Right now it doesn't consider multi-line stuff as one line. I was thinking of counting the semi colons or something for C#, but I thought it's not that important

    it's easy to figure that out for VB but I guess not as simple with C#. In vb I just have to look for a "_" character. But dunno about C#. When can you have a line of code that doesnt end with a semicolon? I can only think of brackets"{", attributes, and I guess class/namespace/etc definitions....
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  12. #12
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    You could add it as plugin for VS.NET. You could press a menu or whatever that would run your program with the project name as argument.
    \m/\m/

  13. #13

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by PT Exorcist
    You could add it as plugin for VS.NET. You could press a menu or whatever that would run your program with the project name as argument.
    hmm I suppose... but
    umm
    eeh
    UUH
    how do you make a plugin for vs?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  14. #14
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    As more ideas , you could add this as add-ins and integrates it with VS.NET IDE .

  15. #15
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    MrPolite, whats the deal with the sexy looking titlebar on that screenshot?

    Is that effect your own work or is it something I've missed out on completely:
    I don't live here any more.

  16. #16
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Originally posted by MrPolite
    hmm I suppose... but
    umm
    eeh
    UUH
    how do you make a plugin for vs?
    New Project...Other Projects...VS.net Add-in Project.

    I think you need the Pro version though.
    I don't live here any more.

  17. #17
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210
    Originally posted by wossname
    MrPolite, whats the deal with the sexy looking titlebar on that screenshot?

    Is that effect your own work or is it something I've missed out on completely:
    it's a windows theme from XPStyles. BlueColor.

    EDIT:

    actually... something like that is from mandrake linux. trillian uses the same style as mrpolite's theme. not sure whether they're derived from the mandrake linux theme. that one's better, imo.
    [vbcode]
    Me.Hide()
    [/vbcode]

  18. #18

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    yeah thats the watercolor theme that came with StyleXP... I kinda dont like the ugly/busy looking themes, but I really do get tired of one theme after a while, so I change it...



    umm I tried making an add-in, it didnt work, dunno why I guess I dont know how exactly.... once the button used to appear in the tools menu, then it disappeared, then other stuff anyone has a good and through tutorial for addins?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  19. #19

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    bump, another update
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  20. #20
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    Re: updated-March 16-Line counter program... if you want

    it doesn't load up my vs 2005 solutions

    FIX IT!
    \m/\m/

  21. #21
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: updated-March 16-Line counter program... if you want

    [wayne-campbell]Yeah, get the .net (2005). Are you mental?[/wayne-campbell]

    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width