Tuesday, December 13, 2011

Quiz review

1) All these are part of the von Neumann architecture except for:
a) control unit
b) arithmetic / logarithmic unit
c) input
d) memory

2) The Turing test is ______________________.
a test of computer intelligence.
Can the computer fool the interrogator into thinking it is a human?

3) In fonts, a point is precisely: _____________.
1/72 of an inch

4) Sequential access memory can best be compared to _________.
Sequential:
VHS tape, cassette tape, scroll

RAM:
kind of like a DVD
book

5) One can convert C++ to machine language using:
a) a compiler
b) an editor
c) ASCII
d) Unicode

6) A kilobyte is = 
a) 1020 bytes
b) 2^10 bytes
c) 2^20 bytes
d) 10^9 bytes

7) The binary number 101 is equal to _____ in decimal:
a) 101
b) 3
c) 5
d) 7

8) Vector graphics will typically be ___________ than the equivalent bitmap graphics:
a) bigger
b) smaller
1) The process of converting text, sound, etc., into data that can be processed by digital devices is called:
a) compiling
b) interpreting
c) digitization
d) numberization

2) What is a mainframe computer?
A computer which many people log on to and use simultaneously.

3) Which is NOT a way can hackers get someone's password?
a) dictionary attack
b) phishing
c) sniffing
d) dishing

4) A computer uses ____ASCII____ codes to represent numbers in your SSN and Street Address, but it uses ___binary______ numbers for numeric data such as your age.


5) An example of an HTML attribute is:
a) br
b) src
c) omg
d) http

6) An example of a closing tag is:
a) <br>
b) </em>
c) {close}
d) <php>

7) If I wanted to solve the traveling salesman problem for 200 cities, on a 2.4 GHz PC, with 20 GB of RAM and a 1 TB hard drive, it would take me:
a) about 1 minute
b) about 1 day
c) about 10 years
d) more than a trillion years

8) Why is that a good thing? We can rely on encryption.

9) One trilobite is: ____________________  an extinct marine arthropod
Consider the following URL:


1) What is the protocol?
http
2) What is the top level domain?
edu
3) What it the domain?
qc.edu
4) What is the path?
~svitak/cs12/
or
~svitak/cs12/syllabi.html

5) Give me an example of an IP address:
192.168.1.1

6) The Internet is the same as the World Wide Web
a) True
b) False

7) What is hotlinking?
using someone else's image and bandwidth by putting the URL of the image on their server directly into the src attribute

8) What is beta software?
software that is not really "ready" yet. may be buggy. they are hoping you will test it and find the errors. Often is free.
1) A type of application softawre that is called _____ is designed to help several people collaborate on a single project using local networds or Internet connections.
a) system software
b) productivity software
c) utility software
d) groupware

2) ______ software stores data as a series of records and allows you to establish relationships between different types of records.
a) spreadsheet
b) database
c) groupware
d) recording

3) A _____ license is priced per copy and allows a specific number of copies to be used at the same time.
a) concurrent-use
b) sequential-use
c) single-use
d) site

4) A software _____ is a small section of program code that replaces part of the software you currently have installed.
patch

5) The term _______ refers to software tools used to conceal malware and backdoors that have been installed on a victim's computer.
a) trojan
b) phish
c) rootkit
d) malware

6) An example of an HTML tag that only makes sense within another HTML tag is:
<li>
<tr>
<td>

7) GUI stands for:
graphical user interface

8) An example of a CSS selector is:
a) align
b) #fred
c) ;
d) light-blue

9) What, precisely, does the Evaluate Formula do?
Opens up a window, lets you see step by step how your formula is evaluated. Used for debugging in Excel.

10) If I am sitting in cell B5 and refer to cell A1 as an relative reference, what will the R1C1 reference look like?
R[-4]C[-1]

11) What does the ROUND function have to do with the plot from Superman III or Office Space?
fractions of a penny

1) A ____ program stored in ROM tells the hard disk to load the operating system into RAM.
bootstrap

2) A ____ compatible OS should be able to run application software designed for the OS's prior generations.
backwards

