This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MINIMUM_ZOOM_ARC 0.003 //approximately 1 miles (1 degree of arc ~= 69 miles) | |
#define ANNOTATION_REGION_PAD_FACTOR 1.1 | |
#define MAX_DEGREES_ARC 360 | |
+(MKCoordinateRegion)adjustZoomMapView:(NSArray*) locations { | |
int count = [locations count]; | |
MKMapPoint points[count]; //C array of MKMapPoint struct | |
for( int i=0; i<count; i++ ) //load points C array by converting coordinates to points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[_mapView setRegion:[_mapView regionThatFits:[self adjustZoomMapView:locationPoints]] animated:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Colaborators = new Schema({ | |
rut : {type: String, unique: true, index: true } | |
,name : {type: String } | |
}); | |
var Enterprises = new Schema({ | |
icono : String | |
,identifier : {type: String, unique: true, index: true } | |
,name : {type: String, unique: true, index: true } | |
,description : String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models.Enterprises.find({'colaborators.rut':userRut}, callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models.Enterprises.find({'colaborators.rut':userRut}, "colaborators", callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create your image | |
UIImage *image = [UIImage imageNamed: @"logo.png"]; | |
UIImageView *imageview = [[UIImageView alloc] initWithImage: image]; | |
// set the text view to the image view | |
self.navigationItem.titleView = imageview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NSObject+PWObject.h | |
#import <Foundation/Foundation.h> | |
@interface NSObject (PWObject) | |
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay; | |
@end | |
/* NSObject+PWObject.m */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isValidLocation:(CLLocation *)newLocation | |
withOldLocation:(CLLocation *)oldLocation | |
{ | |
// Filter out nil locations | |
if (!newLocation) | |
{ | |
NSLog(@"No es valido newLocation is Nil"); | |
return NO; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function insertarNuevoTicket($usuario=null, $servicio=null, $componente=null, $finicio=null, $descripcion=null, $tipo_ticket=null, $nuevo_id=null) { | |
$stm=$this->pdo->prepare("INSERT INTO tickets VALUES( ".$nuevo_id.", '".$usuario."', '".$descripcion."', ".$tipo_ticket.", now(), ".$servicio.", ".$componente.", timestamp IS NULL, 0, 1, 0, 0);"); $query = "INSERT INTO tickets VALUES( ".$nuevo_id.", '".$usuario."', '".$descripcion."', ".$tipo_ticket.", now(), ".$servicio.", ".$componente.", NULL, 0, 1, 0, 0)"; | |
echo "<br>".$query."<br>"; | |
$stm->execute(); | |
$row=0; | |
$row=$stm->rowCount(); | |
return $row; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function playing(list,times){ | |
var newArray = []; | |
var x = 0; | |
for(i=0;i<list.length;i++){ | |
// console.log(list.length); | |
if(times > 0){ | |
if(list.length%2 == 1){ | |
// impar debemos eliminar desde el 0 |
OlderNewer