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, October 12, 2022

Sliding Puzzle 9x9 - 1 - 221011Tu

  Sliding Puzzle - 9x9 - 1  
.
Version: 221011Tu
.
Other versions
Version Link
220915Th I solved sliding Puzzle-15 game - 220915Th
.
On evening of PkT 2022 Sep 14 Wed my niece asked for my help while playing sliding “puzzle 15” game. I found that she had solved top 3 rows out of total 4 rows. I felt happy on watching that and at the same time felt sorry because I had no idea how to solve that puzzle game.
.
Therefore for helping my niece in solving that puzzle game I started learning online that game myself. After reading some articles about that game on couple of sites/pages I found the strategy/method required for solving “puzzle 15” game.
.
Till late night, on that day, I kept learning and practicing solving “puzzle 15” game so that I could teach my niece next time how to play and solve puzzle games like “puzzle 15”.
.
While I was learning and playing that game i remembered that a few years ago i had made a similar game on computer. So on my next session on computer I started that game for playing and found that that game was actually Puzzle-8 game. Fortunately the strategy I had learned for Puzzle-15 game worked on Puzzle-8 game also and then I solved Puzzle-8 game for the first time. Major difference between Puzzle-8 game and Puzzle-15 game is dimension of their grid.
.
During that session of learning and playing and solving sliding Puzzle-15 game online and Puzzle-8 game on PC on game made by me in c# (c sharp) an interesting idea visited my mind. The idea was to make an upgraded version of the Puzzle-8 game I had already made on PC in c#. Major improvement I wanted to make was to make the game flexible in its size so that it could be played as 2x2 (Puzzle-3) to 9x9 (Puzzle-80) puzzle game. I kept upper limit to 9 for keeping game’s user-interface user friendly.
.
Quickly I started work on that idea of mine and made the new and upgraded version of Puzzle-8 in a few days in c#. In this blog in the following I am going to discuss the new and upgraded version of Puzzle-8 I named Puzzle-9x9.
.
Following are some screen-shots of the above mentioned sliding puzzle game demonstrating different states of application (sliding puzzle game) I made in c#.
.

.
[ Application preview ]
This image I added here as a preview of my slef made Puzzle-9x9 game I am discussing here.
.
.
.

