SKAEHUB BOOT CAMP EXPERIENCE

Edwin Atieno
5 min readJun 23, 2021

Being accepted for the SkaeHub boot camp was my greatest achievement this year. After the interview, I was eagerly waiting for their email, which I received on Thursday. We were to report on Monday the following week by 1:30 pm, but due to the joy and anxiety, I was there by 12:30 pm. That day was an orientation of what we are expected to do. The Big guy (Humphrey Musenyo) was the one taking us through. Experience was written all over his face.

The next day we were to report before 8:30 am, but I was the first person to arrive. One of the things I value is work ethic. The day was so educative, challenging, and also fun. We formed groups that taught me one great thing: when we work together, anything is possible. We were assigned group work and also personal assignments. The questions were challenging, but thanks to the teamwork, it was really easy and well understood. Some of the things I learned were:

1) Planning:

It was so clear that working without a plan is planning to fail. We compared planning to a cigarette that has two parts. One part is the filter, while the other one is the tobacco which takes the largest part. For a cigarette company to profit, the tobacco part should be bigger than the filter side. This is the same with our project. Planning and breaking down the problem should be the main and big part because coding will be straightforward and fast with a well-defined step to the solution.

2) Algorithm:

An algorithm is a well-defined sequence of steps used to solve a problem. When given a problem, one should always break down the solution and have steps, which can be in simple English or even use a diagram (flowchart) explaining the steps. We did this for our group task, and it really helped finish the work in time and made it easier for members to understand. The group question was about SQLite and connecting to a program in python. Steps:

1) Definition of SQLite

2) Research on SQLite

3) Create the project

4) Create the database

5) Connect the project to the database

6) Run the project

3) Code:

Being a beginner in python, I never did such a program, making it a bit hard for me. However, I managed it through discussion and also googling. It was a great experience. Here is a snippet of the code which objective was to create and connect to an SQLite database

CODE;

# Import sqlite3 module
import sqlite3
try:
# Create the database
create = sqlite3.connect(‘example.db’)
print(“\nDatabase created and connected to SQLite.”)

table = create.cursor()

# Create table
table.execute(‘’’CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)’’’)

# Insert a row of data
table.execute(“INSERT INTO stocks VALUES (‘2006–01–05’,’BUY’,’RHAT’,100,35.14)”)

# Create a query to request for version
print(sqlite3.version)

except sqlite3.Error as error:
print(“Error while connecting to sqlite”, error)
finally:
if create:
create.close()
print(“\nThe SQLite connection is closed.”)
# Close Just be sure any changes have been committed or they will be lost.

We also did some other questions on programming, which were also good. An example is this one which is supposed to help the user come with a password:

import randomimport stringimport sys# This function uses the string module to make random letters and numbersdef strong_list():    return "".join(random.choice(string.ascii_letters + string.digits) for x in range(8))# This function creates a random list of special charactersdef special_char():    return "".join(random.choice("?!&$*%@") for x in range(2))def main():    # combine both special characters and mixed    specials = special_char()    mixed = strong_list()    password = (mixed + specials)    #initialize the password into a list    passwordarray = []    passwordarray[:10] = password    # prompt user to select difficulty    difficulty = str(input("choose your password to be weak, medium or strong?"))    # filter out the type of password according to user choice    if difficulty.lower() == "weak":        shufflelist = random.sample(passwordarray, len(passwordarray[0:4]))        userpassword = "".join(shufflelist)        print (userpassword)        # check user's satisfaction        happy = str(input("Best password?  Y/N?"))        if happy.upper() == "Y":            sys.exit()        elif happy.upper() == "N":            main()    # condition check for medium    elif difficulty.lower() == "medium":        shufflelist = random.sample(passwordarray, len(passwordarray[0:6]))        userpassword = "".join(shufflelist)        print(userpassword)        #check user's satisfaction        happy = str(input("Best password?  Y/N?"))        if happy.upper() == "Y":            sys.exit()        elif happy.upper() == "N":            main()    # condition check for medium    elif difficulty.lower() == "strong":        shufflelist = random.sample(passwordarray, len(passwordarray))        userpassword = "".join(shufflelist)        print(userpassword)        # check user's satisfaction        happy = str(input("Best password?  Y/N?"))        if happy.upper() == "Y":            sys.exit()        elif happy.upper() == "N":            main()    # incase does not select    else:        print ("Please try again, restarting generator")        main()#calling the main functionmain()

Those were some of the things I learnt and also did. The hospitality was also good. We were served very sweet tea and chapati and others mandazi.

On the third day, which is today, activities were very different from the previous day. The group work was so challenging and was incorporating so much, that is, many topics. We really did our best but were not able to complete it. Yes, we failed, but failing is also part of learning. Humphrey came through for us, and he explained it and motivated us, which boosted our morale. Since every day is learning day, here are some of the things I learnt:

1) Never give up:

Some groups had lost hope because it was not running, but one group never gave up, and they continued trying, and almost made it apart from some error because of the IDE(coding environment).

2) Do not stick on your failures:

If we had a tried a different way to solve the problem rather than sticking on the same wrong code, we would have made it. So that was one of the big lessons I learned.

3) How to write a code that will help get the number of followers on Twitter:

Steps :

1) Should download and import selenium

2) Import webdriver from selenium

3) Allow user to input the username of the Twitter account

4) Call the webdriver depending on the browser

5) Also prompt the webdriver to wait for a while before showing an error

6) Direct the program to Twitter using the get() to get the URL

7) Print the number of followers and then close the web browser.

CODE:

#import webdriver from selenium libraryfrom selenium import webdriverfrom selenium.common.exceptions import WebDriverException,NoSuchElementExceptiontwitter_handle = input('Please input your Twitter handle here: ')# The ChromeDriver class starts the ChromeDriver server process at creation and terminates it when quit is called# But one can change the driver depending on engine e.g. Firefox,driver = webdriver.Chrome()# Tell the webdriver the time to wait before sending a "No such Element Exception"driver.implicitly_wait(100)# check incase of an errortry:    driver.get('http://twitter.com/'+twitter_handle)# error expexctedexcept WebDriverException as e:    print("An error occured ", e)# Process to be done when there is no errorelse:    try:        #opens the browser based on the twitter handle displaying the profile        web_element = driver.find_element_by_xpath('//a[@href="/' + twitter_handle + '/followers"]')    #checks an error    except NoSuchElementException as e:        print("An error occured ", e)    #it prints the number of followers then closes the chrome openned    else:        print (web_element.text)        # method to close & destroy both the WebDriver and Web Browser instances gracefully after each run of Test Execution.        driver.quit()

For the past three days, I can say it has been a great experience, and I expect to learn more as we continue.

--

--

Edwin Atieno

Software Developer. Mostly web and Mobile application