text:
jQuery(document).ready(function(){
    var scripts = document.getElementsByTagName("script");
    var jsFolder = "";
    for (var i= 0; i< scripts.length; i++)
    {
        if( scripts[i].src && scripts[i].src.match(/initslider-1\.js/i))
            jsFolder = scripts[i].src.substr(0, scripts[i].src.lastIndexOf("/") + 1);
    }
    jQuery("#amazingslider-1").amazingslider({
        sliderid:1,
        jsfolder:jsFolder,
        width:900,
        height:360,
        skinsfoldername:"",
        loadimageondemand:false,
        videohidecontrols:false,
        donotresize:false,
        enabletouchswipe:true,
        fullscreen:false,
        autoplayvideo:false,
        addmargin:true,
        transitiononfirstslide:false,
        forceflash:false,
        isresponsive:true,
        forceflashonie11:true,
        forceflashonie10:true,
        pauseonmouseover:false,
        playvideoonclickthumb:true,
        slideinterval:5000,
        fullwidth:false,
        randomplay:false,
        scalemode:"fill",
        loop:0,
        autoplay:true,
        navplayvideoimage:"play-32-32-0.png",
        navpreviewheight:60,
        timerheight:2,
        descriptioncssresponsive:"font-size:12px;",
        shownumbering:false,
        skin:"Cube",
        addgooglefonts:true,
        navshowplaypause:true,
        navshowplayvideo:true,
        navshowplaypausestandalonemarginx:8,
        navshowplaypausestandalonemarginy:8,
        navbuttonradius:0,
        navthumbnavigationarrowimageheight:32,
        navmarginy:16,
        lightboxshownavigation:false,
        showshadow:false,
        navfeaturedarrowimagewidth:16,
        navpreviewwidth:120,
        googlefonts:"Inder",
        navborderhighlightcolor:"",
        navcolor:"#999999",
        lightboxdescriptionbottomcss:"{color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;}",
        lightboxthumbwidth:80,
        navthumbnavigationarrowimagewidth:32,
        navthumbtitlehovercss:"text-decoration:underline;",
        navthumbmediumheight:64,
        texteffectresponsivesize:600,
        arrowwidth:36,
        texteffecteasing:"easeOutCubic",
        texteffect:"slide",
        lightboxthumbheight:60,
        navspacing:8,
        navarrowimage:"navarrows-28-28-0.png",
        bordercolor:"#ffffff",
        ribbonimage:"ribbon_topleft-0.png",
        navwidth:24,
        navheight:24,
        arrowimage:"arrows-36-80-0.png",
        timeropacity:0.6,
        arrowhideonmouseleave:1000,
        navthumbnavigationarrowimage:"carouselarrows-32-32-0.png",
        navshowplaypausestandalone:false,
        texteffect1:"slide",
        navpreviewbordercolor:"#ffffff",
        texteffect2:"slide",
        customcss:"",
        ribbonposition:"topleft",
        navthumbdescriptioncss:"display:block;position:relative;padding:2px 4px;text-align:left;font:normal 12px Arial,Helvetica,sans-serif;color:#333;",
        lightboxtitlebottomcss:"{color:#333; font-size:14px; font-family:Armata,sans-serif,Arial; overflow:hidden; text-align:left;}",
        arrowstyle:"always",
        navthumbmediumsize:800,
        navthumbtitleheight:20,
        textpositionmargintop:24,
        buttoncssresponsive:"",
        navswitchonmouseover:false,
        playvideoimage:"playvideo-64-64-0.png",
        arrowtop:50,
        textstyle:"dynamic",
        playvideoimageheight:64,
        navfonthighlightcolor:"#666666",
        showbackgroundimage:false,
        navpreviewborder:4,
        navopacity:0.8,
        navdirection:"horizontal",
        navbuttonshowbgimage:true,
        navbuttonbgimage:"navbuttonbgimage-28-28-0.png",
        textbgcss:"display:none;",
        textpositiondynamic:"bottomleft",
        playvideoimagewidth:64,
        buttoncss:"display:block; position:relative; margin-top:10px;",
        navborder:4,
        navshowpreviewontouch:false,
        bottomshadowimagewidth:110,
        showtimer:true,
        navradius:0,
        navmultirows:false,
        navshowpreview:true,
        navpreviewarrowheight:8,
        navmarginx:16,
        navfeaturedarrowimage:"featuredarrow-16-8-0.png",
        navthumbsmallsize:480,
        showribbon:false,
        navstyle:"bullets",
        textpositionmarginleft:24,
        descriptioncss:"display:block; position:relative; font:12px \"Lucida Sans Unicode\",\"Lucida Grande\",sans-serif,Arial; color:#fff;  background-color:#e04000; margin-top:10px; padding:10px; ",
        navplaypauseimage:"navplaypause-28-28-0.png",
        backgroundimagetop:-10,
        timercolor:"#ffffff",
        numberingformat:"%NUM/%TOTAL ",
        navthumbmediumwidth:64,
        navfontsize:12,
        navhighlightcolor:"#333333",
        texteffectdelay1:1000,
        navimage:"bullet-24-24-1.png",
        texteffectdelay2:1500,
        texteffectduration1:600,
        navshowplaypausestandaloneautohide:false,
        texteffectduration2:600,
        navbuttoncolor:"#999999",
        navshowarrow:true,
        texteffectslidedirection:"left",
        navshowfeaturedarrow:false,
        lightboxbarheight:64,
        titlecss:"display:table; position:relative; font:bold 14px \"Lucida Sans Unicode\",\"Lucida Grande\",sans-serif,Arial; color:#fff; white-space:nowrap; background-color:#f7a020; padding:10px;",
        ribbonimagey:0,
        ribbonimagex:0,
        navthumbsmallheight:48,
        texteffectslidedistance1:120,
        texteffectslidedistance2:120,
        navrowspacing:8,
        navshowplaypausestandaloneposition:"bottomright",
        shadowsize:5,
        lightboxthumbtopmargin:12,
        titlecssresponsive:"font-size:12px;",
        navshowplaypausestandalonewidth:28,
        navthumbresponsive:false,
        navfeaturedarrowimageheight:8,
        navshowplaypausestandaloneheight:28,
        textpositionmarginright:24,
        backgroundimagewidth:120,
        textautohide:true,
        navthumbtitlewidth:120,
        navpreviewposition:"top",
        texteffectseparate:true,
        arrowheight:80,
        shadowcolor:"#aaaaaa",
        arrowmargin:-18,
        texteffectduration:600,
        bottomshadowimage:"bottomshadow-110-95-0.png",
        border:0,
        lightboxshowdescription:false,
        timerposition:"bottom",
        navfontcolor:"#333333",
        navthumbnavigationstyle:"arrow",
        borderradius:0,
        navbuttonhighlightcolor:"#333333",
        textpositionstatic:"bottom",
        texteffecteasing2:"easeOutCubic",
        navthumbstyle:"imageonly",
        texteffecteasing1:"easeOutCubic",
        textcss:"display:block; padding:8px 16px; text-align:left;",
        navthumbsmallwidth:48,
        navbordercolor:"#ffffff",
        navpreviewarrowimage:"previewarrow-16-8-0.png",
        navthumbtitlecss:"display:block;position:relative;padding:2px 4px;text-align:left;font:bold 14px Arial,Helvetica,sans-serif;color:#333;",
        showbottomshadow:true,
        texteffectslidedistance:30,
        texteffectdelay:500,
        textpositionmarginstatic:0,
        backgroundimage:"",
        navposition:"bottom",
        texteffectslidedirection1:"right",
        navpreviewarrowwidth:16,
        textformat:"Color box",
        texteffectslidedirection2:"right",
        bottomshadowimagetop:95,
        texteffectresponsive:true,
        navshowbuttons:false,
        lightboxthumbbottommargin:8,
        textpositionmarginbottom:24,
        lightboxshowtitle:true,
        slice: {
            checked:true,
            effectdirection:0,
            effects:"up,down,updown",
            slicecount:10,
            duration:1500,
            easing:"easeOutCubic"
        },
        blocks: {
            columncount:5,
            checked:true,
            rowcount:5,
            effects:"topleft,bottomright,top,bottom,random",
            duration:1500,
            easing:"easeOutCubic"
        },
        slide: {
            duration:1000,
            easing:"easeOutCubic",
            checked:true,
            effectdirection:0
        },
        crossfade: {
            duration:1000,
            easing:"easeOutCubic",
            checked:true
        },
        blinds: {
            duration:2000,
            easing:"easeOutCubic",
            checked:true,
            effectdirection:0,
            slicecount:3
        },
        transition:"slice,blocks,slide,crossfade,blinds",
        scalemode:"fill",
        isfullscreen:false,
        textformat: {

        }
    });
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdventOfCode.Year2016
{
    public class Day14 : IAoC
    {
        internal static System.Security.Cryptography.MD5 Md5 = System.Security.Cryptography.MD5.Create();

        public string SolvePart1(string input)
        {
            var lines = input.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
            return Part1(lines).ToString();
        }

        public string SolvePart2(string input)
        {
            var lines = input.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
            return Part2(lines).ToString();
        }

        public string GetInput() => @"qzyelonm";

        public int Part1(string[] input, int keystretching = 0)
        {
            string salt = input[0].Trim();
            int currentIndex = 0;
            int keysFound = 0;
            string[] triplets = new string[1000];
            string[] quintets = new string[1000];
            string[] hashes = new string[1000];
            while (keysFound < 64 && currentIndex < 1e+6)
            {
                // search the current space (so n-1000)
                int indexModThousand = currentIndex % 1000;
                if (!string.IsNullOrEmpty(triplets[indexModThousand]))
                {
                    //bool keyFound = false;
                    char curChar = triplets[indexModThousand][0];
                    for (int j = 0; j < 1000; j++)
                    {
                        // skip yourself
                        if (j == indexModThousand) { continue; }

                        if (quintets[j].Contains(curChar))
                        {
                            //keyFound = true;
                            keysFound++;
                            //Debug.WriteLine($"Found key {keysFound} for index: {currentIndex - 1000}");
                            break;
                        }
                    }

                    if (keysFound == 64)
                    {
                        return currentIndex - 1000;
                    }
                }

                // overwrite with new entry (= n)
                string hash = BitConverter.ToString(
                    Md5.ComputeHash(
                        Encoding.UTF8.GetBytes(salt + currentIndex)
                        )
                     ).Replace("-", "").ToLowerInvariant();

                // part 2
                for (int keystretch = 0; keystretch < keystretching; keystretch++)
                {
                    hash = BitConverter.ToString(
                    Md5.ComputeHash(
                        Encoding.UTF8.GetBytes(hash)
                        )
                     ).Replace("-", "").ToLowerInvariant();
                }

                triplets[indexModThousand] = ConsecutiveChars(hash, 3);
                quintets[indexModThousand] = ConsecutiveChars(hash, 5);
                currentIndex++;
            }
            return currentIndex;
        }

        public int Part2(string[] input)
        {
            return Part1(input, 2016);
        }

        public string ConsecutiveChars(string input, int length)
        {
            HashSet<char> consecutivechars = new HashSet<char>();
            for (int i = length - 1; i < input.Length; i++)
            {
                char curChar = input[i];
                bool consecutive = true;
                for (int j = 1; j < length; j++)
                {
                    if (input[i - j] != curChar)
                    {
                        consecutive = false;
                        break;
                    }
                }
                if (consecutive) { consecutivechars.Add(curChar); }
            }
            return new string(consecutivechars.ToArray());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import * as React from 'react';
import * as TestUtils from 'react-addons-test-utils';
import { CoreLayout, CoreLayoutProps} from '../../src/layouts/CoreLayout/CoreLayout';

import * as chai from 'chai';
const expect = chai.expect;

function shallowRender(component: React.ReactElement<any>): React.ReactElement<any> {
    'use strict';

  const renderer = TestUtils.createRenderer();

  renderer.render(component);
  return renderer.getRenderOutput();
}

function shallowRenderWithProps(props: CoreLayoutProps): React.ReactElement<any> {
    'use strict';

  return shallowRender(<CoreLayout {...props} />);
}

xdescribe('(Layout) Core', () => {
  let _component;
  let _props;
  let _child;

  beforeEach(() => {
    _child =
Child
;
    _props = {
      children: _child
    };

    _component = shallowRenderWithProps(_props);
  });

  it('Should render as a
.', () => {
    expect(_component.type).to.equal('div');
  });
});


text:
title: For Loop
localeTitle: Para loop
---
## Para loop

O PHP `for` instrução consiste em três expressões e uma instrução:

`for ((initialization); (condition); (final-expression)) statement`

### Descrição

*   inicialização
    *   Corra antes da primeira execução no loop.
    *   Esta expressão é comumente usada para criar contadores.
    *   As variáveis criadas aqui estão no escopo do loop. Uma vez que o loop tenha terminado, a execução é destruída.
*   condição
    *   Expressão que é verificada antes da execução de cada iteração.
    *   Se omitido, esta expressão será avaliada como `true` .
*   expressão final
    *   Expressão executada após cada iteração.
    *   Geralmente usado para incrementar um contador.
    *   Mas pode ser usado para executar qualquer expressão.
*   declaração
    *   Código a ser repetido em cada iteração de loop.

Qualquer uma dessas três expressões ou a declaração pode ser omitida.

As expressões podem conter várias expressões separadas por vírgula.

Na expressão (condição), todas as expressões separadas por vírgulas serão avaliadas.

O resultado é obtido a partir do último.

For loops são comumente usados para contar um certo número de iterações para repetir uma instrução.

### Armadilhas Comuns

#### Ultrapassando os limites de um array

Ao indexar em um array muitas vezes é fácil exceder os limites do array (ex. Tentar referenciar o 4º elemento de um array de 3 elementos).

```php
// This will cause an error.
 // The bounds of the array will be exceeded.
 $arr = array(1,2,3);

 for ($i = 0; $i <= count($arr); $i++) {
    var_dump($arr[$i]);
 }
```

Isto irá produzir:

```txt
int(1) int(2) int(3) NULL
```

Existem maneiras de corrigir esse código.

Defina a condição como `$i < count($arr)` ou `$i <= count($arr) - 1` .

#### Problemas de desempenho

O código acima pode ficar lento, porque o tamanho da matriz é buscado em cada iteração.

Para corrigir esse problema, é possível colocar o tamanho da matriz em uma variável.

```php
//create the $size variable with a second expression comma separated
 for ($i = 0, $size = count($arr); $i < $size; ++$i) {
```

### Mais Informações

*   [PHP.net - Estruturas de Controle](https://secure.php.net/manual/en/control-structures.for.php)


text:
var fs = require("fs");
var config = require("./../../app/config");
var plugin = require("./../../app/plugin");

module.exports = function(req,res){
	switch (req.params[1]){
		case undefined:
			var plugins = plugin.getAll();
			res.render("setting",{
				root : config.get('root'),
				active: "setting",
				plugins : plugins
			});
			break;
		case "saveRoot":
			var root = req.query.rootDir;
			var result = config.setRoot(root);
			res.jsonp(result);
			break;
	}
}


text:
<?php
require_once CPAC_DIR . 'classes/third_party/acf.php';
require_once CPAC_DIR . 'classes/third_party/ninja_forms.php';
require_once CPAC_DIR . 'classes/third_party/woocommerce.php';
require_once CPAC_DIR . 'classes/third_party/wpml.php';


text:
package com.vmware.vim25;

/**
 * @author Steve Jin (http://www.doublecloud.org)
 * @version 5.1
 */

@SuppressWarnings("all")
public class DatastoreSummary extends DynamicData {
    public ManagedObjectReference datastore;
    public String name;
    public String url;
    public long capacity;
    public long freeSpace;
    public Long uncommitted;
    public boolean accessible;
    public Boolean multipleHostAccess;
    public String type;
    public String maintenanceMode;

    public ManagedObjectReference getDatastore() {
        return this.datastore;
    }

    public String getName() {
        return this.name;
    }

    public String getUrl() {
        return this.url;
    }

    public long getCapacity() {
        return this.capacity;
    }

    public long getFreeSpace() {
        return this.freeSpace;
    }

    public Long getUncommitted() {
        return this.uncommitted;
    }

    public boolean isAccessible() {
        return this.accessible;
    }

    public Boolean getMultipleHostAccess() {
        return this.multipleHostAccess;
    }

    public String getType() {
        return this.type;
    }

    public String getMaintenanceMode() {
        return this.maintenanceMode;
    }

    public void setDatastore(ManagedObjectReference datastore) {
        this.datastore = datastore;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setCapacity(long capacity) {
        this.capacity = capacity;
    }

    public void setFreeSpace(long freeSpace) {
        this.freeSpace = freeSpace;
    }

    public void setUncommitted(Long uncommitted) {
        this.uncommitted = uncommitted;
    }

    public void setAccessible(boolean accessible) {
        this.accessible = accessible;
    }

    public void setMultipleHostAccess(Boolean multipleHostAccess) {
        this.multipleHostAccess = multipleHostAccess;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setMaintenanceMode(String maintenanceMode) {
        this.maintenanceMode = maintenanceMode;
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _helperPluginUtils = require("@babel/helper-plugin-utils");

var _default = (0, _helperPluginUtils.declare)(api => {
  api.assertVersion(7);
  return {
    name: "syntax-async-generators",

    manipulateOptions(opts, parserOpts) {
      parserOpts.plugins.push("asyncGenerators");
    }

  };
});

exports.default = _default;


text:
namespace AngleSharp.Css.Parser
{
    using AngleSharp.Css.Dom;
    using AngleSharp.Css.Parser.Tokens;
    using AngleSharp.Dom;
    using AngleSharp.Text;
    using System;

    /// <summary>
    /// See http://dev.w3.org/csswg/css-syntax/#parsing for details.
    /// </summary>
    sealed class CssBuilder
    {
        #region Fields

        private readonly CssTokenizer _tokenizer;
        private readonly CssParserOptions _options;
        private readonly IBrowsingContext _context;

        #endregion

        #region ctor

        public CssBuilder(CssParserOptions options, CssTokenizer tokenizer, IBrowsingContext context)
        {
            _tokenizer = tokenizer;
            _options = options;
            _context = context;
        }

        #endregion

        #region Create Rules

        public ICssRule CreateRule(ICssStyleSheet sheet, CssToken token)
        {
            switch (token.Type)
            {
                case CssTokenType.AtKeyword:
                    return CreateAtRule(sheet, token);

                case CssTokenType.CurlyBracketOpen:
                    RaiseErrorOccurred(CssParseError.InvalidBlockStart, token.Position);
                    JumpToRuleEnd(ref token);
                    return null;

                case CssTokenType.String:
                case CssTokenType.Url:
                case CssTokenType.CurlyBracketClose:
                case CssTokenType.RoundBracketClose:
                case CssTokenType.SquareBracketClose:
                    RaiseErrorOccurred(CssParseError.InvalidToken, token.Position);
                    JumpToRuleEnd(ref token);
                    return null;

                default:
                    return CreateStyleRule(sheet, token);
            }
        }

        private ICssRule CreateStyleRule(ICssStyleSheet sheet, CssToken token)
        {
            var rule = new CssStyleRule(sheet);
            return CreateStyle(rule, token);
        }

        private ICssRule CreateAtRule(ICssStyleSheet sheet, CssToken token)
        {
            if (token.Data.Is(RuleNames.Media))
            {
                var rule = new CssMediaRule(sheet);
                return CreateMedia(rule, token);
            }
            else if (token.Data.Is(RuleNames.FontFace))
            {
                var rule = new CssFontFaceRule(sheet);
                return CreateFontFace(rule, token);
            }
            else if (token.Data.Is(RuleNames.Keyframes))
            {
                var rule = new CssKeyframesRule(sheet);
                return CreateKeyframes(rule, token);
            }
            else if (token.Data.Is(RuleNames.Import))
            {
                var rule = new CssImportRule(sheet);
                return CreateImport(rule, token);
            }
            else if (token.Data.Is(RuleNames.Charset))
            {
                var rule = new CssCharsetRule(sheet);
                return CreateCharset(rule, token);
            }
            else if (token.Data.Is(RuleNames.Namespace))
            {
                var rule = new CssNamespaceRule(sheet);
                return CreateNamespace(rule, token);
            }
            else if (token.Data.Is(RuleNames.Page))
            {
                var rule = new CssPageRule(sheet);
                return CreatePage(rule, token);
            }
            else if (token.Data.Is(RuleNames.Supports))
            {
                var rule = new CssSupportsRule(sheet);
                return CreateSupports(rule, token);
            }
            else if (token.Data.Is(RuleNames.ViewPort))
            {
                var rule = new CssViewportRule(sheet);
                return CreateViewport(rule, token);
            }
            else if (token.Data.Is(RuleNames.Document))
            {
                var rule = new CssDocumentRule(sheet);
                return CreateDocument(rule, token);
            }
            else if (token.Data.Is(RuleNames.CounterStyle))
            {
                var rule = new CssCounterStyleRule(sheet);
                return CreateCounterStyle(rule, token);
            }
            else if (token.Data.Is(RuleNames.FontFeatureValues))
            {
                var rule = new CssFontFeatureValuesRule(sheet);
                return CreateFontFeatureValues(rule, token);
            }
            else if (_options.IsIncludingUnknownRules)
            {
                return CreateUnknownAtRule(sheet, token);
            }

            RaiseErrorOccurred(CssParseError.UnknownAtRule, token.Position);
            JumpToRuleEnd(ref token);
            return null;
        }

        private CssCharsetRule CreateCharset(CssCharsetRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            if (token.Type == CssTokenType.String)
            {
                rule.CharacterSet = token.Data;
            }

            JumpToEnd(ref token);
            return rule;
        }

        private CssDocumentRule CreateDocument(CssDocumentRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);
            var functions = GetArgument(ref token);
            var result = rule.SetConditionText(functions, throwOnError: false);
            CollectTrivia(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(token);
            }
            else if (FillRules(rule) && result)
            {
                return rule;
            }

            return null;
        }

        private CssViewportRule CreateViewport(CssViewportRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(token);
                return null;
            }

            FillDeclarations(rule);
            return rule;
        }

        private CssFontFaceRule CreateFontFace(CssFontFaceRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(token);
                return null;
            }

            FillDeclarations(rule);
            return rule;
        }

        private CssImportRule CreateImport(CssImportRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            if (token.Is(CssTokenType.String, CssTokenType.Url))
            {
                rule.Href = token.Data;
                token = NextToken();
                CollectTrivia(ref token);
                var media = GetArgument(ref token);

                if (!String.IsNullOrEmpty(media))
                {
                    rule.Media.SetMediaText(media, throwOnError: false);
                }
            }

            CollectTrivia(ref token);
            JumpToEnd(ref token);
            return rule;
        }

        private CssKeyframesRule CreateKeyframes(CssKeyframesRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);
            rule.Name = GetRuleName(ref token);
            CollectTrivia(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(token);
                return null;
            }

            FillKeyframeRules(rule);
            return rule;
        }

        private CssMediaRule CreateMedia(CssMediaRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);
            var media = GetArgument(ref token);
            rule.Media.SetMediaText(media, throwOnError: false);
            CollectTrivia(ref token);

            while (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketOpen))
            {
                if (token.Type == CssTokenType.Semicolon)
                {
                    return null;
                }

                token = NextToken();
            }

            FillRules(rule);
            return rule;
        }

        private CssNamespaceRule CreateNamespace(CssNamespaceRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);
            rule.Prefix = GetRuleName(ref token);
            CollectTrivia(ref token);

            if (token.Type == CssTokenType.Url)
            {
                rule.NamespaceUri = token.Data;
            }

            JumpToEnd(ref token);
            return rule;
        }

        private CssPageRule CreatePage(CssPageRule rule, CssToken current)
        {
            current = NextToken();
            var selectorText = GetArgument(ref current);

            rule.SelectorText = selectorText;

            if (rule.Selector is null && _options.IsToleratingInvalidSelectors)
            {
                rule.SetInvalidSelector(selectorText);
            }

            CollectTrivia(ref current);

            if (current.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(current);
                return null;
            }

            FillDeclarations(rule.Style, NextToken());
            return rule;
        }

        private CssSupportsRule CreateSupports(CssSupportsRule rule, CssToken current)
        {
            var token = NextToken();
            CollectTrivia(ref token);
            var conditions = GetArgument(ref token);
            var result = rule.SetConditionText(conditions, throwOnError: false);
            CollectTrivia(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(token);
            }
            else if (FillRules(rule) && result)
            {
                return rule;
            }

            return null;
        }

        private CssFontFeatureValuesRule CreateFontFeatureValues(CssFontFeatureValuesRule rule, CssToken current)
        {
            CollectTrivia(ref current);
            //rule.FamilyName =
            return null;
        }

        private CssCounterStyleRule CreateCounterStyle(CssCounterStyleRule rule, CssToken current)
        {
            CollectTrivia(ref current);
            return null;
        }

        public CssStyleRule CreateStyle(CssStyleRule rule, CssToken current)
        {
            CollectTrivia(ref current);
            var selectorText = GetArgument(ref current);

            rule.SelectorText = selectorText;

            if (rule.Selector is null && _options.IsToleratingInvalidSelectors)
            {
                rule.SetInvalidSelector(selectorText);
            }

            if (current.Type != CssTokenType.CurlyBracketOpen)
            {
                SkipDeclarations(current);
                return null;
            }

            FillDeclarations(rule.Style, NextToken());
            return rule;
        }

        public CssKeyframeRule CreateKeyframeRule(CssKeyframeRule rule, CssToken current)
        {
            CollectTrivia(ref current);
            rule.KeyText = GetArgument(ref current);
            FillDeclarations(rule.Style, NextToken());
            return rule;
        }

        private CssKeyframesRule FillKeyframeRules(CssKeyframesRule parentRule)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            while (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketClose))
            {
                var rule = new CssKeyframeRule(parentRule.Owner);
                CreateKeyframeRule(rule, token);
                token = NextToken();
                CollectTrivia(ref token);
                parentRule.Add(rule);
            }

            return parentRule;
        }

        private CssDeclarationRule FillDeclarations(CssDeclarationRule rule)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            while (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketClose))
            {
                CreateDeclarationWith(rule, ref token);
                CollectTrivia(ref token);
            }

            return rule;
        }

        private CssUnknownRule CreateUnknownAtRule(ICssStyleSheet sheet, CssToken current)
        {
            var token = NextToken();

            while (token.IsNot(CssTokenType.CurlyBracketOpen, CssTokenType.Semicolon, CssTokenType.EndOfFile))
            {
                token = NextToken();
            }

            if (token.Type == CssTokenType.CurlyBracketOpen)
            {
                var curly = 1;

                do
                {
                    token = NextToken();

                    switch (token.Type)
                    {
                        case CssTokenType.CurlyBracketOpen:
                            curly++;
                            break;
                        case CssTokenType.CurlyBracketClose:
                            curly--;
                            break;
                        case CssTokenType.EndOfFile:
                            curly = 0;
                            break;
                    }
                }
                while (curly != 0);
            }

            var range = new TextRange(current.Position, token.Position);
            return new CssUnknownRule(sheet, current.Data, new TextView(sheet.Source, range));
        }

        private Boolean FillRules(CssGroupingRule group)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            while (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketClose))
            {
                var rule = CreateRule(group.Owner, token);
                token = NextToken();
                CollectTrivia(ref token);

                if (rule != null)
                {
                    group.Add(rule);
                }
            }

            return token.Type == CssTokenType.CurlyBracketClose;
        }

        #endregion

        #region API

        /// <summary>
        /// Creates as many rules as possible.
        /// </summary>
        /// <returns>The found rules.</returns>
        public TextPosition CreateRules(CssStyleSheet sheet)
        {
            var token = NextToken();
            CollectTrivia(ref token);

            while (token.Type != CssTokenType.EndOfFile)
            {
                var rule = CreateRule(sheet, token);
                token = NextToken();
                CollectTrivia(ref token);

                if (rule != null)
                {
                    sheet.Add(rule);
                }
            }

            return token.Position;
        }

        /// <summary>
        /// Fills the given parent style with declarations given by the tokens.
        /// </summary>
        public CssStyleDeclaration FillDeclarations(CssStyleDeclaration style, CssToken token)
        {
            CollectTrivia(ref token);

            while (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketClose))
            {
                CreateDeclarationWith(style, ref token);
                CollectTrivia(ref token);
            }

            return style;
        }

        /// <summary>
        /// Called before the property name has been detected.
        /// </summary>
        public void CreateDeclarationWith(ICssProperties properties, ref CssToken token)
        {
            CollectTrivia(ref token);
            var start = token.Position;

            if (token.IsNot(CssTokenType.EndOfFile, CssTokenType.CurlyBracketClose, CssTokenType.Colon) &&
                token.IsNot(CssTokenType.Semicolon, CssTokenType.CurlyBracketOpen))
            {
                var name = token.Data;

                while (token.Type == CssTokenType.Delim)
                {
                    token = NextToken();
                    name += token.Data;
                }

                token = NextToken();
                CollectTrivia(ref token);

                if (token.Type == CssTokenType.Colon)
                {
                    token = NextToken();
                    CollectTrivia(ref token);
                    var value = CreateValue(ref token, out var important);

                    if (String.IsNullOrEmpty(value))
                    {
                        RaiseErrorOccurred(CssParseError.ValueMissing, token.Position);
                    }
                    else
                    {
                        properties.SetProperty(name, value, important ? CssKeywords.Important : null);
                    }
                }
                else
                {
                    RaiseErrorOccurred(CssParseError.ColonMissing, token.Position);
                }

                JumpToDeclEnd(ref token);
            }
            else if (token.Type != CssTokenType.EndOfFile)
            {
                RaiseErrorOccurred(CssParseError.IdentExpected, start);
                JumpToDeclEnd(ref token);
            }

            if (token.Type == CssTokenType.Semicolon)
            {
                token = NextToken();
            }
        }

        #endregion

        #region Helpers

        private void JumpToEnd(ref CssToken current)
        {
            while (current.IsNot(CssTokenType.EndOfFile, CssTokenType.Semicolon))
            {
                current = NextToken();
            }
        }

        private void JumpToRuleEnd(ref CssToken current)
        {
            var scopes = 0;

            while (current.Type != CssTokenType.EndOfFile)
            {
                if (current.Type == CssTokenType.CurlyBracketOpen)
                {
                    scopes++;
                }
                else if (current.Type == CssTokenType.CurlyBracketClose)
                {
                    scopes--;
                }

                if (scopes <= 0 && (current.Is(CssTokenType.CurlyBracketClose, CssTokenType.Semicolon)))
                {
                    break;
                }

                current = NextToken();
            }
        }

        private void JumpToArgEnd(ref CssToken current)
        {
            var arguments = 0;

            while (current.Type != CssTokenType.EndOfFile)
            {
                if (current.Type == CssTokenType.RoundBracketOpen)
                {
                    arguments++;
                }
                else if (arguments <= 0 && current.Type == CssTokenType.RoundBracketClose)
                {
                    break;
                }
                else if (current.Type == CssTokenType.RoundBracketClose)
                {
                    arguments--;
                }

                current = NextToken();
            }
        }

        private void JumpToDeclEnd(ref CssToken current)
        {
            var scopes = 0;

            while (current.Type != CssTokenType.EndOfFile)
            {
                if (current.Type == CssTokenType.CurlyBracketOpen)
                {
                    scopes++;
                }
                else if (scopes <= 0 && (current.Is(CssTokenType.CurlyBracketClose, CssTokenType.Semicolon)))
                {
                    break;
                }
                else if (current.Type == CssTokenType.CurlyBracketClose)
                {
                    scopes--;
                }

                current = NextToken();
            }
        }

        private CssToken NextToken() => _tokenizer.Get();

        private void CollectTrivia(ref CssToken token)
        {
            var storeComments = false;

            while (token.Type == CssTokenType.Whitespace || token.Type == CssTokenType.Comment || token.Type == CssTokenType.Cdc || token.Type == CssTokenType.Cdo)
            {
                if (storeComments && token.Type == CssTokenType.Comment)
                {
                    var comment = new CssComment(token.Data);
                    //TODO What should be done with the comment?
                }

                token = _tokenizer.Get();
            }
        }

        private void SkipDeclarations(CssToken token)
        {
            RaiseErrorOccurred(CssParseError.InvalidToken, token.Position);
            JumpToRuleEnd(ref token);
        }

        private void RaiseErrorOccurred(CssParseError code, TextPosition position) =>
            _tokenizer.RaiseErrorOccurred(code, position);

        #endregion

        #region Fill Inner

        private String CreateValue(ref CssToken token, out Boolean important)
        {
            var keyword = CssKeywords.BangImportant;
            var value = _tokenizer.ContentFrom(token.Position.Position);
            important = value.EndsWith(keyword, StringComparison.OrdinalIgnoreCase);
            token = NextToken();
            return important ? value.Substring(0, value.Length - keyword.Length).Trim() : value;
        }

        private String GetArgument(ref CssToken token)
        {
            var argument = _tokenizer.ContentFrom(token.Position.Position);
            token = NextToken();
            return argument;
        }

        private String GetRuleName(ref CssToken token)
        {
            var name = String.Empty;

            if (token.Type == CssTokenType.Ident)
            {
                name = token.Data;
                token = NextToken();
            }

            return name;
        }

        #endregion
    }
}