3) File ______ software overwrites deleted files with random 1s and 0s.
shredder

4) Name one way in which Solver is more powerful than Goal Seek.
impose constraints; look for a max or min instead of a specific value; can fiddle with multiple cells

5) Draw me a small decision tree to distinguish between rocks, cats, and mice.
Done.
1) Comnmunications _________, such as TCP/IP, set standards for encoding and decoding data, guiding data to its destination, and mitigating the effects of noise.

a) interfaces
b) buzzwords
c) protocols
d) SSIDs


2) A network ______ is a device that links two or more nodes of a wired device and broadcasts it to all the network nodes.

a) hub
b) router
c) modem
d) packet


3) For security reasons, it is not advisable to allow shared access to the _____ directory of your C: drive.
a) driver
b) root
c) branch
d) folder


4) _____ is public key encryption software that is popular with PC owners who want to encrypt email and data files.

a) PGP
b) Bluetooth
c) The system registry
d) A keylogger

5) What, relating to SQL, do you get when Santa is bitten by a werewolf?
Where Clause

6) In SQL, the sort of statement which will display some records from a table is called:
a) DISPLAY
b) SHOW
c) SELECT
d) SUBTABLE

7) A record in a database is closest to a _______ in Excel.
a) column
b) row
c) cell
d) worksheet

8) Explain one way in which Solver is more powerful than Goal seek.
 Done.
________________
Some more questions:
1) The sorting algorithm in which you repeatedly find the smallest item and place it in the appropriate slot is called:
a) insertion sort
b) bubble sort
c) selection sort
d) merge sort
2) In Visual Basic, you continuously wait for an event to occur and respond to it. This is called an ___________. event driven programming language.

3) Descartes walks into a bar. The bartender says, "Are you having a beer?" Descartes says, "I think not," and ceases to exist. Why?

4) What does Descartes have to do with SQL?
Cartesian product

5) A Serial Number in Access and Excel is a way to handle:
a) dates
b) times
c) both
d) neither

6) A primary key is a field, or set of fields, which uniquely identify a record.
a) true
b) false

7) How would you look for a single word which begins with the letter J, ends with the letter H, in advanced wildcard search in Word?
<J*H>
if not for pointy backets, it would match
Jump for joy, TRISH.

8) p {color:red;text-align:center;}
In the above CSS, what is the selector?



Thursday, December 8, 2011


Final
Lecture book:
Ch 1-6

Multiple choice (mostly)
Fill in the blank (less)
Short answer (even less)

30-50 questions

CS313 - data structures
you have a bunch of data. you want to store it in some way. you want to perform actions upon that data. what are the repercussions of how you store it.

collection of numbers

dense list, or an array

linked list
doubly-linked list
arrows also point to previous item

diff ways of storing same data
why do we care?

remove bob from telephone list
pretend that I have n records, where n is very large, such as 1 million.

Does my computer program "scale"

in an array based list, we would need to shift all elements one up, to take Bob's place (and then Sally's place, etc.)


array is simpler
but, deleting is VERY slow
O(n)

deleting from a doubly-linked list
is
O(1)
constant time


Algorithms:
selection sort:
http://en.wikipedia.org/wiki/Selection_sort
each time, find the smallest item, put it into the appropriate slot
linear search for the smallest item
swap the items
repeat
O(n^2)

insertion sort
http://en.wikipedia.org/wiki/Insertion_sort
repeatedly grow sorted section by taking the next element, shifting over elements greater than it, and INSERTING the new element into the correct slot
O(n^2)

Wednesday, December 7, 2011

Tuesday, December 6, 2011


What else is there?
http://www.cs.qc.cuny.edu/

080 Problem Solving with Computers
Is REALLY Visual Basic.NET Programming

1) Draw your GUI (Graphical User Interface)
2) Visual basic is Event-Driven
as opposed to procedural
3) Write the event handler

081 HTML and WWW Programming


Client-side, server-side programming language
PHP
This is my webpage:
<?php
for ($i=1; $i<=100; $i=$i+1)
{
   echo "Hello$i ";
}

?>

And <font color="red">that ends my webpage.</font>


