Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

Developing Logical and Mathematical Thinking in Children

Classified in Computers

Written on in English with a size of 3.73 KB

What is Mathematical Logical Thinking?

These are the skills students develop associated with logical and mathematical concepts, reasoning, comprehension, and exploration of the world through real proportions, thus strengthening more abstract aspects of thought.

Geometry with Dinosaurs

This activity involves cutting out various geometric shapes with EVA rubber. Children will then create their own dinosaurs using these shapes. Through this activity, they can learn geometric shapes, count the number of elements used in each dinosaur (like the sides of the shapes), and create new geometric shapes from the ones they already have.

Logical Reasoning with Chupa Chups

This activity consists of creating logically structured material and playing with it using... Continue reading "Developing Logical and Mathematical Thinking in Children" »

C# and .NET Core Fundamentals: Essential Programming Concepts

Posted by Anonymous and classified in Computers

Written on in English with a size of 14.54 KB

.NET Framework and Its Core Components

The Microsoft .NET Framework is a comprehensive and consistent programming model developed by Microsoft for building applications with visually stunning user experiences, seamless and secure communication, and the ability to model a range of business processes. The .NET Framework is a software development platform used for building and running Windows applications. It provides a controlled programming environment where software can be developed, installed, and executed primarily on Windows-based operating systems.

Key Components of .NET Framework:

  1. Common Language Runtime (CLR): The CLR is the execution engine for .NET applications. It provides core services such as:
    • Memory management (garbage collection)
    • Thread
... Continue reading "C# and .NET Core Fundamentals: Essential Programming Concepts" »

LEGv8 Architecture and Assembly Language: Key Concepts

Classified in Computers

Written on in English with a size of 239.58 KB

Performance Metrics

  • Elapsed Time: Represents overall system performance. It is the total time taken to complete a task.
  • User CPU Time: Indicates CPU performance. It is the time the task actively runs on the CPU, excluding idle time.
  • CPU Time: The time the CPU spends executing instructions, either from the task or the operating system, excluding idle time.
  • Clock Speed: 1 MHz equals 1 million clock cycles per second. 1 GHz equals 1 billion clock cycles per second.
  • Response Time: Equivalent to execution time.
  • Throughput: Equivalent to bandwidth.
  • Performance Comparison: (PerfA) / (PerfB) = (ExecTimeB) / (ExecTimeA) = n

Impact of Processor Upgrades

  • Replacing a processor with a faster one decreases response time and increases throughput.
  • Adding an additional
... Continue reading "LEGv8 Architecture and Assembly Language: Key Concepts" »

C++ & C Programming Solutions: Algorithms & Patterns

Classified in Computers

Written on in English with a size of 5.13 KB

1. Anagram Detection: C++ String Comparison

This C++ program determines if two input strings are anagrams of each other. It achieves this by converting both strings to lowercase, sorting their characters alphabetically, and then comparing the sorted strings. If they are identical, the original strings are considered anagrams.


#include<bits/stdc++.h>
using namespace std;

int main(){
    string s2,s1;
    cin>>s1>>s2;
    transform(s1.begin(),s1.end(),s1.begin(),::tolower);
    transform(s2.begin(),s2.end(),s2.begin(),::tolower);
    sort(s1.begin(),s1.end());
    sort(s2.begin(),s2.end());
    cout<< (s2==s1);
}

2. Array Subarray: C++ Sliding Window Minimum

This C++ program attempts to find the maximum of minimums within... Continue reading "C++ & C Programming Solutions: Algorithms & Patterns" »

Java Programming Essentials: Exceptions, Threads, Events, and Adapters

Posted by Anonymous and classified in Computers

Written on in English with a size of 7 KB

Core Java Programming Concepts Explained

Key Java Definitions

  • Exception: An event that disrupts the normal flow of a program's instructions.
  • Thread: A lightweight subprocess enabling multitasking within a program.
  • Event Handling: Implemented using listeners and event classes that respond to user actions.
  • Applet: A small Java program embedded in a web page for interactive content.
  • Remote Applets: Used to download and execute applets from a web server over the internet.
  • Applet Parameters: Passed to applets using <PARAM> tags in HTML, accessed via the getParameter() method.
  • Daemon Thread: Runs in the background for services like garbage collection and ends when main threads finish.
  • Thread Synchronization Advantages:
    • Prevents thread interference.
    • Ensures
... Continue reading "Java Programming Essentials: Exceptions, Threads, Events, and Adapters" »

