Posts

Showing posts from 2022

Parts of Speech - Pronouns

Image
 What is a Pronoun? Pronouns Definition of a Pronoun: A pronoun is a word that replaces a noun (single word)  or replaces  anything functioning as a noun (noun clause , noun phrase) . Pronouns do the same job of nouns in the sentence. Examples on Pronouns I have a car . It is white. It is 2021 model.      (We used "it" in the second and third sentence to avoid repeating the noun "car".) My daughter's cat's name is " Candy ". She is white and she keeps playing all day long.      (We used "she" to replace "My daughter's cat".) What are Antecedents of Pronouns?  She likes blue color more than red . --> Who is She ? What if we did not mention the noun first? If we started with the pronoun, we will not know what does this pronoun refer to, right? Most of the time, yes, that's why we need to start with nouns and we call them Antecedents . Sometimes we don't need to start with nouns (if you start by "I"...

cs50 Week 2 Problem Set 2 Readability Solution

Image
CS50 Week 2 Problem Set 2 Readability Problem Set 2 - Readability In coding, problems have different ways to get to the solution. Below code is one way. Soon, we will be posting different codes. ** Remember: Try to change some things in the code before submitting it in order to avoid being rejected as Harvard academic honesty. The Solution: #include <cs50.h> #include <stdio.h> #include <string.h> #include <math.h> #include <ctype.h> int main(void) {     // inintiate needed variables     string text = get_string("TEXT: ");     int letters = 0;     int words = 1;     int sentences = 0;     for (int i = 0; i < strlen(text); i++)     {         if (isalpha(text[i]))         {             letters++;         }         else if (text[i] == ' ')         {   ...

English Vocabulary Books

Image
Everyday Real English Conversation Books Enhance your Everyday English Vocabulary English Vocabulary in use In this post, you will find books that help you enhance your vocabulary. These books will walkl you through the best way to earn and remember the new vocabulary. added to that, there are multiple excercixes with answers English Vocabulary in Use Elementary Level (with Answers) Author: Michael McCarthy, Felicity ODell English Vocabulary in Use Pre-Intermediate & Intermediate Author: Stuart Redman "Test" - English Vocabulary in Use Pre-Intermediate & Intermediate Author: Stuart Redman & Ruth Gairns English Vocabulary in Use A...

How to Open a Folder in VSC with CMD

Image
 Open a Folder in Visual Studio Code with CMD VSC If you don't have the the right click option open with visual studio code, no worries, you can do that with command prompt. Here's how: From windows explorer, open/migrate to the folder/directory which you want to work on. click in the folder/directory path which will highlight the path to the folder ex. C:\Users\User\Desktop\projects While the folder is highlighted, type cmd which will open the command prompt with the file path Open folder with Command Prompt In the command prompt type ( code . ) without the brackets. The folder you are in will open with Visual Studio Code. Now, you can work on the folder through Visual Studio Code, like creating a new file, copying or deleting a file. Other topics of Interest: How to show flames in Visual Studio Code DoodleMaker Vs Doodly Visual Studio Code terminal drop down list How to download a YouTube Video

A Holding Company?

Image
 What is a Holding Company? Definition of a "Holding Company": As per Merriam Webster Dictionary, a holding company is a company whose main business is owning  more than half of another company's (subsidiary) stock. As per Dictionary.com, it's a company that controls other companies through stock ownership but that usually does not engage directly in their productive operations . So, we can understand that the holding company is a "corporation or limited liability company (LLC) which doesn't manufacture or sell any products or  services or conduct any business operations. Holding companies only hold the controlling stock in other companies (As per the definition from investopedia). How does the Holding Company Operate? The subsidiary companies have their own management who run the business directly while management of the holding company monitors and foresees the policies and measure the performance of the subsidiary companies' management. Accordingly, t...

None, is it Singular or Plural?

Image
 "None" .. How to deal with it? Does None mean Nothing? H ave you ever wondered whether to choose "none is" or "none are"? Maybe you would like to say "It's none of your business? What is "None"? "None" as a word is defined as "an indefinite Pronoun", and it means "not one", "not any", or "nothing". It can be used as "an adverb", and it means "not at all". None .. Singular or Plural? The final result of a debate between grammarians is that "none" can be both Singular and Plural depending on what the speaker means. This is the general but I will help you differentiate: "None" as an indefinite Pronoun should agree with the noun / Pronoun to which it refers. Plural None of your words ARE carefully chosen. ("words" is plural, so it takes a plural verb) None of my friends ARE going to the movies . Three people WERE in the bar. None of them w...

How to show flames in Visual Studio Code

Image
 Power Mode power mode What is Power Mode? Power Mode is an awesome extension in Visual Studio Code (VSC) .  How to use Power Mode Extension? When you have Visual Studio Code Open, click on Extensions icon on the left (Ctrl+Shift+X). On top, in Search Extensions in Marketplace , write Power Mode Click on the extension with the icon shown in the tutorial below Click on install After the extension is installed, on the right under you will find a cog, click on it and then choose Extension Settings The first option "Powermode: Enabled will be unticked by default, choose it to activate the extension (tick the square) in Powermode: Presets, choose the preset you like The rest of the options are up to you to control how the preset will look like (timing, size, counter, etc.) Happy Coding

How to use Python Virtual Environment - venv

Image
 Virtual Environment python virtual environment -venv What is Virtual Environment? Virtual Environment - we will call it (Virtualenv) - is an isolated environment where you can download packages away from python system packages. This article is about venv which is a built-in python package, and for windows users. How to simply use virtual environment? * To create a virtual Environment folder: >> python -m venv folder_name -> It's a good practice/common convention to add venv to the folder name to differentiate it from other folders. OR: >> python -m venv Exsisting_folder_name\new_venv_folder_name * To activate/move inside the Virual Envirnment folder: >> folder_name\Scripts\activate.bat OR: >> Exsisting_folder_name\new_venv_folder_name\Scripts\activate.bat - You will notice the name of the Virtual Environment folder in the beginning of the folder path.  - Now, you're working on an isolated folder which has only the default python global version ins...

Parts of Speech - Verbs

Image
What is a Verb? Parts of Speech - Verbs A Verb (v) is a word that shows action, occurrence, or state of being. The Verb describes what the subject (Noun) is doing. I run everyday because I love to be in a good shape. She works at a factory My car needs an oil change. The wealthy man bought a mansion. He apologized to her many times. How many types of Verbs and what are they? There are 11 common types of verbs - some people say they are 7. The main 7 Types of Verbs: 1- Action Verbs: Words that describe actions. Action verbs can also be called Dynamic or Physical Verbs. Action Verbs Examples of Action Verbs: work - chase - run - play - help - swim - jump - write - ignore - try Please open the door. I always laugh when I hear his jokes. 2- Stative Verbs: Stative or state verbs are words which describe thoughts, emotions, feelings, opinions, senses, possessions, perceptions, measurement,.. . stative verbs in English Examples of Stative Verbs: want - own - have - be - need - love 🔔...

Python LAB 2.8.1.4 Reading ints safely

Image
 Reading ints safely Reading ints safely The Challenge improving the student's skills in defining functions; using exceptions in order to provide a safe input environment. Scenario Your task is to write a function able to input integer values and to check if they are within a specified range. LAB Sandbox The function should: accept three arguments: a prompt, a low acceptable limit, and a high acceptable limit; if the user enters a string that is not an integer value, the function should emit the message Error: wrong input, and ask the user to input the value again; if the user enters a number which falls outside the specified range, the function should emit the message Error: the value is not within permitted range (min..max) and ask the user to input the value again; if the input value is valid, return it as a result. Test data Test your code carefully. This is how the function should react to the user's input: Enter a number from -10 to 10: 100 Error: the value is not within ...

يوم التأسيس - يوم بدينا

Image
 يوم التأسيس يوم التأسيس السعودى - 300 عام تحتفل المملكة الهربية السعودية اليوم الموافق الثلاثاء 22 فبراير 2022 بكرى "يوم التأسيس" تحت شعار "يوم بدينا " , والذى يصادف ذكرى تأسيس الدولة السعودية الأولى قبل 3 قرون (300 عام) على يد الإمام محمد بن سعود يوم التأسيس السعودى ويأتي الاحتفاء بهذه الذكرى، بعد أن أصدر الملك سلمان بن عبدالعزيز آل سعود   أمرا ملكيا في يناير الماضي يقضي باعتبار 22 فبراير من كل عام يوماَ للتأسيس، ليتم الاحتفاء بهذه المناسبة لأول مرة وسط احتفالات وفعاليات تعم المملكة وتؤكد على الجذور التاريخية للبلاد. وكان الإمام محمد بن سعود قد أسس الدولة السعودية الأولى في منتصف عام 1139هـ (1727م) والتي استمرت إلى عام 1233هـ (1818م)، وعاصمتها "الدرعية". وأصبحت هذه مدينة  عاصمة لدولة مترامية الأطراف، ومصدر جذب اقتصادي واجتماعي وفكري وثقافي، وتحتضن على ترابها معالم أثرية، إضافة إلى أن النظام المالي للدولة وصف بأنه من الأنظمة المتميزة من حيث الموازنة بين الموارد والمصروفات. وقد هاجر كثير من العلماء إلى "الدرعية" لتلقي التعليم والتأليف الذي كان سا...

Python 2.5.1.10 LAB: Find a word!

Image
 Find a Word in a Combination of Characters Find a word game Objectives improving the student's skills in operating with strings; using the find() method for searching strings. Scenario Let's play a game. We will give you two strings: one being a word (e.g., "dog") and the second being a combination of any characters. Your task is to write a program which answers the following question: are the characters comprising the first string hidden inside the second string? For example: if the second string is given as "vcxzxduybfdsobywuefgas", the answer is yes; if the second string is "vcxzxdcybfdstbywuefsas", the answer is no (as there are neither the letters "d", "o", or "g", in this order) Hints: you should use the two-argument variants of the pos() functions inside your code; don't worry about case sensitivity. Test your code using the data we've provided. Test data Sample input: donor Nabucodonosor Sample output:...

Python 2.5.1.9 LAB: The Digit of Life

Image
 The Digit of Life The digit of life Life Path Number Calculator To know your life path number, You need to enter your birth date as numbers only to calculate your life path number. You should add the digits of the month, day, and year until you arrive at a single digit number. How digit of life  is calculated Let's see the lab question. Objectives improving the student's skills in operating with strings; converting integers into strings, and vice versa. Scenario Some say that the Digit of Life is a digit evaluated using somebody's birthday. It's simple - you just need to sum all the digits of the date. If the result contains more than one digit, you have to repeat the addition until you get exactly one digit. For example: 1 January 2017 = 2017 01 01 2 + 0 + 1 + 7 + 0 + 1 + 0 + 1 = 12 1 + 2 = 3 3 is the digit we searched for and found. Your task is to write a program which: asks the user her/his birthday (in the format YYYYMMDD, or YYYYDDMM, or MMDDYYYY - actually, the ...

Python 2.5.1.8 LAB: Anagrams

Image
 Anagrams Anagram Listen = Silent [1] An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.[1] For example, the word binary into brainy and the word adobe into abode. The original word or phrase is known as the subject of the anagram. Any word or phrase that exactly reproduces the letters in another order is an anagram. Now, lets see the lab question. Scenario An anagram is a new word formed by rearranging the letters of a word, using all the original letters exactly once. For example, the phrases "rail safety" and "fairy tales" are anagrams, while "I am" and "You are" are not. Your task is to write a program which: asks the user for two separate texts; checks whether, the entered texts are anagrams and prints the result. Note: assume that two empty strings are not anagrams; treat upper- and lower-case letters as equal; spaces are not taken into acc...

Python 2.5.1.7 LAB: Palindromes

Image
Python: Check If a String is a Palindrome Palindrome The Challenge improving the student's skills in operating with strings; encouraging the student to look for non-obvious solutions. Scenario Do you know what a palindrome is? It's a word which look the same when read forward and backward. For example, "kayak" is a palindrome, while "loyal" is not. Your task is to write a program which: asks the user for some text; checks whether the entered text is a palindrome, and prints result. Note: assume that an empty string isn't a palindrome; treat upper- and lower-case letters as equal; spaces are not taken into account during the check - treat them as non-existent; there are more than a few correct solutions - try to find more than one. Test your code using the data we've provided. Test data Sample input: Ten animals I slam in a net Sample output: It's a palindrome Sample input: Eleven animals I slam in a net Sample output: It's not a palindrome...