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. Other Discussions
  3. Article Writing
  4. Tip/Trick gone

Tip/Trick gone

Scheduled Pinned Locked Moved Article Writing
question
7 Posts 3 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.
  • E Offline
    E Offline
    Enver Maroshi
    wrote on last edited by
    #1

    Hi, just a question, i created a small tip yestarday (3 lines of code), and it got pending status, and now i don't see it any more under my tips. I can see only one tip, but it should be two of them. Is it possible that moderator found it useless? Well, the tip sure was small, it contained 3 lines of code which are used to find first date of week - but since it was different than those found on other places (using while) i thought it could be usefull to other people. This is how tip looked like:

    Private Function FirstDayOfWeek(ByVal dayInWeek As Date) As Date
    
        ' Calculate difference between specified date days of week and first day of week
        Dim Days As Integer = dayInWeek.DayOfWeek - CurrentCulture.DateTimeFormat.FirstDayOfWeek
    
        ' Add day difference to number of days in week then devide sum with days in week, reminder is number of days we need to substract
        Days = (7 + Days) Mod 7
    
        ' Substract difference of days from specified date
        Return dayInWeek.AddDays(-Days)
    End Function
    

    It sure is small, but is it really useless?

    P L 2 Replies Last reply
    0
    • E Enver Maroshi

      Hi, just a question, i created a small tip yestarday (3 lines of code), and it got pending status, and now i don't see it any more under my tips. I can see only one tip, but it should be two of them. Is it possible that moderator found it useless? Well, the tip sure was small, it contained 3 lines of code which are used to find first date of week - but since it was different than those found on other places (using while) i thought it could be usefull to other people. This is how tip looked like:

      Private Function FirstDayOfWeek(ByVal dayInWeek As Date) As Date
      
          ' Calculate difference between specified date days of week and first day of week
          Dim Days As Integer = dayInWeek.DayOfWeek - CurrentCulture.DateTimeFormat.FirstDayOfWeek
      
          ' Add day difference to number of days in week then devide sum with days in week, reminder is number of days we need to substract
          Days = (7 + Days) Mod 7
      
          ' Substract difference of days from specified date
          Return dayInWeek.AddDays(-Days)
      End Function
      

      It sure is small, but is it really useless?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      I don't think it's useless, but the name is a little bit misleading. When I glanced at this here, I thought you were merely recreating the FirstDayOfWeek method, rather than one that identifies the first day of week based on a particular date. Repost it as a Tip/Trick with a slightly different name.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      E 1 Reply Last reply
      0
      • P Pete OHanlon

        I don't think it's useless, but the name is a little bit misleading. When I glanced at this here, I thought you were merely recreating the FirstDayOfWeek method, rather than one that identifies the first day of week based on a particular date. Repost it as a Tip/Trick with a slightly different name.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        E Offline
        E Offline
        Enver Maroshi
        wrote on last edited by
        #3

        Thank you for your response, i see your point and i agree that title is a bit confusing. I will post a new one with different name and with better description, even better i will steal your description of code (identifies the first day of week based on a particular date). :laugh: But i think that user should get some response like, your tip/trick was deleted and a reason for such action, since i did not understand what happened, i was not sure it got deleted, or was stuck somewhere or something like that.

        P 1 Reply Last reply
        0
        • E Enver Maroshi

          Thank you for your response, i see your point and i agree that title is a bit confusing. I will post a new one with different name and with better description, even better i will steal your description of code (identifies the first day of week based on a particular date). :laugh: But i think that user should get some response like, your tip/trick was deleted and a reason for such action, since i did not understand what happened, i was not sure it got deleted, or was stuck somewhere or something like that.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Are you sure it's been deleted? Have a word on the suggestions forum, and see if anyone knows there.

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          • E Enver Maroshi

            Hi, just a question, i created a small tip yestarday (3 lines of code), and it got pending status, and now i don't see it any more under my tips. I can see only one tip, but it should be two of them. Is it possible that moderator found it useless? Well, the tip sure was small, it contained 3 lines of code which are used to find first date of week - but since it was different than those found on other places (using while) i thought it could be usefull to other people. This is how tip looked like:

            Private Function FirstDayOfWeek(ByVal dayInWeek As Date) As Date
            
                ' Calculate difference between specified date days of week and first day of week
                Dim Days As Integer = dayInWeek.DayOfWeek - CurrentCulture.DateTimeFormat.FirstDayOfWeek
            
                ' Add day difference to number of days in week then devide sum with days in week, reminder is number of days we need to substract
                Days = (7 + Days) Mod 7
            
                ' Substract difference of days from specified date
                Return dayInWeek.AddDays(-Days)
            End Function
            

            It sure is small, but is it really useless?

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi Enver, 1. I can see your tip here[^], it is still awaiting approval. 2. I'd change the title to something like: find first day of week containing given date. 3. I think it is OK, however it is hardly original. I provided a similar technique as an alternative here[^]. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

            E 1 Reply Last reply
            0
            • L Luc Pattyn

              Hi Enver, 1. I can see your tip here[^], it is still awaiting approval. 2. I'd change the title to something like: find first day of week containing given date. 3. I think it is OK, however it is hardly original. I provided a similar technique as an alternative here[^]. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              E Offline
              E Offline
              Enver Maroshi
              wrote on last edited by
              #6

              Hi, 1. This is the new one i created, old one is really gone, lost in cyber universe :) 2. This was my second attempt of title, as soon as i find edit button on tip/trick i will change title again. 3. Yes indeed, our concepts seem to be the same. :( Anyhow thanks for feedback.

              L 1 Reply Last reply
              0
              • E Enver Maroshi

                Hi, 1. This is the new one i created, old one is really gone, lost in cyber universe :) 2. This was my second attempt of title, as soon as i find edit button on tip/trick i will change title again. 3. Yes indeed, our concepts seem to be the same. :( Anyhow thanks for feedback.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                you're welcome. To edit a tip/trick title start by clicking the "improve tip/trick" widget. Then look for the first edit box, labeled "subject". :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                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