Showing posts with label c#. Show all posts
Showing posts with label c#. Show all posts

Monday, July 1, 2024

Prime numbers generator - 6 - 240701Mo

  Prime numbers generator - 6 [2/2]  
.
(Finds all prime numbers between 2 and 32000000002 - c#)
Version: 240701Mo
Previous version: 171005Th
.
Decades ago, I was a regular visitor to the Liaquat National Memorial Library in Karachi, where I spent countless hours reading books. Although I no longer remember how and when my first visit to the library happened, I still fondly remember spending several hours over many years in the library's reading hall, reading books on different subjects. While computer programming books were my primary interest, I also enjoyed reading books on various subjects and browsing through different newspapers. It was at this library that I first discovered books on Lisp and Prolog, but my true passion was for books on C programming language, and I was fortunate to find an impressive collection of high-quality titles on the subject.
.
The Liaquat National Memorial Library offered a serene and peaceful environment, conducive to learning. After a few visits, I realized that arriving early was crucial to securing a seat in the vast reading hall, which was always in high demand. This knowledge motivated me to arrive promptly on subsequent visits, ensuring that I could fully utilize the library's resources and enjoy the tranquil atmosphere.
.
The Liaquat National Memorial Library's proximity to PTV Karachi offered a thrilling bonus - glimpses of TV stars of the time, such as Subhani ba Yunus, during my visits. One afternoon, I even spotted the renowned Pakistani movie star, Mohammad Ali, standing by the library entrance, engaged in conversation with someone. I believe he was a federal minister at the time. Unfortunately, my focus was elsewhere, preoccupied with getting photocopied chapters of a Unix book, and I missed the opportunity to request his autograph. I still recall his tall stature, pinkish-white complexion, and warm smile. It's a memory I cherish, even if I didn't get his signature.
.
Let's come to the topic of this blog post. During one of my visits to the Liaquat National Memorial Library, I requested the latest edition of the Guinness Book of World Records. While browsing through its pages, I stumbled upon a fascinating entry about a competition to discover prime numbers with a larger number of digits than any previously known prime number. Since I was already familiar with the process of determining whether a number is prime or not, an idea struck me: why not use a computer to find some prime numbers myself?
.
Since then, I have been exploring various software applications at my disposal to develop programs for discovering a vast number of prime numbers. Over time, I have utilized a range of computers and softwares, which are listed as follows:
.
  1. Turbo C version 2 ON Pentium 2 and Pentium 3
  2. Html and JScript ON Pentium 4
  3. GCC ON Pentium 3 and i5
  4. C# 6 ON Pentium 3
  5. C# 2008 ON Pentium 4
  6. C# 2010 ON i5
.
Across various software platforms and at different times, I experimented with diverse methods for discovering prime numbers, including the 'long hand division method' and various iterations of the 'Sieve method'. Additionally, I persistently researched online, stumbling upon websites showcasing extensive lists of prime numbers, such as the first million prime numbers. This sparked a thought - I too have amassed a substantial collection of prime numbers on my computer's hard drive. Why not share my findings, even if I'm not the first to discover them, on the internet someday?
.
As a result, I reran the current version of my prime number finding application to explore prime numbers within various upper limits under 32000000002. Notably, when setting the upper limit to 20000000, I discovered approximately a little more than one million prime numbers. I'm sharing below some of the outputs from these prime number searches. So far the maximum I reached for continuous list of prime numbers is as follows:
.
  • Range......................: [2 and 32000000002] inclusive
  • Prime numbers found.: [1382799415]
  • Largest prime number: [31999999987]
.
In previous version of this post I had shared a list of first "6542" prime numbers, under 2^16, I found using software made by me using C# 2010. In previous versions of this post I had also shared links to files containing first 1270607 prime numbers I found under 20000000 using an application I made in c# 2010.
.
Today in this post in the following I am shareing screeshots of the application which is under descussion in this post and this post's previous version.
.

.
.
Application Output
Following are screenshots of the application I took at different stages of application.
.
(Application is loaded)
.
(Process is finished successfully)
.
.

.
  I hope to share more of my discoveries in the future  
.

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

I will upload source code of application I made and used for generating above prime numbers in some near-future post some time else.
.


Saturday, May 20, 2023

Sliding Button - 2

  Sliding Button - 2  
.
(Lucky number generator, Get your lucky number)
.
Version: 230504Th
.
Other versions
Version Link
nil No other versions so far.
.
About a decade ago I came up with an idea of creating a Windows Forums application having a special type of button. That button should be like such that whenever the user clicks on the button with the mouse, the button should slide from under the mouse pointer. That idea remained an idea and could not go any further.
.
Now! Few days ago, somehow, that idea again visited my brain and I decided to give it a try. For that very purpose I did some planning like what kind of windows forms application I should make for implementing that old idea of mine. After making a virtual list of work-wise application type candidates I selected a simple type and started developing the required application. In few hours I completed the 1st version of the application.
.
In this blog entry I am going to discus that application in some detail.
.
First I kept the working of the application as simple as possible. I named it "Slipping button". "Sliding button", "Get your lucky number" and "Lucky number generator" were other names in my consideration. I used "Lucky number generator" as text (display name, title) of the application. From applications's names it is obvious that it generates and displays a number as a lucky number. To keep things simple application randomly generates a lucky number between changeable two seed numbers.
.
Working of the application is simple and is as follows:
1)_Change seed number values or leave them as they are.
2)_Click "Get" button for getting lucky number.
*)__(This displays user's lucky number)
.
Fun starts when user clicks on the "Get" button because when user clicks on the "Get" button
either "Get" button remains on it's position and application displays the lucky number
or "Get' button simply and completely slides from under the mouse pointer and lucky number is not displayed.
Because of this behavior of the "Get" button user has to make multiple tries to get his/her lucky number. This behavior of the "Get" button can annoy, frustrate and entertain the user at the same time.
.
Following are some screen-shots of the above mentioned "Get your lucky number" application I made in c#.
.

.
[(*) Lucky number generater]
.
A view of the "Sliding Button", or "Slipping button" or "Get your luck number" or "Lucky number generater" application. First is name of this application and remaining three are it's nick names etc.
.
.
.
[ (0) Application loaded]
Application is loaded and is ready for use.
.
.
.
[(01) Seed number values are changed.]
User has changed booth seed numbers. Changing seed numbers is optional. User cand change both number, only one number or leave their values as it is.
.
.
.
[(02) Get button is clicked]
.
[(02a) "Get" button slided]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointer. Therefor no lucky number is displayed. In the following section different position on which "Get" button slided during the session are displayed.
.
[(02a1) "Get" button slided to the Bottom left corner.]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Bottom Left Corner. Lucky number is not displayed.
.
.
.
[(02a2) "Get" button slided to the Top right corner.]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Top Right Corner. Lucky number is not displayed.
.
.
.
[(02a3) "Get" button slided to the Top Left corner.]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Top Left Corner. Lucky number is not displayed.
.
.
.
[(02a4) "Get" button slided to the Center Left side]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Center Left Side. Lucky number is not displayed.
.
.
.
[(02a5) "Get" button slided to the Top Center side]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Top Center side. Lucky number is not displayed.
.
.
.
[(02a6) "Get" button slided to the Bottom Right corner.]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Bottom Right Corner. Lucky number is not displayed.
.
.
.
[(02a7) "Get" button slided to the Bottom Center side]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Bottom Center side. Lucky number is not displayed.
.
.
.
[(02a8) "Get" button slided to the Center Right corner.]
.
User clicked on the "Get" button but "Get" button slided from under the mouse pointe to the Center Right side. Lucky number is not displayed.
.
.
.
[(02b) Lucky number generated]
.
User clicked on the "Get" button and "Get" button remained on it's default position i.e Center, Center. Lucky number is generated and displayed.
.
.
.
[(03) Clear button clicked]
.
User clicked "Clear" button and form is cleared (reset to it's default state). First seed  number's valued is set to "1000" and Second seed number's value is set to "9999".
.
.
.
[(04) Help button clicked]
.
User clicked "Help" button and Help form is displayed. Help form displayes scrollable useful help information about this application.
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
60°, 20%, 35% 107, 107, 71 #6b6b47
 
60°, 19%, 85% 224, 224, 209 #e0e0d1
.

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


Friday, February 3, 2023

kfProgressbar - 5 - 190724We

  kfProgressbar - 5  
.
Version: 190724We
.
Other versions
Version Link
141204We Fancy Progressbar - Ver 2 - C Sharp
170410Mo FG Progressbar 03.01 - 170410Mo
180430Sa FancyProgressbar - 3 - (User Control) - 180430Sa
.
Some years ago I had made a good looking Progress Bar with advanced graphic look and feel as a User-Control in c sharp. Before making that user-control I had made an application for trying and testing various different styles for my intended progressbar. My idea for making that kind of progressbar was to show progress steps graphically during on going progress.
.
In June of year 2022 I searched on hard-drive of computer for the final version of the above mentioned application. That application was it self the first version of progressbar of its category. I had searched for that application, mentioned above, mostly to revisit a dimension of my past. After finding that application I ran it and during that session I kept going back in time again and again. I ran that application a few more times and after revising its different options I took and saved some screen-shots at different levels/states of the application. I did that for sharing online. I had named that progressbar "kfProgressbar - 5".
.
In this blog entry I am going to discus that progressbar in some detail.
.
Main purpose of making this graphical progressbar was to have a progressbar which can also display information about running progress at sub-steps like at every percent of the progress. This progressbar also displays "amount of work" and "time consumed for the work" for each percentage of work completed besides displaying information for total progress.
.
Following are some screen-shots of the above mentioned progressbar demonstrating application I made in c#.
.

.
[ (0) Application loaded]
Application is loaded and is ready for use.
.
.
[(0a) Process related]
.
[(0a1) Start button Clicked.]
[(0a1) Process is running . . .] Start button is clicked and process is started and is running. Progressbar is displaying progress information as a graph. At top it is displaying information about work completed and at bottom it is displaying time consumed for completed work.
.
.
.
[(0a2) Process completed successfully] Start button was clicked and process was started and process is completed successfully.
.
.
.
[(0a2) Process canciled]
During a running process Cancel button is clicked and process aborted itself.
.
.
.
[(0b) Application Help form displayed]
"Show help" button is clicked and useful information about application are displayed in the Help form
.
.
.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
30°, 100%, 50% 255, 128, 0 #ff8000
 
31°, 100%, 90% 255, 230, 204 #ffe6cc
.

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


Wednesday, August 17, 2022

FancyProgressbar - 3 - (User Control) - 180430Sa

  FancyProgressbar - 3 (User control)  
.
Version: 180430Sa
.
Other versions
Version Link
141204We Fancy Progressbar - Ver 2 - C Sharp
170410Mo FG Progressbar 03.01 - 170410Mo
.
Few days ago I specially searched on hard-drive of computer for an application I had made some years ago in c# (c sharp) for demonstrating a progressbar (user control). I had made that demonstration applicaton for testing progressbar usercontrol I had made in c# (c sharp). After finding that application I ran it for some time and after testing/revising it's different options I took and saved some screen-shots at different levels/states of application. I did that for sharing online. I had named that progressbar "FancyProgressbar - 3".
.
In this blog entry I am going to discus that progressbar in some detail.
.
First the purpose of making this progressbar was to have a progressbar which can display progress status of the process over it. This progressbar can display, user chose-able, following type of information over it:
.
  1. Progress status/state
    1. Ready
    2. Working
    3. Cancel
    4. Error
    5. Complete
  2. Progress percent
    1. Completed
    2. Remaining
  3. Time
    1. Elapsed
    2. Remaining
.
Following are some screen-shots of the above mentioned progressbar demonstrating application I made in c#.
.

.
[ (1) Application loaded]
Application is loaded and is ready for use.
.
.
.
.
[(1a) Application tab is active]
Application tab, out of it's three tabs, is active.
.
.
.
[(1a1) Error generation]
Generate ERROR during process option (CheckBox) is checked/selected. Purpose of this option is to have ability to generate ERROR programmatically during process for testing purpose. When this option is checked process randomly aborts between progress percent of 33 to 66.
.
.
.
[(1a2) Progressbar width]
Progressbar with is modified (increased). Purpose of this option is to have ability for test application to change width of progressbar for testing.
.
.
.
[(1a3) Progressbar text]
Progressbar text options are expended. Purpose of this option is to give ability to select different combination of text/information over progressbar.
.
.
.
[(1a4) Process related]
.
[(1a4a) Start button clicked]
[Process is running . . .] Start button is clicked and process is started and is running. Progressbar background color is light-Blue and progressbar color is dark-Green. Progressbar is displaying from left to right progress percent completed, time elapsed, progress state i.e. working, Time remaining, progress percent remaining.
.
.
.
[Process completed successfully] Start button was clicked and process was started and process is completed successfully. Progressbar background color is light-Blue and progressbar color is dark-Green. Progressbar is displaying from left to right progress percent completed, time elapsed, progress state i.e. working, Time remaining, progress percent remaining.
.
.
.
[(1a4b) Cancel button clicked]
During a running process Cancel button is clicked and process aborted itself. Progressbar color is changed to Orange.
.
.
.
[(1a4c) ERROR generated]
During a running process ERROR is generated programmatically. This happened because "Error generation" CheckBox was checked. Progressbar color is changed to Red.
.
.
.
[(1b) Help tab is active]
Useful information about application are displayed in this Help tab
.
.
.
[(1b1) About and Author]
In this image About and Author sections of Help tab are visible. About section displays basic information about application. Author section displays basic information about author of application i.e. me "Khursheed Fateh".
.
.
.
[(1b2) How to Use]
Help tab's "How to Use" section in simple text describes/explains how to use this application.
.
.
.
[(1b3) Features of Progressbar]
"Features of Progressbar" section of Help tab describes and explains different features of this application. This section is further divided into 2 parts. (Labels: Three type of information displayed over progressbar), (Status: Five status options for progressbar).
.
.
.
[(1c) Exit tab is active]
User can EXIT from this application only from here. This tab displays a button with text "EXIT FROM HERE". Clicking this button closes this application. This button occupies entire area of the tab and has red background color and white text color.
.
.
.
[(1d) Application Exiting methods]
.
[(1d1) Application System menu is expanded]
Application's system menu is expanded by clicking on the application/form icon on Left-Top of the application form.
.
.
.
[(1d2a) Close button of form is clicked]
Close button of the form situated on the right-top of the form is clicked and this opens a Hint window explaining how to exit from application.
.
.
.
.
[(1d2b) Close option of System menu clicked]
First application/form icon on the left top of the formis clicked. Second System menu is displayed. Third Close option from System menu is clicked. This opens a Hint window explaining how to exit from application.
.
.
.
[(1d2c) Alt+F4 is pressed on Keyboard]
Alt+F4 key combination is pressed from keyboard and this opens a Hint window explaining how to exit from application.
.
.
.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
174°, 52%, 33% 40, 128, 119 #fcba03
 
174°, 62%, 90% 213, 245, 242 #d5f5f2
.

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


Thursday, August 5, 2021

Computerized generic calendar - 210805Th

  Computerized generic calendar  
.1);">.
Version - 210805Th
.
Other versions
Version Link
210410Sa Manual Generic Calendar - 210410Sa
.
Many years ago I made a manual calendar for displaying any year's entire calendar in same place. I described that manual calendar in a blog post with title Manual Generic Calendar - 210410Sa.
.
At start I used to use that Manual generic calendar I described in a post here from time to time but as I started having access to other means like computers etc I almost stopped using that calendar. Since then I am keeping that calendar in a drawer of my closet in my room safely.
.
I only take that calendar out to show others or to use myself and/or to go back in time when I made it. Some months ago when I was using that calendar and going back in time I got an idea. That idea was to make it's simulator on computer. That idea looked good to me and I started thinking about it.
.
After a few days I started making a software version of that calendar and in a few days completed it's first version. This post is to describe Computer version (I made in 2020) of the Manual version (I made a few decades ago).
.

.
Above described application "GenericCalendar - 1" is explained, with images where required, in the following.
.

.
[ User interface of Application ]
Application's user interface is explained in the following.
.
User Interface
.
.

.
[ How to Use Application ]
Application's use is explained in the following.
.
How to Use
.
.

.
Following are the screen shots of "GenericCalendar - 1" aplication with explanation.
.

.
[ Application is loaded ]
Application looks like in the following photo when loaded.
.
.
.

.
[ Application's Action/Weekly-holidays menu expanded ]
Application's Action/Weeklly-holidays menu looks like this. It has options for each day of week.
.
.
.

.
[ Application's Help menlu is displayed ]
Application's Help menu is displayed. It has 5 options About, Purpose, User interface, How to use, Copyright.
.
.
.

.
[ Application's Help/About form is displayed ]
Application's Help/About form is displayed. It displays  basic information about application.
.
.
.

.
[ Application's Help/Purpose form is displayed ]
Application's Help/Purpose form is displayed. It displays purpose of this application.
.
.
.

.
[ Application's Help/Copyright form is displayed ]
Application's Help/Copyright form is displayed. It displays copyright notice of this application.
.
.
.

.
[ Leep year displalyed ]
Application looks like this when leep year is selected/entered and calendar is displayed..
.
.
.

.
[ Year value selected/entered ]
Application looks like this when new year value is selected/entered by user and calendar for that year is displayed..
.
.
.

.
[ Day of week changed ]
Application looks like this when day of week is changed and calendar is displayed
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
213, 51%, 40% 050, 097, 154 #32619a
 
213, 51%, 64% 116, 159, 210 #749fd2
.

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

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