www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 480074037f17eac47063d19e4a17c11ab97f23f7
parent 536e75f95e64f0a4b1b32a1dbd1ad59cd8806802
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date:   Sat, 12 Feb 2011 15:41:11 +0100

Merge branch 'master' of https://github.com/jsmaniac/2011-m1s2-ter

Diffstat:
Acode/PtiClic/res/drawable-hdpi/corbeille.png | 0
Acode/PtiClic/res/drawable-ldpi/corbeille.png | 0
Acode/PtiClic/res/drawable-mdpi/corbeille.png | 0
Dcode/serveur/README | 6------
Acode/serveur/README.sh | 16++++++++++++++++
Mcode/serveur/dump.url | 2+-
Mcode/serveur/dump2sqlite.sh | 20++++++++++----------
Mcode/serveur/php/pticlic.php | 2+-
8 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/code/PtiClic/res/drawable-hdpi/corbeille.png b/code/PtiClic/res/drawable-hdpi/corbeille.png Binary files differ. diff --git a/code/PtiClic/res/drawable-ldpi/corbeille.png b/code/PtiClic/res/drawable-ldpi/corbeille.png Binary files differ. diff --git a/code/PtiClic/res/drawable-mdpi/corbeille.png b/code/PtiClic/res/drawable-mdpi/corbeille.png Binary files differ. diff --git a/code/serveur/README b/code/serveur/README @@ -1,6 +0,0 @@ -cat dump.url -# Aller à cette adresse, et télécharger le dernier dump -./dump2sqlite.sh 01232011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt > sql -pv sql | sqlite3 php/db -sudo chown -R user.www-data php -chmod 664 php/db diff --git a/code/serveur/README.sh b/code/serveur/README.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# cat dump.url +# Aller à cette adresse, et télécharger le dernier dump +echo "Étape 1/3 : Téléchargement" +wget 'http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/02122011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt' + +echo "Étape 2/3 : Conversion vers sql" +./dump2sqlite.sh 01232011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt > sql + +echo "Étape 3/3 : Insertion dans la bdd" +mv php/db php/db.old +pv sql | sqlite3 php/db + +sudo chown -R $USER.www-data php +chmod 664 php/db diff --git a/code/serveur/dump.url b/code/serveur/dump.url @@ -1 +1 @@ -http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/ +http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/?C=M;O=D diff --git a/code/serveur/dump2sqlite.sh b/code/serveur/dump2sqlite.sh @@ -8,6 +8,7 @@ echo " Et c'est parti !" >&2 echo >&2 # Played_game(type) : 0 => partie de référence, 1 => joueur +# Note : l'index i_played_game_all sert à la vérification lors du set_partie. cat <<EOF begin transaction; @@ -20,7 +21,15 @@ create table game(gid integer primary key autoincrement, eid_central_word, relat create table game_cloud(gid, num, difficulty, eid_word, totalWeight, probaR1, probaR2, probaR0, probaTrash); create table played_game(pgid integer primary key autoincrement, gid, login, timestamp); create table played_game_cloud(pgid, gid, type, num, relation, weight, score); + insert into user(login, mail, hash_passwd, score) values('foo', 'foo@isp.com', '$(echo -n 'bar' | md5sum | cut -d ' ' -f 1)', 0); + +create index i_relation_start on relation(start); +create index i_relation_end on relation(end); +create index i_relation_type on relation(type); +create index i_relation_start_type on relation(start,type); +create index i_relation_end_type on relation(end,type); +create index i_played_game_all on played_game(pgid, gid, login, timestamp); EOF # tr : pour virer le CRLF qui traîne @@ -38,13 +47,4 @@ cat "$1" \ | grep -v '^//' \ | grep -v '^$' -# Note : l'index i_played_game_all sert à la vérification lors du set_partie. -cat <<EOF -create index i_relation_start on relation(start); -create index i_relation_end on relation(end); -create index i_relation_type on relation(type); -create index i_relation_start_type on relation(start,type); -create index i_relation_end_type on relation(end,type); -create index i_played_game_all on played_game(pgid, gid, login, timestamp); -commit; -EOF +echo "commit;" diff --git a/code/serveur/php/pticlic.php b/code/serveur/php/pticlic.php @@ -159,7 +159,7 @@ function cg_build_result_sets($cloudSize, $centerEid, $r1, $r2) */ function cg_choose_relations() { - $relations = array(5, 7, 9, 10, /* Pas d'icônes pour celles-ci. */ 13, 14, 22); + $relations = array(5, 7, 9, 10);// /* Pas d'icônes pour celles-ci. */ 13, 14, 22); $r1 = rand(0,count($relations)-1); $r2 = rand(0,count($relations)-2);