Saturday, November 24, 2007

Project 2

Remember that project 2 is just a live chat wall. Think Facebook wall that updates interactively. In case you didn't want to write the backend yourself, here is a simple django project that covers it. The URLs are /wall/post/ to POST a new message and /wall/posts/ to see messages. The latter supports the GET param last_id to specify that you want all posts after a given message.


Also, think of something cool to make for the final assignment. It's totally open-ended, from a database driven website, to a nifty UI control, to some addition to Prototype (this one is cool because it shows up when you google your name). If you're short on ideas email me and I can help you out.

Tuesday, November 6, 2007

meebo, inc. guest lecture!

Elaine Wherry and Sandy Jen, founders of meebo, will be lecturing tomorrow about big cool JavaScript applications. Come to CS91SI at 2:15 in 420-040, and forward this to any friends that might be interested.

Wednesday, October 31, 2007

Making the server return an unordered list for Autocompleter

I didn't realize that it was much easier to work with the Ajax.Autocompleter if the server returned a <ul> element rather than JSON. To make dealing with this much easier, I encourage you to edit autocomplete/views.py and replace the complete function with this:


def complete(request):
    word = request['word']
    completions = word_list.get_words_with_prefix(word)
    res = '<ul>'
    for completion in completions:
        res += '<li>' + completion + '</li>'
    res += '</ul>'
    return HttpResponse(res)
;

Wednesday, October 17, 2007

Finally, an assignment! A simple autocompleter.

For this assignment you shall use some library (i.e. scriptaculous) to implement a Google Suggest-alike. I've written the backend in django for you, so you don't have to poke at it unless you would like to. To get the django development environment going, follow these steps.

1. Download a local copy of django to your AFS space on a vine.
vine3:~> svn co http://code.djangoproject.com/svn/django/trunk/ django

2. Set your $PYTHONPATH:
vine3:~> setenv PYTHONPATH ~/django/

3. Set your $PYTHONPATH in the .login file
vine3:~> echo "setenv PYTHONPATH ~/django/" >> ~/.login

4. Copy the django project into your local directory.
vine3:~> cp -r /usr/class/cs91si/projects/web91 .

5. Run the django test server
vine3:~> cd web91
vine3:~> python manage.py runserver 0.0.0.0:7777

Where 7777 is a port to listen on.

6. Try out http://vine3.stanford.edu:7777/complete/?word=fluf , replacing the appropriate server and port. See if the JSON returned looks reasonable. The first request will take some time as it loads the lexicon.

7. Load up autocomplete/static/complete.html and edit it. It can be loaded at
http://vine3.stanford.edu:7777/complete.html, replacing the appropriate server and port.

Using scriptaculous, or the library of your choice, build an autocompleting text box on the complete.html page that queries the backend for words to complete with.

Wednesday, October 10, 2007

Class #3: Pretty!

Today's class will be all about making things that are pretty. No handouts, just a set of links to projects we'll talk about.

Lightboxes
Prototoype Windows
scriptaculous
Dojo

Thursday, October 4, 2007

Spellchecker example, handout 3

Here's the spellchecker app I wrote up. To actually run it you will need Python and Django installed. It's easy to install on a Mac, and I think it's not too difficult in Windows either. If you just want to look at the JS it is there as well. Enjoy.

Spellchecker
Intro to Prototype Classes/JavaScript OO/Ajax

Tuesday, October 2, 2007

New Room!

Hey everyone, Uncle Stanford is helping us out this week and has blessed CS91SI with a bigger room. We will be meeting in 420-040, Wednesdays at 2:15 from now on. Tell your friends so they know where to go. See you tomorrow.

Labels: