Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - min and max in multidimensional-array -


hi trying find min , max values of x , y how can find min , max functions not working correctly

$datapoints = array(  array('x' => 2343, 'y' => 4322),   array('x' => 103, 'y' => 303 ),   array('x' => 2345,'y' => 2321 ),   array('x' => 310, 'y' => 2044 ),   array('x' => 173, 'y' => 793 ),   array('x' => 456, 'y' => 2675),   array('x' => 24, 'y' => 819 )); 

i thinik have write own function:

<?php       function max_with_key($array, $key) {         if (!is_array($array) || count($array) == 0) return false;         $max = $array[0][$key];         foreach($array $a) {             if($a[$key] > $max) {                 $max = $a[$key];             }         }         return $max;     }       $datapoints = array(      array('x' => 2343, 'y' => 4322),       array('x' => 103, 'y' => 303 ),       array('x' => 2345,'y' => 2321 ),       array('x' => 310, 'y' => 2044 ),       array('x' => 173, 'y' => 793 ),       array('x' => 456, 'y' => 2675),       array('x' => 24, 'y' => 819 ));      $max_x = max_with_key($datapoints, 'x');  //2343     $max_y = max_with_key($datapoints, 'y');  //4322 ?> 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -