Katie projects, notes and crud
July 30, 2004: Since I'll no longer be on campus, I put all my code in my webspace on faclin01. Most of the relevant, well-commented stuff should be linked in below and on the wiki; everything "else" is in ~krivard/share.
- It's to the point where I'm spending more time dealing with bad code than doing new things... now in search of something else to do.
- A bit mindsqueezing.
Wumpus World is being interesting, though I keep trying to specify relations that are technically correct but make Prolog barf everywhere. Some professor coded the Russell and Norvig environment stuff into Prolog back in 1995, which I have downloaded and am in the process of reading/understanding(it's highly understandable, I should send this guy a thankyou or something). I suppose by now I know enough Prolog to have a feel for what it's all about, and I should do more productive things. But the wumpus stuff is a bit addictive. Ah well. I'll finish poking the Holder stuff, and then move on.
I just wrote a Hunt the Wumpus textgame in about an hour and a half. It required some understanding of backtracking, recursive programming, dynamic vs static variables, and cut/fail. That's pretty sweet. Code: HuntTheWumpus
- Fix the website (functionalness and as much content as is reasonable)
Update: website is content-functional, BUT we should have some sort of process to keep this from being annoying in the future: Make a build script(so site only updates when you're sure it's good), or make the ccg_site module -i 'cvs update -d /usr/www/html/cognition'
No, don't do that -- edit loginfo instead.
- Move this wiki over? ewww...
- Figure out what sort of HTML infrastructure we need to do, if any, now, and try not to be too artsy with it.
Writing the interpreter outlined in the SICP book, converted to Common Lisp so I can get brain around the difference between syntax and language and between implemented and implementation.
- (The Friedman book (Essentials), by the way, is highly readable, even if it is yes a bit too deep for this course. A page or two from the Preface might be a good intro to get students in the mindset for interpreters, though.)
env stuff is what controls scoping. Neat!
Trouble likes to visit when I can't tell the difference between "You're just making that up" and legitimate Scheme macros/etc. set...! are particularly annoying. Better now that I have the sicp book open to my right, and the ANSI "The Scheme Programming Language" open to my left.
HA! -- I solved the define vs setf problem from waaaay back in AI-IS:
;; Want: (newcar '(1 2 3)) > 1 ;; Then: ;; in Scheme (define newcar car) ;; in Common Lisp (setf (symbol-function 'newcar) (symbol-function 'car))
Learned to use step, one of Common Lisp's debugging tools. Highly useful, though takes some getting used to.
- 7/1/04: I have an interpreter which, as far as I've tested it(not much), functions. I call it "done".
There are 7 versions out there in two flavors with different syntax. Some generators don't even produce well-formed xml! Not going to use in the course.
Well, if we were going to do anything it would be the RDF-based one (1.0, I think) as it's the only one I see as Semantic Web in the Black Hole sense -- las
Return of Clicker
- Because I fall asleep if I don't have code to hack on in the afternoons...
--> Being postponed in favor of more productive stuff. Currently in revision 2, which is more modular, uses interfaces, and is ready for implementation of responses from students.
HTML parsing/ screen scraping
HtmlOrganizer: java and python versions of app to build parse tree out of an html file
Found a Scheme with net support (DrScheme); don't be lazy just cause it's Scheme, work more on this
- Writing a python app to crawl webpages -- read page, collect links, build queue, iterate. Be a well-behaved web-bot.
- Most interesting pages to crawl are not well-formed HTML. In fact, they make my parser very sad. Must find a way to make the parser more tolerant, or find a source of good html.
- Rewrote python app to not care about well-formed-ness; no longer uses a parse tree(*sigh*).
App is living at WgetCrawler. There's a lot of random cruft in it now that's mostly workarounds for misc. web errors; the actual Thing probably doesn't need to be as complex.
Lex / YACC
Pythonified Lex/YACC is totally sweet. HtmlOrganizer now includes this extra-special way of parsing, even though it doesn't build a parse tree. What's neat is that it doesn't necessarily barf on syntax errors, so you actually do get to the end of not-well-formed files.