Couldn't find the text of this for a while...
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
| pragma solidity ^0.4.11; | |
| contract PassToken { | |
| // so in order to sell tokens for an ICO you'll need to know how many | |
| // to sell | |
| // so let's say that we want to sell 1 million tokens | |
| // 1 eth -> 10 tokens | |
| // so we'll have 100,000 eth by the 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
| 0x37e748739D4ab6915fA9C3755F23Ddf7Ee771d67 |
Using Ruby on Rails we would like you to create a simple expert search tool. The application should fulfill the requirements below. The source code must be placed in a public repo on GitHub. The application should be deployable on Heroku.
- I enter a name and a personal website address and a member is created.
- When a member is created, all the heading (h1-h3) values are pulled in from the website to that members profile.
- The website url is shortened (e.g. using http://goo.gl)
- After the member has been added, I can define their friendships with other existing members. Friendships are bi-directional i.e. If David is a friend of Oliver, Oliver is always a friend of David as well.
- The interface should list all members with their name, short url and the number of friends e.g. Alan http://goo.gl/3io1P (3)
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
| testing |
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
| testing |
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
| def count_sentences | |
| self.scan(/[^\.!?]+[\.!?]/).map(&:strip).count | |
| 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
| def key_for_min_value(name_hash) | |
| new_name_hash = name_hash.sort_by do |key, value| | |
| value | |
| end | |
| just_names = new_name_hash.collect do |x,y| | |
| x | |
| end | |
| just_names.first | |
| 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 |bm| | |
| bm.report { first_approach } | |
| bm.report { alternative_approach } | |
| 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
| def both_elements(array1) | |
| array2 = [] | |
| intersection = array1 & array2 | |
| if !intersection.empty? | |
| intersection[i] | |
| else | |
| nil | |
| end | |
| end |
NewerOlder