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

Sort by
Subject
Level

Predictive Modeling Techniques in Data Mining

Classified in Computers

Written on in English with a size of 4.25 KB

CH6

Predictive Modeling Techniques

61) Predictive modeling is perhaps the most commonly practiced branch in data mining. What are three of the most popular predictive modeling techniques?

Answer:

  • Artificial neural networks
  • Support vector machines
  • k-nearest neighbor

62) Why have neural networks shown much promise in many forecasting and business classification applications?

Answer: Because of their ability to "learn" from the data, their nonparametric nature (i.e., no rigid assumptions), and their ability to generalize.

Understanding Neural Networks

63) Each ANN is composed of a collection of neurons that are grouped into layers. One of these layers is the hidden layer. Define the hidden layer.

Answer: A hidden layer is a layer of neurons that takes input... Continue reading "Predictive Modeling Techniques in Data Mining" »

Java Code Examples: Word Count, Fibonacci, Stack & Queue

Classified in Computers

Written on in English with a size of 6.62 KB

Class: CountOccurrenceOfWords

This class demonstrates how to count the occurrences of words in a given text string using a TreeMap to maintain sorted word counts.

public class CountOccurrenceOfWords {
    public static void main(String[] args) {
        // Set text in a string
        String text = "Good morning. Have a good class. " +
                      "Have a good visit. Have fun!";

        // Create a TreeMap to hold words as keys and counts as values
        Map<String, Integer> map = new TreeMap<>();

        String[] words = text.split("[ \n\t\r.,;:!?()]+");
        for (int i = 0; i < words.length; i++) {
            String key = words[i].toLowerCase();
            if (key.length() > 0) {
                if (!map.
... Continue reading "Java Code Examples: Word Count, Fibonacci, Stack & Queue" »

VHDL ALU Testbench Implementation and Simulation

Classified in Computers

Written on in English with a size of 2.33 KB

VHDL ALU Testbench Code

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use std.textio.all;
use ieee.std_logic_textio.all;

entity alu_tb is
end alu_tb;

architecture sim of alu_tb is
    component alu
        generic (N : positive);
        port (
            a, b : in std_logic_vector (4*N-1 downto 0);
            opr : in std_logic;
            ovfw_sign : out std_logic;
            resultado : out std_logic_vector (4*N-1 downto 0)
        );
    end component;

    constant N : positive := 4;
    signal a_i, b_i : std_logic_vector (4*N-1 downto 0);
    signal opr_i : std_logic;
    signal ovfw_sign_i : std_logic;
    signal resultado_i : std_logic_vector (4*N-1 downto 0);

begin
    DUT: alu
    generic map (N =>
... Continue reading "VHDL ALU Testbench Implementation and Simulation" »

Object-Oriented Data Encapsulation & Types

Classified in Computers

Written on in English with a size of 2.63 KB

Chapter 1: Foundations of Object-Oriented Programming

Data Encapsulation with Classes

The starting point of object-oriented programming is to provide a more faithful implementation of the notion of “type” in programming. The programming languages we are familiar with come with standard built-in types that we can assign to variables and values:

Built-in Programming Types

  • In C, we can use int, float, double, char, etc.
  • In Haskell, similarly, we can use Int, Float, Char, Bool, etc.

In addition, programming languages provide a way to assign a single name to a collection of values of the same type. The nature of this collection is determined by the underlying architecture assumed by the programming language.

Collections and Data Structures

Arrays in
... Continue reading "Object-Oriented Data Encapsulation & Types" »

Core Operating System Concepts: Processes, Shells, and Security

Classified in Computers

Written on in English with a size of 95.39 KB

Operations on a Process

  1. Process Creation: A user request or an already running process can create new processes. A parent process creates child processes using a system call, which, in turn, can create other processes, forming a tree of processes.
  2. Process Pre-emption: A process is pre-empted if an I/O event or timeout occurs. The process then moves from the running state to the ready state, and the CPU loads another process from the ready state to the running state, if available.
  3. Process Blocking: When a process requires an I/O event during its execution, it moves from the running state to the waiting state, and the CPU dispatches another process.
  4. Process Termination: A process is terminated when it completes its execution. Additionally, events
... Continue reading "Core Operating System Concepts: Processes, Shells, and Security" »

Software, Hardware, Networking, Cloud & IoT Fundamentals

Classified in Computers

Written on in English with a size of 2.96 KB

Software

Software: It's a set of instructions, data, or programs used to operate computers and execute specific tasks. It is a generic term used to refer to applications, software, and programs that run on a device. E.g. Excel, Linux, macOS.

Hardware

Hardware: It's the physical parts of a computer and related devices. They can be internal, such as: motherboard, RAM, CPU; or external, such as monitors, printers, and keyboards.

Client/Server Computing

Client/Server Computing: This is a distributed computing model where some processing power is located within small, cost-effective client PCs.

Packet Switching

Packet Switching: Packet switching is a method of breaking down digital messages into smaller packets. These packets are sent across various communication... Continue reading "Software, Hardware, Networking, Cloud & IoT Fundamentals" »

Algorithm Analysis: Time and Space Complexity

Classified in Computers

Written on in English with a size of 4.5 KB

Space Complexity

  • Analysis of the space complexity of an algorithm or program is the amount of memory it needs to run to completion.
  • The space needed by a program consists of the following components:
  • Fixed space requirements: Independent of the number and size of the program's input and output. It includes:
  • Instruction Space (Space needed to store the code)
  • Space for simple variables
  • Space for constants
  • Variable space requirements: This component consists of:
  • Space needed by structured variables whose size depends on the particular instance I of the problem being solved
  • Space required when a function uses recursion

Total Space Complexity

S(P) of a program is:

S(P) = C + Sp(I)

Here Sp(I) is the variable space requirements of program P working on an instance... Continue reading "Algorithm Analysis: Time and Space Complexity" »

Digital Technology: Applications and Considerations

Classified in Computers

Written on in English with a size of 2.22 KB

E-Voting

Considerations

  • Voter ID
  • Candidate ID and Voter ID
  • Representing information in text format
  • Secure section for additional fields
  • Providing a set number of options to reduce data input errors

Data Collection Methods

Questionnaires

Advantages: Less labor-intensive than interviews.

Disadvantages: Poorly designed questions (e.g., overuse or lack of closed questions) can lead to misunderstandings.

Interviews

Advantages: Provide more detailed information than questionnaires; allow for face-to-face interaction.

Disadvantages: Time-consuming; require skilled interviewers.

BYOD at Xingu Academy

Technical Aspects

  • MAC address and IP address management
  • Voice recognition software: Converts analog speech to digital sound, then to text using a sound database. Matches
... Continue reading "Digital Technology: Applications and Considerations" »

Mastering Apache Flink and HBase Data Operations

Classified in Computers

Written on in English with a size of 4.37 KB

Identify High-Volume Customer Purchases in Flink

The following Java code utilizes Apache Flink to identify customers who purchase more than 10 units of a specific item within a session window.

public class CustomerPurchase {
    public static void main(String[] args) throws Exception {
        final ParameterTool params = ParameterTool.fromArgs(args);
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<String> text = env.readTextFile(params.get("input"));
        env.getConfig().setGlobalJobParameters(params);

        SingleOutputStreamOperator<Tuple3<Long, Integer, Integer>> mapStream = text.map(new MapFunction<String, Tuple3<Long, Integer, Integer>
... Continue reading "Mastering Apache Flink and HBase Data Operations" »

C++ Cheat Sheet: Structs, Classes, Pointers, Arrays, and More

Classified in Computers

Written on in English with a size of 6.65 KB


```c++
    //input 
    int main(int argc, char * argv[]){ // or char ** argv
        const char* strs[] = {"Hello", "World!"};
        const char str[] = {"Hello"};
        const int arr[] = {1,2,3};
        std::cout << *strs<< std::endl;
        std::cout << str << std::endl;
        std::cout << arr << std::endl;
        std::cout << *arr << std::endl;
        std::cout << *str << std::endl;
        std::cout << *(strs + 1)<
    } 
    //output
    Hello
    Hello
    0x77d02fb38050
    1
    H
    World!
    void insert(int array[], int size, int item, int num_copies){
    for(int * i = array; i < array + size - num_copies;
... Continue reading "C++ Cheat Sheet: Structs, Classes, Pointers, Arrays, and More" »