July 3rd 2022 - Day 3 of 3 day study bender

 The final study bender day went great!

Started the day out by watching CS50 lecture 6 on Python and since I have had extensive experience coding in Python, skipped through most of the lecture. Here are some key points/takeaways that you don't think of often. Note all notes here pertain to Python3.

1) Unlike 'C' programming language, in Python, at the end of every print statement, we get a new line character implicitly.

* Indentation is important in Python programming language, unlike 'C' programming language.


2) Data types available in Python -> string, integer, float, complex, list, tuple, range, dictionary, boolean, None (not an exhaustive list).

* Python programming languages do not need to be compiled. Python is an interpreted language.


3) We use a 'main()' function to call functions before defining them, this way our code is more readable, and we need to make sure to call the main function before the end of our program.

* We often see something like the below:

if __name__ == "__main__":
    print("Hello, World!")

   This is simliar in functionality to calling the main() functions but solves some problems around importing libraries. Can read more about it on this stack overflow page.



4) Lambda functions:


If you need a function temporarily and don't need to call it in the future, you can use a lambda function. Say for example, you need to add 5 to a variable 'x' and store it in a variable 'num'.


num = lambda x : x+5


--------------------------


After this, I had quite some time left over in the morning so I started viewing the next CS50 lecture, number 7 titled 'SQL'.


Some takeaway;


1) SQL is a domain specific language that makes working with data very efficient. It can be used to perform CRUD operation easily on some data.


* sqlite3 is the type of database that is used on mobile devices.


* You can import .csv data into sql without defining the schema, it will create tables based on the first line of the csv file.



2) The following are the most important SQL commands:


SELECT - extracts data from a database

UPDATE - updates data in a database

DELETE - deletes data from a database

INSERT INTO - inserts new data into a database

CREATE DATABASE - creates a new database

ALTER DATABASE - modifies a database

CREATE TABLE - creates a new table

ALTER TABLE - modifies a table

DROP TABLE - deletes a table

CREATE INDEX - creates an index (search key)

DROP INDEX - deletes an index



----------------------------------------


After all this, I moved on to a lift and shift DevOps project from on-premises to AWS cloud. I will discuss this in more detail in another post, I just want to mention the AWS Certificate Manager (ACM) part which I used to set up a Public Certificate on a domain that I purchased from 'namecheap' using CName.

Comments

Popular posts from this blog

Playing around with Dell R520 server

Experience Interviewing for an Infrastructure Engineer - Continuous Delivery position

Plan for July 1st long weekend.