Beau Peep Notice Board
Beau Peep Notice Board => Outpourings => Topic started 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?
-
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!
-
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
-
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...
-
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.
-
None of mine hatched. Sorry!
-
Superb cartoon, Tarks!
-
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.
-
Actually, it's pretty average.
-
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?
-
a)...Yes.
b)...Yes.
c)...No.
-
I'll show you what the text looks like in North America and you can see why I wasn't impressed.
-
It looks perfect to me.
-
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.
-
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!
-
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.
-
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.
-
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.
-
So, school teachers are the spawn of Satan. Noted.
Maths teachers…and tutors…but only the male ones….certainly.
-
_(_)_ wWWWw _
@@@@ (_)@(_) vVVVv _ @@@@ (___) _(_)_
@@()@@ wWWWw (_)\ (___) _(_)_ @@()@@ Y (_)@(_)
@@@@ (___) `|/ Y (_)@(_) @@@@ \|/ (_)\
/ Y \| \|/ /(_) \| |/ |
\ | \ |/ | / \ | / \|/ |/ \| \|/
\\|// \\|/// \\\|//\\\|/// \|/// \\\|// \\|// \\\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
Now this is clever!
_(_)_ wWWWw _
@@@@ (_)@(_) vVVVv _ @@@@ (___) _(_)_
@@()@@ wWWWw (_)\ (___) _(_)_ @@()@@ Y (_)@(_)
@@@@ (___) `|/ Y (_)@(_) @@@@ \|/ (_)\
/ Y \| \|/ /(_) \| |/ |
\ | \ |/ | / \ | / \|/ |/ \| \|/
\\|// \\|/// \\\|//\\\|/// \|/// \\\|// \\|// \\\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
Then wait till you see this!
.,. .,;;;;;,
;;;;;;;,, ,;;%%%%%;;
`;;;%%%%;;,. ,;;%%;;%%%;;
`;%%;;%%%;;,;;%%%%%%%;;'
`;;%%;;%:,;%%%%%;;%%;;,
`;;%%%,;%%%%%%%%%;;;
`;:%%%%%%;;%%;;;'
..,,,. .:::::::.
.;;;;;;;;;;,. s.
`;;;;;;;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