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
| "51.28995" "-115.225424" | |
| "51.343943" "-115.215761" | |
| "51.366801" "-116.339765" | |
| "51.372096" "-116.500556" | |
| "51.374474" "-116.505531" | |
| "51.37931" "-116.499068" | |
| "51.408442" "-116.241692" | |
| "51.448212" "-116.424461" | |
| "51.45666" "-116.433732" | |
| "51.471964" "-116.508653" |
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
| func IsPointInPolygon(p: CLLocationCoordinate2D, polygon: [CLLocationCoordinate2D]) -> Bool { | |
| var minX: Double = polygon[0].latitude | |
| var maxX: Double = polygon[0].latitude | |
| var minY: Double = polygon[0].longitude | |
| var maxY: Double = polygon[0].longitude | |
| for i in 0...polygon.count{ | |
| let q : CLLocationCoordinate2D = polygon[i]; | |
| minX = min(q.latitude, minX) |
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
| Border of Polygon | |
| -115.103760,50.958427,0.0 | |
| -115.982666,51.103522,0.0 | |
| -116.290283,51.323747,0.0 | |
| -116.323242,51.563412,0.0 | |
| -115.982666,51.638476,0.0 | |
| -115.576172,51.549751,0.0 | |
| -114.895020,51.337476,0.0 | |
| -114.763184,51.013755,0.0 | |
| -115.081787,50.958427,0.0 |
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
| func loadTable() { | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { | |
| //Add your long running task to get the table data here | |
| dispatch_async(dispatch_get_main_queue()) { | |
| self.indicator.stopAnimating() | |
| self.indicator.hidesWhenStopped = true | |
| self.tableView.reloadData() | |
| } | |
| } |
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
| func setupLoadingIndicator() { | |
| indicator.color = UIColor .blackColor() | |
| indicator.frame = CGRectMake(0.0, 0.0, 10.0, 10.0) | |
| indicator.center = self.view.center | |
| self.view.addSubview(indicator) | |
| indicator.bringSubviewToFront(self.view) | |
| indicator.startAnimating() | |
| } |
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
| func buildIndexFromNames(names: [String]) -> [String:[String]] { | |
| var indexedNames: [String:[String]] = [String():[]] | |
| for name in names{ | |
| let firstLetterOfString = String(name.characters.prefix(1)).uppercaseString | |
| if indexedNames[firstLetterOfString] != nil { | |
| indexedNames[firstLetterOfString]!.append(name) | |
| } else { | |
| indexedNames[firstLetterOfString] = [name] |
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
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System.Collections.Generic; | |
| namespace UnitTestProject1 | |
| { | |
| [TestClass] | |
| public class UrlRepositoryTest | |
| { | |
| [TestMethod] | |
| public void ShouldAddKeyAndRetrieveKey() |
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
| using System; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| namespace UnitTestProject1 | |
| { | |
| [TestClass] | |
| public class UnitTest1 | |
| { | |
| [TestMethod] | |
| public void ShouldEncodeIntegerToBase58() |
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
| var Firebase = require('firebase'); | |
| var json2html = require('node-json2html'); | |
| const api = new Firebase('https://hacker-news.firebaseio.com/v0') | |
| var topStoryIds = [] | |
| function loadTopStories(callback) { | |
| api.child('topstories').on('value', snapshot => { | |
| topStoryIds = snapshot.val(); | |
| callback(print_stories); |