- Identify the use cases that are in scope
- Determine constraints based on scoped use cases
use case : the things your system needs to be do.
constraints : the things your system will have to consider to be able to do stuff
| FROM golang:1.6.2 | |
| COPY . /go | |
| RUN go get github.com/nats-io/nats | |
| RUN go build api-server.go | |
| EXPOSE 8080 | |
| ENTRYPOINT ["/go/api-server"] |
| /** | |
| * Base contract that all upgradeable contracts should use. | |
| * | |
| * Contracts implementing this interface are all called using delegatecall from | |
| * a dispatcher. As a result, the _sizes and _dest variables are shared with the | |
| * dispatcher contract, which allows the called contract to update these at will. | |
| * | |
| * _sizes is a map of function signatures to return value sizes. Due to EVM | |
| * limitations, these need to be populated by the target contract, so the | |
| * dispatcher knows how many bytes of data to return from called functions. |
| function queue(concurrency = 1) { | |
| let running = 0 | |
| const taskQueue = [] | |
| const runTask = (task) => { | |
| running++ | |
| task(() => { | |
| running-- | |
| if (taskQueue.length > 0) { | |
| runTask(taskQueue.shift()) |
| const fetchContent = (url) => | |
| rx.Observable.create(observer => | |
| fetch(url) | |
| .then(res => res.json()) | |
| .then(json => { | |
| observer.onNext(json) | |
| observer.onCompleted() | |
| ) | |
| .catch(e => observer.onError()) | |
| ) |
| this.ycQuestions = [ | |
| "So what are you working on?", | |
| "Have you raised funding?", | |
| "What makes new users try you?", | |
| "What competition do you fear most?", | |
| "What’s the worst thing that has happened?", | |
| "Will you reincorporate as a US company?", | |
| "What’s an impressive thing you have done?", | |
| "Where is the rocket science here?", | |
| "Why did you pick this idea to work on?", |
| import React, {Component} from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import {observable, computed} from 'mobx'; | |
| import {observer} from 'mobx-react'; | |
| // import DevTools from 'mobx-react-devtools'; | |
| class Server { | |
| @observable days = []; | |
| @observable name = ""; | |
| @computed get upDays() { |
| // | |
| // In Solidity, a mapping is like a hashmap and works with `string` like this: | |
| // mapping (string => uint) a; | |
| // | |
| // However it doesn't support accessors where string is a key: | |
| // mapping (string => uint) public a; | |
| // | |
| // "Internal compiler error: Accessors for mapping with dynamically-sized keys not yet implemented." | |
| // | |
| // An accessor returns uint when called as `a(string)`. |
| <html> | |
| <head> | |
| <meta name="description" content="React Barchart animated"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.5.1/lodash.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script> | |
| <meta charset="utf-8"> |
| const ReactPerf = require('ReactPerf'); | |
| const TRACE_DOM = false; | |
| function reactPerfTrace(objName: string, fnName: string, func: any): any { | |
| return function(component) { | |
| let label; | |
| if (objName === 'ReactCompositeComponent') { | |
| var instName = this.getName() || 'Unknown'; | |
| label = fnName === 'mountComponent' || fnName === 'updateComponent' ? instName : `${instName}.${fnName}`; |