text:
(function () {
    var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}

// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
    var register_3795 = function (id) {
        var module = dem(id);
        var fragments = id.split('.');
        var target = Function('return this;')();
        for (var i = 0; i < fragments.length - 1; ++i) {
            if (target[fragments[i]] === undefined) { target[fragments[i]] = {}; }
            target = target[fragments[i]];
        }
        target[fragments[fragments.length - 1]] = module;
    };

    var instantiate = function (id) {
        var actual = defs[id];
        var dependencies = actual.deps;
        var definition = actual.defn;
        var len = dependencies.length;
        var instances = new Array(len);
        for (var i = 0; i < len; ++i) { instances[i] = dem(dependencies[i]); }
        var defResult = definition.apply(null, instances);
        if (defResult === undefined) { throw 'module [' + id + '] returned undefined'; }
        actual.instance = defResult;
    };

    var def = function (id, dependencies, definition) {
        if (typeof id !== 'string') { throw 'module id must be a string'; } else if (dependencies === undefined) { throw 'no dependencies for ' + id; } else if (definition === undefined) { throw 'no definition function for ' + id; }
        defs[id] = {
            deps: dependencies,
            defn: definition,
            instance: undefined
        };
    };

    var dem = function (id) {
        var actual = defs[id];
        if (actual === undefined) { throw 'module [' + id + '] was undefined'; } else if (actual.instance === undefined) { instantiate(id); }
        return actual.instance;
    };

    var req = function (ids, callback) {
        var len = ids.length;
        var instances = new Array(len);
        for (var i = 0; i < len; ++i) { instances[i] = dem(ids[i]); }
        callback.apply(null, instances);
    };

    var ephox = {};

    ephox.bolt = {
        module: {
            api: {
                define: def,
                require: req,
                demand: dem
            }
        }
    };

    var define = def;
    var require = req;
    var demand = dem;
// this helps with minification when using a lot of global references
    var defineGlobal = function (id, ref) {
        define(id, [], function () { return ref; });
    };
/* jsc
["tinymce.plugins.textpattern.Plugin","ephox.katamari.api.Cell","tinymce.core.PluginManager","tinymce.plugins.textpattern.api.Api","tinymce.plugins.textpattern.api.Settings","tinymce.plugins.textpattern.core.Keyboard","global!tinymce.util.Tools.resolve","tinymce.core.util.Delay","tinymce.core.util.VK","tinymce.plugins.textpattern.core.KeyHandler","tinymce.plugins.textpattern.core.Formatter","global!document","tinymce.core.dom.TreeWalker","tinymce.core.util.Tools","tinymce.plugins.textpattern.core.Patterns"]
jsc */
    define(
  'ephox.katamari.api.Cell',

        [
        ],

  function () {
      var Cell = function (initial) {
          var value = initial;

          var get = function () {
              return value;
          };

          var set = function (v) {
              value = v;
          };

          var clone = function () {
              return Cell(get());
          };

          return {
              get: get,
              set: set,
              clone: clone
          };
      };

      return Cell;
  }
);

    defineGlobal('global!tinymce.util.Tools.resolve', tinymce.util.Tools.resolve);
/**
 * ResolveGlobal.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.core.PluginManager',
        [
            'global!tinymce.util.Tools.resolve'
        ],
  function (resolve) {
      return resolve('tinymce.PluginManager');
  }
);

/**
 * Api.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.api.Api',
        [
        ],
  function () {
      var get = function (patternsState) {
          var setPatterns = function (newPatterns) {
              patternsState.set(newPatterns);
          };

          var getPatterns = function () {
              return patternsState.get();
          };

          return {
              setPatterns: setPatterns,
              getPatterns: getPatterns
          };
      };

      return {
          get: get
      };
  }
);
/**
 * Settings.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.api.Settings',
        [
        ],
  function () {
      var defaultPatterns = [
      { start: '*', end: '*', format: 'italic' },
      { start: '**', end: '**', format: 'bold' },
      { start: '***', end: '***', format: ['bold', 'italic'] },
      { start: '#', format: 'h1' },
      { start: '##', format: 'h2' },
      { start: '###', format: 'h3' },
      { start: '####', format: 'h4' },
      { start: '#####', format: 'h5' },
      { start: '######', format: 'h6' },
      { start: '1. ', cmd: 'InsertOrderedList' },
      { start: '* ', cmd: 'InsertUnorderedList' },
      { start: '- ', cmd: 'InsertUnorderedList' }
      ];

      var getPatterns = function (editorSettings) {
          return editorSettings.textpattern_patterns !== undefined
        ? editorSettings.textpattern_patterns
        : defaultPatterns;
      };

      return {
          getPatterns: getPatterns
      };
  }
);

/**
 * ResolveGlobal.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.core.util.Delay',
        [
            'global!tinymce.util.Tools.resolve'
        ],
  function (resolve) {
      return resolve('tinymce.util.Delay');
  }
);

/**
 * ResolveGlobal.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.core.util.VK',
        [
            'global!tinymce.util.Tools.resolve'
        ],
  function (resolve) {
      return resolve('tinymce.util.VK');
  }
);

    defineGlobal('global!document', document);
/**
 * ResolveGlobal.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.core.dom.TreeWalker',
        [
            'global!tinymce.util.Tools.resolve'
        ],
  function (resolve) {
      return resolve('tinymce.dom.TreeWalker');
  }
);

/**
 * ResolveGlobal.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.core.util.Tools',
        [
            'global!tinymce.util.Tools.resolve'
        ],
  function (resolve) {
      return resolve('tinymce.util.Tools');
  }
);

/**
 * Patterns.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.core.Patterns',
        [
        ],
  function () {
    // Returns a sorted patterns list, ordered descending by start length
      var sortPatterns = function (patterns) {
          return patterns.sort(function (a, b) {
              if (a.start.length > b.start.length) {
                  return -1;
              }

              if (a.start.length < b.start.length) {
                  return 1;
              }

              return 0;
          });
      };

    // Finds a matching pattern to the specified text
      var findPattern = function (patterns, text) {
          for (var i = 0; i < patterns.length; i++) {
              if (text.indexOf(patterns[i].start) !== 0) {
                  continue;
              }

              if (patterns[i].end && text.lastIndexOf(patterns[i].end) !== (text.length - patterns[i].end.length)) {
                  continue;
              }

              return patterns[i];
          }
      };

      var isMatchingPattern = function (pattern, text, offset, delta) {
          var textEnd = text.substr(offset - pattern.end.length - delta, pattern.end.length);
          return textEnd === pattern.end;
      };

      var hasContent = function (offset, delta, pattern) {
          return (offset - delta - pattern.end.length - pattern.start.length) > 0;
      };

    // Finds the best matching end pattern
      var findEndPattern = function (patterns, text, offset, delta) {
          var pattern, i;
          var sortedPatterns = sortPatterns(patterns);

      // Find best matching end
          for (i = 0; i < sortedPatterns.length; i++) {
              pattern = sortedPatterns[i];
              if (pattern.end !== undefined && isMatchingPattern(pattern, text, offset, delta) && hasContent(offset, delta, pattern)) {
                  return pattern;
              }
          }
      };

      return {
          findPattern: findPattern,
          findEndPattern: findEndPattern
      };
  }
);

/**
 * Formatter.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.core.Formatter',
        [
            'global!document',
            'tinymce.core.dom.TreeWalker',
            'tinymce.core.util.Tools',
            'tinymce.plugins.textpattern.core.Patterns'
        ],
  function (document, TreeWalker, Tools, Patterns) {
      var splitContainer = function (container, pattern, endOffset, startOffset, space) {
      // Split text node and remove start/end from text node
          container = startOffset > 0 ? container.splitText(startOffset) : container;
          container.splitText(endOffset - startOffset + pattern.end.length);
          container.deleteData(0, pattern.start.length);
          container.deleteData(container.data.length - pattern.end.length, pattern.end.length);

          return container;
      };

      var patternFromRng = function (patterns, rng, space) {
          if (rng.collapsed === false) {
              return;
          }

          var container = rng.startContainer;
          var text = container.data;
          var delta = space === true ? 1 : 0;

          if (container.nodeType !== 3) {
              return;
          }

      // Find best matching end
          var endPattern = Patterns.findEndPattern(patterns, text, rng.startOffset, delta);
          if (endPattern === undefined) {
              return;
          }

      // Find start of matched pattern
          var endOffset = text.lastIndexOf(endPattern.end, rng.startOffset - delta);
          var startOffset = text.lastIndexOf(endPattern.start, endOffset - endPattern.end.length);
          endOffset = text.indexOf(endPattern.end, startOffset + endPattern.start.length);

          if (startOffset === -1) {
              return;
          }

      // Setup a range for the matching word
          var patternRng = document.createRange();
          patternRng.setStart(container, startOffset);
          patternRng.setEnd(container, endOffset + endPattern.end.length);

          var startPattern = Patterns.findPattern(patterns, patternRng.toString());

          if (endPattern === undefined || startPattern !== endPattern || (container.data.length <= endPattern.start.length + endPattern.end.length)) {
              return;
          }

          return {
              pattern: endPattern,
              startOffset: startOffset,
              endOffset: endOffset
          };
      };

      var splitAndApply = function (editor, container, found, space) {
          var formatArray = Tools.isArray(found.pattern.format) ? found.pattern.format : [found.pattern.format];
          var validFormats = Tools.grep(formatArray, function (formatName) {
              var format = editor.formatter.get(formatName);
              return format && format[0].inline;
          });

          if (validFormats.length !== 0) {
              editor.undoManager.transact(function () {
                  container = splitContainer(container, found.pattern, found.endOffset, found.startOffset, space);
                  formatArray.forEach(function (format) {
                      editor.formatter.apply(format, {}, container);
                  });
              });

              return container;
          }
      };

    // Handles inline formats like *abc* and **abc**
      var doApplyInlineFormat = function (editor, patterns, space) {
          var rng = editor.selection.getRng(true);
          var foundPattern = patternFromRng(patterns, rng, space);

          if (foundPattern) {
              return splitAndApply(editor, rng.startContainer, foundPattern, space);
          }
      };

      var applyInlineFormatSpace = function (editor, patterns) {
          return doApplyInlineFormat(editor, patterns, true);
      };
      var applyInlineFormatEnter = function (editor, patterns) {
          return doApplyInlineFormat(editor, patterns, false);
      };

    // Handles block formats like ##abc or 1. abc
      var applyBlockFormat = function (editor, patterns) {
          var selection, dom, container, firstTextNode, node, format, textBlockElm, pattern, walker, rng, offset;

          selection = editor.selection;
          dom = editor.dom;

          if (!selection.isCollapsed()) {
              return;
          }

          textBlockElm = dom.getParent(selection.getStart(), 'p');
          if (textBlockElm) {
              walker = new TreeWalker(textBlockElm, textBlockElm);
              while ((node = walker.next())) {
                  if (node.nodeType === 3) {
                      firstTextNode = node;
                      break;
                  }
              }

              if (firstTextNode) {
                  pattern = Patterns.findPattern(patterns, firstTextNode.data);
                  if (!pattern) {
                      return;
                  }

                  rng = selection.getRng(true);
                  container = rng.startContainer;
                  offset = rng.startOffset;

                  if (firstTextNode === container) {
                      offset = Math.max(0, offset - pattern.start.length);
                  }

                  if (Tools.trim(firstTextNode.data).length === pattern.start.length) {
                      return;
                  }

                  if (pattern.format) {
                      format = editor.formatter.get(pattern.format);
                      if (format && format[0].block) {
                          firstTextNode.deleteData(0, pattern.start.length);
                          editor.formatter.apply(pattern.format, {}, firstTextNode);

                          rng.setStart(container, offset);
                          rng.collapse(true);
                          selection.setRng(rng);
                      }
                  }

                  if (pattern.cmd) {
                      editor.undoManager.transact(function () {
                          firstTextNode.deleteData(0, pattern.start.length);
                          editor.execCommand(pattern.cmd);
                      });
                  }
              }
          }
      };

      return {
          patternFromRng: patternFromRng,
          applyInlineFormatSpace: applyInlineFormatSpace,
          applyInlineFormatEnter: applyInlineFormatEnter,
          applyBlockFormat: applyBlockFormat
      };
  }
);

/**
 * KeyHandler.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.core.KeyHandler',
        [
            'tinymce.core.util.VK',
            'tinymce.plugins.textpattern.core.Formatter'
        ],
  function (VK, Formatter) {
      function handleEnter (editor, patterns) {
          var wrappedTextNode, rng;

          wrappedTextNode = Formatter.applyInlineFormatEnter(editor, patterns);
          if (wrappedTextNode) {
              rng = editor.dom.createRng();
              rng.setStart(wrappedTextNode, wrappedTextNode.data.length);
              rng.setEnd(wrappedTextNode, wrappedTextNode.data.length);
              editor.selection.setRng(rng);
          }

          Formatter.applyBlockFormat(editor, patterns);
      }

      function handleInlineKey (editor, patterns) {
          var wrappedTextNode, lastChar, lastCharNode, rng, dom;

          wrappedTextNode = Formatter.applyInlineFormatSpace(editor, patterns);
          if (wrappedTextNode) {
              dom = editor.dom;
              lastChar = wrappedTextNode.data.slice(-1);

        // Move space after the newly formatted node
              if (/[\u00a0 ]/.test(lastChar)) {
                  wrappedTextNode.deleteData(wrappedTextNode.data.length - 1, 1);
                  lastCharNode = dom.doc.createTextNode(lastChar);

                  dom.insertAfter(lastCharNode, wrappedTextNode.parentNode);

                  rng = dom.createRng();
                  rng.setStart(lastCharNode, 1);
                  rng.setEnd(lastCharNode, 1);
                  editor.selection.setRng(rng);
              }
          }
      }

      var checkKeyEvent = function (codes, event, predicate) {
          for (var i = 0; i < codes.length; i++) {
              if (predicate(codes[i], event)) {
                  return true;
              }
          }
      };

      var checkKeyCode = function (codes, event) {
          return checkKeyEvent(codes, event, function (code, event) {
              return code === event.keyCode && VK.modifierPressed(event) === false;
          });
      };

      var checkCharCode = function (chars, event) {
          return checkKeyEvent(chars, event, function (chr, event) {
              return chr.charCodeAt(0) === event.charCode;
          });
      };

      return {
          handleEnter: handleEnter,
          handleInlineKey: handleInlineKey,
          checkCharCode: checkCharCode,
          checkKeyCode: checkKeyCode
      };
  }
);

/**
 * Keyboard.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.core.Keyboard',
        [
            'tinymce.core.util.Delay',
            'tinymce.core.util.VK',
            'tinymce.plugins.textpattern.core.KeyHandler'
        ],
  function (Delay, VK, KeyHandler) {
      var setup = function (editor, patternsState) {
          var charCodes = [',', '.', ';', ':', '!', '?'];
          var keyCodes = [32];

          editor.on('keydown', function (e) {
              if (e.keyCode === 13 && !VK.modifierPressed(e)) {
                  KeyHandler.handleEnter(editor, patternsState.get());
              }
          }, true);

          editor.on('keyup', function (e) {
              if (KeyHandler.checkKeyCode(keyCodes, e)) {
                  KeyHandler.handleInlineKey(editor, patternsState.get());
              }
          });

          editor.on('keypress', function (e) {
              if (KeyHandler.checkCharCode(charCodes, e)) {
                  Delay.setEditorTimeout(editor, function () {
                      KeyHandler.handleInlineKey(editor, patternsState.get());
                  });
              }
          });
      };

      return {
          setup: setup
      };
  }
);
/**
 * Plugin.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

    define(
  'tinymce.plugins.textpattern.Plugin',
        [
            'ephox.katamari.api.Cell',
            'tinymce.core.PluginManager',
            'tinymce.plugins.textpattern.api.Api',
            'tinymce.plugins.textpattern.api.Settings',
            'tinymce.plugins.textpattern.core.Keyboard'
        ],
  function (Cell, PluginManager, Api, Settings, Keyboard) {
      PluginManager.add('textpattern', function (editor) {
          var patternsState = Cell(Settings.getPatterns(editor.settings));

          Keyboard.setup(editor, patternsState);

          return Api.get(patternsState);
      });

      return function () { };
  }
);
    dem('tinymce.plugins.textpattern.Plugin')();
})();


text:
package com.ezcloud.framework.common;

import java.beans.PropertyEditorSupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.time.DateUtils;

/**
 * 日期类型转换
 */
public class DateEditor extends PropertyEditorSupport {

	/** 默认日期格式 */
	private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

	/** 是否将空转换为null */
	private boolean emptyAsNull;

	/** 日期格式 */
	private String dateFormat = DEFAULT_DATE_FORMAT;

	/**
	 * @param emptyAsNull
	 *            是否将空转换为null
	 */
	public DateEditor(boolean emptyAsNull) {
		this.emptyAsNull = emptyAsNull;
	}

	/**
	 * @param emptyAsNull
	 *            是否将空转换为null
	 * @param dateFormat
	 *            日期格式
	 */
	public DateEditor(boolean emptyAsNull, String dateFormat) {
		this.emptyAsNull = emptyAsNull;
		this.dateFormat = dateFormat;
	}

	/**
	 * 获取日期
	 *
	 * @return 日期
	 */
	@Override
	public String getAsText() {
		Date value = (Date) getValue();
		return value != null ? new SimpleDateFormat(dateFormat).format(value) : "";
	}

	/**
	 * 设置日期
	 *
	 * @param text
	 *            字符串
	 */
	@Override
	public void setAsText(String text) {
		if (text == null) {
			setValue(null);
		} else {
			String value = text.trim();
			if (emptyAsNull && "".equals(value)) {
				setValue(null);
			} else {
				try {
					setValue(DateUtils.parseDate(value, CommonAttributes.DATE_PATTERNS));
				} catch (ParseException e) {
					setValue(null);
				}
			}
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
template <class T>
void Convert(const T& x,AnyCollection& c) { c = x; }
///Default conversion from collection
template <class T>
bool Convert(const AnyCollection& c,T& x) { return c.as<T>(x); }

///Default conversion from array to collection
template <class T>
void Convert(const std::vector<T>& v,AnyCollection& c)
{
  c.resize(v.size());
  for(size_t i=0;i<v.size();i++)
    Convert(v[i],c[(int)i]);
}

///Default conversion from collection to array
template <class T>
bool Convert(const AnyCollection& c,std::vector<T>& v)
{
  v.resize(c.size());
  for(size_t i=0;i<v.size();i++)
    if(!Convert(c[(int)i],v[i])) return false;
  return true;
}

void Convert(const Vector3& x,AnyCollection& c);
void Convert(const Vector& x,AnyCollection& c);
void Convert(const IKGoal& g,AnyCollection& c);
void Convert(const Hold& h,AnyCollection& c);
void Convert(const Grasp& g,AnyCollection& c);
void Convert(const Stance& s,AnyCollection& c);
bool Convert(const AnyCollection& c,Vector3& x);
bool Convert(const AnyCollection& c,Vector& x);
bool Convert(const AnyCollection& c,IKGoal& g);
bool Convert(const AnyCollection& c,Hold& h);
bool Convert(const AnyCollection& c,Grasp& g);
bool Convert(const AnyCollection& c,Stance& s);

template <class T>
void SaveJSON(std::ostream& out,const T& x) {
  AnyCollection msg;
  Convert(x,msg);
  out<<msg;
}

template <class T>
bool LoadJSON(std::istream& in,const T& x) {
  AnyCollection msg;
  in >> msg;
  if(!in) return false;
  return Convert(msg,x);
}

#endif


text:
//Write a program that gets two numbers from the console and prints the greater of them.

using System;

class NumberComparer
{
    static void Main()
    {

        double firstNumber = double.Parse(Console.ReadLine());
        double secondNumber = double.Parse(Console.ReadLine());

        Console.WriteLine(firstNumber > secondNumber ? firstNumber : secondNumber);

        //if(firstNumber>secondNumber)
        //{
        //Console.WriteLine(firstNumber);
        //}
        //else
        //{
        //Console.WriteLine(secondNumber);
        //}
    }
}


text:
Download a list of ip ranges for a list of countries. Simply customize the
CN_LIST array variable with the country code of the countries you wish to target.

#List Of Country Codes
--

###Asia
- China (CN)
- Maldives (MV)
- Lebanon (LB)
- Malaysia (MY)
- India (IN)
- Iran (IR)
- Uzbekistan (UZ)
- Saudi Arabia (SA)
- Kuwait (KW)
- Macao (MO)
- Thailand (TH)
- Kyrgyzstan (KG)
- Cambodia (KH)
- Taiwan (TW)
- Vietnam (VN)
- Syria (SY)
- Israel (IL)
- Mongolia (MN)
- Oman (OM)
- Turkmenistan (TM)
- Singapore (SG)
- Hashemite Kingdom of Jordan (JO)
- Bahrain (BH)
- Armenia (AM)
- Bhutan (BT)
- Nepal (NP)
- Georgia (GE)
- Myanmar (Burma) (MM)
- Indonesia (ID)
- Palestine (PS)
- Afghanistan (AF)
- Turkey (TR)
- Iraq (IQ)
- Azerbaijan (AZ)
- Pakistan (PK)
- United Arab Emirates (AE)
- North Korea (KP)
- British Indian Ocean Territory (IO)
- Bangladesh (BD)
- Tajikistan (TJ)
- Kazakhstan (KZ)
- Republic of Korea (KR)
- Japan (JP)
- Laos (LA)
- Hong Kong (HK)
- Brunei (BN)
- Yemen (YE)
- Philippines (PH)
- Sri Lanka (LK)
- Qatar (QA)

###Africa
- Morocco (MA)
- South Africa (ZA)
- Ghana (GH)
- Djibouti (DJ)
- Mozambique (MZ)
- Namibia (NA)
- Madagascar (MG)
- Sudan (SD)
- Cape Verde (CV)
- Congo (CD)
- Nigeria (NG)
- Cameroon (CM)
- Zimbabwe (ZW)
- Uganda (UG)
- Swaziland (SZ)
- Togo (TG)
- Botswana (BW)
- Gabon (GA)
- South Sudan (SS)
- Seychelles (SC)
- Guinea (GN)
- Burundi (BI)
- Gambia (GM)
- Equatorial Guinea (GQ)
- Comoros (KM)
- Senegal (SN)
- Chad (TD)
- Ivory Coast (CI)
- Angola (AO)
- Liberia (LR)
- Algeria (DZ)
- Sierra Leone (SL)
- Mauritania (MR)
- Central African Republic (CF)
- Niger (NE)
- Mali (ML)
- Eritrea (ER)
- Benin (BJ)
- Egypt (EG)
- Libya (LY)
- Tunisia (TN)
- Tanzania (TZ)
- Lesotho (LS)
- Somalia (SO)
- Réunion (RE)
- Ethiopia (ET)
- Republic of the Congo (CG)
- Malawi (MW)
- Rwanda (RW)
- Guinea-Bissau (GW)
- Mayotte (YT)
- Mauritius (MU)
- Zambia (ZM)
- Kenya (KE)
- São Tomé and Príncipe (ST)
- Burkina Faso (BF)

###Europe
- Faroe Islands (FO)
- Sweden (SE)
- Bulgaria (BG)
- Malta (MT)
- Montenegro (ME)
- Ukraine (UA)
- United Kingdom (GB)
- Iceland (IS)
- Isle of Man (IM)
- Luxembourg (LU)
- Former Yugoslav Republic of Macedonia (MK)
- Czech Republic (CZ)
- Belgium (BE)
- Monaco (MC)
- Austria (AT)
- Netherlands (NL)
- Portugal (PT)
- Serbia (RS)
- Croatia (HR)
- Russia (RU)
- Slovenia (SI)
- Cyprus (CY)
- Belarus (BY)
- Romania (RO)
- Finland (FI)
- Andorra (AD)
- Guernsey (GG)
- Albania (AL)
- Norway (NO)
- Republic of Moldova (MD)
- Greece (GR)
- Poland (PL)
- Latvia (LV)
- Jersey (JE)
- Germany (DE)
- Ireland (IE)
- Estonia (EE)
- San Marino (SM)
- Vatican City (VA)
- Hungary (HU)
- Italy (IT)
- Spain (ES)
- Switzerland (CH)
- Gibraltar (GI)
- Bosnia and Herzegovina (BA)
- Liechtenstein (LI)
- Republic of Lithuania (LT)
- France (FR)
- Denmark (DK)
- Slovak Republic (SK)

###North America
- Bermuda (BM)
- Barbados (BB)
- Turks and Caicos Islands (TC)
- Martinique (MQ)
- Mexico (MX)
- Saint-Barthélemy (BL)
- Cuba (CU)
- Saint Pierre and Miquelon (PM)
- British Virgin Islands (VG)
- Montserrat (MS)
- Honduras (HN)
- Canada (CA)
- Belize (BZ)
- Greenland (GL)
- Grenada (GD)
- Jamaica (JM)
- Antigua and Barbuda (AG)
- Panama (PA)
- Bonaire, Sint Eustatius, and Saba (BQ)
- Costa Rica (CR)
- Saint Kitts and Nevis (KN)
- Dominica (DM)
- Saint Lucia (LC)
- Saint Martin (MF)
- Cayman Islands (KY)
- Aruba (AW)
- Curaçao (CW)
- Saint Vincent and the Grenadines (VC)
- Trinidad and Tobago (TT)
- United States (US)
- Sint Maarten (SX)
- Guatemala (GT)
- Guadeloupe (GP)
- U.S. Virgin Islands (VI)
- Anguilla (AI)
- El Salvador (SV)
- Puerto Rico (PR)
- Dominican Republic (DO)
- Nicaragua (NI)
- Haiti (HT)
- Bahamas (BS)

###Australia
- Kiribati (KI)
- Australia (AU)
- Niue (NU)
- Northern Mariana Islands (MP)
- American Samoa (AS)
- Tokelau (TK)
- Vanuatu (VU)
- Tonga (TO)
- Solomon Islands (SB)
- Cook Islands (CK)
- Palau (PW)
- Papua New Guinea (PG)
- Wallis and Futuna (WF)
- Norfolk Island (NF)
- Federated States of Micronesia (FM)
- Fiji (FJ)
- Marshall Islands (MH)
- French Polynesia (PF)
- Nauru (NR)
- New Zealand (NZ)
- New Caledonia (NC)
- Tuvalu (TV)
- East Timor (TL)
- Samoa (WS)
- Guam (GU)

###South America
- Colombia (CO)
- Peru (PE)
- Bolivia (BO)
- Uruguay (UY)
- Paraguay (PY)
- Guyana (GY)
- Chile (CL)
- Brazil (BR)
- French Guiana (GF)
- Suriname (SR)
- Venezuela (VE)
- Ecuador (EC)
- Argentina (AR)


text:
namespace blink {

class Shader : public RefCountedDartWrappable<Shader> {
  DEFINE_WRAPPERTYPEINFO();
  FML_FRIEND_MAKE_REF_COUNTED(Shader);

 public:
  ~Shader() override;

  sk_sp<SkShader> shader() { return shader_.get(); }

  void set_shader(flow::SkiaGPUObject<SkShader> shader) {
    shader_ = std::move(shader);
  }

 protected:
  Shader(flow::SkiaGPUObject<SkShader> shader = {});

 private:
  flow::SkiaGPUObject<SkShader> shader_;
};

}  // namespace blink

#endif  // FLUTTER_LIB_UI_PAINTING_SHADER_H_


text:
import django

if django.VERSION >= (3, 2):
    # The declaration is only needed for older Django versions
    pass
else:
    default_app_config = 'wagtail.contrib.styleguide.apps.WagtailStyleGuideAppConfig'


text:
'use strict';

/**
 * Given a `fieldName` (eg. "foo") and an object representing arguments and
 * values (eg. `{first: 10, orberBy: "name"}`) returns a unique storage key
 * (ie. `foo{"first":10,"orderBy":"name"}`).
 */
function formatStorageKey(fieldName, argsWithValues) {
  if (!argsWithValues) {
    return fieldName;
  }
  var filtered = null;
  for (var argName in argsWithValues) {
    if (argsWithValues.hasOwnProperty(argName)) {
      var value = argsWithValues[argName];
      if (value != null) {
        if (!filtered) {
          filtered = {};
        }
        filtered[argName] = value;
      }
    }
  }
  return filtered ? fieldName + require('./stableJSONStringify')(filtered) : fieldName;
}

module.exports = formatStorageKey;


text:
// -*- C++ -*-
// Module:  Log4CPLUS
// File:    win32debugappender.h
// Created: 12/2003
// Author:  Eduardo Francos, Odalio SARL
//
//
// Copyright 2003-2010 Odalio SARL
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/** @file */

#ifndef LOG4CPLUS_WIN32DEBUG_APPENDER_HEADER_
#define LOG4CPLUS_WIN32DEBUG_APPENDER_HEADER_

#include <log4cplus/config.hxx>

#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
#pragma once
#endif

#if defined (LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING)

#include <log4cplus/appender.h>

namespace log4cplus {

    /**
     * Prints log events using OutputDebugString().
     */
    class LOG4CPLUS_EXPORT Win32DebugAppender
        : public Appender
    {
    public:
      // Ctors
        Win32DebugAppender();
        Win32DebugAppender(const log4cplus::helpers::Properties& properties);

      // Dtor
        virtual ~Win32DebugAppender();

      // Methods
        virtual void close();

    protected:
        virtual void append(const log4cplus::spi::InternalLoggingEvent& event);

    private:
      // Disallow copying of instances of this class
        Win32DebugAppender(const Win32DebugAppender&);
        Win32DebugAppender& operator=(const Win32DebugAppender&);
    };

} // end namespace log4cplus

#endif // LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING
#endif // LOG4CPLUS_WIN32DEBUG_APPENDER_HEADER_


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls Sci. Nat. , Bot. , sér. 4 5: 371 (1857)

#### Original name
Stereum nephodes Mont.

### Remarks
null


text:
<!DOCTYPE html>

<meta charset="utf-8">

<title>class ApplicationController - Rails Application Documentation</title>

<link href="./fonts.css" rel="stylesheet">
<link href="./rdoc.css" rel="stylesheet">

    Home

    Pages
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Parent

ActionController::Base

Included Modules

Adm::SessionsHelper

Methods

#access_foward_if_adm

#access_foward_if_not_adm

#access_foward_if_not_emp

#access_foward_if_not_logged

#access_foward_if_opr

#access_granted?

#access_granted_forward?

    class ApplicationController

Public Instance Methods

          access_foward_if_adm()

          click to toggle source

# File app/controllers/application_controller.rb, line 41
def access_foward_if_adm
      access_granted_forward?(["emp","opr"], root_path, "Administradores não possuem acesso diretor a essa página")
end

          access_foward_if_not_adm()

          click to toggle source

# File app/controllers/application_controller.rb, line 29
def access_foward_if_not_adm
      access_granted_forward?(["adm"], root_path, "Apenas o administrador tem acesso a essa página")
end

          access_foward_if_not_emp()

          click to toggle source

# File app/controllers/application_controller.rb, line 33
def access_foward_if_not_emp
  access_granted_forward?(["emp"], root_path, "Apenas o empresários tem acesso a essa página")
end

          access_foward_if_not_logged()

          click to toggle source

# File app/controllers/application_controller.rb, line 45
def access_foward_if_not_logged
  if not signed_in?
    redirect_to public_plataforma_path, notice: "Por favor, faça login antes de acessar essa página"
  end
end

          access_foward_if_opr()

          click to toggle source

# File app/controllers/application_controller.rb, line 37
def access_foward_if_opr
  access_granted_forward?(["adm","emp"], root_path, "Operadores não possuem acesso a essa página")
end

          access_granted?(permissions)

          click to toggle source

# File app/controllers/application_controller.rb, line 7
def access_granted?(permissions)
  permissions.each do |p|
    return true if current_user.user_access.name == p if signed_in?
  end
  return false
end

          access_granted_forward?(permissions, foward, msg="Você não tem acesso")

          click to toggle source

# File app/controllers/application_controller.rb, line 14
def access_granted_forward?(permissions, foward, msg="Você não tem acesso")
  redirect_to foward, notice: msg unless permissions.any?

  if not signed_in?
      redirect_to foward, notice: "Por favor, faça login antes de acessar essa página"
      return
  end

  permissions.each do |p|
    return true if current_user.user_access.name == p  if signed_in?
  end

  redirect_to foward, notice: msg
end

Validate

Generated by RDoc 4.1.1.

Based on Darkfish by Michael Granger.


text:
title: "ServiceComb Java-Chassis Downloads"
lang: cn
ref: release
permalink: /cn/release/java-chassis-downloads/
excerpt: "ServiceComb Java-Chassis Downloads"
last_modified_at: 2018-03-28T00:50:43-55:00
---

## Releases

* Apache ServiceComb (incubating) Service-Center 1.0.0-m1
    - Source [[src]](https://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-src.zip) [[asc]](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-src.zip.asc) [[sha512]](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-src.zip.sha512)
    - Distribution [[Binary]](https://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-bin.zip) [[asc]](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-bin.zip.asc) [[sha512]](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/apache-servicecomb-incubating-java-chassis-distribution-1.0.0-m1-bin.zip.sha512)

**Verifying the release**

It is essential that you verify the integrity of the downloaded files using the PGP or SHA signatures.
 The PGP signatures can  be verified using GPG or PGP.
 Please download the [KEYS](https://www.apache.org/dist/incubator/servicecomb/KEYS){:target="_blank"} as well as the asc signature files for relevant distribution. It is recommended to get these files from the main distribution [directory](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/){:target="_blank"} and not from the mirrors.
 ```
 gpg -i KEYS

 or

 pgpk -a KEYS

 or

 pgp -ka KEYS

```

To verify the binaries/sources you can download the relevant asc files for it from main distribution directory and follow the below guide.

```
gpg --verify apache-servicecomb-incubating-java-chassis-********.asc apache-servicecomb-incubating-java-chassis-*********

or

pgpv apache-servicecomb-incubating-java-chassis-********.asc

or

pgp apache-servicecomb-incubating-java-chassis-********.asc

```

Alternatively you can download the SHA signatures from main distribution [repo](https://www.apache.org/dist/incubator/servicecomb/incubator-servicecomb-java-chassis/){:target="_blank"} and verify the downloads using sha512sum.


text:
// The "||" notation doesn't work yet
Fixtures = typeof Fixtures !== "undefined" ? Fixtures : {};

Fixtures.realisations = [
  /* 0 */
  {
    "_id" : "uG6hAZQerMApTWhkP",
    "description" : "Pourquoi pas ?",
    "img" : "/images/realisations/_MG_7552.JPG",
    "title" : "Le cerf enchanté",
    "resume" : "",
    "img_full" : "/images/realisations/_MG_7550.JPG"
  },

  /* 1 */
  {
    "_id" : "y9d2NDGMv7TstDMEX",
    "description" : "La joie du papier japonais.",
    "img" : "/images/realisations/_MG_7539.JPG",
    "title" : "Tabouret tuné",
    "resume" : "",
    "img_full" : "/images/realisations/_MG_7538.JPG"
  },

  /* 2 */
  {
    "_id" : "7KqbhJcxZATq4phdf",
    "description" : "Trop doudoux",
    "img" : "/images/realisations/_MG_7533.JPG",
    "title" : "Coussins doudoux",
    "resume" : "",
    "img_full" : "/images/realisations/_MG_7558.JPG"
  },

  /* 3 */
  {
    "_id" : "BFNaCseXEAciJH6Xd",
    "description" : "",
    "editable" : true,
    "img" : "/images/realisations/_MG_7577.JPG",
    "img_full" : "/images/realisations/_MG_7576.JPG",
    "resume" : "Pourquoi pas ?",
    "title" : "La joie des papiers d'Adeline Klam"
  },

  /* 4 */
  {
    "_id" : "DTmh92JWtQnMsCJfp",
    "description" : "## pourquoi\n\nLe vrai *bonnet* crocheté. \n\nUn vrai bonheur !\n\n>flkdjfkdsjlkdfs\nfmlsdkflmsdkfmlsdkfmlsdkfmlkfsd\nmlfksdmlfksmdlkmdskfmldskdfmlk\n\n * fdsmlkfdmsl\n * mfsdklmflks\n * mlfkdsmlfksm\n\n",
    "editable" : false,
    "img" : "/images/realisations/_MG_7529.JPG",
    "img_full" : "/images/realisations/_MG_7562.JPG",
    "resume" : "Un bonnet comme celui-ci, ça se garde toute une vie !",
    "title" : "Le vrai bonnet"
  },

  /* 5 */
  {
    "_id" : "ZiA9gRgGnHgSxtXRZ",
    "description" : "## Pourquoi pas.\n\n**Adultae** ex <i>et</i> amicorum Publicola filia adultae florem amicorum ille ex pauperis ille alitur mariti ex humatur stipe nobilitas subsidiis dotatur liberis conlaticia liberis subsidiis florem Valerius aerario et Reguli pauperis inops Reguli uxor filia nobilitas stipe alitur Reguli liberis filia Reguli mariti diuturnum ex Scipionis absentia *humatur* florem aerario liberis inops conlaticia Reguli florem inops subsidiis pauperis ex virginis liberis pauperis ille pauperis cum diuturnum filia Reguli inops ille pauperis causa Scipionis subsidiis absentia cum erubesceret adultae diuturnum nobilitas liberis subsidiis stipe Reguli florem absentia diuturnum conlaticia adultae absentia absentia Publicola adultae stipe humatur ille erubesceret virginis cum amicorum.\n\n",
    "editable" : true,
    "img" : "/images/realisations/_MG_7579.JPG",
    "img_full" : "/images/realisations/_MG_7580.JPG",
    "resume" : "Mes premières réalisations à la machine à coudre.",
    "title" : "Trousses"
  }
];


text:
Xml Cache Data integrity

        Loading...

        This checks the data integrity for the xml structures for content, media and members that are stored in the cmsContentXml table.
        This does not check the data integrity of the xml cache file, only the xml structures stored in the database used to create the xml cache file.

        {{value.label}} ...
        Checking...
        Ok
        Error

            <button type="button" ng-click="fix(value)" class="btn btn-warning">
                Fix
                Rebuild
            </button>


text:
module ChildProcess
  module Windows
    class Handle

      class << self
        private :new

        def open(pid, access = PROCESS_ALL_ACCESS)
          handle = Lib.open_process(access, false, pid)

          if handle.null?
            raise Error, Lib.last_error_message
          end

          h = new(handle, pid)
          return h unless block_given?

          begin
            yield h
          ensure
            h.close
          end
        end
      end

      attr_reader :pointer

      def initialize(pointer, pid)
        unless pointer.kind_of?(FFI::Pointer)
          raise TypeError, "invalid handle: #{pointer.inspect}"
        end

        if pointer.null?
          raise ArgumentError, "handle is null: #{pointer.inspect}"
        end

        @pid     = pid
        @pointer = pointer
        @closed  = false
      end

      def exit_code
        code_pointer = FFI::MemoryPointer.new :ulong
        ok = Lib.get_exit_code(@pointer, code_pointer)

        if ok
          code_pointer.get_ulong(0)
        else
          close
          raise Error, Lib.last_error_message
        end
      end

      def send(signal)
        case signal
        when 0
          exit_code == PROCESS_STILL_ALIVE
        when WIN_SIGINT
          Lib.generate_console_ctrl_event(CTRL_C_EVENT, @pid)
        when WIN_SIGBREAK
          Lib.generate_console_ctrl_event(CTRL_BREAK_EVENT, @pid)
        when WIN_SIGKILL
          ok = Lib.terminate_process(@pointer, @pid)
          Lib.check_error ok
        else
          thread_id     = FFI::MemoryPointer.new(:ulong)
          module_handle = Lib.get_module_handle("kernel32")
          proc_address  = Lib.get_proc_address(module_handle, "ExitProcess")

          thread = Lib.create_remote_thread(@pointer, 0, 0, proc_address, 0, 0, thread_id)
          check_error thread

          Lib.wait_for_single_object(thread, 5)
          true
        end
      end

      def close
        return if @closed

        Lib.close_handle(@pointer)
        @closed = true
      end

      def wait(milliseconds = nil)
        Lib.wait_for_single_object(@pointer, milliseconds || INFINITE)
      end

    end # Handle
  end # Windows
end # ChildProcess


text:
import numpy
from numpy.testing import assert_almost_equal
import torch
from torch.autograd import Variable

from allennlp.common import Params
from allennlp.modules.similarity_functions import DotProductSimilarity
from allennlp.common.testing import AllenNlpTestCase

class TestDotProductSimilarityFunction(AllenNlpTestCase):
    def test_forward_does_a_dot_product(self):
        dot_product = DotProductSimilarity()
        a_vectors = torch.LongTensor([[1, 1, 1], [-1, -1, -1]])
        b_vectors = torch.LongTensor([[1, 0, 1], [1, 0, 0]])
        result = dot_product(Variable(a_vectors), Variable(b_vectors)).data.numpy()
        assert result.shape == (2,)
        assert numpy.all(result == [2, -1])

    def test_forward_works_with_higher_order_tensors(self):
        dot_product = DotProductSimilarity()
        a_vectors = numpy.random.rand(5, 4, 3, 6, 7)
        b_vectors = numpy.random.rand(5, 4, 3, 6, 7)
        desired_result = numpy.sum(a_vectors * b_vectors, axis=-1)
        result = dot_product(Variable(torch.from_numpy(a_vectors)),
                             Variable(torch.from_numpy(b_vectors))).data.numpy()
        assert result.shape == (5, 4, 3, 6)
        # We're cutting this down here with a random partial index, so that if this test fails the
        # output isn't so huge and slow.
        assert_almost_equal(result[2, 3, 1], desired_result[2, 3, 1])

    def test_can_construct_from_params(self):
        assert DotProductSimilarity.from_params(Params({})).__class__.__name__ == 'DotProductSimilarity'


text:
<template name="layout">
  {{> header}}

    {{> yield}}

</template>

<template name="header">

          AutoForm Jquery Payments Demo

</template>


text:
.. _readme:

.. include:: ../README.rst

.. .. include:: goals.rst

.. .. include:: products.rst


text:
package com.vivifram.second.hitalk.ui.page.layout;

import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.vivifram.second.hitalk.R;

/**
 * Created by zuowei on 16-8-1.
 */
public class HitalkFragmentLayout extends BaseFragmentLayout {

    public interface  OnTabClickListener{
        void onTabClick(int index);
    }
    private int mCurrentTabIndex;
    private Tab tabOne_;
    private Tab tabTwo_;
    private OnTabClickListener mOnTabClickListener;
    public HitalkFragmentLayout(View root) {
        super(root);
    }

    @Override
    public void onActivitySet() {
        super.onActivitySet();
        mAct.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    }

    @Override
    public void onViewCreate(View root) {
        super.onViewCreate(root);
        createRoom(root);
    }

    private void createRoom(View root) {
        tabOne_ = new Tab(root.findViewById(R.id.tabOne),0);
        tabOne_.setSelected(true);
        tabTwo_ = new Tab(findViewById(R.id.tabTwo),1);
        tabOne_.setTitle(mCtx.getString(R.string.tab_hi));
        tabTwo_.setTitle(mCtx.getString(R.string.topic_conversation_title));

        View.OnClickListener onClickListener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int id = v.getId();
                if (id == tabOne_.getTabId()){
                    tabOne_.setSelected(true);
                    tabTwo_.setSelected(false);
                    mCurrentTabIndex = tabOne_.getIndex();
                    if (mOnTabClickListener != null){
                        mOnTabClickListener.onTabClick(tabOne_.getIndex());
                    }
                }else if (id == tabTwo_.getTabId()){
                    tabOne_.setSelected(false);
                    tabTwo_.setSelected(true);
                    mCurrentTabIndex = tabTwo_.getIndex();
                    if (mOnTabClickListener != null){
                        mOnTabClickListener.onTabClick(tabTwo_.getIndex());
                    }
                }
            }
        };

        tabOne_.setTabOnclickListener(onClickListener);
        tabTwo_.setTabOnclickListener(onClickListener);
    }

    public void setTabOneCount(int count){
        tabOne_.setNumber(count);
    }

    public void setTabTwoCount(int count){
        tabTwo_.setNumber(count);
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    public int getContentId(){
        return R.id.content;
    }

    public int getCurrentTabIndex() {
        return mCurrentTabIndex;
    }

    @Override
    public void onViewDestroy() {
        super.onViewDestroy();
    }

    public void setOnTabClickListener(OnTabClickListener mOnTabClickListener) {
        this.mOnTabClickListener = mOnTabClickListener;
    }

    private static class Tab{
        private View mRoot;
        private TextView mTitleTv;
        private TextView mNumberTv;
        private int mIndex;
        public Tab(View v, int index){
            mRoot = v;
            mTitleTv = (TextView) mRoot.findViewById(R.id.titleTv);
            mNumberTv = (TextView) mRoot.findViewById(R.id.numberTv);
            mIndex = index;
        }

        public void setTitle(String title){
            mTitleTv.setText(title);
        }

        public void setSelected(boolean selected){
            mRoot.setSelected(selected);
        }

        public void setNumber(int number){
            mNumberTv.setText(String.format(mRoot.getResources()
                    .getString(R.string.onlineNumber),number));
        }

        public void setTabOnclickListener(View.OnClickListener onclickListener){
            mRoot.setOnClickListener(onclickListener);
        }

        public int getTabId(){
            return mRoot.getId();
        }

        public int getIndex() {
            return mIndex;
        }
    }
}


text:
require 'spec_helper'
require 'core_ext/module/include'

describe Travis::Exceptions::Handling do
  let(:klass) do
    options = self.options

    Class.new do
      extend Travis::Exceptions::Handling

      attr_reader :called

      def outer
        inner
      end
      rescues :outer, options

      def inner # so there's something we can stub for raising
        @called = true
      end

      def arity_3(foo, bar, baz)
        [foo, bar, baz]
      end
      rescues :arity_3
    end
  end

  let(:options) { {} }
  let(:object)  { klass.new }

  before do
    Travis.stubs(:env).returns 'development'
  end

  it 'calls the original implementation' do
    object.outer
    object.called.should == true
  end

  it 'rescues exceptions' do
    object.stubs(:inner).raises(Exception)
    lambda { object.outer }.should_not raise_error
  end

  it 'sends exceptions to the exception handler' do
    exception = Exception.new
    object.stubs(:inner).raises(exception)
    Travis::Exceptions.expects(:handle).with(exception, {})
    object.outer
  end

  it 'works with methods that have an arity of 3' do
    object.arity_3(1, 2, 3).should == [1, 2, 3]
  end

  describe '' do
    let(:error)   { Class.new(StandardError) }
    let(:options) { { raise: error } }

    it '' do
      object.stubs(:inner).raises(error)
      lambda { object.outer }.should raise_error(error)
    end
  end
end


text:
import { PlanetData } from 'novadatainterface/PlanetData';
import { AsyncSystemResource } from 'nova_ecs/async_system';
import { Position } from 'nova_ecs/datatypes/position';
import { Vector } from 'nova_ecs/datatypes/vector';
import { Entity } from 'nova_ecs/entity';
import { MovementStateComponent } from 'nova_ecs/plugins/movement_plugin';
import { World } from 'nova_ecs/world';
import * as PIXI from 'pixi.js';
import { Observable } from 'rxjs';
import { GameData } from '../client/gamedata/GameData';
import { ControlEvent } from '../nova_plugin/controls_plugin';
import { GameDataResource } from '../nova_plugin/game_data_resource';
import { ArmorComponent, IonizationComponent, ShieldComponent } from '../nova_plugin/health_plugin';
import { OutfitsStateComponent } from '../nova_plugin/outfit_plugin';
import { ShipPhysicsComponent } from '../nova_plugin/ship_plugin';
import { SystemIdResource } from '../nova_plugin/system_id_resource';
import { SystemPlugin } from '../nova_plugin/system_plugin';
import { WeaponsStateComponent } from '../nova_plugin/weapons_state';
import { Button } from './button';
import { Menu } from './menu';
import { MenuControls } from './menu_controls';
import { Outfitter } from './outfitter';
import { Shipyard } from './shipyard';

export class Spaceport extends Menu<Entity> {
    private outfitter: Outfitter;
    private shipyard: Shipyard;
    private data?: PlanetData;

    private font = {
        title: {
            fontFamily: "Geneva", fontSize: 18, fill: 0xffffff,
            align: 'center'
        } as const,
        desc: {
            fontFamily: "Geneva", fontSize: 9, fill: 0xffffff,
            align: 'left', wordWrap: true, wordWrapWidth: 301
        } as const,
    };

    constructor(gameData: GameData, private id: string,
        controlEvents: Observable<ControlEvent>) {
        super(gameData, "nova:8500", controlEvents);
        this.container.name = 'Spaceport';

        const buttons = {
            outfitter: new Button(gameData, "Outfitter", 120, { x: 160, y: 116 }),
            shipyard: new Button(gameData, "Shipyard", 120, { x: 160, y: 74 }),
            leave: new Button(gameData, "Leave", 120, { x: 160, y: 200 })
        };

        buttons.leave.click.subscribe(this.done.bind(this));

        this.outfitter = new Outfitter(gameData, controlEvents);
        const showOutfitter = async () => {
            this.controls.unbind();
            const outfits = this.input.components.get(OutfitsStateComponent) ?? new Map();
            const newOutfits = await this.outfitter.show(outfits);
            this.input.components.set(OutfitsStateComponent, newOutfits);
            // Delete these so they are re-created with the new outfits.
            // TODO: Find a better way to do this.
            this.input.components.delete(WeaponsStateComponent);
            this.input.components.delete(ShipPhysicsComponent);
            this.controls.bind();
        };
        buttons.outfitter.click.subscribe(showOutfitter);

        this.shipyard = new Shipyard(gameData, controlEvents);

        const showShipyard = async () => {
            this.controls.unbind();
            const newInput = await this.shipyard.show(this.input);
            if (newInput !== this.input) {
                // Construct a fake system and run providers so that outfits of the new
                // ship are provided.
                const shipBuildWorld = new World('outfit builder');
                shipBuildWorld.resources.set(GameDataResource, gameData);
                shipBuildWorld.resources.set(SystemIdResource, 'nova:128');
                await shipBuildWorld.addPlugin(SystemPlugin);
                shipBuildWorld.entities.set('ship', newInput);
                shipBuildWorld.step();
                await shipBuildWorld.resources.get(AsyncSystemResource)?.done;
                shipBuildWorld.step();
                shipBuildWorld.entities.delete('ship');
            }
            this.input = newInput;

            this.controls.bind();
        };
        buttons.shipyard.click.subscribe(showShipyard);
        this.addButtons(buttons);

        this.controls = new MenuControls(controlEvents, {
            outfitter: showOutfitter,
            shipyard: showShipyard,
            depart: this.done.bind(this),
        });
    }

    override async build() {
        await super.build();
        const data = await this.gameData.data.Planet.get(this.id);
        this.data = data;
        const title = new PIXI.Text(data.name, this.font.title);
        title.position.x = -24;
        title.position.y = 39;
        this.container.addChild(title);

        const desc = new PIXI.Text(data.landingDesc, this.font.desc);
        desc.position.x = -149;
        desc.position.y = 70;
        this.container.addChild(desc);

        const spaceportPict = this.gameData.spriteFromPict(data.landingPict)
        spaceportPict.position.x = -306;
        spaceportPict.position.y = -256;
        this.container.addChild(spaceportPict)
        this.container.addChild(this.outfitter.container);
        this.container.addChild(this.shipyard.container);
    }

    protected override done() {
        if (this.data) {
            const movement = this.input.components.get(MovementStateComponent);
            if (movement) {
                movement.position = new Position(...this.data.position);
                movement.velocity = new Vector(0, 0);
            }
            const shield = this.input.components.get(ShieldComponent);
            if (shield) {
                shield.current = shield.max;
            }
            const armor = this.input.components.get(ArmorComponent);
            if (armor) {
                armor.current = armor.max;
            }
            const ionization = this.input.components.get(IonizationComponent);
            if (ionization) {
                ionization.current = 0;
            }
        }
        super.done();
    }
}


text:
{% extends "search/search_base.html" %}
{% load crispy_forms_tags %}
{% block content %}

    <div class="container">
    <form method="get" action=".">
        {{ form|crispy }}
        <input class="btn btn-large btn-primary" type="submit" name="submit" value="Search">
    </form>
    </div>
{% endblock content %}


text:
<component name="libraryTable">
  <library name="Maven: org.apache.hadoop:hadoop-mapreduce-client-jobclient:tests:2.6.4">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4-tests.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4-test-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4-test-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
import numpy as np
from ..core.mapping import Mapping
from ..core.parameterization import Param

class Linear(Mapping):
    """
    A Linear mapping.

    .. math::

       F(\mathbf{x}) = \mathbf{A} \mathbf{x})

    :param input_dim: dimension of input.
    :type input_dim: int
    :param output_dim: dimension of output.
    :type output_dim: int
    :param kernel: a GPy kernel, defaults to GPy.kern.RBF
    :type kernel: GPy.kern.kern

    """

    def __init__(self, input_dim, output_dim, name='linmap'):
        super(Linear, self).__init__(input_dim=input_dim, output_dim=output_dim, name=name)
        self.A = Param('A', np.random.randn(self.input_dim, self.output_dim))
        self.link_parameter(self.A)

    def f(self, X):
        return np.dot(X, self.A)

    def update_gradients(self, dL_dF, X):
        self.A.gradient = np.dot(X.T, dL_dF)

    def gradients_X(self, dL_dF, X):
        return np.dot(dL_dF, self.A.T)

    def to_dict(self):
        input_dict = super(Linear, self)._to_dict()
        input_dict["class"] = "GPy.mappings.Linear"
        input_dict["A"] = self.A.values.tolist()
        return input_dict

    @staticmethod
    def _from_dict(mapping_class, input_dict):
        import copy
        input_dict = copy.deepcopy(input_dict)
        A = np.array(input_dict.pop('A'))
        l = Linear(**input_dict)
        l.unlink_parameter(l.A)
        l.update_model(False)
        l.A = Param('A', A)
        l.link_parameter(l.A)
        return l


text:
class TagsController < ApplicationController
  include CommonBehavior

  before_action :set_tag, only: MEMBER_ACTIONS

  def authorize!
    authorize(@tag || @tags)
  end
  private :authorize!

  def index
    @tags = Tag.all.paginate(page: params[:page], per_page: per_page_param)
    authorize!
  end

  def show; end

  def new
    @tag = Tag.new
    authorize!
  end

  def tag_params
    params[:tag].permit(:name) if params[:tag].present?
  end
  private :tag_params

  def edit; end

  def create
    @tag = Tag.new(tag_params)
    authorize!
    create_and_respond(object: @tag)
  end

  def set_tag
    @tag = Tag.find(params[:id])
    authorize!
  end
  private :set_tag

  def update
    update_and_respond(object: @tag, params: tag_params)
  end

  def destroy
    destroy_and_respond(object: @tag)
  end

  def to_s
    name
  end
end


text:
var assert = require('assert');

var R = require('..');

describe('head', function() {

  it('returns the first element of an ordered collection', function() {
    assert.strictEqual(R.head([1, 2, 3]), 1);
    assert.strictEqual(R.head([2, 3]), 2);
    assert.strictEqual(R.head([3]), 3);
    assert.strictEqual(R.head([]), undefined);

    assert.strictEqual(R.head('abc'), 'a');
    assert.strictEqual(R.head('bc'), 'b');
    assert.strictEqual(R.head('c'), 'c');
    assert.strictEqual(R.head(''), '');
  });

  it('throws if applied to null or undefined', function() {
    assert.throws(function() { R.head(null); }, TypeError);
    assert.throws(function() { R.head(undefined); }, TypeError);
  });

});


text:
var _curry3 =
/*#__PURE__*/
require("./internal/_curry3");

var equals =
/*#__PURE__*/
require("./equals");
/**
 * Returns `true` if the specified object property is equal, in
 * [`R.equals`](#equals) terms, to the given value; `false` otherwise.
 * You can test multiple properties with [`R.whereEq`](#whereEq).
 *
 * @func
 * @memberOf R
 * @since v0.1.0
 * @category Relation
 * @sig String -> a -> Object -> Boolean
 * @param {String} name
 * @param {*} val
 * @param {*} obj
 * @return {Boolean}
 * @see R.whereEq, R.propSatisfies, R.equals
 * @example
 *
 *      const abby = {name: 'Abby', age: 7, hair: 'blond'};
 *      const fred = {name: 'Fred', age: 12, hair: 'brown'};
 *      const rusty = {name: 'Rusty', age: 10, hair: 'brown'};
 *      const alois = {name: 'Alois', age: 15, disposition: 'surly'};
 *      const kids = [abby, fred, rusty, alois];
 *      const hasBrownHair = R.propEq('hair', 'brown');
 *      R.filter(hasBrownHair, kids); //=> [fred, rusty]
 */

var propEq =
/*#__PURE__*/
_curry3(function propEq(name, val, obj) {
  return equals(val, obj[name]);
});

module.exports = propEq;


text:
using System.Threading;
using System.Threading.Tasks;

namespace SimpleSoft.Mediator.Tests.Mocks
{
    public class MockCommandHandler : ICommandHandler<MockCommand>
    {
        public Task HandleAsync(MockCommand cmd, CancellationToken ct)
        {
            return Task.CompletedTask;
        }
    }
}


text:
package http

import (
	"net/http"

	"go-common/app/tool/saga/conf"
	"go-common/app/tool/saga/service"
	"go-common/library/log"
	bm "go-common/library/net/http/blademaster"
	"go-common/library/net/http/blademaster/middleware/verify"
)

var (
	svc    *service.Service
	idfSvc *verify.Verify
)

// Init init http sever instance.
func Init(s *service.Service) {
	svc = s
	idfSvc = verify.New(nil)
	e := bm.DefaultServer(conf.Conf.BM)
	internalRouter(e)
	if err := e.Start(); err != nil {
		log.Error("xhttp.Serve error(%v)", err)
		panic(err)
	}
}

// internalRouter init internal router.
func internalRouter(e *bm.Engine) {
	e.Ping(ping)
	e.Register(register)

	group1 := e.Group("/x/internal/v2/saga/gitlab")
	{
		group1.POST("/comment", gitlabComment)
		group1.POST("/pipeline", gitlabPipeline)
		group1.POST("/mr", gitlabMR)
	}
	group2 := e.Group("/x/internal/v2/saga/api")
	{
		group2.POST("/contributors", buildContributors)
	}
}

// ping check server ok.
func ping(c *bm.Context) {
	if err := svc.Ping(c); err != nil {
		log.Error("saga ping error(%+v)", err)
		c.AbortWithStatus(http.StatusServiceUnavailable)
	}
}

func register(c *bm.Context) {
	c.JSON(nil, nil)
}


text:
<?php

namespace Google\AdsApi\AdManager\v202205;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class ForecastService extends \Google\AdsApi\Common\AdsSoapClient
{

    /**
     * @var array $classmap The defined classes
     */
    private static $classmap = array (
      'ObjectValue' => 'Google\\AdsApi\\AdManager\\v202205\\ObjectValue',
      'AdUnitCodeError' => 'Google\\AdsApi\\AdManager\\v202205\\AdUnitCodeError',
      'AdUnitTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\AdUnitTargeting',
      'AlternativeUnitTypeForecast' => 'Google\\AdsApi\\AdManager\\v202205\\AlternativeUnitTypeForecast',
      'ApiError' => 'Google\\AdsApi\\AdManager\\v202205\\ApiError',
      'ApiException' => 'Google\\AdsApi\\AdManager\\v202205\\ApiException',
      'TechnologyTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\TechnologyTargeting',
      'ApiVersionError' => 'Google\\AdsApi\\AdManager\\v202205\\ApiVersionError',
      'ApplicationException' => 'Google\\AdsApi\\AdManager\\v202205\\ApplicationException',
      'AppliedLabel' => 'Google\\AdsApi\\AdManager\\v202205\\AppliedLabel',
      'AssetError' => 'Google\\AdsApi\\AdManager\\v202205\\AssetError',
      'AudienceExtensionError' => 'Google\\AdsApi\\AdManager\\v202205\\AudienceExtensionError',
      'AuthenticationError' => 'Google\\AdsApi\\AdManager\\v202205\\AuthenticationError',
      'AvailabilityForecast' => 'Google\\AdsApi\\AdManager\\v202205\\AvailabilityForecast',
      'AvailabilityForecastOptions' => 'Google\\AdsApi\\AdManager\\v202205\\AvailabilityForecastOptions',
      'BandwidthGroup' => 'Google\\AdsApi\\AdManager\\v202205\\BandwidthGroup',
      'BandwidthGroupTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\BandwidthGroupTargeting',
      'BaseCustomFieldValue' => 'Google\\AdsApi\\AdManager\\v202205\\BaseCustomFieldValue',
      'BooleanValue' => 'Google\\AdsApi\\AdManager\\v202205\\BooleanValue',
      'Browser' => 'Google\\AdsApi\\AdManager\\v202205\\Browser',
      'BrowserLanguage' => 'Google\\AdsApi\\AdManager\\v202205\\BrowserLanguage',
      'BrowserLanguageTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\BrowserLanguageTargeting',
      'BrowserTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\BrowserTargeting',
      'BuyerUserListTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\BuyerUserListTargeting',
      'ClickTrackingLineItemError' => 'Google\\AdsApi\\AdManager\\v202205\\ClickTrackingLineItemError',
      'CollectionSizeError' => 'Google\\AdsApi\\AdManager\\v202205\\CollectionSizeError',
      'CommonError' => 'Google\\AdsApi\\AdManager\\v202205\\CommonError',
      'CompanyCreditStatusError' => 'Google\\AdsApi\\AdManager\\v202205\\CompanyCreditStatusError',
      'ContendingLineItem' => 'Google\\AdsApi\\AdManager\\v202205\\ContendingLineItem',
      'ContentTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\ContentTargeting',
      'CreativeError' => 'Google\\AdsApi\\AdManager\\v202205\\CreativeError',
      'CreativePlaceholder' => 'Google\\AdsApi\\AdManager\\v202205\\CreativePlaceholder',
      'CreativeTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\CreativeTargeting',
      'CrossSellError' => 'Google\\AdsApi\\AdManager\\v202205\\CrossSellError',
      'CustomCriteria' => 'Google\\AdsApi\\AdManager\\v202205\\CustomCriteria',
      'CustomCriteriaSet' => 'Google\\AdsApi\\AdManager\\v202205\\CustomCriteriaSet',
      'CustomFieldValue' => 'Google\\AdsApi\\AdManager\\v202205\\CustomFieldValue',
      'CustomFieldValueError' => 'Google\\AdsApi\\AdManager\\v202205\\CustomFieldValueError',
      'CustomPacingCurve' => 'Google\\AdsApi\\AdManager\\v202205\\CustomPacingCurve',
      'CustomPacingGoal' => 'Google\\AdsApi\\AdManager\\v202205\\CustomPacingGoal',
      'CmsMetadataCriteria' => 'Google\\AdsApi\\AdManager\\v202205\\CmsMetadataCriteria',
      'CustomTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\CustomTargetingError',
      'CustomCriteriaLeaf' => 'Google\\AdsApi\\AdManager\\v202205\\CustomCriteriaLeaf',
      'CustomCriteriaNode' => 'Google\\AdsApi\\AdManager\\v202205\\CustomCriteriaNode',
      'AudienceSegmentCriteria' => 'Google\\AdsApi\\AdManager\\v202205\\AudienceSegmentCriteria',
      'Date' => 'Google\\AdsApi\\AdManager\\v202205\\Date',
      'DateError' => 'Google\\AdsApi\\AdManager\\v202205\\DateError',
      'DateRange' => 'Google\\AdsApi\\AdManager\\v202205\\DateRange',
      'DateTime' => 'Google\\AdsApi\\AdManager\\v202205\\DateTime',
      'DateTimeRange' => 'Google\\AdsApi\\AdManager\\v202205\\DateTimeRange',
      'DateTimeRangeTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\DateTimeRangeTargeting',
      'DateTimeRangeTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\DateTimeRangeTargetingError',
      'DateTimeValue' => 'Google\\AdsApi\\AdManager\\v202205\\DateTimeValue',
      'DateValue' => 'Google\\AdsApi\\AdManager\\v202205\\DateValue',
      'DayPart' => 'Google\\AdsApi\\AdManager\\v202205\\DayPart',
      'DayPartTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\DayPartTargeting',
      'DayPartTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\DayPartTargetingError',
      'DeliveryData' => 'Google\\AdsApi\\AdManager\\v202205\\DeliveryData',
      'BreakdownForecast' => 'Google\\AdsApi\\AdManager\\v202205\\BreakdownForecast',
      'DeliveryForecastOptions' => 'Google\\AdsApi\\AdManager\\v202205\\DeliveryForecastOptions',
      'DeliveryForecast' => 'Google\\AdsApi\\AdManager\\v202205\\DeliveryForecast',
      'DeliveryIndicator' => 'Google\\AdsApi\\AdManager\\v202205\\DeliveryIndicator',
      'DeviceCapability' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceCapability',
      'DeviceCapabilityTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceCapabilityTargeting',
      'DeviceCategory' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceCategory',
      'DeviceCategoryTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceCategoryTargeting',
      'DeviceManufacturer' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceManufacturer',
      'DeviceManufacturerTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\DeviceManufacturerTargeting',
      'DropDownCustomFieldValue' => 'Google\\AdsApi\\AdManager\\v202205\\DropDownCustomFieldValue',
      'EntityChildrenLimitReachedError' => 'Google\\AdsApi\\AdManager\\v202205\\EntityChildrenLimitReachedError',
      'EntityLimitReachedError' => 'Google\\AdsApi\\AdManager\\v202205\\EntityLimitReachedError',
      'FeatureError' => 'Google\\AdsApi\\AdManager\\v202205\\FeatureError',
      'FieldPathElement' => 'Google\\AdsApi\\AdManager\\v202205\\FieldPathElement',
      'ForecastBreakdown' => 'Google\\AdsApi\\AdManager\\v202205\\ForecastBreakdown',
      'ForecastBreakdownEntry' => 'Google\\AdsApi\\AdManager\\v202205\\ForecastBreakdownEntry',
      'ForecastBreakdownOptions' => 'Google\\AdsApi\\AdManager\\v202205\\ForecastBreakdownOptions',
      'ForecastBreakdownTarget' => 'Google\\AdsApi\\AdManager\\v202205\\ForecastBreakdownTarget',
      'ForecastError' => 'Google\\AdsApi\\AdManager\\v202205\\ForecastError',
      'FrequencyCap' => 'Google\\AdsApi\\AdManager\\v202205\\FrequencyCap',
      'FrequencyCapError' => 'Google\\AdsApi\\AdManager\\v202205\\FrequencyCapError',
      'GenericTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\GenericTargetingError',
      'GeoTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\GeoTargeting',
      'GeoTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\GeoTargetingError',
      'Goal' => 'Google\\AdsApi\\AdManager\\v202205\\Goal',
      'GrpDemographicBreakdown' => 'Google\\AdsApi\\AdManager\\v202205\\GrpDemographicBreakdown',
      'GrpSettings' => 'Google\\AdsApi\\AdManager\\v202205\\GrpSettings',
      'GrpSettingsError' => 'Google\\AdsApi\\AdManager\\v202205\\GrpSettingsError',
      'ImageError' => 'Google\\AdsApi\\AdManager\\v202205\\ImageError',
      'InternalApiError' => 'Google\\AdsApi\\AdManager\\v202205\\InternalApiError',
      'InvalidUrlError' => 'Google\\AdsApi\\AdManager\\v202205\\InvalidUrlError',
      'InventoryTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\InventoryTargeting',
      'InventoryTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\InventoryTargetingError',
      'InventoryUnitError' => 'Google\\AdsApi\\AdManager\\v202205\\InventoryUnitError',
      'InventoryUrl' => 'Google\\AdsApi\\AdManager\\v202205\\InventoryUrl',
      'InventoryUrlTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\InventoryUrlTargeting',
      'LabelEntityAssociationError' => 'Google\\AdsApi\\AdManager\\v202205\\LabelEntityAssociationError',
      'LineItemActivityAssociationError' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemActivityAssociationError',
      'LineItemActivityAssociation' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemActivityAssociation',
      'LineItemCreativeAssociationError' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemCreativeAssociationError',
      'LineItemDealInfoDto' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemDealInfoDto',
      'LineItemDeliveryForecast' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemDeliveryForecast',
      'LineItem' => 'Google\\AdsApi\\AdManager\\v202205\\LineItem',
      'LineItemError' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemError',
      'LineItemFlightDateError' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemFlightDateError',
      'LineItemOperationError' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemOperationError',
      'LineItemSummary' => 'Google\\AdsApi\\AdManager\\v202205\\LineItemSummary',
      'Location' => 'Google\\AdsApi\\AdManager\\v202205\\Location',
      'MobileApplicationTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\MobileApplicationTargeting',
      'MobileApplicationTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\MobileApplicationTargetingError',
      'MobileCarrier' => 'Google\\AdsApi\\AdManager\\v202205\\MobileCarrier',
      'MobileCarrierTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\MobileCarrierTargeting',
      'MobileDevice' => 'Google\\AdsApi\\AdManager\\v202205\\MobileDevice',
      'MobileDeviceSubmodel' => 'Google\\AdsApi\\AdManager\\v202205\\MobileDeviceSubmodel',
      'MobileDeviceSubmodelTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\MobileDeviceSubmodelTargeting',
      'MobileDeviceTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\MobileDeviceTargeting',
      'Money' => 'Google\\AdsApi\\AdManager\\v202205\\Money',
      'NotNullError' => 'Google\\AdsApi\\AdManager\\v202205\\NotNullError',
      'NullError' => 'Google\\AdsApi\\AdManager\\v202205\\NullError',
      'NumberValue' => 'Google\\AdsApi\\AdManager\\v202205\\NumberValue',
      'OperatingSystem' => 'Google\\AdsApi\\AdManager\\v202205\\OperatingSystem',
      'OperatingSystemTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\OperatingSystemTargeting',
      'OperatingSystemVersion' => 'Google\\AdsApi\\AdManager\\v202205\\OperatingSystemVersion',
      'OperatingSystemVersionTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\OperatingSystemVersionTargeting',
      'OrderActionError' => 'Google\\AdsApi\\AdManager\\v202205\\OrderActionError',
      'OrderError' => 'Google\\AdsApi\\AdManager\\v202205\\OrderError',
      'ParseError' => 'Google\\AdsApi\\AdManager\\v202205\\ParseError',
      'PermissionError' => 'Google\\AdsApi\\AdManager\\v202205\\PermissionError',
      'ProgrammaticError' => 'Google\\AdsApi\\AdManager\\v202205\\ProgrammaticError',
      'ProposalLineItem' => 'Google\\AdsApi\\AdManager\\v202205\\ProposalLineItem',
      'ProposalLineItemMakegoodInfo' => 'Google\\AdsApi\\AdManager\\v202205\\ProposalLineItemMakegoodInfo',
      'ProspectiveLineItem' => 'Google\\AdsApi\\AdManager\\v202205\\ProspectiveLineItem',
      'PublisherQueryLanguageContextError' => 'Google\\AdsApi\\AdManager\\v202205\\PublisherQueryLanguageContextError',
      'PublisherQueryLanguageSyntaxError' => 'Google\\AdsApi\\AdManager\\v202205\\PublisherQueryLanguageSyntaxError',
      'QuotaError' => 'Google\\AdsApi\\AdManager\\v202205\\QuotaError',
      'RangeError' => 'Google\\AdsApi\\AdManager\\v202205\\RangeError',
      'RegExError' => 'Google\\AdsApi\\AdManager\\v202205\\RegExError',
      'RequestPlatformTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\RequestPlatformTargeting',
      'RequestPlatformTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\RequestPlatformTargetingError',
      'RequiredCollectionError' => 'Google\\AdsApi\\AdManager\\v202205\\RequiredCollectionError',
      'RequiredError' => 'Google\\AdsApi\\AdManager\\v202205\\RequiredError',
      'RequiredNumberError' => 'Google\\AdsApi\\AdManager\\v202205\\RequiredNumberError',
      'RequiredSizeError' => 'Google\\AdsApi\\AdManager\\v202205\\RequiredSizeError',
      'ReservationDetailsError' => 'Google\\AdsApi\\AdManager\\v202205\\ReservationDetailsError',
      'AudienceSegmentError' => 'Google\\AdsApi\\AdManager\\v202205\\AudienceSegmentError',
      'ServerError' => 'Google\\AdsApi\\AdManager\\v202205\\ServerError',
      'SetTopBoxLineItemError' => 'Google\\AdsApi\\AdManager\\v202205\\SetTopBoxLineItemError',
      'SetValue' => 'Google\\AdsApi\\AdManager\\v202205\\SetValue',
      'Size' => 'Google\\AdsApi\\AdManager\\v202205\\Size',
      'SoapRequestHeader' => 'Google\\AdsApi\\AdManager\\v202205\\SoapRequestHeader',
      'SoapResponseHeader' => 'Google\\AdsApi\\AdManager\\v202205\\SoapResponseHeader',
      'StatementError' => 'Google\\AdsApi\\AdManager\\v202205\\StatementError',
      'Stats' => 'Google\\AdsApi\\AdManager\\v202205\\Stats',
      'StringFormatError' => 'Google\\AdsApi\\AdManager\\v202205\\StringFormatError',
      'StringLengthError' => 'Google\\AdsApi\\AdManager\\v202205\\StringLengthError',
      'TargetingCriteriaBreakdown' => 'Google\\AdsApi\\AdManager\\v202205\\TargetingCriteriaBreakdown',
      'Targeting' => 'Google\\AdsApi\\AdManager\\v202205\\Targeting',
      'TeamError' => 'Google\\AdsApi\\AdManager\\v202205\\TeamError',
      'Technology' => 'Google\\AdsApi\\AdManager\\v202205\\Technology',
      'TechnologyTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\TechnologyTargetingError',
      'TextValue' => 'Google\\AdsApi\\AdManager\\v202205\\TextValue',
      'ThirdPartyMeasurementSettings' => 'Google\\AdsApi\\AdManager\\v202205\\ThirdPartyMeasurementSettings',
      'TimeOfDay' => 'Google\\AdsApi\\AdManager\\v202205\\TimeOfDay',
      'TimeSeries' => 'Google\\AdsApi\\AdManager\\v202205\\TimeSeries',
      'TimeZoneError' => 'Google\\AdsApi\\AdManager\\v202205\\TimeZoneError',
      'TrafficDataRequest' => 'Google\\AdsApi\\AdManager\\v202205\\TrafficDataRequest',
      'TrafficDataResponse' => 'Google\\AdsApi\\AdManager\\v202205\\TrafficDataResponse',
      'TranscodingError' => 'Google\\AdsApi\\AdManager\\v202205\\TranscodingError',
      'TypeError' => 'Google\\AdsApi\\AdManager\\v202205\\TypeError',
      'UniqueError' => 'Google\\AdsApi\\AdManager\\v202205\\UniqueError',
      'UserDomainTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\UserDomainTargeting',
      'UserDomainTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\UserDomainTargetingError',
      'Value' => 'Google\\AdsApi\\AdManager\\v202205\\Value',
      'VideoPosition' => 'Google\\AdsApi\\AdManager\\v202205\\VideoPosition',
      'VideoPositionTargeting' => 'Google\\AdsApi\\AdManager\\v202205\\VideoPositionTargeting',
      'VideoPositionTargetingError' => 'Google\\AdsApi\\AdManager\\v202205\\VideoPositionTargetingError',
      'VideoPositionWithinPod' => 'Google\\AdsApi\\AdManager\\v202205\\VideoPositionWithinPod',
      'VideoPositionTarget' => 'Google\\AdsApi\\AdManager\\v202205\\VideoPositionTarget',
      'getAvailabilityForecastResponse' => 'Google\\AdsApi\\AdManager\\v202205\\getAvailabilityForecastResponse',
      'getAvailabilityForecastByIdResponse' => 'Google\\AdsApi\\AdManager\\v202205\\getAvailabilityForecastByIdResponse',
      'getDeliveryForecastResponse' => 'Google\\AdsApi\\AdManager\\v202205\\getDeliveryForecastResponse',
      'getDeliveryForecastByIdsResponse' => 'Google\\AdsApi\\AdManager\\v202205\\getDeliveryForecastByIdsResponse',
      'getTrafficDataResponse' => 'Google\\AdsApi\\AdManager\\v202205\\getTrafficDataResponse',
    );

    /**
     * @param array $options A array of config values
     * @param string $wsdl The wsdl file to use
     */
    public function __construct(array $options = array(),
                $wsdl = 'https://ads.google.com/apis/ads/publisher/v202205/ForecastService?wsdl')
    {
      foreach (self::$classmap as $key => $value) {
        if (!isset($options['classmap'][$key])) {
          $options['classmap'][$key] = $value;
        }
      }
      $options = array_merge(array (
      'features' => 1,
    ), $options);
      parent::__construct($wsdl, $options);
    }

    /**
     * Gets the availability forecast for a {@link ProspectiveLineItem}. An availability forecast
     * reports the maximum number of available units that the line item can book, and the total number
     * of units matching the line item's targeting.
     *
     * @param \Google\AdsApi\AdManager\v202205\ProspectiveLineItem $lineItem
     * @param \Google\AdsApi\AdManager\v202205\AvailabilityForecastOptions $forecastOptions
     * @return \Google\AdsApi\AdManager\v202205\AvailabilityForecast
     * @throws \Google\AdsApi\AdManager\v202205\ApiException
     */
    public function getAvailabilityForecast(\Google\AdsApi\AdManager\v202205\ProspectiveLineItem $lineItem, \Google\AdsApi\AdManager\v202205\AvailabilityForecastOptions $forecastOptions)
    {
      return $this->__soapCall('getAvailabilityForecast', array(array('lineItem' => $lineItem, 'forecastOptions' => $forecastOptions)))->getRval();
    }

    /**
     * Gets an {@link AvailabilityForecast} for an existing {@link LineItem} object. An availability
     * forecast reports the maximum number of available units that the line item can be booked with,
     * and also the total number of units matching the line item's targeting.
     *
     * <p>Only line items having type {@link LineItemType#SPONSORSHIP} or {@link
     * LineItemType#STANDARD} are valid. Other types will result in {@link
     * ReservationDetailsError.Reason#LINE_ITEM_TYPE_NOT_ALLOWED}.
     *
     * @param int $lineItemId
     * @param \Google\AdsApi\AdManager\v202205\AvailabilityForecastOptions $forecastOptions
     * @return \Google\AdsApi\AdManager\v202205\AvailabilityForecast
     * @throws \Google\AdsApi\AdManager\v202205\ApiException
     */
    public function getAvailabilityForecastById($lineItemId, \Google\AdsApi\AdManager\v202205\AvailabilityForecastOptions $forecastOptions)
    {
      return $this->__soapCall('getAvailabilityForecastById', array(array('lineItemId' => $lineItemId, 'forecastOptions' => $forecastOptions)))->getRval();
    }

    /**
     * Gets the delivery forecast for a list of {@link ProspectiveLineItem} objects in a single
     * delivery simulation with line items potentially contending with each other. A delivery forecast
     * reports the number of units that will be delivered to each line item given the line item goals
     * and contentions from other line items.
     *
     * @param \Google\AdsApi\AdManager\v202205\ProspectiveLineItem[] $lineItems
     * @param \Google\AdsApi\AdManager\v202205\DeliveryForecastOptions $forecastOptions
     * @return \Google\AdsApi\AdManager\v202205\DeliveryForecast
     * @throws \Google\AdsApi\AdManager\v202205\ApiException
     */
    public function getDeliveryForecast(array $lineItems, \Google\AdsApi\AdManager\v202205\DeliveryForecastOptions $forecastOptions)
    {
      return $this->__soapCall('getDeliveryForecast', array(array('lineItems' => $lineItems, 'forecastOptions' => $forecastOptions)))->getRval();
    }

    /**
     * Gets the delivery forecast for a list of existing {@link LineItem} objects in a single
     * delivery simulation. A delivery forecast reports the number of units that will be delivered
     * to each line item given the line item goals and contentions from other line items.
     *
     * @param long[] $lineItemIds
     * @param \Google\AdsApi\AdManager\v202205\DeliveryForecastOptions $forecastOptions
     * @return \Google\AdsApi\AdManager\v202205\DeliveryForecast
     * @throws \Google\AdsApi\AdManager\v202205\ApiException
     */
    public function getDeliveryForecastByIds(array $lineItemIds, \Google\AdsApi\AdManager\v202205\DeliveryForecastOptions $forecastOptions)
    {
      return $this->__soapCall('getDeliveryForecastByIds', array(array('lineItemIds' => $lineItemIds, 'forecastOptions' => $forecastOptions)))->getRval();
    }

    /**
     * Returns forecasted and historical traffic data for the segment of traffic specified by the
     * provided request.
     *
     * <p>Calling this endpoint programmatically is only available for Ad Manager 360 networks.
     *
     * @param \Google\AdsApi\AdManager\v202205\TrafficDataRequest $trafficDataRequest
     * @return \Google\AdsApi\AdManager\v202205\TrafficDataResponse
     * @throws \Google\AdsApi\AdManager\v202205\ApiException
     */
    public function getTrafficData(\Google\AdsApi\AdManager\v202205\TrafficDataRequest $trafficDataRequest)
    {
      return $this->__soapCall('getTrafficData', array(array('trafficDataRequest' => $trafficDataRequest)))->getRval();
    }

}


text:
require 'chef/knife'
require 'chef/json_compat'

require_relative 'podnix_base'
class Chef
  class Knife
    class PodnixServerCreate < Knife

      deps do
        require 'net/ssh'
        require 'net/ssh/multi'
        require 'podnix'
        require 'highline'
        require 'chef/knife/bootstrap'
        require 'chef/knife/core/bootstrap_context'
        require 'securerandom'
        require 'timeout'
        require 'socket'

        Chef::Knife.load_deps

      end
      include Knife::PodnixBase

      banner "knife podnix server create OPTIONS"

      option :name,
        :short => "-N SERVER_NAME",
        :long => "--name SERVER_NAME",
        :description => "name for the newly created Server",
        :required => true

      option :bootstrap,
        :long => "--[no-]bootstrap",
        :description => "Bootstrap the server with knife bootstrap",
        :boolean => true,
        :default => true

      option :podnix_api_key,
        :short => "-K PODNIX_API_KEY",
        :long => "--podnix_api_key PODNIX_API_KEY",
        :description => "Podnix API key",
        :default => Chef::Config[:knife][:podnix_api_key]

      option :flavor,
        :short => "-f FLAVOR",
        :long => "--flavor FLAVOR",
        :description => "the amount of vCores and RAM that your server will get. MODEL IN PODNIX [1, 2, 4, 8]",
        :required => true,
        :proc => Proc.new { |flavor| Chef::Config[:knife][:podnix_flavor] = flavor }

      option :password,
        :short => "-P PASSWORD",
        :long => "--password PASSWORD",
        :description => "Specifies the root password (on Linux) or administrator password (on Windows). Must contain at least 9 chars and include a lower case char, an upper case char and a number",
        :required => true,
        :proc => Proc.new { |password| Chef::Config[:knife][:podnix_password] = password }

      option :storage,
        :long => "--storage SIZE",
        :description => "Specify the size (in GB) of the system drive. Valid size is 10-250",
        :default => '10',
        :proc => Proc.new { |size| Chef::Config[:knife][:podnix_storage] = size }

      option :ssd,
        :long => "--ssd 1",
        :description => "If this parameter is set to 1, the system drive will be located on a SSD drive",
        :proc => Proc.new { |set| Chef::Config[:knife][:podnix_ssd] = set }

      option :image,
        :short => "-I IMAGE_ID",
        :long => "--image IMAGE_ID",
        :description => "This image_id will define operating system and pre-installed software. default '37' which is Ubuntu 13.04 (64bit), For more 'knife podnix image list' ",
        :required => true,
        :proc => Proc.new { |i| Chef::Config[:knife][:podnix_image] = i }

      option :ssh_user,
        :short => "-x USERNAME",
        :long => "--ssh-user USERNAME",
        :description => "The user to create and add the provided public key to authorized_keys, default is 'root'",
        :default => "root"

      option :run_list,
        :short => "-r RUN_LIST",
        :long => "--run-list RUN_LIST",
        :description => "Comma separated list of roles/recipes to apply",
        :proc => lambda { |o| o.split(/[\s,]+/) },
        :default => []

      option :distro,
        :short => "-d DISTRO",
        :long => "--distro DISTRO",
        :description => "Bootstrap a distro using a template; default is 'chef-full'",
        :proc => Proc.new { |d| Chef::Config[:knife][:distro] = d },
        :default => "chef-full"

      option :chef_node_name,
        :short => "-N NAME",
        :long => "--node-name NAME",
        :description => "The Chef node name for your new node default is the name of the server.",
        :proc => Proc.new { |t| Chef::Config[:knife][:chef_node_name] = t }

      def h
        @highline ||= HighLine.new
      end

      def podnix_api
        Podnix::API.new({:key => "#{config[:podnix_api_key]}"})
      end

      def run
        validate!

        unless config[:name]
          ui.error("A Server Name must be provided -N")
          exit 1
        end

        create_hash = {
          :name => "#{config[:name]}",
          :model => "#{config[:flavor]}",
          :image => "#{config[:image]}",
          :password => "#{config[:password]}",
          :storage => "#{config[:storage]}"
        }
        if config[:ssd]
          create_hash[:ssd] = "1"
        end

        @po_server = podnix_api.add_server(create_hash)

        puts ui.color("Server:", :green)
        msg_pair("Name", config[:name])
        msg_pair("Model", config[:flavor])
        msg_pair("Image", config[:image])
        msg_pair("Storage", config[:storage])
        msg_pair("Password", config[:password])

        puts ui.color("Server is being created", :green)
        puts ui.color("Creating Server......", :green)

        sleep 60

        @po_start = podnix_api.start_server({:id => "#{@po_server.data[:body]['id']}"})
        puts ui.color("Starting Server......", :green)
        sleep 60

        @po_get = podnix_api.get_server({:id => "#{@po_server.data[:body]['id']}"})
        print "\n#{ui.color("Waiting for instance", :magenta)}"

        puts("\n")
        @po_server = @po_get.data[:body]['data']
        msg_pair("Public DNS Name", @po_server['hostname'])
        msg_pair("Public IP Address", @po_server['ip'])

        bootstrap()

        puts "\n"
        msg_pair("ID", @po_server['id'])
        msg_pair("Name", @po_server['name'])
        msg_pair("Image", @po_server['image'])
        msg_pair("Password", @po_server['vnc_passwd'])
        msg_pair("vCores", @po_server['vcores'])
        msg_pair("RAM", @po_server['ram'])
        msg_pair("Model", @po_server['model'])
        msg_pair("Drives", @po_server['drives'])
        msg_pair("Storage", @po_server['storage'])
        msg_pair("Run List", (config[:run_list]))
        #msg_pair("JSON Attributes",config[:json_attributes]) unless !config[:json_attributes] || config[:json_attributes].empty?
      end
      #=end

      def bootstrap
        bootstrap = Chef::Knife::Bootstrap.new
        bootstrap.name_args = @po_server['ip']
        bootstrap.config[:run_list] = locate_config_value(:run_list)
        bootstrap.config[:ssh_user] = locate_config_value(:ssh_user)
        bootstrap.config[:ssh_password] = locate_config_value(:password)
        bootstrap.config[:distro] = locate_config_value(:distro)
        bootstrap.config[:host_key_verify] = false
        bootstrap.config[:chef_node_name] = locate_config_value(:chef_node_name) || @po_server['name']
        bootstrap.config[:use_sudo] = true unless bootstrap.config[:ssh_user] == 'root'
        bootstrap.run
      end

    end
  end
end


text:
define(['exports'], function (exports) {
  'use strict';
  var StencilSDK = (function () {
      function StencilSDK() {
      this.private = "parts";
    }

    StencilSDK.prototype.configure = function configure(baseUrl) {
      baseUrl = (baseUrl == null || baseUrl == "") ? "/api" : baseUrl;
      return Stencil.Client.Create(baseUrl);
    };

    return StencilSDK;
  })();

  exports.StencilSDK = StencilSDK;
  return exports;
});


text:
package org.apache.jackrabbit.oak.plugins.segment.standby.codec;

import static org.apache.jackrabbit.oak.plugins.segment.standby.codec.SegmentEncoder.EXTRA_HEADERS_LEN;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

import java.nio.ByteBuffer;
import java.util.UUID;

import org.apache.jackrabbit.oak.plugins.segment.Segment;
import org.apache.jackrabbit.oak.plugins.segment.SegmentId;
import org.apache.jackrabbit.oak.plugins.segment.SegmentStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;

@Deprecated
public class SegmentDecoder extends LengthFieldBasedFrameDecoder {

    private static final Logger log = LoggerFactory
            .getLogger(SegmentDecoder.class);

    /**
     * the maximum possible size a header message might have
     */
    private static final int MAX_LENGHT = Segment.MAX_SEGMENT_SIZE
            + EXTRA_HEADERS_LEN;

    private final SegmentStore store;

    public SegmentDecoder(SegmentStore store) {
        super(MAX_LENGHT, 0, 4, 0, 0);
        this.store = store;
    }

    @Override
    protected Object decode(ChannelHandlerContext ctx, ByteBuf in)
            throws Exception {
        ByteBuf frame = (ByteBuf) super.decode(ctx, in);
        if (frame == null) {
            return null;
        }
        int len = frame.readInt();
        byte type = frame.readByte();
        long msb = frame.readLong();
        long lsb = frame.readLong();
        long hash = frame.readLong();
        byte[] segment = new byte[len - 25];
        frame.getBytes(29, segment);
        Hasher hasher = Hashing.murmur3_32().newHasher();
        long check = hasher.putBytes(segment).hash().padToLong();
        if (hash == check) {
            SegmentId id = new SegmentId(store.getTracker(), msb, lsb);
            Segment s = new Segment(store.getTracker(), id,
                    ByteBuffer.wrap(segment));
            log.debug("received type {} with id {} and size {}", type, id,
                    s.size());
            return s;
        }
        log.debug("received corrupted segment {}, ignoring", new UUID(msb, lsb));
        return null;

    }

    @Override
    protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer,
            int index, int length) {
        return buffer.slice(index, length);
    }

}


text:
class Portfolio < ActiveRecord::Base
  belongs_to :user
  before_save :upcase_symbol

  validates :company_name, :quantity, :average_price, :user_id, presence: true
  validates :symbol, presence: true, uniqueness: { case_sensitive: false }

  private
    def upcase_symbol
      self.symbol = symbol.upcase
    end
end