Beau Peep Notice Board

Beau Peep Notice Board => Outpourings => Topic started by: Diane CBPFC on September 20, 2021, 06:44:36 AM

Title: Chelsea Flower Show
Post by: Diane CBPFC on September 20, 2021, 06:44:36 AM
I watched the first program tonight, this is the first time Chelsea has had a fall flower show so it is quite exciting and colourful especially if you love dahlias. 

It got me wondering if Beau and Dennis were tasked to make a theme garden, what would they plant?

Title: Re: Chelsea Flower Show
Post by: Roger Kettle on September 20, 2021, 06:49:13 PM
I seem to recall Egon having a garden ay one stage and attempting to grow something like lager.
On a personal note, this year we have failed to produce potatoes, artichokes and lettuce in our garden. This is similar to our crop failures of last year. We're on a roll!
Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on September 20, 2021, 07:50:06 PM
I seem to recall Egon having a garden ay one stage and attempting to grow something like lager.
On a personal note, this year we have failed to produce potatoes, artichokes and lettuce in our garden. This is similar to our crop failures of last year. We're on a roll!

Maybe instead of fancy veggies you should have tried a native crop to your country such as haggis
Title: Re: Chelsea Flower Show
Post by: Tarquin Thunderthighs lll on September 20, 2021, 09:01:21 PM
Maybe instead of fancy veggies you should have tried a native crop to your country such as haggis

I'm afraid I must inform you that the humble Haggis is neither vegetable nor mineral, Diane, but wholly animal...

Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on September 20, 2021, 09:28:19 PM
Maybe instead of fancy veggies you should have tried a native crop to your country such as haggis

I'm afraid I must inform you that the humble Haggis is neither vegetable nor mineral, Diane, but wholly animal...

Next you will be telling me that budgie seed doesn't grow budgies.
Title: Re: Chelsea Flower Show
Post by: Tarquin Thunderthighs lll on September 20, 2021, 10:25:34 PM
None of mine hatched. Sorry!
Title: Re: Chelsea Flower Show
Post by: Roger Kettle on September 21, 2021, 09:33:26 AM
Superb cartoon, Tarks!
Title: Re: Chelsea Flower Show
Post by: Mince on September 30, 2021, 10:36:06 PM
This piece of programming that I wrote looks somewhat like a flower show.

return assemblies
   .SelectMany(
      x => x
      .GetTypes()
      .Where(t => t.Namespace != null && t.Namespace.Contains(".LCQ") && t.Name.StartsWith("LCQ"))
      .SelectMany(
         u => Enumerable
            .Range(0, (int)u.GetProperty("Count").GetValue(null))
            .Select(
               v => (
                        Title: (string)u.GetMethod("Title").Invoke(null, new object[] { v }),
                        QNo: v,
                        QType: u
                     )
            )
         .ToList()
      )
   )
   .ToDictionary(
      t => t.Title,
      t => (t.QType, t.QNo)
   );


I'm just gonna wait now for a "Great programming, Mince" from Roger.
Title: Re: Chelsea Flower Show
Post by: Roger Kettle on October 01, 2021, 09:29:35 AM
Actually, it's pretty average.
Title: Re: Chelsea Flower Show
Post by: Mince on October 01, 2021, 02:17:51 PM
Is it because I used reflection to invoke the function in the classes? Should I have kept everything strongly typed? Have you managed to open the lid yet?
Title: Re: Chelsea Flower Show
Post by: Roger Kettle on October 01, 2021, 05:55:58 PM
a)...Yes.
b)...Yes.
c)...No.
Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on October 02, 2021, 05:57:53 PM
I'll show you what the text looks like in North America and you can see why I wasn't impressed. 
Title: Re: Chelsea Flower Show
Post by: Mince on October 04, 2021, 04:08:48 PM
It looks perfect to me.
Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on October 04, 2021, 04:37:10 PM
It looks perfect to me.

What is it supposed to be? I put up an image of the code but instead of that showing as a photo attachment as what normally happens when you post an image, it was read and posted in text the same as it was in your earlier post. To me it looks like a mess without reason.
Title: Re: Chelsea Flower Show
Post by: Mince on October 05, 2021, 12:22:20 PM
It's a piece of cool programming from a piece of software I wrote this year to create random maths questions (with answers).

