fbpx
Welcome, Guest
Username: Password: Remember me
Share your code snippets, screen shots etc. here
  • Page:
  • 1

TOPIC: Early Easter Quiz Question !!?? .....

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1273

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi guys,

Well, its time for some fun - educated, professional fun, before the Easter break !!

Below is an image of two Enums that I coded recently, into my test app for making data Input Masks.



Now then, without cheating, or doing any deep research, you have to guesstimate the number of similar Enum structures available for us to use in the standard set of assemblies making up the References 'set' in a reasonably standard WPF app in X#. lets say an MVVM app with Entity Framework and Galasoft MVVM framework.

I am currently working on a WPF demo app to allow us to see those that are in the DLLs, and view the full details on screen - in an interesting way. Along with the total count.

I expect guys (friends and colleagues, and all X# Forum readers) to post their guesses in short posts - before I post my app solution - so get estimating ;-0) Answers to be posted starting NOW !

Their is more to Enums than we first think - they appear so simple on the surface - BUT - in fact have a big impact on our .NET coding. I am still coming to terms with them - years after I first found how good they are. I am sure we all need to use them more than we do.

Best regards,
Phil.
Wales, UK.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1278

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi guys,

Just to give you a general pointer I have attached an image showing the reference DLLs from which I will provide a total of the Enums available to us.



Good Guessing ;-0)

Cheers,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1280

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Okay guys,

You obviously need some help on this topic / question !

I now know the answer BUT am not going to tell until a few of you guys post a guess. Come on Karl you are always game for this sort of a challenge ;-0)

Attached is an image of my early test / trial app running - you can only see the collection of Assemblies which I am scanning, and examining.



I plan to have a much more fun and interactive WPF form to allow users to select individual assemblies, and then any Enums found, to see their members and values.

Does anyone out there know how to easily get hold of all the DLLs in the Reference section. I have previously used the 'Assembly.GetExecutiveAssembly()' but this is limited it which DLLs it seems to find and make available.

Okay then folks, a hint on the grand total of Enums in these bunch of assemblies.

Let me say that there are more than the number of goals that Sunderland have scored in the Premiere League this season ;-0)

I may give you a more precise hint later. Possibly you need some more time to reflect on the question, and even reflect on the answer too !

Now post in your good guesstimates ......

Cheers,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1282

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
OK Phil.

I would say: about a hundred and fifty.

But I would not be surprised if it is about five hundreds.

Frank

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1283

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Thanks for joining in the competition Frank ;-0)

Thinking about your answer I would say in that case you may just be surprised.

This now chances the 'ball park' for answers from Karl, Wolfgang et all ;-0)

I now attach another image which shows a 'window' in the ListBox display which shows some real answers - as well as the size of the 'thumb' in the scroll bar.



Note also that the Enum items are not in alphabetic order - yet.

I have even shown you half of the code to provide the answer ;-0) So logically this means you should get half of the Grand Total value.

Good guessing .........
Cheers,
Phil.
Wales, UK.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1285

  wriedmann's Avatar wriedmann Offline Posts: 1545
Hi Phil,

please don't expect an answer from me - I'm much under time pressure for a project and than taht I will be offline for a few days now.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1287

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
Come on Wolfgang,

after my shot in the dark and Phil's answer it should not be difficult anymore. Just a number, not more. It's fun.

Frank

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1288

  wriedmann's Avatar wriedmann Offline Posts: 1545
Hi Frank,

I don't think Phil was asking us about a shot in the dark.... With Reflection it should be relatively easy to find out the required number, but I don't have the time to dedicate.

I would suspect that in all these libraries there are much more than 1.000 enums. It is enough to see how many enums are only used in the WPF classes.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1289

  FFF's Avatar FFF Away Posts: 565
Now then, some 5k i'd suspect. What reminds me of the frontispiz of one of Ivo Wessel's books, citing Ockham's razor: "non sunt multiplicanda entia sine necessitate" - don't introduce "new things" if not really, but really, necessary... ;)

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1290

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Well guys,

Now that you are loosening up a little, and letting you feelings guide you, as a team you are getting there ;-0) And how long does a quick guess take, as Frank so rightly said ?

Although what Ockham has to do with this I could not fathom out Karl !? But I did like Ivo's style of doing things. Anything.

And all my original point was about, was - we all need and use Enums, but often without much thought as to their importance, even if they are not as complex as the rest of the stuff we often need to use in .NET, we can't do without them. And our code would break if the underlying values were in any way re-mapped. Break big-time.

