![]() |
![]() Fall Semester 2009 |
Fri Nov 20
Thu Nov 19
Tue Nov 17
Fri Nov 13
Thu Nov 12Check Nov 29 in this document.
Tue Nov 03
<script>
function Robot() {
this.giveCards = function giveCards() {
cardOne = this.deck.pop();
cardTwo = this.deck.pop();
this.handOne.push(cardOne);
this.handTwo.push(cardTwo);
document.getElementById("oneHand").innerHTML = this.handOne;
document.getElementById("twoHand").innerHTML = this.handTwo;
}
this.initialize = function initialize() {
this.deck = [];
this.handOne = [];
this.handTwo = [];
for (i = 0; i < 4; i++)
for (j = 0; j < 13; j++)
this.deck.push(j);
for (var i = 0; i < 100; i++) {
var index = Math.floor(Math.random() * this.deck.length);
var other = Math.floor(Math.random() * this.deck.length);
var temp = this.deck[index];
this.deck[index] = this.deck[other];
this.deck[other] = temp;
}
alert(this.deck);
}
}
</script>
<form>
<table>
<tr> <td> Player One <td> <span id="oneHand"></span>
<tr> <td> Player Two <td> <span id="twoHand"></span>
</table>
<input type=button value=Hit onClick=coraline.giveCards()>
</form>
<script>
coraline = new Robot();
coraline.initialize();
coraline.giveCards();
</script>
Mon Nov 02Date: Mon, 2 Nov 2009 09:57:29 -0500 (EST) From: Adrian GermanTo: Karthik Narayan Muthuraman Jacob Levi Marsh Daniel Arthur Wick Jennifer Jean Hughes China Rose Williams Ying Wang Nicholas Tyler Sorosky Tyler Scott Peterson Anthony Chad Brown Raymond James Keller Kaitlin Louise Herkamp Na Li Park Aaron Henry Deutsch Jimmy Floyd Denton Beibit Zhumabekov Subject: semester project and this week's plan Hello and I hope everybody is doing well! I am currently working on updating everybody's grades in the online blogs. I have given individual feedback in person in lab. Office hours for this coming week are listed here: http://silo.cs.indiana.edu:8346/cgi-bin/fall2009/schedule This week we wrap up Javscript/DHTML and install Tomcat in labs. We then proceed to study the basics of OOP in Java, Javascript, Python and PHP. In another week you will be able to finish Homework Seven which is the last homework assignment this semester. There is another thing we need to discuss: semester projects. A semester project is a (mostly) independent-study-kind-of activity in which one is attempting to use the knowledge accumulating thus far to either (a) write a bigger application than our homework assignments, or (b) learn one of the web frameworks of the moment. Here's and example (by Karthik M.) from the second category: Title of project: CakePHP, the rapid development PHP framework. Basic outline: in this project I will study this framework. Milestones: 0. Choosing to study CakePHP 1. Implementation of a web Blog (following the on-line tutorial) 2. Implementation of a simple ACL controlled application (same) 3. Implementation of the Flag Quiz or a similar problem in CakePHP. 4. Wrap-up: summary of what I have learned (pocket reference format). Tomorrow in class we will briefly discuss step 1 of the list above, to just give an example of why it's easy and how you actually can and should learn a lot from it, as a matter of fact. Please be ready to tell me what you want to do for a semester project when I send you individual e-mail messages today. Feel free to ask for advice - but you also need to let me know what you might find interesting to work on. I will try to send a list to choose from. Sincerely, Adrian German --
Thu Oct 29
Tue Oct 27Take a look at this example.
We will discuss Python, Javascript and Java (the basics).
You can look through chapters 15 and 16 of the .pdf text.
Sat-Sun Oct 24-25We start from this collection of files: an engine inside a car driven by a person.
-bash-3.2$ ls -l total 40 -rw-r--r-- 1 dgerman faculty 720 Oct 22 11:41 template.py -rw-r--r-- 1 dgerman faculty 2469 Oct 22 11:46 client.py -rwx------ 1 dgerman faculty 152 Oct 22 13:16 one -bash-3.2$
one is the car, with wheels, that can be driven on land.
Call one and it will drive on land. It will work.
Now here is the "boat":
-bash-3.2$ ls -l total 40 -rw-r--r-- 1 dgerman faculty 720 Oct 22 11:41 template.py -rw-r--r-- 1 dgerman faculty 2469 Oct 22 11:46 client.py -rwx------ 1 dgerman faculty 152 Oct 22 13:16 one -rw-r--r-- 1 dgerman faculty 1795 Oct 22 13:35 server.py -rwx------ 1 dgerman faculty 75 Oct 22 13:17 two -bash-3.2$
two is the boat. If
one is the driver
client.One car
template.Engine engine,
two is the driver that drives the server extension of the client car.
server is only adding the propellers to the car.
In server the wheels are not used. (We expected that, we knew that).
But
Thu-Fri Oct 22-23
Now copy server.py into the same folder (see below).
Also copy two and make it executable.
two works with the database and provides the server side version of one.
Just make sure that there are non references to my username, port, server in the file. Mine can be accessed from here:
You should see the content of the table as the program is accessed by various people:http://silo.cs.indiana.edu:8346/cgi-bin/1022/two
Notice thatmysql> select * from hwFive; +------------+---------------------------------+------+------+------+------+---------------------+ | session_id | message | n1 | n2 | m1 | m2 | modified | +------------+---------------------------------+------+------+------+------+---------------------+ | 58974425 | Very good.Score now: 2 out of 4 | 26 | 23 | 2 | 4 | 2009-10-22 13:36:24 | | 11848907 | Welcome | 17 | -18 | 0 | 0 | 2009-10-22 13:36:42 | | 24997385 | Very good.Score now: 1 out of 1 | -37 | 48 | 1 | 1 | 2009-10-22 13:37:40 | +------------+---------------------------------+------+------+------+------+---------------------+ 3 rows in set (0.00 sec) mysql>
one still works, as below, and the two share code but keep state in different places.
Thu Oct 22
~/apache/cgi-bin/1022
template.py
client.py into the same folder.
one make it executable and access it from the web.
http://silo.cs.indiana.edu:xxxx/cgi-bin/yyyy/one
Now let's go to MySQL:
Locate the file that allows you to log in as regular user:cd /nobackup/dgerman/mysql-5.0.22/
Get in with the right password:-bash-3.2$ ls -ld connect_as_lbird -rwx------ 1 dgerman faculty 105 Oct 13 12:26 connect_as_lbird -bash-3.2$ cat connect_as_lbird mysql --socket=/nobackup/dgerman/mysql/mysql.sock \ --port=8974 --host=silo.cs.indiana.edu -u lbird -p -bash-3.2$
At the mysql command prompt select your database:-bash-3.2$ ./connect_as_lbird Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.22-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
Then create the table:use awards;
Then exit.create table hwFive ( session_id char(8) primary key, message varchar(240), n1 int, n2 int, m1 int, m2 int, modified timestamp );
Wed Oct 21
Tue Oct 20Notes wrote in class today: here.
------------------------------------------------------------------------ Date: Mon, 19 Oct 2009 10:41:06 -0400 (EDT) From: Adrian German To: ... Subject: office hours this week and exam info There is an exam on Thu, it is take home. Think of a problem, let me know what it is, and once I approve it -- solve it. Use any technology you like: PHP with/without sessions or CGI/Perl or CGI/Python. Then on Thu come and write the solution up with no help, closed-book. Then on Thu and Fri in lab you will have a chance to grade your test and fix it if need be. More details about that part then. Office hours this week: http://silo.cs.indiana.edu:8346/cgi-bin/fall2009/schedule Material describing basic problems you could claim on an exam: http://www.cs.indiana.edu/classes/a348/fall2009/exam.pdf Don't expect me to agree to a simple problem, but the material starts from a very simple problem and builds on it. Sincerely, Adrian German --
Fri Oct 16Nice bug example provided by Karthik in lab on Thu:
Thu Oct 15http://www.cs.indiana.edu/classes/a348/fall2008/whatsnew/hwFive.txt
Simple PHP notes from a while ago, PHP tutorial at w3schools.com.
Basic steps to get started with MySQL.
Fri Oct 09The code we wrote in class today.
Thu Oct 08Notes to be used in lab this week: or here.
Notes distributed in class today.
Tue Oct 06
Sat-Sun Oct 3-4
Fri Oct 02
Thu Oct 01
Fri Sep 25Here's an example of how to start implementing a variation of war: notes.
For Hangman /usr/share/dict/words is useful.
(How many 5 letter words with 2 vowels are there?)
Thu Sep 24
Notes from today's class can be found here.
Code for one of the programs discussed in class Tue is here.
Wed Sep 23
Thu Sep 17The program we developed in class today: here.
The source code for the card game that is the model for Homework Two: here (read carefully).
Sat-Sun Sep 12-13
Fri Sep 11
Thu Sep 10Lab notes from today's lab.
Notes from today's class, in real time.
Wed Sep 09Website for this semester instantiated.
Last semester's website will remain available to you.
Mon-Tue Sep 7-8
Thu Sep 03