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
| = link_to "Home", root_url | |
| %h1= @user.name | |
| %h2 nearby cities | |
| - for name in @user.nearbys(25) | |
| %li | |
| = link_to name.name, @user | |
| = name.distance.round(2) | |
| miles |
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
| :javascript | |
| function initMap() { | |
| var myLatLng = {lat: #{@user.latitude}, lng: #{@user.longitude} }; | |
| var map = new google.maps.Map(document.getElementById('map'), { | |
| center: myLatLng, | |
| zoom: 17 | |
| }); |
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
| Test Results: | |
| String.prototype.toAlternatingCase | |
| should work for fixed tests (provided in the description) | |
| ✘ Expected: 'HELLO WORLD', instead got: ['H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D'] | |
| ✘ Expected: 'hello world', instead got: ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] | |
| ✘ Expected: 'HELLO world', instead got: ['H', 'E', 'L', 'L', 'O', ' ', 'w', 'o', 'r', 'l', 'd'] | |
| ✘ Expected: 'hEllO wOrld', instead got: ['h', 'E', 'l', 'l', 'O', ' ', 'w', 'O', 'r', 'l', 'd'] | |
| ✘ Expected: '12345', instead got: ['1', '2', '3', '4', '5'] | |
| ✘ Expected: '1A2B3C4D5E', instead got: ['1', 'A', '2', 'B', '3', 'C', '4', 'D', '5', 'E'] | |
| ✘ Expected: 'sTRING.PROTOTYPE.TOaLTERNATINGcASE', instead got: ['s', 'T', 'R', 'I', 'N', 'G', '.', 'P', 'R', 'O', 'T', 'O', 'T', 'Y', 'P', 'E', '.', 'T', 'O', 'a', 'L', 'T', 'E', 'R', 'N', 'A', 'T', 'I', 'N', 'G', 'c', 'A', 'S', 'E'] |
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
| describe("Example tests", function(){ | |
| var testData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]; | |
| var actual = countPositivesSumNegatives(testData); | |
| var expected = [10, -65]; | |
| Test.expect(actual[0] == expected[0] && actual[1] == expected[1], "Wrong return value."); | |
| testData = [0, 2, 3, 0, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14]; | |
| actual = countPositivesSumNegatives(testData); | |
| expected = [8, -50]; |
OlderNewer