Showing posts with label c-sharp. Show all posts
Showing posts with label c-sharp. Show all posts

Monday, August 28, 2023

Count Tokens in Text file - 230828Mo

  Count Tokens in Text file - 1  
.
Version: 230828Mo
.
Other versions
Version Link
nil No other versions so far.
.
A few weeks ago, by chance, I saw a text conversation between two of my cousins ​​on Facebook. I kept reading that conversaion as a silent observer and didn't took part in it. There was a lot of text in the conversation.
.
After a while I wondered what I should do with this conversation. Then I thought that since there is so much text in the conversation, why not check that it uses all the English alphabets and all the digits of the decimal system.
.
At first I tried to do it manually but of course it was not an easy task nor was I interested in doing it manually at all costs. So I decided to create a software application in c# (c sharp) myself to solve this task.
.
Within few days I created the required application in c# (c sharp). I named the application as "CountInText". Longer version of the name of the application under discussion is "Count Tokens in Text file". During creation of the application I added some more features to it like punctuation, word and line count etc. It was a good timepass and it also reminded earlier days of my learning computer programming.
.
In the following I am going to explain the application under discussion in this blog entry (article) with the help of screenshots of the application at different stages of it's work.
.

.
[ (*) Application preview ]
.
This image is preview of the application "CountInText".
.
.
.

.
[ (1): Application is loaded ]
Application is loaded and is ready for use.
.
.
.
[ (2a): Menu "File" expanded ]
Application menu's "File" option is expanded.
.
.
.
[ (2b): Menu "Help" expanded ]
Application menu's "Help" option is expanded.
.
.
.
[ (2b1): Menu "Help/About" clicked ]
Application menu's "Help/About" option is clicked and a reciprocating window is opened. This window displays basic information about the application.
.
.
.
[ (2b4): Menu "Help/Copyright" clicked ]
Application menu's "Help/Copyright" option is clicked and a reciprocating window is opened. This window displays copyright notice about this application.
.
.
.
[ (3a): Select Input file ]
"Select Input file" button is clicked and a dialouge box is oppened for selecting input file.
.
.
.
[ (3b1): Input file selected  ]
An input file is selected and it's path and name is displayed under "Select input file" button".
.
.
.
[ (3b1a): Input file changed ]
Application looks like this when user changes the selected input file.
.
.
.
[ (3b1b): Input file NOT changed ]
Application looks like this when user aborts the changing process of the selected input file.
.
.
.
[  (3b2): Input file NOT selected ]
Application looks like this when user clicks "Select input file" button for the first time but then aborts the process.
.
.
.
[ (4a): Check ALL clicked ]
Check "All" button under Action column is clicked and as a result all action options are selected.
.
.
.
[ (4b): Check NONE clicked ]
Check "None" button under Action column is clicked and as a result all action options are un-selected. Only default Action option remains selected.
.
.
.
[ (5): Some Options selected ]
TWehn more then one but less then all action options are selected then application looks like this.
.
.
.
[ (6): Count button clicked ]
User clicked "Count" button. Only after an input file is selected user can click "Count" button.
.
[ (6a): Counting process is running ]
User clicked "Count" button and application is counting default plus those tokens which are selected by user.
.
.
.
[ (6b1): Process completed - first view   ]
Application looks like this when token counting process completes successfully.
.
.
.
[ (6b2): Process completed - second view ]
Application looks like this when token counting process completes successfully. Now application is ready for next task. User needs to click "Clear" button to enable "Count" button.
.
.
.
[ (7): Clear button clicked ]
User clicked "Clear" button for clearing form fields and un-checking all none-default action options.
.
[ (7a): Clearing forme ]
Form clearing process is in progress.
.
.
.
[ (7b): Form cleared ]
Clearing form process completed.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
21°, 42%, 33% (0, 155, 119 #774931
 
21°, 42%, 80% 181, 212, 205 #e1c6b7
.

.
If there are any mistakes in this post then I will remove them whenever I will know about them.
.


Wednesday, March 3, 2021

Color mixer in c-Sharp - 210304Th

  Color mixer in c-Sharp  
.
Version: 210304Th
.
Other versions
Version Link
None No other versions available yet
.
.
Few months ago, one evening, I was sitting in TV lounge of our home and watching some TV program. My niece came to me and asked in her soft voice "How to know what color is made by mixing any two colors?". I said "mix any two colors and you will know". She said "No! Without mixing any colors". I tried to find and give some answer to my niece but had no idea.
.
Therefore instead of answering, somehow, I went into thoughts and started thinking how to give a useful answer to my niece. During same thinking session I wondered why not I make an application for my niece for solving this problem. An application in which my niece can mix any two colors to get the resulting color.
.
After getting this idea I started making the above mentioned application in c#. I made more than one version of the application to test the look and feel of different type of user-interface and code-logic. The version of the above mentioned application I am sharing/discussing here is n-layer based.
.
Following are some screen-shots of the above mentioned application I made in c# for my niece.
.

.
[Application Preview]
Application's preview.
.
.
.
[Application How to Use]
For selecting new color click "Choose color A" and/or "Choose color B" in menu "Action/Select colors/[Choose color A | Choose color B] or in toolbar "Choose color A | Choose color B" or in form right of "Select color" and under "Color A" and/or "Color B" boxes.
For randomly select new "Color A" and/or "Color B" click in menu "Action/Random colors/[Method 1 | Method 2]" or in toolbar's "Random color" part "Method 1" and/or "Method 2".
"Method 1" generates randomly new values for "Color A" and "Color B" and constant value "50%" for 'Color blend %" for "Color A" and "Color B". "Method 2" generates randomly new values for "Color A", "Color B" and "Color blen %" values for "Color A" and "Color B".
.

.
[Application at start]
Application in it's initializing phase. At this phase application initializes itself based on default settings and  settings saved in previous session .
.
.
.
.
[Application started]
Application's main form loaded and is ready for use.
.
.
.
[Application's menu File]
Application's menu option "File" expanded.
.
.
.
[Application's menu Action]
Application's menu option "Action" expanded.
.
.
.
[Application's mulenu Action/Select colors]
Application's menu option "Action/Select colors" expanded.
.
.
.
[Application's menu Action/Random colors]
Application's menu option "Action/Random colors" expanded.
.
.
.
[Application's menu Help]
Application's menu option "Help" expanded.
.
.
.
[Application's menu option Help/About]
Application's menu option "Help/About" clicket.
.
.
.
[Application's menu option Help/Purpose]
Application's menu option "Help/Purpose" clicked.
.
.
.
[Application's menu Help/Main form]
Application's menu option "Help/Main form" expanded.
.
.
.
[Application's menu Help/Color picker
Application's menu option "Help/Color picker" expanded.
.
.
.
[Application's menu Help/Copyright]
Application's menu "Help/Coplyright" clicked.
.
.
.
[Application's Color selecter form]
Application's Color selector/picker form displayed. In this form user can select color via Named-color, Color-picker or Comon-colors..
.
.
.
[Color selected ]
Some samples of main form after color is selected via Color selector form
.
.
.
.
.
.
.
[Application at End]
Application's in it's closing phase. At this phase application saves it's different settings and status..
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
306, 94%, 45% 224, 007, 203 #e007cb
 
306, 38%, 79% 222, 182, 218 #deb6da
.

.
If there are any mistakes in this post then I will remove them whenever I will know about them.
.