Archive for the 'A2Z' Category

“Everything you wanted to know about text but were afraid to ask”

Thursday, May 18th, 2006

This semester, I took a gamble at another programming course, for 2 reasons - Dan Shiffman was teaching it and the topic of making a play on words/letters/bodies of text was especially intriguing. Programming A to Z was a brand-spanking-new course @ ITP, and Shiffman’s invention. His examples were primarily in Java, but he accommodated us deviants (PHP + Perl). We covered regular expressions (oy vey!), bayesian text analysis, hash tables, binary trees, spiders, mining, interactive fiction, generative text and threads. Even though my own programming skills were not up to par, Shiffman introduced useful and powerful concepts for manipulating text. What I mean, is that he gave us different perspectives with which to observe, analyze and play with text within different environments.

On top of all this, what I found most inspiring is what other students DID taking all of these various approaches in mind. Language was experimented with, conversations were captured and displayed in trees and intricate sketch-like-machine drawings, politician’s speeches were recorded and made searchable, new virtual spaces and stories were created, email fed into an alphabet machine made of antique letterpress forms, and the list goes on.

As a final hurrah, we decided to document the final projects in a little, hot pink booklet. After a few exquisite corpse attempts at the cover design between Michael Delgaudio, Demetrie Tyler and I, we came up with what you see below.

A2ZcoverMagnify.gif

a2z final presentation: dreamNodes

Tuesday, April 25th, 2006

dreamNodes
www.dreamnodes.com

INTRODUCTION
dreamNodes is an online dream journal which allows users to store their dreams, and discover common themes both individually as well as across all users’ dreams.

GOALS

  • Setup an online application for storage of user accounts, dream text, and a dream dictionary
  • Allow users to add terms and definitions to the dictionary
  • Visualize dream themes using a “dreamCloud”
  • Provide resources such as links to useful sites, books on dream research and interpretation, and allow users to add on to this

CHALLENGES

  • Learning PHP, MySQL and working with a database
  • Conceptually approaching ways to connect users and dreams, body of dreams as a whole
  • Allowing users to help develop the site by adding content, dream themes, etc.

PROCESS
Research - After doing some online research, it doesn’t appear that there exists an online application that aims to connect people through dreams at the level we intended. There is a field of research known as social dreaming, but this is a bit more complicated than what we had in mind.

Setup - We started by building a basic application where users could create an account, login, record their dreams, and attach the date they had the dream.

Tags vs. Themes - Initially, we were playing with the notion of tagging dreams, but this approach seems to detract from the inherent value of the dreams themselves - themes were already discoverable within them. We took a list of dream terms from an existing online dream dictionary and inserted only the terms into a table. This list was then run against the table of dreams in another table (Journals) to find the matching occurences.

Redesign - The main purpose was to improve readability. The former version had a black background, white text and purple links, which proved difficult to read. We also needed to simplify the layout so users could more easily make sense of how to use the site - login/register, find dream themes, find connections, see common themes across all users and within their own journals.

Visualization - Currently having trouble implementing the dreamCloud. We want two types - one for the entire database of dreams and one for individual users. Work-In-Progress

For more detailed documentation on our development process, see our project blog.

SOURCE CODE
The bulk of the action happens in these two files:
journals.php
tags.php

Our references & resources:
majordomo.com (site’s now funky, but code samples are commented by Byrne Reese)
http://php.net
http://dev.mysql.com
and of course, Dan Shiffman

FUTURE PLANS
We plan to continue improving dreamNodes and exploring what else could be done with the text here. After discussing ideas with Dan about the interface and allowing the user more involvement in developing the app, an AJAX interface might work best. Users could select any word from their dream text on the fly, add it to the list of themes and optionally add a personal definition or possible interpretation for it.

We’re also interested in Noah’s suggestion about being able to leave messages for other dreamers, since dreamNodes is about exploring possible connections between people and dreams.

Also, experiment with running dream journal text against dream interpretation/analysis content available online. Could be interesting to see, for example, Freud’s Dream Psychology Psychoanalysis for Beginners (on Project Gutenberg) and other works centered around dreams.

dreamNodes feedback from Dan

Monday, April 24th, 2006

I met briefly with Dan Shiffman to review the current state of dreamNodes.com and here are his thoughts:

  • New interface is better & easier to read
  • The text cloud works as a good & suitable visualization for dreams
  • Dream Themes is currently limited to our list of words (lifted from an online source). Is kind of weak, content-wise. Immediately, it’s visible that certain words should be themes, especially since they’re interesting words/topics.
  • Dream Themes - Consider allowing users more flexibility in growing this part of the database. Rather than allowing them to tag, or generate entirely new words, maybe limit them to selecting words from within their own entries. Would require AJAX to make any word selectable and add to their list of themes.
  • Dream Themes page - try a different color for text instead of the theme word being larger (breaks readability of paragraph)
  • Also on Dream Themes page - where it lists “more themes:” consider making a mini tag cloud so you can immediately get a sense of presence/weight of those other themes contained within this particular dream
  • Impilicitly state that this is a public dream journal whose purpose it is to look for connections across users through their dreams. Anonymity could be setup in their accounts by allowing users to create any username for public display.
  • In regards to adding a dictionary, could also be contributed to in the same way users could add to the dream themes listing (via ajax interface).
  • Also, on intro/home page, don’t forget to explain what the dreamCloud is, especially to introduce new visitors to the site.

