Extra general Flashcards
When should you use local variables and when should you use global variables
If you feel that a certain variable will take multiple values by passing through various functions then use local variables and pass them in function calls. If you feel that a certain variable you need to use will have constant value, then declare it as a global variable
What is top down design
breaking a problem down
Advantages of top down design
the problem is easier to understand, program, test and maintain.
Shows clearly how different parts of the problem relate to each other
Division of labour - different teams working on different parts of the problem independently
May make code more modular as it broken into smaller subroutines
Disadvantages of top down design
It assumes that the whole solution to the problem is knowable in advance.
Poorly understood programs are hard to decompose.
Not every problem can be broken down in this way, for example event driven programs like GUIs
What are the 4 values of the agile methods
1.Individuals over processes
2.Working software over documents
3.Customer collab
change
Pros of flat file databases
Easy to set up - no knowledge required
Easy to use in code - e.g. CSV files are easy to process
Easy to share, e.g. email attachments
Cons of flat file databases
Duplication of data (data redundancy) which take more time to update eg if Miss Read moves house you have to update her address in multiple rows, can lead to inconsistency eg you forget to update Miss Read’s details in every place they are stored.
Take up more space so more storage is required.
Everyone can see everything (not good if some data is sensitive)
Inefficient – have to have all fields for every record
Can’t perform complex queries as easily
Pros of relational databases
Reduces duplication of data meaning easier to update, accurate, better consistency, less storage space
Can set different access rights for each user for each table
Can index fields for quicker searching
If implemented with DBMS, it will allow concurrent access to the database allowing multiple users
Complex queries can be carried out
Cons of relational databases
More difficult to correctly set up (normalization is the process of structuring the data in a relational database according to formal rules to avoid problems of data redundancy which leads to inconsistency and inaccuracy (incorrect) and inconsistency (between different fields)
Cons of cache
small size and fixed size
Pros of web browser cache
Faster load time, reduced network traffic ie fewer HTTP requests
Cons of web browser cache (cache in general)
Cached resource may be out of date
What does a cache server (proxy server) do?
Cache server (proxy server) saves previously requested web pages or other content.
Pros of caching a proxy server
Faster load time as HTTP request does not have to go original web server, reduces network traffic
When is DNS cache used?
When a DNS server responds to a DNS request, the operating system may store these results in a local DNS cache
Pros of DNS cache?
reduced network traffic ie fewer DNS requests.
Reduced network traffic as there will be fewer DNS requests to remote DNS servers
Cons of DNS cache?
resources may be out of date, if a web page has changed the location of its server an error may occur
Pros of caching in general
Speeds up retrieval
Cache miss normally would not result in error
Cons of caching
Algorithms for caching can be very complicated. When the cache is full, the algorithm must choose which items to discard to make room for the new ones.
Wrong data may be cached then it has to be removed and the correct data loaded.
Cache does not have the required content (cache miss) so time is wasted checking it.
What is a cache hit
dataA “cache hit” occurs when a file is requested from a cache and the cache is able to fulfill that request
What is a cache miss
an event in which a system or application makes a request to retrieve data from a cache, but that specific data is not currently in cache memory
What does atomic mean
Atomic means each item of data is distinct and you can’t separate the data any more or break it up any smaller without losing meaning.
atomicity
The fully or not at all transaction thing
When would you not have to do anything for second normal form
If you don’t have any composite primary keys
Do the normal forms have to be done in order
Yes
What does tcp do
the type of error checking to be used
data compression method, if any
how the sending device will indicate that it has finished sending a message
how the receiving device will indicate that it has received a message
type of encryption used
packet size
UDP
a communications protocol that is primarily used to establish low-latency and loss-tolerating connections between applications on the internet. UDP speeds up transmissions by enabling the transfer of data before an agreement is provided by the receiving party. No error checking which makes it good for gaming and streaming but bad for sending over important documents as if data is lost it cannot be retrieved due to no error checking
What is a standard
standard is a definition or specification that is an agreed way of doing things. Standards make it easier to build software or hardware that will run (is compatible) on different systems (in different countries). Without standards most devices would not be able to communicate with each other.
Two categories of standards
De jure (by force of law) and de facto standards
Dejure
Regulated by official bodies and used across the internet
defacto standards
ones that arise through popular use but are not managed or regulated
Why are standards important
Standards form the fundamental building blocks for product development by establishing consistent protocols that can be universally understood and adopted.
Standards are important in the computer industry because they allow the combination of products from different manufacturers to create a customized system.
What would happen without standards
Without standards, only hardware and software from the same company could be used
Why are protocols important
Set of rules that allow transmission between devices.
Allowing devices to communicate
By ensuring all devices follow the same rules
So they interpret data/signals in the same way
What is DRAM
dynamic RAM and it is used for main memory
What is SRAM
Static RAM and used for cache memory (shorter access time than dynamic RAM)
First step of bios
Power On Self-Test (POST) runs to determine if hardware eg processor, RAM, storage devices and other interface cards are working correctly
Second step of bios
Load configuration settings eg clock speed, boot device order, enabled and disable interfaces
third step of bios
Find and load the bootloader program from secondary storage, which starts the initialisation of the operating system.
Example of special purpose software
Calculators and CAD
Memory management
Recording how memory in the computer is divided and identified so that memory is allocated efficiently between processes that are running
Process management
(CPU) Scheduling allows multiple processes to run in turn using a scheduling algorithm
File management
Enables files and directories to be moved, copied, deleted and renamed on secondary storage devices
Network management
Sharing resources of a remote computer such as files or printers.
Security
The OS supports the security of a device by ensuring that resources are protected from unauthorised access through the use of permissions and passwords, e.g user access rights, user authentication, file permissions
User interface
to provide an interface between the user and computer (ie, CLI, GUI)
What does RIPA stand for
Regulation of investigatory powers
What does RIPA give authorities the power to do
Compel disclosure of encryption keys and the power to insist on users decrypting messages
What does RIPA ensure in link to communications
Communications can be monitored if there is just cause
Negative of constant monitoring
Risk of false positive
Positive of constant monitoring
Reduce risk of illegal activities being co-ordinated
Origin of private key in asymmetric encryption and why it has a lower chance of getting intercepted
It is the recipients private key
How to prove a message has been sent by you
Encrypt it using YOUR private key and then everybody can decrypt it using your PUBLIC key so you can guarantee that you encrypted
What is a hash
A fixed size value
What do hash tables store
key-value pairs
What are key value pairs formed from
A bucket array and a hash function
Why are hash tables used
When data needs to be stored with constant access time
Example of where hash tables are used
Caches and databases
Third way of dealing with a collision
Storing items together in a list under the hash value
Why should hash values be abbreviated
As if not searching for the hash could take longer than simply searching for the key
What does encryption protect data in
Motion
What does hashing protect data in
static
Why can paging be in efficient
Takes no account of how it splits a program so could separate the instructions inside a looping condition which would mean it would repeatedly have to access data from a different page in a different physical location this would make the program take longer to complete
Why can segmentation be more efficient
They are complete sections of programs
Similarities between paging and segmentation
Allow programs to run despite insufficient memory, transferred onto memory when needed
Where are pages and segments both stored
On a disk
Differences between paging and segmentation
Pages are fixed size, segments are different sizes, pages made to fit sections of memory, segments made to fit sections of programs
What connects to the server in a client server network
Terminals
What is the server in a client server network
Powerful, central computer
Server and processing power in client server network
Greater processing power than the terminal
Obscure advantages of client server networks
Data and resources can be shared between clients
Central back ups in a client server
No need for individual backups
Main disadvantage of client server network
Functionality of terminal depends on server, if this fails, performance fails
Dependence peer to peer network
Not dependant on central server
Difficulty of locating resources and tracing files peer to peer network
Impossible to trace origin of files and difficult to locate resources
What decodes the instruction
Control unit
Execute section
If necessary, data is fetched
Second stage of waterfall model
Feasibility – is it technically viable, economical, legal? How effective the project will be in solving the problem? Can it be done in time?
Third stage of waterfall model
White/black box, alpha/beta, performance etc
What is the final stage of the waterfal model?
installation, migration, support, and maintenance e.g. corrective, perfective, adaptive maintenance (to keep a software product usable in a changed or changing environment
What does the processor do when it needs to read or write a location in memory?
it first checks for a corresponding entry in the cache. If the processor finds that the memory location is in the cache, a cache hit has occurred and the processor immediately reads/writes to the cache. If not, a cache miss has occurred and the data is copied from main memory into cache and the request fulfilled from cache.
Why close files
When a file is “opened,” the operating system marks the file as locked, generally so it can’t be deleted by other processes while it’s being used. myFile.close() undoes the lock, allowing the operating system and other processes to do what it wishes with the file. It also releases any system resources associated with the stream.
Why is it easier to swap pages
Because they are fixed size
Concurrent v simultaneous
Concurrent is where each given a time slice
Programs and data
Yes