Showing posts with label Logic. Show all posts
Showing posts with label Logic. 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.
.


Friday, August 23, 2019

ImageUnion Application in C# (C Sharp) - 190823Fr

  ImageUnion Application in C#  
.
(Application for making Union of Images)
(Written by me in c# 2010)
Version: 190823Fr
.
On this year’s (2019Aug21Wed) birthday of mine, as I logged into my Twitter account I got a nice surprise of a lot of colorful balloons flying from bottom to top inside browser's client area. I enjoyed the experience very much and recalled that in previous years this happened as well. Meanwhile I kept clicking the reload button of browser to get another show of flying balloons few more times.
.
To make that moment memorable I took some screen-shots of balloon demo as well. Selected one of them, edited eg added some thanking text to it and posted on twitter.
.
After doing that I somehow saw a link just next to my information under banner. Link was saying "Happy Birthday!". I moved mouse pointer over link and clicked it. But may be because I was at the same time thinking something else I did not notice that each click was giving a new balloon demo. After afew clicks I did noticed and did clicked a few more times and at the same time enjoyed as well.
.
As I was enjoying reloading twitter page I found something very interesting in right column of Twitter page under the heading of "You might like". Immediately I took screen-shot and saved image to HDD. Because of that new found interest/attraction I clicked on "Happy Birthday!" link a few more times and took a few more screen-shots. After that and during comparing images for final selection I found that some images had more balloons and some less depending on time when I took those screen-shots, plus each image had different arrangement of balloons. I was not able to select any one of them for uploading/sharing on social media. So I decided to make an application for mixing all images together in such a way that all balloons from all screen-shots become part of one image. Background was already same in all images.
.
Therefore after making a skeleton idea for an application I started working on that and after some hours completed that successfully in c#. That application performs it's task in following three steps:
(1)_Load basic image: In this step user selects basic image with which he/she wants other images to mix.
(2)_Load Images to mix: In this step user selects images for mixing with image selected in first step.
(3)_Mix source images and save target image: In this step application mixes all images together and saves resulted image to HDD.
.
After making application I tested it a few times and felt satisfaction on the success of the application. I am sharing screen-shot of the application and their description in the following.
.
Screen shots of application and their description:
Following are screen shots of ImageUnion application at different stages with their description.
.
Application on Load:
Application looks like in the following image when it loads. Menu is on top line and status-bar is at bottom line. Area in between them is divided in three columns. In left column is option for selecting base image. In center column is option for selecting images for mixing with base image. In right column is option for generating mixed image. Mixed image gets saved automatically.
.
.

.
Help/About:
Application looks like in the following image when 'About' in 'Help' menu is clicked. This menu-item displays basic information about application and it's author.
.
.

.
Help/Purpose:
Application looks like in the following image when 'Purpose' in 'Help' menu is clicked. This menu-item display text explaining purpose of the application.
.
.

.
Help/Copyright:
Application looks like in the following image when 'Copyright' in 'Help' menu is clicked. This menu-item displays copyright text for this application.
.
.

.
Base image selected:
Application looks like in the following image when 'Select ...' button in left column "Base image to Union" is clicked and an image is selected.
.
.

.
Remaining image Selection:
(a)_Remaining images in process of selection:
Application looks like in the following image when 'Select ...' button in center column "Other images to Union" is clicked and one or more images are selected ans Remaining images selection process runs.
.
.

.
Remaining images selected:
Application looks like in the following image when 'Select ...' button in center column "Other images to Union" is clicked and one or more images are selected.
.
.

.
Target image generation:
(a)_Target image in process of generation:
Application looks like in the following image when 'Generate' button in right column "Unioned image" is clicked and some processing is done.
.
.

.
(b)_Target image generated and saved:
Application looks like in the following image when 'Generate' button in right column "Unioned image" is clicked and required image generation process completes.
.
.

.
Image of page that inspired this application:
And finally I am sharing in the following the image of screen-shot of the twitter page (as it was then) because of which I made this application. This image is generated by application by mixing many screen-shot images of Twitter page.
.

.

.
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.
.

.
Colors used in this post:
Border color rgb(64, 128, 128) #408080
Background color rgb(230, 242, 242) #e6f2f2
.

.
UPDATE [2020 Oct 01 Thu]
During previous some days I made some changes in ImageUnion-1 application's User interface and Logic and re-ran it. Then I took ScreenShots of application while it was running, on it's different stages. Then I edited those ScreenShot phots and Unioned photo. Then I replaced original photos of this post with the new ones.
.

.
If there are any mistakes then I will surely remove them whenever found.
.

.