Tangled Passages (or my first foray into Interactive Fiction)

Tuesday, March 21st, 2006
I was really excited to explore IF after first hearing about it in the beginning of the semester. I expected it to be like the Choose Your Own Adventure books from my childhood, but with a free-form environment allowing you more possibilities. I started with For A Change and luckily, Dan advised me to look up common IF verbs online because I was at a loss figuring out what to command my character to do after a short while. Started getting the hang of it, and did enjoy Adam Cadre’s I-O (still playing it).Regarding user control, I was expecting that something more emergent to arise, but the story was still too scripted and limited. I didn’t complete any of the above works, but presume there exists a single conclusion which is the aim of your adventure. Maybe the input from users could be saved and contribute to a vocabulary within the story, and eventually add actions and more creative responses to these. The repetitive responses “I don’t understand that” or “That is neither here nor there” become a bit discouraging. It would be more engaging if IF allowed users to contribute to the development of these stories and possibly shape new narratives within existing works.Nick Montfort’s Toward a Theory of Interactive Fiction and Twisty Little Passages do offer interesting background and perspectives on IF, but I think the interactive end needs to be pushed further. Still, I think the idea of navigating through an environment and narrative via text is fascinating and holds a lot of potential to be explored.

A2Z Midterm Proposal: dreamNodes

Monday, February 27th, 2006
Steven & I are working on a dream journal concept together, but we’re still working out some details. Here’s the general idea/phases:1. Setup a website to serve as a dream journal for users (login page, blog style journal)

2. Content will be compared against a dream dictionary, specific words will be isolated and users will see highlighted terms in their journal entries. When clicked on, they can see what those terms mean in dreamland. This would be accomplished using Bayesian filtering.

3. Final phase:
- Extract connections between users and display a visualization of these (i.e. similar words, themes, profile interests, etc.)
- Allow users to add tags to their dreams
- Allow users to add to the dream dictionary in a wiki format

Our plan is to do this in PHP and the visualization end in Processing.

Concordance

Saturday, February 18th, 2006

For this topic, I didn’t find much online as of yet - here are a couple dealing with PHP and binary trees: Dev Mechanic & Code Comments. Matt Burton tried out a couple newsgroups too, but no responses.

To work on:
- Research more PHP samples employing concordance
- Practice connecting to MySQL database
- Explore recursion
- Should I work with String Tokenizer in PHP?? Online example

Readings: Algorithmic Efficiency, What is Text Analysis?

Regular expressions, you’re breaking my heart

Tuesday, February 14th, 2006

I started with Dan Shiffman’s vowel doubler example, then tried a regex to replace instances of time with the actual word time, but it’s not working.

regexphp.htm - input form
voweldoubler.php - Dan’s code, with my added attempt to replace time

I researched PHP regex and came across this handy reference sheet, downloadable as a PDF (see PCRE “cheat sheet”). Also, on php.net, I found that when using regex functions, there’s the POSIX syntax and PERL-compatible syntax using PCRE functions. A warning is disclosed that POSIX is not binary safe and to read more about it in a document that’s in “manpage format”. Hmmm…I think I’ll just stick with the PCRE syntax. (wikipedia definition: “Almost all substantial UNIX and Unix-like operating systems have extensive documentation known as man pages (short for “manual pages”).

To work on:
- More practice with regex
- Brainstorm more creative uses with it

Readings: Machines Visions, chapters on Regular Expressions

Happy valentine’s day…

a2z: Response + Assignment

Tuesday, February 7th, 2006

After struggling with Java for the third week, I give up! Moving on to PHP! I want to get into dynamic web stuff, databases and MySQL anyways, so this works out. So I started with Week 1’s assignment - text in/text out.

In this example, I appropriated Dan’s PHP example and every time the word “talk” appears in the text entered in the form, it’s replaced with “jibberish”.

Form
PHP script
Try out with King Crimson lyrics - “talk” appears incessantly

To work on:
- Ensuring the form stays on the page after results are spat out
- Keep line breaks

Java: file in/file out

Tuesday, January 24th, 2006

I decided to take my first stab at Java (over PHP) for this assignment, but I hit some roadblocks with the code. My goal was to read in lyrics from a song, and like the God example, search for every time the word “talk” appears, and keep it along with whatever word follows it. I shamelessly used Dan’s code, looked online for some help on how to read in external text, and came up with this…

ModTalk.java
elephanttalk.txt (Lyrics to Elephant Talk by King Crimson)

Clearly, I need to revisit Processing and the basics of programming to familiarize myself better with strings. Also, I had a little trouble getting used to compiling via Terminal, or the command line, versus the good ol’ “Play” button from Processing.

Readings: Jackson Mac Low, Java Tutorial on Strings