.
[ (01) Sliding Puzzle-9x9 is loaded ]
Sliding game application is loaded and is ready for use.
.
.
.
.
[ (01a) Menu]
[ (01a1) Game's Game menu is displayed ]
Puzzle game's Game menu is clicked displaying its only option i.e. Quit.
.
.
.
[ (01a1a) Menu's Game/Quit option is clicked ]
Puzzle game's Game/Quit menu option is clicked and an alert message window is displayed. This window confirms wether user really want to quit application or not.
This alert window opens when user tries to Quit application using application menu's Game/Quit option or clicks form's red colored Close button on its top right or clicks system menus close option.
.
.
.
[ (01a2) Game's Help menu is displayed ]
Puzzle Game's Help menu is clicked displaying its 5 options.
.
.
.
[ (01a2a) Help/About is displayed ]
Game's Help/About option is clicked and a window is opened displaying basic information about Puzzle game application.
.
.
.
[ (01a2b) Help/Purpose is displayed ]
Game's Help/Purpose option is clicked and a window is opened displaying Purpose of this Puzzle game application.
.
.
.
[ (01a2c) Help/User-Interface is displayed ]
Game's Help/User-Interface option is clicked and a window is opened displaying information about User-interface of this Puzzle game application.
.
.
.
[ (01a2d) Help/How-to-use is displayed ]
Game's Help/How-to-use option is clicked and a window is opened displaying information describing how-to-use this Puzzle game application.
.
.
.
[ (01a2e) Help/Copyright ]
Game's Help/Copyright option is clicked and a window is opened displaying Copyright notice for this Puzzle game application.
.
.
.
[ (01b ) Action ]
[ (01b1) Button New is clicked ]
Button "New" is clicked. This diables "New" button and enables Shuffle" button and "Puzzle grid size" option and "Start" button. Puzzle grid with default/currently-set grid size is also displayed.
.
.
.
[ (01b2) Puzzle grid size option is expanded  ]
Puzzle grid size comboBox is clicked displayling Puzzle grid size options available.
.
.
.
[ (01b2a) New Puzzle grid size is choosen ]
From "Puzzle grid size" comboBox new puzzle grid size is choosen and therefore new puzzle grid is displayled arrording to the selected grid size.
.
.
.
[ (01b3) Button Shuffle is clicked ]
Button "Shuffle" is clicked and tiles on sliding puzzle grid are shuffled. This option can be used for getting new tile arrangement.
.
.
.
[ (01b4) Button Start is clicked ]
Button "Start" is clicked. This action disables "New" button, Puzzle grid size comboBox, Shuffle button and Start button. This action enables Close button.
This action turns tile color to Steelblue for those tiles which are not on their correct position and Green to those tiles which are on their corrent position.Now Puzzle is ready for playing.
Now Puzzle is ready for player to solve it.
.
.
.
[ (01b4a) Some moves are made ]
Sliding puzzle game looks like in this image after some moves are made. Useful information is displayed under button sectio n on right side.
.
.
.
[ (01b4b) Puzzle is solved (1) ]
Puzzle is solved and a congratulating message is displayed.
.
.
.
.
[ (01b4c) Puzzle is solved (2) ]
Puzzle was solved and a congratulating message was displayed. After closing that message application looks like this. In status line application is telling that game is solved and now player must click "Close" button to close this game and get option for starting new one.
.
.
.
[ (01b5a) Solved Puzzle is closed ]
Puzzle was solved and then closed. In this situation application looks like in this image. All tiles on their correct position are in green color. Button "New" is enabled and everything else is disabled in action section.
.
.
.
[ (01b5b) Un-solved Puzzle is closed ]
Puzzle was not solved but was closed. In this situation application looks like in this image. All tiles on their correct position are in green color and others are in purple color. Button "New" is enabled and everything else is disabled in action section.
.
.
.
[ (01c) Puzzle-9x9 giid in diferent sizes ]
[ (01c1) Puzzle-9x9 grid size 2x2 ]
Puzzle grid looks like in this image when grid size of 2x2 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c2) Puzzle-9x9 grid size 3x3 ]
Puzzle grid looks like in this image when grid size of 3x3 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c3) Puzzle-9x9 grid size 4x4 ]
Puzzle grid looks like in this image when grid size of 4x4 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c4) Puzzsle-9x9 grid size 5x5 ]
Puzzle grid looks like in this image when grid size of 5x5 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c5) Puzzle-9x9 grid size 6x6 ]
Puzzle grid looks like in this image when grid size of 6x6 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c6) Puzzle-9x9 grid size 7x7 ]
Puzzle grid looks like in this image when grid size of 7x7 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c7) Puzzle-9x9 grid size 8x8 ]
Puzzle grid looks like in this image when grid size of 8x8 is selected from "Puzle grid size" comboBox.
.
.
.
[ (01c8) Puzzle-9x9 grid size 9x9 ]
Puzzle grid looks like in this image when grid size of 9x9 is selected from "Puzle grid size" comboBox.
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
63°, 98%, 19% 92, 97, 1 #5b6001
 
63°, 60%, 60% 208, 214, 90 #d0d65a
.

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


Thursday, September 15, 2022

I solved sliding Puzzle-15 game - 220915Th

  I solved sliding Puzzle-15 game  
.
Version: 220915Th
.
Other versions
Version Link
221011Tu Sliding Puzzle 9x9 - 1 - 221011Tu
.
On evening of PkT 2022 Oct 14 Wed my niece asked for my help while playing sliding “puzzle 15” game. I found that she had solved top 3 rows out of total 4 rows. I felt happy on watching that and at the same time felt sorry because I had no idea how to solve that puzzle game.
.
Therefore for helping my niece in solving that puzzle game I started learning online that game myself. After reading some articles about that game on couple of sites/pages I found the strategy/method required for solving “puzzle 15” game.
.
Till late that night I kept learning and practicing solving “puzzle 15” game so that I could teach my niece next time how to play and solve puzzle games like “puzzle 15”.
.
During that session of learning and playing sliding Puzzle-15 game online I solved the game for the first time. Even after solving the game I kept learnig the game on different sites to get as much information about solving it as possible. That night I played this sliding puzzle-15 game online over and over because I wanted to practice enough to teach this game to my niece in better way.
.
I, during that same session, also played and solved sliding Puzzle-15 game available on my smart phone. That was an exciting moment for me because before that day I had no idea about solving the puzzle. Therefore immediately I took a screenshot of the game for sharing the moment with everyone., also played and solved sliding Puzzle-15 game available on my smart phone. That was an exciting moment for me because before that day I had no idea about solving the puzzle. Therefore immediately I took a screenshot of the game for sharing the moment with everyone.
.
Following is the unified image made out of screenshots of the gaming session I discussed above.
.

