My D's P's L's Js _ Day12 _ Git & GitHub {9}; CS50'sT {6}; Other Developments {12}

Raghuu'Raghuu'
6 min read

Day12

\\ Lets Get Started \\

Git and GitHub {9} _

Working with the staging area :

  • for chaking what our staging area will look like : git status

  • so, staging area now is empty and no commits etc.

  • we have one untracked file (in red test.txt), which isn't yet added to the staging area.

  • for adding it to staging area : run git add test.txt

    • staging area is also refered as the Source Control

    • there can be many files with different extensions that you want to add in staging area, it can be done all at once by command : git add ..

    • Git is not exclussive to just Tech field, we can use it to keep track and maintain any kind of work and files and systems. (It can be used in almost anything).

  • now by checking with git status, the green highlighted previously red same file (s) confirms that thoese files are now added (catched) onto the staging area, and are waiting to be taken as a snapshot which is to being committed.

    • the staged file can be unstaged and thereby be untracked by the command : git rm --cached <file>....
  • the command for completely deleting a file is : git rm -f <file>

HarvardX CS50T {6}_

CS50's Understanding Technology.

Resource Or Reference : HarvardX CS50T

Multimedia :

Graphics :

  • A graphic, what we see with multimedia, is really just a bunch of pixels both horizontal and vertical

    • All file formats are rectangular in nature, though transparent pixels can make images look to take on other shapes

    • In the simplest form, each of the dots or pixels is a bunch of 0s and 1s

  • To create a file format, we just need to determine a mapping

  • This image is only black and white, so how to represent color?

RGB :

  • RGB stands for Red Green Blue

    • With information giving an amount of red, an amount of green, and an amount of blue, you can tell a computer how to colorize pixels

    • None of the colors yields a black pixel

    • All of the colors yields a white pixel

    • In between these two options is where we get all sorts of colors

  • Consider the three bytes: 11111111 00000000 00000000

    • If we interpret these bytes to represent colors, it appears we want all of the red, none of the green, and none of the blue

    • These 24 bits (3 bytes = 3 x 8 bits = 24 bits) represent the color we know as red!

      • If a computer wanted to represent this color, it would store these 24 bits
  • Consider the three bytes: 00000000 11111111 00000000

    • Green
  • Consider the three bytes: 00000000 0000000 11111111

    • Blue
  • Consider the three bytes: 00000000 0000000 0000000

    • Black
  • Consider the three bytes: 11111111 11111111 11111111

    • White
  • Can get many color variations by mixing the above colors in different quantities

  • When we talk about image formats, we typically don’t talk in terms of binary but rather something called # hexadecimal (base-16, contains 16 digits)

    • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f

    • 0 is the smallest number we can represent in single digit

    • f is the largest number (value of 15) we can represent in a single digit

  • Consider the 8 bits: 1111 1111

    • Each hexadecimal digit represents four bits

    • One hexadecimal digit can represent the first four bits, another can represent the second four

      • Represent something with eight symbols using only two!
    • 1111 is the decimal number 15, which is f

    • Therefore, 1111 1111 in hexadecimal is ff

  • Red can thus be represented in hexadecimal as ff 00 00

  • Green can be represented in hexadecimal as 00 ff 00

  • Blue can be represented in hexadecimal as 00 00 ff

  • A lot of graphical editing software such as Photoshop use hexadecimal to represent colors

Other Developments {12} _

Recap, Ques, & Other Notes :

  • Recaps.

    • To create a file format, we just need to determine a mapping
  • Ques.

    • Mapping in detail (please see Day14) [✔]

    • Data Transformations vs Mapping ? (please see Day14) [✔]

    • some other similar and alternate ways to remove files in a Git repository? (please Refer bellow) [✔]

    • rewriting the repository's history? (pls see Day13) [✔]

    • Bash vs SQL (Complementary) (pls see Bellow) [✔]

  • Other Notes.

    • After adding a file onto the staging area and thereby its being tracked by the Git, but what if we remove it completely using shell command? (Or Git # Remove vs Git force remove vs bash remove) : (from Day10) _

      • If you have added a file to the Git staging area, and then you remove it completely using a shell command, the following will happen:
  1. The file will be removed from the local file system, and it will no longer be present in your working directory.

  2. The file will still be tracked by Git, but it will be marked as "deleted" in the Git index (staging area).

  3. When you run git status, you will see the file listed under the "Changes to be committed" section, with the word "deleted" next to it.

  4. To complete the removal of the file from the Git repository, you need to run the following command: git rm <filename> This command will remove the file from the Git index (staging area) and from your local file system.

  5. After running git rm , the file will be staged for deletion. You can then commit the changes to permanently remove the file from the Git repository. git commit -m "Remove file <filename>"

  • It's important to note that removing a file from the Git repository does not necessarily remove it from the entire Git history. If the file has been previously committed, it will still be present in the repository's history, and you may need to take additional steps to completely remove it, such as using the git rm --cached command or rewriting the repository's history.

    • Bash vs SQL (Complementary) :
  • System Interaction:

    • Bash, as a command-line shell and scripting language, provides a way to interact with the operating system, execute commands, and automate various tasks.

    • SQL, on the other hand, is focused on managing and manipulating data stored in relational databases.

    • By using Bash, you can call SQL commands and process the results within a shell script, allowing you to integrate database operations into your system-level automation.

  • Data Integration:

    • Bash can be used to extract data from various sources, perform data transformations, and then load the data into a database using SQL commands.

    • This allows you to create data processing pipelines that combine the strengths of Bash for data handling and SQL for data management.

  • Scripting and Automation:

    • Bash's scripting capabilities make it a powerful tool**forautomating repetitive tasks, such as** database backups, schema migrations, or data processing workflows.

    • Within these Bash scripts, you can incorporate SQL statements to interact with databases and perform specific data-related operations.

  • Reporting and Analysis:

    • Bash can be used to generate reports, parse the output of SQL queries, and present the data in a desired format, such as text files, CSV, or even HTML.

    • This allows you to create custom reporting and data analysis solutions that leverage both the system-level capabilities of Bash and the data management features of SQL.

  • Application Integration:

    • Bash scripts can be integrated into larger applications or systems, providing a way to connect those applications with database operations performed using SQL.

    • This can be particularly useful when developing applications that need to interact with relational databases.

that is it for today

TC and Happy Learning & Earning!

0
Subscribe to my newsletter

Read articles from Raghuu' directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Raghuu'
Raghuu'