├── client ├── __init__.py ├── example.py └── NDlibClient.py ├── service_test └── __init__.py ├── logs └── README.md ├── data ├── exploratories │ ├── ToyCore_Com │ │ └── nodes_initial_status.csv │ ├── ToyPeri_Com │ │ └── nodes_initial_status.csv │ ├── README.txt │ ├── ClusteredBA_top │ │ └── nodes_initial_status.csv │ ├── ClusteredBA_random │ │ └── nodes_initial_status.csv │ └── ClusteredBA_bottom │ │ └── nodes_initial_status.csv └── db │ └── README.md ├── .DS_Store ├── static ├── images │ ├── pic01.jpg │ ├── pic02.jpg │ └── logo-rest.png ├── docs │ ├── img │ │ ├── favicon.ico │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── vendor │ │ ├── prettify │ │ │ ├── lang-rd.js │ │ │ ├── lang-go.js │ │ │ ├── lang-tex.js │ │ │ ├── lang-proto.js │ │ │ ├── lang-llvm.js │ │ │ ├── lang-yaml.js │ │ │ ├── lang-basic.js │ │ │ ├── lang-wiki.js │ │ │ ├── lang-lua.js │ │ │ ├── lang-hs.js │ │ │ ├── lang-erlang.js │ │ │ ├── lang-tcl.js │ │ │ ├── prettify.css │ │ │ ├── lang-r.js │ │ │ ├── lang-pascal.js │ │ │ ├── lang-lisp.js │ │ │ ├── lang-css.js │ │ │ ├── lang-mumps.js │ │ │ ├── lang-scala.js │ │ │ ├── lang-dart.js │ │ │ ├── lang-apollo.js │ │ │ ├── lang-ml.js │ │ │ ├── lang-n.js │ │ │ ├── lang-vhdl.js │ │ │ ├── lang-clj.js │ │ │ ├── lang-vb.js │ │ │ ├── lang-sql.js │ │ │ └── prettify.js │ │ ├── path-to-regexp │ │ │ ├── LICENSE │ │ │ └── index.js │ │ ├── prettify.css │ │ ├── polyfill.js │ │ ├── webfontloader.js │ │ └── semver.min.js │ ├── locales │ │ ├── zh.js │ │ ├── zh_cn.js │ │ ├── pl.js │ │ ├── ca.js │ │ ├── de.js │ │ ├── pt_br.js │ │ ├── ru.js │ │ ├── es.js │ │ ├── nl.js │ │ ├── fr.js │ │ ├── it.js │ │ └── locale.js │ ├── api_project.json │ ├── api_project.js │ ├── utils │ │ ├── send_sample_request.js │ │ └── handlebars_helper.js │ └── css │ │ └── style.css └── assets │ ├── css │ ├── images │ │ ├── bg01.png │ │ └── bg02.png │ └── ie8.css │ ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 │ ├── sass │ ├── libs │ │ ├── _vars.scss │ │ ├── _functions.scss │ │ └── _mixins.scss │ └── ie8.scss │ └── js │ ├── main.js │ ├── ie │ ├── html5shiv.js │ └── respond.min.js │ ├── skel.min.js │ └── util.js ├── utils ├── __init__.py └── generators.py ├── requirements.txt ├── gunicorn.sh ├── .travis.yml ├── Dockerfile ├── resources ├── networks.json ├── generators.json ├── exploratories.json └── models.json ├── apidoc.json ├── .gitignore ├── README.md └── CHANGELOG.md /client/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /service_test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logs/README.md: -------------------------------------------------------------------------------- 1 | Application logs -------------------------------------------------------------------------------- /data/exploratories/ToyCore_Com/nodes_initial_status.csv: -------------------------------------------------------------------------------- 1 | 0,1 -------------------------------------------------------------------------------- /data/exploratories/ToyPeri_Com/nodes_initial_status.csv: -------------------------------------------------------------------------------- 1 | 0,1 -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/.DS_Store -------------------------------------------------------------------------------- /static/images/pic01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/images/pic01.jpg -------------------------------------------------------------------------------- /static/images/pic02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/images/pic02.jpg -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'rossetti' 2 | __license__ = "GPL" 3 | __email__ = "giulio.rossetti@gmail.com" 4 | -------------------------------------------------------------------------------- /static/docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/docs/img/favicon.ico -------------------------------------------------------------------------------- /static/images/logo-rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/images/logo-rest.png -------------------------------------------------------------------------------- /static/assets/css/images/bg01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/css/images/bg01.png -------------------------------------------------------------------------------- /static/assets/css/images/bg02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/css/images/bg02.png -------------------------------------------------------------------------------- /static/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/docs/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/docs/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /static/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /static/docs/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiulioRossetti/ndlib-rest/HEAD/static/docs/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | flask-cors 3 | flask-restful 4 | flask_apidoc 5 | flask_cors 6 | requests 7 | numpy 8 | scipy 9 | ndlib==4.0.2 10 | gunicorn 11 | -------------------------------------------------------------------------------- /data/db/README.md: -------------------------------------------------------------------------------- 1 | In this folder will be temporarily stored the experiments data. 2 | If an experiment is not adequately closed it data structures will not be cleaned thus causing a growth of experiments.db. 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); 2 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); 2 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); 2 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /static/assets/sass/libs/_vars.scss: -------------------------------------------------------------------------------- 1 | // Misc. 2 | $misc: ( 3 | z-index-base: 10000, 4 | sidebar-side: 'left' 5 | ); 6 | 7 | // Duration. 8 | $duration: ( 9 | sidebar: 0.5s 10 | ); 11 | 12 | // Size. 13 | $size: ( 14 | sidebar: 14em 15 | ); 16 | 17 | // Font. 18 | $font: ( 19 | ); 20 | 21 | // Palette. 22 | $palette: ( 23 | ); -------------------------------------------------------------------------------- /gunicorn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | pip install -r requirements.txt 5 | exec gunicorn -w 4 -b 0.0.0.0:5000 ndrest:app > /dev/null & 6 | 7 | if [ -d NDLib_viz ]; then 8 | rm -rf NDLib_viz 9 | fi 10 | 11 | git clone https://github.com/GiulioRossetti/NDLib_viz.git > /dev/null 12 | cd NDLib_viz 13 | npm install 14 | npm run dev & 15 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: python 4 | python: 5 | - "3.6" 6 | 7 | before_install: 8 | - pip install gunicorn 9 | - pip install pytest pytest-cov 10 | - pip install coveralls 11 | 12 | install: 13 | - pip install -r requirements.txt 14 | 15 | script: 16 | - gunicorn -w 4 -b 127.0.0.1:5000 ndrest:app & 17 | - python service_test/EndpointTesting.py 18 | 19 | after_success: 20 | - coveralls -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", 3 | /^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); 4 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); 2 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nikolaik/python-nodejs:latest 2 | 3 | MAINTAINER Giulio Rossetti 4 | 5 | COPY requirements.txt /tmp/ 6 | 7 | RUN pip install --upgrade pip 8 | RUN pip install gunicorn 9 | RUN pip install -r /tmp/requirements.txt 10 | RUN apt-get update 11 | RUN apt-get -y install git 12 | 13 | COPY . /app 14 | WORKDIR /app 15 | 16 | RUN git clone https://github.com/GiulioRossetti/NDLib_viz.git 17 | 18 | WORKDIR NDLib_viz 19 | RUN npm install 20 | 21 | EXPOSE 5000 8080 22 | 23 | WORKDIR /app 24 | ENTRYPOINT ["/bin/bash"] 25 | CMD ["gunicorn.sh"] 26 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 2 | ["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 2 | ["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", 3 | /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); 4 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], 2 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 3 | -------------------------------------------------------------------------------- /data/exploratories/README.txt: -------------------------------------------------------------------------------- 1 | An exploratory is identified by a folder having name: 2 | network_exploratory (i.e. Lastfm_rock) 3 | 4 | The folder should contain up to three files: 5 | 6 | - nodes.csv 7 | having format: 8 | id_node,threshold,profile 9 | Where threshold and profile are ranging in [0,1]. If only one is defined the default value - to be specified for each entry - is 0. 10 | 11 | - edges.csv 12 | having format: 13 | id_node_from,id_node_to,weight 14 | Where weight ranges in [0,1]. Default value 1. 15 | 16 | - nodes_initial_status.csv 17 | having format: 18 | id_node,initial_status 19 | Where initial_status is a value in [-1, 0, 1, 2] depending by the statuses allowed by the desired model. -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], 3 | ["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); 4 | -------------------------------------------------------------------------------- /resources/networks.json: -------------------------------------------------------------------------------- 1 | { 2 | "networks": 3 | [ 4 | { 5 | "name": "Lastfm", 6 | "size": 7 | { 8 | "nodes": 75969, 9 | "edges": 389639 10 | }, 11 | "directed": false, 12 | "exploratory_available": true, 13 | "open_access": true, 14 | "description": "Undirected social graph involving UK users of Last.fm" 15 | }, 16 | { 17 | "name": "Twitter", 18 | "size": 19 | { 20 | "nodes": 2566, 21 | "edges": 8593 22 | }, 23 | "directed": false, 24 | "exploratory_available": false, 25 | "open_access": false, 26 | "description": "Undirected social graph involving Twitter users of the city of Richmond" 27 | } 28 | 29 | ] 30 | } -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); 4 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 2 | ["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, 2 | null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); 3 | -------------------------------------------------------------------------------- /static/assets/sass/libs/_functions.scss: -------------------------------------------------------------------------------- 1 | /// Gets a duration value. 2 | /// @param {string} $keys Key(s). 3 | /// @return {string} Value. 4 | @function _duration($keys...) { 5 | @return val($duration, $keys...); 6 | } 7 | 8 | /// Gets a font value. 9 | /// @param {string} $keys Key(s). 10 | /// @return {string} Value. 11 | @function _font($keys...) { 12 | @return val($font, $keys...); 13 | } 14 | 15 | /// Gets a misc value. 16 | /// @param {string} $keys Key(s). 17 | /// @return {string} Value. 18 | @function _misc($keys...) { 19 | @return val($misc, $keys...); 20 | } 21 | 22 | /// Gets a palette value. 23 | /// @param {string} $keys Key(s). 24 | /// @return {string} Value. 25 | @function _palette($keys...) { 26 | @return val($palette, $keys...); 27 | } 28 | 29 | /// Gets a size value. 30 | /// @param {string} $keys Key(s). 31 | /// @return {string} Value. 32 | @function _size($keys...) { 33 | @return val($size, $keys...); 34 | } -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 3 | -------------------------------------------------------------------------------- /resources/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "endpoints": 3 | [ 4 | { 5 | "name": "ERGraph", 6 | "uri": "/api/Generators/ERGraph", 7 | "params": {"token": "access token", "n": "number of nodes", "p": "rewiring probability"} 8 | }, 9 | { 10 | "name": "BAGraph", 11 | "uri": "/api/Generators/BarabasiAlbertGraph", 12 | "params": {"token": "access token", "n": "number of nodes", "m": "number of edges per new node"} 13 | }, 14 | { 15 | "name": "WattsStrogatzGraph", 16 | "uri": "/api/Generators/WattsStrogatzGraph", 17 | "params": {"token": "access token", "n": "number of nodes", 18 | "k": "number of node connections", 19 | "p": "edge rewiring probability"} 20 | }, 21 | { 22 | "name": "CompleteGraph", 23 | "uri": "/api/Generators/CompleteGraph", 24 | "params": {"token": "access token", "n": "number of nodes"} 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 2 | ["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), 3 | ["dart"]); 4 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 2 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); 3 | -------------------------------------------------------------------------------- /data/exploratories/ClusteredBA_top/nodes_initial_status.csv: -------------------------------------------------------------------------------- 1 | 4,-1 2 | 5,-1 3 | 2,-1 4 | 9,-1 5 | 12,-1 6 | 11,-1 7 | 8,-1 8 | 3,-1 9 | 6,-1 10 | 13,-1 11 | 23,-1 12 | 24,-1 13 | 16,-1 14 | 32,-1 15 | 10,-1 16 | 27,-1 17 | 25,-1 18 | 41,-1 19 | 42,-1 20 | 65,-1 21 | 40,-1 22 | 29,-1 23 | 15,-1 24 | 18,-1 25 | 45,-1 26 | 22,-1 27 | 107,-1 28 | 1,-1 29 | 34,-1 30 | 49,-1 31 | 7,-1 32 | 54,-1 33 | 59,-1 34 | 103,-1 35 | 104,-1 36 | 20,-1 37 | 36,-1 38 | 38,-1 39 | 46,-1 40 | 66,-1 41 | 35,-1 42 | 44,-1 43 | 52,-1 44 | 56,-1 45 | 57,-1 46 | 67,-1 47 | 76,-1 48 | 84,-1 49 | 98,-1 50 | 109,-1 51 | 112,-1 52 | 48,-1 53 | 62,-1 54 | 70,-1 55 | 72,-1 56 | 80,-1 57 | 81,-1 58 | 93,-1 59 | 97,-1 60 | 100,-1 61 | 101,-1 62 | 111,-1 63 | 135,-1 64 | 136,-1 65 | 137,-1 66 | 17,-1 67 | 19,-1 68 | 30,-1 69 | 37,-1 70 | 50,-1 71 | 58,-1 72 | 87,-1 73 | 88,-1 74 | 99,-1 75 | 115,-1 76 | 128,-1 77 | 130,-1 78 | 152,-1 79 | 188,-1 80 | 0,-1 81 | 14,-1 82 | 26,-1 83 | 31,-1 84 | 33,-1 85 | 39,-1 86 | 43,-1 87 | 47,-1 88 | 63,-1 89 | 64,-1 90 | 71,-1 91 | -------------------------------------------------------------------------------- /data/exploratories/ClusteredBA_random/nodes_initial_status.csv: -------------------------------------------------------------------------------- 1 | 68,-1 2 | 40,-1 3 | 255,-1 4 | 246,-1 5 | 111,-1 6 | 230,-1 7 | 104,-1 8 | 263,-1 9 | 23,-1 10 | 285,-1 11 | 232,-1 12 | 9,-1 13 | 104,-1 14 | 230,-1 15 | 180,-1 16 | 166,-1 17 | 297,-1 18 | 46,-1 19 | 62,-1 20 | 81,-1 21 | 282,-1 22 | 36,-1 23 | 140,-1 24 | 271,-1 25 | 136,-1 26 | 63,-1 27 | 15,-1 28 | 151,-1 29 | 240,-1 30 | 172,-1 31 | 71,-1 32 | 295,-1 33 | 176,-1 34 | 142,-1 35 | 80,-1 36 | 92,-1 37 | 134,-1 38 | 98,-1 39 | 249,-1 40 | 222,-1 41 | 99,-1 42 | 45,-1 43 | 94,-1 44 | 100,-1 45 | 17,-1 46 | 139,-1 47 | 178,-1 48 | 256,-1 49 | 175,-1 50 | 35,-1 51 | 86,-1 52 | 229,-1 53 | 209,-1 54 | 286,-1 55 | 296,-1 56 | 212,-1 57 | 133,-1 58 | 283,-1 59 | 85,-1 60 | 260,-1 61 | 271,-1 62 | 288,-1 63 | 237,-1 64 | 250,-1 65 | 218,-1 66 | 96,-1 67 | 26,-1 68 | 68,-1 69 | 172,-1 70 | 110,-1 71 | 131,-1 72 | 175,-1 73 | 77,-1 74 | 60,-1 75 | 283,-1 76 | 104,-1 77 | 224,-1 78 | 41,-1 79 | 240,-1 80 | 179,-1 81 | 203,-1 82 | 272,-1 83 | 52,-1 84 | 191,-1 85 | 191,-1 86 | 28,-1 87 | 212,-1 88 | 105,-1 89 | 116,-1 90 | 211,-1 91 | -------------------------------------------------------------------------------- /data/exploratories/ClusteredBA_bottom/nodes_initial_status.csv: -------------------------------------------------------------------------------- 1 | 69,-1 2 | 102,-1 3 | 106,-1 4 | 110,-1 5 | 119,-1 6 | 129,-1 7 | 131,-1 8 | 133,-1 9 | 140,-1 10 | 148,-1 11 | 156,-1 12 | 161,-1 13 | 169,-1 14 | 171,-1 15 | 176,-1 16 | 178,-1 17 | 184,-1 18 | 186,-1 19 | 191,-1 20 | 193,-1 21 | 197,-1 22 | 202,-1 23 | 205,-1 24 | 206,-1 25 | 208,-1 26 | 211,-1 27 | 212,-1 28 | 215,-1 29 | 218,-1 30 | 219,-1 31 | 222,-1 32 | 224,-1 33 | 226,-1 34 | 227,-1 35 | 228,-1 36 | 229,-1 37 | 230,-1 38 | 233,-1 39 | 235,-1 40 | 236,-1 41 | 238,-1 42 | 240,-1 43 | 241,-1 44 | 242,-1 45 | 245,-1 46 | 246,-1 47 | 247,-1 48 | 250,-1 49 | 251,-1 50 | 252,-1 51 | 253,-1 52 | 254,-1 53 | 255,-1 54 | 256,-1 55 | 258,-1 56 | 259,-1 57 | 261,-1 58 | 262,-1 59 | 263,-1 60 | 264,-1 61 | 265,-1 62 | 266,-1 63 | 267,-1 64 | 270,-1 65 | 271,-1 66 | 272,-1 67 | 273,-1 68 | 274,-1 69 | 275,-1 70 | 276,-1 71 | 278,-1 72 | 279,-1 73 | 281,-1 74 | 283,-1 75 | 284,-1 76 | 285,-1 77 | 287,-1 78 | 288,-1 79 | 289,-1 80 | 290,-1 81 | 291,-1 82 | 292,-1 83 | 293,-1 84 | 294,-1 85 | 295,-1 86 | 296,-1 87 | 297,-1 88 | 298,-1 89 | 299,-1 90 | 286,-1 91 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 2 | ["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); 3 | -------------------------------------------------------------------------------- /static/docs/locales/zh.js: -------------------------------------------------------------------------------- 1 | define({ 2 | zh: { 3 | 'Allowed values​​:' : '允許值:', 4 | 'Compare all with predecessor': '預先比較所有', 5 | 'compare changes to:' : '比較變更:', 6 | 'compared to' : '對比', 7 | 'Default value:' : '默認值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概括', 11 | 'Generated with' : '生成工具', 12 | 'Name' : '名稱', 13 | 'No response values​​.' : '無對應資料.', 14 | 'optional' : '選項', 15 | 'Parameter' : '參數', 16 | 'Permission:' : '允許:', 17 | 'Response' : '回應', 18 | 'Send' : '發送', 19 | 'Send a Sample Request' : '發送試用需求', 20 | 'show up to version:' : '顯示到版本:', 21 | 'Size range:' : '尺寸範圍:', 22 | 'Type' : '類型', 23 | 'url' : '網址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/zh_cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'zh_cn': { 3 | 'Allowed values:' : '允许值:', 4 | 'Compare all with predecessor': '与所有较早的比较', 5 | 'compare changes to:' : '将当前版本与指定版本比较:', 6 | 'compared to' : '相比于', 7 | 'Default value:' : '默认值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概要', 11 | 'Generated with' : '基于', 12 | 'Name' : '名称', 13 | 'No response values.' : '无返回值.', 14 | 'optional' : '可选', 15 | 'Parameter' : '参数', 16 | 'Permission:' : '权限:', 17 | 'Response' : '返回', 18 | 'Send' : '发送', 19 | 'Send a Sample Request' : '发送示例请求', 20 | 'show up to version:' : '显示到指定版本:', 21 | 'Size range:' : '取值范围:', 22 | 'Type' : '类型', 23 | 'url' : '网址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/vendor/path-to-regexp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /static/docs/api_project.json: -------------------------------------------------------------------------------- 1 | { "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-02-15T09:37:33.089Z", "url": "http://apidocjs.com", "version": "0.16.1" } } 2 | -------------------------------------------------------------------------------- /static/docs/api_project.js: -------------------------------------------------------------------------------- 1 | define({ "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-02-15T09:37:33.089Z", "url": "http://apidocjs.com", "version": "0.16.1" } }); 2 | -------------------------------------------------------------------------------- /static/docs/locales/pl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | pl: { 3 | 'Allowed values:' : 'Dozwolone wartości:', 4 | 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 5 | 'compare changes to:' : 'porównaj zmiany do:', 6 | 'compared to' : 'porównaj do:', 7 | 'Default value:' : 'Wartość domyślna:', 8 | 'Description' : 'Opis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Generalnie', 11 | 'Generated with' : 'Wygenerowano z', 12 | 'Name' : 'Nazwa', 13 | 'No response values.' : 'Brak odpowiedzi.', 14 | 'optional' : 'opcjonalny', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Uprawnienia:', 17 | 'Response' : 'Odpowiedź', 18 | 'Send' : 'Wyślij', 19 | 'Send a Sample Request' : 'Wyślij przykładowe żądanie', 20 | 'show up to version:' : 'pokaż do wersji:', 21 | 'Size range:' : 'Zakres rozmiaru:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /apidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "(N)etwork (D)iffusion library REST service", 3 | "version": "2.0.1", 4 | "description": "REST service for the simulation of diffusion models over networks.", 5 | "title": "NDlib REST", 6 | "url": "http://127.0.0.1:5000", 7 | "sampleUrl": "http://127.0.0.1:5000", 8 | "order": [ 9 | "Experiment", 10 | "getexp", 11 | "describeexp", 12 | "resetexp", 13 | "deleteexp", 14 | "configure", 15 | "Exploratory", 16 | "listexploratory", 17 | "loadexploratory", 18 | "Resources", 19 | "getgraphs", 20 | "getnetworks", 21 | "getmodellist", 22 | "destroynetwork", 23 | "deletemodels", 24 | "Networks", 25 | "CompleteGraph", 26 | "ERGraph", 27 | "BAGraph", 28 | "CBAGraph", 29 | "WSGraph", 30 | "PlantedPartition", 31 | "loadgraph", 32 | "upload", 33 | "expgraphs", 34 | "Models", 35 | "si", 36 | "sir", 37 | "sis", 38 | "seis", 39 | "seir", 40 | "threshold", 41 | "KerteszThreshold", 42 | "profile", 43 | "profilethreshold", 44 | "indepcascades", 45 | "voter", 46 | "qvoter", 47 | "majority", 48 | "sznajd", 49 | "AlgorithmicBias", 50 | "dsi", 51 | "dsis", 52 | "dsis", 53 | "Iterators", 54 | "iterator", 55 | "iteratorbunch" 56 | ] 57 | } 58 | -------------------------------------------------------------------------------- /static/docs/locales/ca.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ca: { 3 | 'Allowed values:' : 'Valors permesos:', 4 | 'Compare all with predecessor': 'Comparar tot amb versió anterior', 5 | 'compare changes to:' : 'comparar canvis amb:', 6 | 'compared to' : 'comparat amb', 7 | 'Default value:' : 'Valor per defecte:', 8 | 'Description' : 'Descripció', 9 | 'Field' : 'Camp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat amb', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Sense valors en la resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Paràmetre', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petició d\'exemple', 20 | 'show up to version:' : 'mostrar versió:', 21 | 'Size range:' : 'Tamany de rang:', 22 | 'Type' : 'Tipus', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/de.js: -------------------------------------------------------------------------------- 1 | define({ 2 | de: { 3 | 'Allowed values:' : 'Erlaubte Werte:', 4 | 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 5 | 'compare changes to:' : 'vergleiche Änderungen mit:', 6 | 'compared to' : 'verglichen mit', 7 | 'Default value:' : 'Standardwert:', 8 | 'Description' : 'Beschreibung', 9 | 'Field' : 'Feld', 10 | 'General' : 'Allgemein', 11 | 'Generated with' : 'Erstellt mit', 12 | 'Name' : 'Name', 13 | 'No response values.' : 'Keine Rückgabewerte.', 14 | 'optional' : 'optional', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Berechtigung:', 17 | 'Response' : 'Antwort', 18 | 'Send' : 'Senden', 19 | 'Send a Sample Request' : 'Eine Beispielanfrage senden', 20 | 'show up to version:' : 'zeige bis zur Version:', 21 | 'Size range:' : 'Größenbereich:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/pt_br.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'pt_br': { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Compare todos com antecessores', 5 | 'compare changes to:' : 'comparar alterações com:', 6 | 'compared to' : 'comparado com', 7 | 'Default value:' : 'Valor padrão:', 8 | 'Description' : 'Descrição', 9 | 'Field' : 'Campo', 10 | 'General' : 'Geral', 11 | 'Generated with' : 'Gerado com', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Sem valores de resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parâmetro', 16 | 'Permission:' : 'Permissão:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 20 | 'show up to version:' : 'aparecer para a versão:', 21 | 'Size range:' : 'Faixa de tamanho:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/ru.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ru: { 3 | 'Allowed values:' : 'Допустимые значения:', 4 | 'Compare all with predecessor': 'Сравнить с предыдущей версией', 5 | 'compare changes to:' : 'сравнить с:', 6 | 'compared to' : 'в сравнении с', 7 | 'Default value:' : 'По умолчанию:', 8 | 'Description' : 'Описание', 9 | 'Field' : 'Название', 10 | 'General' : 'Общая информация', 11 | 'Generated with' : 'Сгенерировано с помощью', 12 | 'Name' : 'Название', 13 | 'No response values.' : 'Нет значений для ответа.', 14 | 'optional' : 'необязательный', 15 | 'Parameter' : 'Параметр', 16 | 'Permission:' : 'Разрешено:', 17 | 'Response' : 'Ответ', 18 | 'Send' : 'Отправить', 19 | 'Send a Sample Request' : 'Отправить тестовый запрос', 20 | 'show up to version:' : 'показать версию:', 21 | 'Size range:' : 'Ограничения:', 22 | 'Type' : 'Тип', 23 | 'url' : 'URL' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/es.js: -------------------------------------------------------------------------------- 1 | define({ 2 | es: { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Comparar todo con versión anterior', 5 | 'compare changes to:' : 'comparar cambios con:', 6 | 'compared to' : 'comparado con', 7 | 'Default value:' : 'Valor por defecto:', 8 | 'Description' : 'Descripción', 9 | 'Field' : 'Campo', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generado con', 12 | 'Name' : 'Nombre', 13 | 'No response values.' : 'Sin valores en la respuesta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parámetro', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Respuesta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petición de ejemplo', 20 | 'show up to version:' : 'mostrar a versión:', 21 | 'Size range:' : 'Tamaño de rango:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/nl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | nl: { 3 | 'Allowed values:' : 'Toegestane waarden:', 4 | 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 5 | 'compare changes to:' : 'vergelijk veranderingen met:', 6 | 'compared to' : 'vergelijk met', 7 | 'Default value:' : 'Standaard waarde:', 8 | 'Description' : 'Omschrijving', 9 | 'Field' : 'Veld', 10 | 'General' : 'Algemeen', 11 | 'Generated with' : 'Gegenereerd met', 12 | 'Name' : 'Naam', 13 | 'No response values.' : 'Geen response waardes.', 14 | 'optional' : 'optioneel', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Permissie:', 17 | 'Response' : 'Antwoorden', 18 | 'Send' : 'Sturen', 19 | 'Send a Sample Request' : 'Stuur een sample aanvragen', 20 | 'show up to version:' : 'toon tot en met versie:', 21 | 'Size range:' : 'Maatbereik:', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/fr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | fr: { 3 | 'Allowed values:' : 'Valeurs autorisées :', 4 | 'Compare all with predecessor': 'Tout comparer avec ...', 5 | 'compare changes to:' : 'comparer les changements à :', 6 | 'compared to' : 'comparer à', 7 | 'Default value:' : 'Valeur par défaut :', 8 | 'Description' : 'Description', 9 | 'Field' : 'Champ', 10 | 'General' : 'Général', 11 | 'Generated with' : 'Généré avec', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Aucune valeur de réponse.', 14 | 'optional' : 'optionnel', 15 | 'Parameter' : 'Paramètre', 16 | 'Permission:' : 'Permission :', 17 | 'Response' : 'Réponse', 18 | 'Send' : 'Envoyer', 19 | 'Send a Sample Request' : 'Envoyer une requête représentative', 20 | 'show up to version:' : 'Montrer à partir de la version :', 21 | 'Size range:' : 'Ordre de grandeur :', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/it.js: -------------------------------------------------------------------------------- 1 | define({ 2 | it: { 3 | 'Allowed values:' : 'Valori permessi:', 4 | 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 5 | 'compare changes to:' : 'confronta modifiche con:', 6 | 'compared to' : 'confrontato con', 7 | 'Default value:' : 'Valore predefinito:', 8 | 'Description' : 'Descrizione', 9 | 'Field' : 'Campo', 10 | 'General' : 'Generale', 11 | 'Generated with' : 'Creato con', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Nessnu valore di risposta.', 14 | 'optional' : 'opzionale', 15 | 'Parameter' : 'Parametro', 16 | 'Permission:' : 'Permessi:', 17 | 'Response' : 'Risposta', 18 | 'Send' : 'Invia', 19 | 'Send a Sample Request' : 'Invia una richiesta di esempio', 20 | 'show up to version:' : 'visualizza la versione:', 21 | 'Size range:' : 'Intervallo dimensione:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /static/docs/locales/locale.js: -------------------------------------------------------------------------------- 1 | define([ 2 | './locales/ca.js', 3 | './locales/de.js', 4 | './locales/es.js', 5 | './locales/fr.js', 6 | './locales/it.js', 7 | './locales/nl.js', 8 | './locales/pl.js', 9 | './locales/pt_br.js', 10 | './locales/ru.js', 11 | './locales/zh.js', 12 | './locales/zh_cn.js' 13 | ], function() { 14 | var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); 15 | var language = langId.substr(0, 2); 16 | var locales = {}; 17 | 18 | for (index in arguments) { 19 | for (property in arguments[index]) 20 | locales[property] = arguments[index][property]; 21 | } 22 | if ( ! locales['en']) 23 | locales['en'] = {}; 24 | 25 | if ( ! locales[langId] && ! locales[language]) 26 | language = 'en'; 27 | 28 | var locale = (locales[langId] ? locales[langId] : locales[language]); 29 | 30 | function __(text) { 31 | var index = locale[text]; 32 | if (index === undefined) 33 | return text; 34 | return index; 35 | }; 36 | 37 | function setLanguage(language) { 38 | locale = locales[language]; 39 | } 40 | 41 | return { 42 | __ : __, 43 | locales : locales, 44 | locale : locale, 45 | setLanguage: setLanguage 46 | }; 47 | }); 48 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /resources/exploratories.json: -------------------------------------------------------------------------------- 1 | { 2 | "exploratory": 3 | [ 4 | { 5 | "name": "ToyCore_Com", 6 | "network": "ToyCore", 7 | "node_initial_status": ["infected"], 8 | "description": "Initial status of nodes, community outbreak (Threshold model)" 9 | }, 10 | { 11 | "name": "ToyPeri_Com", 12 | "network": "ToyPeri", 13 | "node_initial_status": ["infected"], 14 | "description": "Initial status of nodes, global outbreak (Threshold model)" 15 | }, 16 | { 17 | "name": "ClusteredBA_top", 18 | "network": "ClusteredBA", 19 | "node_initial_status": ["blocked"], 20 | "description": "Initial status of the 30%-top degree nodes is set to blocked (Kertesz Threshold)" 21 | }, 22 | { 23 | "name": "ClusteredBA_bottom", 24 | "network": "ClusteredBA", 25 | "node_initial_status": ["blocked"], 26 | "description": "Initial status of the 30%-bottom degree nodes is set to blocked (Kertesz Threshold)" 27 | }, 28 | { 29 | "name": "ClusteredBA_random", 30 | "network": "ClusteredBA", 31 | "node_initial_status": ["blocked"], 32 | "description": "Initial status: 30% of randomly chosen nodes are blocked (Kertesz Threshold)" 33 | }, 34 | { 35 | "name": "CogOp_1", 36 | "network": "CogOp", 37 | "description": "Network having powerlaw degree distribution with exponent b=1.6 (Cognitive Opinion Dynamic)" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 2 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 3 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); 4 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | env/ 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *,cover 49 | .hypothesis/ 50 | 51 | # Translations 52 | *.mo 53 | *.pot 54 | 55 | # Django stuff: 56 | *.log 57 | local_settings.py 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # dotenv 85 | .env 86 | 87 | # virtualenv 88 | .venv 89 | venv/ 90 | ENV/ 91 | 92 | # Spyder project settings 93 | .spyderproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | -------------------------------------------------------------------------------- /static/assets/css/ie8.css: -------------------------------------------------------------------------------- 1 | /* 2 | ndlib by HTML5 UP 3 | html5up.net | @n33co 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | form input[type="text"], 8 | form input[type="email"], 9 | form input[type="password"], 10 | form select, 11 | form textarea { 12 | position: relative; 13 | box-shadow: none !important; 14 | -ms-behavior: url("assets/js/ie/PIE.htc");} 15 | 16 | input[type="button"], 17 | input[type="submit"], 18 | input[type="reset"], 19 | button, 20 | .button { 21 | position: relative; 22 | box-shadow: none !important; 23 | -ms-behavior: url("assets/js/ie/PIE.htc");} 24 | 25 | .pagination .pages a { 26 | position: relative; 27 | box-shadow: none !important; 28 | -ms-behavior: url("assets/js/ie/PIE.htc"); 29 | } 30 | 31 | .box.calendar td a, .box.calendar td span { 32 | position: relative; 33 | box-shadow: none !important; 34 | -ms-behavior: url("assets/js/ie/PIE.htc"); 35 | } 36 | 37 | .box.text-style1 .inner { 38 | position: relative; 39 | box-shadow: none !important; 40 | -ms-behavior: url("assets/js/ie/PIE.htc"); 41 | } 42 | 43 | #nav li a { 44 | position: relative; 45 | box-shadow: none !important; 46 | -ms-behavior: url("assets/js/ie/PIE.htc"); 47 | } 48 | 49 | .box.post .info { 50 | box-shadow: none !important; 51 | -ms-behavior: url("assets/js/ie/PIE.htc"); 52 | } 53 | 54 | .box.post .info .stats li a { 55 | position: relative; 56 | box-shadow: none !important; 57 | -ms-behavior: url("assets/js/ie/PIE.htc"); 58 | } 59 | 60 | #logo { 61 | position: relative; 62 | box-shadow: none !important; 63 | -ms-behavior: url("assets/js/ie/PIE.htc"); 64 | } -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 2 | null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, 2 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); 3 | -------------------------------------------------------------------------------- /static/assets/sass/libs/_mixins.scss: -------------------------------------------------------------------------------- 1 | /// Makes an element's :before pseudoelement a FontAwesome icon. 2 | /// @param {string} $content Optional content value to use. 3 | /// @param {string} $where Optional pseudoelement to target (before or after). 4 | @mixin icon($content: false, $where: before) { 5 | 6 | text-decoration: none; 7 | 8 | &:#{$where} { 9 | 10 | @if $content { 11 | content: $content; 12 | } 13 | 14 | -moz-osx-font-smoothing: grayscale; 15 | -webkit-font-smoothing: antialiased; 16 | font-family: FontAwesome; 17 | font-style: normal; 18 | font-weight: normal; 19 | text-transform: none !important; 20 | 21 | } 22 | 23 | } 24 | 25 | /// Applies padding to an element, taking the current element-margin value into account. 26 | /// @param {mixed} $tb Top/bottom padding. 27 | /// @param {mixed} $lr Left/right padding. 28 | /// @param {list} $pad Optional extra padding (in the following order top, right, bottom, left) 29 | /// @param {bool} $important If true, adds !important. 30 | @mixin padding($tb, $lr, $pad: (0,0,0,0), $important: null) { 31 | 32 | @if $important { 33 | $important: '!important'; 34 | } 35 | 36 | padding: ($tb + nth($pad,1)) ($lr + nth($pad,2)) max(0.1em, $tb - _size(element-margin) + nth($pad,3)) ($lr + nth($pad,4)) #{$important}; 37 | 38 | } 39 | 40 | /// Encodes a SVG data URL so IE doesn't choke (via codepen.io/jakob-e/pen/YXXBrp). 41 | /// @param {string} $svg SVG data URL. 42 | /// @return {string} Encoded SVG data URL. 43 | @function svg-url($svg) { 44 | 45 | $svg: str-replace($svg, '"', '\''); 46 | $svg: str-replace($svg, '<', '%3C'); 47 | $svg: str-replace($svg, '>', '%3E'); 48 | $svg: str-replace($svg, '&', '%26'); 49 | $svg: str-replace($svg, '#', '%23'); 50 | $svg: str-replace($svg, '{', '%7B'); 51 | $svg: str-replace($svg, '}', '%7D'); 52 | $svg: str-replace($svg, ';', '%3B'); 53 | 54 | @return url("data:image/svg+xml;charset=utf8,#{$svg}"); 55 | 56 | } -------------------------------------------------------------------------------- /static/docs/vendor/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | /* Vim sunburst theme by David Leibovic */ 3 | pre .str { 4 | color: #65B042; 5 | } 6 | /* string - green */ 7 | pre .kwd { 8 | color: #E28964; 9 | } 10 | /* keyword - dark pink */ 11 | pre .com { 12 | color: #AEAEAE; 13 | font-style: italic; 14 | } 15 | /* comment - gray */ 16 | pre .typ { 17 | color: #89bdff; 18 | } 19 | /* type - light blue */ 20 | pre .lit { 21 | color: #3387CC; 22 | } 23 | /* literal - blue */ 24 | pre .pun { 25 | color: #fff; 26 | } 27 | /* punctuation - white */ 28 | pre .pln { 29 | color: #fff; 30 | } 31 | /* plaintext - white */ 32 | pre .tag { 33 | color: #89bdff; 34 | } 35 | /* html/xml tag - light blue */ 36 | pre .atn { 37 | color: #bdb76b; 38 | } 39 | /* html/xml attribute name - khaki */ 40 | pre .atv { 41 | color: #65B042; 42 | } 43 | /* html/xml attribute value - green */ 44 | pre .dec { 45 | color: #3387CC; 46 | } 47 | /* decimal - blue */ 48 | /* Specify class=linenums on a pre to get line numbering */ 49 | ol.linenums { 50 | margin-top: 0; 51 | margin-bottom: 0; 52 | color: #AEAEAE; 53 | } 54 | /* IE indents via margin-left */ 55 | li.L0, 56 | li.L1, 57 | li.L2, 58 | li.L3, 59 | li.L5, 60 | li.L6, 61 | li.L7, 62 | li.L8 { 63 | list-style-type: none; 64 | } 65 | /* Alternate shading for lines */ 66 | @media print { 67 | pre .str { 68 | color: #060; 69 | } 70 | pre .kwd { 71 | color: #006; 72 | font-weight: bold; 73 | } 74 | pre .com { 75 | color: #600; 76 | font-style: italic; 77 | } 78 | pre .typ { 79 | color: #404; 80 | font-weight: bold; 81 | } 82 | pre .lit { 83 | color: #044; 84 | } 85 | pre .pun { 86 | color: #440; 87 | } 88 | pre .pln { 89 | color: #000; 90 | } 91 | pre .tag { 92 | color: #006; 93 | font-weight: bold; 94 | } 95 | pre .atn { 96 | color: #404; 97 | } 98 | pre .atv { 99 | color: #060; 100 | } 101 | } -------------------------------------------------------------------------------- /static/assets/sass/ie8.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/vars'; 2 | @import 'libs/functions'; 3 | @import 'libs/mixins'; 4 | @import 'libs/skel'; 5 | 6 | /* 7 | Striped by HTML5 UP 8 | html5up.net | @n33co 9 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 10 | */ 11 | 12 | form { 13 | input[type="text"], 14 | input[type="email"], 15 | input[type="password"], 16 | select, 17 | textarea { 18 | position: relative; 19 | box-shadow: none !important; 20 | -ms-behavior: url('assets/js/ie/PIE.htc'); 21 | } 22 | } 23 | 24 | input[type="button"], 25 | input[type="submit"], 26 | input[type="reset"], 27 | button, 28 | .button { 29 | position: relative; 30 | box-shadow: none !important; 31 | -ms-behavior: url('assets/js/ie/PIE.htc'); 32 | } 33 | 34 | .pagination { 35 | .pages { 36 | a { 37 | position: relative; 38 | box-shadow: none !important; 39 | -ms-behavior: url('assets/js/ie/PIE.htc'); 40 | } 41 | } 42 | } 43 | 44 | .box { 45 | &.calendar { 46 | td { 47 | a, span { 48 | position: relative; 49 | box-shadow: none !important; 50 | -ms-behavior: url('assets/js/ie/PIE.htc'); 51 | } 52 | } 53 | } 54 | 55 | &.text-style1 { 56 | .inner { 57 | position: relative; 58 | box-shadow: none !important; 59 | -ms-behavior: url('assets/js/ie/PIE.htc'); 60 | } 61 | } 62 | } 63 | 64 | #nav { 65 | li { 66 | a { 67 | position: relative; 68 | box-shadow: none !important; 69 | -ms-behavior: url('assets/js/ie/PIE.htc'); 70 | } 71 | } 72 | } 73 | 74 | .box { 75 | &.post { 76 | .info { 77 | box-shadow: none !important; 78 | -ms-behavior: url('assets/js/ie/PIE.htc'); 79 | 80 | .stats { 81 | li { 82 | a { 83 | position: relative; 84 | box-shadow: none !important; 85 | -ms-behavior: url('assets/js/ie/PIE.htc'); 86 | } 87 | } 88 | } 89 | } 90 | } 91 | } 92 | 93 | #logo { 94 | position: relative; 95 | box-shadow: none !important; 96 | -ms-behavior: url('assets/js/ie/PIE.htc'); 97 | } -------------------------------------------------------------------------------- /static/assets/js/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | Striped by HTML5 UP 3 | html5up.net | @n33co 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | (function($) { 8 | 9 | skel.breakpoints({ 10 | desktop: '(min-width: 737px)', 11 | wide: '(min-width: 1201px)', 12 | narrow: '(min-width: 737px) and (max-width: 1200px)', 13 | narrower: '(min-width: 737px) and (max-width: 1000px)', 14 | mobile: '(max-width: 736px)' 15 | }); 16 | 17 | $(function() { 18 | 19 | var $window = $(window), 20 | $body = $('body'), 21 | $document = $(document); 22 | 23 | // Disable animations/transitions until the page has loaded. 24 | $body.addClass('is-loading'); 25 | 26 | $window.on('load', function() { 27 | $body.removeClass('is-loading'); 28 | }); 29 | 30 | // Fix: Placeholder polyfill. 31 | $('form').placeholder(); 32 | 33 | // Prioritize "important" elements on mobile. 34 | skel.on('+mobile -mobile', function() { 35 | $.prioritize( 36 | '.important\\28 mobile\\29', 37 | skel.breakpoint('mobile').active 38 | ); 39 | }); 40 | 41 | // Off-Canvas Sidebar. 42 | 43 | // Height hack. 44 | var $sc = $('#sidebar, #content'), tid; 45 | 46 | $window 47 | .on('resize', function() { 48 | window.clearTimeout(tid); 49 | tid = window.setTimeout(function() { 50 | $sc.css('min-height', $document.height()); 51 | }, 100); 52 | }) 53 | .on('load', function() { 54 | $window.trigger('resize'); 55 | }) 56 | .trigger('resize'); 57 | 58 | // Title Bar. 59 | $( 60 | '
' + 61 | '' + 62 | '' + $('#logo').html() + '' + 63 | '
' 64 | ) 65 | .appendTo($body); 66 | 67 | // Sidebar 68 | $('#sidebar') 69 | .panel({ 70 | delay: 500, 71 | hideOnClick: true, 72 | hideOnSwipe: true, 73 | resetScroll: true, 74 | resetForms: true, 75 | side: 'left', 76 | target: $body, 77 | visibleClass: 'sidebar-visible' 78 | }); 79 | 80 | // Fix: Remove navPanel transitions on WP<10 (poor/buggy performance). 81 | if (skel.vars.os == 'wp' && skel.vars.osVersion < 10) 82 | $('#titleBar, #sidebar, #main') 83 | .css('transition', 'none'); 84 | 85 | }); 86 | 87 | })(jQuery); -------------------------------------------------------------------------------- /static/assets/js/ie/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d>> 0; 61 | 62 | // 4. If IsCallable(callback) is false, throw a TypeError exception. 63 | // See: http://es5.github.com/#x9.11 64 | if (typeof callback !== "function") { 65 | throw new TypeError(callback + " is not a function"); 66 | } 67 | 68 | // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. 69 | if (arguments.length > 1) { 70 | T = thisArg; 71 | } 72 | 73 | // 6. Let k be 0 74 | k = 0; 75 | 76 | // 7. Repeat, while k < len 77 | while (k < len) { 78 | 79 | var kValue; 80 | 81 | // a. Let Pk be ToString(k). 82 | // This is implicit for LHS operands of the in operator 83 | // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. 84 | // This step can be combined with c 85 | // c. If kPresent is true, then 86 | if (k in O) { 87 | 88 | // i. Let kValue be the result of calling the Get internal method of O with argument Pk. 89 | kValue = O[k]; 90 | 91 | // ii. Call the Call internal method of callback with T as the this value and 92 | // argument list containing kValue, k, and O. 93 | callback.call(T, kValue, k, O); 94 | } 95 | // d. Increase k by 1. 96 | k++; 97 | } 98 | // 8. return undefined 99 | }; 100 | } 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NDlib-Rest - Network Diffusion Library REST Service. 2 | [![Build Status](https://travis-ci.org/GiulioRossetti/ndlib-rest.svg?branch=master)](https://travis-ci.org/GiulioRossetti/ndlib-rest) 3 | 4 | This project offers a REST interface for the [ndlib](https://github.com/GiulioRossetti/ndlib) Python library. 5 | 6 | 7 | #### Tools 8 | * REST service: ndrest.py 9 | * Web API docs: http://127.0.0.1:5000/docs 10 | * Unittest: ndlib-rest/service_test 11 | * Python REST client: ndlib-rest/client 12 | 13 | 14 | Python 3.6 required dependencies: 15 | 16 | - [ndlib](https://github.com/GiulioRossetti/ndlib)==4.0.2 17 | - flask==0.12 18 | - flask-cors==3.0.2 19 | - flask_restful==0.3.5 20 | - flask_apidoc==1.0.0 21 | - networkx==1.11 22 | - numpy==1.12.0 23 | - scipy==0.18.1 24 | - [dynetx](https://github.com/GiulioRossetti/dynetx)==0.1.6 25 | 26 | #### REST service setup 27 | Local testing 28 | ```python 29 | python ndrest.py 30 | ``` 31 | 32 | Local testig with multiple workers (using [gunicorn](http://gunicorn.org/) web server): 33 | ```bash 34 | gunicorn -w num_workers -b 127.0.0.1:5000 ndrest:app 35 | ``` 36 | 37 | In order to change the binding IP/port modify the apidoc.json file. 38 | To update the API page run the command: 39 | ``` 40 | apidoc -i ndlib-rest/ -o ndlib-rest/static/docs 41 | ``` 42 | 43 | 44 | #### Docker Container 45 | The web application (REST service and Viz framework) is shipped as a [Docker](https://www.docker.com/) container. 46 | You can use the Dockerfile to create a new image and run the web application using the gunicorn application server. 47 | 48 | To create the Docker image, install Docker on your machine. 49 | To create the image execute the following command from the local copy of the repository 50 | 51 | ``` 52 | docker build -t [tagname_for_your_image] . 53 | ``` 54 | The command create a new image with the specified name. Pay attention to the ```.``` a the end of the command. 55 | 56 | ``` 57 | docker run -d -i -p 5000:5000 -p 8080:8080 [tagname_for_your_image] 58 | ``` 59 | This command execute a container with the previous image, bind the local port 5000 to the internal port of the container. 60 | The option ```-d``` make the container to run in the background (detached) 61 | 62 | To have a list of all active container 63 | ``` 64 | docker ps -al 65 | ``` 66 | 67 | To stop a container 68 | 69 | ``` 70 | docker stop container_name 71 | ``` 72 | ##### Prebuilt Docker image 73 | 74 | To avoid docker image building just download the full container (beta version) 75 | 76 | ``` 77 | docker pull rossetti/ndrest:ndrest_beta 78 | ``` 79 | 80 | Once the image is ready run it as: 81 | 82 | ``` 83 | docker run -d -i -p 5000:5000 -p 8080:8080 rossetti/ndrest:ndrest_beta 84 | ``` 85 | 86 | ## REST service details 87 | In ndrest.py are specified limits for graph sizes. 88 | In particular it describes the minimum and maximum numbers of nodes (for both generators and loaded networks) as well as the maximum file sizes for upload. 89 | 90 | ```python 91 | app.config['MAX_CONTENT_LENGTH'] = 50 * 1024 * 1024 # 50MB limit for uploads 92 | max_number_of_nodes = 100000 93 | min_number_of_nodes = 200 # inherited by networkx 94 | ``` 95 | 96 | - The "complete graph generator" endpoint represents the only exception to the specified lower bound on number of nodes: such model lowers the minimum to 100 nodes. Indeed, the suggested limits can be increased to handle bigger graphs. 97 | - When loading external graphs nodes MUST be identified by integer ids. 98 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## [To Add] 5 | - Dynamic Graph generator 6 | - Dynamic Graph upload/load 7 | 8 | ## [2.0.0] 9 | ### Added 10 | - Python 3 support 11 | - Dynamic Network Support 12 | - Models 13 | - Dynamic SI 14 | - Dynamic SIS 15 | - Dynamic SIR 16 | 17 | ## [1.0.0] 18 | ### Added 19 | - Models 20 | - SEIS 21 | - SEIR 22 | 23 | ### Updated 24 | - Diffusion Library update: ndlib 2.x.x 25 | 26 | 27 | ## [0.9.2] 28 | ### Added 29 | - Networks 30 | - Planted l-partition 31 | - Clustered Barabàsi-Albert 32 | - Exploratories 33 | - ToyCore: local (community) outbreak 34 | - ToyPeri: global outbreak 35 | - ClusteredBA_top: Kertesz Threshold test (10%-high degree nodes blocked) 36 | - ClusteredBA_bottom: Kertesz Threshold test (10%-low degree nodes blocked) 37 | - CogOp: network having powerlaw degree distribution with exponent b=1.6 38 | - Request Logging 39 | 40 | ### Removed 41 | - Iterators 42 | - Complete Run 43 | 44 | ### Updated 45 | - Tools 46 | - Python REST client (support for the new models, networks and exploratories) 47 | 48 | ### Changed 49 | - Experiment Persistency Model (refactoring) 50 | - Models 51 | - Removed ad-hoc implementations: Models are now available through [ndlib](https://github.com/GiulioRossetti/ndlib) package 52 | 53 | ## [0.9.1] 54 | ### Added 55 | - Models 56 | - Kertesz Threshold 57 | - Cognitive Opinion Dynamics 58 | - Installation 59 | - Docker Setup 60 | 61 | ## [0.9.0] 62 | ### Added 63 | - Networks 64 | - Complete Graphs 65 | - Models 66 | - QVoter 67 | - Resources 68 | - Upload Graph (JSON) 69 | - Iterators 70 | - Incremental updates 71 | 72 | ### Changed 73 | - File upload/download limit (50MB) 74 | - Experiment Persistency Model 75 | 76 | ## [0.8.0] 77 | ### Updated 78 | - Experiment Persistence Handling: form unique db to individual dbs 79 | 80 | ### Added 81 | - Access Control Allow Origin header 82 | 83 | 84 | ## [0.7.0] 85 | ### Added 86 | - Models 87 | - Voter 88 | - Majority Rule 89 | - Sznajd 90 | 91 | 92 | ### Updated 93 | - Tools 94 | - Python REST client (support for the new models) 95 | 96 | 97 | ## [0.6.0] 98 | ### Added 99 | - Exploratory 100 | - List Exploratories 101 | - Get Configuration 102 | - Tools 103 | - Python REST client 104 | 105 | 106 | ### Changed 107 | - Adoption of flask-shelve for experiment persistence 108 | - Enabling support for multi-threaded web server 109 | 110 | 111 | ## [0.5.0] 112 | ### Added 113 | - Experiment 114 | - Advanced Configuration 115 | - Networks 116 | - Get Network 117 | 118 | 119 | ## [0.4.0] 120 | ### Added 121 | - Resources 122 | - Real Network Endpoint List 123 | - Network Destroy 124 | - Networks 125 | - Load Real Graph 126 | 127 | 128 | ## [0.3.0] 129 | ### Added 130 | - Networks 131 | - Watts-Strogatz 132 | - Models 133 | - Profile 134 | - Profile-Threshold 135 | 136 | 137 | ## [0.2.0] 138 | ### Added 139 | - Networks 140 | - Barabasi-Albert 141 | - Models 142 | - SI 143 | - SIS 144 | - SIR 145 | - Iterators 146 | - Complete Run 147 | 148 | 149 | ## [0.1.0] 150 | ### Added 151 | - Experiment 152 | - Create, Describe, Reset, Destroy 153 | - Resources 154 | - Models Endpoint List 155 | - Network Generators Endpoint List 156 | - Models Destroy 157 | - Networks 158 | - Erdos-Renyi 159 | - Models 160 | - Threshold 161 | - Iterators 162 | - Single Iteration 163 | - Iteration Bunch 164 | -------------------------------------------------------------------------------- /static/assets/js/ie/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill 2 | * Copyright 2014 Scott Jehl 3 | * Licensed under MIT 4 | * http://j.mp/respondjs */ 5 | 6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b ["/", "test", "\d+", undefined, "?"] 23 | // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined] 24 | '([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?', 25 | // Match regexp special characters that are always escaped. 26 | '([.+*?=^!:${}()[\\]|\\/])' 27 | ].join('|'), 'g'); 28 | 29 | /** 30 | * Escape the capturing group by escaping special characters and meaning. 31 | * 32 | * @param {String} group 33 | * @return {String} 34 | */ 35 | function escapeGroup (group) { 36 | return group.replace(/([=!:$\/()])/g, '\\$1'); 37 | } 38 | 39 | /** 40 | * Attach the keys as a property of the regexp. 41 | * 42 | * @param {RegExp} re 43 | * @param {Array} keys 44 | * @return {RegExp} 45 | */ 46 | function attachKeys (re, keys) { 47 | re.keys = keys; 48 | return re; 49 | } 50 | 51 | /** 52 | * Get the flags for a regexp from the options. 53 | * 54 | * @param {Object} options 55 | * @return {String} 56 | */ 57 | function flags (options) { 58 | return options.sensitive ? '' : 'i'; 59 | } 60 | 61 | /** 62 | * Pull out keys from a regexp. 63 | * 64 | * @param {RegExp} path 65 | * @param {Array} keys 66 | * @return {RegExp} 67 | */ 68 | function regexpToRegexp (path, keys) { 69 | // Use a negative lookahead to match only capturing groups. 70 | var groups = path.source.match(/\((?!\?)/g); 71 | 72 | if (groups) { 73 | for (var i = 0; i < groups.length; i++) { 74 | keys.push({ 75 | name: i, 76 | delimiter: null, 77 | optional: false, 78 | repeat: false 79 | }); 80 | } 81 | } 82 | 83 | return attachKeys(path, keys); 84 | } 85 | 86 | /** 87 | * Transform an array into a regexp. 88 | * 89 | * @param {Array} path 90 | * @param {Array} keys 91 | * @param {Object} options 92 | * @return {RegExp} 93 | */ 94 | function arrayToRegexp (path, keys, options) { 95 | var parts = []; 96 | 97 | for (var i = 0; i < path.length; i++) { 98 | parts.push(pathToRegexp(path[i], keys, options).source); 99 | } 100 | 101 | var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); 102 | return attachKeys(regexp, keys); 103 | } 104 | 105 | /** 106 | * Replace the specific tags with regexp strings. 107 | * 108 | * @param {String} path 109 | * @param {Array} keys 110 | * @return {String} 111 | */ 112 | function replacePath (path, keys) { 113 | var index = 0; 114 | 115 | function replace (_, escaped, prefix, key, capture, group, suffix, escape) { 116 | if (escaped) { 117 | return escaped; 118 | } 119 | 120 | if (escape) { 121 | return '\\' + escape; 122 | } 123 | 124 | var repeat = suffix === '+' || suffix === '*'; 125 | var optional = suffix === '?' || suffix === '*'; 126 | 127 | keys.push({ 128 | name: key || index++, 129 | delimiter: prefix || '/', 130 | optional: optional, 131 | repeat: repeat 132 | }); 133 | 134 | prefix = prefix ? ('\\' + prefix) : ''; 135 | capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?'); 136 | 137 | if (repeat) { 138 | capture = capture + '(?:' + prefix + capture + ')*'; 139 | } 140 | 141 | if (optional) { 142 | return '(?:' + prefix + '(' + capture + '))?'; 143 | } 144 | 145 | // Basic parameter support. 146 | return prefix + '(' + capture + ')'; 147 | } 148 | 149 | return path.replace(PATH_REGEXP, replace); 150 | } 151 | 152 | /** 153 | * Normalize the given path string, returning a regular expression. 154 | * 155 | * An empty array can be passed in for the keys, which will hold the 156 | * placeholder key descriptions. For example, using `/user/:id`, `keys` will 157 | * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. 158 | * 159 | * @param {(String|RegExp|Array)} path 160 | * @param {Array} [keys] 161 | * @param {Object} [options] 162 | * @return {RegExp} 163 | */ 164 | function pathToRegexp (path, keys, options) { 165 | keys = keys || []; 166 | 167 | if (!isArray(keys)) { 168 | options = keys; 169 | keys = []; 170 | } else if (!options) { 171 | options = {}; 172 | } 173 | 174 | if (path instanceof RegExp) { 175 | return regexpToRegexp(path, keys, options); 176 | } 177 | 178 | if (isArray(path)) { 179 | return arrayToRegexp(path, keys, options); 180 | } 181 | 182 | var strict = options.strict; 183 | var end = options.end !== false; 184 | var route = replacePath(path, keys); 185 | var endsWithSlash = path.charAt(path.length - 1) === '/'; 186 | 187 | // In non-strict mode we allow a slash at the end of match. If the path to 188 | // match already ends with a slash, we remove it for consistency. The slash 189 | // is valid at the end of a path match, not in the middle. This is important 190 | // in non-ending mode, where "/test/" shouldn't match "/test//route". 191 | if (!strict) { 192 | route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; 193 | } 194 | 195 | if (end) { 196 | route += '$'; 197 | } else { 198 | // In non-ending mode, we need the capturing groups to match as much as 199 | // possible by using a positive lookahead to the end or next path segment. 200 | route += strict && endsWithSlash ? '' : '(?=\\/|$)'; 201 | } 202 | 203 | return attachKeys(new RegExp('^' + route, flags(options)), keys); 204 | } 205 | -------------------------------------------------------------------------------- /static/docs/utils/send_sample_request.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'jquery' 3 | ], function($) { 4 | 5 | var initDynamic = function() { 6 | // Button send 7 | $(".sample-request-send").off("click"); 8 | $(".sample-request-send").on("click", function(e) { 9 | e.preventDefault(); 10 | var $root = $(this).parents("article"); 11 | var group = $root.data("group"); 12 | var name = $root.data("name"); 13 | var version = $root.data("version"); 14 | sendSampleRequest(group, name, version, $(this).data("sample-request-type")); 15 | }); 16 | 17 | // Button clear 18 | $(".sample-request-clear").off("click"); 19 | $(".sample-request-clear").on("click", function(e) { 20 | e.preventDefault(); 21 | var $root = $(this).parents("article"); 22 | var group = $root.data("group"); 23 | var name = $root.data("name"); 24 | var version = $root.data("version"); 25 | clearSampleRequest(group, name, version); 26 | }); 27 | }; // initDynamic 28 | 29 | function sendSampleRequest(group, name, version, type) 30 | { 31 | var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); 32 | 33 | // Optional header 34 | var header = {}; 35 | $root.find(".sample-request-header:checked").each(function(i, element) { 36 | var group = $(element).data("sample-request-header-group-id"); 37 | $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) { 38 | var key = $(element).data("sample-request-header-name"); 39 | var value = element.value; 40 | if ( ! element.optional && element.defaultValue !== '') { 41 | value = element.defaultValue; 42 | } 43 | header[key] = value; 44 | }); 45 | }); 46 | 47 | // create JSON dictionary of parameters 48 | var param = {}; 49 | var paramType = {}; 50 | $root.find(".sample-request-param:checked").each(function(i, element) { 51 | var group = $(element).data("sample-request-param-group-id"); 52 | $root.find("[data-sample-request-param-group=\"" + group + "\"]").each(function(i, element) { 53 | var key = $(element).data("sample-request-param-name"); 54 | var value = element.value; 55 | if ( ! element.optional && element.defaultValue !== '') { 56 | value = element.defaultValue; 57 | } 58 | param[key] = value; 59 | paramType[key] = $(element).next().text(); 60 | }); 61 | }); 62 | 63 | // grab user-inputted URL 64 | var url = $root.find(".sample-request-url").val(); 65 | 66 | // Insert url parameter 67 | var pattern = pathToRegexp(url, null); 68 | var matches = pattern.exec(url); 69 | for (var i = 1; i < matches.length; i++) { 70 | var key = matches[i].substr(1); 71 | if (param[key] !== undefined) { 72 | url = url.replace(matches[i], encodeURIComponent(param[key])); 73 | 74 | // remove URL parameters from list 75 | delete param[key]; 76 | } 77 | } // for 78 | 79 | $root.find(".sample-request-response").fadeTo(250, 1); 80 | $root.find(".sample-request-response-json").html("Loading..."); 81 | refreshScrollSpy(); 82 | 83 | _.each( param, function( val, key ) { 84 | var t = paramType[ key ].toLowerCase(); 85 | if ( t === 'object' || t === 'array' ) { 86 | try { 87 | param[ key ] = JSON.parse( val ); 88 | } catch (e) { 89 | } 90 | } 91 | }); 92 | 93 | // send AJAX request, catch success or error callback 94 | var ajaxRequest = { 95 | url : url, 96 | headers : header, 97 | data : param, 98 | type : type.toUpperCase(), 99 | success : displaySuccess, 100 | error : displayError 101 | }; 102 | 103 | $.ajax(ajaxRequest); 104 | 105 | 106 | function displaySuccess(data, status, jqXHR) { 107 | var jsonResponse; 108 | try { 109 | jsonResponse = JSON.parse(jqXHR.responseText); 110 | jsonResponse = JSON.stringify(jsonResponse, null, 4); 111 | } catch (e) { 112 | jsonResponse = data; 113 | } 114 | $root.find(".sample-request-response-json").html(jsonResponse); 115 | refreshScrollSpy(); 116 | }; 117 | 118 | function displayError(jqXHR, textStatus, error) { 119 | var message = "Error " + jqXHR.status + ": " + error; 120 | var jsonResponse; 121 | try { 122 | jsonResponse = JSON.parse(jqXHR.responseText); 123 | jsonResponse = JSON.stringify(jsonResponse, null, 4); 124 | } catch (e) { 125 | jsonResponse = escape(jqXHR.responseText); 126 | } 127 | 128 | if (jsonResponse) 129 | message += "
" + jsonResponse; 130 | 131 | // flicker on previous error to make clear that there is a new response 132 | if($root.find(".sample-request-response").is(":visible")) 133 | $root.find(".sample-request-response").fadeTo(1, 0.1); 134 | 135 | $root.find(".sample-request-response").fadeTo(250, 1); 136 | $root.find(".sample-request-response-json").html(message); 137 | refreshScrollSpy(); 138 | }; 139 | } 140 | 141 | function clearSampleRequest(group, name, version) 142 | { 143 | var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); 144 | 145 | // hide sample response 146 | $root.find(".sample-request-response-json").html(""); 147 | $root.find(".sample-request-response").hide(); 148 | 149 | // reset value of parameters 150 | $root.find(".sample-request-param").each(function(i, element) { 151 | element.value = ""; 152 | }); 153 | 154 | // restore default URL 155 | var $urlElement = $root.find(".sample-request-url"); 156 | $urlElement.val($urlElement.prop("defaultValue")); 157 | 158 | refreshScrollSpy(); 159 | } 160 | 161 | function refreshScrollSpy() 162 | { 163 | $('[data-spy="scroll"]').each(function () { 164 | $(this).scrollspy("refresh"); 165 | }); 166 | } 167 | 168 | function escapeHtml(str) { 169 | var div = document.createElement("div"); 170 | div.appendChild(document.createTextNode(str)); 171 | return div.innerHTML; 172 | } 173 | 174 | /** 175 | * Exports. 176 | */ 177 | return { 178 | initDynamic: initDynamic 179 | }; 180 | 181 | }); 182 | -------------------------------------------------------------------------------- /resources/models.json: -------------------------------------------------------------------------------- 1 | { 2 | "endpoints": [ 3 | { 4 | "name": "Threshold", 5 | "uri": "/api/Threshold", 6 | "params": { 7 | "token": "access token", 8 | "infected": "The initial percentage of infected nodes.", 9 | "threshold":"A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution." 10 | }, 11 | "discrete": true, 12 | "statuses": { 13 | "Susceptible": 0, 14 | "Infected": 1 15 | } 16 | }, 17 | { 18 | "name": "SIR", 19 | "uri": "/api/SIR", 20 | "params": { 21 | "token": "access token", 22 | "beta": "Infection rate", 23 | "gamma": "Recovery rate", 24 | "infected": "The initial percentage of infected nodes." 25 | }, 26 | "discrete": true, 27 | "statuses": { 28 | "Susceptible": 0, 29 | "Infected": 1, 30 | "Removed": 2 31 | } 32 | }, 33 | { 34 | "name": "SEIR", 35 | "uri": "/api/SEIR", 36 | "params": { 37 | "token": "access token", 38 | "beta": "Infection rate", 39 | "gamma": "Recovery rate", 40 | "alpha": "Incubation period", 41 | "infected": "The initial percentage of infected nodes." 42 | }, 43 | "discrete": true, 44 | "statuses": { 45 | "Susceptible": 0, 46 | "Infected": 1, 47 | "Removed": 3, 48 | "Exposed": 2 49 | } 50 | }, 51 | { 52 | "name": "SEIS", 53 | "uri": "/api/SEIS", 54 | "params": { 55 | "token": "access token", 56 | "beta": "Infection rate", 57 | "lambda": "Recovery rate", 58 | "alpha": "Incubation period", 59 | "infected": "The initial percentage of infected nodes." 60 | }, 61 | "discrete": true, 62 | "statuses": { 63 | "Susceptible": 0, 64 | "Infected": 1, 65 | "Exposed": 2 66 | } 67 | }, 68 | { 69 | "name": "SWIR", 70 | "uri": "/api/SWIR", 71 | "params": { 72 | "token": "access token", 73 | "kappa": "Infection rate from susceptible state", 74 | "mu": "weakened rate", 75 | "nu": "infection rate from weakened state", 76 | "infected": "The initial percentage of infected nodes." 77 | }, 78 | "discrete": true, 79 | "statuses": { 80 | "Susceptible": 0, 81 | "Infected": 1, 82 | "Weakened": 2, 83 | "Removed": 3 84 | } 85 | }, 86 | { 87 | "name": "SI", 88 | "uri": "/api/SI", 89 | "params": { 90 | "token": "access token", 91 | "beta": "Infection rate", 92 | "infected": "The initial percentage of infected nodes." 93 | }, 94 | "discrete": true, 95 | "statuses": { 96 | "Susceptible": 0, 97 | "Infected": 1 98 | } 99 | }, 100 | { 101 | "name": "SIS", 102 | "uri": "/api/SIS", 103 | "params": { 104 | "token": "access token", 105 | "beta": "Infection rate", 106 | "lambda": "Recovery rate", 107 | "infected": "The initial percentage of infected nodes." 108 | }, 109 | "discrete": true, 110 | "statuses": { 111 | "Susceptible": 0, 112 | "Infected": 1 113 | } 114 | }, 115 | { 116 | "name": "Profile", 117 | "uri": "/api/Profile", 118 | "params": { 119 | "token": "access token", 120 | "profile": "fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.", 121 | "infected": "The initial percentage of infected nodes." 122 | }, 123 | "discrete": true, 124 | "statuses": { 125 | "Susceptible": 0, 126 | "Infected": 1, 127 | "Blocked": -1 128 | } 129 | }, 130 | { 131 | "name": "Profile-Threshold", 132 | "uri": "/api/ProfileThreshold", 133 | "params": { 134 | "token": "access token", 135 | "profile": "2 fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.", 136 | "threshold":"A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.", 137 | "infected": "The initial percentage of infected nodes." 138 | }, 139 | "discrete": true, 140 | "statuses": { 141 | "Susceptible": 0, 142 | "Infected": 1, 143 | "Blocked": -1 144 | } 145 | }, 146 | { 147 | "name": "Independent Cascades", 148 | "uri": "/api/IndependentCascades", 149 | "params": { 150 | "token": "access token", 151 | "infected": "The initial percentage of infected nodes." 152 | }, 153 | "discrete": true, 154 | "statuses": { 155 | "Susceptible": 0, 156 | "Infected": 1, 157 | "Removed": 2 158 | } 159 | }, 160 | { 161 | "name": "Voter", 162 | "uri": "/api/Voter", 163 | "params": { 164 | "token": "access token", 165 | "infected": "The initial percentage of infected nodes." 166 | }, 167 | "discrete": true, 168 | "statuses": { 169 | "Susceptible": 0, 170 | "Infected": 1 171 | } 172 | }, 173 | { 174 | "name": "QVoter", 175 | "uri": "/api/QVoter", 176 | "params": { 177 | "token": "access token", 178 | "infected": "The initial percentage of infected nodes.", 179 | "q": "Number of neighbours that affect the opinion of an agent" 180 | }, 181 | "discrete": true, 182 | "statuses": { 183 | "Susceptible": 0, 184 | "Infected": 1 185 | } 186 | }, 187 | { 188 | "name": "Majority Rule", 189 | "uri": "/api/MajorityRule", 190 | "params": { 191 | "token": "access token", 192 | "infected": "The initial percentage of infected nodes.", 193 | "q": "The group size" 194 | }, 195 | "discrete": true, 196 | "statuses": { 197 | "Susceptible": 0, 198 | "Infected": 1 199 | } 200 | }, 201 | { 202 | "name": "Sznajd", 203 | "uri": "/api/Sznajd", 204 | "params": { 205 | "token": "access token", 206 | "infected": "The initial percentage of infected nodes." 207 | }, 208 | "discrete": true, 209 | "statuses": { 210 | "Susceptible": 0, 211 | "Infected": 1 212 | } 213 | }, 214 | { 215 | "name": "KerteszThreshold", 216 | "uri": "/api/KerteszThreshold", 217 | "params": { 218 | "token": "access token", 219 | "infected": "The initial percentage of infected nodes.", 220 | "threshold": "A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.", 221 | "adopter_rate": "The adopter rate. Fixed probability of self-infection per iteration.", 222 | "blocked": "Percentage of blocked nodes." 223 | }, 224 | "discrete": true, 225 | "statuses": { 226 | "Susceptible": 0, 227 | "Infected": 1, 228 | "Blocked": -1 229 | } 230 | }, 231 | { 232 | "name": "Cognitive Opinion Dynamics", 233 | "uri": "/api/CognitiveOpinionDynamic", 234 | "params": { 235 | "token": "access token", 236 | "I": "The external information." 237 | }, 238 | "discrete": false, 239 | "statuses": { 240 | } 241 | }, 242 | { 243 | "name": "Algorithmic Bias", 244 | "uri": "/api/AlgorithmicBias", 245 | "params": { 246 | "token": "access token", 247 | "epsilon": "bounded confidence threshold", 248 | "gamma": "algorithmic bias" 249 | }, 250 | "discrete": false, 251 | "statuses": { 252 | "Infected": 0 253 | } 254 | } 255 | 256 | ] 257 | } -------------------------------------------------------------------------------- /static/assets/js/skel.min.js: -------------------------------------------------------------------------------- 1 | /* skel.js v3.0.0 | (c) n33 | skel.io | MIT licensed */ 2 | var skel=function(){"use strict";var t={breakpointIds:null,events:{},isInit:!1,obj:{attachments:{},breakpoints:{},head:null,states:{}},sd:"/",state:null,stateHandlers:{},stateId:"",vars:{},DOMReady:null,indexOf:null,isArray:null,iterate:null,matchesMedia:null,extend:function(e,n){t.iterate(n,function(i){t.isArray(n[i])?(t.isArray(e[i])||(e[i]=[]),t.extend(e[i],n[i])):"object"==typeof n[i]?("object"!=typeof e[i]&&(e[i]={}),t.extend(e[i],n[i])):e[i]=n[i]})},newStyle:function(t){var e=document.createElement("style");return e.type="text/css",e.innerHTML=t,e},_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,i=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+i in n||"Webkit"+i in n||"O"+i in n||"ms"+i in n},on:function(e,n){var i=e.split(/[\s]+/);return t.iterate(i,function(e){var a=i[e];if(t.isInit){if("init"==a)return void n();if("change"==a)n();else{var r=a.charAt(0);if("+"==r||"!"==r){var o=a.substring(1);if(o in t.obj.breakpoints)if("+"==r&&t.obj.breakpoints[o].active)n();else if("!"==r&&!t.obj.breakpoints[o].active)return void n()}}}t.events[a]||(t.events[a]=[]),t.events[a].push(n)}),t},trigger:function(e){return t.events[e]&&0!=t.events[e].length?(t.iterate(t.events[e],function(n){t.events[e][n]()}),t):void 0},breakpoint:function(e){return t.obj.breakpoints[e]},breakpoints:function(e){function n(t,e){this.name=this.id=t,this.media=e,this.active=!1,this.wasActive=!1}return n.prototype.matches=function(){return t.matchesMedia(this.media)},n.prototype.sync=function(){this.wasActive=this.active,this.active=this.matches()},t.iterate(e,function(i){t.obj.breakpoints[i]=new n(i,e[i])}),window.setTimeout(function(){t.poll()},0),t},addStateHandler:function(e,n){t.stateHandlers[e]=n},callStateHandler:function(e){var n=t.stateHandlers[e]();t.iterate(n,function(e){t.state.attachments.push(n[e])})},changeState:function(e){t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].sync()}),t.vars.lastStateId=t.stateId,t.stateId=e,t.breakpointIds=t.stateId===t.sd?[]:t.stateId.substring(1).split(t.sd),t.obj.states[t.stateId]?t.state=t.obj.states[t.stateId]:(t.obj.states[t.stateId]={attachments:[]},t.state=t.obj.states[t.stateId],t.iterate(t.stateHandlers,t.callStateHandler)),t.detachAll(t.state.attachments),t.attachAll(t.state.attachments),t.vars.stateId=t.stateId,t.vars.state=t.state,t.trigger("change"),t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].active?t.obj.breakpoints[e].wasActive||t.trigger("+"+e):t.obj.breakpoints[e].wasActive&&t.trigger("-"+e)})},generateStateConfig:function(e,n){var i={};return t.extend(i,e),t.iterate(t.breakpointIds,function(e){t.extend(i,n[t.breakpointIds[e]])}),i},getStateId:function(){var e="";return t.iterate(t.obj.breakpoints,function(n){var i=t.obj.breakpoints[n];i.matches()&&(e+=t.sd+i.id)}),e},poll:function(){var e="";e=t.getStateId(),""===e&&(e=t.sd),e!==t.stateId&&t.changeState(e)},_attach:null,attach:function(e){var n=t.obj.head,i=e.element;return i.parentNode&&i.parentNode.tagName?!1:(t._attach||(t._attach=n.firstChild),n.insertBefore(i,t._attach.nextSibling),e.permanent&&(t._attach=i),!0)},attachAll:function(e){var n=[];t.iterate(e,function(t){n[e[t].priority]||(n[e[t].priority]=[]),n[e[t].priority].push(e[t])}),n.reverse(),t.iterate(n,function(e){t.iterate(n[e],function(i){t.attach(n[e][i])})})},detach:function(t){var e=t.element;return t.permanent||!e.parentNode||e.parentNode&&!e.parentNode.tagName?!1:(e.parentNode.removeChild(e),!0)},detachAll:function(e){var n={};t.iterate(e,function(t){n[e[t].id]=!0}),t.iterate(t.obj.attachments,function(e){e in n||t.detach(t.obj.attachments[e])})},attachment:function(e){return e in t.obj.attachments?t.obj.attachments[e]:null},newAttachment:function(e,n,i,a){return t.obj.attachments[e]={id:e,element:n,priority:i,permanent:a}},init:function(){t.initMethods(),t.initVars(),t.initEvents(),t.obj.head=document.getElementsByTagName("head")[0],t.isInit=!0,t.trigger("init")},initEvents:function(){t.on("resize",function(){t.poll()}),t.on("orientationChange",function(){t.poll()}),t.DOMReady(function(){t.trigger("ready")}),window.onload&&t.on("load",window.onload),window.onload=function(){t.trigger("load")},window.onresize&&t.on("resize",window.onresize),window.onresize=function(){t.trigger("resize")},window.onorientationchange&&t.on("orientationChange",window.onorientationchange),window.onorientationchange=function(){t.trigger("orientationChange")}},initMethods:function(){document.addEventListener?!function(e,n){t.DOMReady=n()}("domready",function(){function t(t){for(r=1;t=n.shift();)t()}var e,n=[],i=document,a="DOMContentLoaded",r=/^loaded|^c/.test(i.readyState);return i.addEventListener(a,e=function(){i.removeEventListener(a,e),t()}),function(t){r?t():n.push(t)}}):!function(e,n){t.DOMReady=n()}("domready",function(t){function e(t){for(h=1;t=i.shift();)t()}var n,i=[],a=!1,r=document,o=r.documentElement,s=o.doScroll,c="DOMContentLoaded",d="addEventListener",u="onreadystatechange",l="readyState",f=s?/^loaded|^c/:/^loaded|c/,h=f.test(r[l]);return r[d]&&r[d](c,n=function(){r.removeEventListener(c,n,a),e()},a),s&&r.attachEvent(u,n=function(){/^c/.test(r[l])&&(r.detachEvent(u,n),e())}),t=s?function(e){self!=top?h?e():i.push(e):function(){try{o.doScroll("left")}catch(n){return setTimeout(function(){t(e)},50)}e()}()}:function(t){h?t():i.push(t)}}),Array.prototype.indexOf?t.indexOf=function(t,e){return t.indexOf(e)}:t.indexOf=function(t,e){if("string"==typeof t)return t.indexOf(e);var n,i,a=e?e:0;if(!this)throw new TypeError;if(i=this.length,0===i||a>=i)return-1;for(0>a&&(a=i-Math.abs(a)),n=a;i>n;n++)if(this[n]===t)return n;return-1},Array.isArray?t.isArray=function(t){return Array.isArray(t)}:t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},Object.keys?t.iterate=function(t,e){if(!t)return[];var n,i=Object.keys(t);for(n=0;i[n]&&e(i[n],t[i[n]])!==!1;n++);}:t.iterate=function(t,e){if(!t)return[];var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])===!1)break},window.matchMedia?t.matchesMedia=function(t){return""==t?!0:window.matchMedia(t).matches}:window.styleMedia||window.media?t.matchesMedia=function(t){if(""==t)return!0;var e=window.styleMedia||window.media;return e.matchMedium(t||"all")}:window.getComputedStyle?t.matchesMedia=function(t){if(""==t)return!0;var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle;var a="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=a:e.textContent=a,"1px"===i.width}:t.matchesMedia=function(t){if(""==t)return!0;var e,n,i,a,r={"min-width":null,"max-width":null},o=!1;for(i=t.split(/\s+and\s+/),e=0;er["max-width"]||null!==r["min-height"]&&cr["max-height"]?!1:!0},navigator.userAgent.match(/MSIE ([0-9]+)/)&&RegExp.$1<9&&(t.newStyle=function(t){var e=document.createElement("span");return e.innerHTML=' ",e})},initVars:function(){var e,n,i,a=navigator.userAgent;e="other",n=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(RegExp.$1),!1):void 0}),t.vars.browser=e,t.vars.browserVersion=n,e="other",n=0,i=[["ios",/([0-9_]+) like Mac OS X/,function(t){return t.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(t){return 0}],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(t){return t.replace("_",".").replace("_","")}],["wp",/Windows Phone ([0-9\.]+)/,null],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(i[2]?i[2](RegExp.$1):RegExp.$1),!1):void 0}),t.vars.os=e,t.vars.osVersion=n,t.vars.IEVersion="ie"==t.vars.browser?t.vars.browserVersion:99,t.vars.touch="wp"==t.vars.os?navigator.msMaxTouchPoints>0:!!("ontouchstart"in window),t.vars.mobile="wp"==t.vars.os||"android"==t.vars.os||"ios"==t.vars.os||"bb"==t.vars.os}};return t.init(),t}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.skel=e()}(this,function(){return skel}); 3 | -------------------------------------------------------------------------------- /client/NDlibClient.py: -------------------------------------------------------------------------------- 1 | from requests import put, get, delete, post 2 | from networkx.readwrite import json_graph 3 | import json 4 | 5 | __author__ = "Giulio Rossetti" 6 | __email__ = "giulio.rossetti@gmail.com" 7 | 8 | 9 | class NDlibClient(object): 10 | def __init__(self, service_url): 11 | self.token = "" 12 | self.base = service_url 13 | 14 | def create_experiment(self): 15 | res = get('%s/api/Experiment' % self.base).json() 16 | self.token = res['token'] 17 | 18 | def destroy_experiment(self): 19 | res = delete('%s/api/Experiment' % self.base, data={'token': self.token}) 20 | return res.status_code 21 | 22 | def reset_experiment(self, models=[]): 23 | if len(models) == 0: 24 | models = '' 25 | else: 26 | models = ','.join(models) 27 | 28 | res = put('%s/api/ExperimentStatus' % self.base, data={'token': self.token, 'models': models}) 29 | return res.status_code 30 | 31 | def describe_experiment(self): 32 | res = post('%s/api/ExperimentStatus' % self.base, data={'token': self.token}).json() 33 | return res 34 | 35 | def list_available_diffusion_models(self): 36 | res = get('%s/api/Models' % self.base).json()['endpoints'] 37 | names = [res[x]['name'] for x in res] 38 | return names 39 | 40 | def list_available_graph_generators(self): 41 | res = get('%s/api/Generators' % self.base).json()['endpoints'] 42 | names = [res[x]['name'] for x in res] 43 | return names 44 | 45 | def list_available_real_network_resources(self): 46 | res = get('%s/api/Networks' % self.base).json()['networks'] 47 | names = [res[x]['name'] for x in res] 48 | return names 49 | 50 | def load_graph(self, name): 51 | res = put('%s/api/Networks' % self.base, data={'name': name, 'token': self.token}) 52 | return res.status_code 53 | 54 | def add_barabasi_albert_graph(self, n, m): 55 | res = put("%s/api/Generators/BarabasiAlbertGraph" % self.base, data={'n': n, 'm': m, 'token': self.token}) 56 | return res.status_code 57 | 58 | def add_clustered_barabasi_albert_graph(self, n, m, p): 59 | res = put("%s/api/Generators/ClusteredBarabasiAlbertGraph" % self.base, data={'n': n, 'm': m, 'p': p, 60 | 'token': self.token}) 61 | return res.status_code 62 | 63 | def add_erdos_renyi_graph(self, n, p, directed=False): 64 | gr = put("%s/api/Generators/ERGraph" % self.base, 65 | data={'n': n, 'p': p, 'directed': directed, 'token': self.token}) 66 | return gr.status_code 67 | 68 | def add_planted_lpartition_graph(self, l, k, pin, pout, directed=False): 69 | gr = put("%s/api/Generators/PlantedPartition" % self.base, data={'l': l, 'k': k, 'pin': pin, 'pout': pout, 70 | 'directed': directed, 'token': self.token}) 71 | return gr.status_code 72 | 73 | def add_wats_strogatz_graph(self, n, k, p): 74 | gr = put("%s/api/Generators/WSGraph" % self.base, data={'n': n, 'k': k, 'p': p, 'token': self.token}) 75 | return gr.status_code 76 | 77 | def add_wats_complete_graph(self, n): 78 | gr = put("%s/api/Generators/CompleteGraph" % self.base, data={'n': n, 'token': self.token}) 79 | return gr.status_code 80 | 81 | def destroy_graph(self): 82 | res = delete('%s/api/Networks' % self.base, data={'token': self.token}) 83 | return res.status_code 84 | 85 | def add_threshold_model(self, infected, threshold=0): 86 | res = put('%s/api/Threshold' % self.base, 87 | data={'infected': infected, 'threshold': threshold, 'token': self.token}) 88 | return res.status_code 89 | 90 | def add_kertesz_model(self, infected, threshold=0.1, blocked=0.1, adopter_rate=0.1): 91 | res = put('%s/api/KerteszThreshold' % self.base, 92 | data={'infected': infected, 'threshold': threshold, 'token': self.token, 'blocked': blocked, 93 | 'adopter_rate': adopter_rate}) 94 | return res.status_code 95 | 96 | def add_profile_model(self, infected, profile=0): 97 | res = put('%s/api/Profile' % self.base, data={'infected': infected, 'profile': profile, 'token': self.token}) 98 | return res.status_code 99 | 100 | def add_profile_threshold_model(self, infected, threshold=0, profile=0): 101 | res = put('%s/api/ProfileThreshold' % self.base, 102 | data={'infected': infected, 'threshold': threshold, 'profile': profile, 'token': self.token}) 103 | return res.status_code 104 | 105 | def add_SI(self, infected, beta): 106 | res = put('%s/api/SI' % self.base, data={'infected': infected, 'beta': beta, 'token': self.token}) 107 | return res.status_code 108 | 109 | def add_SIS(self, infected, beta, lbd): 110 | res = put('%s/api/SIS' % self.base, 111 | data={'infected': infected, 'beta': beta, 'lambda': lbd, 'token': self.token}) 112 | return res.status_code 113 | 114 | def add_SEIS(self, infected, beta, alpha, lbd): 115 | res = put('%s/api/SEIS' % self.base, 116 | data={'infected': infected, 'beta': beta, 'lambda': lbd, 'alpha': alpha, 'token': self.token}) 117 | return res.status_code 118 | 119 | def add_SIR(self, infected, beta, gamma): 120 | res = put('%s/api/SIR' % self.base, 121 | data={'infected': infected, 'beta': beta, 'gamma': gamma, 'token': self.token}) 122 | return res.status_code 123 | 124 | def add_SEIR(self, infected, beta, gamma, alpha): 125 | res = put('%s/api/SEIR' % self.base, 126 | data={'infected': infected, 'beta': beta, 'gamma': gamma, 'alpha': alpha, 'token': self.token}) 127 | return res.status_code 128 | 129 | def add_independent_cascades(self, infected): 130 | res = put('%s/api/IndependentCascades' % self.base, data={'infected': infected, 'token': self.token}) 131 | return res.status_code 132 | 133 | def add_voter(self, infected): 134 | res = put('%s/api/Voter' % self.base, data={'infected': infected, 'token': self.token}) 135 | return res.status_code 136 | 137 | def add_qvoter(self, infected, q): 138 | res = put('%s/api/QVoter' % self.base, data={'infected': infected, 'q': q, 'token': self.token}) 139 | return res.status_code 140 | 141 | def add_majority_rule(self, infected, q): 142 | res = put('%s/api/MajorityRule' % self.base, data={'infected': infected, 'q': q, 'token': self.token}) 143 | return res.status_code 144 | 145 | def add_sznajd(self, infected): 146 | res = put('%s/api/Sznajd' % self.base, data={'infected': infected, 'token': self.token}) 147 | return res.status_code 148 | 149 | def add_cognitiveopdyn(self, i, B_range_min, B_range_max, T_range_min, T_range_max, R_fraction_negative, 150 | R_fraction_neutral, R_fraction_positive): 151 | 152 | res = put('%s/api/CognitiveOpinionDynamic' % self.base, 153 | data={'I': i, 'B_range_min': B_range_min, 'B_range_max': B_range_max, 154 | 'T_range_min': T_range_min, 155 | 'T_range_max': T_range_max, 156 | 'R_fraction_negative': R_fraction_negative, 157 | 'R_fraction_neutral': R_fraction_neutral, 158 | 'R_fraction_positive': R_fraction_positive, 159 | 'token': self.token}) 160 | return res.status_code 161 | 162 | def destroy_model(self, models=[]): 163 | if len(models) == 0: 164 | models = '' 165 | else: 166 | models = ','.join(models) 167 | 168 | res = delete('%s/api/Models' % self.base, data={'models': models, 'token': self.token}) 169 | return res.status_code 170 | 171 | def set_advanced_configuration(self, configuration, models=[]): 172 | if len(models) == 0: 173 | models = '' 174 | else: 175 | models = ','.join(models) 176 | res = put('%s/api/Configure' % self.base, 177 | data={'status': json.dumps(configuration), 'models': models, 'token': self.token}) 178 | return res.status_code 179 | 180 | def get_iteration(self, models=[]): 181 | if len(models) == 0: 182 | models = '' 183 | else: 184 | models = ','.join(models) 185 | 186 | res = post('%s/api/Iteration' % self.base, data={'token': self.token, 'models': models}).json() 187 | return res 188 | 189 | def get_iteration_bunch(self, bunch, models=[]): 190 | if len(models) == 0: 191 | models = '' 192 | else: 193 | models = ','.join(models) 194 | 195 | res = post('%s/api/IterationBunch' % self.base, 196 | data={'bunch': bunch, 'models': models, 'token': self.token}).json() 197 | return res 198 | 199 | def get_complete_run(self, models=[]): 200 | if len(models) == 0: 201 | models = '' 202 | else: 203 | models = ','.join(models) 204 | 205 | res = post('%s/api/CompleteRun' % self.base, data={'token': self.token, 'models': models}).json() 206 | return res 207 | 208 | def get_graph(self): 209 | res = post('%s/api/GetGraph' % self.base, data={'token': self.token}).json() 210 | try: 211 | graph = json_graph.loads(json.dumps(res)) 212 | return graph 213 | except: 214 | return None 215 | 216 | def get_list_available_exploratories(self): 217 | res = get('%s/api/Exploratory' % self.base).json()['exploratory'] 218 | names = [x['name'] for x in res] 219 | return names 220 | 221 | def load_exploratory(self, name): 222 | res = post('%s/api/Exploratory' % self.base, data={'exploratory': name, 'token': self.token}) 223 | return res.status_code 224 | 225 | def upload_graph(self, directed, graph, dynamic=False): 226 | res = post('%s/api/UploadNetwork' % self.base, 227 | data={'directed': directed, 'graph': json.dumps(graph), 'dynamic': dynamic, 'token': self.token}) 228 | return res.status_code 229 | -------------------------------------------------------------------------------- /static/docs/utils/handlebars_helper.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'locales', 3 | 'handlebars', 4 | 'diffMatchPatch' 5 | ], function(locale, Handlebars, DiffMatchPatch) { 6 | 7 | /** 8 | * start/stop timer for simple performance check. 9 | */ 10 | var timer; 11 | Handlebars.registerHelper('startTimer', function(text) { 12 | timer = new Date(); 13 | return ''; 14 | }); 15 | 16 | Handlebars.registerHelper('stopTimer', function(text) { 17 | console.log(new Date() - timer); 18 | return ''; 19 | }); 20 | 21 | /** 22 | * Return localized Text. 23 | * @param string text 24 | */ 25 | Handlebars.registerHelper('__', function(text) { 26 | return locale.__(text); 27 | }); 28 | 29 | /** 30 | * Console log. 31 | * @param mixed obj 32 | */ 33 | Handlebars.registerHelper('cl', function(obj) { 34 | console.log(obj); 35 | return ''; 36 | }); 37 | 38 | /** 39 | * Replace underscore with space. 40 | * @param string text 41 | */ 42 | Handlebars.registerHelper('underscoreToSpace', function(text) { 43 | return text.replace(/(_+)/g, ' '); 44 | }); 45 | 46 | /** 47 | * 48 | */ 49 | Handlebars.registerHelper('assign', function(name) { 50 | if(arguments.length > 0) { 51 | var type = typeof(arguments[1]); 52 | var arg = null; 53 | if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1]; 54 | Handlebars.registerHelper(name, function() { return arg; }); 55 | } 56 | return ''; 57 | }); 58 | 59 | /** 60 | * 61 | */ 62 | Handlebars.registerHelper('nl2br', function(text) { 63 | return _handlebarsNewlineToBreak(text); 64 | }); 65 | 66 | /** 67 | * 68 | */ 69 | Handlebars.registerHelper('if_eq', function(context, options) { 70 | var compare = context; 71 | // Get length if context is an object 72 | if (context instanceof Object && ! (options.hash.compare instanceof Object)) 73 | compare = Object.keys(context).length; 74 | 75 | if (compare === options.hash.compare) 76 | return options.fn(this); 77 | 78 | return options.inverse(this); 79 | }); 80 | 81 | /** 82 | * 83 | */ 84 | Handlebars.registerHelper('if_gt', function(context, options) { 85 | var compare = context; 86 | // Get length if context is an object 87 | if (context instanceof Object && ! (options.hash.compare instanceof Object)) 88 | compare = Object.keys(context).length; 89 | 90 | if(compare > options.hash.compare) 91 | return options.fn(this); 92 | 93 | return options.inverse(this); 94 | }); 95 | 96 | /** 97 | * 98 | */ 99 | var templateCache = {}; 100 | Handlebars.registerHelper('subTemplate', function(name, sourceContext) { 101 | if ( ! templateCache[name]) 102 | templateCache[name] = Handlebars.compile($('#template-' + name).html()); 103 | 104 | var template = templateCache[name]; 105 | var templateContext = $.extend({}, this, sourceContext.hash); 106 | return new Handlebars.SafeString( template(templateContext) ); 107 | }); 108 | 109 | /** 110 | * 111 | */ 112 | Handlebars.registerHelper('toLowerCase', function(value) { 113 | return (value && typeof value === 'string') ? value.toLowerCase() : ''; 114 | }); 115 | 116 | /** 117 | * 118 | */ 119 | Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) { 120 | var splits = value.split(splitChar); 121 | return new Array(splits.length).join(fillChar) + splits[splits.length - 1]; 122 | }); 123 | 124 | /** 125 | * Convert Newline to HTML-Break (nl2br). 126 | * 127 | * @param {String} text 128 | * @returns {String} 129 | */ 130 | function _handlebarsNewlineToBreak(text) { 131 | return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '
' + '$2'); 132 | } 133 | 134 | /** 135 | * 136 | */ 137 | Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) { 138 | var fieldName = options.hash.field; 139 | var newSource = []; 140 | if (source) { 141 | source.forEach(function(entry) { 142 | var values = entry; 143 | values['key'] = entry[fieldName]; 144 | newSource.push(values); 145 | }); 146 | } 147 | 148 | var newCompare = []; 149 | if (compare) { 150 | compare.forEach(function(entry) { 151 | var values = entry; 152 | values['key'] = entry[fieldName]; 153 | newCompare.push(values); 154 | }); 155 | } 156 | return _handlebarsEachCompared('key', newSource, newCompare, options); 157 | }); 158 | 159 | /** 160 | * 161 | */ 162 | Handlebars.registerHelper('each_compare_keys', function(source, compare, options) { 163 | var newSource = []; 164 | if (source) { 165 | var sourceFields = Object.keys(source); 166 | sourceFields.forEach(function(name) { 167 | var values = {}; 168 | values['value'] = source[name]; 169 | values['key'] = name; 170 | newSource.push(values); 171 | }); 172 | } 173 | 174 | var newCompare = []; 175 | if (compare) { 176 | var compareFields = Object.keys(compare); 177 | compareFields.forEach(function(name) { 178 | var values = {}; 179 | values['value'] = compare[name]; 180 | values['key'] = name; 181 | newCompare.push(values); 182 | }); 183 | } 184 | return _handlebarsEachCompared('key', newSource, newCompare, options); 185 | }); 186 | 187 | /** 188 | * 189 | */ 190 | Handlebars.registerHelper('each_compare_field', function(source, compare, options) { 191 | return _handlebarsEachCompared('field', source, compare, options); 192 | }); 193 | 194 | /** 195 | * 196 | */ 197 | Handlebars.registerHelper('each_compare_title', function(source, compare, options) { 198 | return _handlebarsEachCompared('title', source, compare, options); 199 | }); 200 | 201 | /** 202 | * 203 | */ 204 | Handlebars.registerHelper('reformat', function(source, type){ 205 | if (type == 'json') 206 | try { 207 | return JSON.stringify(JSON.parse(source.trim()),null, " "); 208 | } catch(e) { 209 | 210 | } 211 | return source 212 | }); 213 | 214 | /** 215 | * 216 | */ 217 | Handlebars.registerHelper('showDiff', function(source, compare, options) { 218 | var ds = ''; 219 | if(source === compare) { 220 | ds = source; 221 | } else { 222 | if( ! source) 223 | return compare; 224 | 225 | if( ! compare) 226 | return source; 227 | 228 | var d = diffMatchPatch.diff_main(compare, source); 229 | diffMatchPatch.diff_cleanupSemantic(d); 230 | ds = diffMatchPatch.diff_prettyHtml(d); 231 | ds = ds.replace(/¶/gm, ''); 232 | } 233 | if(options === 'nl2br') 234 | ds = _handlebarsNewlineToBreak(ds); 235 | 236 | return ds; 237 | }); 238 | 239 | /** 240 | * 241 | */ 242 | function _handlebarsEachCompared(fieldname, source, compare, options) 243 | { 244 | var dataList = []; 245 | var index = 0; 246 | if(source) { 247 | source.forEach(function(sourceEntry) { 248 | var found = false; 249 | if (compare) { 250 | compare.forEach(function(compareEntry) { 251 | if(sourceEntry[fieldname] === compareEntry[fieldname]) { 252 | var data = { 253 | typeSame: true, 254 | source: sourceEntry, 255 | compare: compareEntry, 256 | index: index 257 | }; 258 | dataList.push(data); 259 | found = true; 260 | index++; 261 | } 262 | }); 263 | } 264 | if ( ! found) { 265 | var data = { 266 | typeIns: true, 267 | source: sourceEntry, 268 | index: index 269 | }; 270 | dataList.push(data); 271 | index++; 272 | } 273 | }); 274 | } 275 | 276 | if (compare) { 277 | compare.forEach(function(compareEntry) { 278 | var found = false; 279 | if (source) { 280 | source.forEach(function(sourceEntry) { 281 | if(sourceEntry[fieldname] === compareEntry[fieldname]) 282 | found = true; 283 | }); 284 | } 285 | if ( ! found) { 286 | var data = { 287 | typeDel: true, 288 | compare: compareEntry, 289 | index: index 290 | }; 291 | dataList.push(data); 292 | index++; 293 | } 294 | }); 295 | } 296 | 297 | var ret = ''; 298 | var length = dataList.length; 299 | for (var index in dataList) { 300 | if(index == (length - 1)) 301 | dataList[index]['_last'] = true; 302 | ret = ret + options.fn(dataList[index]); 303 | } 304 | return ret; 305 | } 306 | 307 | var diffMatchPatch = new DiffMatchPatch(); 308 | 309 | /** 310 | * Overwrite Colors 311 | */ 312 | DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) { 313 | var html = []; 314 | var pattern_amp = /&/g; 315 | var pattern_lt = //g; 317 | var pattern_para = /\n/g; 318 | for (var x = 0; x < diffs.length; x++) { 319 | var op = diffs[x][0]; // Operation (insert, delete, equal) 320 | var data = diffs[x][1]; // Text of change. 321 | var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') 322 | .replace(pattern_gt, '>').replace(pattern_para, '¶
'); 323 | switch (op) { 324 | case DIFF_INSERT: 325 | html[x] = '' + text + ''; 326 | break; 327 | case DIFF_DELETE: 328 | html[x] = '' + text + ''; 329 | break; 330 | case DIFF_EQUAL: 331 | html[x] = '' + text + ''; 332 | break; 333 | } 334 | } 335 | return html.join(''); 336 | }; 337 | 338 | // Exports 339 | return Handlebars; 340 | }); 341 | -------------------------------------------------------------------------------- /static/docs/vendor/webfontloader.js: -------------------------------------------------------------------------------- 1 | /* Web Font Loader v1.6.24 - (c) Adobe Systems, Google. License: Apache 2.0 */ 2 | (function(){function aa(a,b,d){return a.call.apply(a.bind,arguments)}function ba(a,b,d){if(!a)throw Error();if(2=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?c():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.f)});Promise.race([e,c]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a= 8 | P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)}; 9 | function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&&d===a.f[S[c]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f.serif&&d===a.f["sans-serif"])||(c=U()&&ma(a,b,d));c?q()-a.A>=a.w?U()&&ma(a,b,d)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)}; 10 | W.prototype.h=function(a){var b=this.a;if(b.g){var d=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),c=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];d||c.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,c,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)}; 11 | function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=c||null||{};if(0===d.length&&f)M(b.a);else{b.f+=d.length;f&&(b.j=f);var h,m=[];for(h=0;h)?=?)";var E=s++;i[E]=i[a]+"|x|X|\\*";var $=s++;i[$]=i[o]+"|x|X|\\*";var k=s++;i[k]="[v=\\s]*("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:"+i[c]+")?"+i[g]+"?"+")?)?";var R=s++;i[R]="[v=\\s]*("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:"+i[v]+")?"+i[g]+"?"+")?)?";var S=s++;i[S]="^"+i[b]+"\\s*"+i[k]+"$";var x=s++;i[x]="^"+i[b]+"\\s*"+i[R]+"$";var I=s++;i[I]="(?:~>?)";var T=s++;i[T]="(\\s*)"+i[I]+"\\s+";n[T]=new RegExp(i[T],"g");var V="$1~";var A=s++;i[A]="^"+i[I]+i[k]+"$";var C=s++;i[C]="^"+i[I]+i[R]+"$";var M=s++;i[M]="(?:\\^)";var N=s++;i[N]="(\\s*)"+i[M]+"\\s+";n[N]=new RegExp(i[N],"g");var _="$1^";var z=s++;i[z]="^"+i[M]+i[k]+"$";var P=s++;i[P]="^"+i[M]+i[R]+"$";var X=s++;i[X]="^"+i[b]+"\\s*("+d+")$|^$";var Z=s++;i[Z]="^"+i[b]+"\\s*("+y+")$|^$";var q=s++;i[q]="(\\s*)"+i[b]+"\\s*("+d+"|"+i[k]+")";n[q]=new RegExp(i[q],"g");var L="$1$2$3";var F=s++;i[F]="^\\s*("+i[k]+")"+"\\s+-\\s+"+"("+i[k]+")"+"\\s*$";var G=s++;i[G]="^\\s*("+i[R]+")"+"\\s+-\\s+"+"("+i[R]+")"+"\\s*$";var O=s++;i[O]="(<|>)?=?\\s*\\*";for(var B=0;Br)return null;var i=t?n[j]:n[w];if(!i.test(e))return null;try{return new K(e,t)}catch(s){return null}}e.valid=H;function H(e,r){var t=D(e,r);return t?t.version:null}e.clean=J;function J(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=K;function K(e,i){if(e instanceof K){if(e.loose===i)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof K))return new K(e,i);this.loose=i;var s=e.trim().match(i?n[j]:n[w]);if(!s)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+s[1];this.minor=+s[2];this.patch=+s[3];if(this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");if(!s[4])this.prerelease=[];else this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r'};K.prototype.toString=function(){return this.version};K.prototype.compare=function(e){if(!(e instanceof K))e=new K(e,this.loose);return this.compareMain(e)||this.comparePre(e)};K.prototype.compareMain=function(e){if(!(e instanceof K))e=new K(e,this.loose);return Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)};K.prototype.comparePre=function(e){if(!(e instanceof K))e=new K(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Y(t,n)}while(++r)};K.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=Q;function Q(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new K(e,t).inc(r,n).version}catch(i){return null}}e.diff=U;function U(e,r){if(pr(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=Y;var W=/^[0-9]+$/;function Y(e,r){var t=W.test(e);var n=W.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=er;function er(e,r){return Y(r,e)}e.major=rr;function rr(e,r){return new K(e,r).major}e.minor=tr;function tr(e,r){return new K(e,r).minor}e.patch=nr;function nr(e,r){return new K(e,r).patch}e.compare=ir;function ir(e,r,t){return new K(e,t).compare(r)}e.compareLoose=sr;function sr(e,r){return ir(e,r,true)}e.rcompare=or;function or(e,r,t){return ir(r,e,t)}e.sort=ar;function ar(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=fr;function fr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ur;function ur(e,r,t){return ir(e,r,t)>0}e.lt=lr;function lr(e,r,t){return ir(e,r,t)<0}e.eq=pr;function pr(e,r,t){return ir(e,r,t)===0}e.neq=hr;function hr(e,r,t){return ir(e,r,t)!==0}e.gte=cr;function cr(e,r,t){return ir(e,r,t)>=0}e.lte=vr;function vr(e,r,t){return ir(e,r,t)<=0}e.cmp=mr;function mr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=pr(e,t,n);break;case"!=":i=hr(e,t,n);break;case">":i=ur(e,t,n);break;case">=":i=cr(e,t,n);break;case"<":i=lr(e,t,n);break;case"<=":i=vr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=gr;function gr(e,r){if(e instanceof gr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof gr))return new gr(e,r);this.loose=r;this.parse(e);if(this.semver===wr)this.value="";else this.value=this.operator+this.semver.version}var wr={};gr.prototype.parse=function(e){var r=this.loose?n[X]:n[Z];var t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1];if(this.operator==="=")this.operator="";if(!t[2])this.semver=wr;else this.semver=new K(t[2],this.loose)};gr.prototype.inspect=function(){return''};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(e){if(this.semver===wr)return true;if(typeof e==="string")e=new K(e,this.loose);return mr(e,this.operator,this.semver,this.loose)};e.Range=yr;function yr(e,r){if(e instanceof yr&&e.loose===r)return e;if(!(this instanceof yr))return new yr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}yr.prototype.inspect=function(){return''};yr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};yr.prototype.toString=function(){return this.range};yr.prototype.parseRange=function(e){var r=this.loose;e=e.trim();var t=r?n[G]:n[F];e=e.replace(t,Tr);e=e.replace(n[q],L);e=e.replace(n[T],V);e=e.replace(n[N],_);e=e.split(/\s+/).join(" ");var i=r?n[X]:n[Z];var s=e.split(" ").map(function(e){return jr(e,r)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new gr(e,r)});return s};e.toComparators=dr;function dr(e,r){return new yr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function jr(e,r){e=kr(e,r);e=Er(e,r);e=Sr(e,r);e=Ir(e,r);return e}function br(e){return!e||e.toLowerCase()==="x"||e==="*"}function Er(e,r){return e.trim().split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,r){var t=r?n[C]:n[A];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function kr(e,r){return e.trim().split(/\s+/).map(function(e){return Rr(e,r)}).join(" ")}function Rr(e,r){var t=r?n[P]:n[z];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function Sr(e,r){return e.split(/\s+/).map(function(e){return xr(e,r)}).join(" ")}function xr(e,r){e=e.trim();var t=r?n[x]:n[S];return e.replace(t,function(e,r,t,n,i,s){var o=br(t);var a=o||br(n);var f=a||br(i);var u=f;if(r==="="&&u)r="";if(o){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(a)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function Ir(e,r){return e.trim().replace(n[O],"")}function Tr(e,r,t,n,i,s,o,a,f,u,l,p,h){if(br(t))r="";else if(br(n))r=">="+t+".0.0";else if(br(i))r=">="+t+"."+n+".0";else r=">="+r;if(br(f))a="";else if(br(u))a="<"+(+f+1)+".0.0";else if(br(l))a="<"+f+"."+(+u+1)+".0";else if(p)a="<="+f+"."+u+"."+l+"-"+p;else a="<="+a;return(r+" "+a).trim()}yr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new K(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Ar;function Ar(e,r,t){try{r=new yr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Cr;function Cr(e,r,t){return e.filter(function(e){return Ar(e,r,t)}).sort(function(e,r){return or(e,r,t)})[0]||null}e.validRange=Mr;function Mr(e,r){try{return new yr(e,r).range||"*"}catch(t){return null}}e.ltr=Nr;function Nr(e,r,t){return zr(e,r,"<",t)}e.gtr=_r;function _r(e,r,t){return zr(e,r,">",t)}e.outside=zr;function zr(e,r,t,n){e=new K(e,n);r=new yr(r,n);var i,s,o,a,f;switch(t){case">":i=ur;s=vr;o=lr;a=">";f=">=";break;case"<":i=lr;s=cr;o=ur;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ar(e,r,n)){return false}for(var u=0;u li > a { 262 | display: block; 263 | width: 192px; 264 | margin: 0; 265 | padding: 2px 11px; 266 | border: 0; 267 | border-left: transparent 4px solid; 268 | border-right: transparent 4px solid; 269 | font-family: "Source Sans Pro", sans-serif; 270 | font-weight: 400; 271 | font-size: 14px; 272 | } 273 | 274 | .sidenav > li.nav-header > a { 275 | padding: 5px 15px; 276 | border: 1px solid #e5e5e5; 277 | width: 190px; 278 | font-family: "Source Sans Pro", sans-serif; 279 | font-weight: 700; 280 | font-size: 16px; 281 | background-color: #ffffff; 282 | } 283 | 284 | .sidenav > li.nav-header.active > a { 285 | background-color: #0088cc; 286 | } 287 | 288 | .sidenav > .active > a { 289 | position: relative; 290 | z-index: 2; 291 | } 292 | 293 | .sidenav > li > a:hover { 294 | background-color: #ffffff; 295 | } 296 | 297 | .sidenav > li.has-modifications a { 298 | border-right: #60d060 4px solid; 299 | } 300 | 301 | .sidenav > li.is-new a { 302 | border-left: #e5e5e5 4px solid; 303 | } 304 | 305 | /* ------------------------------------------------------------------------------------------ 306 | * Compare 307 | * ------------------------------------------------------------------------------------------ */ 308 | 309 | ins { 310 | background: #60d060; 311 | text-decoration: none; 312 | color: #000000; 313 | } 314 | 315 | del { 316 | background: #f05050; 317 | color: #000000; 318 | } 319 | 320 | .label-ins { 321 | background-color: #60d060; 322 | } 323 | 324 | .label-del { 325 | background-color: #f05050; 326 | text-decoration: line-through; 327 | } 328 | 329 | pre.ins { 330 | background-color: #60d060; 331 | } 332 | 333 | pre.del { 334 | background-color: #f05050; 335 | text-decoration: line-through; 336 | } 337 | 338 | table.ins th, 339 | table.ins td { 340 | background-color: #60d060; 341 | } 342 | 343 | table.del th, 344 | table.del td { 345 | background-color: #f05050; 346 | text-decoration: line-through; 347 | } 348 | 349 | tr.ins td { 350 | background-color: #60d060; 351 | } 352 | 353 | tr.del td { 354 | background-color: #f05050; 355 | text-decoration: line-through; 356 | } 357 | 358 | /* ------------------------------------------------------------------------------------------ 359 | * Spinner 360 | * ------------------------------------------------------------------------------------------ */ 361 | 362 | #loader { 363 | position: absolute; 364 | width: 100%; 365 | } 366 | 367 | #loader p { 368 | padding-top: 80px; 369 | margin-left: -4px; 370 | } 371 | 372 | .spinner { 373 | margin: 200px auto; 374 | width: 60px; 375 | height: 60px; 376 | position: relative; 377 | } 378 | 379 | .container1 > div, .container2 > div, .container3 > div { 380 | width: 14px; 381 | height: 14px; 382 | background-color: #0088cc; 383 | 384 | border-radius: 100%; 385 | position: absolute; 386 | -webkit-animation: bouncedelay 1.2s infinite ease-in-out; 387 | animation: bouncedelay 1.2s infinite ease-in-out; 388 | /* Prevent first frame from flickering when animation starts */ 389 | -webkit-animation-fill-mode: both; 390 | animation-fill-mode: both; 391 | } 392 | 393 | .spinner .spinner-container { 394 | position: absolute; 395 | width: 100%; 396 | height: 100%; 397 | } 398 | 399 | .container2 { 400 | -webkit-transform: rotateZ(45deg); 401 | transform: rotateZ(45deg); 402 | } 403 | 404 | .container3 { 405 | -webkit-transform: rotateZ(90deg); 406 | transform: rotateZ(90deg); 407 | } 408 | 409 | .circle1 { top: 0; left: 0; } 410 | .circle2 { top: 0; right: 0; } 411 | .circle3 { right: 0; bottom: 0; } 412 | .circle4 { left: 0; bottom: 0; } 413 | 414 | .container2 .circle1 { 415 | -webkit-animation-delay: -1.1s; 416 | animation-delay: -1.1s; 417 | } 418 | 419 | .container3 .circle1 { 420 | -webkit-animation-delay: -1.0s; 421 | animation-delay: -1.0s; 422 | } 423 | 424 | .container1 .circle2 { 425 | -webkit-animation-delay: -0.9s; 426 | animation-delay: -0.9s; 427 | } 428 | 429 | .container2 .circle2 { 430 | -webkit-animation-delay: -0.8s; 431 | animation-delay: -0.8s; 432 | } 433 | 434 | .container3 .circle2 { 435 | -webkit-animation-delay: -0.7s; 436 | animation-delay: -0.7s; 437 | } 438 | 439 | .container1 .circle3 { 440 | -webkit-animation-delay: -0.6s; 441 | animation-delay: -0.6s; 442 | } 443 | 444 | .container2 .circle3 { 445 | -webkit-animation-delay: -0.5s; 446 | animation-delay: -0.5s; 447 | } 448 | 449 | .container3 .circle3 { 450 | -webkit-animation-delay: -0.4s; 451 | animation-delay: -0.4s; 452 | } 453 | 454 | .container1 .circle4 { 455 | -webkit-animation-delay: -0.3s; 456 | animation-delay: -0.3s; 457 | } 458 | 459 | .container2 .circle4 { 460 | -webkit-animation-delay: -0.2s; 461 | animation-delay: -0.2s; 462 | } 463 | 464 | .container3 .circle4 { 465 | -webkit-animation-delay: -0.1s; 466 | animation-delay: -0.1s; 467 | } 468 | 469 | @-webkit-keyframes bouncedelay { 470 | 0%, 80%, 100% { -webkit-transform: scale(0.0) } 471 | 40% { -webkit-transform: scale(1.0) } 472 | } 473 | 474 | @keyframes bouncedelay { 475 | 0%, 80%, 100% { 476 | transform: scale(0.0); 477 | -webkit-transform: scale(0.0); 478 | } 40% { 479 | transform: scale(1.0); 480 | -webkit-transform: scale(1.0); 481 | } 482 | } 483 | 484 | /* ------------------------------------------------------------------------------------------ 485 | * Tabs 486 | * ------------------------------------------------------------------------------------------ */ 487 | ul.nav-tabs { 488 | margin: 0; 489 | } 490 | 491 | /* ------------------------------------------------------------------------------------------ 492 | * Print 493 | * ------------------------------------------------------------------------------------------ */ 494 | 495 | @media print { 496 | 497 | #sidenav, 498 | #version, 499 | #versions, 500 | section .version, 501 | section .versions { 502 | display: none; 503 | } 504 | 505 | #content { 506 | margin-left: 0; 507 | } 508 | 509 | a { 510 | text-decoration: none; 511 | color: inherit; 512 | } 513 | 514 | a:after { 515 | content: " [" attr(href) "] "; 516 | } 517 | 518 | p { 519 | color: #000000 520 | } 521 | 522 | pre { 523 | background-color: #ffffff; 524 | color: #000000; 525 | padding: 10px; 526 | border: #808080 1px solid; 527 | border-radius: 6px; 528 | position: relative; 529 | margin: 10px 0 20px 0; 530 | } 531 | 532 | } /* /@media print */ 533 | -------------------------------------------------------------------------------- /static/docs/vendor/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i' + 26 | '' + 27 | $this.text() + 28 | '' 29 | ); 30 | 31 | }); 32 | 33 | return b.join(''); 34 | 35 | }; 36 | 37 | /** 38 | * Panel-ify an element. 39 | * @param {object} userConfig User config. 40 | * @return {jQuery} jQuery object. 41 | */ 42 | $.fn.panel = function(userConfig) { 43 | 44 | // No elements? 45 | if (this.length == 0) 46 | return $this; 47 | 48 | // Multiple elements? 49 | if (this.length > 1) { 50 | 51 | for (var i=0; i < this.length; i++) 52 | $(this[i]).panel(userConfig); 53 | 54 | return $this; 55 | 56 | } 57 | 58 | // Vars. 59 | var $this = $(this), 60 | $body = $('body'), 61 | $window = $(window), 62 | id = $this.attr('id'), 63 | config; 64 | 65 | // Config. 66 | config = $.extend({ 67 | 68 | // Delay. 69 | delay: 0, 70 | 71 | // Hide panel on link click. 72 | hideOnClick: false, 73 | 74 | // Hide panel on escape keypress. 75 | hideOnEscape: false, 76 | 77 | // Hide panel on swipe. 78 | hideOnSwipe: false, 79 | 80 | // Reset scroll position on hide. 81 | resetScroll: false, 82 | 83 | // Reset forms on hide. 84 | resetForms: false, 85 | 86 | // Side of viewport the panel will appear. 87 | side: null, 88 | 89 | // Target element for "class". 90 | target: $this, 91 | 92 | // Class to toggle. 93 | visibleClass: 'visible' 94 | 95 | }, userConfig); 96 | 97 | // Expand "target" if it's not a jQuery object already. 98 | if (typeof config.target != 'jQuery') 99 | config.target = $(config.target); 100 | 101 | // Panel. 102 | 103 | // Methods. 104 | $this._hide = function(event) { 105 | 106 | // Already hidden? Bail. 107 | if (!config.target.hasClass(config.visibleClass)) 108 | return; 109 | 110 | // If an event was provided, cancel it. 111 | if (event) { 112 | 113 | event.preventDefault(); 114 | event.stopPropagation(); 115 | 116 | } 117 | 118 | // Hide. 119 | config.target.removeClass(config.visibleClass); 120 | 121 | // Post-hide stuff. 122 | window.setTimeout(function() { 123 | 124 | // Reset scroll position. 125 | if (config.resetScroll) 126 | $this.scrollTop(0); 127 | 128 | // Reset forms. 129 | if (config.resetForms) 130 | $this.find('form').each(function() { 131 | this.reset(); 132 | }); 133 | 134 | }, config.delay); 135 | 136 | }; 137 | 138 | // Vendor fixes. 139 | $this 140 | .css('-ms-overflow-style', '-ms-autohiding-scrollbar') 141 | .css('-webkit-overflow-scrolling', 'touch'); 142 | 143 | // Hide on click. 144 | if (config.hideOnClick) { 145 | 146 | $this.find('a') 147 | .css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); 148 | 149 | $this 150 | .on('click', 'a', function(event) { 151 | 152 | var $a = $(this), 153 | href = $a.attr('href'), 154 | target = $a.attr('target'); 155 | 156 | if (!href || href == '#' || href == '' || href == '#' + id) 157 | return; 158 | 159 | // Cancel original event. 160 | event.preventDefault(); 161 | event.stopPropagation(); 162 | 163 | // Hide panel. 164 | $this._hide(); 165 | 166 | // Redirect to href. 167 | window.setTimeout(function() { 168 | 169 | if (target == '_blank') 170 | window.open(href); 171 | else 172 | window.location.href = href; 173 | 174 | }, config.delay + 10); 175 | 176 | }); 177 | 178 | } 179 | 180 | // Event: Touch stuff. 181 | $this.on('touchstart', function(event) { 182 | 183 | $this.touchPosX = event.originalEvent.touches[0].pageX; 184 | $this.touchPosY = event.originalEvent.touches[0].pageY; 185 | 186 | }) 187 | 188 | $this.on('touchmove', function(event) { 189 | 190 | if ($this.touchPosX === null 191 | || $this.touchPosY === null) 192 | return; 193 | 194 | var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX, 195 | diffY = $this.touchPosY - event.originalEvent.touches[0].pageY, 196 | th = $this.outerHeight(), 197 | ts = ($this.get(0).scrollHeight - $this.scrollTop()); 198 | 199 | // Hide on swipe? 200 | if (config.hideOnSwipe) { 201 | 202 | var result = false, 203 | boundary = 20, 204 | delta = 50; 205 | 206 | switch (config.side) { 207 | 208 | case 'left': 209 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX > delta); 210 | break; 211 | 212 | case 'right': 213 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX < (-1 * delta)); 214 | break; 215 | 216 | case 'top': 217 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY > delta); 218 | break; 219 | 220 | case 'bottom': 221 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY < (-1 * delta)); 222 | break; 223 | 224 | default: 225 | break; 226 | 227 | } 228 | 229 | if (result) { 230 | 231 | $this.touchPosX = null; 232 | $this.touchPosY = null; 233 | $this._hide(); 234 | 235 | return false; 236 | 237 | } 238 | 239 | } 240 | 241 | // Prevent vertical scrolling past the top or bottom. 242 | if (($this.scrollTop() < 0 && diffY < 0) 243 | || (ts > (th - 2) && ts < (th + 2) && diffY > 0)) { 244 | 245 | event.preventDefault(); 246 | event.stopPropagation(); 247 | 248 | } 249 | 250 | }); 251 | 252 | // Event: Prevent certain events inside the panel from bubbling. 253 | $this.on('click touchend touchstart touchmove', function(event) { 254 | event.stopPropagation(); 255 | }); 256 | 257 | // Event: Hide panel if a child anchor tag pointing to its ID is clicked. 258 | $this.on('click', 'a[href="#' + id + '"]', function(event) { 259 | 260 | event.preventDefault(); 261 | event.stopPropagation(); 262 | 263 | config.target.removeClass(config.visibleClass); 264 | 265 | }); 266 | 267 | // Body. 268 | 269 | // Event: Hide panel on body click/tap. 270 | $body.on('click touchend', function(event) { 271 | $this._hide(event); 272 | }); 273 | 274 | // Event: Toggle. 275 | $body.on('click', 'a[href="#' + id + '"]', function(event) { 276 | 277 | event.preventDefault(); 278 | event.stopPropagation(); 279 | 280 | config.target.toggleClass(config.visibleClass); 281 | 282 | }); 283 | 284 | // Window. 285 | 286 | // Event: Hide on ESC. 287 | if (config.hideOnEscape) 288 | $window.on('keydown', function(event) { 289 | 290 | if (event.keyCode == 27) 291 | $this._hide(event); 292 | 293 | }); 294 | 295 | return $this; 296 | 297 | }; 298 | 299 | /** 300 | * Apply "placeholder" attribute polyfill to one or more forms. 301 | * @return {jQuery} jQuery object. 302 | */ 303 | $.fn.placeholder = function() { 304 | 305 | // Browser natively supports placeholders? Bail. 306 | if (typeof (document.createElement('input')).placeholder != 'undefined') 307 | return $(this); 308 | 309 | // No elements? 310 | if (this.length == 0) 311 | return $this; 312 | 313 | // Multiple elements? 314 | if (this.length > 1) { 315 | 316 | for (var i=0; i < this.length; i++) 317 | $(this[i]).placeholder(); 318 | 319 | return $this; 320 | 321 | } 322 | 323 | // Vars. 324 | var $this = $(this); 325 | 326 | // Text, TextArea. 327 | $this.find('input[type=text],textarea') 328 | .each(function() { 329 | 330 | var i = $(this); 331 | 332 | if (i.val() == '' 333 | || i.val() == i.attr('placeholder')) 334 | i 335 | .addClass('polyfill-placeholder') 336 | .val(i.attr('placeholder')); 337 | 338 | }) 339 | .on('blur', function() { 340 | 341 | var i = $(this); 342 | 343 | if (i.attr('name').match(/-polyfill-field$/)) 344 | return; 345 | 346 | if (i.val() == '') 347 | i 348 | .addClass('polyfill-placeholder') 349 | .val(i.attr('placeholder')); 350 | 351 | }) 352 | .on('focus', function() { 353 | 354 | var i = $(this); 355 | 356 | if (i.attr('name').match(/-polyfill-field$/)) 357 | return; 358 | 359 | if (i.val() == i.attr('placeholder')) 360 | i 361 | .removeClass('polyfill-placeholder') 362 | .val(''); 363 | 364 | }); 365 | 366 | // Password. 367 | $this.find('input[type=password]') 368 | .each(function() { 369 | 370 | var i = $(this); 371 | var x = $( 372 | $('
') 373 | .append(i.clone()) 374 | .remove() 375 | .html() 376 | .replace(/type="password"/i, 'type="text"') 377 | .replace(/type=password/i, 'type=text') 378 | ); 379 | 380 | if (i.attr('id') != '') 381 | x.attr('id', i.attr('id') + '-polyfill-field'); 382 | 383 | if (i.attr('name') != '') 384 | x.attr('name', i.attr('name') + '-polyfill-field'); 385 | 386 | x.addClass('polyfill-placeholder') 387 | .val(x.attr('placeholder')).insertAfter(i); 388 | 389 | if (i.val() == '') 390 | i.hide(); 391 | else 392 | x.hide(); 393 | 394 | i 395 | .on('blur', function(event) { 396 | 397 | event.preventDefault(); 398 | 399 | var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 400 | 401 | if (i.val() == '') { 402 | 403 | i.hide(); 404 | x.show(); 405 | 406 | } 407 | 408 | }); 409 | 410 | x 411 | .on('focus', function(event) { 412 | 413 | event.preventDefault(); 414 | 415 | var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']'); 416 | 417 | x.hide(); 418 | 419 | i 420 | .show() 421 | .focus(); 422 | 423 | }) 424 | .on('keypress', function(event) { 425 | 426 | event.preventDefault(); 427 | x.val(''); 428 | 429 | }); 430 | 431 | }); 432 | 433 | // Events. 434 | $this 435 | .on('submit', function() { 436 | 437 | $this.find('input[type=text],input[type=password],textarea') 438 | .each(function(event) { 439 | 440 | var i = $(this); 441 | 442 | if (i.attr('name').match(/-polyfill-field$/)) 443 | i.attr('name', ''); 444 | 445 | if (i.val() == i.attr('placeholder')) { 446 | 447 | i.removeClass('polyfill-placeholder'); 448 | i.val(''); 449 | 450 | } 451 | 452 | }); 453 | 454 | }) 455 | .on('reset', function(event) { 456 | 457 | event.preventDefault(); 458 | 459 | $this.find('select') 460 | .val($('option:first').val()); 461 | 462 | $this.find('input,textarea') 463 | .each(function() { 464 | 465 | var i = $(this), 466 | x; 467 | 468 | i.removeClass('polyfill-placeholder'); 469 | 470 | switch (this.type) { 471 | 472 | case 'submit': 473 | case 'reset': 474 | break; 475 | 476 | case 'password': 477 | i.val(i.attr('defaultValue')); 478 | 479 | x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 480 | 481 | if (i.val() == '') { 482 | i.hide(); 483 | x.show(); 484 | } 485 | else { 486 | i.show(); 487 | x.hide(); 488 | } 489 | 490 | break; 491 | 492 | case 'checkbox': 493 | case 'radio': 494 | i.attr('checked', i.attr('defaultValue')); 495 | break; 496 | 497 | case 'text': 498 | case 'textarea': 499 | i.val(i.attr('defaultValue')); 500 | 501 | if (i.val() == '') { 502 | i.addClass('polyfill-placeholder'); 503 | i.val(i.attr('placeholder')); 504 | } 505 | 506 | break; 507 | 508 | default: 509 | i.val(i.attr('defaultValue')); 510 | break; 511 | 512 | } 513 | }); 514 | 515 | }); 516 | 517 | return $this; 518 | 519 | }; 520 | 521 | /** 522 | * Moves elements to/from the first positions of their respective parents. 523 | * @param {jQuery} $elements Elements (or selector) to move. 524 | * @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations. 525 | */ 526 | $.prioritize = function($elements, condition) { 527 | 528 | var key = '__prioritize'; 529 | 530 | // Expand $elements if it's not already a jQuery object. 531 | if (typeof $elements != 'jQuery') 532 | $elements = $($elements); 533 | 534 | // Step through elements. 535 | $elements.each(function() { 536 | 537 | var $e = $(this), $p, 538 | $parent = $e.parent(); 539 | 540 | // No parent? Bail. 541 | if ($parent.length == 0) 542 | return; 543 | 544 | // Not moved? Move it. 545 | if (!$e.data(key)) { 546 | 547 | // Condition is false? Bail. 548 | if (!condition) 549 | return; 550 | 551 | // Get placeholder (which will serve as our point of reference for when this element needs to move back). 552 | $p = $e.prev(); 553 | 554 | // Couldn't find anything? Means this element's already at the top, so bail. 555 | if ($p.length == 0) 556 | return; 557 | 558 | // Move element to top of parent. 559 | $e.prependTo($parent); 560 | 561 | // Mark element as moved. 562 | $e.data(key, $p); 563 | 564 | } 565 | 566 | // Moved already? 567 | else { 568 | 569 | // Condition is true? Bail. 570 | if (condition) 571 | return; 572 | 573 | $p = $e.data(key); 574 | 575 | // Move element back to its original location (using our placeholder). 576 | $e.insertAfter($p); 577 | 578 | // Unmark element as moved. 579 | $e.removeData(key); 580 | 581 | } 582 | 583 | }); 584 | 585 | }; 586 | 587 | })(jQuery); --------------------------------------------------------------------------------