Show Menu
Cheatography

compsci exam Cheat Sheet (DRAFT) by

fisdjiafjifjspad[jfasjfopadjofjsopad

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Docker FIle

FROM
Create a new build stage from a base image.
RUN
Execute build commands.
COPY
Copy files and direct­ories.
COPY
Specify default commands.

MySQL

SELECT
Extracts data from database
UPDATE
Updates data in a database
DELETE
deletes data from a database
INSERT INTO
inserts new data into a database
CREATE DATABASE
Creates a new database
ALTER DATABASE
Modifies a database
CREATE TABLE
Creates a new Table
*DROP TABLE
Deletes a table
CREATE INDEX
Creates a search key
DROP INDEX
Deletes search key
ORDER BY
List by a certain column, DESC or ASC, etc.
DISTINCT
Filter only unique inputs
WHERE
Filter function (SELECT * FROM Customers WHERE Countr­y='­Mex­ico')
 

HTTP

GET
Fetch the resource from web
PUT
Update the resource
POST
Create a resource to send to web
DELETE
Delete resource from web
 

Memory Resources

Caching Heiarchy
CPU Registers, L1, L2, L3, RAM, SSD/HDD, Cloud
FIFO
First In First Out, Evict Oldest Entry
LRU
Least Recently Used, Evict the entry that has been used longest ago. Move hits to front
Transp­osing
Column by Column, faster than row by row for long arrays.
FS(File System)
Caches data in the RAM. Uses memory and avoids storage reads.
Stale Data
Old files are deleted from the cache. SSD is large, so freshness more important than space there.
PyArrow
Cache Friendly table layout. Saves time when handling large datasets by turning each value into Pyarrow Types.
 

Compute Resources

Locks
Making a code execute on only one thread. Avoids discre­pancies from other threads changing vals.
Thread­ing.lock()
class thread­ing.Lock The class implem­enting primitive lock objects. Once a thread has acquired a lock, subsequent attempts to acquire it block, until it is released; any thread may release it. Changed in version 3.13: Lock is now a class. In earlier Pythons, Lock was a factory function which returned an instance of the underlying private lock type.
lock.a­cqu­ire()
Acquire a lock, blocking or non-bl­ocking. Locks code under lock to one thread.
lock.r­ele­ase()
Release a lock. This can be called from any thread, not only the thread which has acquired the lock.
GIL
Global Interp­reter Lock.