Javascript
client-side scripting


085 Database Application Programming

088 Advanced Productivity Tools For Business
Advanced Excel
all chapters of the book
developing an intuition for writing formulas

111 Algorithmic Problem Solving
introduction to programming (for majors) using C++

Friday, December 2, 2011

INSERT INTO BOOKS
(ISBN, Title, Author, Publisher)
VALUES
("111", "C++ Recipes", "Josh Waxman", "Waxman Books")

UPDATE BOOKS
Set
ISBN="444"
Where Author="Josh Waxman"

UPDATE BOOKS
Set
ISBN=ISBN & " 2nd Edition"
Where Author="Josh Waxman"

Delete * From Books
Where Author="Josh Waxman"

CREATE TABLE

Quiz on tuesday, dec 6
next chap in book
material up to Nov 17th

read ch 8 book.

Final on 22nd, 6:30-8:30, here, in C205

SUMMARY QUERIES

Group by Clause


SELECT Publisher, AVG(ListPrice) As AveragePrice From BOOKS
GROUP BY Publisher

Select [Last Name], [First Name], Salary+Bonus As TotalSalary
from Employee

Calculate field

Split form

Form/SubForm
you need a defined relationship


There are two types of Macros.
Macros are USUALLY VBA

Access does have VBA
But they also have "Macros"

a few interesting Algorithms
Bubble sort

n elements i want to sort
each time, i do about n comparisons
i need to repeat it about n times
n squared
O(n^2)


Sorting machines

Tuesday, November 29, 2011


Query 2:
Select Title, PublDate, LastName, PubName
From Book, Author, Publisher
Where PublDate > #11/29/2011# And
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY PublDate DESC

Select Title, PublDate, LastName, PubName
From Book, Author, Publisher
Where PublDate > DATE() And
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY PublDate DESC

Query 3:
Select Title, PublDate, Copyright, LastName, PubName
From Book, Author, Publisher
Where
(Copyright = 2010 OR Date()-PublDate Between 0 And 60 ) And
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY PublDate DESC

Query 4:
Select Title, LastName, PubName
From Book, Author, Publisher
Where PubName ="Wiley" And
Title Like "*Excel 2007*"
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY Title ASC

Query 5:
Is Null
ISNULL(fieldname)

Select Title, Edition, LastName, PubName
From Book, Author, Publisher
Where ISNULL(Edition)=True And
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY Title ASC

within access, -1 means True
0 means false

Select Title, Edition, LastName, PubName
From Book, Author, Publisher
Where Edition Is Null And
Book.AuthorCode = AuthorId And
Publisher.PubId = Book.PubId
ORDER BY Title ASC

w3schools.com

Serial numbers in access and excel
is the offset of days since January 0, 1900
dates
times are fractions of days

Parameters in Queries
We have finished (more or less) SELECT queries

UPDATE, DELETE, DROP TABLE, CREATE TABLE
INSERT

Tuesday, November 22, 2011


Read ch 7 in book. quickchecks.

last time: relational database. basic SQL.
w3schools.com

SELECT Customers.CusID, First, Last, Street, Apt, City, OrderId, Descrip, Price, Qnty, [Total Price], Orders.CusID From Customers, Orders

Select * From Customers, Orders

Cartesian product of the rows of both tables

Select * From Customers, Orders
WHERE Customers.CusID = Orders.CusID

That is called an INNER JOIN. (There is also a right and a left join.)

import vs export

Layout view is WYSIWYG

Select Title, LastName, PubName
from Book, Author, Publisher
WHERE Book.AuthorCode = Author.AuthorID And
Book.PubID = Publisher.PubID And
Book.PubID = "Prentice-Hall"
ORDER BY Title

Oops!

SELECT Book.Title, Author.LastName, Publisher.PubName
FROM Publisher INNER JOIN (Author INNER JOIN Book ON Author.[AuthorID] = Book.[AuthorCode]) ON Publisher.[PubID] = Book.[PubID]
WHERE (((Publisher.PubName)="Prentice-Hall"))
ORDER BY Book.Title;

This was auto-generated by Access query designer.