Study Guides (248,610)
Canada (121,635)
Laura Reid (46)

Comp Sci Final Exam Notes.docx

33 Pages

Computer Science
Course Code
Computer Science 1033A/B
Laura Reid

This preview shows pages 1,2,3,4. Sign up to view the full 33 pages of the document.
Comp Sci Final Exam Notes Red is anything she explicitly said on the exam Blue is anything she stressed that could be on the exam Week 2 Multimedia  Multimedia application – an application that can be used to present text, sound, video, images and animation  Multimedia uses: o To inform o To educate o To sell and run businesses o To entertain  Multimedia components are used in combination with: o Interactivity: user has control over the application, active experience o Hyperlinking: index allows for jumping around sections  Computer Based Multimedia Applications o Integrate various media components and allow interactivity and hyperlinking o Modes of delivery:  World wide web  CD/DVD discs  Information kiosks  Game boxes  Handheld devices, IPods  Required equipment for a multimedia developer: o Microphone o Speakers/headphones o Camera o Video camera o Fast processor o Lots of storage capacity o DVD burner/player o Sound card o Video card  Ways that we can communicate or spread a message to other people: o Other people o Telephone o Radio o TV o Newspaper/magazines o World wide web  Cheap  Fast  Usually current  Accessible by millions History  Asia has the biggest population and the most internet users  Australia has the smallest population and least amount of users  The internet is a massive network of networks connecting computers  The world wide web is a way of accessing information over the medium of the internet  The earliest drawings/painting by humans were discovered in france  The first permanent photograph was taken between 1810-1840  The first motion picture was recorded between 1880-1890  The first full length movie with synchronized dialogue was the Jazz Singer  The Wizard of Oz showed the power of full colour by having parts in black and white and part in colour  ARPANET was the predecessor to the internet  1983 – Internet was created when TCP/IP is adopted by all ARPANET users  1991 - Tim Berners-Lee invented the world wide web  Mosaic was the first graphical browser for the Web  The Rolling Stones was the first band to give a concert over the internet  Toy story was the first full length feature film that was completely computer generated  Napster was the application that revolutionized/irritated the music industry in 1999  Digit cameras became fairly accessible and affordable to the public in 1996 Design  Good design is about CRAP o C = contrast o R = repetition o A = alignment o P = proximity  A monitor is a rectangular area broken down into very small pieces or dots  The dots on a monitor are called pixels  Resolution = the number of pixels across by the number of pixels down o 800 x 600 pixels vs 1024 x 768 pixels  800 x 600 would have bigger pixels  A pixel is displayed using light on a monitor to create images or text  When printing, the pixels are called dots o Dots can be different colours, can create big image or small o 72 dpi vs 300 dpi  72 dpi will have bigger dots o the problem with bigger dots/pixels is that the quality isn’t very good  What can you do if you want an unusual font on your website?  Font Type (Typeface) = characters that have a common design are grouped into families called font types o Eg. Arial, Arial Black  There are two categories of fonts: Serif or Sans Serif o Serif: has a fine line added to finish a letter stroke  Easier to read  Eg. Times New Roman o Sans Serif: no line added  Best for headlines and headings  Eg. Comic, Arial  In general its easier to read mixed cases than all upper case  Kerning: adjusting the distance between pairs of letters o In standard spacing distance between uppercase A and W seems farther than H and N, kerning fixes this  Tracking: adjusting the distance between all the letters o Measured in ems  Leading: (pronounced ledding) amount of vertical space between lines of text o As the length of a line increases, it is harder for the reader to jump to the next line, so wide columns require larger leading o Tracking and leading are related  Font size in dreamweaver can be measured in several units: o Points, picas (as in MS word)  Print unit  Text that is 72 points is 1 inch tall  Commonly text is 12 points which is 1/6 of an inch o Pixels, Percentage, ems  Relative to default font size for the browser and to the screen resolution  1 em is equal to the width of an m in the default font type and size of the browser o Inches, centimeters  Which units to use: o In general, don’t use points, it is for printing o If you are worried about accessibility  use ems or % because they are relative to the browser o If you are worried about control  use pixels  Colour o Hexadecimal representation:  Digits are: (1 2 3 4 5 6 7 8 9 a b c d e f)  Must start with a # and have 6 digits  Need 2 digits for Red, 2 digits for Green and 2 for Blue  RRGGBB  So red is really #FF0000  Biggest number is FF  Yellow = # FFFF00  Dark Gray = #222222  Light Gray = #CCCCCC  C is bigger than 2, so you’re getting closer to more color, therefore closer to white  Never use underlining on a webpage because it can be taken as a link Week 3  Computers only understand Binary  Binary  (2 Binary digits or BITS) 0,1,10,11,100,101,111,1000 [0 and 1]  Octal  (8 digits) 0,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,20 [0 to 7]  Decimal  (10 digits) 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 [0 to 9]  Hexadecimal  (16 digits) 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,13,14,15,16,17,18,19,1A – F20, FA – FF  Binary Bits o With 1 bit  0 and 1 = can represent 2 items (back and white/ true or false) o With 2 bits  00, 01, 10, 11 = can represent four items o Etc. o 8 bits = Byte  Binary vs Decimal representation: # Binary Decimal 1 0 or 00000000 0 2 10 00000001 2 3 11 00000010 3 4 100 or 00000100 4  The ASCII code represents 1 byte for each letter  Converting analog to digital o 2 step process:  1. Sampling: how many chunks to represent the thing (more pieces broken down, better quality = bigger file size)  2. Quantizing: how many discrete values will I use to represent the parts  Dots per inch (dpi) = when scanning or getting an image from our camera, it determines how many samples to take (how to break down the image) o The more samples that are taken, the higher the resolution will be o Samples on scanners/printers are measured as dots per inch o Samples on monitors are measured as pixels per inch (PPI) o Example: If we scan an 8 inch x 10 inch image at 100 dpi, the image will be (8x100) x (10x100) = 800,000 samples  It would have 800,000 pixels  Pixel: Picture elements called pixels that represent an image o The smallest image component and show the smallest detail o Arranged in columns and rows o Each pixel is given a numerical value that represents the corresponding colour o Megapixels = how many millions of pixels you can capture in a photograph on your digital camera  A camera with more megapixels can print a larger image without detecting loss of quality o When printing an image, the image must be printed at a size that has a min of 300 pixels per inch o Example: if you have an image that is 3000 pixels x 1500 pixels, for print quality to be good, what size should it be printed at?  3000/300 = 10 inches by 1500/300 = 5 inches, shouldn’t be printed any larger than this  QUESTION: How many pixels is an image that is 800 pixels by 800 pixels? o 640,000  QUESTION : How many megapixels is that image? o About 1/2  QUESTION : How big would this picture be if you printed it out at 200 dpi? o 4 inches  QUESTION : How big would this picture be if you printed it out at 100 dpi? o 8 inches by 8 inches  QUESTION : How many colours can you represent with 4 bit colour? o 16  The amount of space the image takes up on the screen is dependent on: o Size of the image o Current resolution of the screen o NOT DPI o Example: an image that is 400 pixels by 300 pixels, will take up ¼ of the screen on a monitor with resolution 800 by 600  Average pixels per inch for monitors depends on o The size of the monitor in inches o Current resolution o But average is 72 ppi because we are guaranteed that we will see the image at 100% and it will be the same size as on a typical screen if we print it  Resizing an image  resampling o Make a picture smaller removes pixels, makes it crisper, gives it a smaller file size  File size for images is determined by the number of pixels o DPI/PPI does not make a difference  QUESTION: How many pixels will a 4 inch by 6 inch image be if we scan it in at 100 dpi? o 400 x 600 = 240,000  QUESTION: Assume we have 3 images, all 3 images are 100 pixels by 100 pixels but they were each scan in with different dpi. (One was 10dpi, one was 50 dpi, one was 100dpi) o Which of the following statements are true?  All 3 images will have the same file size  True  The image that was scanned in at 100dpi will print smaller than the one scanned in at 10dpi  True  Quantizing the image o Assume for each pixel we have 1 bit to represent the colour  1 bit allows for 2 colours  Colour images: o Subtractive model – CMYK  Used for printing  Ink applied to paper  Primary colours  cyan, magenta and yellow  Ink when applied removes the white  Need black ink though because putting the three together doesn’t truly get you black o Additive model – RGB  Use on monitors  Adding light to a black background (the monitor)  Primary colours  red, green and blue  True Colour o Can represent 2^24 colours  about 16 million different colours  256 shades of red, 256 shades of green and 256 shades of blue o 0 = none, 256 = max o need 3 bytes (1 byte = 8 bits) for true colour o 2 ways to encode true colours:  1. , amount of red, green and blue  <255,0,0> = the most red, no green no blue  2. Hexidecimal Code, #RRGGBB  00 = 0  FF = 255  0A = 10, 0B = 11 o Can represent the same number of colours using Hex as RGB o FF in hexadecimal = 255 in deciman o What is 255,0,0 = red o 0, 300, 0 = trick question, can’t go above 255 o 66,00,99 isn’t the same thing as #660099, but 255 = FF  Question: How many colours do you think the human eye can detect (are in the visible spectrum)? o 10 million  Indexed colour o Sometimes we don’t need 16 million colours, we use indexed colour o Doesn’t use all the colours o Our index might be 8 bits  2^8 different colours = Image bit depth Transferring files to the world wide web  Web server = a computer that delivers web pages  Client = computer that is requesting to see/visit the web page  Advantages of a web server: o Connected – computer is on all the time and connected to the internet o Always available – since it never is turned off, your website is always available o Well maintained – the people running the servers will take care of security and computer maintenance issues  At UWO = Review  Question: How many things can you represent with a 5 bit depth (5 bits)?  32  Question: What is the smallest value that you should set the dpi for an image that you plan to print?  300 DPI  Question: When converting analog to digital what two things to you have to do to analog data?  A. Sample and quantify  Question: How big will the following image be when printed? 600 pixels by 900 pixels, printed at 300 dpi?  2 inches x 3 inches  Question: What bit depth do you need to represent a black and white image?  1 Week 4 Graphics  Bitmapped graphic images o Image consists of pixels in a grid o When they are enlarged, the computer added new pixels and guesses on the colour of new pixels based on surrounding pixels = interpolation o Bitmapped images enlarged become jagged o Easy to represent on a monitor because its 1:1 mapping o Also called raster graphics images o Resolution dependent o All images from scanners and digital cameras are bitmapped images o At low resolutions they seem bigger o Common bitmap file formats:  BMP, GIF, JPEG, PNG, PICT, PCX, TIFF, PSD o Popular bitmap editing software:  Microsoft paint, adobe photoshop, corel photo-paint, corel paint shop pro, the gimp  Vector Graphics o Image is made up of individual, scalable objects o Objects are defined by math equations o Objects consist of lines, curves and shapes o No distortion as image is enlarged o Doesn’t work well with photo’s, just drawings o Still has crisp lines as image is enlarged o Most browsers need a plug in to display o Usually have smaller file size than the same image stored as bitmap o Common file formats:  AI, CDR, CMX, CGM, DXF, WMF, EPS o Software:  Adobe illustrator, corelDRAW, Xara Xtreme, Serif DrawPlus o The term flatten image in photoshop is changing the vector layer into a bitmapped layer o You can convert a vector graphic image into a bitmapped image but you can not easily convert a bitmapped image into a vector graphic image  How big is an image in true colour (2^24 colours) o Assume that we have a picture that is 1600 pixels by 1200 pixels o Each pixel needs 3 bytes to represent the colour of each pixel o How many bytes, kilobytes and megabytes is the image?  1600 x 1200 x 3 = 5,760,000 bytes  5,760,000/1024 = 5625 kilobytes  Need to make webpages download as fast as possible o Need to make image files smaller  Reduce the number of pixels to make the image smaller o To keep the image the size we want  Compress the image file  An uncompressed image that is 200 by 200 pixels will be 200 x200 x 3 bytes = 120,000 bytes  120,000/1024 = 117.2 kilobytes  Compression o Key idea is to compress as much without sacrificing quality o 2 types of compression:  1. Lossless: compression of original bits and bytes into less bits and bytes without losing any of the original information about the picture  no info lost  2. Lossy: some original information is lost  selected portions of the images are discarded o Different algorithms for compression o Common compressed image file formats:  Gif, jpg, jpeg, png o Uncompressed files formats:  Bmp, raw o How does compression work?  Compression for image with large blocks of the same colour  Take 4 pixels store the average colour of them then store that information repeat – lossy  Break up the triangles by the colours – get 5 rectangles – lossless o Looks for patterns and builds a decoding hash table  Brightness vs Colour o The human eye is more sensitive to brightness detail than to fine color details o lossy compression leaves out information about brightness and colour  Finds two adjacent pixels with very similar colors, and sores both those pixels with the same color and discard the other color o Picking the most appropriate file format depends on what type of image we are representing  GIF (graphic interchange format) o Widely used on the web o Cross platform o Support 8 bit colour o Not great for photographs, but good for cliparts, logos, animation  Not good for photography because can only store 256 colours o Looks for large blocks of area that all have the same colour o Saving an image with 24 bit colour as a gif will lower the quality the first time you convert it o Produces smaller file sizes than jpgs o Lossless compression o Allows for transparency of one colour  Background will show through  The problem though, is if the background isn’t white – teeth aren’t white because that colour was chosen to be transparent o Allows for animation  Doesn’t need plug in  Works in all browsers, universal format o Allows for Dithering: juxtaposing pixels of two colors to create the illusion that a third colour is present  Makes a checkered box with different shades next to each other o Interlacing – how images are downloaded to your screen  Lets you have a feel for the whole picture without waiting around to see it  The image is drawn in a series of passes rather than all at the same time  JPG (JPEG) – Joint Photographic expert group o Widely used on the web o Cross platform o Supports 24 bit colours o Great photographs o Larger file sizes than GIFs o Best for blends of color, softer shadow effects, subtle changes in color o Not good for well defined lines or sharp contrast between colours o Does lossy compression (discards data about colours than about brightness) o Degrades the image quality o Image data is lost with each compression, save as a jpg only when finished with the final product o Quality of image is inversely proportional to amount of compression o No transparency o No animation o No interlacing o No dithering – because not limited by colours  PNG o Created specifically because of licensing issues with GIFs in the 90s o Lossless compression o Two versions  PNG – 8 and PNG-24 (number of bits) o PNG 8  Similar to GIF  Only allows for 256 colours  Allows for 1 transparent colour  Storing of colours is more efficient in PNG files than GIFs, so PNG files are smaller than GIF counterparts o PNG 24  Allows for 24 bit colour  Lossless – doesn’t do as good of a job compressing as JPG = JPG smaller  Allows for transparency of each pixel with different levels of opacity – doesn’t work in IE 6 GIF JPG PNG 8 PNG 24 Best for Logos, Photographs Logos, Photograph cartoons, cartoons, images that drawings drawings need transparency Compression Lossless Lossy Lossless Lossless Browsers All All All Not on IE6 Transparency One colour only No One colour only Varying levels Animation Yes No No No Dithering Yes No Yes No Interlacing Yes No Yes Yes Shape of image Must be rectangular  Question: How big will an image be in terms of bytes if it is uncompressed, true colour and 200 by 400 bytes? ◦ 200x 400 x 3 =  Question: What type of compression doesn’t lose any of the original information about the image? ◦ Lossless  Question: Which type(s) of file formats perform a lossless compression? ◦ PNG and JPG  Question JPGs will produce a smaller file size than PNG 24 for a photograph: TRUE OR FALSE Week 5  Computer network: a group of interconnected computers, could be connected with wires, wirelessly or satellites  Internet: global system of interconnected computer networks that use the standardized internet protocol suite (TCP/IP) to serve users worldwide o Network of networks o Hardware not software o Software that runs on the internet  How does the internet work? o Uses TCP/IP o A Standard protocol o The ideas behind this protocol were funded by advanced research projects agency of the US department of defence around 1969 = originally called ARPANET o Opposite of your home telephone where get a direct line that only you and the person you are talking to can use  If communication is broken another line is tried o Circuit switching: two nodes establish a direct communication channel  This is how phone lines work o Packet: small group of bytes consisting of a header and the body o Protocol: rules for the format of transmission of data o TCP is the part of the software that manages the message  Sending:  Takes a large chuck of data and breaks it into small packets  Sends the packets out on to the internet  Receiving:  Detects lost packets, packets with errors because of network congestion, traffic load balancing or other unpredictable behavior and requests the packet to be resent  Rearranges and reassembles the packets back into the webpage, email message etc. o IP  Like GPS  Picks a route for a packet stopping at routers when pick the next bet machine/network to send the package to  If a communication line is down or broken, sends the package back to TCP and TCP send it again or tries a different route  Need to be able to identify all the machines on the internet so each machine has it’s own unique address  Uses IP addresses o IP address  Just like your home address  Each machine has its own address  Consists of 4 sets of numbers with dots between them  Each number ranges from 0 to 255  Not geographical  Always 32 bits  o How to send the message, for example a webpage  TCP breaks webpage into packets of bytes  TCP figures out IP address of where it wants to send the packets  TCP figures out IP address of where the packet is coming from  Sends of each packet to first machine on the route  Packet stops at first machine, likely a router, then the router sends it to the next machine and so on until it gets to the final IP Address   Packet Switching  Domain Names o Don’t use IP address in your web browser because domain names are for easy memory o In 1973 IP address became the standardized way to identify machines on the internet o 1984 – University of Wisconsin came up with a name serve that maps a name to an IP address o 1985 – Domain Name System is established and the initial top level domain names  Top level domain names: .com, . net, . org o 1990 - the internet moves beyond government and universities to commercial society o Up until 1995 you didn’t have to pay for domain names o 1995-1998 you paid the Natural Science Foundation 100$ US dollars for a 2 year registration for a domain name o 1998 – assignment of domain name is opened up to private companies to encourage competition o How do Domain names work?  Every machine on the internet gets an IP address  DNS – domain name system, maps the domain name to the correct IP address  Like a big phone book of domain names and IP addresses  in most cases there is a one to one mapping between IP addresses and a domain name  sometimes one IP address might map to more than one domain name or vice versa o Domain names identify machines on the internet o Web server contains all the web pages for a company or individual o Web pages are stored on the web server machine in folders or directories o Web pages are just files  URL o Established by Tim Berners Lee in 1990 o Points to a web page on the internet o http://  hypertext transfer protocol, rules on data exchanged between servers and browsers o www  world wide web (doesn’t count as domain name) o  domain name (case insensitive) o /its  folder o spring.html  file  o www  world wide web, NOT part of domain name o csd  third level domain, also a sub domain  sub domain of o uwo  second level domain o .ca  top level domain (TLD)  Sub Domains o Used to organize your web server o Eg.  Rules for Domain names o Each item between a dot is called a level o You can have a max of 127 levels o Each level can be up to 63 characters long and must be at least 3 characters long, except for TLD o The entire domain name (including sub domains) can not be longer than 255 characters o  4 levels  2 sub domains o must use one of the approved TLDs o each level must consist of letters, digits and hyphens o each level cannot start with a hyphen or end with a hyphen o each level must not contain a space o domain names are case insensitive  4 reasons not to host your own website o Expensive: servers and server software can be expensive o Continual connection: server needs a 24/7 high speed connection to the internet which is costly o Technical: setting up configurations is complicated o Support: server maintenance requires 24 hour support, special skills and knowledge  ISP = internet service provider o Maintains one or more machines that are permanently connected to the internet o Offers connections via telephone lines, cable, satellite dishes o Provide users with:  User account for accessing the internet  Email access  Web space to host/hold your website o Some ISPs are  Rogers  Bell  Execulink  Western (while you’re a student) o What to look for in an ISP  Disk space: always get more  Bandwidth: amount of traffic allowed to occur between your website and the rest of the internet at a given time  Web site speed  Database/programming language support  Technical support  Uptime (99% plus guarantee)  FTP access: unlimited for easy maintenance  Web statistics summary: traffic on your website  Scripts availability (counters, form support)  Web provider  Question: Give 3 valid TLDs o .com, .ca, .net  Question: is a valid domain name. TRUE or FALSE o No, only is valid (www not part of domain name)  Question: Zack& is a valid domain name. TRUE or FALSE o No, can’t have & in it  Question: What is a message (a webpage or an email message or a file) on the Internet broken down into before it is sent over the net? o Packet  Question: Are the following valid IP addresses? o  yes, has four dots o  no o 129.129.129  no Week 6 Planning and Design  Define the business requirements  Look at competitors websites  Good website design tips o Have something valuable to offer o Don’t distract with blinking, animated GIFs, autoloading sound, too much scrolling o No popups o Don’t use images on the background o Put a lot of through into organization o Minimize clicking – no more than 3 clicks to get to a page o Have a way to get to the homepage on every page o Include a menu on every page o Compress images o Don’t let multimedia files bog down website o No line of text should be more than 600 pixels wide o Don’t make your page too wide (around 800 pixels), users should never have to horizontally scroll, minimal vertical scrolling o Use contrasting colors or simple backgrounds o Make text big enough to read o Use all capital letter sparingly o Never use more than one exclamation point o Spell check o Never underline words that are not links o Put contact info or a link to it on every page o Test links – remove dead ones o Include last modified date  Each web page is normally an html file o Very basic page, just has clickable links, images, sometimes forms o .html file is a file with html codes displayed in a browser to look good  Other extensions for web pages: .shtml  extra stuff from the server, .php, .aso, .cgi  Web page and Web sites o A web site is a collection of related web pages stored in a folder o Web site folder should contain a sub folder called images that holds the image files that will be displayed on the page o The home page for the website should have the file name index.html  Folder structure for a simple site o Create a top level folder o Use lowercase letters o Index.html is invalid o Give the other pages appropriate lowercase names with .html extension o Create subfolder called images wit all images in it  AND o Both take you to the same page  For more complicated websites, each sub website is a subfolder that contains its own index.html and images subfolder o  The index page that would should up= brescia  programs  .index.html o Each sub folder has its own index page and images subfolder  Web server o The computer that runs software which holds the web pages and delivers web pages to the client o The computer must be connected to the internet o WinSCP or filezilla - The software we used to move webpages we built onto the web server o – the web server machine at western  Web browser o Software/program that displays formatted web pages to the client  HTML o In the late 1980s Tim Berners Lee proposed a way of sharing research papers using the internet and hypertext o In the 1990 Berners Lee set the specifications for the HTML language and wrote a browser to read HTML files and output o He proposed html tags  , , ,  tags always start with < and end with >  Most tags come in twos: opening and closing tags o Originally we made html files with simple text editors like notepad o Section tags  , , o Formatting tags  , , , o Link tags  o placeholder tags (standalone or unpaired tags)   Search engines look at page title – why it’s important  Graphics o Use common universal formats such as jpg, gif and png files that will work in any browser o Resize and compress the image as much as possible in photoshop before putting it in with dreamweaver  Any resizing you do within dreamweaver will not affect the download speed o Always set the alternative tag and title tag  Shows when page is loading, when mouse hovers over, meets barrier free access requirements o Consider dial up users: The site must not take more than 25-30 seconds for a 56K modem user  Edit>preferences>status bar – set connection speed to 56K  Look at the bottom status bar of the document to see download speed o Named anchors can link to any spot within the current page OR you can link to the middle of another page  Links: o Type 1: links to other pages within your website o Type 2: link to a different website o Type 3: link to an email address o Type 4: link on an image  Link parts of an image o Type 5: link to a particular spot on a page (bookmark/anchor) Week 7 – Web Site Design and S
More Less
Unlock Document

Only pages 1,2,3,4 are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.