Notes, summaries, assignments, exams, and exercises for Computer science for University

Network Protocols: CSMA/CD and Guided Media Transmission

Computer science1.6 KB

CSMA/CD Protocol: Ethernet Data Management

Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a network protocol used in Ethernet networks for managing data transmission over a shared medium. Before transmitting, a device listens to the channel to ensure it is not in use (carrier sense). If the channel is clear, it sends data. While transmitting, the device also listens for collisions. If a collision occurs (when two devices transmit simultaneously), both devices stop, send a jamming signal, and wait a random time before retrying. CSMA/CD effectively reduces collisions but is less efficient with many devices and is not suitable for wireless networks.

Guided Media Transmission: Applications and Benefits

Guided media transmission...

Continue reading "Network Protocols: CSMA/CD and Guided Media Transmission" »

Debugging and Optimizing Essential Java Code Examples

Computer science10.4 KB

This document presents seven fundamental Java programming examples (pg1 through pg7) that demonstrate basic input/output, conditional logic, array handling, and algorithmic concepts. The original code contained numerous syntax errors, capitalization issues, and logical flaws. Below, we provide the corrected and optimized versions, ensuring proper Java conventions and functionality.

1. pg1: Conditional Arithmetic Checks

Purpose: Evaluating multiple arithmetic relationships between three input integers (a, b, c).

The original code had incorrect capitalization (Int, If, Else) and a logical flaw where the combined condition check was unreachable due to sequential else if statements. The corrected version addresses these issues.

import java.util.Scanner;
...
Continue reading "Debugging and Optimizing Essential Java Code Examples" »

Data Manipulation and Visualization with R and the nycflights13 Dataset

Computer science3.64 KB

library(nycflights13)
library(tidyverse)

Data Manipulation with dplyr

Ordering Rows with arrange()

arrange(flights, year, month, day)
arrange(flights, desc(arr_delay))

Handling NAs

df <- tibble(x = c(5, 2, NA))
arrange(df, x)
arrange(df, desc(x))

Selecting Columns with select()

select(flights, year, month, day)
select(flights, year:day)
select(flights, -(year:day))
rename(flights, mes = month)
select(flights, time_hour, air_time, everything())

Creating New Variables with mutate()

flights_sml <- select(flights, year:day, ends_with("delay"), distance, air_time)
mutate(flights_sml, gain = arr_delay - dep_delay, speed = distance / air_time * 60)

Creating Functions with Vector Arguments

transmute(flights, dep_time, hour = dep_time %/% 100, minute = dep_time %
...
Continue reading "Data Manipulation and Visualization with R and the nycflights13 Dataset" »

Evolution of the iPhone: Early Models & Capabilities

Computer science1.68 KB

Evolution of the iPhone

Released on June 29, 2007, the iPhone has seen multiple new hardware iterations with new iOS releases since.

User Interface and Connectivity

The user interface is built around the device's multi-touch screen, including a virtual keyboard. The iPhone has Wi-Fi and can connect to cellular networks.

Core iPhone Features

An iPhone can:

  • Shoot video (standard feature from the iPhone 3GS)
  • Take photos
  • Play music
  • Send and receive email
  • Browse the web
  • Send and receive text messages
  • Follow GPS navigation
  • Record notes
  • Perform mathematical calculations
  • Receive visual voicemail

Other functionality, such as video games, reference works, and social networking, can be enabled by downloading mobile apps.

The App Store Ecosystem

As of January 2017, Apple'...

Continue reading "Evolution of the iPhone: Early Models & Capabilities" »

A Glossary of Computer and Internet Terms

Computer science3.71 KB

ASCII Code

American Standard Code for Information Interchange. A code in which each alphanumeric character is represented as a number from 0 to 127, translated into a 7-bit binary code for the computer. ASCII is used by most microcomputers and printers, and because of this, text-only files can be transferred easily between different kinds of computers.

Availability

A measure of how easy or difficult it is to obtain a piece of hardware or a computer application.

Backbone

High-speed lines or connections that form the major access pathways within the Internet.

Bandwidth

The capacity of a networked connection. Bandwidth determines how much data can be sent along the networked wires. Bandwidth is particularly important for Internet connections, since greater...

Continue reading "A Glossary of Computer and Internet Terms" »

Understanding Counting Principles, Knowledge Types, and Geometric Thinking

Computer science3.56 KB

The Counting Principles

Counting is the action of finding the number of elements in a finite set of objects. Here are the key principles:

  1. The Stable-Order Principle: To count effectively, the list of words used (like one, two, three) must be in a repeatable order.
  2. The One-to-One Principle: This involves assigning one, and only one, distinct counting word to each item being counted.
  3. The Cardinal Principle: When the one-to-one and stable-order principles are followed, the number name given to the final object in a collection represents the total number of items in that collection.
  4. The Order-Irrelevance Principle: This principle highlights that the order in which items are counted doesn't affect the total count.
  5. The Abstraction Principle: These counting
...
Continue reading "Understanding Counting Principles, Knowledge Types, and Geometric Thinking" »

Microsoft Access Query Design and Data Management FAQ

Computer science3.4 KB

Microsoft Access Query Fundamentals

  • Query Creation: Queries are built using the Query Wizard, which prompts for necessary information.
  • Datasheet Behavior: When a query is run, the datasheet contents are temporary.
  • Field Ordering: The display order of fields in a query is determined by their order in the Design Grid.
  • Execution: To view query results, you must run the query.
  • Field Selection: Double-clicking the field list title bar in the design window will highlight all fields.
  • Adding Fields: You can automatically include all table fields by double-clicking the asterisk in the Field List box.

Managing Related Data and Records

  • Multi-Table Queries: Data can be extracted from multiple tables in one query, even if the tables are separate.
  • Referential Integrity:
...
Continue reading "Microsoft Access Query Design and Data Management FAQ" »

Microsoft Access Core Concepts and Functions

Computer science3.87 KB

Fundamental Database Concepts

What is a datasheet?

When you first open a datasheet, Microsoft Access selects the first field value in the first record.

What is a table?

All fields for a specific individual or place can be grouped together as a table.

How can a field be described?

A field can be described as an attribute.

What is a primary key?

A field, or a combination of fields, that has a unique value is a primary key.

What is a requirement for a primary key?

A primary key must contain a unique value for each record within the table.

What is a foreign key?

A field that is defined in one table and is also a primary key in a different table is a foreign key.

What is a requirement for a foreign key?

Every foreign key must match the field value of a primary

...
Continue reading "Microsoft Access Core Concepts and Functions" »

Database Management System: Key Concepts and Features

Computer science3.9 KB

Why do you have a primary key?

A primary key ensures UNIQUE DATA.

Form Design Views

In Form View, you cannot make any design changes to a form.

Checking Field Lengths

Martha is concerned that her form data may be longer in length than the size of the field control. To check this, she should use Print View.

Handling Primary Key Changes

If you choose the Cascade Update Related Fields Option, Access permits the change in value to the primary key and changes the appropriate foreign key values in the related table, thereby eliminating the possibility of inconsistent data in Yuka's database.

Resizing Columns

You can resize columns easily in Layout View.

Activating the Find Command

You can activate the Find command from the button on the Home tab.

Saving Database

...
Continue reading "Database Management System: Key Concepts and Features" »