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
| module Main (main) where | |
| import Control.Monad (forever, when) | |
| import System.Environment (getArgs) | |
| import System.IO (withBinaryFile, hIsEOF, IOMode(ReadMode), hSetBuffering, BufferMode(BlockBuffering)) | |
| import Control.Concurrent (threadDelay) | |
| import Blaze.ByteString.Builder.ByteString (fromByteString) | |
| import Data.ByteString (ByteString) | |
| import Data.ByteString as BS | |
| import Data.Text as T |
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
| import {Hero} from './hero'; | |
| import {HEROES} from './mock-heroes'; | |
| import {Injectable} from 'angular2/core'; | |
| @Injectable() | |
| export class HeroService { | |
| getHeroes() { | |
| return Promise.resolve(HEROES); | |
| } | |
| // See the "Take it slow" appendix | |
| getHeroesSlowly() { |
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
| # Python 2.7 | |
| # 1. Iterator | |
| def f(n): | |
| return [x**4 for x in range(n)] | |
| def f2(n): | |
| for x in range(n): | |
| yield x**3 | |
| # Check if is a prime | |
| def isPrime(n): |
NewerOlder