70 likes | 176 Views
PHP によるCプログラムの実行. システムコールの復習. // コマンドの内容を変数に代入 $command=“ls /home/fushimi/file/data/”; // 出力結果を格納用の配列の初期化 $output= array() ; // 戻り値を格納する変数の初期化 $return=null; // コマンドの実行関数 exec( $command,$output,$return ) ;. Cプログラムを実行させる. // コマンドの内容を変数に代入 $command=“./cpgm 引数 1 引数 2”;
E N D
システムコールの復習 //コマンドの内容を変数に代入 $command=“ls /home/fushimi/file/data/”; //出力結果を格納用の配列の初期化 $output=array(); //戻り値を格納する変数の初期化 $return=null; //コマンドの実行関数 exec($command,$output,$return);
Cプログラムを実行させる //コマンドの内容を変数に代入 $command=“./cpgm 引数1 引数2”; //出力結果を格納用の配列の初期化 $output=array(); //戻り値を格納する変数の初期化 $return=null; //コマンドの実行関数 exec($command,$output,$return);
実行させるプログラムを選択 $a=$_POST[‘cpgm’]; if($a==prk)$command=“〇〇”; else if($a==hits)$command=“〇〇”; else if($a==deg)$command=“〇〇”; else if($a==clc1)$command=“〇〇”; else if($a==clc2)$command=“〇〇”; else if($a==bwc)$command=“〇〇”;
ランキングプログラム(C)の詳細 • ページランク • ./prkalpha label-list 出力ファイル名 • Hits • ./hits label-list 出力ファイル名 • 次数中心性 • ./deg label-list 出力ファイル名 • 近接中心性 • ./clc1 label-list 出力ファイル名 • ./clc2 label-list 出力ファイル名 • 媒介中心性 • ./bwc label-list 出力ファイル名
ランキング結果のソート(並び替え) • ./csortNURLIDランキング結果ファイル名出力ファイル名 • 0 1 2 3 4 • 0:プログラムの実行ファイル名 • 1:並び替える値の総数(例:12047)label-listの第1行目に書いてある • 2:URLID • 3:ランキングの結果ファイル(例:prk.txt) • 4:並び替え結果のファイル(例:sprk.txt)
補足 • 読み込むlabel-listは“:1”のついてないもの • 近接中心性 clc1とclc2の違い