Latency and throughput

Latency (execution time): time to finish a fixed task Throughput (bandwidth): number of tasks per unit time Calculate speed up Average performance CPU Performance CPI: Cycles/instruction IPC = 1/CPI Used more frequently than CPI Favored because “bigger is better”, but harder to compute with What is the CPI? (1 cycle+2 cycles +3 cycles) / 3 …

Notes on “Threads”

Threads The thread defines a sequential execution stream within a process. Processes The process defines the address space and general process attributes (everything but threads of execution) Kernel-level thread OS-managed threads are called kernel-level threads or lightweight processes. Thread operations still require system calls Kernel-level threads have to be general to support the needs of …

Rotate Array

This is No.189 problem in LeetCode. The problem description is: Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to …

How to let WordPress only displays summary of article on home page

Firstly, find the directory: Appearance -> Theme Editor -> Main Index Template -> index.php, and locate the code: /* Start the Loop */ while ( have_posts() ) : the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called …

A Simple Calculator Application On Android Studio

1. Open Android Studio and create a new project. 2. Set the basic information and choose API. 3. Finish basic setting and choose activity platform (Basic Activity Here). 4. See the main page. 5. Remove some irrelevant code from activity_main.xml. Click the text button on the bottom of activity_main.xml. Delete FloatingActionButton which will show e-mail …

Dynamic Programming

What is Dynamic Programming? Let’s have a look at the definition on Introduction to Algorithm: "Dynamic programming like the divide-and-conquer method, solves problems by combining the solutions to sub-problems. Different from divide-and-conquer, dynamic programming applies when the sub-problems overlap — that is, when sub-problems share sub-sub-problems. A dynamic programming algorithm solves each sub-sub-problems just once …