Monday, 31 May 2010


*/$match = "match";
//database private stuff here
/*$query ="SELECT AVG(`item`), AVG(`item1`), AVG(`item2`), AVG(`item3`),AVG(`item4`), AVG(`item5`), AVG(`item6`) FROM Vains_test1 WHERE mood = 'happy'";*//*$query="SELECT AVG(item), AVG (item1), AVG(item2), AVG(item3), AVG(item4), AVG(item5), AVG(item6) FROM Vains_test1 where mood = 'happy'";*/$sum;$sum1; $sum2; $sum3; $sum4; $sum5; $sum6; $sum7; $sum8; $sum9; $sum10; $sum11; $sum12; $sum13; $sum14; $sum15; $sum16; $sum17;$sum18; $sum19; $sum20; $sum21; $sum22; $sum23; $sum24;
$query="SELECT item, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20, item21, item22, item23, item24 FROM Vains_test1 where mood = 'happy'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();$arrA = array();echo "
Top Ten Database Output Right Now


";$spe;$i=0;while ($i < $num) {
$item=mysql_result($result,$i,"item");$item1=mysql_result($result,$i,"item1");$item2=mysql_result($result,$i,"item2");$item3=mysql_result($result,$i,"item3");$item4=mysql_result($result,$i,"item4");$item5=mysql_result($result,$i,"item5");$item6=mysql_result($result,$i,"item6");$item7=mysql_result($result,$i,"item7");$item8=mysql_result($result,$i,"item8");$item9=mysql_result($result,$i,"item9");$item10=mysql_result($result,$i,"item10");$item11=mysql_result($result,$i,"item11");$item12=mysql_result($result,$i,"item12");$item13=mysql_result($result,$i,"item13");$item14=mysql_result($result,$i,"item14");$item15=mysql_result($result,$i,"item15");$item16=mysql_result($result,$i,"item16");$item17=mysql_result($result,$i,"item17");$item18=mysql_result($result,$i,"item18");$item19=mysql_result($result,$i,"item19");$item20=mysql_result($result,$i,"item20");$item21=mysql_result($result,$i,"item21");$item22=mysql_result($result,$i,"item22");$item23=mysql_result($result,$i,"item23");$item24=mysql_result($result,$i,"item24");
//echo "Item :$item
item2: $item
Item3: $item
item4: $item
item5: $item
item6: $item


";//echo "Item :$item
";//now work out average for item
$sum += $item;$sum1 += $item1;$sum2 += $item2;$sum3 += $item3;$sum4 += $item4;$sum5 += $item5;$sum6 += $item6;$sum7 += $item7;$sum8 += $item8;$sum9 += $item9;$sum10 += $item10;$sum11 += $item11;$sum12 += $item12;$sum13 += $item13;$sum14 += $item14;$sum15 += $item15;$sum16 += $item16;$sum17 += $item17;$sum18 += $item18;$sum19 += $item19;$sum20 += $item20;$sum21 += $item21;$sum22 += $item22;$sum23 += $item23;$sum24 += $item24;$i++;}//echo $sum;//echo "num :$num
";//$iavg = $sum/$num;//echo "$iavg
";$item_avg = averager($sum,$num);$item1_avg = averager($sum1,$num);$item2_avg = averager($sum2,$num);$item3_avg = averager($sum3,$num);$item4_avg = averager($sum4,$num);$item5_avg = averager($sum5,$num);$item6_avg = averager($sum6,$num);$item7_avg = averager($sum7,$num);$item8_avg = averager($sum8,$num);$item9_avg = averager($sum9,$num);$item10_avg = averager($sum10,$num);$item11_avg = averager($sum11,$num);$item12_avg = averager($sum12,$num);$item13_avg = averager($sum13,$num);$item14_avg = averager($sum14,$num);$item15_avg = averager($sum15,$num);$item16_avg = averager($sum16,$num);$item17_avg = averager($sum17,$num);$item18_avg = averager($sum18,$num);$item19_avg = averager($sum19,$num);$item20_avg = averager($sum20,$num);$item21_avg = averager($sum21,$num);$item22_avg = averager($sum22,$num);$item23_avg = averager($sum23,$num);$item24_avg = averager($sum24,$num);/*echo "$item_avg
";echo "$item1_avg
";echo "$item2_avg
";echo "$item3_avg
";echo "$item4_avg
";echo "$item5_avg
";echo "$item6_avg
";echo "$item7_avg
";echo "$item8_avg
";echo "$item9_avg
";echo "$item10_avg
";echo "$item11_avg
";echo "$item12_avg
";echo "$item13_avg
";echo "$item14_avg
";echo "$item15_avg
";echo "$item16_avg
";echo "$item17_avg
";echo "$item18_avg
";echo "$item19_avg
";echo "$item20_avg
";echo "$item21_avg
";echo "$item22_avg
";echo "$item23_avg
";echo "$item24_avg
";echo "----
";*///
//
/*$maxer = max($item_avg, $item1_avg, $item2_avg, $item3_avg, $item4_avg);echo $maxer;if($maxer == $item4_avg){
echo " Item3 is max-
"; }
*/
//order averages highest first/*$array_count=count($array); for($i=1;$i<=$array_count;$i++){$max_val[$i]=max_key($array);
$view=$array[$max_val[$i]];
unset($array[$max_val[$i]]);
print $view." ".$i."
"; // }
*/$array = array($item_avg, $item1_avg, $item2_avg, $item3_avg, $item4_avg, $item5_avg, $item6_avg, $item7_avg, $item8_avg, $item9_avg, $item10_avg, $item11_avg, $item12_avg, $item13_avg, $item14_avg, $item15_avg, $item16_avg, $item17_avg, $item18_avg, $item19_avg, $item20_avg, $item21_avg, $item22_avg, $item23_avg, $item24_avg);

