├── .DS_Store ├── .bookignore ├── .gitignore ├── Gruntfile.js ├── LICENSE.txt ├── README.md ├── SUMMARY.md ├── array_map_parseint └── README.md ├── autoexecute └── README.md ├── banking └── README.md ├── book.json ├── conditionals_functions └── README.md ├── cover.jpg ├── cover.png ├── delete └── README.md ├── detectIE └── README.md ├── docs ├── GLOSSARY.html ├── LICENSE.txt ├── array_map_parseint │ └── README.html ├── autoexecute │ └── README.html ├── banking │ └── README.html ├── conditionals_functions │ └── README.html ├── cover.jpg ├── cover.png ├── delete │ └── README.html ├── detectIE │ └── README.html ├── encapsulate_collection │ └── README.html ├── even_odd │ └── README.html ├── fooling_around_boolean │ └── README.html ├── fooling_around_boolean_2 │ └── README.html ├── frozen │ └── README.html ├── ghost_array │ └── README.html ├── gitbook │ ├── app.js │ ├── fonts │ │ ├── fontawesome │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ ├── merriweather │ │ │ ├── 250.woff │ │ │ ├── 250i.woff │ │ │ ├── 400.woff │ │ │ ├── 400i.woff │ │ │ ├── 700.woff │ │ │ ├── 700i.woff │ │ │ ├── 900.woff │ │ │ └── 900i.woff │ │ └── opensans │ │ │ ├── 300.woff │ │ │ ├── 300i.woff │ │ │ ├── 400.woff │ │ │ ├── 400i.woff │ │ │ ├── 600.woff │ │ │ ├── 600i.woff │ │ │ ├── 700.woff │ │ │ └── 700i.woff │ ├── images │ │ ├── apple-touch-icon-precomposed-152.png │ │ └── favicon.ico │ ├── plugins │ │ ├── gitbook-plugin-exercises │ │ │ ├── ace │ │ │ │ ├── ace.js │ │ │ │ ├── ext-chromevox.js │ │ │ │ ├── ext-elastic_tabstops_lite.js │ │ │ │ ├── ext-emmet.js │ │ │ │ ├── ext-error_marker.js │ │ │ │ ├── ext-keybinding_menu.js │ │ │ │ ├── ext-language_tools.js │ │ │ │ ├── ext-modelist.js │ │ │ │ ├── ext-old_ie.js │ │ │ │ ├── ext-searchbox.js │ │ │ │ ├── ext-settings_menu.js │ │ │ │ ├── ext-spellcheck.js │ │ │ │ ├── ext-split.js │ │ │ │ ├── ext-static_highlight.js │ │ │ │ ├── ext-statusbar.js │ │ │ │ ├── ext-textarea.js │ │ │ │ ├── ext-themelist.js │ │ │ │ ├── ext-whitespace.js │ │ │ │ ├── keybinding-emacs.js │ │ │ │ ├── keybinding-vim.js │ │ │ │ ├── mode-abap.js │ │ │ │ ├── mode-actionscript.js │ │ │ │ ├── mode-ada.js │ │ │ │ ├── mode-apache_conf.js │ │ │ │ ├── mode-asciidoc.js │ │ │ │ ├── mode-assembly_x86.js │ │ │ │ ├── mode-autohotkey.js │ │ │ │ ├── mode-batchfile.js │ │ │ │ ├── mode-c9search.js │ │ │ │ ├── mode-c_cpp.js │ │ │ │ ├── mode-cirru.js │ │ │ │ ├── mode-clojure.js │ │ │ │ ├── mode-cobol.js │ │ │ │ ├── mode-coffee.js │ │ │ │ ├── mode-coldfusion.js │ │ │ │ ├── mode-csharp.js │ │ │ │ ├── mode-css.js │ │ │ │ ├── mode-curly.js │ │ │ │ ├── mode-d.js │ │ │ │ ├── mode-dart.js │ │ │ │ ├── mode-diff.js │ │ │ │ ├── mode-django.js │ │ │ │ ├── mode-dot.js │ │ │ │ ├── mode-ejs.js │ │ │ │ ├── mode-erlang.js │ │ │ │ ├── mode-forth.js │ │ │ │ ├── mode-ftl.js │ │ │ │ ├── mode-gherkin.js │ │ │ │ ├── mode-glsl.js │ │ │ │ ├── mode-golang.js │ │ │ │ ├── mode-groovy.js │ │ │ │ ├── mode-haml.js │ │ │ │ ├── mode-handlebars.js │ │ │ │ ├── mode-haskell.js │ │ │ │ ├── mode-haxe.js │ │ │ │ ├── mode-html.js │ │ │ │ ├── mode-html_completions.js │ │ │ │ ├── mode-html_ruby.js │ │ │ │ ├── mode-ini.js │ │ │ │ ├── mode-jack.js │ │ │ │ ├── mode-jade.js │ │ │ │ ├── mode-java.js │ │ │ │ ├── mode-javascript.js │ │ │ │ ├── mode-json.js │ │ │ │ ├── mode-jsoniq.js │ │ │ │ ├── mode-jsp.js │ │ │ │ ├── mode-jsx.js │ │ │ │ ├── mode-julia.js │ │ │ │ ├── mode-latex.js │ │ │ │ ├── mode-less.js │ │ │ │ ├── mode-liquid.js │ │ │ │ ├── mode-lisp.js │ │ │ │ ├── mode-livescript.js │ │ │ │ ├── mode-logiql.js │ │ │ │ ├── mode-lsl.js │ │ │ │ ├── mode-lua.js │ │ │ │ ├── mode-luapage.js │ │ │ │ ├── mode-lucene.js │ │ │ │ ├── mode-makefile.js │ │ │ │ ├── mode-markdown.js │ │ │ │ ├── mode-matlab.js │ │ │ │ ├── mode-mel.js │ │ │ │ ├── mode-mushcode.js │ │ │ │ ├── mode-mushcode_high_rules.js │ │ │ │ ├── mode-mysql.js │ │ │ │ ├── mode-nix.js │ │ │ │ ├── mode-objectivec.js │ │ │ │ ├── mode-ocaml.js │ │ │ │ ├── mode-pascal.js │ │ │ │ ├── mode-perl.js │ │ │ │ ├── mode-pgsql.js │ │ │ │ ├── mode-php.js │ │ │ │ ├── mode-plain_text.js │ │ │ │ ├── mode-powershell.js │ │ │ │ ├── mode-prolog.js │ │ │ │ ├── mode-properties.js │ │ │ │ ├── mode-protobuf.js │ │ │ │ ├── mode-python.js │ │ │ │ ├── mode-r.js │ │ │ │ ├── mode-rdoc.js │ │ │ │ ├── mode-rhtml.js │ │ │ │ ├── mode-ruby.js │ │ │ │ ├── mode-rust.js │ │ │ │ ├── mode-sass.js │ │ │ │ ├── mode-scad.js │ │ │ │ ├── mode-scala.js │ │ │ │ ├── mode-scheme.js │ │ │ │ ├── mode-scss.js │ │ │ │ ├── mode-sh.js │ │ │ │ ├── mode-sjs.js │ │ │ │ ├── mode-smarty.js │ │ │ │ ├── mode-snippets.js │ │ │ │ ├── mode-soy_template.js │ │ │ │ ├── mode-space.js │ │ │ │ ├── mode-sql.js │ │ │ │ ├── mode-stylus.js │ │ │ │ ├── mode-svg.js │ │ │ │ ├── mode-tcl.js │ │ │ │ ├── mode-tex.js │ │ │ │ ├── mode-text.js │ │ │ │ ├── mode-textile.js │ │ │ │ ├── mode-toml.js │ │ │ │ ├── mode-twig.js │ │ │ │ ├── mode-typescript.js │ │ │ │ ├── mode-vbscript.js │ │ │ │ ├── mode-velocity.js │ │ │ │ ├── mode-verilog.js │ │ │ │ ├── mode-vhdl.js │ │ │ │ ├── mode-xml.js │ │ │ │ ├── mode-xquery.js │ │ │ │ ├── mode-yaml.js │ │ │ │ ├── snippets │ │ │ │ │ ├── abap.js │ │ │ │ │ ├── actionscript.js │ │ │ │ │ ├── ada.js │ │ │ │ │ ├── apache_conf.js │ │ │ │ │ ├── asciidoc.js │ │ │ │ │ ├── assembly_x86.js │ │ │ │ │ ├── autohotkey.js │ │ │ │ │ ├── batchfile.js │ │ │ │ │ ├── c9search.js │ │ │ │ │ ├── c_cpp.js │ │ │ │ │ ├── cirru.js │ │ │ │ │ ├── clojure.js │ │ │ │ │ ├── cobol.js │ │ │ │ │ ├── coffee.js │ │ │ │ │ ├── coldfusion.js │ │ │ │ │ ├── csharp.js │ │ │ │ │ ├── css.js │ │ │ │ │ ├── curly.js │ │ │ │ │ ├── d.js │ │ │ │ │ ├── dart.js │ │ │ │ │ ├── diff.js │ │ │ │ │ ├── django.js │ │ │ │ │ ├── dot.js │ │ │ │ │ ├── ejs.js │ │ │ │ │ ├── erlang.js │ │ │ │ │ ├── forth.js │ │ │ │ │ ├── ftl.js │ │ │ │ │ ├── gherkin.js │ │ │ │ │ ├── glsl.js │ │ │ │ │ ├── golang.js │ │ │ │ │ ├── groovy.js │ │ │ │ │ ├── haml.js │ │ │ │ │ ├── handlebars.js │ │ │ │ │ ├── haskell.js │ │ │ │ │ ├── haxe.js │ │ │ │ │ ├── html.js │ │ │ │ │ ├── html_completions.js │ │ │ │ │ ├── html_ruby.js │ │ │ │ │ ├── ini.js │ │ │ │ │ ├── jack.js │ │ │ │ │ ├── jade.js │ │ │ │ │ ├── java.js │ │ │ │ │ ├── javascript.js │ │ │ │ │ ├── json.js │ │ │ │ │ ├── jsoniq.js │ │ │ │ │ ├── jsp.js │ │ │ │ │ ├── jsx.js │ │ │ │ │ ├── julia.js │ │ │ │ │ ├── latex.js │ │ │ │ │ ├── less.js │ │ │ │ │ ├── liquid.js │ │ │ │ │ ├── lisp.js │ │ │ │ │ ├── livescript.js │ │ │ │ │ ├── logiql.js │ │ │ │ │ ├── lsl.js │ │ │ │ │ ├── lua.js │ │ │ │ │ ├── luapage.js │ │ │ │ │ ├── lucene.js │ │ │ │ │ ├── makefile.js │ │ │ │ │ ├── markdown.js │ │ │ │ │ ├── matlab.js │ │ │ │ │ ├── mel.js │ │ │ │ │ ├── mushcode.js │ │ │ │ │ ├── mushcode_high_rules.js │ │ │ │ │ ├── mysql.js │ │ │ │ │ ├── nix.js │ │ │ │ │ ├── objectivec.js │ │ │ │ │ ├── ocaml.js │ │ │ │ │ ├── pascal.js │ │ │ │ │ ├── perl.js │ │ │ │ │ ├── pgsql.js │ │ │ │ │ ├── php.js │ │ │ │ │ ├── plain_text.js │ │ │ │ │ ├── powershell.js │ │ │ │ │ ├── prolog.js │ │ │ │ │ ├── properties.js │ │ │ │ │ ├── protobuf.js │ │ │ │ │ ├── python.js │ │ │ │ │ ├── r.js │ │ │ │ │ ├── rdoc.js │ │ │ │ │ ├── rhtml.js │ │ │ │ │ ├── ruby.js │ │ │ │ │ ├── rust.js │ │ │ │ │ ├── sass.js │ │ │ │ │ ├── scad.js │ │ │ │ │ ├── scala.js │ │ │ │ │ ├── scheme.js │ │ │ │ │ ├── scss.js │ │ │ │ │ ├── sh.js │ │ │ │ │ ├── sjs.js │ │ │ │ │ ├── smarty.js │ │ │ │ │ ├── snippets.js │ │ │ │ │ ├── soy_template.js │ │ │ │ │ ├── space.js │ │ │ │ │ ├── sql.js │ │ │ │ │ ├── stylus.js │ │ │ │ │ ├── svg.js │ │ │ │ │ ├── tcl.js │ │ │ │ │ ├── tex.js │ │ │ │ │ ├── text.js │ │ │ │ │ ├── textile.js │ │ │ │ │ ├── toml.js │ │ │ │ │ ├── twig.js │ │ │ │ │ ├── typescript.js │ │ │ │ │ ├── vbscript.js │ │ │ │ │ ├── velocity.js │ │ │ │ │ ├── verilog.js │ │ │ │ │ ├── vhdl.js │ │ │ │ │ ├── xml.js │ │ │ │ │ ├── xquery.js │ │ │ │ │ └── yaml.js │ │ │ │ ├── theme-ambiance.js │ │ │ │ ├── theme-chaos.js │ │ │ │ ├── theme-chrome.js │ │ │ │ ├── theme-clouds.js │ │ │ │ ├── theme-clouds_midnight.js │ │ │ │ ├── theme-cobalt.js │ │ │ │ ├── theme-crimson_editor.js │ │ │ │ ├── theme-dawn.js │ │ │ │ ├── theme-dreamweaver.js │ │ │ │ ├── theme-eclipse.js │ │ │ │ ├── theme-github.js │ │ │ │ ├── theme-idle_fingers.js │ │ │ │ ├── theme-katzenmilch.js │ │ │ │ ├── theme-kr.js │ │ │ │ ├── theme-kuroir.js │ │ │ │ ├── theme-merbivore.js │ │ │ │ ├── theme-merbivore_soft.js │ │ │ │ ├── theme-mono_industrial.js │ │ │ │ ├── theme-monokai.js │ │ │ │ ├── theme-pastel_on_dark.js │ │ │ │ ├── theme-solarized_dark.js │ │ │ │ ├── theme-solarized_light.js │ │ │ │ ├── theme-terminal.js │ │ │ │ ├── theme-textmate.js │ │ │ │ ├── theme-tomorrow.js │ │ │ │ ├── theme-tomorrow_night.js │ │ │ │ ├── theme-tomorrow_night_blue.js │ │ │ │ ├── theme-tomorrow_night_bright.js │ │ │ │ ├── theme-tomorrow_night_eighties.js │ │ │ │ ├── theme-twilight.js │ │ │ │ ├── theme-vibrant_ink.js │ │ │ │ ├── theme-xcode.js │ │ │ │ ├── worker-coffee.js │ │ │ │ ├── worker-css.js │ │ │ │ ├── worker-html.js │ │ │ │ ├── worker-javascript.js │ │ │ │ ├── worker-json.js │ │ │ │ ├── worker-lua.js │ │ │ │ ├── worker-php.js │ │ │ │ └── worker-xquery.js │ │ │ ├── exercises.css │ │ │ ├── exercises.js │ │ │ └── jsrepl │ │ │ │ ├── engines │ │ │ │ └── javascript-default.js │ │ │ │ ├── jsrepl.js │ │ │ │ ├── langs │ │ │ │ └── javascript │ │ │ │ │ └── jsrepl_js.js │ │ │ │ ├── sandbox.html │ │ │ │ └── sandbox.js │ │ └── gitbook-plugin-mathjax │ │ │ └── plugin.js │ ├── print.css │ └── style.css ├── glossary_index.json ├── hoisting1 │ └── README.html ├── index.html ├── input_search │ └── README.html ├── intro │ └── README.md ├── invaluable │ └── README.html ├── json │ └── README.html ├── nested_loop │ └── README.html ├── nested_scopes │ └── README.html ├── now_you_see_me │ └── README.html ├── objects1 │ └── README.html ├── objects2 │ └── README.html ├── point │ └── README.html ├── running_man │ └── README.html ├── scope │ └── README.html ├── search_index.json ├── spartacus │ └── README.html ├── terminator │ └── README.html ├── timers │ └── README.html ├── undefined_values_in_array │ └── README.html ├── utf8 │ └── README.html └── variable_scope │ └── README.html ├── encapsulate_collection └── README.md ├── even_odd └── README.md ├── fooling_around_boolean └── README.md ├── fooling_around_boolean_2 └── README.md ├── frozen └── README.md ├── ghost_array └── README.md ├── hoisting1 └── README.md ├── input_search └── README.md ├── intro └── README.md ├── invaluable └── README.md ├── json └── README.md ├── nested_loop └── README.md ├── nested_scopes └── README.md ├── now_you_see_me └── README.md ├── objects1 └── README.md ├── objects2 └── README.md ├── package.json ├── point └── README.md ├── running_man └── README.md ├── scope └── README.md ├── spartacus └── README.md ├── terminator └── README.md ├── timers └── README.md ├── undefined_values_in_array └── README.md ├── utf8 └── README.md └── variable_scope └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/.DS_Store -------------------------------------------------------------------------------- /.bookignore: -------------------------------------------------------------------------------- 1 | .grunt 2 | .bookignore 3 | .gitignore 4 | Gruntfile.js 5 | package.json -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | _book 4 | book.epub 5 | book.pdf 6 | book.mobi -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | var exec = require("child_process").exec; 3 | 4 | module.exports = function (grunt) { 5 | grunt.loadNpmTasks('grunt-gitbook'); 6 | grunt.loadNpmTasks('grunt-gh-pages'); 7 | grunt.loadNpmTasks('grunt-contrib-clean'); 8 | 9 | grunt.initConfig({ 10 | 'gitbook': { 11 | development: { 12 | output: path.join(__dirname, "docs"), 13 | input: "./", 14 | title: "Javascript Challenges", 15 | description: "Challenge your self to learn and understand the most obscure and tricky parts of Javascript.", 16 | github: "tcorral/javascript-challenges-book" 17 | } 18 | }, 19 | 'gh-pages': { 20 | options: { 21 | base: 'docs' 22 | }, 23 | src: ['**'] 24 | }, 25 | 'clean': { 26 | files: '.grunt' 27 | } 28 | }); 29 | 30 | grunt.registerTask('publish', [ 31 | 'gitbook', 32 | 'gh-pages', 33 | 'clean' 34 | ]); 35 | 36 | grunt.registerTask('pdf', function (grunt){ 37 | var done = this.async(); 38 | exec('gitbook pdf ./', function (err, stdout, stderr) { 39 | if(err){ 40 | console.log('exec error:' + err); 41 | } 42 | console.log('stderr:', stderr); 43 | console.log('stdout:', stdout); 44 | done(); 45 | }) 46 | }); 47 | 48 | grunt.registerTask('epub', function (grunt){ 49 | var done = this.async(); 50 | exec('gitbook epub ./', function (err, stdout, stderr) { 51 | if(err){ 52 | console.log('exec error:' + err); 53 | } 54 | console.log('stderr:', stderr); 55 | console.log('stdout:', stdout); 56 | done(); 57 | }) 58 | }); 59 | 60 | grunt.registerTask('mobi', function (grunt){ 61 | var done = this.async(); 62 | exec('gitbook mobi ./', function (err, stdout, stderr) { 63 | if(err){ 64 | console.log('exec error:' + err); 65 | } 66 | console.log('stderr:', stderr); 67 | console.log('stdout:', stdout); 68 | done(); 69 | }) 70 | }); 71 | grunt.registerTask('default', ['gitbook', 'pdf', 'epub', 'mobi']); 72 | }; -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Tomas Corral Casas 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Javascript Challenges 2 | This book will challenge you to learn and understand the most obscure and tricky parts of Javascript. 3 | 4 | In order to perform the best that you can I recommend you not to cheat taking a look at solutions before you suggest one. 5 | 6 | This book can be used as a learning resource for Javascript training if you want, but please send a tweet recommending us to other people. 7 | 8 | I hope you enjoy this book because this is the purpose of this book. 9 | 10 | Feedback is welcome. 11 | 12 | Thanks a lot to [GITBOOK team](http://www.gitbook.io/) for it's amazing project to write your own books using Github repos. 13 | 14 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Intro](README.md) 4 | * [Self Invoking Functions](autoexecute/README.md) 5 | * [Floats Operations Imprecision](banking/README.md) 6 | * [Hoisting and Conditionals](hoisting1/README.md) 7 | * [Checking Properties](objects1/README.md) 8 | * [Closure and Objects](objects2/README.md) 9 | * [Conditionals and Functions](conditionals_functions/README.md) 10 | * [Delete](delete/README.md) 11 | * [Detect Internet Explorer](detectIE/README.md) 12 | * [Don't judge a book by its cover](utf8/README.md) 13 | * [Encapsulate collection](encapsulate_collection/README.md) 14 | * [Even or Odd](even_odd/README.md) 15 | * [Exit nested loop](nested_loop/README.md) 16 | * [#1 Fooling around boolean](fooling_around_boolean/README.md) 17 | * [#2 Fooling around boolean](fooling_around_boolean_2/README.md) 18 | * [Ghost Array](ghost_array/README.md) 19 | * [Input Search](input_search/README.md) 20 | * [Invaluable](invaluable/README.md) 21 | * [JSON](json/README.md) 22 | * [Nested Scopes](nested_scopes/README.md) 23 | * [Now you see me...](now_you_see_me/README.md) 24 | * [Frozen](frozen/README.md) 25 | * [Point](point/README.md) 26 | * [Running Man](running_man/README.md) 27 | * [Scope](scope/README.md) 28 | * [Spartacus](spartacus/README.md) 29 | * [Terminator](terminator/README.md) 30 | * [Timers](timers/README.md) 31 | * [Undefined Values in Arrays](undefined_values_in_array/README.md) 32 | * [Array Map and ParseInt](array_map_parseint/README.md) 33 | * [Variable Scope](variable_scope/README.md) -------------------------------------------------------------------------------- /array_map_parseint/README.md: -------------------------------------------------------------------------------- 1 | # Using Array.prototype.map and parseInt 2 | 3 | ## Snippet 1 4 | ``` 5 | var result = ['1','10','100','1000','10000', '100000', '1000000'].map(parseInt) 6 | ``` 7 | 8 | ## Expected 9 | ``` 10 | var result = [1, 10, 100, 1000, 10000, 100000, 100000]; 11 | ``` 12 | --- 13 | What's the result of executing Snippet 1 code? 14 | ```js 15 | var result = ; 16 | ``` 17 | ```js 18 | var result = [1, NaN, 4, 27, 256, 3125, 46656]; 19 | ``` 20 | ```js 21 | assert(result[0] === 1 && isNaN(result[1]) && result[2] === 4 && result[3] === 27 && result[4] === 256 &&& result[5] === 3125 && result[6] === 46656); 22 | ``` 23 | --- 24 | 25 | --- 26 | Why? 27 | ```js 28 | 29 | ``` 30 | ```js 31 | Array.prototype.map has three arguments that pass to the callback we set as argument: 32 | * value 33 | * index 34 | * arr 35 | When we check the specifications of parseInt we can see that parseInt could receive two arguments. 36 | The former is the string to be parsed and the latter is the ratio to convert the value. 37 | 38 | When we run Snippet 1 code, the following is actually executed: 39 | * parseInt(1, 0) => 1 40 | * parseInt(10, 1) => NaN 41 | * parseInt(100, 2) => 4 42 | * parseInt(1000, 3) => 27 43 | * parseInt(10000, 4) => 256 44 | * parseInt(100000, 5) => 3125 45 | * parseInt(1000000, 6) => 46656 46 | ``` 47 | ```js 48 | __match_answer_and_solution__ 49 | ``` 50 | --- 51 | 52 | --- 53 | We need to get the same array as in Expected 1, please fix the code: 54 | ```js 55 | var result = ['1','10','100','1000','10000', '100000', '1000000'].map(parseInt) 56 | ``` 57 | ```js 58 | var result = ['1','10','100','1000','10000', '100000', '1000000'].map(Number) 59 | ``` 60 | ```js 61 | assert(result[0] === 1 && result[1] === 10 && result[2] === 100 && result[3] === 1000 && result[4] === 10000 && result[5] === 100000 && result[6] === 1000000 ); 62 | ``` 63 | --- 64 | -------------------------------------------------------------------------------- /autoexecute/README.md: -------------------------------------------------------------------------------- 1 | # Self Invoking Functions 2 | 3 | I want to set variable 'testValue' to 3 using a Self Invoking Function, can you help me? 4 | 5 | ``` 6 | var testValue; 7 | function test() { testValue = 3; }(); 8 | ``` 9 | 10 | --- 11 | 12 | What is the result of executing the previous code? 13 | 14 | ```js 15 | 16 | ``` 17 | 18 | ```js 19 | SyntaxError: Unexpected token ) 20 | ``` 21 | 22 | ```js 23 | __match_answer_and_solution__ 24 | ``` 25 | 26 | --- 27 | 28 | --- 29 | 30 | What is the value of variable 'testValue'? 31 | 32 | ```js 33 | 34 | ``` 35 | 36 | ```js 37 | undefined 38 | ``` 39 | 40 | ```js 41 | __match_answer_and_solution__ 42 | ``` 43 | 44 | --- 45 | 46 | 47 | --- 48 | 49 | Why? 50 | 51 | ```js 52 | 53 | ``` 54 | 55 | ```js 56 | The value of testValue is undefined because the function has not been autoexecuted. 57 | ``` 58 | 59 | ```js 60 | __match_answer_and_solution__ 61 | ``` 62 | 63 | --- 64 | 65 | --- 66 | 67 | Write the code to execute this function adding only one more character to the sentence. 68 | 69 | ```js 70 | var testValue; 71 | function test() { testValue = 3; }(); 72 | ``` 73 | 74 | ```js 75 | var testValue; 76 | !function test() { testValue = 3; }(); 77 | ``` 78 | 79 | ```js 80 | assert(testValue == 3); 81 | ``` 82 | 83 | --- -------------------------------------------------------------------------------- /banking/README.md: -------------------------------------------------------------------------------- 1 | #Floats Operations Imprecision 2 | 3 | Welcome to Bank Ruptcy, and we want to hire you to fix our algorithm to exchange the stock options, because we have some weird behaviour. 4 | 5 | This is our algorithm to exchange the stock options: 6 | 7 | ``` 8 | var stockOptionsCost = 10.70, paid = 20.80; 9 | 10 | function calculateChange() { 11 | 12 | return paid - stockOptionsCost; 13 | } 14 | 15 | function calculateAmountOfStockOptions () { 16 | return paid / stockOptionsCost; 17 | } 18 | 19 | var amountStockOptions = calculateAmountOfStockOptions(); 20 | var yourChange = calculateChange(); 21 | ``` 22 | 23 | --- 24 | 25 | What returns calculateAmountOfStockOptions ? 26 | 27 | ```js 28 | 29 | ``` 30 | 31 | ```js 32 | 1.94392523364486 33 | ``` 34 | 35 | ```js 36 | __match_answer_and_solution__ 37 | ``` 38 | 39 | --- 40 | 41 | --- 42 | 43 | What is the value of calculateChange ? Input the number value. 44 | 45 | ```js 46 | 47 | ``` 48 | 49 | ```js 50 | 10.100000000000001 51 | ``` 52 | 53 | ```js 54 | __match_answer_and_solution__ 55 | ``` 56 | 57 | --- 58 | 59 | --- 60 | 61 | Why? 62 | 63 | ```js 64 | 65 | ``` 66 | 67 | ```js 68 | Javascript has several problems operating with floating point, this is one of the causes that it should not be to operate with floats. 69 | ``` 70 | 71 | ```js 72 | __match_answer_and_solution__ 73 | ``` 74 | 75 | --- 76 | 77 | --- 78 | 79 | Please fix this code to return the correct change. 80 | 81 | ```js 82 | var stockOptionsCost = 10.70, paid = 20.80; 83 | 84 | function calculateChange() { 85 | 86 | return paid - stockOptionsCost; 87 | } 88 | 89 | function calculateAmountOfStockOptions () { 90 | return paid / stockOptionsCost; 91 | } 92 | 93 | var amountStockOptions = calculateAmountOfStockOptions(); 94 | var yourChange = calculateChange(); 95 | ``` 96 | 97 | ```js 98 | var stockOptionsCost = 10.70, paid = 20.80; 99 | 100 | function calculateChange() { 101 | 102 | return (paid - stockOptionsCost).toFixed(2); 103 | } 104 | 105 | function calculateAmountOfStockOptions () { 106 | return paid / stockOptionsCost; 107 | } 108 | 109 | var amountStockOptions = calculateAmountOfStockOptions(); 110 | var yourChange = calculateChange(); 111 | ``` 112 | 113 | ```js 114 | assert(yourChange == 10.10); 115 | ``` 116 | 117 | --- -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "exercises" 4 | ] 5 | } -------------------------------------------------------------------------------- /conditionals_functions/README.md: -------------------------------------------------------------------------------- 1 | # Conditionals and functions 2 | 3 | Read and execute the following snippets of code: 4 | 5 | ## Snippet 1: 6 | ``` 7 | var test; 8 | 9 | if ( true ) { 10 | test = function () { 11 | console.log( "That's true" ); 12 | }; 13 | } else { 14 | test = function () { 15 | console.log( "That's false" ); 16 | }; 17 | } 18 | 19 | test(); // Shows "That's true" 20 | ``` 21 | 22 | ## Snippet 2: 23 | ``` 24 | if ( true ) { 25 | function test() { 26 | console.log( "That's true" ); 27 | } 28 | } else { 29 | function test() { 30 | console.log( "That's false" ); 31 | } 32 | } 33 | 34 | test(); // Shows "That's false" 35 | ``` 36 | 37 | ## Snippet 3: 38 | ``` 39 | var test; 40 | 41 | if ( true ) { 42 | test = function () { 43 | console.log( "That's true" ); 44 | }; 45 | } else { 46 | function test() { 47 | console.log( "That's false" ); 48 | } 49 | } 50 | 51 | test(); // Shows "That's true" 52 | ``` 53 | 54 | --- 55 | What's the reason of this behaviour? 56 | 57 | ```js 58 | 59 | ``` 60 | 61 | ```js 62 | The execution of Snippet 1 shows "That's true" because function expressions are evaluated in execution time. 63 | The execution of Snippet 2 shows "That's false" because function declarations are evaluated in evaluation time, and the second one overwrittes the first one. 64 | The execution of Snippet 3 shows "That's true" because when the code has been evaluated it has changed to the function that could return "That's false" but when the code has been executed it has been overwritten again with the function expression. 65 | ``` 66 | 67 | ```js 68 | __match_answer_and_solution__ 69 | ``` 70 | --- 71 | -------------------------------------------------------------------------------- /cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/cover.jpg -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/cover.png -------------------------------------------------------------------------------- /delete/README.md: -------------------------------------------------------------------------------- 1 | # Delete 2 | 3 | Execute this code: 4 | ``` 5 | var name = 'John', 6 | obj = { 7 | name: 'James' 8 | }, 9 | Animal, 10 | mammal; 11 | 12 | Animal = function(){}; 13 | Animal.prototype.name = 'animal'; 14 | 15 | mammal = new Animal(); 16 | mammal.name = 'mammal'; 17 | 18 | delete name; 19 | 20 | console.log('#1: ' + name); 21 | 22 | delete obj.name; 23 | 24 | console.log('#2: ' + obj.name); 25 | 26 | delete obj.toString; 27 | 28 | console.log('#3: ' + obj.toString); 29 | 30 | delete mammal.name; 31 | 32 | console.log('#4: ' + mammal.name); 33 | ``` 34 | 35 | The execution of this code logs: 36 | ``` 37 | #1: John 38 | ``` 39 | ``` 40 | #2: undefined 41 | ``` 42 | ``` 43 | #3: function toString() { [native code] } 44 | ``` 45 | ``` 46 | #4: animal 47 | ``` 48 | 49 | --- 50 | 51 | Why **#1: John** is logged? 52 | 53 | ```js 54 | 55 | ``` 56 | ```js 57 | John is logged because name is a global variable and global variables can't be deleted. 58 | ``` 59 | ```js 60 | __match_answer_and_solution__ 61 | ``` 62 | 63 | --- 64 | 65 | --- 66 | 67 | Why **#2: undefined** is logged? 68 | 69 | ```js 70 | 71 | ``` 72 | ```js 73 | undefined is logged because we have deleted the name property of obj, properties or members of objects can be deleted excluding the properties or members of the global object. 74 | ``` 75 | ```js 76 | __match_answer_and_solution__ 77 | ``` 78 | 79 | --- 80 | 81 | --- 82 | 83 | Why **#3: function toString() { [native code] }** is logged? 84 | 85 | ```js 86 | 87 | ``` 88 | ```js 89 | function toString() { [native code] } is logged because toString is an inherited method from Object and inherited methods or members can't be deleted. 90 | ``` 91 | ```js 92 | __match_answer_and_solution__ 93 | ``` 94 | 95 | --- 96 | 97 | --- 98 | 99 | Why **#4: animal** is logged? 100 | 101 | ```js 102 | 103 | ``` 104 | ```js 105 | animal is logged because we have deleted the own mammal.name property but the inherited property is shown. 106 | ``` 107 | ```js 108 | __match_answer_and_solution__ 109 | ``` 110 | 111 | --- -------------------------------------------------------------------------------- /detectIE/README.md: -------------------------------------------------------------------------------- 1 | # Detect Internet Explorer 2 | 3 | --- 4 | To accomplish a task you need to detect Internet Explorer browsers without using browser sniffing. 5 | 6 | The function to detect the browser can be executed in... 7 | 8 | * Opera 9 | * Chrome 10 | * Firefox 11 | * Phantom 12 | * Internet Explorer 13 | 14 | ... and it should return *true* only if the browser is Internet Explorer. 15 | 16 | The function should detect only that browser is Internet Explorer, versions are not relevant but you must perform the action with a single code. 17 | 18 | Write the code: 19 | 20 | ```js 21 | function isIE() { 22 | 23 | } 24 | ``` 25 | 26 | ```js 27 | function isIE() { 28 | window.external = ''; 29 | return typeof window.external === 'object'; 30 | } 31 | ``` 32 | 33 | ```js 34 | assert(trim(isIE.toString()).replace('isIE', '') == trim(isIE_good.toString()).replace('isIE_good', '')); 35 | ``` 36 | 37 | ```js 38 | function isIE_good() { 39 | window.external = ''; 40 | return typeof window.external === 'object'; 41 | } 42 | function trim(str) { 43 | return str.replace(/^\s+|\r\n*|\n*|\s+$/g, ''); 44 | } 45 | ``` 46 | --- -------------------------------------------------------------------------------- /docs/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Tomas Corral Casas 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /docs/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/cover.jpg -------------------------------------------------------------------------------- /docs/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/cover.png -------------------------------------------------------------------------------- /docs/gitbook/fonts/fontawesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/fontawesome/FontAwesome.otf -------------------------------------------------------------------------------- /docs/gitbook/fonts/fontawesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/fontawesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/gitbook/fonts/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/gitbook/fonts/fontawesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/fontawesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/250.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/250.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/250i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/250i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/400.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/400i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/400i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/700.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/700i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/700i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/900.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/merriweather/900i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/merriweather/900i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/300.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/300i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/300i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/400.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/400i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/400i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/600.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/600i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/600i.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/700.woff -------------------------------------------------------------------------------- /docs/gitbook/fonts/opensans/700i.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/fonts/opensans/700i.woff -------------------------------------------------------------------------------- /docs/gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /docs/gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/ext-error_marker.js: -------------------------------------------------------------------------------- 1 | (function(){ace.require(["ace/ext/error_marker"],function(){})})() -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/ext-modelist.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i"),u||l.push(""),f.$renderLine(l,h,!0,!1),l.push("\n");var p="
"+"
"+l.join("")+"
"+"
";return f.destroy(),{css:s+n.cssText,html:p,session:a}},n.exports=a,n.exports.highlight=a}),function(){ace.require(["ace/ext/static_highlight"],function(){})}() -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/ext-statusbar.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}),function(){ace.require(["ace/ext/statusbar"],function(){})}() -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/ext-themelist.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/themelist",["require","exports","module"],function(e,t,n){var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Cobalt","cobalt","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}),function(){ace.require(["ace/ext/themelist"],function(){})}() -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/ext-whitespace.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function h(e){var t=0;for(var r=e;r0&&!(s%c)&&!(l%c)&&(r[c]=(r[c]||0)+1),n[l]=(n[l]||0)+1}s=l;while(ud.score&&(d={score:m,length:u})}if(d.score&&d.score>1.4)var g=d.length;if(i>v+1)return{ch:" ",length:g};if(v+1>i)return{ch:" ",length:g}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t?-1:0;for(var s=0,o=r.length;si&&n.removeInLine(s,a,u.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.AdaHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-cobol.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/cobol_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./cobol_highlight_rules").CobolHighlightRules,u=e("../range").Range,a=function(){this.HighlightRules=o};r.inherits(a,i),function(){this.lineCommentStart="*",this.$id="ace/mode/cobol"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"\\*.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.CobolHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-diff.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/diff_highlight_rules","ace/mode/folding/diff"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./diff_highlight_rules").DiffHighlightRules,u=e("./folding/diff").FoldMode,a=function(){this.HighlightRules=o,this.foldingRules=new u(["diff","index","\\+{3}","@@|\\*{5}"],"i")};r.inherits(a,i),function(){this.$id="ace/mode/diff"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{regex:"^(?:\\*{15}|={67}|-{3}|\\+{3})$",token:"punctuation.definition.separator.diff",name:"keyword"},{regex:"^(@@)(\\s*.+?\\s*)(@@)(.*)$",token:["constant","constant.numeric","constant","comment.doc.tag"]},{regex:"^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",token:["constant.numeric","punctuation.definition.range.diff","constant.function","constant.numeric","punctuation.definition.range.diff","invalid"],name:"meta."},{regex:"^(\\-{3}|\\+{3}|\\*{3})( .+)$",token:["constant.numeric","meta.tag"]},{regex:"^([!+>])(.*?)(\\s*)$",token:["support.constant","text","invalid"]},{regex:"^([<\\-])(.*?)(\\s*)$",token:["support.function","string","invalid"]},{regex:"^(diff)(\\s+--\\w+)?(.+?)( .+)?$",token:["variable","variable","keyword","variable"]},{regex:"^Index.+$",token:"variable"},{regex:"^\\s+$",token:"text"},{regex:"\\s*$",token:"invalid"},{defaultToken:"invisible",caseInsensitive:!0}]}};r.inherits(s,i),t.DiffHighlightRules=s}),ace.define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(e,t){this.regExpList=e,this.flag=t,this.foldingStartMarker=RegExp("^("+e.join("|")+")",this.flag)};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i={row:n,column:r.length},o=this.regExpList;for(var u=1;u<=o.length;u++){var a=RegExp("^("+o.slice(0,u).join("|")+")",this.flag);if(a.test(r))break}for(var f=e.getLength();++n"},{token:"comment",regex:"\\| ",next:"table-item"},{token:"comment",regex:"\\|$",next:"start"}],qqstring3:[{token:"constant.language.escape",regex:s},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],"table-item":[{token:"string",regex:"[A-Za-z0-9 ]*",next:"start"}]}};r.inherits(o,i),t.GherkinHighlightRules=o}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-ini.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/ini_highlight_rules","ace/mode/folding/ini"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./ini_highlight_rules").IniHighlightRules,u=e("./folding/ini").FoldMode,a=function(){this.HighlightRules=o,this.foldingRules=new u};r.inherits(a,i),function(){this.lineCommentStart=";",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/ini"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s="\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})",o=function(){this.$rules={start:[{token:"punctuation.definition.comment.ini",regex:"#.*",push_:[{token:"comment.line.number-sign.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.number-sign.ini"}]},{token:"punctuation.definition.comment.ini",regex:";.*",push_:[{token:"comment.line.semicolon.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.semicolon.ini"}]},{token:["keyword.other.definition.ini","text","punctuation.separator.key-value.ini"],regex:"\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)"},{token:["punctuation.definition.entity.ini","constant.section.group-title.ini","punctuation.definition.entity.ini"],regex:"^(\\[)(.*?)(\\])"},{token:"punctuation.definition.string.begin.ini",regex:"'",push:[{token:"punctuation.definition.string.end.ini",regex:"'",next:"pop"},{token:"constant.language.escape",regex:s},{defaultToken:"string.quoted.single.ini"}]},{token:"punctuation.definition.string.begin.ini",regex:'"',push:[{token:"constant.language.escape",regex:s},{token:"punctuation.definition.string.end.ini",regex:'"',next:"pop"},{defaultToken:"string.quoted.double.ini"}]}]},this.normalizeRules()};o.metaData={fileTypes:["ini","conf"],keyEquivalent:"^~I",name:"Ini",scopeName:"source.ini"},r.inherits(o,i),t.IniHighlightRules=o}),ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^\s*\[([^\])]*)]\s*(?:$|[;#])/,this.getFoldWidgetRange=function(e,t,n){var r=this.foldingStartMarker,s=e.getLine(n),o=s.match(r);if(!o)return;var u=o[1]+".",a=s.length,f=e.getLength(),l=n,c=n;while(++nl){var h=e.getLine(c).length;return new i(l,a,c,h)}}}.call(o.prototype)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-lisp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/lisp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/lisp_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./lisp_highlight_rules").LispHighlightRules,u=function(){this.HighlightRules=o};r.inherits(u,i),function(){this.lineCommentStart=";",this.$id="ace/mode/lisp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/lisp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="case|do|let|loop|if|else|when",t="eq|neq|and|or",n="null|nil",r="cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn",i=this.createKeywordMapper({"keyword.control":e,"keyword.operator":t,"constant.language":n,"support.function":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:";.*$"},{token:["storage.type.function-type.lisp","text","entity.name.function.lisp"],regex:"(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},{token:["punctuation.definition.constant.character.lisp","constant.character.lisp"],regex:"(#)((?:\\w|[\\\\+-=<>'\"&#])+)"},{token:["punctuation.definition.variable.lisp","variable.other.global.lisp","punctuation.definition.variable.lisp"],regex:"(\\*)(\\S*)(\\*)"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"string",regex:'"(?=.)',next:"qqstring"}],qqstring:[{token:"constant.character.escape.lisp",regex:"\\\\."},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"}]}};r.inherits(s,i),t.LispHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-lucene.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/lucene_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./lucene_highlight_rules").LuceneHighlightRules,u=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(u,i),function(){this.$id="ace/mode/lucene"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"constant.character.negation",regex:"[\\-]"},{token:"constant.character.interro",regex:"[\\?]"},{token:"constant.character.asterisk",regex:"[\\*]"},{token:"constant.character.proximity",regex:"~[0-9]+\\b"},{token:"keyword.operator",regex:"(?:AND|OR|NOT)\\b"},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"keyword",regex:"[\\S]+:"},{token:"string",regex:'".*?"'},{token:"text",regex:"\\s+"}]}};r.inherits(o,s),t.LuceneHighlightRules=o}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,u=e("./behaviour").Behaviour,a=function(){this.HighlightRules=o,this.$behaviour=new u};r.inherits(a,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return""},this.$id="ace/mode/plain_text"}.call(a.prototype),t.Mode=a}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-properties.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/properties",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/properties_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./properties_highlight_rules").PropertiesHighlightRules,u=function(){this.HighlightRules=o};r.inherits(u,i),function(){this.$id="ace/mode/properties"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/properties_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=/\\u[0-9a-fA-F]{4}|\\/;this.$rules={start:[{token:"comment",regex:/[!#].*$/},{token:"keyword",regex:/[=:]$/},{token:"keyword",regex:/[=:]/,next:"value"},{token:"constant.language.escape",regex:e},{defaultToken:"variable"}],value:[{regex:/\\$/,token:"string",next:"value"},{regex:/$/,token:"string",next:"start"},{token:"constant.language.escape",regex:e},{defaultToken:"string"}]}};r.inherits(s,i),t.PropertiesHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-scheme.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/scheme_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./scheme_highlight_rules").SchemeHighlightRules,u=function(){this.HighlightRules=o};r.inherits(u,i),function(){this.lineCommentStart=";",this.$id="ace/mode/scheme"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/scheme_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="case|do|let|loop|if|else|when",t="eq?|eqv?|equal?|and|or|not|null?",n="#t|#f",r="cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load",i=this.createKeywordMapper({"keyword.control":e,"keyword.operator":t,"constant.language":n,"support.function":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:";.*$"},{token:["storage.type.function-type.scheme","text","entity.name.function.scheme"],regex:"(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},{token:"punctuation.definition.constant.character.scheme",regex:"#:\\S+"},{token:["punctuation.definition.variable.scheme","variable.other.global.scheme","punctuation.definition.variable.scheme"],regex:"(\\*)(\\S*)(\\*)"},{token:"constant.numeric",regex:"#[xXoObB][0-9a-fA-F]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?"},{token:i,regex:"[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*"},{token:"string",regex:'"(?=.)',next:"qqstring"}],qqstring:[{token:"constant.character.escape.scheme",regex:"\\\\."},{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}]}};r.inherits(s,i),t.SchemeHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-space.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/space",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/folding/coffee","ace/mode/space_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./folding/coffee").FoldMode,u=e("./space_highlight_rules").SpaceHighlightRules,a=function(){var e=new u;this.$tokenizer=new s(e.getRules()),this.foldingRules=new o};r.inherits(a,i),function(){this.$id="ace/mode/space"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.SqlHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-tex.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/tex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,u=e("./tex_highlight_rules").TexHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=function(e){e?this.HighlightRules=o:this.HighlightRules=u,this.$outdent=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.allowAutoInsert=function(){return!1},this.$id="ace/mode/tex"}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-text.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcorral/javascript-challenges-book/47c58fc67ac47400ab30d18584c812475bf63813/docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-text.js -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-textile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./textile_highlight_rules").TextileHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=function(){this.HighlightRules=o,this.$outdent=new u};r.inherits(a,i),function(){this.getNextLineIndent=function(e,t,n){return e=="intag"?n:""},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/textile"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:function(e){return e.charAt(0)=="h"?"markup.heading."+e.charAt(1):"markup.heading"},regex:"h1|h2|h3|h4|h5|h6|bq|p|bc|pre",next:"blocktag"},{token:"keyword",regex:"[\\*]+|[#]+"},{token:"text",regex:".+"}],blocktag:[{token:"keyword",regex:"\\. ",next:"start"},{token:"keyword",regex:"\\(",next:"blocktagproperties"}],blocktagproperties:[{token:"keyword",regex:"\\)",next:"blocktag"},{token:"string",regex:"[a-zA-Z0-9\\-_]+"},{token:"keyword",regex:"#"}]}};r.inherits(s,i),t.TextileHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-toml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/toml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/toml_highlight_rules","ace/mode/folding/ini"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./toml_highlight_rules").TomlHighlightRules,u=e("./folding/ini").FoldMode,a=function(){this.HighlightRules=o,this.foldingRules=new u};r.inherits(a,i),function(){this.lineCommentStart="#",this.$id="ace/mode/toml"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/toml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=this.createKeywordMapper({"constant.language.boolean":"true|false"},"identifier"),t="[a-zA-Z\\$_\xa1-\uffff][a-zA-Z\\d\\$_\xa1-\uffff]*\\b";this.$rules={start:[{token:"comment.toml",regex:/#.*$/},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:["variable.keygroup.toml"],regex:"(?:^\\s*)(\\[([^\\]]+)\\])"},{token:e,regex:t},{token:"support.date.toml",regex:"\\d{4}-\\d{2}-\\d{2}(T)\\d{2}:\\d{2}:\\d{2}(Z)"},{token:"constant.numeric.toml",regex:"-?\\d+(\\.?\\d+)?"}],qqstring:[{token:"string",regex:"\\\\$",next:"qqstring"},{token:"constant.language.escape",regex:'\\\\[0tnr"\\\\]'},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}]}};r.inherits(s,i),t.TomlHighlightRules=s}),ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^\s*\[([^\])]*)]\s*(?:$|[;#])/,this.getFoldWidgetRange=function(e,t,n){var r=this.foldingStartMarker,s=e.getLine(n),o=s.match(r);if(!o)return;var u=o[1]+".",a=s.length,f=e.getLength(),l=n,c=n;while(++nl){var h=e.getLine(c).length;return new i(l,a,c,h)}}}.call(o.prototype)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-verilog.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/verilog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/verilog_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./verilog_highlight_rules").VerilogHighlightRules,u=e("../range").Range,a=function(){this.HighlightRules=o};r.inherits(a,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/verilog"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/verilog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="always|and|assign|automatic|begin|buf|bufif0|bufif1|case|casex|casez|cell|cmos|config|deassign|default|defparam|design|disable|edge|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|event|for|force|forever|fork|function|generate|genvar|highz0|highz1|if|ifnone|incdir|include|initial|inout|input|instance|integer|join|large|liblist|library|localparam|macromodule|medium|module|nand|negedge|nmos|nor|noshowcancelled|not|notif0|notif1|or|output|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|rcmos|real|realtime|reg|release|repeat|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|showcancelled|signed|small|specify|specparam|strong0|strong1|supply0|supply1|table|task|time|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|unsigned|use|vectored|wait|wand|weak0|weak1|while|wire|wor|xnor|xorbegin|bufif0|bufif1|case|casex|casez|config|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|for|forever|function|generate|if|ifnone|macromodule|module|primitive|repeat|specify|table|task|while",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"//.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.VerilogHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/mode-vhdl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/vhdl_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./vhdl_highlight_rules").VHDLHighlightRules,u=e("../range").Range,a=function(){this.HighlightRules=o};r.inherits(a,i),function(){this.lineCommentStart="--",this.$id="ace/mode/vhdl"}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/vhdl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="access|after|ailas|all|architecture|assert|attribute|begin|block|buffer|bus|case|component|configuration|disconnect|downto|else|elsif|end|entity|file|for|function|generate|generic|guarded|if|impure|in|inertial|inout|is|label|linkage|literal|loop|mapnew|next|of|on|open|others|out|port|process|pure|range|record|reject|report|return|select|shared|subtype|then|to|transport|type|unaffected|united|until|wait|when|while|with",t="bit|bit_vector|boolean|character|integer|line|natural|positive|real|register|severity|signal|signed|std_logic|std_logic_vector|string||text|time|unsigned|variable",n="array|constant",r="abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|srasrl|xnor|xor",i="true|false|null",s=this.createKeywordMapper({"keyword.operator":r,keyword:e,"constant.language":i,"storage.modifier":n,"storage.type":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"keyword",regex:"\\s*(?:library|package|use)\\b"},{token:s,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>"},{token:"punctuation.operator",regex:"\\'|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[(]"},{token:"paren.rparen",regex:"[\\])]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.VHDLHighlightRules=s}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/abap.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/abap",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="abap"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/actionscript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/actionscript",["require","exports","module"],function(e,t,n){t.snippetText='snippet main\n package {\n import flash.display.*;\n import flash.Events.*;\n \n public class Main extends Sprite {\n public function Main ( ) {\n trace("start");\n stage.scaleMode = StageScaleMode.NO_SCALE;\n stage.addEventListener(Event.RESIZE, resizeListener);\n }\n \n private function resizeListener (e:Event):void {\n trace("The application window changed size!");\n trace("New width: " + stage.stageWidth);\n trace("New height: " + stage.stageHeight);\n }\n \n }\n \n }\nsnippet class\n ${1:public|internal} class ${2:name} ${3:extends } {\n public function $2 ( ) {\n ("start");\n }\n }\nsnippet all\n package name {\n\n ${1:public|internal|final} class ${2:name} ${3:extends } {\n private|public| static const FOO = "abc";\n private|public| static var BAR = "abc";\n\n // class initializer - no JIT !! one time setup\n if Cababilities.os == "Linux|MacOS" {\n FOO = "other";\n }\n\n // constructor:\n public function $2 ( ){\n super2();\n trace("start");\n }\n public function name (a, b...){\n super.name(..);\n lable:break\n }\n }\n }\n\n function A(){\n // A can only be accessed within this file\n }\nsnippet switch\n switch(${1}){\n case ${2}:\n ${3}\n break;\n default:\n }\nsnippet case\n case ${1}:\n ${2}\n break;\nsnippet package\n package ${1:package}{\n ${2}\n }\nsnippet wh\n while ${1:cond}{\n ${2}\n }\nsnippet do\n do {\n ${2}\n } while (${1:cond})\nsnippet while\n while ${1:cond}{\n ${2}\n }\nsnippet for enumerate names\n for (${1:var} in ${2:object}){\n ${3}\n }\nsnippet for enumerate values\n for each (${1:var} in ${2:object}){\n ${3}\n }\nsnippet get_set\n function get ${1:name} {\n return ${2}\n }\n function set $1 (newValue) {\n ${3}\n }\nsnippet interface\n interface name {\n function method(${1}):${2:returntype};\n }\nsnippet try\n try {\n ${1}\n } catch (error:ErrorType) {\n ${2}\n } finally {\n ${3}\n }\n# For Loop (same as c.snippet)\nsnippet for for (..) {..}\n for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n ${4:/* code */}\n }\n# Custom For Loop\nsnippet forr\n for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {\n ${5:/* code */}\n }\n# If Condition\nsnippet if\n if (${1:/* condition */}) {\n ${2:/* code */}\n }\nsnippet el\n else {\n ${1}\n }\n# Ternary conditional\nsnippet t\n ${1:/* condition */} ? ${2:a} : ${3:b}\nsnippet fun\n function ${1:function_name}(${2})${3}\n {\n ${4:/* code */}\n }\n# FlxSprite (usefull when using the flixel library)\nsnippet FlxSprite\n package\n {\n import org.flixel.*\n\n public class ${1:ClassName} extends ${2:FlxSprite}\n {\n public function $1(${3: X:Number, Y:Number}):void\n {\n super(X,Y);\n ${4: //code...}\n }\n\n override public function update():void\n {\n super.update();\n ${5: //code...}\n }\n }\n }\n\n',t.scope="actionscript"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/ada.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ada",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="ada"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/apache_conf.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/apache_conf",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="apache_conf"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/asciidoc.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/asciidoc",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="asciidoc"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/assembly_x86.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/assembly_x86",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="assembly_x86"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/autohotkey.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/autohotkey",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="autohotkey"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/batchfile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/batchfile",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="batchfile"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/c9search.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/c9search",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="c9search"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/c_cpp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/c_cpp",["require","exports","module"],function(e,t,n){t.snippetText="## STL Collections\n# std::array\nsnippet array\n std::array<${1:T}, ${2:N}> ${3};${4}\n# std::vector\nsnippet vector\n std::vector<${1:T}> ${2};${3}\n# std::deque\nsnippet deque\n std::deque<${1:T}> ${2};${3}\n# std::forward_list\nsnippet flist\n std::forward_list<${1:T}> ${2};${3}\n# std::list\nsnippet list\n std::list<${1:T}> ${2};${3}\n# std::set\nsnippet set\n std::set<${1:T}> ${2};${3}\n# std::map\nsnippet map\n std::map<${1:Key}, ${2:T}> ${3};${4}\n# std::multiset\nsnippet mset\n std::multiset<${1:T}> ${2};${3}\n# std::multimap\nsnippet mmap\n std::multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_set\nsnippet uset\n std::unordered_set<${1:T}> ${2};${3}\n# std::unordered_map\nsnippet umap\n std::unordered_map<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_multiset\nsnippet umset\n std::unordered_multiset<${1:T}> ${2};${3}\n# std::unordered_multimap\nsnippet ummap\n std::unordered_multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::stack\nsnippet stack\n std::stack<${1:T}> ${2};${3}\n# std::queue\nsnippet queue\n std::queue<${1:T}> ${2};${3}\n# std::priority_queue\nsnippet pqueue\n std::priority_queue<${1:T}> ${2};${3}\n##\n## Access Modifiers\n# private\nsnippet pri\n private\n# protected\nsnippet pro\n protected\n# public\nsnippet pub\n public\n# friend\nsnippet fr\n friend\n# mutable\nsnippet mu\n mutable\n## \n## Class\n# class\nsnippet cl\n class ${1:`Filename('$1', 'name')`} \n {\n public:\n $1(${2});\n ~$1();\n\n private:\n ${3:/* data */}\n };\n# member function implementation\nsnippet mfun\n ${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {\n ${5:/* code */}\n }\n# namespace\nsnippet ns\n namespace ${1:`Filename('', 'my')`} {\n ${2}\n } /* namespace $1 */\n##\n## Input/Output\n# std::cout\nsnippet cout\n std::cout << ${1} << std::endl;${2}\n# std::cin\nsnippet cin\n std::cin >> ${1};${2}\n##\n## Iteration\n# for i \nsnippet fori\n for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n ${4:/* code */}\n }${5}\n\n# foreach\nsnippet fore\n for (${1:auto} ${2:i} : ${3:container}) {\n ${4:/* code */}\n }${5}\n# iterator\nsnippet iter\n for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {\n ${6}\n }${7}\n\n# auto iterator\nsnippet itera\n for (auto ${1:i} = $1.begin(); $1 != $1.end(); ++$1) {\n ${2:std::cout << *$1 << std::endl;}\n }${3}\n##\n## Lambdas\n# lamda (one line)\nsnippet ld\n [${1}](${2}){${3:/* code */}}${4}\n# lambda (multi-line)\nsnippet lld\n [${1}](${2}){\n ${3:/* code */}\n }${4}\n",t.scope="c_cpp"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/cirru.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/cirru",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="cirru"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/clojure.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/clojure",["require","exports","module"],function(e,t,n){t.snippetText='snippet comm\n (comment\n ${1}\n )\nsnippet condp\n (condp ${1:pred} ${2:expr}\n ${3})\nsnippet def\n (def ${1})\nsnippet defm\n (defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]\n ${5})\nsnippet defmm\n (defmulti ${1:name} "${2:doc-string}" ${3:dispatch-fn})\nsnippet defma\n (defmacro ${1:name} "${2:doc-string}" ${3:dispatch-fn})\nsnippet defn\n (defn ${1:name} "${2:doc-string}" [${3:arg-list}]\n ${4})\nsnippet defp\n (defprotocol ${1:name}\n ${2})\nsnippet defr\n (defrecord ${1:name} [${2:fields}]\n ${3:protocol}\n ${4})\nsnippet deft\n (deftest ${1:name}\n (is (= ${2:assertion})))\n ${3})\nsnippet is\n (is (= ${1} ${2}))\nsnippet defty\n (deftype ${1:Name} [${2:fields}]\n ${3:Protocol}\n ${4})\nsnippet doseq\n (doseq [${1:elem} ${2:coll}]\n ${3})\nsnippet fn\n (fn [${1:arg-list}] ${2})\nsnippet if\n (if ${1:test-expr}\n ${2:then-expr}\n ${3:else-expr})\nsnippet if-let \n (if-let [${1:result} ${2:test-expr}]\n (${3:then-expr} $1)\n (${4:else-expr}))\nsnippet imp\n (:import [${1:package}])\n & {:keys [${1:keys}] :or {${2:defaults}}}\nsnippet let\n (let [${1:name} ${2:expr}]\n ${3})\nsnippet letfn\n (letfn [(${1:name) [${2:args}]\n ${3})])\nsnippet map\n (map ${1:func} ${2:coll})\nsnippet mapl\n (map #(${1:lambda}) ${2:coll})\nsnippet met\n (${1:name} [${2:this} ${3:args}]\n ${4})\nsnippet ns\n (ns ${1:name}\n ${2})\nsnippet dotimes\n (dotimes [_ 10]\n (time\n (dotimes [_ ${1:times}]\n ${2})))\nsnippet pmethod\n (${1:name} [${2:this} ${3:args}])\nsnippet refer\n (:refer-clojure :exclude [${1}])\nsnippet require\n (:require [${1:namespace} :as [${2}]])\nsnippet use\n (:use [${1:namespace} :only [${2}]])\nsnippet print\n (println ${1})\nsnippet reduce\n (reduce ${1:(fn [p n] ${3})} ${2})\nsnippet when\n (when ${1:test} ${2:body})\nsnippet when-let\n (when-let [${1:result} ${2:test}]\n ${3:body})\n',t.scope="clojure"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/cobol.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/cobol",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="cobol"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/coffee.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/coffee",["require","exports","module"],function(e,t,n){t.snippetText="# Closure loop\nsnippet forindo\n for ${1:name} in ${2:array}\n do ($1) ->\n ${3:// body}\n# Array comprehension\nsnippet fora\n for ${1:name} in ${2:array}\n ${3:// body...}\n# Object comprehension\nsnippet foro\n for ${1:key}, ${2:value} of ${3:object}\n ${4:// body...}\n# Range comprehension (inclusive)\nsnippet forr\n for ${1:name} in [${2:start}..${3:finish}]\n ${4:// body...}\nsnippet forrb\n for ${1:name} in [${2:start}..${3:finish}] by ${4:step}\n ${5:// body...}\n# Range comprehension (exclusive)\nsnippet forrex\n for ${1:name} in [${2:start}...${3:finish}]\n ${4:// body...}\nsnippet forrexb\n for ${1:name} in [${2:start}...${3:finish}] by ${4:step}\n ${5:// body...}\n# Function\nsnippet fun\n (${1:args}) ->\n ${2:// body...}\n# Function (bound)\nsnippet bfun\n (${1:args}) =>\n ${2:// body...}\n# Class\nsnippet cla class ..\n class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n ${2}\nsnippet cla class .. constructor: ..\n class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n constructor: (${2:args}) ->\n ${3}\n\n ${4}\nsnippet cla class .. extends ..\n class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n ${3}\nsnippet cla class .. extends .. constructor: ..\n class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n constructor: (${3:args}) ->\n ${4}\n\n ${5}\n# If\nsnippet if\n if ${1:condition}\n ${2:// body...}\n# If __ Else\nsnippet ife\n if ${1:condition}\n ${2:// body...}\n else\n ${3:// body...}\n# Else if\nsnippet elif\n else if ${1:condition}\n ${2:// body...}\n# Ternary If\nsnippet ifte\n if ${1:condition} then ${2:value} else ${3:other}\n# Unless\nsnippet unl\n ${1:action} unless ${2:condition}\n# Switch\nsnippet swi\n switch ${1:object}\n when ${2:value}\n ${3:// body...}\n\n# Log\nsnippet log\n console.log ${1}\n# Try __ Catch\nsnippet try\n try\n ${1}\n catch ${2:error}\n ${3}\n# Require\nsnippet req\n ${2:$1} = require '${1:sys}'${3}\n# Export\nsnippet exp\n ${1:root} = exports ? this\n",t.scope="coffee"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/coldfusion.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/coldfusion",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="coldfusion"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/csharp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/csharp",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="csharp"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/curly.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/curly",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="curly"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/d.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/d",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="d"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/dart.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/dart",["require","exports","module"],function(e,t,n){t.snippetText="snippet lib\n library ${1};\n ${2}\nsnippet im\n import '${1}';\n ${2}\nsnippet pa\n part '${1}';\n ${2}\nsnippet pao\n part of ${1};\n ${2}\nsnippet main\n void main() {\n ${1:/* code */}\n }\nsnippet st\n static ${1}\nsnippet fi\n final ${1}\nsnippet re\n return ${1}\nsnippet br\n break;\nsnippet th\n throw ${1}\nsnippet cl\n class ${1:`Filename(\"\", \"untitled\")`} ${2}\nsnippet imp\n implements ${1}\nsnippet ext\n extends ${1}\nsnippet if\n if (${1:true}) {\n ${2}\n }\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${3}\n }\nsnippet el\n else\nsnippet sw\n switch (${1}) {\n ${2}\n }\nsnippet cs\n case ${1}:\n ${2}\nsnippet de\n default:\n ${1}\nsnippet for\n for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {\n ${4:$1[$2]}\n }\nsnippet fore\n for (final ${2:item} in ${1:itemList}) {\n ${3:/* code */}\n }\nsnippet wh\n while (${1:/* condition */}) {\n ${2:/* code */}\n }\nsnippet dowh\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\nsnippet as\n assert(${1:/* condition */});\nsnippet try\n try {\n ${2}\n } catch (${1:Exception e}) {\n }\nsnippet tryf\n try {\n ${2}\n } catch (${1:Exception e}) {\n } finally {\n }\n",t.scope="dart"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/diff.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/diff",["require","exports","module"],function(e,t,n){t.snippetText='# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header\nsnippet header DEP-3 style header\n Description: ${1}\n Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}\n Bug: ${4:url in upstream bugtracker}\n Forwarded: ${5:no|not-needed|url}\n Author: ${6:`g:snips_author`}\n Reviewed-by: ${7:name and email}\n Last-Update: ${8:`strftime("%Y-%m-%d")`}\n Applied-Upstream: ${9:upstream version|url|commit}\n\n',t.scope="diff"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/dot.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/dot",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="dot"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/ejs.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ejs",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="ejs"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/forth.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/forth",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="forth"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/ftl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ftl",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="ftl"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/gherkin.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gherkin",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="gherkin"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/glsl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/glsl",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="glsl"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/golang.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/golang",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="golang"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/groovy.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/groovy",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="groovy"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/haml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haml",["require","exports","module"],function(e,t,n){t.snippetText="snippet t\n %table\n %tr\n %th\n ${1:headers}\n %tr\n %td\n ${2:headers}\nsnippet ul\n %ul\n %li\n ${1:item}\n %li\nsnippet =rp\n = render :partial => '${1:partial}'\nsnippet =rpl\n = render :partial => '${1:partial}', :locals => {}\nsnippet =rpc\n = render :partial => '${1:partial}', :collection => @$1\n\n",t.scope="haml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/handlebars.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/handlebars",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="handlebars"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/haskell.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haskell",["require","exports","module"],function(e,t,n){t.snippetText="snippet lang\n {-# LANGUAGE ${1:OverloadedStrings} #-}\nsnippet info\n -- |\n -- Module : ${1:Module.Namespace}\n -- Copyright : ${2:Author} ${3:2011-2012}\n -- License : ${4:BSD3}\n --\n -- Maintainer : ${5:email@something.com}\n -- Stability : ${6:experimental}\n -- Portability : ${7:unknown}\n --\n -- ${8:Description}\n --\nsnippet import\n import ${1:Data.Text}\nsnippet import2\n import ${1:Data.Text} (${2:head})\nsnippet importq\n import qualified ${1:Data.Text} as ${2:T}\nsnippet inst\n instance ${1:Monoid} ${2:Type} where\n ${3}\nsnippet type\n type ${1:Type} = ${2:Type}\nsnippet data\n data ${1:Type} = ${2:$1} ${3:Int}\nsnippet newtype\n newtype ${1:Type} = ${2:$1} ${3:Int}\nsnippet class\n class ${1:Class} a where\n ${2}\nsnippet module\n module `substitute(substitute(expand('%:r'), '[/\\\\]','.','g'),'^\\%(\\l*\\.\\)\\?','','')` (\n ) where\n `expand('%') =~ 'Main' ? \"\\n\\nmain = do\\n print \\\"hello world\\\"\" : \"\"`\n\nsnippet const\n ${1:name} :: ${2:a}\n $1 = ${3:undefined}\nsnippet fn\n ${1:fn} :: ${2:a} -> ${3:a}\n $1 ${4} = ${5:undefined}\nsnippet fn2\n ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}\n $1 ${5} = ${6:undefined}\nsnippet ap\n ${1:map} ${2:fn} ${3:list}\nsnippet do\n do\n \nsnippet \u03bb\n \\${1:x} -> ${2}\nsnippet \\\n \\${1:x} -> ${2}\nsnippet <-\n ${1:a} <- ${2:m a}\nsnippet \u2190\n ${1:a} <- ${2:m a}\nsnippet ->\n ${1:m a} -> ${2:a}\nsnippet \u2192\n ${1:m a} -> ${2:a}\nsnippet tup\n (${1:a}, ${2:b})\nsnippet tup2\n (${1:a}, ${2:b}, ${3:c})\nsnippet tup3\n (${1:a}, ${2:b}, ${3:c}, ${4:d})\nsnippet rec\n ${1:Record} { ${2:recFieldA} = ${3:undefined}\n , ${4:recFieldB} = ${5:undefined}\n }\nsnippet case\n case ${1:something} of\n ${2} -> ${3}\nsnippet let\n let ${1} = ${2}\n in ${3}\nsnippet where\n where\n ${1:fn} = ${2:undefined}\n",t.scope="haskell"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/haxe.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/haxe",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="haxe"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/html_completions.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/html_completions",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="html_completions"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/html_ruby.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/html_ruby",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="html_ruby"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/ini.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ini",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="ini"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/jack.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jack",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="jack"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/jade.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jade",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="jade"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/json.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/json",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="json"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/jsoniq.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jsoniq",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="jsoniq"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/jsp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jsp",["require","exports","module"],function(e,t,n){t.snippetText='snippet @page\n <%@page contentType="text/html" pageEncoding="UTF-8"%>\nsnippet jstl\n <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>\n <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>\nsnippet jstl:c\n <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>\nsnippet jstl:fn\n <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>\nsnippet cpath\n ${pageContext.request.contextPath}\nsnippet cout\n \nsnippet cset\n \nsnippet cremove\n \nsnippet ccatch\n \nsnippet cif\n \n ${2}\n \nsnippet cchoose\n \n ${1}\n \nsnippet cwhen\n \n ${2}\n \nsnippet cother\n \n ${1}\n \nsnippet cfore\n \n ${4:}\n \nsnippet cfort\n ${2:item1,item2,item3}\n \n ${5:}\n \nsnippet cparam\n \nsnippet cparam+\n \n cparam+${3}\nsnippet cimport\n \nsnippet cimport+\n \n \n cparam+${4}\n \nsnippet curl\n \n ${3}\nsnippet curl+\n \n \n cparam+${6}\n \n ${3}\nsnippet credirect\n \nsnippet contains\n ${fn:contains(${1:string}, ${2:substr})}\nsnippet contains:i\n ${fn:containsIgnoreCase(${1:string}, ${2:substr})}\nsnippet endswith\n ${fn:endsWith(${1:string}, ${2:suffix})}\nsnippet escape\n ${fn:escapeXml(${1:string})}\nsnippet indexof\n ${fn:indexOf(${1:string}, ${2:substr})}\nsnippet join\n ${fn:join(${1:collection}, ${2:delims})}\nsnippet length\n ${fn:length(${1:collection_or_string})}\nsnippet replace\n ${fn:replace(${1:string}, ${2:substr}, ${3:replace})}\nsnippet split\n ${fn:split(${1:string}, ${2:delims})}\nsnippet startswith\n ${fn:startsWith(${1:string}, ${2:prefix})}\nsnippet substr\n ${fn:substring(${1:string}, ${2:begin}, ${3:end})}\nsnippet substr:a\n ${fn:substringAfter(${1:string}, ${2:substr})}\nsnippet substr:b\n ${fn:substringBefore(${1:string}, ${2:substr})}\nsnippet lc\n ${fn:toLowerCase(${1:string})}\nsnippet uc\n ${fn:toUpperCase(${1:string})}\nsnippet trim\n ${fn:trim(${1:string})}\n',t.scope="jsp"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/jsx.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/jsx",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="jsx"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/julia.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/julia",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="julia"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/latex.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/latex",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="latex"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/less.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/less",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="less"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/liquid.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/liquid",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="liquid"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/lisp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lisp",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="lisp"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/livescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/livescript",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="livescript"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/logiql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/logiql",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="logiql"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/lua.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lua",["require","exports","module"],function(e,t,n){t.snippetText="snippet #!\n #!/usr/bin/env lua\n $1\nsnippet local\n local ${1:x} = ${2:1}\nsnippet fun\n function ${1:fname}(${2:...})\n ${3:-- body}\n end\nsnippet for\n for ${1:i}=${2:1},${3:10} do\n ${4:print(i)}\n end\nsnippet forp\n for ${1:i},${2:v} in pairs(${3:table_name}) do\n ${4:-- body}\n end\nsnippet fori\n for ${1:i},${2:v} in ipairs(${3:table_name}) do\n ${4:-- body}\n end\n",t.scope="lua"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/luapage.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/luapage",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="luapage"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/lucene.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/lucene",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="lucene"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/makefile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/makefile",["require","exports","module"],function(e,t,n){t.snippetText="snippet ifeq\n ifeq (${1:cond0},${2:cond1})\n ${3:code}\n endif\n",t.scope="makefile"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/markdown.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/markdown",["require","exports","module"],function(e,t,n){t.snippetText='# Markdown\n\n# Includes octopress (http://octopress.org/) snippets\n\nsnippet [\n [${1:text}](http://${2:address} "${3:title}")\nsnippet [*\n [${1:link}](${2:`@*`} "${3:title}")${4}\n\nsnippet [:\n [${1:id}]: http://${2:url} "${3:title}"\nsnippet [:*\n [${1:id}]: ${2:`@*`} "${3:title}"\n\nsnippet ![\n ![${1:alttext}](${2:/images/image.jpg} "${3:title}")\nsnippet ![*\n ![${1:alt}](${2:`@*`} "${3:title}")${4}\n\nsnippet ![:\n ![${1:id}]: ${2:url} "${3:title}"\nsnippet ![:*\n ![${1:id}]: ${2:`@*`} "${3:title}"\n\nsnippet ===\nregex /^/=+/=*//\n ${PREV_LINE/./=/g}\n \n ${0}\nsnippet ---\nregex /^/-+/-*//\n ${PREV_LINE/./-/g}\n \n ${0}\nsnippet blockquote\n {% blockquote %}\n ${1:quote}\n {% endblockquote %}\n\nsnippet blockquote-author\n {% blockquote ${1:author}, ${2:title} %}\n ${3:quote}\n {% endblockquote %}\n\nsnippet blockquote-link\n {% blockquote ${1:author} ${2:URL} ${3:link_text} %}\n ${4:quote}\n {% endblockquote %}\n\nsnippet bt-codeblock-short\n ```\n ${1:code_snippet}\n ```\n\nsnippet bt-codeblock-full\n ``` ${1:language} ${2:title} ${3:URL} ${4:link_text}\n ${5:code_snippet}\n ```\n\nsnippet codeblock-short\n {% codeblock %}\n ${1:code_snippet}\n {% endcodeblock %}\n\nsnippet codeblock-full\n {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}\n ${5:code_snippet}\n {% endcodeblock %}\n\nsnippet gist-full\n {% gist ${1:gist_id} ${2:filename} %}\n\nsnippet gist-short\n {% gist ${1:gist_id} %}\n\nsnippet img\n {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %}\n\nsnippet youtube\n {% youtube ${1:video_id} %}\n\n# The quote should appear only once in the text. It is inherently part of it.\n# See http://octopress.org/docs/plugins/pullquote/ for more info.\n\nsnippet pullquote\n {% pullquote %}\n ${1:text} {" ${2:quote} "} ${3:text}\n {% endpullquote %}\n',t.scope="markdown"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/matlab.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/matlab",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="matlab"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/mel.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mel",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="mel"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/mushcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mushcode",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="mushcode"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/mushcode_high_rules.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mushcode_high_rules",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="mushcode_high_rules"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/mysql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/mysql",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="mysql"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/nix.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/nix",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="nix"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/objectivec.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/objectivec",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="objectivec"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/ocaml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/ocaml",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="ocaml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/pascal.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/pascal",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="pascal"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/pgsql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/pgsql",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="pgsql"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/plain_text",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="plain_text"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/powershell.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/powershell",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="powershell"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/prolog.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/prolog",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="prolog"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/properties.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/properties",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="properties"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/protobuf.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/protobuf",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="protobuf"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/r.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/r",["require","exports","module"],function(e,t,n){t.snippetText='snippet #!\n #!/usr/bin/env Rscript\n\n# includes\nsnippet lib\n library(${1:package})\nsnippet req\n require(${1:package})\nsnippet source\n source(\'${1:file}\')\n\n# conditionals\nsnippet if\n if (${1:condition}) {\n ${2:code}\n }\nsnippet el\n else {\n ${1:code}\n }\nsnippet ei\n else if (${1:condition}) {\n ${2:code}\n }\n\n# functions\nsnippet fun\n ${1:name} = function (${2:variables}) {\n ${3:code}\n }\nsnippet ret\n return(${1:code})\n\n# dataframes, lists, etc\nsnippet df\n ${1:name}[${2:rows}, ${3:cols}]\nsnippet c\n c(${1:items})\nsnippet li\n list(${1:items})\nsnippet mat\n matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols})\n\n# apply functions\nsnippet apply\n apply(${1:array}, ${2:margin}, ${3:function})\nsnippet lapply\n lapply(${1:list}, ${2:function})\nsnippet sapply\n lapply(${1:list}, ${2:function})\nsnippet vapply\n vapply(${1:list}, ${2:function}, ${3:type})\nsnippet mapply\n mapply(${1:function}, ${2:...})\nsnippet tapply\n tapply(${1:vector}, ${2:index}, ${3:function})\nsnippet rapply\n rapply(${1:list}, ${2:function})\n\n# plyr functions\nsnippet dd\n ddply(${1:frame}, ${2:variables}, ${3:function})\nsnippet dl\n dlply(${1:frame}, ${2:variables}, ${3:function})\nsnippet da\n daply(${1:frame}, ${2:variables}, ${3:function})\nsnippet d_\n d_ply(${1:frame}, ${2:variables}, ${3:function})\n\nsnippet ad\n adply(${1:array}, ${2:margin}, ${3:function})\nsnippet al\n alply(${1:array}, ${2:margin}, ${3:function})\nsnippet aa\n aaply(${1:array}, ${2:margin}, ${3:function})\nsnippet a_\n a_ply(${1:array}, ${2:margin}, ${3:function})\n\nsnippet ld\n ldply(${1:list}, ${2:function})\nsnippet ll\n llply(${1:list}, ${2:function})\nsnippet la\n laply(${1:list}, ${2:function})\nsnippet l_\n l_ply(${1:list}, ${2:function})\n\nsnippet md\n mdply(${1:matrix}, ${2:function})\nsnippet ml\n mlply(${1:matrix}, ${2:function})\nsnippet ma\n maply(${1:matrix}, ${2:function})\nsnippet m_\n m_ply(${1:matrix}, ${2:function})\n\n# plot functions\nsnippet pl\n plot(${1:x}, ${2:y})\nsnippet ggp\n ggplot(${1:data}, aes(${2:aesthetics}))\nsnippet img\n ${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}")\n ${6:plot}\n dev.off()\n\n# statistical test functions\nsnippet fis\n fisher.test(${1:x}, ${2:y})\nsnippet chi\n chisq.test(${1:x}, ${2:y})\nsnippet tt\n t.test(${1:x}, ${2:y})\nsnippet wil\n wilcox.test(${1:x}, ${2:y})\nsnippet cor\n cor.test(${1:x}, ${2:y})\nsnippet fte\n var.test(${1:x}, ${2:y})\nsnippet kvt \n kv.test(${1:x}, ${2:y})\n',t.scope="r"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/rdoc.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rdoc",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="rdoc"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/rhtml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rhtml",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="rhtml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/rust.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/rust",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="rust"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/sass.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sass",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="sass"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/scad.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scad",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="scad"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/scala.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scala",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="scala"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/scheme.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scheme",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="scheme"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/scss.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/scss",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="scss"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/sh.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sh",["require","exports","module"],function(e,t,n){t.snippetText='# Shebang. Executing bash via /usr/bin/env makes scripts more portable.\nsnippet #!\n #!/usr/bin/env bash\n \nsnippet if\n if [[ ${1:condition} ]]; then\n ${2:#statements}\n fi\nsnippet elif\n elif [[ ${1:condition} ]]; then\n ${2:#statements}\nsnippet for\n for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do\n ${3:#statements}\n done\nsnippet fori\n for ${1:needle} in ${2:haystack} ; do\n ${3:#statements}\n done\nsnippet wh\n while [[ ${1:condition} ]]; do\n ${2:#statements}\n done\nsnippet until\n until [[ ${1:condition} ]]; do\n ${2:#statements}\n done\nsnippet case\n case ${1:word} in\n ${2:pattern})\n ${3};;\n esac\nsnippet go \n while getopts \'${1:o}\' ${2:opts} \n do \n case $$2 in\n ${3:o0})\n ${4:#staments};;\n esac\n done\n# Set SCRIPT_DIR variable to directory script is located.\nsnippet sdir\n SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"\n# getopt\nsnippet getopt\n __ScriptVersion="${1:version}"\n\n #=== FUNCTION ================================================================\n # NAME: usage\n # DESCRIPTION: Display usage information.\n #===============================================================================\n function usage ()\n {\n cat <<- EOT\n\n Usage : $${0:0} [options] [--] \n\n Options: \n -h|help Display this message\n -v|version Display script version\n\n EOT\n } # ---------- end of function usage ----------\n\n #-----------------------------------------------------------------------\n # Handle command line arguments\n #-----------------------------------------------------------------------\n\n while getopts ":hv" opt\n do\n case $opt in\n\n h|help ) usage; exit 0 ;;\n\n v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;;\n\n \\? ) echo -e "\\n Option does not exist : $OPTARG\\n"\n usage; exit 1 ;;\n\n esac # --- end of case ---\n done\n shift $(($OPTIND-1))\n\n',t.scope="sh"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/sjs.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sjs",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="sjs"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/smarty.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/smarty",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="smarty"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/snippets.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/snippets",["require","exports","module"],function(e,t,n){t.snippetText="# snippets for making snippets :)\nsnippet snip\n snippet ${1:trigger}\n ${2}\nsnippet msnip\n snippet ${1:trigger} ${2:description}\n ${3}\nsnippet v\n {VISUAL}\n",t.scope="snippets"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/soy_template.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/soy_template",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="soy_template"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/space.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/space",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="space"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/sql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/sql",["require","exports","module"],function(e,t,n){t.snippetText="snippet tbl\n create table ${1:table} (\n ${2:columns}\n );\nsnippet col\n ${1:name} ${2:type} ${3:default ''} ${4:not null}\nsnippet ccol\n ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\nsnippet ncol\n ${1:name} number ${3:default 0} ${4:not null}\nsnippet dcol\n ${1:name} date ${3:default sysdate} ${4:not null}\nsnippet ind\n create index ${3:$1_$2} on ${1:table}(${2:column});\nsnippet uind\n create unique index ${1:name} on ${2:table}(${3:column});\nsnippet tblcom\n comment on table ${1:table} is '${2:comment}';\nsnippet colcom\n comment on column ${1:table}.${2:column} is '${3:comment}';\nsnippet addcol\n alter table ${1:table} add (${2:column} ${3:type});\nsnippet seq\n create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\nsnippet s*\n select * from ${1:table}\n",t.scope="sql"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/stylus.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/stylus",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="stylus"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/svg.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/svg",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="svg"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/tcl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/tcl",["require","exports","module"],function(e,t,n){t.snippetText="# #!/usr/bin/env tclsh\nsnippet #!\n #!/usr/bin/env tclsh\n \n# Process\nsnippet pro\n proc ${1:function_name} {${2:args}} {\n ${3:#body ...}\n }\n#xif\nsnippet xif\n ${1:expr}? ${2:true} : ${3:false}\n# Conditional\nsnippet if\n if {${1}} {\n ${2:# body...}\n }\n# Conditional if..else\nsnippet ife\n if {${1}} {\n ${2:# body...}\n } else {\n ${3:# else...}\n }\n# Conditional if..elsif..else\nsnippet ifee\n if {${1}} {\n ${2:# body...}\n } elseif {${3}} {\n ${4:# elsif...}\n } else {\n ${5:# else...}\n }\n# If catch then\nsnippet ifc\n if { [catch {${1:#do something...}} ${2:err}] } {\n ${3:# handle failure...}\n }\n# Catch\nsnippet catch\n catch {${1}} ${2:err} ${3:options}\n# While Loop\nsnippet wh\n while {${1}} {\n ${2:# body...}\n }\n# For Loop\nsnippet for\n for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {\n ${4:# body...}\n }\n# Foreach Loop\nsnippet fore\n foreach ${1:x} {${2:#list}} {\n ${3:# body...}\n }\n# after ms script...\nsnippet af\n after ${1:ms} ${2:#do something}\n# after cancel id\nsnippet afc\n after cancel ${1:id or script}\n# after idle\nsnippet afi\n after idle ${1:script}\n# after info id\nsnippet afin\n after info ${1:id}\n# Expr\nsnippet exp\n expr {${1:#expression here}}\n# Switch\nsnippet sw\n switch ${1:var} {\n ${3:pattern 1} {\n ${4:#do something}\n }\n default {\n ${2:#do something}\n }\n }\n# Case\nsnippet ca\n ${1:pattern} {\n ${2:#do something}\n }${3}\n# Namespace eval\nsnippet ns\n namespace eval ${1:path} {${2:#script...}}\n# Namespace current\nsnippet nsc\n namespace current\n",t.scope="tcl"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/text",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="text"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/textile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/textile",["require","exports","module"],function(e,t,n){t.snippetText='# Jekyll post header\nsnippet header\n ---\n title: ${1:title}\n layout: post\n date: ${2:date} ${3:hour:minute:second} -05:00\n ---\n\n# Image\nsnippet img\n !${1:url}(${2:title}):${3:link}!\n\n# Table\nsnippet |\n |${1}|${2}\n\n# Link\nsnippet link\n "${1:link text}":${2:url}\n\n# Acronym\nsnippet (\n (${1:Expand acronym})${2}\n\n# Footnote\nsnippet fn\n [${1:ref number}] ${3}\n\n fn$1. ${2:footnote}\n \n',t.scope="textile"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/toml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/toml",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="toml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/twig.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/twig",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="twig"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/typescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/typescript",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="typescript"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/vbscript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/vbscript",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="vbscript"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/velocity.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/velocity",["require","exports","module"],function(e,t,n){t.snippetText='# macro\nsnippet #macro\n #macro ( ${1:macroName} ${2:\\$var1, [\\$var2, ...]} )\n ${3:## macro code}\n #end\n# foreach\nsnippet #foreach\n #foreach ( ${1:\\$item} in ${2:\\$collection} )\n ${3:## foreach code}\n #end\n# if\nsnippet #if\n #if ( ${1:true} )\n ${0}\n #end\n# if ... else\nsnippet #ife\n #if ( ${1:true} )\n ${2}\n #else\n ${0}\n #end\n#import\nsnippet #import\n #import ( "${1:path/to/velocity/format}" )\n# set\nsnippet #set\n #set ( $${1:var} = ${0} )\n',t.scope="velocity",t.includeScopes=["html","javascript","css"]}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/verilog.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/verilog",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="verilog"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/vhdl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/vhdl",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="vhdl"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/xml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/xml",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="xml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/xquery.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/xquery",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="xquery"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/snippets/yaml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/yaml",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="yaml"}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-chaos.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/chaos",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-chaos",t.cssText=".ace-chaos .ace_gutter {background: #141414;color: #595959;border-right: 1px solid #282828;}.ace-chaos .ace_gutter-cell.ace_warning {background-image: none;background: #FC0;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_gutter-cell.ace_error {background-position: -6px center;background-image: none;background: #F10;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_print-margin {border-left: 1px solid #555;right: 0;background: #1D1D1D;}.ace-chaos {background-color: #161616;color: #E6E1DC;}.ace-chaos .ace_cursor {border-left: 2px solid #FFFFFF;}.ace-chaos .ace_cursor.ace_overwrite {border-left: 0px;border-bottom: 1px solid #FFFFFF;}.ace-chaos .ace_marker-layer .ace_selection {background: #494836;}.ace-chaos .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-chaos .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #FCE94F;}.ace-chaos .ace_marker-layer .ace_active-line {background: #333;}.ace-chaos .ace_gutter-active-line {background-color: #222;}.ace-chaos .ace_invisible {color: #404040;}.ace-chaos .ace_keyword {color:#00698F;}.ace-chaos .ace_keyword.ace_operator {color:#FF308F;}.ace-chaos .ace_constant {color:#1EDAFB;}.ace-chaos .ace_constant.ace_language {color:#FDC251;}.ace-chaos .ace_constant.ace_library {color:#8DFF0A;}.ace-chaos .ace_constant.ace_numeric {color:#58C554;}.ace-chaos .ace_invalid {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_invalid.ace_deprecated {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_support {color: #999;}.ace-chaos .ace_support.ace_function {color:#00AEEF;}.ace-chaos .ace_function {color:#00AEEF;}.ace-chaos .ace_string {color:#58C554;}.ace-chaos .ace_comment {color:#555;font-style:italic;padding-bottom: 0px;}.ace-chaos .ace_variable {color:#997744;}.ace-chaos .ace_meta.ace_tag {color:#BE53E6;}.ace-chaos .ace_entity.ace_other.ace_attribute-name {color:#FFFF89;}.ace-chaos .ace_markup.ace_underline {text-decoration: underline;}.ace-chaos .ace_fold-widget {text-align: center;}.ace-chaos .ace_fold-widget:hover {color: #777;}.ace-chaos .ace_fold-widget.ace_start,.ace-chaos .ace_fold-widget.ace_end,.ace-chaos .ace_fold-widget.ace_closed{background: none;border: none;box-shadow: none;}.ace-chaos .ace_fold-widget.ace_start:after {content: '\u25be'}.ace-chaos .ace_fold-widget.ace_end:after {content: '\u25b4'}.ace-chaos .ace_fold-widget.ace_closed:after {content: '\u2023'}.ace-chaos .ace_indent-guide {border-right:1px dotted #333;margin-right:-1px;}.ace-chaos .ace_fold { background: #222; border-radius: 3px; color: #7AF; border: none; }.ace-chaos .ace_fold:hover {background: #CCC; color: #000;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-chrome.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-clouds.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/clouds",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-clouds",t.cssText='.ace-clouds .ace_gutter {background: #ebebeb;color: #333}.ace-clouds .ace_print-margin {width: 1px;background: #e8e8e8}.ace-clouds {background-color: #FFFFFF;color: #000000}.ace-clouds .ace_cursor {color: #000000}.ace-clouds .ace_marker-layer .ace_selection {background: #BDD5FC}.ace-clouds.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-clouds .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-clouds .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds .ace_marker-layer .ace_active-line {background: #FFFBD1}.ace-clouds .ace_gutter-active-line {background-color : #dcdcdc}.ace-clouds .ace_marker-layer .ace_selected-word {border: 1px solid #BDD5FC}.ace-clouds .ace_invisible {color: #BFBFBF}.ace-clouds .ace_keyword,.ace-clouds .ace_meta,.ace-clouds .ace_support.ace_constant.ace_property-value {color: #AF956F}.ace-clouds .ace_keyword.ace_operator {color: #484848}.ace-clouds .ace_keyword.ace_other.ace_unit {color: #96DC5F}.ace-clouds .ace_constant.ace_language {color: #39946A}.ace-clouds .ace_constant.ace_numeric {color: #46A609}.ace-clouds .ace_constant.ace_character.ace_entity {color: #BF78CC}.ace-clouds .ace_invalid {background-color: #FF002A}.ace-clouds .ace_fold {background-color: #AF956F;border-color: #000000}.ace-clouds .ace_storage,.ace-clouds .ace_support.ace_class,.ace-clouds .ace_support.ace_function,.ace-clouds .ace_support.ace_other,.ace-clouds .ace_support.ace_type {color: #C52727}.ace-clouds .ace_string {color: #5D90CD}.ace-clouds .ace_comment {color: #BCC8BA}.ace-clouds .ace_entity.ace_name.ace_tag,.ace-clouds .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-clouds_midnight.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-clouds-midnight",t.cssText=".ace-clouds-midnight .ace_gutter {background: #232323;color: #929292}.ace-clouds-midnight .ace_print-margin {width: 1px;background: #232323}.ace-clouds-midnight {background-color: #191919;color: #929292}.ace-clouds-midnight .ace_cursor {color: #7DA5DC}.ace-clouds-midnight .ace_marker-layer .ace_selection {background: #000000}.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #191919;border-radius: 2px}.ace-clouds-midnight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-clouds-midnight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds-midnight .ace_marker-layer .ace_active-line {background: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_gutter-active-line {background-color: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_marker-layer .ace_selected-word {border: 1px solid #000000}.ace-clouds-midnight .ace_invisible {color: #BFBFBF}.ace-clouds-midnight .ace_keyword,.ace-clouds-midnight .ace_meta,.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {color: #927C5D}.ace-clouds-midnight .ace_keyword.ace_operator {color: #4B4B4B}.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {color: #366F1A}.ace-clouds-midnight .ace_constant.ace_language {color: #39946A}.ace-clouds-midnight .ace_constant.ace_numeric {color: #46A609}.ace-clouds-midnight .ace_constant.ace_character.ace_entity {color: #A165AC}.ace-clouds-midnight .ace_invalid {color: #FFFFFF;background-color: #E92E2E}.ace-clouds-midnight .ace_fold {background-color: #927C5D;border-color: #929292}.ace-clouds-midnight .ace_storage,.ace-clouds-midnight .ace_support.ace_class,.ace-clouds-midnight .ace_support.ace_function,.ace-clouds-midnight .ace_support.ace_other,.ace-clouds-midnight .ace_support.ace_type {color: #E92E2E}.ace-clouds-midnight .ace_string {color: #5D90CD}.ace-clouds-midnight .ace_comment {color: #3C403B}.ace-clouds-midnight .ace_entity.ace_name.ace_tag,.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds-midnight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-cobalt.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cobalt",t.cssText=".ace-cobalt .ace_gutter {background: #011e3a;color: #fff}.ace-cobalt .ace_print-margin {width: 1px;background: #011e3a}.ace-cobalt {background-color: #002240;color: #FFFFFF}.ace-cobalt .ace_cursor {color: #FFFFFF}.ace-cobalt .ace_marker-layer .ace_selection {background: rgba(179, 101, 57, 0.75)}.ace-cobalt.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002240;border-radius: 2px}.ace-cobalt .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-cobalt .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_marker-layer .ace_selected-word {border: 1px solid rgba(179, 101, 57, 0.75)}.ace-cobalt .ace_invisible {color: rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_keyword,.ace-cobalt .ace_meta {color: #FF9D00}.ace-cobalt .ace_constant,.ace-cobalt .ace_constant.ace_character,.ace-cobalt .ace_constant.ace_character.ace_escape,.ace-cobalt .ace_constant.ace_other {color: #FF628C}.ace-cobalt .ace_invalid {color: #F8F8F8;background-color: #800F00}.ace-cobalt .ace_support {color: #80FFBB}.ace-cobalt .ace_support.ace_constant {color: #EB939A}.ace-cobalt .ace_fold {background-color: #FF9D00;border-color: #FFFFFF}.ace-cobalt .ace_support.ace_function {color: #FFB054}.ace-cobalt .ace_storage {color: #FFEE80}.ace-cobalt .ace_entity {color: #FFDD00}.ace-cobalt .ace_string {color: #3AD900}.ace-cobalt .ace_string.ace_regexp {color: #80FFC2}.ace-cobalt .ace_comment {font-style: italic;color: #0088FF}.ace-cobalt .ace_heading,.ace-cobalt .ace_markup.ace_heading {color: #C8E4FD;background-color: #001221}.ace-cobalt .ace_list,.ace-cobalt .ace_markup.ace_list {background-color: #130D26}.ace-cobalt .ace_variable {color: #CCCCCC}.ace-cobalt .ace_variable.ace_language {color: #FF80E1}.ace-cobalt .ace_meta.ace_tag {color: #9EFFFF}.ace-cobalt .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-crimson_editor.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-crimson-editor .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-crimson-editor .ace_gutter-layer {width: 100%;text-align: right;}.ace-crimson-editor .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-crimson-editor {background-color: #FFFFFF;color: rgb(64, 64, 64);}.ace-crimson-editor .ace_cursor {color: black;}.ace-crimson-editor .ace_invisible {color: rgb(191, 191, 191);}.ace-crimson-editor .ace_identifier {color: black;}.ace-crimson-editor .ace_keyword {color: blue;}.ace-crimson-editor .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-crimson-editor .ace_constant.ace_language {color: rgb(255, 156, 0);}.ace-crimson-editor .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_invalid {text-decoration: line-through;color: rgb(224, 0, 0);}.ace-crimson-editor .ace_fold {}.ace-crimson-editor .ace_support.ace_function {color: rgb(192, 0, 0);}.ace-crimson-editor .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_support.ace_type,.ace-crimson-editor .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-crimson-editor .ace_keyword.ace_operator {color: rgb(49, 132, 149);}.ace-crimson-editor .ace_string {color: rgb(128, 0, 128);}.ace-crimson-editor .ace_comment {color: rgb(76, 136, 107);}.ace-crimson-editor .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-crimson-editor .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-crimson-editor .ace_constant.ace_numeric {color: rgb(0, 0, 64);}.ace-crimson-editor .ace_variable {color: rgb(0, 64, 128);}.ace-crimson-editor .ace_xml-pe {color: rgb(104, 104, 91);}.ace-crimson-editor .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-crimson-editor .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-crimson-editor .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-crimson-editor .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-crimson-editor .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-crimson-editor .ace_gutter-active-line {background-color : #dcdcdc;}.ace-crimson-editor .ace_meta.ace_tag {color:rgb(28, 2, 255);}.ace-crimson-editor .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-crimson-editor .ace_string.ace_regex {color: rgb(192, 0, 192);}.ace-crimson-editor .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-crimson-editor";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-dawn.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dawn",t.cssText=".ace-dawn .ace_gutter {background: #ebebeb;color: #333}.ace-dawn .ace_print-margin {width: 1px;background: #e8e8e8}.ace-dawn {background-color: #F9F9F9;color: #080808}.ace-dawn .ace_cursor {color: #000000}.ace-dawn .ace_marker-layer .ace_selection {background: rgba(39, 95, 255, 0.30)}.ace-dawn.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #F9F9F9;border-radius: 2px}.ace-dawn .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-dawn .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(75, 75, 126, 0.50)}.ace-dawn .ace_marker-layer .ace_active-line {background: rgba(36, 99, 180, 0.12)}.ace-dawn .ace_gutter-active-line {background-color : #dcdcdc}.ace-dawn .ace_marker-layer .ace_selected-word {border: 1px solid rgba(39, 95, 255, 0.30)}.ace-dawn .ace_invisible {color: rgba(75, 75, 126, 0.50)}.ace-dawn .ace_keyword,.ace-dawn .ace_meta {color: #794938}.ace-dawn .ace_constant,.ace-dawn .ace_constant.ace_character,.ace-dawn .ace_constant.ace_character.ace_escape,.ace-dawn .ace_constant.ace_other {color: #811F24}.ace-dawn .ace_invalid.ace_illegal {text-decoration: underline;font-style: italic;color: #F8F8F8;background-color: #B52A1D}.ace-dawn .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #B52A1D}.ace-dawn .ace_support {color: #691C97}.ace-dawn .ace_support.ace_constant {color: #B4371F}.ace-dawn .ace_fold {background-color: #794938;border-color: #080808}.ace-dawn .ace_list,.ace-dawn .ace_markup.ace_list,.ace-dawn .ace_support.ace_function {color: #693A17}.ace-dawn .ace_storage {font-style: italic;color: #A71D5D}.ace-dawn .ace_string {color: #0B6125}.ace-dawn .ace_string.ace_regexp {color: #CF5628}.ace-dawn .ace_comment {font-style: italic;color: #5A525F}.ace-dawn .ace_heading,.ace-dawn .ace_markup.ace_heading {color: #19356D}.ace-dawn .ace_variable {color: #234A97}.ace-dawn .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-eclipse.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/eclipse",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-eclipse .ace_gutter {background: #ebebeb;border-right: 1px solid rgb(159, 159, 159);color: rgb(136, 136, 136);}.ace-eclipse .ace_print-margin {width: 1px;background: #ebebeb;}.ace-eclipse {background-color: #FFFFFF;color: black;}.ace-eclipse .ace_fold {background-color: rgb(60, 76, 114);}.ace-eclipse .ace_cursor {color: black;}.ace-eclipse .ace_storage,.ace-eclipse .ace_keyword,.ace-eclipse .ace_variable {color: rgb(127, 0, 85);}.ace-eclipse .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-eclipse .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-eclipse .ace_function {color: rgb(60, 76, 114);}.ace-eclipse .ace_string {color: rgb(42, 0, 255);}.ace-eclipse .ace_comment {color: rgb(113, 150, 130);}.ace-eclipse .ace_comment.ace_doc {color: rgb(63, 95, 191);}.ace-eclipse .ace_comment.ace_doc.ace_tag {color: rgb(127, 159, 191);}.ace-eclipse .ace_constant.ace_numeric {color: darkblue;}.ace-eclipse .ace_tag {color: rgb(25, 118, 116);}.ace-eclipse .ace_type {color: rgb(127, 0, 127);}.ace-eclipse .ace_xml-pe {color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_meta.ace_tag {color:rgb(25, 118, 116);}.ace-eclipse .ace_invisible {color: #ddd;}.ace-eclipse .ace_entity.ace_other.ace_attribute-name {color:rgb(127, 0, 127);}.ace-eclipse .ace_marker-layer .ace_step {background: rgb(255, 255, 0);}.ace-eclipse .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-eclipse .ace_marker-layer .ace_selected-word {border: 1px solid rgb(181, 213, 255);}.ace-eclipse .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-eclipse";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-github.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/github",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-github",t.cssText='/* CSS style content from github\'s default pygments highlighter template.Cursor and selection styles from textmate.css. */.ace-github .ace_gutter {background: #e8e8e8;color: #AAA;}.ace-github {background: #fff;color: #000;}.ace-github .ace_keyword {font-weight: bold;}.ace-github .ace_string {color: #D14;}.ace-github .ace_variable.ace_class {color: teal;}.ace-github .ace_constant.ace_numeric {color: #099;}.ace-github .ace_constant.ace_buildin {color: #0086B3;}.ace-github .ace_support.ace_function {color: #0086B3;}.ace-github .ace_comment {color: #998;font-style: italic;}.ace-github .ace_variable.ace_language {color: #0086B3;}.ace-github .ace_paren {font-weight: bold;}.ace-github .ace_boolean {font-weight: bold;}.ace-github .ace_string.ace_regexp {color: #009926;font-weight: normal;}.ace-github .ace_variable.ace_instance {color: teal;}.ace-github .ace_constant.ace_language {font-weight: bold;}.ace-github .ace_cursor {color: black;}.ace-github .ace_marker-layer .ace_active-line {background: rgb(255, 255, 204);}.ace-github .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-github.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}/* bold keywords cause cursor issues for some fonts *//* this disables bold style for editor and keeps for static highlighter */.ace-github.ace_nobold .ace_line > span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-idle_fingers.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-idle-fingers",t.cssText=".ace-idle-fingers .ace_gutter {background: #3b3b3b;color: #fff}.ace-idle-fingers .ace_print-margin {width: 1px;background: #3b3b3b}.ace-idle-fingers {background-color: #323232;color: #FFFFFF}.ace-idle-fingers .ace_cursor {color: #91FF00}.ace-idle-fingers .ace_marker-layer .ace_selection {background: rgba(90, 100, 126, 0.88)}.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #323232;border-radius: 2px}.ace-idle-fingers .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-idle-fingers .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-idle-fingers .ace_marker-layer .ace_active-line {background: #353637}.ace-idle-fingers .ace_gutter-active-line {background-color: #353637}.ace-idle-fingers .ace_marker-layer .ace_selected-word {border: 1px solid rgba(90, 100, 126, 0.88)}.ace-idle-fingers .ace_invisible {color: #404040}.ace-idle-fingers .ace_keyword,.ace-idle-fingers .ace_meta {color: #CC7833}.ace-idle-fingers .ace_constant,.ace-idle-fingers .ace_constant.ace_character,.ace-idle-fingers .ace_constant.ace_character.ace_escape,.ace-idle-fingers .ace_constant.ace_other,.ace-idle-fingers .ace_support.ace_constant {color: #6C99BB}.ace-idle-fingers .ace_invalid {color: #FFFFFF;background-color: #FF0000}.ace-idle-fingers .ace_fold {background-color: #CC7833;border-color: #FFFFFF}.ace-idle-fingers .ace_support.ace_function {color: #B83426}.ace-idle-fingers .ace_variable.ace_parameter {font-style: italic}.ace-idle-fingers .ace_string {color: #A5C261}.ace-idle-fingers .ace_string.ace_regexp {color: #CCCC33}.ace-idle-fingers .ace_comment {font-style: italic;color: #BC9458}.ace-idle-fingers .ace_meta.ace_tag {color: #FFE5BB}.ace-idle-fingers .ace_entity.ace_name {color: #FFC66D}.ace-idle-fingers .ace_collab.ace_user1 {color: #323232;background-color: #FFF980}.ace-idle-fingers .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-kr.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/kr_theme",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-kr-theme",t.cssText=".ace-kr-theme .ace_gutter {background: #1c1917;color: #FCFFE0}.ace-kr-theme .ace_print-margin {width: 1px;background: #1c1917}.ace-kr-theme {background-color: #0B0A09;color: #FCFFE0}.ace-kr-theme .ace_cursor {color: #FF9900}.ace-kr-theme .ace_marker-layer .ace_selection {background: rgba(170, 0, 255, 0.45)}.ace-kr-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0B0A09;border-radius: 2px}.ace-kr-theme .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-kr-theme .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_marker-layer .ace_active-line {background: #38403D}.ace-kr-theme .ace_gutter-active-line {background-color : #38403D}.ace-kr-theme .ace_marker-layer .ace_selected-word {border: 1px solid rgba(170, 0, 255, 0.45)}.ace-kr-theme .ace_invisible {color: rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_keyword,.ace-kr-theme .ace_meta {color: #949C8B}.ace-kr-theme .ace_constant,.ace-kr-theme .ace_constant.ace_character,.ace-kr-theme .ace_constant.ace_character.ace_escape,.ace-kr-theme .ace_constant.ace_other {color: rgba(210, 117, 24, 0.76)}.ace-kr-theme .ace_invalid {color: #F8F8F8;background-color: #A41300}.ace-kr-theme .ace_support {color: #9FC28A}.ace-kr-theme .ace_support.ace_constant {color: #C27E66}.ace-kr-theme .ace_fold {background-color: #949C8B;border-color: #FCFFE0}.ace-kr-theme .ace_support.ace_function {color: #85873A}.ace-kr-theme .ace_storage {color: #FFEE80}.ace-kr-theme .ace_string {color: rgba(164, 161, 181, 0.8)}.ace-kr-theme .ace_string.ace_regexp {color: rgba(125, 255, 192, 0.65)}.ace-kr-theme .ace_comment {font-style: italic;color: #706D5B}.ace-kr-theme .ace_variable {color: #D1A796}.ace-kr-theme .ace_list,.ace-kr-theme .ace_markup.ace_list {background-color: #0F0040}.ace-kr-theme .ace_variable.ace_language {color: #FF80E1}.ace-kr-theme .ace_meta.ace_tag {color: #BABD9C}.ace-kr-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-kuroir.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/kuroir",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-kuroir",t.cssText="/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 467560D0-6ACE-4409-82FD-4791420837AC) */.ace-kuroir .ace_gutter {background: #e8e8e8;color: #333;}.ace-kuroir .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-kuroir {background-color: #E8E9E8;color: #363636;}.ace-kuroir .ace_cursor {color: #202020;}.ace-kuroir .ace_marker-layer .ace_selection {background: rgba(245, 170, 0, 0.57);}.ace-kuroir.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #E8E9E8;border-radius: 2px;}.ace-kuroir .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-kuroir .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(0, 0, 0, 0.29);}.ace-kuroir .ace_marker-layer .ace_active-line {background: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_gutter-active-line {background-color: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_marker-layer .ace_selected-word {border: 1px solid rgba(245, 170, 0, 0.57);}.ace-kuroir .ace_fold {border-color: #363636;}.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;font-style:italic;color:#FD1732;background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-merbivore.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/merbivore",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore",t.cssText=".ace-merbivore .ace_gutter {background: #202020;color: #E6E1DC}.ace-merbivore .ace_print-margin {width: 1px;background: #555651}.ace-merbivore {background-color: #161616;color: #E6E1DC}.ace-merbivore .ace_cursor {color: #FFFFFF}.ace-merbivore .ace_marker-layer .ace_selection {background: #454545}.ace-merbivore.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #161616;border-radius: 2px}.ace-merbivore .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore .ace_gutter-active-line {background-color: #333435}.ace-merbivore .ace_marker-layer .ace_selected-word {border: 1px solid #454545}.ace-merbivore .ace_invisible {color: #404040}.ace-merbivore .ace_entity.ace_name.ace_tag,.ace-merbivore .ace_keyword,.ace-merbivore .ace_meta,.ace-merbivore .ace_meta.ace_tag,.ace-merbivore .ace_storage,.ace-merbivore .ace_support.ace_function {color: #FC6F09}.ace-merbivore .ace_constant,.ace-merbivore .ace_constant.ace_character,.ace-merbivore .ace_constant.ace_character.ace_escape,.ace-merbivore .ace_constant.ace_other,.ace-merbivore .ace_support.ace_type {color: #1EDAFB}.ace-merbivore .ace_constant.ace_character.ace_escape {color: #519F50}.ace-merbivore .ace_constant.ace_language {color: #FDC251}.ace-merbivore .ace_constant.ace_library,.ace-merbivore .ace_string,.ace-merbivore .ace_support.ace_constant {color: #8DFF0A}.ace-merbivore .ace_constant.ace_numeric {color: #58C554}.ace-merbivore .ace_invalid {color: #FFFFFF;background-color: #990000}.ace-merbivore .ace_fold {background-color: #FC6F09;border-color: #E6E1DC}.ace-merbivore .ace_comment {font-style: italic;color: #AD2EA4}.ace-merbivore .ace_entity.ace_other.ace_attribute-name {color: #FFFF89}.ace-merbivore .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-merbivore_soft.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore-soft",t.cssText=".ace-merbivore-soft .ace_gutter {background: #262424;color: #E6E1DC}.ace-merbivore-soft .ace_print-margin {width: 1px;background: #262424}.ace-merbivore-soft {background-color: #1C1C1C;color: #E6E1DC}.ace-merbivore-soft .ace_cursor {color: #FFFFFF}.ace-merbivore-soft .ace_marker-layer .ace_selection {background: #494949}.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1C1C1C;border-radius: 2px}.ace-merbivore-soft .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore-soft .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore-soft .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore-soft .ace_gutter-active-line {background-color: #333435}.ace-merbivore-soft .ace_marker-layer .ace_selected-word {border: 1px solid #494949}.ace-merbivore-soft .ace_invisible {color: #404040}.ace-merbivore-soft .ace_entity.ace_name.ace_tag,.ace-merbivore-soft .ace_keyword,.ace-merbivore-soft .ace_meta,.ace-merbivore-soft .ace_meta.ace_tag,.ace-merbivore-soft .ace_storage {color: #FC803A}.ace-merbivore-soft .ace_constant,.ace-merbivore-soft .ace_constant.ace_character,.ace-merbivore-soft .ace_constant.ace_character.ace_escape,.ace-merbivore-soft .ace_constant.ace_other,.ace-merbivore-soft .ace_support.ace_type {color: #68C1D8}.ace-merbivore-soft .ace_constant.ace_character.ace_escape {color: #B3E5B4}.ace-merbivore-soft .ace_constant.ace_language {color: #E1C582}.ace-merbivore-soft .ace_constant.ace_library,.ace-merbivore-soft .ace_string,.ace-merbivore-soft .ace_support.ace_constant {color: #8EC65F}.ace-merbivore-soft .ace_constant.ace_numeric {color: #7FC578}.ace-merbivore-soft .ace_invalid,.ace-merbivore-soft .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #FE3838}.ace-merbivore-soft .ace_fold {background-color: #FC803A;border-color: #E6E1DC}.ace-merbivore-soft .ace_comment,.ace-merbivore-soft .ace_meta {font-style: italic;color: #AC4BB8}.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {color: #EAF1A3}.ace-merbivore-soft .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-mono_industrial.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-mono-industrial",t.cssText=".ace-mono-industrial .ace_gutter {background: #1d2521;color: #C5C9C9}.ace-mono-industrial .ace_print-margin {width: 1px;background: #555651}.ace-mono-industrial {background-color: #222C28;color: #FFFFFF}.ace-mono-industrial .ace_cursor {color: #FFFFFF}.ace-mono-industrial .ace_marker-layer .ace_selection {background: rgba(145, 153, 148, 0.40)}.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #222C28;border-radius: 2px}.ace-mono-industrial .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-mono-industrial .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_marker-layer .ace_active-line {background: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_gutter-active-line {background-color: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_marker-layer .ace_selected-word {border: 1px solid rgba(145, 153, 148, 0.40)}.ace-mono-industrial .ace_invisible {color: rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_string {background-color: #151C19;color: #FFFFFF}.ace-mono-industrial .ace_keyword,.ace-mono-industrial .ace_meta {color: #A39E64}.ace-mono-industrial .ace_constant,.ace-mono-industrial .ace_constant.ace_character,.ace-mono-industrial .ace_constant.ace_character.ace_escape,.ace-mono-industrial .ace_constant.ace_numeric,.ace-mono-industrial .ace_constant.ace_other {color: #E98800}.ace-mono-industrial .ace_entity.ace_name.ace_function,.ace-mono-industrial .ace_keyword.ace_operator,.ace-mono-industrial .ace_variable {color: #A8B3AB}.ace-mono-industrial .ace_invalid {color: #FFFFFF;background-color: rgba(153, 0, 0, 0.68)}.ace-mono-industrial .ace_support.ace_constant {color: #C87500}.ace-mono-industrial .ace_fold {background-color: #A8B3AB;border-color: #FFFFFF}.ace-mono-industrial .ace_support.ace_function {color: #588E60}.ace-mono-industrial .ace_entity.ace_name,.ace-mono-industrial .ace_support.ace_class,.ace-mono-industrial .ace_support.ace_type {color: #5778B6}.ace-mono-industrial .ace_storage {color: #C23B00}.ace-mono-industrial .ace_variable.ace_language,.ace-mono-industrial .ace_variable.ace_parameter {color: #648BD2}.ace-mono-industrial .ace_comment {color: #666C68;background-color: #151C19}.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {color: #909993}.ace-mono-industrial .ace_entity.ace_name.ace_tag {color: #A65EFF}.ace-mono-industrial .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-monokai.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;border-radius: 2px}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-pastel_on_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-pastel-on-dark",t.cssText=".ace-pastel-on-dark .ace_gutter {background: #353030;color: #8F938F}.ace-pastel-on-dark .ace_print-margin {width: 1px;background: #353030}.ace-pastel-on-dark {background-color: #2C2828;color: #8F938F}.ace-pastel-on-dark .ace_cursor {color: #A7A7A7}.ace-pastel-on-dark .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2C2828;border-radius: 2px}.ace-pastel-on-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-pastel-on-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_keyword,.ace-pastel-on-dark .ace_meta {color: #757aD8}.ace-pastel-on-dark .ace_constant,.ace-pastel-on-dark .ace_constant.ace_character,.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,.ace-pastel-on-dark .ace_constant.ace_other {color: #4FB7C5}.ace-pastel-on-dark .ace_keyword.ace_operator {color: #797878}.ace-pastel-on-dark .ace_constant.ace_character {color: #AFA472}.ace-pastel-on-dark .ace_constant.ace_language {color: #DE8E30}.ace-pastel-on-dark .ace_constant.ace_numeric {color: #CCCCCC}.ace-pastel-on-dark .ace_invalid,.ace-pastel-on-dark .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-pastel-on-dark .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-pastel-on-dark .ace_fold {background-color: #757aD8;border-color: #8F938F}.ace-pastel-on-dark .ace_support.ace_function {color: #AEB2F8}.ace-pastel-on-dark .ace_string {color: #66A968}.ace-pastel-on-dark .ace_string.ace_regexp {color: #E9C062}.ace-pastel-on-dark .ace_comment {color: #A6C6FF}.ace-pastel-on-dark .ace_variable {color: #BEBF55}.ace-pastel-on-dark .ace_variable.ace_language {color: #C1C144}.ace-pastel-on-dark .ace_xml-pe {color: #494949}.ace-pastel-on-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-solarized_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-solarized-dark",t.cssText=".ace-solarized-dark .ace_gutter {background: #01313f;color: #d0edf7}.ace-solarized-dark .ace_print-margin {width: 1px;background: #33555E}.ace-solarized-dark {background-color: #002B36;color: #93A1A1}.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,.ace-solarized-dark .ace_storage {color: #93A1A1}.ace-solarized-dark .ace_cursor,.ace-solarized-dark .ace_string.ace_regexp {color: #D30102}.ace-solarized-dark .ace_marker-layer .ace_active-line,.ace-solarized-dark .ace_marker-layer .ace_selection {background: rgba(255, 255, 255, 0.1)}.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002B36;border-radius: 2px}.ace-solarized-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-solarized-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_gutter-active-line {background-color: #0d3440}.ace-solarized-dark .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-dark .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_keyword,.ace-solarized-dark .ace_meta,.ace-solarized-dark .ace_support.ace_class,.ace-solarized-dark .ace_support.ace_type {color: #859900}.ace-solarized-dark .ace_constant.ace_character,.ace-solarized-dark .ace_constant.ace_other {color: #CB4B16}.ace-solarized-dark .ace_constant.ace_language {color: #B58900}.ace-solarized-dark .ace_constant.ace_numeric {color: #D33682}.ace-solarized-dark .ace_fold {background-color: #268BD2;border-color: #93A1A1}.ace-solarized-dark .ace_entity.ace_name.ace_function,.ace-solarized-dark .ace_entity.ace_name.ace_tag,.ace-solarized-dark .ace_support.ace_function,.ace-solarized-dark .ace_variable,.ace-solarized-dark .ace_variable.ace_language {color: #268BD2}.ace-solarized-dark .ace_string {color: #2AA198}.ace-solarized-dark .ace_comment {font-style: italic;color: #657B83}.ace-solarized-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-solarized_light.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-solarized-light",t.cssText=".ace-solarized-light .ace_gutter {background: #fbf1d3;color: #333}.ace-solarized-light .ace_print-margin {width: 1px;background: #e8e8e8}.ace-solarized-light {background-color: #FDF6E3;color: #586E75}.ace-solarized-light .ace_cursor {color: #000000}.ace-solarized-light .ace_marker-layer .ace_selection {background: rgba(7, 54, 67, 0.09)}.ace-solarized-light.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FDF6E3;border-radius: 2px}.ace-solarized-light .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-solarized-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_marker-layer .ace_active-line {background: #EEE8D5}.ace-solarized-light .ace_gutter-active-line {background-color : #EDE5C1}.ace-solarized-light .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-light .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_keyword,.ace-solarized-light .ace_meta,.ace-solarized-light .ace_support.ace_class,.ace-solarized-light .ace_support.ace_type {color: #859900}.ace-solarized-light .ace_constant.ace_character,.ace-solarized-light .ace_constant.ace_other {color: #CB4B16}.ace-solarized-light .ace_constant.ace_language {color: #B58900}.ace-solarized-light .ace_constant.ace_numeric {color: #D33682}.ace-solarized-light .ace_fold {background-color: #268BD2;border-color: #586E75}.ace-solarized-light .ace_entity.ace_name.ace_function,.ace-solarized-light .ace_entity.ace_name.ace_tag,.ace-solarized-light .ace_support.ace_function,.ace-solarized-light .ace_variable,.ace-solarized-light .ace_variable.ace_language {color: #268BD2}.ace-solarized-light .ace_storage {color: #073642}.ace-solarized-light .ace_string {color: #2AA198}.ace-solarized-light .ace_string.ace_regexp {color: #D30102}.ace-solarized-light .ace_comment,.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {color: #93A1A1}.ace-solarized-light .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-terminal.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/terminal",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-terminal-theme",t.cssText=".ace-terminal-theme .ace_gutter {background: #1a0005;color: steelblue}.ace-terminal-theme .ace_print-margin {width: 1px;background: #1a1a1a}.ace-terminal-theme {background-color: black;color: #DEDEDE}.ace-terminal-theme .ace_cursor {color: #9F9F9F}.ace-terminal-theme .ace_marker-layer .ace_selection {background: #424242}.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px black;border-radius: 2px}.ace-terminal-theme .ace_marker-layer .ace_step {background: rgb(0, 0, 0)}.ace-terminal-theme .ace_marker-layer .ace_bracket {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-start {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {margin: -1px 0 0 -1px;border: 1px solid #900}.ace-terminal-theme .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-terminal-theme .ace_gutter-active-line {background-color: #2A112A}.ace-terminal-theme .ace_marker-layer .ace_selected-word {border: 1px solid #424242}.ace-terminal-theme .ace_invisible {color: #343434}.ace-terminal-theme .ace_keyword,.ace-terminal-theme .ace_meta,.ace-terminal-theme .ace_storage,.ace-terminal-theme .ace_storage.ace_type,.ace-terminal-theme .ace_support.ace_type {color: tomato}.ace-terminal-theme .ace_keyword.ace_operator {color: deeppink}.ace-terminal-theme .ace_constant.ace_character,.ace-terminal-theme .ace_constant.ace_language,.ace-terminal-theme .ace_constant.ace_numeric,.ace-terminal-theme .ace_keyword.ace_other.ace_unit,.ace-terminal-theme .ace_support.ace_constant,.ace-terminal-theme .ace_variable.ace_parameter {color: #E78C45}.ace-terminal-theme .ace_constant.ace_other {color: gold}.ace-terminal-theme .ace_invalid {color: yellow;background-color: red}.ace-terminal-theme .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-terminal-theme .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-terminal-theme .ace_entity.ace_name.ace_function,.ace-terminal-theme .ace_support.ace_function,.ace-terminal-theme .ace_variable {color: #7AA6DA}.ace-terminal-theme .ace_support.ace_class,.ace-terminal-theme .ace_support.ace_type {color: #E7C547}.ace-terminal-theme .ace_heading,.ace-terminal-theme .ace_string {color: #B9CA4A}.ace-terminal-theme .ace_entity.ace_name.ace_tag,.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,.ace-terminal-theme .ace_meta.ace_tag,.ace-terminal-theme .ace_string.ace_regexp,.ace-terminal-theme .ace_variable {color: #D54E53}.ace-terminal-theme .ace_comment {color: orangered}.ace-terminal-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-textmate.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-tomorrow.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-tomorrow_night.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night",t.cssText=".ace-tomorrow-night .ace_gutter {background: #25282c;color: #C5C8C6}.ace-tomorrow-night .ace_print-margin {width: 1px;background: #25282c}.ace-tomorrow-night {background-color: #1D1F21;color: #C5C8C6}.ace-tomorrow-night .ace_cursor {color: #AEAFAD}.ace-tomorrow-night .ace_marker-layer .ace_selection {background: #373B41}.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1D1F21;border-radius: 2px}.ace-tomorrow-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #4B4E55}.ace-tomorrow-night .ace_marker-layer .ace_active-line {background: #282A2E}.ace-tomorrow-night .ace_gutter-active-line {background-color: #282A2E}.ace-tomorrow-night .ace_marker-layer .ace_selected-word {border: 1px solid #373B41}.ace-tomorrow-night .ace_invisible {color: #4B4E55}.ace-tomorrow-night .ace_keyword,.ace-tomorrow-night .ace_meta,.ace-tomorrow-night .ace_storage,.ace-tomorrow-night .ace_storage.ace_type,.ace-tomorrow-night .ace_support.ace_type {color: #B294BB}.ace-tomorrow-night .ace_keyword.ace_operator {color: #8ABEB7}.ace-tomorrow-night .ace_constant.ace_character,.ace-tomorrow-night .ace_constant.ace_language,.ace-tomorrow-night .ace_constant.ace_numeric,.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night .ace_support.ace_constant,.ace-tomorrow-night .ace_variable.ace_parameter {color: #DE935F}.ace-tomorrow-night .ace_constant.ace_other {color: #CED1CF}.ace-tomorrow-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night .ace_fold {background-color: #81A2BE;border-color: #C5C8C6}.ace-tomorrow-night .ace_entity.ace_name.ace_function,.ace-tomorrow-night .ace_support.ace_function,.ace-tomorrow-night .ace_variable {color: #81A2BE}.ace-tomorrow-night .ace_support.ace_class,.ace-tomorrow-night .ace_support.ace_type {color: #F0C674}.ace-tomorrow-night .ace_heading,.ace-tomorrow-night .ace_markup.ace_heading,.ace-tomorrow-night .ace_string {color: #B5BD68}.ace-tomorrow-night .ace_entity.ace_name.ace_tag,.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night .ace_meta.ace_tag,.ace-tomorrow-night .ace_string.ace_regexp,.ace-tomorrow-night .ace_variable {color: #CC6666}.ace-tomorrow-night .ace_comment {color: #969896}.ace-tomorrow-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-twilight.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=".ace-twilight .ace_gutter {background: #232323;color: #E2E2E2}.ace-twilight .ace_print-margin {width: 1px;background: #232323}.ace-twilight {background-color: #141414;color: #F8F8F8}.ace-twilight .ace_cursor {color: #A7A7A7}.ace-twilight .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-twilight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;border-radius: 2px}.ace-twilight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-twilight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-twilight .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-twilight .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-twilight .ace_keyword,.ace-twilight .ace_meta {color: #CDA869}.ace-twilight .ace_constant,.ace-twilight .ace_constant.ace_character,.ace-twilight .ace_constant.ace_character.ace_escape,.ace-twilight .ace_constant.ace_other,.ace-twilight .ace_heading,.ace-twilight .ace_markup.ace_heading,.ace-twilight .ace_support.ace_constant {color: #CF6A4C}.ace-twilight .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-twilight .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-twilight .ace_support {color: #9B859D}.ace-twilight .ace_fold {background-color: #AC885B;border-color: #F8F8F8}.ace-twilight .ace_support.ace_function {color: #DAD085}.ace-twilight .ace_list,.ace-twilight .ace_markup.ace_list,.ace-twilight .ace_storage {color: #F9EE98}.ace-twilight .ace_entity.ace_name.ace_function,.ace-twilight .ace_meta.ace_tag,.ace-twilight .ace_variable {color: #AC885B}.ace-twilight .ace_string {color: #8F9D6A}.ace-twilight .ace_string.ace_regexp {color: #E9C062}.ace-twilight .ace_comment {font-style: italic;color: #5F5A60}.ace-twilight .ace_variable {color: #7587A6}.ace-twilight .ace_xml-pe {color: #494949}.ace-twilight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-vibrant_ink.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-vibrant-ink",t.cssText=".ace-vibrant-ink .ace_gutter {background: #1a1a1a;color: #BEBEBE}.ace-vibrant-ink .ace_print-margin {width: 1px;background: #1a1a1a}.ace-vibrant-ink {background-color: #0F0F0F;color: #FFFFFF}.ace-vibrant-ink .ace_cursor {color: #FFFFFF}.ace-vibrant-ink .ace_marker-layer .ace_selection {background: #6699CC}.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0F0F0F;border-radius: 2px}.ace-vibrant-ink .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-vibrant-ink .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-vibrant-ink .ace_marker-layer .ace_active-line {background: #333333}.ace-vibrant-ink .ace_gutter-active-line {background-color: #333333}.ace-vibrant-ink .ace_marker-layer .ace_selected-word {border: 1px solid #6699CC}.ace-vibrant-ink .ace_invisible {color: #404040}.ace-vibrant-ink .ace_keyword,.ace-vibrant-ink .ace_meta {color: #FF6600}.ace-vibrant-ink .ace_constant,.ace-vibrant-ink .ace_constant.ace_character,.ace-vibrant-ink .ace_constant.ace_character.ace_escape,.ace-vibrant-ink .ace_constant.ace_other {color: #339999}.ace-vibrant-ink .ace_constant.ace_numeric {color: #99CC99}.ace-vibrant-ink .ace_invalid,.ace-vibrant-ink .ace_invalid.ace_deprecated {color: #CCFF33;background-color: #000000}.ace-vibrant-ink .ace_fold {background-color: #FFCC00;border-color: #FFFFFF}.ace-vibrant-ink .ace_entity.ace_name.ace_function,.ace-vibrant-ink .ace_support.ace_function,.ace-vibrant-ink .ace_variable {color: #FFCC00}.ace-vibrant-ink .ace_variable.ace_parameter {font-style: italic}.ace-vibrant-ink .ace_string {color: #66FF00}.ace-vibrant-ink .ace_string.ace_regexp {color: #44B4CC}.ace-vibrant-ink .ace_comment {color: #9933CC}.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {font-style: italic;color: #99CC99}.ace-vibrant-ink .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/ace/theme-xcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText="/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */.ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode {background-color: #FFFFFF;color: #000000}.ace-xcode .ace_cursor {color: #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/exercises.css: -------------------------------------------------------------------------------- 1 | .book .book-body .page-wrapper .page-inner section.exercise { 2 | display: block !important; 3 | padding: 0px; 4 | margin: 20px 15px; 5 | border: 3px solid #2f8cde; 6 | background: #fff; 7 | color: #333; 8 | font-family: sans-serif; 9 | } 10 | 11 | .page-inner section.exercise .header { 12 | padding: 5px 15px; 13 | color: #fff; 14 | background: #2f8cde; 15 | } 16 | 17 | .page-inner section.exercise .header h2 { 18 | margin: 0px; 19 | font-size: 20px; 20 | } 21 | 22 | .page-inner section.exercise .message { 23 | margin: 5px 15px; 24 | } 25 | 26 | .page-inner section.exercise .editor { 27 | min-height: 50px; 28 | font-size: 14px; 29 | border-top: 1px solid #ddd; 30 | border-bottom: 1px solid #ddd; 31 | } 32 | 33 | .page-inner section.exercise .alert { 34 | display: none; 35 | margin: 0px; 36 | margin-bottom: 10px; 37 | padding: 8px 15px; 38 | } 39 | 40 | .page-inner section.exercise.return-error .alert-danger { 41 | display: block; 42 | } 43 | 44 | .page-inner section.exercise.return-success .alert-success { 45 | display: block; 46 | } 47 | -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/jsrepl/langs/javascript/jsrepl_js.js: -------------------------------------------------------------------------------- 1 | (function(){self.JSREPLEngine=function(){function a(d,b,c,a,e,f){this.result=c;this.error=a;this.sandbox=e;this.inspect=this.sandbox.console.inspect;this.functionClass=this.sandbox.Function;this.sandbox.__eval=this.sandbox.eval;f()}a.prototype.Eval=function(d){var b;try{return b=this.sandbox.__eval(d),this.result(b===void 0?"":this.inspect(b))}catch(a){return this.error(a)}};a.prototype.RawEval=function(a){var b;try{return b=this.sandbox.__eval(a),this.result(b)}catch(c){return this.error(c)}};a.prototype.GetNextLineIndent= 2 | function(a){try{return new this.functionClass(a),false}catch(b){return/[\[\{\(]$/.test(a)?1:0}};return a}()}).call(this); 3 | -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-exercises/jsrepl/sandbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jsREPL Sandbox 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/gitbook/plugins/gitbook-plugin-mathjax/plugin.js: -------------------------------------------------------------------------------- 1 | require(["gitbook"], function(gitbook) { 2 | MathJax.Hub.Config({ 3 | tex2jax: { 4 | processEscapes: true 5 | } 6 | }); 7 | 8 | 9 | gitbook.events.bind("page.change", function() { 10 | MathJax.Hub.Typeset() 11 | }); 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /docs/glossary_index.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /docs/intro/README.md: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /fooling_around_boolean/README.md: -------------------------------------------------------------------------------- 1 | # #1 Fooling around boolean 2 | 3 | Look at the following "implementation" of a xor method on the prototype of the Boolean type. 4 | 5 | ``` 6 | Boolean.prototype.xor = function ( value ) { return !!this !== !!value; }; 7 | ``` 8 | 9 | When we execute the following statement we get an unexpected result. 10 | 11 | ``` 12 | false.xor(false); // => true 13 | ``` 14 | 15 | --- 16 | Why does xor resolves in an unexpected manner? 17 | 18 | ```js 19 | 20 | ``` 21 | ```js 22 | Because this is not false, this inside the function is the complete object and it evaluates to true when it's converted to true the same way that !!{} is true. 23 | ``` 24 | ```js 25 | __match_answer_and_solution__ 26 | ``` 27 | 28 | --- 29 | 30 | --- 31 | Write the code to fix the implementation of xor method: 32 | ```js 33 | Boolean.prototype.xor = function ( value ) { return !!this !== !!value; }; 34 | ``` 35 | ```js 36 | Boolean.prototype.xor = function ( value ) { return !!this.valueOf() !== !!value; }; 37 | ``` 38 | ```js 39 | assert(false.xor(false) === false); 40 | ``` 41 | --- -------------------------------------------------------------------------------- /fooling_around_boolean_2/README.md: -------------------------------------------------------------------------------- 1 | # #2 Fooling around boolean 2 | 3 | All the following statements are true 4 | 5 | ``` 6 | !!{} == true; 7 | ``` 8 | ``` 9 | [] == false; 10 | ``` 11 | 12 | We have the following code: 13 | 14 | ``` 15 | var hasTruthyStuff = function (aSymbols) { 16 | var nResult = 0, 17 | i = 0, 18 | nLen = aSymbols.length; 19 | 20 | for (; i < nLen; i++) { 21 | nResult |= aSymbols[i]; 22 | } 23 | return !!nResult; 24 | }; 25 | ``` 26 | But when we execute the following statement it returns false when we expected to return true because {} should return true. 27 | 28 | ``` 29 | hasTruthyStuff([{},[], 0]) 30 | ``` 31 | 32 | --- 33 | Why does calling the previous statement returns false? 34 | 35 | ```js 36 | 37 | ``` 38 | ```js 39 | You have to be careful when using |= because when it's used to perform a test besides an object it will not modify the original value, then it remains to be zero. 40 | ``` 41 | ```js 42 | __match_answer_and_solution__ 43 | ``` 44 | --- -------------------------------------------------------------------------------- /frozen/README.md: -------------------------------------------------------------------------------- 1 | #Frozen 2 | This challenge will need a bit of knowledge of one of the new features in Javascript 1.8.5, this feature is Object.freeze to get the correct result. 3 | 4 | --- 5 | Note: 6 | * You can use anything of ECMASCRIPT 5 but not DOM or BOM, just Javascript 7 | * There is more than one answer but only the most simple will win. 8 | 9 | Here you have the code to be fixed: 10 | ```js 11 | var dog = { 12 | sound: 'Bark!' 13 | }; 14 | 15 | Object.freeze(dog); 16 | 17 | /* Put your code here */ 18 | 19 | //This method should return 'Bark!' 20 | var result = dog.talk(); 21 | ``` 22 | 23 | ```js 24 | var dog = { 25 | sound: 'Bark!' 26 | }; 27 | 28 | Object.freeze(dog); 29 | 30 | Object.prototype.talk = function () { 31 | return this.sound; 32 | }; 33 | 34 | //This method should return 'Bark!' 35 | var result = dog.talk(); 36 | ``` 37 | 38 | ```js 39 | assert( result === 'Bark!'); 40 | ``` 41 | 42 | --- 43 | -------------------------------------------------------------------------------- /ghost_array/README.md: -------------------------------------------------------------------------------- 1 | # Ghost Array 2 | 3 | Take a look at this code: 4 | 5 | ## Snippet 1 6 | ``` 7 | var arr = []; 8 | arr[999] = 'john'; 9 | console.log(arr.length); 10 | ``` 11 | 12 | --- 13 | What is the result of execute "Snippet 1" code? 14 | 15 | ```js 16 | 17 | ``` 18 | ```js 19 | 1000 20 | ``` 21 | ```js 22 | __match_answer_and_solution__ 23 | ``` 24 | --- 25 | 26 | ## Snippet 2 27 | ``` 28 | var arr = []; 29 | arr[4294967295] = 'james'; 30 | console.log(arr.length); 31 | ``` 32 | 33 | --- 34 | What is the result of execute "Snippet 2" code? 35 | 36 | ```js 37 | 38 | ``` 39 | ```js 40 | 0 41 | ``` 42 | ```js 43 | __match_answer_and_solution__ 44 | ``` 45 | --- 46 | 47 | --- 48 | Why? 49 | 50 | ```js 51 | 52 | ``` 53 | ```js 54 | Because 4294967295 overflows the max number of elements that could be handled by Javascript in Arrays. 55 | ``` 56 | ```js 57 | __match_answer_and_solution__ 58 | ``` 59 | --- 60 | 61 | ## Snippet 3 62 | 63 | ``` 64 | var arr = []; 65 | arr[4294967295] = 'james'; 66 | console.log(arr[4294967295]); 67 | ``` 68 | 69 | --- 70 | What is the result of execute "Snippet 3" code? 71 | 72 | ```js 73 | 74 | ``` 75 | ```js 76 | "james" 77 | ``` 78 | ```js 79 | __match_answer_and_solution__ 80 | ``` 81 | --- 82 | 83 | --- 84 | Why? 85 | 86 | ```js 87 | 88 | ``` 89 | ```js 90 | Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. 91 | ``` 92 | ```js 93 | __match_answer_and_solution__ 94 | ``` 95 | --- 96 | 97 | ## Snippet 4 98 | 99 | ``` 100 | var arr = []; 101 | arr[Number.MIN_VALUE] = 'mary'; 102 | console.log(arr.length); 103 | ``` 104 | 105 | --- 106 | What is the result of execute "Snippet 4" code? 107 | 108 | ```js 109 | 110 | ``` 111 | ```js 112 | 0 113 | ``` 114 | ```js 115 | __match_answer_and_solution__ 116 | ``` 117 | --- 118 | 119 | --- 120 | Why? 121 | 122 | ```js 123 | 124 | ``` 125 | ```js 126 | Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. 127 | ``` 128 | ```js 129 | __match_answer_and_solution__ 130 | ``` 131 | --- 132 | 133 | ## Snippet 5 134 | 135 | ``` 136 | var arr = []; 137 | arr[Number.MIN_VALUE] = 'mary'; 138 | console.log(arr[Number.MIN_VALUE]); 139 | ``` 140 | 141 | --- 142 | What is the result of execute "Snippet 5" code? 143 | 144 | ```js 145 | 146 | ``` 147 | ```js 148 | "mary" 149 | ``` 150 | ```js 151 | __match_answer_and_solution__ 152 | ``` 153 | --- 154 | 155 | --- 156 | Why? 157 | 158 | ```js 159 | 160 | ``` 161 | ```js 162 | Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. 163 | ``` 164 | ```js 165 | __match_answer_and_solution__ 166 | ``` 167 | --- -------------------------------------------------------------------------------- /hoisting1/README.md: -------------------------------------------------------------------------------- 1 | # Hoisting and Conditionals Statements 2 | 3 | I'm Ernie and my friend is Bert and we wrote this code to tell other people which type of birds we like. 4 | 5 | ``` 6 | var bird = 'Pidgeons'; 7 | ( function () { 8 | if ( typeof bird === 'undefined' ){ 9 | var bird = 'Rubber Duck'; 10 | console.log('Ernie loves his ' + bird ); 11 | } else { 12 | console.log('Bert loves his ' + bird ); 13 | } 14 | }() ); 15 | ``` 16 | 17 | There should be a problem with our code because for some reason I only see 'Ernie loves his Rubber Duck' when I expected to see 'Bert loves his Pidgeons', could you help me? 18 | 19 | --- 20 | 21 | Why this is happening? 22 | 23 | ```js 24 | 25 | ``` 26 | 27 | ```js 28 | This is happening because the hoisting problem. Remember that in Javascript there are no block variables. 29 | ``` 30 | 31 | ```js 32 | __match_answer_and_solution__ 33 | ``` 34 | 35 | --- 36 | 37 | --- 38 | 39 | Please help me and fix this code to get 'Bert loves his Pidgeons'. 40 | 41 | ```js 42 | var bird = 'Pidgeons'; 43 | ( function () { 44 | if ( typeof bird === 'undefined' ){ 45 | var bird = 'Rubber Duck'; 46 | console.log('Ernie loves his ' + bird ); 47 | } else { 48 | console.log('Bert loves his ' + bird ); 49 | } 50 | }() ); 51 | ``` 52 | 53 | ```js 54 | var bird = 'Pidgeons'; 55 | ( function () { 56 | if ( typeof bird === 'undefined' ){ 57 | bird = 'Rubber Duck'; 58 | console.log('Ernie loves his ' + bird ); 59 | } else { 60 | console.log('Bert loves his ' + bird ); 61 | } 62 | }() ); 63 | ``` 64 | 65 | ```js 66 | assert(inputs[0] === 'Bert loves his Pidgeons'); 67 | ``` 68 | 69 | ```js 70 | var inputs = []; 71 | var backConsole = console; 72 | var console = { 73 | log: function (str) { 74 | inputs.push(str); 75 | backConsole.log(str); 76 | console = backConsole; 77 | } 78 | }; 79 | ``` 80 | --- 81 | -------------------------------------------------------------------------------- /intro/README.md: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /invaluable/README.md: -------------------------------------------------------------------------------- 1 | # Invaluable 2 | 3 | We have the following code: 4 | 5 | ``` 6 | var strMethod = 'valueOf', 7 | strProperty = 'length', 8 | result; 9 | ``` 10 | 11 | ## Snippet 1 12 | When we execute the Snippet 1, result has a value of 1. 13 | ``` 14 | result = [44 + 22][strMethod]()[strProperty]; 15 | ``` 16 | 17 | --- 18 | Why? 19 | ```js 20 | 21 | ``` 22 | 23 | ```js 24 | Because the precedence of operators, the execution workflow is: 25 | 44+22 -> returns 66 26 | 66 + [ ] -> returns [66] 27 | [66].valueOf() -> returns [66] 28 | [66].length -> returns 1 29 | ``` 30 | 31 | ```js 32 | __match_answer_and_solution__ 33 | ``` 34 | --- 35 | 36 | ## Snippet 2 37 | When we execute the Snippet 2, result has a value of 0. 38 | ``` 39 | value = [44 + 22][strMethod][strProperty]; 40 | ``` 41 | 42 | --- 43 | Why? 44 | ```js 45 | 46 | ``` 47 | 48 | ```js 49 | Because the precedence of operators and how native methods behaviours, the execution workflow is: 50 | 44+22 -> returns 66 51 | 66 + [ ] -> returns [66] 52 | [66].valueOf -> returns function valueOf() { [native code] } 53 | (function valueOf() { [native code] }).length -> returns 0 54 | ``` 55 | 56 | ```js 57 | __match_answer_and_solution__ 58 | ``` 59 | --- -------------------------------------------------------------------------------- /json/README.md: -------------------------------------------------------------------------------- 1 | # JSON 2 | This challenge will help you to understand how JSON object works. 3 | Take a look to the following code: 4 | ``` 5 | var parent = { 6 | name: 'peter', 7 | surname: 'doe' 8 | }; 9 | var parentStringified = JSON.stringify( parent ); 10 | ``` 11 | After execute the previous code we execute the following statement and the result is true. 12 | ``` 13 | console.log( parentStringified === '{ "name": "peter", "surname": "doe" }'); 14 | ``` 15 | 16 | --- 17 | 18 | Write the code needed to get the expected result without changing the values of ``obj.name`` and ``obj.surname`` values: 19 | 20 | ```js 21 | var obj = { 22 | name: 'john', 23 | surname: 'doe' 24 | }; 25 | 26 | // Write the code to get '{ "name": "james", "surname": "sullivan" }' 27 | // when the next statement is executed. 28 | 29 | var result = JSON.stringify( obj ); 30 | ``` 31 | 32 | ```js 33 | var obj = { 34 | name: 'john', 35 | surname: 'doe' 36 | }; 37 | obj.toJSON = function () { 38 | return { name: 'james', surname: 'sullivan' }; 39 | }; 40 | var result = JSON.stringify( obj ); 41 | ``` 42 | 43 | ```js 44 | assert(JSON.parse(result).name == 'james' && JSON.parse(result).surname == 'sullivan'); 45 | ``` 46 | --- 47 | -------------------------------------------------------------------------------- /nested_loop/README.md: -------------------------------------------------------------------------------- 1 | # Exit nested loop 2 | 3 | How to exit of a nested loop. 4 | 5 | --- 6 | 7 | Make the modifications to the following code so that when it's executed it should exit the first time indexInnerLoop has a value of 10 and indexOuterLoop has a value of 0. 8 | 9 | ```js 10 | var indexOuterLoop, iterationsOuterLoop = 1000, indexInnerLoop, iterationsInnerLoop = 100; 11 | 12 | for (indexOuterLoop = 0; indexOuterLoop < 1000; indexOuterLoop++) 13 | { 14 | for (indexInnerLoop = 0; indexInnerLoop < iterationsInnerLoop; indexInnerLoop++) 15 | { 16 | if (indexInnerLoop === 10) 17 | { 18 | console.log( 'indexInnerLoop is equals to 10' ); 19 | break; 20 | } 21 | } 22 | } 23 | 24 | console.log( indexOuterLoop ); // Should log 0. 25 | ``` 26 | 27 | ```js 28 | var indexOuterLoop, iterationsOuterLoop = 1000, indexInnerLoop, iterationsInnerLoop = 100; 29 | 30 | outer: 31 | for (indexOuterLoop = 0; indexOuterLoop < 1000; indexOuterLoop++) 32 | { 33 | inner: 34 | for (indexInnerLoop = 0; indexInnerLoop < iterationsInnerLoop; indexInnerLoop++) 35 | { 36 | if (indexInnerLoop === 10) 37 | { 38 | console.log( 'indexInnerLoop is equals to 10' ); 39 | break outer; 40 | } 41 | } 42 | } 43 | 44 | console.log( indexOuterLoop ); // Should log 0. 45 | ``` 46 | 47 | ```js 48 | assert(items[0] === 'indexInnerLoop is equals to 10' && items[1] === 0); 49 | ``` 50 | 51 | ```js 52 | var items = []; 53 | var backConsole = console; 54 | var counter 55 | var console = { 56 | log: function (str) { 57 | items.push(str); 58 | counter++; 59 | if(counter === 2){ 60 | console = backConsole; 61 | } 62 | } 63 | }; 64 | ``` 65 | 66 | --- 67 | -------------------------------------------------------------------------------- /nested_scopes/README.md: -------------------------------------------------------------------------------- 1 | # Nested Scopes 2 | 3 | Take a look at the following code but don't execute it in the console. 4 | 5 | ``` 6 | {var a = 1;{var b = 2;{( function() {var c = a + b;} )()}}c;} 7 | ``` 8 | 9 | --- 10 | What's the result of executing the previous code? 11 | 12 | ```js 13 | 14 | ``` 15 | 16 | ```js 17 | ReferenceError: c is not defined 18 | ``` 19 | 20 | ```js 21 | __match_answer_and_solution__ 22 | ``` 23 | --- 24 | 25 | --- 26 | Why? 27 | ```js 28 | 29 | ``` 30 | 31 | ```js 32 | The cause of the error is because Javascript only has not block scopes as in other languages, then 'c' only exist inside the function block and it throws an error when we are trying to call it from the current scope. 33 | ``` 34 | 35 | ```js 36 | __match_answer_and_solution__ 37 | ``` 38 | --- -------------------------------------------------------------------------------- /now_you_see_me/README.md: -------------------------------------------------------------------------------- 1 | # Now you see me ... 2 | 3 | ## Snippet 1 4 | ``` 5 | var f = function g() { 6 | return 23; 7 | }; 8 | typeof g(); 9 | ``` 10 | 11 | --- 12 | What is the result of executing Snippet 1 code? 13 | 14 | ```js 15 | 16 | ``` 17 | 18 | ```js 19 | ReferenceError: g is not defined 20 | ``` 21 | 22 | ```js 23 | __match_answer_and_solution__ 24 | ``` 25 | --- 26 | 27 | --- 28 | Why? 29 | 30 | ```js 31 | 32 | ``` 33 | 34 | ```js 35 | When a function expression has a named function it can only be accessed using this name from inside the function itself, but from outside of the function it doesn't exist this is the reason that 'g' trows a Reference Error when is called. 36 | ``` 37 | 38 | ```js 39 | __match_answer_and_solution__ 40 | ``` 41 | --- -------------------------------------------------------------------------------- /objects1/README.md: -------------------------------------------------------------------------------- 1 | # Check properties 2 | 3 | We have the following code... 4 | 5 | ```js 6 | var key, 7 | obj = { 8 | name: 'john', 9 | surname: 'doe' 10 | }; 11 | 12 | 13 | for ( key in obj ) { 14 | if ( obj.hasOwnProperty( key ) ) { 15 | console.log( key + ' exists in obj' ); 16 | console.log( key + ': ' + obj[key] ); 17 | continue; 18 | } 19 | console.log( key + " doesn't exist in obj" ); 20 | } 21 | ``` 22 | ... and the result of executing it is... 23 | 24 | ``` 25 | name exists in obj 26 | name: john 27 | surname exists in obj 28 | surname: doe 29 | ``` 30 | 31 | ... but we want to get the following result, can you help us? 32 | 33 | ``` 34 | name doesn't exist in obj 35 | surname exists in obj 36 | surname: doe 37 | ``` 38 | 39 | 40 | --- 41 | Write the code to get the expected result. 42 | 43 | ```js 44 | var key, 45 | obj = { 46 | name: 'john', 47 | surname: 'doe' 48 | }; 49 | 50 | 51 | for ( key in obj ) { 52 | if ( obj.hasOwnProperty( key ) ) { 53 | console.log( key + ' exists in obj' ); 54 | console.log( key + ': ' + obj[key] ); 55 | continue; 56 | } 57 | console.log( key + " doesn't exist in obj" ); 58 | } 59 | ``` 60 | ```js 61 | var key, 62 | obj = { 63 | name: 'john', 64 | surname: 'doe' 65 | }; 66 | 67 | Object.prototype.hasOwnProperty = function (key) { 68 | if(key == 'name'){ 69 | return false; 70 | } 71 | return true; 72 | }; 73 | 74 | for ( key in obj ) { 75 | if ( obj.hasOwnProperty( key ) ) { 76 | console.log( key + ' exists in obj' ); 77 | console.log( key + ': ' + obj[key] ); 78 | continue; 79 | } 80 | console.log( key + " doesn't exist in obj" ); 81 | } 82 | ``` 83 | ```js 84 | assert(items.length == 3 && items[0] == 'name doesn\'t exist in obj' && items[1] == 'surname exists in obj' && items[2] == 'surname: doe'); 85 | ``` 86 | ```js 87 | var items = []; 88 | var backConsole = console; 89 | var console = { 90 | log: function (str) { 91 | items.push(str); 92 | if(items.length === 3) 93 | { 94 | console = backConsole; 95 | }else{ 96 | backConsole.log(str); 97 | } 98 | } 99 | }; 100 | ``` 101 | --- 102 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Javascript_Challenges", 3 | "version": "0.0.2", 4 | "description": "A bunch of Javascript Challenges", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/tcorral/Javascript-Challenges-book.git" 8 | }, 9 | "author": "Tomás Corral ", 10 | "license": "Apache 2", 11 | "dependencies": {}, 12 | "devDependencies": { 13 | "gitbook": "^3.2.2", 14 | "grunt": "~0.4.1", 15 | "grunt-cli": "^1.2.0", 16 | "grunt-contrib-clean": "~0.5.0", 17 | "grunt-gh-pages": "0.9.1", 18 | "grunt-gitbook": "^1.5.0" 19 | }, 20 | "peerDependencies": { 21 | "grunt": "~0.4.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /point/README.md: -------------------------------------------------------------------------------- 1 | # Point 2 | This challenge needs you to implement a Point class so that the following code returns true. 3 | ``` 4 | new Point( new Point(10, 20) + new Point(30, 50) ).toString() === '{40,70}'; 5 | ``` 6 | 7 | --- 8 | Implement Point and assume that: 9 | 10 | * Must be generic and be able to handle x and y values from 0..999 11 | * The requirements to do it are to implement valueOf and/or toString methods. 12 | 13 | ```js 14 | 15 | ``` 16 | ```js 17 | var Point = function (x, y) { 18 | if(typeof x === 'string') { 19 | this.convertStringToCoordinates(x); 20 | }else{ 21 | this.x = x; 22 | this.y = y; 23 | } 24 | }; 25 | Point.prototype.convertStringToCoordinates = function ( value ) { 26 | var arr, index, len, item; 27 | this.x = 0; 28 | this.y = 0; 29 | arr = JSON.parse('[' + value.replace(/{/g,'[').replace(/}/g,']').replace( new RegExp('\\]\\[', 'g'), '],[') + ']'); 30 | len = arr.length; 31 | for(index = 0; index < len; index++) { 32 | item = arr[index]; 33 | this.x += item[0]; 34 | this.y += item[1]; 35 | } 36 | }; 37 | Point.prototype.toString = function () { 38 | return '{' + this.x + ',' + this.y + '}'; 39 | }; 40 | ``` 41 | ```js 42 | assert(new Point( new Point(10, 20) + new Point(30, 50) ).toString() === '{40,70}'); 43 | ``` 44 | --- -------------------------------------------------------------------------------- /running_man/README.md: -------------------------------------------------------------------------------- 1 | # Running man 2 | We are playing in 'The Running Man' show and we have 9007199254740992 unit times to survive but all the gamers in previous game have been killed even when they have been playing bravely, could you help us? 3 | 4 | *The following code could make crash your browser!! Be careful!!* 5 | ``` 6 | var endTheGame = 9007199254740992, 7 | startTheGame = endTheGame - 100, 8 | count = 0, 9 | index, 10 | result; 11 | 12 | for ( index = startTheGame; index <= endTheGame; index++ ) { 13 | count++; 14 | } 15 | 16 | result = count; 17 | ``` 18 | 19 | --- 20 | Fix the code to allow us to survive: 21 | ```js 22 | var endTheGame = 9007199254740992, 23 | startTheGame = endTheGame - 100, 24 | count = 0, 25 | index, 26 | result; 27 | 28 | for ( index = startTheGame; index <= endTheGame; index++ ) { 29 | count++; 30 | } 31 | 32 | result = count; 33 | ``` 34 | 35 | ```js 36 | var endTheGame = 9007199254740991, 37 | startTheGame = endTheGame - 100, 38 | count = 0, 39 | result, 40 | index; 41 | 42 | for ( index = startTheGame; index <= endTheGame; index++ ) { 43 | count++; 44 | } 45 | 46 | result = count; 47 | ``` 48 | 49 | ```js 50 | assert(result === 101 && endTheGame == 9007199254740991); 51 | ``` 52 | 53 | --- 54 | 55 | --- 56 | Why? 57 | ```js 58 | 59 | ``` 60 | ```js 61 | 9007199254740992 is the maximum number that Javascript can handle then it is unable to manage due to the overflow issue, then the most easy way to do it is decrement the number in one to allow Javascript to work with it. 62 | ``` 63 | ```js 64 | __match_answer_and_solution__ 65 | ``` 66 | --- -------------------------------------------------------------------------------- /scope/README.md: -------------------------------------------------------------------------------- 1 | # Scope; 2 | ## Snippet 1 3 | ``` 4 | (function test() { test = 123; console.log( test );}()) 5 | ``` 6 | --- 7 | What it's logged when Snippet 1 is executed? 8 | 9 | ```js 10 | 11 | ``` 12 | ```js 13 | function test() { test = 123; console.log( test );}() 14 | ``` 15 | ```js 16 | __match_answer_and_solution__ 17 | ``` 18 | --- 19 | 20 | --- 21 | Why? 22 | 23 | ```js 24 | 25 | ``` 26 | ```js 27 | When the code tries to modify test value inside the function it doesn't works because the precedence of the declaration of the function that test reference remains unchanged, then the code that is executed is console.log logs the function body in the console. 28 | ``` 29 | ```js 30 | __match_answer_and_solution__ 31 | ``` 32 | --- -------------------------------------------------------------------------------- /spartacus/README.md: -------------------------------------------------------------------------------- 1 | # Spartacus 2 | I like the TV series Spartacus so much, that I have written the following code to get the name of the different seasons but something goes wrong... 3 | ``` 4 | var season = 'first'; 5 | 6 | var result = ('Spartacus: ' + season === 'first' ? 'Blood and Sand' : 'Gods of the Arena'); 7 | ``` 8 | I expected to get **Spartacus: Blood and Sand** but I got **Gods of the Arena**, could you help me? 9 | 10 | --- 11 | Fix the code to get 'Spartacus: Blood and Sand': 12 | 13 | ```js 14 | var season = 'first'; 15 | var result = ('Spartacus: ' + season === 'first' ? 'Blood and Sand' : 'Gods of the Arena'); 16 | ``` 17 | 18 | ```js 19 | var season = 'first'; 20 | var result = 'Spartacus: ' + (season === 'first' ? 'Blood and Sand' : 'Gods of the Arena'); 21 | ``` 22 | 23 | ```js 24 | assert(result === 'Spartacus: Blood and Sand'); 25 | ``` 26 | -------------------------------------------------------------------------------- /terminator/README.md: -------------------------------------------------------------------------------- 1 | # Terminator 2 | Here you have the prototype code of the next Terminator fan page: 3 | 4 | ``` 5 | 6 | 7 | 8 | Terminator Fan Page 9 | 10 | 11 |
12 | 13 | 14 |
15 | 16 | 17 | ``` 18 | One of my colleagues has written the next code that will log the name we send using the form in the previous page. 19 | ``` 20 | 27 | ``` 28 | But then someone sends the next message as a name and the behaviour of the page changes... 29 | ``` 30 | ' 47 | 48 | 49 | ``` 50 | 51 | --- 52 | Fix the code: 53 | ```js 54 | var result = ''; 55 | function sayonara( name ) { 56 | result = 'Sayonara ' + name + '!'; 57 | } 58 | 59 | sayonara( '