« March 2006 | Main | May 2006 »

April 25, 2006

Video Sensing Final Project

If you refer to past posts, my video sensing final project was to create a midlet for mobile phones in J2ME that allows users to upload video to a website without sending an mms message. See my presentation page

Dowload Perl File

April 23, 2006

Performance This Saturday

The performance this Saturday is approaching and I finally got my max patch to stop crashing my computer. Unfortunately, I will only be able to use photographs. Apparently, it was the video files that were causing the big problem. It is kind of a disappointment, but I am so glad it is working.

Basic run down of operation: The mysql object goes into a database, selects information from a specific table and then sends a url to the parsing object. The parsing object retrieves the image information and sends it into a get jpegs object which divides the different images up into seprate files and allows me to control their speed. Then the images are sent through a processor that makes them blur and move across the screen. There is still much to be down in the processing side of things, but the major difficulties have been resolved.

The images will get into the database from audience participants who will send them from their cell phones before and durring the performance to a specific email address (eye@free4md.com). A perl script running on the free4md server will retrieve the images from the email and dump them into a specific table.

Major problem still: Tonic's interent connection (will I will be investigating this week).

Download a sample mysql patch

April 07, 2006

Session issues on Dreamhost

After five days and many hours of frustration while trying to implement session management and database access on dreamhost, it is finally working. A big, huge, gigantic thanks must go out to Shawn, who sat with me many times for several hours trying to get it to work while probably getting as frustrated as I was (well....maybe not as frustrated). Thank you, thank you, thank you.

In any case, some others may run into this problem. So here are some warnings and instructions on what to do. First, there has been a list modules script floating around that supposedly lists all the perl modules on your server. IT IS NOT ACCURATE. According to its findings, CGI::Session was not installed on dreamhost, which ended up being very incorrect and causing me to waist many hours and several days trying to install a module. The best thing to do is to check your hosting service. Dreamhost lists all modules that they have installed somewhere on their info site and you can check if a module is installed on the command line by issuing the command perl -M The::Module::Name. Another tip, installing the module was not easy at all. There were permissions errors that prevented it from working causing Shawn to have to modify the makefile. I am not sure if this is normal as Shawn said that particular makefile looked kind of strange (it may have also happened because the module was installed system wide- I don't know). But be advised that it may not always be as easy as it should be.

The first problem I had was connecting to the database. Here is the code that must replace the database code on stage in order to connect successfully:

#########################################################
# Define our DB info
#########################################################
use DBI();

$dbpath ="dbi:mysql:database=clc219;host=mysql.free4med.com";

where clc219 is YOUR database name and mysql.free4med.com is YOUR host (which you can find under the goodies-mysql link on your main dreamhost page)
#########################################################
# Connect to the database.
#########################################################
# This only needs to be done once per script
$dbh = DBI->connect($dbpath, "$mysqlusername", "$mysqlpassword", {'RaiseError' => 1, 'PrintError' => 1});

For session management you MUST add the following code to the dwd examples otherwise it won't work:

#########################################################
# Get the necessary Perl modules for session management
#########################################################
use CGI;
use CGI::Session;
use CGI::Session::Driver::file;

#########################################################
# Initialize a new session or obtain old one if possible
#########################################################
$cgi = new CGI;
$session = new CGI::Session("driver:file", $cgi, {Directory=>$globalSessionDirectory});
$session->expire('+30m'); # Session expires after 30 minutes of inactivity

The bolded lines are different then the code we use on stage. Next, and most important, after setting the session parameters:

# Set our logged in session parameters
$session->param("~userid", $userId);
$session->param("~firstname", $firstname);
$session->param("~lastname", $lastname);
$session->param("~email", $email);
$session->param("~last_login", $last_login);
$session->param("~logged-in", 1);
$session->clear(["~login-trials"]);

You must add the following line of code:

$session->flush();

These differences are due to the fact that the CGI::Session module on stage is CGI::Session 3.95 while the module on dreamhost is 4.11. This means that even if you are not on dreamhost you may run into a problem if the module on your servier is newer or different. If you want to know more about what might be different with the 4.11 module you can go here.

Hopefully this will save some of you from the disaster I went through. If you have any problems come talk to me. I can't promise I can help but I will definitely try.

April 06, 2006

Video Sensing Final Project

In the spirit of my research on cell phone video applications and the current project I am working on for dynamic web and producing participatory media, I plan to create in J2ME an app that allows video and photos to be automatically uploaded with privacy settings, tags, comments and forum tags to the website that I am working on free4md.com. I wll post image and code examples soon