Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I love finding old comments....

I love finding old comments....

Scheduled Pinned Locked Moved The Lounge
rubysysadmin
17 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B boarderstu

    Just found this gem whilst going over some old code..

    /// <summary>
    /// Returns a FQ path on the server for a relative path
    /// </summary>
    /// <param name="filename"></param>
    /// <returns></returns>
    public string GetFilePath(string relPath, string filename)
    {
    if (relPath.StartsWith("~/"))
    {
    return HttpContext.Current.Server.MapPath(relPath + filename);
    }
    else
    {
    return relPath + filename; //This ain't a virtual path mate.
    }
    }

    S Offline
    S Offline
    S Douglas
    wrote on last edited by
    #3

    My favorite I keep finding from someone who no longer works here...

    /*
    PUT LOGIC HERE

    */


    Common sense is admitting there is cause and effect and that you can exert some control over what you understand.

    P 1 Reply Last reply
    0
    • S S Douglas

      My favorite I keep finding from someone who no longer works here...

      /*
      PUT LOGIC HERE

      */


      Common sense is admitting there is cause and effect and that you can exert some control over what you understand.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #4

      Oh yes, inside comment blocks is the perfect place to put logic :laugh:

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      B 1 Reply Last reply
      0
      • P Paul Conrad

        Oh yes, inside comment blocks is the perfect place to put logic :laugh:

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

        B Offline
        B Offline
        boarderstu
        wrote on last edited by
        #5

        The only sure way to ensure no errors! (or no logic..)

        modified on Thursday, July 7, 2011 8:19 AM

        1 Reply Last reply
        0
        • B boarderstu

          Just found this gem whilst going over some old code..

          /// <summary>
          /// Returns a FQ path on the server for a relative path
          /// </summary>
          /// <param name="filename"></param>
          /// <returns></returns>
          public string GetFilePath(string relPath, string filename)
          {
          if (relPath.StartsWith("~/"))
          {
          return HttpContext.Current.Server.MapPath(relPath + filename);
          }
          else
          {
          return relPath + filename; //This ain't a virtual path mate.
          }
          }

          B Offline
          B Offline
          BrainiacV
          wrote on last edited by
          #6

          Found this one.

          'We shouldn't reach here,
          'if so, cry softly

          Yes, it was in BASIC.

          Psychosis at 10 Film at 11

          1 Reply Last reply
          0
          • B boarderstu

            Just found this gem whilst going over some old code..

            /// <summary>
            /// Returns a FQ path on the server for a relative path
            /// </summary>
            /// <param name="filename"></param>
            /// <returns></returns>
            public string GetFilePath(string relPath, string filename)
            {
            if (relPath.StartsWith("~/"))
            {
            return HttpContext.Current.Server.MapPath(relPath + filename);
            }
            else
            {
            return relPath + filename; //This ain't a virtual path mate.
            }
            }

            R Offline
            R Offline
            regalsoft
            wrote on last edited by
            #7

            How about this for error handling comments:

            Try
            .
            .
            .
            .
            Catch ex As Exception
            ' Hmmmm.....
            ' Obviously didn't think of something.
            Throw New ApplicationException("Exception Occured")
            End Try

            A 1 Reply Last reply
            0
            • B boarderstu

              Just found this gem whilst going over some old code..

              /// <summary>
              /// Returns a FQ path on the server for a relative path
              /// </summary>
              /// <param name="filename"></param>
              /// <returns></returns>
              public string GetFilePath(string relPath, string filename)
              {
              if (relPath.StartsWith("~/"))
              {
              return HttpContext.Current.Server.MapPath(relPath + filename);
              }
              else
              {
              return relPath + filename; //This ain't a virtual path mate.
              }
              }

              B Offline
              B Offline
              Br Bill
              wrote on last edited by
              #8

              Found this in a ruby script yesterday. I wrote it almost 3 years ago.

              def syncAll()
                  # Do a force sync. IT'S CLOBBERIN' TIME!
                  sync(true)
              end
              
              1 Reply Last reply
              0
              • R regalsoft

                How about this for error handling comments:

                Try
                .
                .
                .
                .
                Catch ex As Exception
                ' Hmmmm.....
                ' Obviously didn't think of something.
                Throw New ApplicationException("Exception Occured")
                End Try

                A Offline
                A Offline
                ajhampson
                wrote on last edited by
                #9

                Hmmm... not only didn't think of something, but we'll mask the real exception with a generic one so no one else can figure it out either! :-D

                1 Reply Last reply
                0
                • B boarderstu

                  Just found this gem whilst going over some old code..

                  /// <summary>
                  /// Returns a FQ path on the server for a relative path
                  /// </summary>
                  /// <param name="filename"></param>
                  /// <returns></returns>
                  public string GetFilePath(string relPath, string filename)
                  {
                  if (relPath.StartsWith("~/"))
                  {
                  return HttpContext.Current.Server.MapPath(relPath + filename);
                  }
                  else
                  {
                  return relPath + filename; //This ain't a virtual path mate.
                  }
                  }

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #10

                  A programmer with a degree in Philosophy, working for me years ago on commercially sold software, liberally sprinkled comments through out whatever he worked on.

                  My favorite was:

                  This MIGHT work!

                  I had it put on a plaque for him.

                  1 Reply Last reply
                  0
                  • B boarderstu

                    Just found this gem whilst going over some old code..

                    /// <summary>
                    /// Returns a FQ path on the server for a relative path
                    /// </summary>
                    /// <param name="filename"></param>
                    /// <returns></returns>
                    public string GetFilePath(string relPath, string filename)
                    {
                    if (relPath.StartsWith("~/"))
                    {
                    return HttpContext.Current.Server.MapPath(relPath + filename);
                    }
                    else
                    {
                    return relPath + filename; //This ain't a virtual path mate.
                    }
                    }

                    V Offline
                    V Offline
                    virang_21
                    wrote on last edited by
                    #11

                    I left a comment for one of the page I coded for future developers.... /*Sentimental value attached to the part of the code which is redundunt now. */ It took me around 3 months to get everything working the way client wanted and at the end management decided to dump it ...

                    Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

                    1 Reply Last reply
                    0
                    • B boarderstu

                      Just found this gem whilst going over some old code..

                      /// <summary>
                      /// Returns a FQ path on the server for a relative path
                      /// </summary>
                      /// <param name="filename"></param>
                      /// <returns></returns>
                      public string GetFilePath(string relPath, string filename)
                      {
                      if (relPath.StartsWith("~/"))
                      {
                      return HttpContext.Current.Server.MapPath(relPath + filename);
                      }
                      else
                      {
                      return relPath + filename; //This ain't a virtual path mate.
                      }
                      }

                      H Offline
                      H Offline
                      hoernchenmeister
                      wrote on last edited by
                      #12

                      I can remeber a comment in an old C++ class I came accross that made me laugh and cry at the same time: // I seriously have to get out of here.... ...all suddenly made sense ;)

                      1 Reply Last reply
                      0
                      • B boarderstu

                        Just found this gem whilst going over some old code..

                        /// <summary>
                        /// Returns a FQ path on the server for a relative path
                        /// </summary>
                        /// <param name="filename"></param>
                        /// <returns></returns>
                        public string GetFilePath(string relPath, string filename)
                        {
                        if (relPath.StartsWith("~/"))
                        {
                        return HttpContext.Current.Server.MapPath(relPath + filename);
                        }
                        else
                        {
                        return relPath + filename; //This ain't a virtual path mate.
                        }
                        }

                        S Offline
                        S Offline
                        Stonkie
                        wrote on last edited by
                        #13

                        I found this last week.

                        // Remove this code.

                        Followed by a few lines of unnecessary code that had no effect in the context. And source control says the last modification on that file was in 2007! :doh:

                        1 Reply Last reply
                        0
                        • B boarderstu

                          Just found this gem whilst going over some old code..

                          /// <summary>
                          /// Returns a FQ path on the server for a relative path
                          /// </summary>
                          /// <param name="filename"></param>
                          /// <returns></returns>
                          public string GetFilePath(string relPath, string filename)
                          {
                          if (relPath.StartsWith("~/"))
                          {
                          return HttpContext.Current.Server.MapPath(relPath + filename);
                          }
                          else
                          {
                          return relPath + filename; //This ain't a virtual path mate.
                          }
                          }

                          O Offline
                          O Offline
                          Orlin Georgiev
                          wrote on last edited by
                          #14

                          A piece of C++ code from a certain popular game engine:

                          BasePort = 7777; // oh well.

                          Note that the network port is also configured in an ini file, but why bother using that?

                          B 1 Reply Last reply
                          0
                          • O Orlin Georgiev

                            A piece of C++ code from a certain popular game engine:

                            BasePort = 7777; // oh well.

                            Note that the network port is also configured in an ini file, but why bother using that?

                            B Offline
                            B Offline
                            boarderstu
                            wrote on last edited by
                            #15

                            My latest...

                            /// <summary>
                            /// A collection of classes for generating Hashes
                            /// </summary>
                            public class Hash
                            {
                            /// <summary>
                            /// Returns a MD5 hash - DO NOT use this for encryption
                            /// </summary>
                            /// <param name="str"></param>
                            /// <returns></returns>
                            ///

                                //Using this for encryption would render you a complete tool.
                                public string GenerateMD5Hash(string str)
                                {
                            
                                }
                            
                            }
                            
                            1 Reply Last reply
                            0
                            • B boarderstu

                              Just found this gem whilst going over some old code..

                              /// <summary>
                              /// Returns a FQ path on the server for a relative path
                              /// </summary>
                              /// <param name="filename"></param>
                              /// <returns></returns>
                              public string GetFilePath(string relPath, string filename)
                              {
                              if (relPath.StartsWith("~/"))
                              {
                              return HttpContext.Current.Server.MapPath(relPath + filename);
                              }
                              else
                              {
                              return relPath + filename; //This ain't a virtual path mate.
                              }
                              }

                              B Offline
                              B Offline
                              blimie
                              wrote on last edited by
                              #16

                              I had to take over support of a vb6 program that had bounced around the dept a few times. One of the fixes documented before large section of commented out code was

                              'WVK: Removed WASL & write_file
                              ' Logging_file "Before weird ass sort loop (WASL)"

                              The commented out code was followed by

                              'Logging_file "After WASLoop, Before write"
                              'ansewer = write_file(In_Order(), in_order_nbr)
                              '
                              'm_blnOption = 1
                              'Unload Me
                              'WVK: thats better

                              1 Reply Last reply
                              0
                              • B boarderstu

                                Just found this gem whilst going over some old code..

                                /// <summary>
                                /// Returns a FQ path on the server for a relative path
                                /// </summary>
                                /// <param name="filename"></param>
                                /// <returns></returns>
                                public string GetFilePath(string relPath, string filename)
                                {
                                if (relPath.StartsWith("~/"))
                                {
                                return HttpContext.Current.Server.MapPath(relPath + filename);
                                }
                                else
                                {
                                return relPath + filename; //This ain't a virtual path mate.
                                }
                                }

                                R Offline
                                R Offline
                                Rich719
                                wrote on last edited by
                                #17

                                Great comment on implementing a custom GINA DLL when dealing with Remote Desktop... // Duplicate what the GINAFULL example does - this clears the TS session but // does not log the user in (although it was supposed to in the example) // Flush the toilet full of Micro$oft terminal server session entanglement sins here // then re-try sending the XXXXXX SAS from the servant service

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups