Java Fundamentals: Type Conversion, Scope, Arrays, and More
Type Conversion
int n = Integer.parseInt("53"); // compile-time error
double m = Integer.parseInt("53"); // automatic conversion (int to double)
int n = Double.parseDouble("53"); // compile-time error
int n = Integer.parseInt("cat"); // run-time error
double → int : (int) castingString Conversion
String → int : int x = Integer.parseInt(" ");String → double : double y = Double.parseDouble(" ");String → boolean : boolean z = Boolean.parseBoolean("true/false");Scope
Computer Organization and Architecture Fundamentals
Computer Technology and Architecture
- Computer technology is changing at a rapid pace.
- Computer architecture refers to those attributes that have a direct impact on the logical execution of a program.
- Architectural attributes include I/O mechanisms.
- Organizational attributes include hardware details transparent to the programmer.
- It is an architectural design issue whether a computer will have a multiply instruction.
- It is an organizational issue whether the multiply instruction will be implemented by
Comprehensive Guide to Sorting Algorithms and Data Structures
1. Lower Bound on Sorting Algorithm Complexity
Any correct sorting algorithm, regardless of its type (comparison-based or otherwise), has a lower bound on its worst-case complexity of Ω(n).
2. In-Place Sorting Algorithms and Auxiliary Storage
Statement: Sorting algorithms that sort objects “in place” require O(1) auxiliary storage (on top of the space needed to store the values to be sorted).
Assessment: Valid
3. Sorting Algorithms and In-Place Sorting
Question: All of these sorting algorithms sort objects
Read MoreLab 5: Configuring GRUB Boot and Kernel Modules
Overview
This lab covers configuring the GRUB boot loader and inserting/removing modules onto a running kernel. It is recommended to perform these steps in a controlled environment like the 401lab to allow for rebooting in case of errors.
Key Concepts
- rpm (Red Hat Package Manager): Installs, verifies, and queries packages.
- Hot-plugging: A feature (especially in SuSE Linux) that allows the system to detect newly added hardware like USB or FireWire devices.
- lsmod: Lists all loaded modules.
- diff: Compares
Learn Go in Y Minutes: A Crash Course in Golang Programming
Learn Go in Y Minutes
Introduction
This is a crash course in the Go programming language. It covers the basics of syntax, data types, control flow, and concurrency.
Getting Started
Go is a statically typed, compiled language with a focus on simplicity and efficiency. It’s known for its built-in concurrency features and fast compilation times.
Package Declaration
Every Go source file starts with a package declaration. The main package is special and declares an executable program.
package mainImport Declaration
Import
Read MorePipeline Performance and Hazard Detection in Computer Architecture
Given a non-pipelined architecture running at 2.5GHz that takes 5 cycles to finish an instruction. You want to make it pipelined with 5 stages. The increase in hardware forces you to run the machine
at 2GHz. The only stalls are caused by:
- memory – (30% of the total instructions) a stall of 50 cycles happens in 2% of the memory instructions
- branch – (20% of the total instructions) a stall of 2 cycles happens in 20% of the branch instructions
What is the speedup? Clearly show all work.
For the following
Read More