net use X: \\192.168.10.17\wwwmaps X: to 192.168.10.17\www
net use /DELETE X:removes the mapped network drive
Now I can just run this batch file .. easy!
net use /DELETE X: net use X: \\192.168.10.17\www
net use X: \\192.168.10.17\wwwmaps X: to 192.168.10.17\www
net use /DELETE X:removes the mapped network drive
net use /DELETE X: net use X: \\192.168.10.17\www
for old in *.png; do convert $old `basename $old .png`.eps;done
convert i1.png e1.eps
convert i2.png e2.eps
convert i3.png e3.eps
for old in *.png; do cp $old my_.`basename $old .png`;done
"Person A", "PROJECT"=>1, "COUNTRY"=>1, "HOURS"=>40),
array("NAME"=>"Person A", "PROJECT"=>1, "COUNTRY"=>1, "HOURS"=>30),
array("NAME"=>"Person A", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>70),
array("NAME"=>"Person A", "PROJECT"=>2, "COUNTRY"=>2, "HOURS"=>10),
array("NAME"=>"Person A", "PROJECT"=>3, "COUNTRY"=>1, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>40),
array("NAME"=>"Person B", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>10),
array("NAME"=>"Person B", "PROJECT"=>2, "COUNTRY"=>2, "HOURS"=>50),
);
$expecteddata1 = array(
array("NAME"=>"Person A", "HOURS"=>200),
array("NAME"=>"Person B", "HOURS"=>100),
);
$expecteddata2 = array(
array("NAME"=>"Person A", "PROJECT"=>1, "HOURS"=>140),
array("NAME"=>"Person A", "PROJECT"=>2, "HOURS"=>10),
array("NAME"=>"Person A", "PROJECT"=>3, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>1, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>2, "HOURS"=>50),
);
function groupData($input, $byOptions) {
$str = "";
foreach($byOptions as $option) {
$str .= '[$row['.$option.']]';
}
$data = array();
foreach($input as $rowid=>$row) {
eval("@\$data".$str."['hours'] += ".$row['HOURS'].";");
}
$newdata = array();
$str = "";
$count = 0;
foreach($byOptions as $option) {
$str .= '"'.$option.'"=>"$id'.$count.'",';
$count ++;
}
$str='array('.$str.'"HOURS"=>"$hours")';
$count = 0;
$forstr = 'foreach($data as $id'.($count).'=>$arr'.($count).') {';
foreach($byOptions as $option) {
if($count >= (sizeof($byOptions)-1)) {
$forstr .= '$hours=$arr'.$count.'["hours"];';
break;
}
$forstr .= 'foreach($arr'.$count.' as $id'.($count+1).'=>$arr'.($count+1).') {';
$count++;
}
$forstr .= '$newdata[]='.$str.';';
$count = 0;
foreach($byOptions as $option) {
if($count >= (sizeof($byOptions)-1)) {
break;
}
$forstr .= '}';
$count ++;
}
$forstr .= '}';
//print $forstr;
eval("$forstr");
return $newdata;
}
$output1 = groupData($data, array("NAME"));
print ($expecteddata1 == $output1)?"Same":"Different Objects";
$output2 = groupData($data, array("NAME", "PROJECT"));
print ($expecteddata2== $output2)?"Same":"Different Objects";
?>
$data = array(
array("NAME"=>"Person A", "PROJECT"=>1, "COUNTRY"=>1, "HOURS"=>40),
array("NAME"=>"Person A", "PROJECT"=>1, "COUNTRY"=>1, "HOURS"=>30),
array("NAME"=>"Person A", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>70),
array("NAME"=>"Person A", "PROJECT"=>2, "COUNTRY"=>2, "HOURS"=>10),
array("NAME"=>"Person A", "PROJECT"=>3, "COUNTRY"=>1, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>40),
array("NAME"=>"Person B", "PROJECT"=>1, "COUNTRY"=>2, "HOURS"=>10),
array("NAME"=>"Person B", "PROJECT"=>2, "COUNTRY"=>2, "HOURS"=>50),
);
which i want in this format$expecteddata1 = array(
array("NAME"=>"Person A", "HOURS"=>200),
array("NAME"=>"Person B", "HOURS"=>100),
);
and also this, $expecteddata2 = array(
array("NAME"=>"Person A", "PROJECT"=>1, "HOURS"=>140),
array("NAME"=>"Person A", "PROJECT"=>2, "HOURS"=>10),
array("NAME"=>"Person A", "PROJECT"=>3, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>1, "HOURS"=>50),
array("NAME"=>"Person B", "PROJECT"=>2, "HOURS"=>50),
);
The expected data need grouping among multiple numbers of options. Note the Total.for($data as $rowid=>$row) {
$newdata[$row["NAME"]] += $row["HOURS]; //gives the data required for $expecteddata1
$newdata[$row["NAME"]][$row["PROJECT]] += $row["HOURS]; //gives the data required for $expecteddata2
}
which can be made to work for any number of options with $str = "";
foreach($byOptions as $option) {
$str .= '[$row['.$option.']]';
}
$data = array();
foreach($input as $rowid=>$row) {
eval("@\$data".$str."['hours'] += ".$row['HOURS'].";");
}
function groupData($input, $byOptions) {
$str = "";
foreach($byOptions as $option) {
$str .= '[$row['.$option.']]';
}
$data = array();
foreach($input as $rowid=>$row) {
eval("@\$data".$str."['hours'] += ".$row['HOURS'].";");
}
$newdata = array();
foreach($data as $id=>$arr) {
if(isset($arr['hours'])) {
$newdata[] = array($byOptions[0]=>$id, 'HOURS'=>$arr['hours']);
} else {
foreach($arr as $id1=>$arr1) {
if(isset($arr1['hours'])) {
$newdata[] = array($byOptions[0]=>$id, $byOptions[1]=>$id1, 'HOURS'=>$arr1['hours']);
} else {
foreach($arr1 as $id2=>$arr2) {
$newdata[] = array($byOptions[0]=>$id, $byOptions[1]=>$id1, $byOptions[2]=>$id2, 'HOURS'=>$arr2['hours']);
}
}
}
}
}
return $newdata;
}
$output1 = groupData($data, array("NAME"));
print ($expecteddata1 == $output1)?"Same":"Different Objects";
$output2 = groupData($data, array("NAME", "PROJECT"));
print ($expecteddata2== $output2)?"Same":"Different Objects";
\begin{figure}[h]
\centering
\fbox{
\scalebox{0.5}{\includegraphics*[viewport=0 900 600 1500]{large_image.png}}
}
\end{figure}
\begin{figure}[h]
\centering
\fbox{
\scalebox{0.5}{\includegraphics*[viewport=0 0 600 900]{large_image.png}}
}
\caption{Caption only here}
\label{Label only here}
\end{figure}
php_value xdebug.auto_trace 1See the meaning of above configuration from here. There are other parameters if you need to see the parameters passed and the return values.
php_value xdebug.trace_format 0
php_value xdebug.trace_output_dir /var/www/trace
php_value xdebug.trace_options 1
TRACE START [2007-12-25 05:24:23]
0.0018 68304 -> {main}() /var/www/testwiki/index.php:0
0.0037 87332 -> require_once(/var/www/testwiki/includes/WebStart.php) /var/www/testwiki/index.php:38
0.0039 87460 -> str_replace() /var/www/testwiki/includes/WebStart.php:10
0.0041 87800 -> ini_get() /var/www/testwiki/includes/WebStart.php:19
0.0043 87800 -> microtime() /var/www/testwiki/includes/WebStart.php:51
0.0045 87860 -> function_exists() /var/www/testwiki/includes/WebStart.php:53
0.0047 87880 -> getrusage() /var/www/testwiki/includes/WebStart.php:54
0.0050 89420 -> ini_set() /var/www/testwiki/includes/WebStart.php:59
0.0052 89420 -> define() /var/www/testwiki/includes/WebStart.php:66
0.0057 91252 -> require_once(/var/www/testwiki/StartProfiler.php) /var/www/testwiki/includes/WebStart.php:69
0.0059 91252 -> dirname() /var/www/testwiki/StartProfiler.php:3
0.0071 101736 -> require_once(/var/www/testwiki/includes/ProfilerStub.php)
.....
.....
2.1464 8033332 -> strlen() /var/www/testwiki/includes/OutputHandler.php:14
2.1466 8033332 -> wfDoContentLength() /var/www/testwiki/includes/OutputHandler.php:14
2.1467 8033332 -> headers_sent() /var/www/testwiki/includes/OutputHandler.php:96
2.1930 74168
TRACE END [2007-12-25 05:24:37]
php_value xdebug.profiler_output_dir /var/www/traceLoad the php script from browser. You will see the file cachegrind.out file being created. There are two such files in my case. I wonder why.
php_value xdebug.profiler_enable 1
