Wednesday, May 24, 2017

Randomnes Tester - Ver 3 - C Sharp

Randomnes Tester ver 3
(Written by me in c#)
.
      Some years ago while working in beautiful Borland Turbo C and using Random numbers, for doing something, I thought why not test how many times any number comes in a list of Random numbers. So I then made a C program for testing that. At watching result of that program I was a little surprised.
      In first version that program generated 100 random numbers and displayed them on screen/CRT. i was surprised to see that some numbers were generated more then once and some never. So I made another version of that program  and I changed it's working a little from first one. Now although it was still generating random numbers between 0 and 99 but a lot of time and was storing how many times a number was getting generated in a array of 100 elements. In fact it was generating random numbers multiple of 100 times between 0 and 99. Now again I was surprised to see it's result. This time almost all numbers were generated 1 percent of times. All of this looked very interesting to me.
      Few months ago I planned/decided to put that program on my this blog but because that program was in Pentium 3 and because that Pentium 3 is no longer working so after thinking and thinking I made that program in c# in visual-studio 2010 for putting/sharing on my this blog. I named this new application 'RandomnesTester'.
      It's user interface is simple and easy to use. At top right it shows a button with text 'Help'. Click this button for viewing Help information about this application. Next to 'Random number count' enter how many random number are required. It is a UInt32 field. Next to it is 'Max value' button. Click it to get  max number entered in 'Random number count' field automatically. Helpful alert messages will display on invalid inputs. Click 'Start' button for starting process. Click 'Stop' button for stoping/cancelling process any time while it is running. On success result will display Under 'Randomnes Test Result'. Column 'Number' will show all numbers it generates from 0 to 99. Column 'Count' will show how many times each number is generated. Column 'Percentage' will show how many percent of times a number is generated. Under these is footer. Footer will show total numbers in 'Number' column under 'Number' column, total of 'Count' column under 'Count' column and total of 'Percentage' column under 'Percentage' column.   Different text messages will show in bottom left telling what application is doing. Process status will show in text in bottom left and in progressbar in bottom right.
.

      Following are the screen shots of 'RandomnessTester' version 3 application with explanation.
.
Application looks like this when it is loaded.
.

.
This is application's Help screen. It displays basic information about application under 'About' section, purpose under 'Purpose' section and how to use under 'How to Use' section.
.

.
If input number is not valid then application displays this alert message giving user 2 options as discribed in it.
.

.
This alert message is displayed when input number is not multiple of 100 telling it will be made so.
.

.
Application looks like this when (1st) Valid number in entered , (2nd) 'Start' button is clicked and (3rd) It begin processing. During processing helpfull information is displayed in status line at bottom
.

.
Application looks like this when during processing 'Stop' button is pressed, Cancelling process. Helpfull information is displayed in status line at bottom
.

.
Application looks like this when processing ends successfully, Helpfull information is displayed in status line at bottom
.

.
      In above image result of process is displayed under 'Randomnes Test Result'. And from this it can be observed that all numbers betwen 0 and 99 are generated near 1 percent of times.
.

      Enjoy Complete Source code of application written and compiled in visual studio 2010 Ultimate by me. Download it. Extract it. Read 'ReadMeFirst.txt' file and do as is explained in it.
.


Saturday, May 6, 2017

Menu for TV - Ver 1 - C Sharp

Menu for TV - Ver 1
(Proposed Menu for TV)
(Demo application is written by me in c# 2010)
.
      Few years ago our Cable provider changed sequence of tv channels again and again in a few months and it made me very upset. Every time they were changing channel sequence I was re-arranging them back to, as much as possible, already memorised sequence numbers. But after that doing it again and again atleast once every year made me to think something else for solving this problem.
      My idea was and still is to some how 'make' tv-menu or 'extend' already availabe tv-menu in tv sets. And in this new and/or extended tv-menu some-where (1) have options for searching tv-channels by typing their name, brand or type etc and (2) have lists of tv-channels orderd in different useful ways eg by-name, by-brand, by-type etc.
      To test and view how menu arrangement look like i made an appllication in c# 2010. I implemented my idea through menu-item  'Channel', which is under menu-item 'TV Menu', with sub menu-items "Search", 'As is', 'Ordered' and 'User Preference' etc. Application and it's menu system is explained bellow with images where required or available.
.
Application at Start:
       Application looks like this on start. On top-left is the menu, 'TV Menu', I was discussing above. Under it under 'Help' in four rectangles 'About', 'Copyright', 'Purpose' and 'How to Use' information is displayed. How it all looks like is shown in following image.
.
.

.
Application Menu - 'TV Menu':
       'TV Menu' is the menu I made to see and perfect look of my proposed menu for tv sets. This is available on top-left of application.
.

.
'TV Menu/Channel/Search' menu-item:
      This menu-item will provide options for searching tv-channels by entering full or part of their 'name', 'brand' or 'type' etc. How it may look like is shown in following image.
.
.

.
'TV Menu/Channel/As is' menu-item:
      This menu-item will show selectable list of channels in order set by Cable provider. How it may look like is shown in following image.
.
.

.
'TV Menu/Channel/Ordered' menu-item:
      This menu-item will have sub menu-items like 'By Frequency', 'By Alphabet', 'By Brand' and 'By Type' etc for displaying tv-channel list by some order. These sub menu-items are explained bellow.
.
'TV Menu/Channel/Ordered/By Frequency' menu-item:
       This menu-item will display selectable list of tv-channels  ordered by their transmision frequency. How it may look like is shown in following image.
.
.

.
'TV Menu/Channel/Ordered/By Alphabet' menu-item:
       This menu-item will display tv-channels  ordered by their names. This menu-item will have sub menu-items with names made of first character of tv-chanels. Eg 'A', 'Z', '0' and '5' etc. Each of these one character menu-items will display selectable list of ordered tv-chanels with names starting with this character.  How it may look like is shown in following image.
.
.

.
'TV Menu/Channel/Ordered/By Brand' menu-item:
       This menu-item will display tv-channel list ordered by their Brand (Brand=Company of channel). This menu-item will have sub menu-items with names made of brand-names of chanells.  Each of these brand-name menu-items will display selectable  ordered list of tv-chanels from these brands. How it may look like is shown in following image.
.
.

.
'TV Menu/Channel/Ordered/By Type' menu-item:
       This menu-item will display tv-channel list ordered by their type eg 'Sports', 'News' and 'Drama' etc. This menu-item will have sub menu-items with names made of channel type eg 'Drama', 'Sports' and 'News' etc. Each of these type-name menu-items will display selectable ordered list of tv-chanels of this type  from different brands.  How it may look llike is shown in following image.
.
.

.
'TV Menu/Channel/User Preference' menu-item:
       This menu-item will allow user to store and then display selectable list of tv-channels according to their preferences. How it may look like is shown in following image.
.
.

.
'TV Menu/Setting' menu-item:
       This menu-item will have all setting options for tv. How it may look like is shown in following image.
.
.

.
'TV Menu/Entertainment' menu-item:
       This menu-item will have all entertaining options for tv. For example in our current tv set 'Game' option is very entertaining.  How it may look like is shown in following image.
.
.

.
       I am shareing source code of that application here also.
.
      Enjoy Complete Source code of application written and compiled in visual studio 2010 Ultimate by me. Download it. Extract it. Read 'ReadMeFirst.txt' file and do as is explained in it.