Sunday, February 27, 2022

Perl example of splitting

 @thislist = ("a/apple", "b/banana/g", "c/cherry/d/f");

print(@thislist);

foreach $myFile (@thislist) {

@myList=split( '/', $myFile);

   $size = @myList;

   print("$size \n");

   print("@myList \n")

}

output

a/appleb/banana/gc/cherry/d/f2 

a apple 

b banana g 

c cherry d f 


tried at https://www.learn-perl.org/


Passing array into subroutine, finding max, min

passing array references to subroutines

referencing and dereferencing

Thursday, February 24, 2022

Python exception handling

 A Comprehensive Guide to Handling Exceptions in Python

python-textbok.readthedocs.io

Errors and exceptions


eg -

import sys


randomList = [1, 2, 8]

for entry in randomList:

    try:      

          print(randomList[entry])

    except:

        print("Oops!", sys.exc_info()[0], "occurred.")


Output

22
8
Oops! <class 'IndexError'> occurred.

Thursday, February 03, 2022

Toastmaster speeches


1. The Ice Breaker  - Practise, Practise, Practise

2. Organize Your Speech –speech format of a fixed point 1 point2. Leave some flexibility in the points supporting the main points.

3. Get to the Point – Time your speech as you say it aloud. This will help you weed out sentences that don’t fit in your speech and timeframe.

4. How to Say It – Make it a part of daily life, so it becomes natural over time.

5. Your Body Speaks – Kindra Hall

6. Vocal Variety – Mimic the energy of other speakers on the radio and TV. Get comfortable listening to your voice. Find ‘Voice memos’ app on your smart phone and listen to your self speaking.

7. Research Your Topic -

8. Get Comfortable with Visual Aids – Pecha Kucha

9. Persuade with Power – Conduct an auction.

10. Inspire Your Audience – Share what you were born to share with the world.

Career Development

Putting common career advice to the test 

Track what excites you or scare you

What metrics mean something

Know what options are available – Networking, Books, Other organization knowledge, Public figures

Which do you see yourself in? Make a future resume. Keep refining it.

Do you know your obstacles? – Feedback

What are the new skills needed to your final destination? – Experience, Education- formal course, online course, Books, Data (eg Strategy, risk as opportunity), Dealing with Complexity, Modeling a situation, Your learning style and growth through challenging with other styles.

Your support team – Find a Mentor, Keep family in the ring, Sustaining motivation and going back to the beginning if this is not the right path.

Giving it back – Mentoring

Pushing ourselves to find the limit

Plaza with different opportunities. There are many steps. Do you want to take one path and reach the pinnacle or go up a bit on the others, which could mean having to climb new stairs and going down a few. Or find lateral bridges.

Know your users needs