Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.advocacy > #412723

Re: Tiny "algorithm" challenge

From owl <owl@rooftop.invalid>
Newsgroups comp.os.linux.advocacy
Subject Re: Tiny "algorithm" challenge
Date 2017-05-03 16:57 +0000
Organization O.W.L.
Message-ID <sav03.aby@rooftop.invalid> (permalink)
References <oeclh3$tll$4@dont-email.me> <xcv903.yyah@rooftop.invalid> <oecn7m$64a$2@dont-email.me> <f6e9f417-689d-4169-a71b-474249dafc6b@googlegroups.com>

Show all headers | View raw


Incubus <incubus9536612@gmail.com> wrote:
> On Wednesday, May 3, 2017 at 1:54:03 PM UTC, DFS wrote:
>> On 5/3/2017 9:37 AM, owl wrote:
>> > DFS <nospam@dfs.com> wrote:
>> >> * if the value entered on screen isn't a Sunday, get the date of the
>> >>    next/upcoming Sunday.
>> >>
>> >> My 1-line VB solution using immediate if:
>> >>
>> >> reportDt = IIf(Weekday(screenDt) > 1, screenDt + (7 - Weekday(screenDt)
>> >> + 1), screenDt)
>> >>
>> >>
>> >> The VB Weekday() function by default returns 1 for Sunday, 2 for Monday,
>> >> etc.
>> >>
>> >>
>> >> Beat it or be pwned.
>> > 
>> > anon@lowtide:~$ date -d Sunday
>> > Sun May  7 00:00:00 EDT 2017
>> > anon@lowtide:~$
>> 
>> 
>> That's not an algorithm; that's a cheat.
> 
> It's code reuse as is DFS' 'solution'.  Neither are a valid algorithm.

The algorithm was specified.  Those are implementations.

Back to comp.os.linux.advocacy | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Tiny "algorithm" challenge DFS <nospam@dfs.com> - 2017-05-03 09:24 -0400
  Re: Tiny "algorithm" challenge owl <owl@rooftop.invalid> - 2017-05-03 13:37 +0000
    Re: Tiny "algorithm" challenge DFS <nospam@dfs.com> - 2017-05-03 09:53 -0400
      Re: Tiny "algorithm" challenge owl <owl@rooftop.invalid> - 2017-05-03 14:16 +0000
        Re: Tiny "algorithm" challenge chrisv <chrisv@nospam.invalid> - 2017-05-03 10:18 -0500
      Re: Tiny "algorithm" challenge Incubus <incubus9536612@gmail.com> - 2017-05-03 07:34 -0700
        Re: Tiny "algorithm" challenge DFS <nospam@dfs.com> - 2017-05-03 11:33 -0400
        Re: Tiny "algorithm" challenge owl <owl@rooftop.invalid> - 2017-05-03 16:57 +0000
      Re: Tiny "algorithm" challenge Sandman <mr@sandman.net> - 2017-05-03 16:25 +0000
        Re: Tiny "algorithm" challenge DFS <nospam@dfs.com> - 2017-05-03 20:34 -0400
      Re: Tiny "algorithm" challenge Snit <usenet@gallopinginsanity.com> - 2017-05-03 10:41 -0700

csiph-web