Thursday, March 17, 2022

To overcome challenges, stop comparing yourself to others - Dean Furness



When we are young with our height and weight, as we grow it becomes our speed and our strength. It seems as if personal averages is almost always used to measure who we are in comparison to our peers. Everybody has their own abilities. So it depends on the person's mindset. If you can focus on that and work to build that you will start to accomplish some really amazing things. 


Mr. Dean Furnes, the speaker in this video, had an accident in 2011, and it cursed him to be in a wheelchair since then. Doctors said he will never walk again. Since then he realized everything that he learned and had known about his height , his strength, balance and mobility are no no valid now. He felt that his personal average had been reset. That time he was being measured more than ever. He became very frustrated. Then he realized he needed to forget about the person he was before and things that he did before. Few weeks later he was transferred to a specialty spinal cord rehab hospital. There he realized he never had a bad day. We can decide what's good or bad. He realized the quicker you move on to what’s next quicker you can attack fast things. So he could quake move on from the bad scenarios and have more time for the good. So he realized what his average day by day was. 




In 2016 he participated in a marathon after practice everyday and he found his real average now. He built it as much as he could. He is working really hard every day to be better. He never quit his journey after the incident. He found who he is now. Since then he participated 7 marathon.




Everyone should take a time and focus on you inserted of others.


Saturday, November 20, 2021

Algorithms in Programming

 Algorithms in Programming

Algorithms are most common thing in programming and we use algorithms in our day today life as well. Lets here talk about algorithms in programming.

An algorithm is a  a set of steps used to complete a specific task. They're the building blocks for programming and they allow things like computers, smartphones, and websites to function and make decisions.

There are five important characteristics of an algorithm 

  1. Well-ordered. 
  2. Has unambiguous operations. 
  3. Has effectively computable operations. 
  4. Produces a result. 
  5. Halts in a finite amount of time. 
When we are given an algorithm there are several ways to determine the purpose of the algorithm. Sometimes it is clear that the algorithm is simple; however, at other times it is useful to "dry out" the algorithm to see what happens.

Running an algorithm dry means assigning the values to the variables of an algorithm and performing the processing without translating them into code. For that we can use Trace Tables (Desk Checking).

Algorithms can be designed using pseudo-code or flowcharts or both. It focuses on step logic rather than programming language.


Pseudo-Code

Pseudocode is a simple way of describing a set of instructions in a way that is similar to a programming language. In the algorithm, most operations fall into three main categories:

  • inputs
  • processes
  • outputs

Example for pseudo-code for printing stars like this

First lets see the scenario. In first line we need to print one star. then go to next line and print two stars. Then again go to next line and print three stars. Then again go to next line and print four stars and finally go to next line and print five stars.

We can implement above scenario like this
  1. Start
  2. Declare counter
  3. Initialize counter=0
  4. WHILE counter<5
  5. counter=counter+1
  6. FOR  counter number of times
  7. Display "*"
  8. END FOR
  9. Print new line
  10. END WHILE
  11. Stop

1st line-    Start point of the pseudo-code

2nd line-   Declare variable for remind counting

3rd line-    Initialize that variable

4th line-    Start a While loop until counter <5

5th line-    counter variable increment by 1

6th line-    Start a For loop and run it times of counter variable

7th line-    Display star

8th line-    End of the For loop

9th line-    Go to new line

10th line-   If the While loop condition is false End the While loop

11th line-   End point


We can also use Trace Tables (Desk Checking) tables to show how the repetition lines work




Flowcharts

A flowchart is a diagram that shows an overview of an algorithm. Flowcharts use a variety of standard symbols to represent different elements and arrows to show flow or direction. These symbols are used to build the flowchart and show the step by step solution to the problem.

Common flow diagram symbols


Lets draw a flowchart for above example




Efficiency of algorithms

Efficiency looks at how long it takes to run a particular algorithm and how much storage space is required. By using both measures, a seemingly much more complex algorithm can be more efficient.


To overcome challenges, stop comparing yourself to others - Dean Furness

When we are young with our height and weight, as we grow it becomes our speed and our strength. It seems as if personal averages is almost ...