$myFile = "testFile.txt";$fh = fopen($myFile, 'w') or die("can't open file");
//order averages highest first$array_count=count($array); for($i=1;$i<=$array_count;$i++){$max_val[$i]=max_key($array);
$view=$array[$max_val[$i]];
////get first 10 in an array
//try printing view to txt then getting back into array
////
unset($array[$max_val[$i]]);
//print $view." ".$i."
"; //
//fwrite($fh,$view." ".$i.""); $stringData = "\n"; fwrite($fh,$stringData); fwrite($fh,$view);
}
fclose($fh);
//////////////////////////////////////////
$line_array = file("testFile.txt");echo "
Retrieving data


";
//echo $line_array[13];//echo "item13:

";//echo $item13_avg;
(string)$top1 = $line_array[1];(string)$top2 = $line_array[2];(string)$top3 = $line_array[3];(string)$top4 = $line_array[4];(string)$top5 = $line_array[5];(string)$top6 = $line_array[6];(string)$top7 = $line_array[7];(string)$top8 = $line_array[8];(string)$top9 = $line_array[9];(string)$top10 = $line_array[10];
echo "TOP 10
";//echo $top10;
(string)$it = $item1_avg;(string)$it2 = $item2_avg;(string)$it3 = $item4_avg;(string)$it4 = $item4_avg;(string)$it5 = $item5_avg;(string)$it6 = $item6_avg;(string)$it7 = $item7_avg;(string)$it8 = $item8_avg;(string)$it9 = $item9_avg;(string)$it10 = $item10_avg;(string)$it11 = $item11_avg;(string)$it12 = $item12_avg;(string)$it13 = $item13_avg;(string)$it14 = $item14_avg;(string)$it15 = $item15_avg;(string)$it16 = $item16_avg;(string)$it17 = $item17_avg;(string)$it18 = $item18_avg;(string)$it19 = $item19_avg;(string)$it20 = $item20_avg;(string)$it21 = $item21_avg;(string)$it22 = $item22_avg;(string)$it23 = $item23_avg;(string)$it24 = $item24_avg;// echo "$top1:"; echo "

";echo round($top1, 2); echo "

"; //echo "
$it13:
";echo round($it10, 2);echo "

" ; $tes = 3;echo round(tes, 2);echo "

" ;
//ok so rounding is the soution to the problem if(round($line_array[1]) === round($item10_avg)){ echo $match; echo "Matchwwww

";
}
//now put on a loop//but rounding angerous for whole numbers such as 4//try PHP_ROUND_HALF_UP??? if(round($top1) === round($it10)){ echo $match; echo "Match

";
}
echo "___+___

"; echo strcasecmp($top1, $it10); echo "___+___

"; if (!strcasecmp($top1, $it10)){ print "The email addresses are identical!";
}
/*if ($top1 == $it10) echo "OK-1";//if (strcmp($ff,trim($numn2)) == 0) echo "OK-4"; //works!if (strcmp( $top1,trim($it10)) == 0) echo "OK-it is"; //doesnt workif (strcmp($top1, trim($it10) )== 0) echo "OK-3";
if (strcmp(trim($top1), trim($it13)) == 0) { echo "strings are equal"; } else { echo "string are not equal"; } */
//strcmp Returns <> 0 if str1 is greater than str2, and 0 if they are equal. //IN PHP FLOAT EQUALITY DOESNT WORK
echo "
___+___


";/////////////////////////////////////////////function max_key($array) {foreach ($array as $key => $val) {if ($val == max($array)) return $key;
}
}
////////////////////////////////////////////function averager($x,$y){$avg= $x/$y;return $avg;}

/////////////////////*$arrA = array();
$arrA ["$item"] = $item_avg;$arrA ["$item2"] = $item2_avg;$arrA ["$item3"] = $item3_avg;$arrA ["$item4"] = $item4_avg;*///echo "look item average is".$item_avg. "
";


