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}