text:
cryptonit
=========

API wrapper for https://cryptonit.net exchange


text:
use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;

#[test]
fn vpmovm2d_1() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(XMM4)), operand2: Some(Direct(K5)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 242, 126, 8, 56, 229], OperandSize::Dword)
}

#[test]
fn vpmovm2d_2() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(XMM18)), operand2: Some(Direct(K4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 226, 126, 8, 56, 212], OperandSize::Qword)
}

#[test]
fn vpmovm2d_3() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(YMM6)), operand2: Some(Direct(K3)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 242, 126, 40, 56, 243], OperandSize::Dword)
}

#[test]
fn vpmovm2d_4() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(YMM31)), operand2: Some(Direct(K1)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 98, 126, 40, 56, 249], OperandSize::Qword)
}

#[test]
fn vpmovm2d_5() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(ZMM5)), operand2: Some(Direct(K6)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 242, 126, 72, 56, 238], OperandSize::Dword)
}

#[test]
fn vpmovm2d_6() {
    run_test(&Instruction { mnemonic: Mnemonic::VPMOVM2D, operand1: Some(Direct(ZMM20)), operand2: Some(Direct(K2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 226, 126, 72, 56, 226], OperandSize::Qword)
}


text:
caption {
  caption-side: top;
}

caption .button-add {
  display: inline-block;
  float: right;
}

caption .header-count {
  display: inline-block;
}