Below the image shows that from the large pile of 'found' enums we can in fact find the one which caused all of this fun in the first place.

'RegexOptions' is required for the Mask code I have been discussing recently.



Notice that the long list is now in alphabetical order - and this was done by a simple and small bit of LINQ code. See this next image and the code beneath it :-



In fact I have used quite a few bits of LINQ code in my lines of code to find Assemblies and Enums - and values etc. Long live LINQ - or 'LLL' for short ;-0)

And with an extra bit of code we can list and see the members of this Enum structure 'RegexOptions'.

The values allow multiple use of the members - in a bit-wise fashion (more another time).



Oh! and I still have not given the answer I found ;-0)

Lets wait to see if some guy comes up with an even better guess ! Even a second Team answer.

New hint - billions is just a bit too far to imagine etc..

OR - divide the height of the 'thumb' into the length of the vertical scroll bar, and get the wrong answer !!??

Good Luck,
Speak soon,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1291

  robert's Avatar robert Offline Posts: 969
4242?
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1292

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Nice try Robert, but slightly less than Karl's

I like the number you chose however ;-0)

But 24242 would have been much closer! (I know, it messes up the '42' idea,)

The total I found to be in all those assemblies, but one, (the Galasoft 'extra' would not load in the method) was as seen in the next image - yes, 22 thousand, 4 hundred and 49 :-

My own guesstimate as I 'penned' the original post, and got the original idea, was 2 to 4 thousand. So it is quite staggering really, even I was a LONG way out!

Check this out :-



Yes, in this "work in progress" test code things are still messy but accurate I feel.

Soon I will have an interactive WPF form, with better presentation of details.

One further screen will have a data grid with rows for Assemblies and their names and enum totals as column details.

Watch this space.

Oh! - point being, if we only use a handful of Enums in our own .NET code, could it be that we are missing a trick or two (or indeed thousands of tricks) ?

Keep on reading these posts, together we may learn something ;-0)
Cheers,
Phil.

P.S. can Karl be counted as the winner when he was 17,449 too low ?
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1293

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
Phil,

Karl Faller wrote: Now then, some 5k i'd suspect.


I read this as 5 times 5k equals 25000 :-)

Frank

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1294

  FFF's Avatar FFF Away Posts: 565

dr philip h. hepburn wrote: P.S. can Karl be counted as the winner when he was 17,449 too low ?

Ha ;)

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1303

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi Karl and all friends and X# colleagues,

I have a slight confession to make - something to do with a small piece of NASA type spacecraft code getting into my solution.

So my craft got to Mars when I was headed for Venus, or even the Moon ! ;-0))

So numerically speaking LARGE became 'large', and it looks like all of you guys who guessed will have to fight it out between you for who gets the champagne to drink.

Yes, now that I have made a new clean demo app for Enums, Assemblies, Classes and Masks etc. it would appear that a small error on one line caused me to count all Types in the assembly, for the grand total - SORRY !

The answer is actually 2363 and can be clearly seen in the image below :-



If you wish to check the code I have left the image attached but not displayed in the body of this post.

What I will add to the post itself is the code to open and display the blue form - its done in the classical way an MVVM form should be displayed.



The assemblies in the data Model are injected into the ViewModel and the VM bound to the View. Easy!

Now then, if you inspect the top blue line in the grid you will see a number you know well by now - 22449 - yes, it is actually all of the types in the collection of assemblies.

However, we still have almost 11 % of all assembly types being of type Enum - so it is still quite substantial.

The unfortunate thing from my point of view was that my first (and correct) try gave me 499, which led me to false expectations for the group of assemblies - that's my excuse.

Anyone seen a space ship cruising around ? If you have then send it back to me please ;-0)

Have a nice day,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1314

  robert's Avatar robert Offline Posts: 969
Phil,

Here are the nominees:

Frank: 150
Robert: 4242
Karl: 5000

Correct answer: 2363

Frank: 2213 to low
Robert: 1879 to high
Karl: 2637 to high


So the winner is: Robert

:):):):):)

You can bring the champagne and the statue to the conference !
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.
Attachments:

Please Log in or Create an account to join the conversation.

Early Easter Quiz Question !!?? ..... 2 years 3 months ago #1315

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Robert - somehow I had a funny feeling you may come to this conclusion ;-0)

However, rule #1 of all competitions states that no member of the management 'TEAM' can enter or win !

So maybe you get a round of applause, but no cigar ;-0((

I will buy you a beer in Cologne as recognition of your genius etc., etc..

Have a nice day,
Phil.
Wales, UK.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1