Understanding Servlet Architecture for Java Web Apps

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.4 KB

Understanding Servlet Architecture for Java Web Applications

Servlet architecture is a core component of Java EE (Enterprise Edition) used for building dynamic web applications. A Servlet is a Java class that runs on a web server and acts as a middle layer between client requests (typically from a browser) and server responses (usually from a database or application logic).

What is a Servlet?

A Servlet is a Java class used to handle HTTP requests and responses in web applications. It runs on a server, receives requests from a client (usually a browser), processes them (e.g., reads form data, interacts with a database), and sends back a dynamic response (like HTML or JSON).

Key Components of Servlet Architecture

  • Client (Browser): Sends an HTTP request
... Continue reading "Understanding Servlet Architecture for Java Web Apps" »

Array and String Algorithms: Core Problem Solutions

Classified in Computers

Written on in English with a size of 6.48 KB


Longest Substring Without Repeating Characters

This problem involves finding the length of the longest substring in a given string that does not contain any repeating characters. A common approach uses a sliding window technique with a Set to efficiently track unique characters.

Strategy:

  • Utilize a Set to store characters within the current window.
  • Iterate through the string with a right pointer, adding characters to the Set.
  • If a duplicate character is encountered, move the left pointer forward, removing characters from the Set, until the duplicate is no longer present.
  • At each step, update the maximum length found.

Java Implementation Snippet

class Solution {
    public int findLongestSubstringWithoutRepeatingCharacter(String str) {
        Set&
... Continue reading "Array and String Algorithms: Core Problem Solutions" »

Tensors and Variables in PyTorch and TensorFlow

Classified in Computers

Written on in English with a size of 2.4 KB

Tensors and Variables in PyTorch and TensorFlow

Here's a brief explanation of tensors and variables in the context of deep learning frameworks like PyTorch and TensorFlow:

Tensors

  • Definition: A tensor is a multi-dimensional array used to represent data (such as scalars, vectors, matrices, or higher-dimensional data).
  • Common Operations: Tensors can be manipulated with mathematical operations (addition, multiplication, etc.), reshaped, sliced, etc.

In PyTorch, tensors are the core data structure:

import torch
# Create a tensor
a = torch.tensor([[1, 2], [3, 4]])
# Basic operations
b = a + 2         # Adds 2 to each element
c = a * a         # Element-wise multiplication
d = a @ a         # Matrix multiplication

Output:

Tensor `b`: [[3, 4], [5, 6]]
Tensor
... Continue reading "Tensors and Variables in PyTorch and TensorFlow" »

C++ Concepts: Exception Handling to Friend Functions

Classified in Computers

Written on in English with a size of 3.16 KB

Exception Handling

#include <iostream>
#include <stdexcept>
using namespace std;
int main() {
    try {
        int numerator = 10;
        int denominator = 0;
        int res;
        if (denominator == 0) {
            throw runtime_error("Division by zero not allowed!");
        }
        res = numerator / denominator;
        cout << "Result after division: " << res << endl;
    }
    catch (const exception& e) {
        cout << "Exception " << e.what() << endl;
    }
    return 0;
}

Operator Overloading

#include <iostream>
using namespace std;
class Test {
private:
    int num;
public:
    Test(): num(8){}
    void operator ++() {
        num = num + 2;
    }
    void Print() {
... Continue reading "C++ Concepts: Exception Handling to Friend Functions" »

CUDA Matrix Multiplication: Shared Memory

Classified in Computers

Written on in English with a size of 3.23 KB

CUDA Matrix Multiplication Using Shared Memory

This code demonstrates matrix multiplication in CUDA, leveraging shared memory for optimization. It includes two examples: a kernel using shared memory and a host-side implementation using the Thrust library.

CUDA Kernel with Shared Memory

The following CUDA kernel performs matrix multiplication using shared memory to optimize data access:


__global__ void matMulShared(int *A, int *B, int *C, int rowsA, int colsA, int colsB) {
    __shared__ int tile_A[TILE_SIZE][TILE_SIZE], tile_B[TILE_SIZE][TILE_SIZE];
    int row = blockIdx.y * TILE_SIZE + threadIdx.y, col = blockIdx.x * TILE_SIZE + threadIdx.x, temp = 0;
    for (int i = 0; i < (colsA + TILE_SIZE - 1) / TILE_SIZE; ++i) {
        if (row <
... Continue reading "CUDA Matrix Multiplication: Shared Memory" »