Notes, abstracts, papers, exams and problems

Sort by
Subject
Level

Software Design Principles and Patterns

Classified in Computers

Written at on English with a size of 4.98 MB.

Lecture 2: Dynamic Dispatch and Interfaces

  • Dynamic Dispatch: The process of selecting which implementation of a polymorphic operation to call at runtime.
  • Interface: Calling a method that is not in the interface will cause a compilation error.

Lecture 3: N/A

Lecture 4: Method Contracts, Exceptions, and Unit Testing

  • Method Contract: Should define pre/post conditions and exceptional behavior. The client is to blame if the precondition is not met, and the service is to blame if the postcondition is not met. Exceptional behavior specifies what the code will do if a precondition is violated.
  • Exception: Runtime exception (unchecked) and IO exception (checked). The IO exception must be caught; otherwise, the code won't compile.
  • Unit Test: Test boundary
... Continue reading "Software Design Principles and Patterns" »

Introduction to Statistics: Discrete and Continuous Random Variables, Probability Distributions, and Sampling Techniques

Classified in Mathematics

Written at on English with a size of 1,002.16 KB.

Discrete Random Variables

Discrete random variables are variables that can take on a finite number of distinct values. In simpler terms, a discrete random variable is a set of possible outcomes that is countable.

Continuous Random Variables

Continuous random variables are random variables that take an infinitely uncountable number of potential values, typically measurable amounts.

Example

  1. List the sample space in the given experiment. How many outcomes are possible?

The sample space is: S = {NNN, NND, NDN, NDD, DNN, DND, DDN, DDD}

  1. Count the number of defective keyboards in each outcome in the sample space and assign this number to the outcome. For instance, if you list NND, then the number of defective keyboards is 1.

The possible values of X are 0,... Continue reading "Introduction to Statistics: Discrete and Continuous Random Variables, Probability Distributions, and Sampling Techniques" »

Language vs Dialect: Power Dynamics and Societal Influence

Classified in Social sciences

Written at on English with a size of 2.3 KB.

Regarding the difference between a language and a dialect can be confusing. A language is a mental phenomenon, the language lives in the mind because it is a cognitive ability. However, a dialect is a certain type of linguistic variety. It is the way of speaking of a community which is a bit different from the standard one. One problem is dialectal continuum:

The distinction is very broad. If we ask how many languages there are, we will not have an exact answer because there are over 4000 and 6000 languages. It is difficult to say which is a language or which is not. The word 'language' is a concept more political than scientific, the decision in the end is political. For example, the Swedes, Danish, and Norwegians speak highly similar linguistic... Continue reading "Language vs Dialect: Power Dynamics and Societal Influence" »

Mesopotamian Civilization: Society, Economy, Religion

Classified in History

Written at on English with a size of 2.95 KB.

The Rise of Mesopotamian Civilization

On the banks of the Tigris and Euphrates rivers, the main urban settlements that were to play a leading role in the three millennia of Mesopotamian history emerged. The periodic overflowing of their banks irrigated and enriched the surrounding land, allowing intensive agricultural exploitation. This favored the appearance of stable settlements and their development. Cities such as Uruk, Ur, Lagash, Assur, Mari, and Babylon, among many others, arose, governed independently from a temple-palace.

Mesopotamian Society and Governance

The temple-palace organized the economy and held the political and military monopoly, as it was where the production and surplus from their economic activities were stored. Society... Continue reading "Mesopotamian Civilization: Society, Economy, Religion" »

The Internet: A Comprehensive Overview

Classified in Technology

Written at on English with a size of 16.63 KB.

The Internet: A Global Network

The Internet is a global network of interconnected computer networks, linking billions of devices worldwide using TCP/IP. It comprises millions of networks, including private, public, academic, business, and government, and provides extensive information resources.

The History of the Internet

The Internet, originating from ARPANet, an experimental network created in the 1960s by the US military, was launched online in 1969 under a contract by ARPA, connecting four US universities. The history of the Internet reflects the continuous growth of this network, connecting millions of people, businesses, governments, schools, and universities.

The ARPANet

The ARPAnet, created in 1969, began with four computers connecting.... Continue reading "The Internet: A Comprehensive Overview" »

Understanding the Circulatory and Reproductive Systems

Classified in Biology