/*$file = fopen("testFile.txt", "r") or exit("Unable to open file!");//Output a line of the file until the end is reachedwhile(!feof($file)) { // echo fgets($file). "
"; }
*/


$file = fopen("testFile.txt", "r") or exit("Unable to open file!");//Output a line of the file until the end is reachedfor($i=1;$i<=11;$i++){
echo fgets($file). "
"; }
fclose($file);

//so we get top ten//put in database then test for matches against each item's avg_score?
//////////
?>



Gradually getting somewhere>>>>

Saturday, 29 May 2010

Well what a slow coach I am with all this, but working out how to keep an automatic tally of values in the VAINS databse to keep the whole thing intelligently and constantly changing. Amazing how slow I am at the moment, can't think of a good excuse either. Oh well, I think, at least, you tend to learn more if you take longer to grasp something. The biggest confusion is that PHP is no good at checking float equalities, quite unlike the other languages I use you have to convert them to Strings first (So I read, though it doesnt actually work yet for me and I'm still working on it).



Now I have to scale it up for the whole 24 VAINS test items and 7 potential mood and other subjective parameters. But that is easy when you finally get these basic structures in place.....

Friday, 28 May 2010


We now have about 100 results from the many kindly respondents to our VAINS survey. I'm now trying to make very simple recommendations based on the data, I guess the complexity of the recommendations will escalate as I get to grips with the trickier aspects of SQL.
First effort today:

http://www.dareinteractive.com/VAINS/Vains_Test/smiley.html

Wednesday, 26 May 2010

http://amaztype.tha.jp/
this is fun
and this is useful
http://www.visualcomplexity.com/vc/
http://www.smashingmagazine.com/2007/08/02/data-visualization-modern-approaches/

Friday, 21 May 2010

mysql send (a cryptic reminder to myself)
Interesting week with the Body Motion Capture workshop, and meeting Choreographers and dancers from Laban, Alexandra and I want to use the body as an interface for a narrative system.

http://www.dareinteractive.com/mysql_send.php

SELECT COUNT(id) FROM Vains_test2

Tuesday, 18 May 2010

Still from openFrameworks/C++ application. Using live video input the code identifies faces and puts masks, hats, and other items on them.
See video clip below:

Prototype for Mirror Masks?

Sunday, 9 May 2010

Above is a full video of software process, next I'll make a film about a reader

using the content at the South Bank location

I'm making a film about the South project, so started today to grab some screen shots of the software generating content.

Tuesday, 4 May 2010


VAINS survey site nearly ready for launching:


Got a head cold so a bit blurry, but I think it looks ok, some of the images are mysterious and others are quite repugnant which is what we wanted...
Interesting links:
http://www.mti.dmu.ac.uk/jukebox/content/installations/WilkinsonP_PLASMA.html
http://www.mti.dmu.ac.uk/jukebox/performances.html
Troika Ranch:
http://www.troikaranch.org/
http://www.georgecoates.org/
http://www.anotherlanguage.org/
Digital performance archive:
http://www.ahds.ac.uk/performingarts/collections/dpa.htm
Le Sacre du Printemps . Igor Stravinsky . an interactive stereoscopic dance and music performanceKlaus Obermaier . Julia Mach . Ars Electronica Futurelab
http://www.exile.at/sacre/
Furterfield: http://www.furtherfield.org/display_user.php?ID=728
Orlan
Igloo http://www.igloo.org.uk/
Gob Squad http://www.gobsquad.com/
Critical Art Ensemble http://www.critical-art.net/
Viking Shoppers (igloo) http://www.swanquake.com/OldSite/mocap/viking.html
Swan Quake http://www.swanquake.com/intro.htm (iglo?)

Interfaces of Performance (Digital Research in the Arts and Humanities) (Hardcover) by Maria Chatzichristodoulou (Author, Editor), Janis Jefferies (Author, Editor), Rachel Zerihan(Author, Editor)
"This collection of essays and interviews investigates current practices that expand our understanding and experience of performance through the use of state-of-the-art technologies. It brings together leading practitioners, writers and curators who explore the intersections between theatre, performance and digital technologies, challenging expectations and furthering discourse across the disciplines. As technologies become increasingly integrated into theatre and performance, Interfaces of Performance revisits key elements of performance practice in order to investigate emergent paradigms. To do this five concepts integral to the core of all performance are foregrounded, namely environments, bodies, audiences, politics of practice and affect. The thematic structure of the volume has been designed to extend current discourse in the field that is often led by formalist analysis focusing on technology per se. The proposed approach intends to unpack conceptual elements of performance practice, investigating the strategic use of a diverse spectrum of technologies as a means to artistic ends. The focus is on the ideas, objectives and concerns of the artists who integrate technologies into their work. In so doing, these inquisitive practitioners research new dramaturgies and methodologies in order to create innovative experiences for, and encounters with, their audiences. "