This file contains hidden or 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
| NSString *destinationString = [NSString stringWithFormat:@"%f,%f",appDelegate.geoEngine.manager.location.coordinate.latitude,appDelegate.geoEngine.manager.location.coordinate.longitude]; | |
| // This is the URL that had been in the app since the feature was added | |
| - NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%f,%f",destinationString, self.pointOfInterest.coordinate.latitude, self.pointOfInterest.coordinate.longitude]; | |
| // This is what I replaced it with | |
| + NSString *poiString = [NSString stringWithFormat:@"%@ %@ %@, %@", self.pointOfInterest.title, self.pointOfInterest.address, self.pointOfInterest.city, self.pointOfInterest.state]; | |
| + | |
| + | |
| + NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%@",destinationString, poiString]; | |
| [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; |
This file contains hidden or 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
| commit 61ec9dec569736fcdf6ce559a1f67f2f95c9eae5 | |
| Author: Christopher Burnett <chris.burnett@digitalscientists.com> | |
| Date: Thu Oct 29 15:46:11 2009 -0400 | |
| added name and address to directions when opening maps.app | |
| diff --git a/Classes/PointOfInterestDetail.m b/Classes/PointOfInterestDetail.m | |
| index 108dc2e..a432f13 100644 | |
| --- a/Classes/PointOfInterestDetail.m | |
| +++ b/Classes/PointOfInterestDetail.m |
This file contains hidden or 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
| CLLocationCoordinate2D myHouse; | |
| myHouse.latitude = 33.760174; | |
| myHouse.longitude = -84.332780; | |
| CLLocationCoordinate2D cornerTavern; | |
| cornerTavern.latitude = 33.679771; | |
| cornerTavern.longitude = -84.440544; | |
| [GDirection getDirectionsFromLocation:myHouse toLocation:cornerTavern withDelegate:self]; |
This file contains hidden or 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
| // Local Search | |
| CLLocationCoordinate2D myHouse; | |
| myHouse.latitude = 33.760174; | |
| myHouse.longitude = -84.332780; | |
| [GLocation getLocalResultsForLocation:myHouse withQuery:@"Corner Tavern" withDelegate:self]; | |
| // Directions | |
| CLLocationCoordinate2D myHouse; |
This file contains hidden or 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
| InterstateExit Load (19.3ms) SELECT *, (ACOS(least(1,COS(0.651560888380549)*COS(-2.12983804456551)*COS(RADIANS(interstate_exits.lat))*COS(RADIANS(interstate_exits.lng))+ | |
| COS(0.651560888380549)*SIN(-2.12983804456551)*COS(RADIANS(interstate_exits.lat))*SIN(RADIANS(interstate_exits.lng))+ | |
| SIN(0.651560888380549)*SIN(RADIANS(interstate_exits.lat))))*3963.19) | |
| AS distance FROM `interstate_exits` WHERE ((interstate = 'I-280') AND ((interstate_exits.lat<37.331689))) ORDER BY distance ASC LIMIT 1 | |
| InterstateExit Load (36.3ms) SELECT *, (ACOS(least(1,COS(0.651560888380549)*COS(-2.12983804456551)*COS(RADIANS(interstate_exits.lat))*COS(RADIANS(interstate_exits.lng))+ | |
| COS(0.651560888380549)*SIN(-2.12983804456551)*COS(RADIANS(interstate_exits.lat))*SIN(RADIANS(interstate_exits.lng))+ | |
| SIN(0.651560888380549)*SIN(RADIANS(interstate_exits.lat))))*3963.19) | |
| AS distance FROM `interstate_exits` WHERE (((interstate_exits.lat>37.331689))) ORDER BY distance ASC LIMIT 1 | |
| InterstateExit Load (24.4ms) SELECT *, (ACOS(leas |
This file contains hidden or 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
| Server Software: Apache/2.2.8 | |
| Server Hostname: staging.bestexitapp.com | |
| Server Port: 80 | |
| Document Path: /upcoming.plist | |
| Document Length: 40262 bytes | |
| Concurrency Level: 10 | |
| Time taken for tests: 70.790 seconds | |
| Complete requests: 1000 |
This file contains hidden or 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
| Server Software: Apache/2.2.8 | |
| Server Hostname: staging.bestexitapp.com | |
| Server Port: 80 | |
| Document Path: /upcoming.plist | |
| Document Length: 36639 bytes | |
| Concurrency Level: 10 | |
| Time taken for tests: 28.947 seconds | |
| Complete requests: 1000 |
This file contains hidden or 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
| # this both the most awesome and stupid thing I | |
| # have ever written | |
| def self.wacky_resort items,course,interstate | |
| if interstate % 2 == 0 | |
| ascending = (course >= 90 && course <= 270) | |
| else | |
| ascending = (course >= 0 && course <= 180) | |
| end | |
| items = ascending ? items.sort_by{|i| i[:interstate_exit]} : items.sort_by{|i| i[:interstate_exit]}.reverse | |
| end |
This file contains hidden or 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
| Benchmark.bm do|b| | |
| b.report("create") do | |
| 10_000.times do |x| | |
| User.create(:username=>"Foo #{x}") | |
| end | |
| end | |
| end | |
| Results: |
This file contains hidden or 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
| require 'test_helper' | |
| class Project | |
| include MongoMapper::Document | |
| key :name, String | |
| key :context_id, String | |
| many :tasks | |
| many :collaborators | |
| end |