It's cool mostly because it's one line of programming (though it's split over several lines for readability).

The main program never changes (as it just creates maths questions) but the repositories from which it chooses the questions must be capable of being added to without having to re-compile the main program, so they are placed in separate files called assemblies.

The function examines the assemblies that contain the maths questions and creates (and returns) a list of all available maths questions that the user can choose from.

return assemblies   
   .SelectMany(    turn a list of lists into a single list
      x => x
      .GetTypes()    get all the types in the assemblies
      .Where(t => t.Namespace != null && t.Namespace.Contains(".LCQ") && t.Name.StartsWith("LCQ"))    filter out the ones we need
      .SelectMany(      turn the inner list of lists into a single list
         u => Enumerable   
            .Range(0, (int)u.GetProperty("Count").GetValue(null))    get the number of questions in each type and number them
            .Select(    for each question, select the question title, the question number, and the question type
               v => (   
                        Title: (string)u.GetMethod("Title").Invoke(null, new object[] { v }),
                        QNo: v,
                        QType: u
                     )
            )
         .ToList()
      )
   )
   .ToDictionary(   create a dictionary out of the questions indexed by their title
      t => t.Title,
      t => (t.QType, t.QNo)
   );

Ten or fifteen years ago, this would have been at least a hundred lines of code. With LINQ, it's reduced to one line of code.

And Roger has the nerve to call it 'average'. Philistine!

Title: Re: Chelsea Flower Show
Post by: Tarquin Thunderthighs lll on October 05, 2021, 12:43:30 PM
It's a piece of cool programming from a piece of software I wrote this year to create random maths questions (with answers).

It's cool mostly because it's one line of programming (though it's split over several lines for readability).

The main program never changes (as it just creates maths questions) but the repositories from which it chooses the questions must be capable of being added to without having to re-compile the main program, so they are placed in separate files called assemblies.

The function examines the assemblies that contain the maths questions and creates (and returns) a list of all available maths questions that the user can choose from.

return assemblies   
   .SelectMany(    turn a list of lists into a single list
      x => x
      .GetTypes()    get all the types in the assemblies
      .Where(t => t.Namespace != null && t.Namespace.Contains(".LCQ") && t.Name.StartsWith("LCQ"))    filter out the ones we need
      .SelectMany(      turn the inner list of lists into a single list
         u => Enumerable   
            .Range(0, (int)u.GetProperty("Count").GetValue(null))    get the number of questions in each type and number them
            .Select(    for each question, select the question title, the question number, and the question type
               v => (   
                        Title: (string)u.GetMethod("Title").Invoke(null, new object[] { v }),
                        QNo: v,
                        QType: u
                     )
            )
         .ToList()
      )
   )
   .ToDictionary(   create a dictionary out of the questions indexed by their title
      t => t.Title,
      t => (t.QType, t.QNo)
   );





Bet you're glad you asked now, Diane.

Anything that produces random maths questions (even with answers) is the spawn of Satan as far as I'm concerned.
Title: Re: Chelsea Flower Show
Post by: Mince on October 05, 2021, 05:09:27 PM
Anything that produces random maths questions (even with answers) is the spawn of Satan as far as I'm concerned.

So, school teachers are the spawn of Satan. Noted.
Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on October 05, 2021, 06:17:31 PM
my apologies - I thought you were trying to depict a flower with text - which WOULD have been cool seeing this is a show garden thread.
Title: Re: Chelsea Flower Show
Post by: Tarquin Thunderthighs lll on October 05, 2021, 08:14:44 PM
So, school teachers are the spawn of Satan. Noted.

Maths teachers…and tutors…but only the male ones….certainly.
Title: Re: Chelsea Flower Show
Post by: Mince on October 06, 2021, 01:43:53 PM

                  _(_)_                          wWWWw   _
      @@@@       (_)@(_)   vVVVv     _     @@@@  (___) _(_)_
     @@()@@ wWWWw  (_)\    (___)   _(_)_  @@()@@   Y  (_)@(_)
      @@@@  (___)     `|/    Y    (_)@(_)  @@@@   \|/   (_)\
       /      Y       \|    \|/    /(_)    \|      |/      |
    \ |     \ |/       | / \ | /  \|/       |/    \|      \|/
    \\|//   \\|///  \\\|//\\\|/// \|///  \\\|//  \\|//  \\\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on October 06, 2021, 02:51:25 PM
Now this is clever!


                  _(_)_                          wWWWw   _
      @@@@       (_)@(_)   vVVVv     _     @@@@  (___) _(_)_
     @@()@@ wWWWw  (_)\    (___)   _(_)_  @@()@@   Y  (_)@(_)
      @@@@  (___)     `|/    Y    (_)@(_)  @@@@   \|/   (_)\
       /      Y       \|    \|/    /(_)    \|      |/      |
    \ |     \ |/       | / \ | /  \|/       |/    \|      \|/
    \\|//   \\|///  \\\|//\\\|/// \|///  \\\|//  \\|//  \\\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^




Title: Re: Chelsea Flower Show
Post by: Mince on October 06, 2021, 03:09:15 PM
Then wait till you see this!

                                     .,.               .,;;;;;,           
                                    ;;;;;;;,,        ,;;%%%%%;;           
                                      `;;;%%%%;;,.  ,;;%%;;%%%;;
                                        `;%%;;%%%;;,;;%%%%%%%;;'
                                         `;;%%;;%:,;%%%%%;;%%;;,
                                            `;;%%%,;%%%%%%%%%;;;
                                               `;:%%%%%%;;%%;;;'         
           ..,,,.                                 .:::::::.               
        .;;;;;;;;;;,.                                  s.                 
        `;;;;;;;;;;;;;,                               ,SSSs.             
          `:.:.:.:.:.:.:.                            ,SSSSSSs.           
           .;;;;;;;;;;;;;::,                        ,SSSSSSSSS,           
          ;;;;;;;;;;;;;;;;:::%,                    ,SS%;SSSSSSsS         
         ;;;;;;,:,:::::::;::::%%,                  SS%;SSSSSSsSS         
         ;;;;;,::a@@@@@@a::%%%%%%%,.   ...         SS%;SSSSSSSS'         
         `::::::@@@@@@@@@@@a;%%%%%%%%%'  #;        `SS%;SSSSS'           
  .,sSSSSs;%%,::@@@@@@;;' #`@@a;%%%%%'   ,'          `S%;SS'             
sSSSSSSSSSs;%%%,:@@@@a;;   .@@@a;%%sSSSS'           .%%%;SS,             
`SSSSSSSSSSSs;%%%,:@@@a;;;;@@@;%%sSSSS'        ..,,%%%;SSSSSSs.           
  `SSSSSSSSSSSSs;%%,%%%%%%%%%%%SSSS'     ..,,%;sSSS;%;SSSSSSSSs.         
     `SSSSSSSSSSS%;%;sSSSS;""""   ..,,%sSSSS;;SSSS%%%;SSSSSSSSSS.         
         """""" %%;SSSSSS;;%..,,sSSS;%SSSSS;%;%%%;%%%%;SSSSSS;SSS.       
                `;SSSSS;;%%%%%;SSSS;%%;%;%;sSSS;%%%%%%%;SSSSSS;SSS       
                 ;SSS;;%%%%%%%%;%;%sSSSS%;SSS;%%%%%%%%%;SSSSSS;SSS       
                 `S;;%%%%%%%%%%%%%SSSSS;%%%;%%%%%%%%%%%;SSSSSS;SSS       
                  ;SS;%%%%%%%%%%%%;%;%;%%;%%%%%%%%%%%%;SSSSSS;SSS'       
                  SS;%%%%%%%%%%%%%%%%%%%;%%%%%%%%%%%;SSSSSS;SSS'         
                  SS;%%%%%%%%%%%%%%%%%%;%%%%%%%%%%%;SSSSS;SSS'           
                  SS;%%%%%%%%%%%%%;sSSs;%%%%%%%%;SSSSSS;SSSS             
                  `SS;%%%%%%%%%%%%%%;SS;%%%%%%;SSSSSS;SSSS'               
                   `S;%%%%%%%%%%%%%%%;S;%%%%%;SSSS;SSSSS%                 
                    `S;%;%%%%%%%%%%%'   `%%%%;SSS;SSSSSS%.               
                    ,S;%%%%%%%%%%;'      `%%%%%;S   `SSSSs%,.             
                  ,%%%%%%%%%%;%;'         `%;%%%;     `SSSs;%%,.         
               ,%%%%%%;;;%;;%;'           .%%;%%%       `SSSSs;%%.       
            ,%%%%%' .%;%;%;'             ,%%;%%%'         `SSSS;%%       
          ,%%%%'   .%%%%'              ,%%%%%'             `SSs%%'       
        ,%%%%'    .%%%'              ,%%%%'                ,%%%'         
      ,%%%%'     .%%%              ,%%%%'                 ,%%%'           
    ,%%%%'      .%%%'            ,%%%%'                  ,%%%'           
  ,%%%%'        %%%%           ,%%%'                    ,%%%%             
  %%%%'       .:::::         ,%%%'                      %%%%'             
.:::::        :::::'       ,%%%'                       ,%%%%             
:::::'                   ,%%%%'                        %%%%%             
                        %%%%%'                         %%%%%             
                      .::::::                        .::::::             
                      ::::::'                        ::::::'             
Title: Re: Chelsea Flower Show
Post by: Diane CBPFC on October 07, 2021, 12:16:56 AM
Yeah, that's a bit too much there buddy.