.
[Image of the happy moment]
I made this image for sharing with my relatives.use and today I am sharing online for everyone.
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
300°, 38.6%, 42.2% 149, 066, 149 #954295
 
300°, 37.8%, 85.5% 232, 204, 232 #E8CCE8
.

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


Monday, August 29, 2022

Living with droughts and floods - 220829Mo

  Living with droughts and floods  
.
Version: 220829Mo
.
Other versions
Version Link
Nil nil
.
.
[ Solving droughts problem ]
.
Around a few decades ago through a cable TV program/talk-show I came to know that Balochistan was then continuously going through bad spells of droughts since few years. That news made me very upset and I started thinking what could be done and how Balochistan can be helped.
.
That drought situation of Balochistan continued after that year also and all that made me think on the matter more and more. I kept worrying and thinking and worrying and thinking about that matter and reached at a solution which looked reasonable and workable to me. Even after creating solution I kept working/thinking on the solution to make it simpler and generalized so that it could be implemented anywhere in the world. In fact I wanted to extend my solution to entire Pakistan. Here I am going to discuss my solution for the drought problem which is although neither easy nor cheap but still is a very necessary solution indeed.
.
My above mentioned idea/solution was based on the following generalized steps:
  1. Dig a lot of different sized lakes and wells all across the concerned area.
  2. Make system for pulling water from the sea.
  3. Pull required amount of water from the sea.
  4. Clean collected sea water completely to up to water’s molecule “H2O”.
  5. Fill lakes and wells with water collected from sea and completely cleaned.
  6. Create networks of canals and pipes for taking water from lakes and wells to its human and non-human consumers/users.
  7. Connect lakes and wells with each other with a network of canals and pipes.
  8. Release water in those canals and pipes.
  9. Provide water 24/7 throughout the year.
  10. Create similar system for filling rivers and streams during droughts.
.
To me the above described solution is right according to the requirement and is highly workable. According to me this solution can easily be adapted and implemented anywhere in the world without much change and difficulty.
.
Following diagram/flow-chart further explains my solution steps graphically.
.
.

.
[ Solving floods problem ]
.
From time to time, in rainy seasons, we get floods of different intensity in different areas of our country Pakistan. These floods cause losses of life and property of different intensity in different parts of the country. All this makes me very upset and sad and makes me to think what could be done to avoid and prevent losses of floods.
.
For solving above mentioned problem of losses due to floods I reached at a solution which looked workable to me. Here I am going to discuss that not easy but workable solution.
.
My above mentioned idea/solution for preventing losses due to floods is based on the solution I made for preventing loses due of droughts. Its steps are as follows:
  1. Create lakes and wells of different size all across the concerned area and keep them empty.
  2. Connect all these lakes and wells together with canals and pipes.
  3. Create canals and pipes for draining these lakes and wells into the sea.
  4. During rainy season fill lakes and wells, created for flood management, with flood water.
  5. During rainy seasons anticipating floods start empting lakes and wells, created for drought management, in the sea and start filling those lakes and wells with flood water from rivers, streams etc.
.
To me the above described solution is right according to the requirement and is highly workable. According to me this solution can also be adapted and implemented anywhere in the world without much change and difficulty.
.
Following diagram/flow-chart further explains my solution steps graphically.
.
.
.

.
Colors used for Border and Background of this post
Color HSL RGB Hex
 
216°, 59%, 45% 047, 101, 181 #2f65b5
 
216°, 76%, 87% 195, 216, 247 #c3d8f7
.

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