Written at on English with a size of 2.6 KB.

Circulatory System

Deoxygenated blood from the body returns to the right atrium of the heart through the superior and inferior vena cavae. The right atrium contracts, pushing the blood through the tricuspid valve into the right ventricle. The right ventricle contracts, pumping the deoxygenated blood through the pulmonary valve into the pulmonary artery. The pulmonary artery carries the deoxygenated blood to the lungs, where it picks up oxygen and releases carbon dioxide through the process of gas exchange. Oxygenated blood returns from the lungs to the left atrium of the heart via the pulmonary veins. The left atrium contracts, pushing the oxygenated blood through the mitral valve into the left ventricle. The left ventricle contracts, pumping... Continue reading "Understanding the Circulatory and Reproductive Systems" »

Apartment Living with Dogs: Max's Urban Adventure

Classified in English

Written at on English with a size of 3.27 KB.

Bringing Max Home

As the morning sun peeked through the tall buildings, casting a warm glow over the bustling city streets, I found myself standing in front of a modest apartment building, anticipation coursing through my veins. This was to be the new home for my beloved companion, a furry four-legged friend named Max.

Max was a friendly and affectionate mixed-breed dog with a playful disposition, always eager for a game of fetch or a leisurely stroll through the park. However, as a responsible pet owner, I knew that transitioning to apartment living would require some adjustments for both Max and me.

Creating a Dog-Friendly Space

The first task at hand was finding the perfect apartment that could accommodate a dog. After much searching, we finally... Continue reading "Apartment Living with Dogs: Max's Urban Adventure" »

Direct and Indirect Exporting Strategies for Businesses

Classified in Economy

Written at on English with a size of 3.78 KB.

Direct and Indirect Exporting

  • Exporting
    • Exporting can be direct or indirect.
    • In direct exporting, the company sells to a customer in another country.
    • The Internet is becoming increasingly important.

Exporting may be done passively or actively. Passive exporting occurs when a business receives orders from abroad without actively looking for them. Active exporting involves developing policies for setting up systems for organizing the export function and for dealing with export logistics, documentation, and finance.

With indirect exporting, intermediaries handle most aspects of export deals. Returns are obviously lower. You lose control over final selling prices.

  • Indirect Exporting: Products are sold to a third party who then sells them within the
... Continue reading "Direct and Indirect Exporting Strategies for Businesses" »

English Grammar and Vocabulary: Tenses, Phrasal Verbs, Prepositions

Classified in Other languages

Written at on English with a size of 4.71 KB.

English Grammar: Verb Tenses

Present Simple

  • Used for actions that happen regularly (but are not happening at this moment).
  • Examples: schedules, calendars

Present Continuous

  • Used for actions happening now.
  • Examples: fixed and sure plans, orders

Past Simple

  • Used for actions that were completed in the past.
  • Regular verbs: Verb + -ed
  • Irregular verbs: second column of the irregular verb list
  • Negative: didn't + subject + verb
  • Interrogative: did + subject + verb

Past Continuous

  • Used for actions that lasted for a long time in the past (often with specific times or dates).
  • Affirmative: subject + was/were + verb + -ing
  • Negative: subject + wasn't/weren't + verb + -ing
  • Interrogative: was/were + subject + verb + -ing

Past Perfect Simple

  • Used for an action that happened before
... Continue reading "English Grammar and Vocabulary: Tenses, Phrasal Verbs, Prepositions" »

C++ Priority Queue Implementation: Code & Explanation

Classified in Computers

Written at on English with a size of 3.58 KB.

C++ Priority Queue Implementation

This document provides a C++ implementation of a priority queue using a heap data structure. The code includes the class definition, member functions, and supporting utilities.

Priority Queue Class Definition


#ifndef priority_queue_h_
#define priority_queue_h_

#include <iostream>
#include <vector>
#include <cassert>

template <class T>
class priority_queue {
private:
    std::vector<T> m_heap;

public:
    priority_queue() {}

    priority_queue(std::vector<T> const& values)
    {
        m_heap = values;
        for (int i = 0; i < m_heap.size(); i++){
            percolate_down(i);
            for (int j = i; j < m_heap.size(); j++){
                percolate_down(
... Continue reading "C++ Priority Queue Implementation: Code & Explanation" »