text:
<?php

namespace Stato\Model;

use \Exception;
use Stato\Model\Interfaces\Changeable;

class MethodMissingTargetException extends Exception {}

class Base implements Changeable
{
    protected static $repositories = array();

    public static function __callStatic($methodName, $args)
    {
        return call_user_func_array(array(static::getDataset(), $methodName), $args);
    }

    public static function create(array $values)
    {
        $class = get_called_class();
        $model = new $class($values);
        $model->save();
        return $model;
    }

    protected static function getDataset()
    {
        return new Dataset(static::getMetaclass(), static::getRepository());
    }

    public static function getRepository($name = null)
    {
        if (is_null($name)) {
            $name = static::getRepositoryName();
        }
        return Repository::get($name);
    }

    public static function getRepositoryName()
    {
        $className = get_called_class();
        if (array_key_exists($className, self::$repositories)) {
            return self::$repositories[$className];
        }
        return static::getDefaultRepositoryName();
    }

    public static function getDefaultRepositoryName()
    {
        return Repository::getDefaultName();
    }

    public static function setRepositoryName($name)
    {
        self::$repositories[get_called_class()] = $name;
    }

    public static function setMetaclass(Metaclass $metaclass)
    {
        $metaclass->defineDynamicMethods('getProperty', 'get');
        $metaclass->defineDynamicMethods('setProperty', 'set');
        $metaclass->setModelClass(get_called_class());
        static::getRepository()->addMetaclass($metaclass);
    }

    public static function getMetaclass()
    {
        return static::getRepository()->getMetaclass(get_called_class());
    }

    protected $metaclass;

    protected $values = array();

    protected $changedValues = array();

    protected $saved = false;

    public function __construct(array $values = null)
    {
        $this->metaclass = static::getMetaclass();
        if (!is_null($values)) {
            $this->metaclass->checkPropertiesExistence(array_keys($values));
            foreach ($values as $k => $v) $this->__set($k, $v);
        }
    }

    public function __get($property)
    {
        $possibleGetter = 'get'.ucfirst($property);
        if (method_exists($this, $possibleGetter)) {
            return $this->$possibleGetter();
        }
        return $this->getProperty($property);
    }

    public function __set($property, $value)
    {
        $possibleSetter = 'set'.ucfirst($property);
        if (method_exists($this, $possibleSetter)) {
            return $this->$possibleSetter($value);
        }
        return $this->setProperty($property, $value);
    }

    public function __call($method, $args)
    {
        list($propertyName, $methodTarget)
            = $this->metaclass->getMethodMissingTarget($method, get_called_class());
        if (!method_exists($this, $methodTarget)) {
            throw new MethodMissingTargetException("Call to undefined method target '$methodTarget'");
        }
        array_unshift($args, $propertyName);
        return call_user_func_array(array($this, $methodTarget), $args);
    }

    public function getProperty($name)
    {
        if (!$this->metaclass->hasProperty($name)) {
            throw new PropertyMissingException("Missing $name property");
        }
        return array_key_exists($name, $this->values) ? $this->values[$name] : null;
    }

    public function setProperty($name, $value)
    {
        if (!$this->metaclass->hasProperty($name)) {
            throw new PropertyMissingException("Missing $name property");
        }
        $this->trackChange($name, $value);
        $this->values[$name] = $value;
    }

    public function save()
    {
        if (!$this->hasChanged()) {
            return $this->isSaved();
        }
        if ($this->isNew()) {
            return $this->_create();
        } else {
            return $this->_update();
        }
    }

    public function isNew()
    {
        return !$this->isSaved();
    }

    public function isSaved()
    {
        return $this->saved == true;
    }

    public function setAsSaved()
    {
        $this->saved = true;
    }

    protected function _create()
    {
        /* on set les props à leur valeur par défaut sauf pour le serial et les relations */
        static::getRepository()->create($this);
        $this->saved = true;
        $this->changedValues = array();
        return true;
    }

    protected function _update()
    {

    }

    /**
     * Do any properties have unsaved changes?
     */
    public function hasChanged()
    {
        return count($this->changedValues) != 0;
    }

    /**
     * Returns an array of properties with unsaved changes.
     * <code>$person->getChangedProperties();   // -> false
     * $person->setName('john');
     * $person->getChangedProperties();   // -> array('name')</code>
     */
    public function getChangedProperties()
    {
        return array_keys($this->changedValues);
    }

    public function getChangedValues()
    {
        return $this->changedValues;
    }

    /**
     * Does <var>$name</var> property have unsaved change?
     */
    public function hasPropertyChanged($name)
    {
        return in_array($name, $this->getChangedProperties());
    }

    public function getChanges()
    {
        $changes = array();
        foreach ($this->changedValues as $k => $v) {
            $changes[$k] = array($v, $this->getProperty($k));
        }
        return $changes;
    }

    protected function trackChange($name, $value)
    {
        $old = $this->getProperty($name);
        if ($this->hasValueChanged($name, $old, $value)) {
            $this->changedValues[$name] = $old;
        }
    }

    protected function hasValueChanged($name, $old, $value)
    {
        return (empty($old) && !empty($value)) || $old != $value;
    }
}


text:
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals

redpajama_set_name: RedPajamaGithub


text:
package com.uet.beman.object;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thanhpd on 3/12/2015.
 */
public class GroupNode extends Node {

    private List<Node> childNode = new ArrayList<Node>();

    public GroupNode() {
    }

    public GroupNode(String id, String message, String parentId, List<Node> childNode) {
        super(id, message, parentId);
        setChildNodeList(childNode);
    }

    public GroupNode(String id) { super(id, null, "0"); }

    public List<Node> getChildNodeList() { return childNode; }

    public void setChildNodeList(List<Node> childNode) { this.childNode = childNode; }

    public boolean isSentenceNode() { return false; }

    public List<GroupNode> getGroupGroupNode() {
        List<GroupNode> result = new ArrayList<>();
        for (Node i:childNode) {
            if (!i.isSentenceNode()) result.add((GroupNode) i);
        }
        return result;
    }

    public List<SentenceNode> getGroupSentenceNode() {
        List<SentenceNode> result = new ArrayList<SentenceNode>();
        for (Node i:childNode) {
            if (i.isSentenceNode()) result.add((SentenceNode) i);
        }
        return result;
    }
}


text:
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
using System.Text;

namespace CryptoKnight.Library.Network
{
    public static class TypeConverter
    {
        public static byte[] ToBytes(this object obj)
        {
            var formatter = new BinaryFormatter();
            using (var stream = new MemoryStream())
            {
                formatter.Serialize(stream, obj);
                return stream.ToArray();
            }
        }

        public static T ToType<T>(this byte[] bytes)
        {
            var formatter = new BinaryFormatter();
            using (var stream = new MemoryStream())
            {
                stream.Write(bytes, 0, bytes.Length);
                stream.Seek(0, SeekOrigin.Begin);
                return (T)formatter.Deserialize(stream);
            }
        }

        public static string ComputeMd5Hash(this string original)
        {
            using (MD5 md5Hash = MD5.Create())
            {
                // Convert the input string to a byte array and compute the hash.
                byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(original));

                // Create a new Stringbuilder to collect the bytes
                // and create a string.
                StringBuilder sBuilder = new StringBuilder();

                // Loop through each byte of the hashed data
                // and format each one as a hexadecimal string.
                for (int i = 0; i < data.Length; i++)
                {
                    sBuilder.Append(data[i].ToString("x2"));
                }

                // Return the hexadecimal string.
                return sBuilder.ToString();
            }
        }
    }
}


text:
@import url(../../../stylesheets/application.css);
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800);
/* load the default Redmine stylesheet */
.input_tiny {
  width: 50px;
}

.input_small {
  width: 100px;
}

.input_medium {
  width: 150px;
}

.input_large {
  width: 200px;
}

.input_xlarge {
  width: 250px;
}

.input_xxlarge {
  width: 300px;
}

.input_full {
  width: 100%;
}

.input_full_wrap {
  display: block;
  padding-right: 8px;
}

input[type="search"]::-webkit-search-decoration {
  display: none;
}

input,
button,
a.button,
select,
textarea {
  -webkit-transition: box-shadow 0.5s;
  -moz-transition: box-shadow 0.5s;
  -o-transition: box-shadow 0.5s;
  transition: box-shadow 0.5s;
}
input:invalid,
button:invalid,
a.button:invalid,
select:invalid,
textarea:invalid {
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
input:focus,
button:focus,
a.button:focus,
select:focus,
textarea:focus {
  -webkit-box-shadow: #81c2dc 0 0 5px 0;
  -moz-box-shadow: #81c2dc 0 0 5px 0;
  box-shadow: #81c2dc 0 0 5px 0;
  z-index: 1;
}

input[type="file"]:focus, input[type="file"]:active,
input[type="radio"]:focus,
input[type="radio"]:active,
input[type="checkbox"]:focus,
input[type="checkbox"]:active {
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}

button,
a.button,
input[type="reset"],
input[type="submit"],
input[type="button"] {
  -webkit-appearance: none;
  -webkit-background-clip: padding;
  -moz-background-clip: padding;
  background-clip: padding-box;
  background: #d92e47;
  border: none;
  cursor: pointer;
  color: #fff;
  display: inline-block;
  font-size: 16px;
  outline: 0;
  overflow: visible;
  margin: 0;
  padding: 0 15px;
  line-height: 2;
  text-shadow: none;
  text-decoration: none;
  vertical-align: top;
  width: auto;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  -o-transition: all 0.5s;
  transition: all 0.5s;
  *padding-top: 2px;
  *padding-bottom: 0;
}
button:hover, button:active,
a.button:hover,
a.button:active,
input[type="reset"]:hover,
input[type="reset"]:active,
input[type="submit"]:hover,
input[type="submit"]:active,
input[type="button"]:hover,
input[type="button"]:active {
  background: #fff;
  color: #d92e47;
}
button::-moz-focus-inner,
a.button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner {
  border: 0;
  padding: 0;
}
button + a,
a.button + a,
input[type="reset"] + a,
input[type="submit"] + a,
input[type="button"] + a {
  font-size: 16px;
  padding: 0 15px;
  line-height: 2;
}

a.button {
  *padding-bottom: 3px;
}

button {
  *padding-top: 1px;
  *padding-bottom: 1px;
}

textarea,
select,
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"] {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-background-clip: padding;
  -moz-background-clip: padding;
  background-clip: padding-box;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  -ms-border-radius: 0;
  -o-border-radius: 0;
  border-radius: 0;
  -webkit-appearance: none;
  background-color: white;
  border: 1px solid;
  border-color: #848484 #c1c1c1 #e1e1e1;
  color: black;
  outline: 0;
  margin: 0;
  padding: 2px 3px;
  text-align: left;
  font-size: 13px;
  font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
  height: 1.8em;
  vertical-align: top;
  *padding-top: 2px;
  *padding-bottom: 1px;
  *height: auto;
}
textarea[disabled],
select[disabled],
input[type="date"][disabled],
input[type="datetime"][disabled],
input[type="datetime-local"][disabled],
input[type="email"][disabled],
input[type="month"][disabled],
input[type="number"][disabled],
input[type="password"][disabled],
input[type="search"][disabled],
input[type="tel"][disabled],
input[type="text"][disabled],
input[type="time"][disabled],
input[type="url"][disabled],
input[type="week"][disabled] {
  background-color: #eeeeee;
}
.box textarea, .box
select, .box
input[type="date"], .box
input[type="datetime"], .box
input[type="datetime-local"], .box
input[type="email"], .box
input[type="month"], .box
input[type="number"], .box
input[type="password"], .box
input[type="search"], .box
input[type="tel"], .box
input[type="text"], .box
input[type="time"], .box
input[type="url"], .box
input[type="week"] {
  border: 1px solid #DDD;
}
fieldset#filters td.values textarea, fieldset#filters td.values
select, fieldset#filters td.values
input[type="date"], fieldset#filters td.values
input[type="datetime"], fieldset#filters td.values
input[type="datetime-local"], fieldset#filters td.values
input[type="email"], fieldset#filters td.values
input[type="month"], fieldset#filters td.values
input[type="number"], fieldset#filters td.values
input[type="password"], fieldset#filters td.values
input[type="search"], fieldset#filters td.values
input[type="tel"], fieldset#filters td.values
input[type="text"], fieldset#filters td.values
input[type="time"], fieldset#filters td.values
input[type="url"], fieldset#filters td.values
input[type="week"] {
  height: 1.8em;
}

button[disabled],
input[disabled],
select[disabled],
select[disabled] option,
select[disabled] optgroup,
textarea[disabled],
a.button_disabled {
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  -moz-user-select: -moz-none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  user-select: none;
  color: #888888;
  cursor: default;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #888888;
}

input:-moz-placeholder,
textarea:-moz-placeholder {
  color: #888888;
}

input.placeholder_text,
textarea.placeholder_text {
  color: #888888;
}

textarea,
select[size],
select[multiple] {
  height: auto;
}

select[size="0"],
select[size="1"] {
  height: 1.8em;
  *height: auto;
}

@media (-webkit-min-device-pixel-ratio: 0) {
  select[size],
  select[multiple],
  select[multiple][size] {
    background-image: none;
    padding-right: 3px;
  }

  select,
  select[size="0"],
  select[size="1"] {
    background-image: url(data:image/png;base64,R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEALAAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==);
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 20px;
  }

  ::-webkit-validation-bubble-message {
    -webkit-box-shadow: none;
    box-shadow: none;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, black));
    border: 0;
    color: white;
    font: 13px / 17px "Lucida Grande", Arial, "Liberation Sans", FreeSans, sans-serif;
    overflow: hidden;
    padding: 15px 15px 17px;
    text-shadow: black 0 0 1px;
    min-height: 16px;
  }

  ::-webkit-validation-bubble-arrow,
  ::-webkit-validation-bubble-top-outer-arrow,
  ::-webkit-validation-bubble-top-inner-arrow {
    -webkit-box-shadow: none;
    box-shadow: none;
    background: #666666;
    border-color: #666666;
  }
}
textarea {
  min-height: 40px;
  overflow: auto;
  resize: vertical;
  width: 100%;
}

optgroup {
  color: black;
  font-style: normal;
  font-weight: normal;
  font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
}
optgroup::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.ie6_button,
* html button,
* html a.button {
  background: #dddddd url('/images/button.png?1382606282') repeat-x;
  border: 1px solid;
  border-color: #dddddd #bbbbbb #999999;
  cursor: pointer;
  color: #333333;
  font: bold 12px / 1.2 Arial, sans-serif;
  padding: 2px 10px 0;
  text-decoration: none;
  overflow: visible;
  vertical-align: top;
  width: auto;
}

* html a.button {
  position: relative;
  top: 3px;
  padding-bottom: 2px;
}

* html button {
  padding-top: 1px;
  padding-bottom: 1px;
}

.ie6_input,
* html textarea,
* html select {
  background: white;
  border: 1px solid;
  border-color: #848484 #c1c1c1 #e1e1e1;
  color: black;
  padding: 2px 3px 1px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  vertical-align: top;
}

* html select {
  margin-top: 1px;
}

.placeholder_text,
.ie6_input_disabled,
.ie6_button_disabled {
  color: #888888;
}

.ie6_input_disabled {
  background: #eeeeee;
}

tr.odd.priority-highest,
table.list tbody tr.odd.priority-highest:hover {
  color: #900;
  font-weight: bold;
}

tr.odd.priority-highest {
  background: #ffc4c4;
}

tr.even.priority-highest,
table.list tbody tr.even.priority-highest:hover {
  color: #900;
  font-weight: bold;
}

tr.even.priority-highest {
  background: #ffd4d4;
}

tr.priority-highest a,
tr.priority-highest:hover a {
  color: #900;
}

tr.odd.priority-highest td,
tr.even.priority-highest td {
  border-color: #ffb4b4;
}

tr.odd.priority-high2,
table.list tbody tr.odd.priority-high2:hover {
  color: #900;
}

tr.odd.priority-high2 {
  background: #ffc4c4;
}

tr.even.priority-high2,
table.list tbody tr.even.priority-high2:hover {
  color: #900;
}

tr.even.priority-high2 {
  background: #ffd4d4;
}

tr.priority-high2 a {
  color: #900;
}

tr.odd.priority-high2 td,
tr.even.priority-high2 td {
  border-color: #ffb4b4;
}

tr.odd.priority-high3,
table.list tbody tr.odd.priority-high3:hover {
  color: #900;
}

tr.odd.priority-high3 {
  background: #fee;
}

tr.even.priority-high3,
table.list tbody tr.even.priority-high3:hover {
  color: #900;
}

tr.even.priority-high3 {
  background: #fff2f2;
}

tr.priority-high3 a {
  color: #900;
}

tr.odd.priority-high3 td,
tr.even.priority-high3 td {
  border-color: #fcc;
}

tr.odd.priority-lowest,
table.list tbody tr.odd.priority-lowest:hover {
  color: #559;
}

tr.odd.priority-lowest {
  background: #eaf7ff;
}

tr.even.priority-lowest,
table.list tbody tr.even.priority-lowest:hover {
  color: #559;
}

tr.even.priority-lowest {
  background: #f2faff;
}

tr.priority-lowest a {
  color: #559;
}

tr.odd.priority-lowest td,
tr.even.priority-lowest td {
  border-color: #add7f3;
}

body {
  font: normal 14px/1.5 'Open Sans', sans-serif;
  font-size: 14px;
  color: #484848;
}

h1, h2, h3, h4 {
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
}

a, a:link, a:visited {
  color: #d92e47;
  -webkit-transition: color 0.5s;
  -moz-transition: color 0.5s;
  -o-transition: color 0.5s;
  transition: color 0.5s;
}
a:hover, a:link:hover, a:visited:hover {
  text-decoration: none;
  color: #ed9aa6;
}
th a, th a:link, th a:visited {
  color: #484848;
}

th {
  font-weight: 300;
}

#top-menu {
  background: #2d2d2d;
  height: auto;
  *zoom: 1;
  border-bottom: 1px solid #393939;
}
#top-menu:after {
  content: "";
  display: table;
  clear: both;
}
#top-menu li {
  padding: 0 10px;
}
#top-menu li a {
  font-weight: normal;
  line-height: 2.5;
}
#top-menu #loggedas {
  line-height: 2.5;
}

#header {
  height: auto;
  min-height: 4em;
  background: #202020;
  padding: 14px 17px 0 17px;
}
#header > h1,
#header > h1:before {
  display: inline-block;
}
#header > h1 {
  margin: 0 20px 2px 9px;
}
#header > h1:before {
  content: url("../images/logo.png");
  vertical-align: middle;
  margin: 0 29px 0 0;
}

#quick-search select {
  padding: 5px 15px 5px 5px;
  height: auto;
  margin-left: 8px;
}
#quick-search input {
  background: #2d2d2d;
  border: none;
  color: #FFF;
  padding: 0px 6px;
  height: 2.4em;
  margin-left: 4px;
  display: inline-block;
}
#quick-search label {
  line-height: 2.1;
}

#main-menu {
  position: relative;
  left: 0;
  margin-right: 0;
  *zoom: 1;
}
#main-menu:after {
  content: "";
  display: table;
  clear: both;
}
#main-menu li a {
  font-weight: 300;
  border-top: 3px solid #202020;
  padding: 4px 15px 7px;
  -webkit-transition: border-color 0.5s;
  -moz-transition: border-color 0.5s;
  -o-transition: border-color 0.5s;
  transition: border-color 0.5s;
}
#main-menu li a.selected, #main-menu li a:hover {
  border-top: 3px solid #d92e47;
  background: transparent;
}
#main-menu li a.selected {
  font-weight: 400;
  background: #fff;
}

#main {
  *zoom: 1;
}
#main:after {
  content: "";
  display: table;
  clear: both;
}

#content {
  width: 75%;
  padding: 15px 20px 10px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

#sidebar {
  width: 22%;
  margin-left: 3%;
}
#sidebar h3 {
  margin-top: 23px;
}

div.issue {
  background: #f4f4f4;
  border: none;
  padding: 3px 15px;
}

.subject h3 {
  font-size: 26px;
  line-height: 2;
}

#errorExplanation, div.flash, .nodata, .warning, .conflict {
  border: 1px solid;
  padding: 2px 4px 3px 30px;
}

#update {
  position: fixed;
  width: 80%;
  max-width: 800px;
  max-height: 80%;
  overflow: auto;
  background: #FFF;
  padding: 10px 20px 15px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  margin-left: -40%;
  left: 50%;
  top: 10%;
  z-index: 20;
}
@media (min-width: 1000px) {
  #update {
    margin-left: -400px;
  }
}
#update .update-close {
  float: right;
  border: 1px solid #484848;
  line-height: 0.5;
  font-size: 25px;
  padding: 0 1px 6px;
  font-weight: 300;
  margin-right: -10px;
  cursor: pointer;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  -o-transition: all 0.5s;
  transition: all 0.5s;
}
#update .update-close:hover {
  background-color: #484848;
  color: #fff;
}
#update fieldset.tabular legend {
  cursor: pointer;
  color: #d92e47;
  -webkit-transition: color 0.5s;
  -moz-transition: color 0.5s;
  -o-transition: color 0.5s;
  transition: color 0.5s;
}
#update fieldset.tabular legend:hover {
  color: #ed9aa6;
}
#update fieldset.tabular legend small,
#update fieldset.tabular div,
#update fieldset.tabular p {
  display: none;
}
#update fieldset.tabular.show-children legend small {
  display: inline;
}
#update fieldset.tabular.show-children div,
#update fieldset.tabular.show-children p {
  display: block;
}

input#issue_subject,
input#time_entry_comments,
.tabular textarea {
  width: 98.4%;
  max-width: 99%;
}

select#time_entry_activity_id {
  width: 95.7%;
}

#attachments_fields span {
  white-space: initial;
}
#attachments_fields input {
  width: 30%;
}
#attachments_fields input + input.description, #attachments_fields input + label {
  width: 60%;
}
@media (max-width: 700px) {
  #attachments_fields input + input.description, #attachments_fields input + label {
    display: block;
    margin-left: 0;
  }
}

table.query-columns td.buttons input[type=button] {
  padding: 0;
}


text:
<?php

namespace Explotic\TiersBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Explotic\TiersBundle\Entity\Machine;
use Explotic\TiersBundle\Form\MachineType;

/**
 * Machine controller.
 *
 */
class MachineController extends Controller
{
    /**
     * Lists all Machine entities.
     *
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('ExploticTiersBundle:Machine')->findAll();

        return $this->render('ExploticTiersBundle:Machine:index.html.twig', array(
            'entities' => $entities,
        ));
    }

    /**
     * Finds and displays a Machine entity.
     *
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ExploticTiersBundle:Machine')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Machine entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return $this->render('ExploticTiersBundle:Machine:show.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),        ));
    }

    /**
     * Displays a form to create a new Machine entity.
     *
     */
    public function newAction()
    {
        $entity = new Machine();
        $form   = $this->createForm(new MachineType(), $entity);

        return $this->render('ExploticTiersBundle:Machine:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Creates a new Machine entity.
     *
     */
    public function createAction(Request $request)
    {
        $entity  = new Machine();
        $form = $this->createForm(new MachineType(), $entity);
        $form->bind($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('machine_show', array('id' => $entity->getId())));
        }

        return $this->render('ExploticTiersBundle:Machine:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Displays a form to edit an existing Machine entity.
     *
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ExploticTiersBundle:Machine')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Machine entity.');
        }

        $editForm = $this->createForm(new MachineType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return $this->render('ExploticTiersBundle:Machine:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Edits an existing Machine entity.
     *
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ExploticTiersBundle:Machine')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Machine entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createForm(new MachineType(), $entity);
        $editForm->bind($request);

        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('machine_edit', array('id' => $id)));
        }

        return $this->render('ExploticTiersBundle:Machine:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Deletes a Machine entity.
     *
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->bind($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('ExploticTiersBundle:Machine')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Machine entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('machine'));
    }

    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }
}


text:
package com.twelvemonkeys.servlet;

import java.lang.annotation.*;

/**
 * Annotation to be used by servlets/filters, to have their {@code init}-method
 * automatically convert and set values from their respective configuration.
 *
 * @author Harald Kuhr
 * @author last modified by $Author: haku $
 * @version $Id: InitParam.java#1 $
 * @see com.twelvemonkeys.servlet.ServletConfigurator
 * @see com.twelvemonkeys.servlet.GenericFilter#init(javax.servlet.FilterConfig)
 * @see com.twelvemonkeys.servlet.GenericServlet#init(javax.servlet.ServletConfig)
 * @see com.twelvemonkeys.servlet.HttpServlet#init(javax.servlet.ServletConfig)
 */
// TODO: Actually implement for version 3.0!
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD/*, TODO: ElementType.FIELD*/})
public @interface InitParam {
    static final String UNDEFINED = "";
    String name() default UNDEFINED;
    String defaultValue() default UNDEFINED; // TODO: Consider separate annotation?
    boolean required() default false; // TODO: Consider separate annotation?
}


text:
With type inference, the data type of an expression can be deduced, which allows providing meaningful autocompleter
suggestions or documentation for a class or method.

The type inference strategies below take only the global scope into account (e.g. like when evaluating a simple line on the console).
For longer console input or complete ruby files, one would have to consider nested scopes and visibility of variables by building an abstract syntax tree out of the complete code.

## Forward Evaluation Resolver

    first identifier → token → next token → …

Tries to find the object corresponding to the first identifier, then evaluates subsequent tokens
using introspection where possible.

TokenClassificationByObject:

We have a reference to the exact object in ObjectSpace.

TokenClassificationByClass:

We know the class in ObjectSpace, but we don't have an instance of it.

TokenClassificationByDoc:

Fallback to documentation to know what type a method returns (since Ruby is not
statically
typed, introspection cannot provide the return types). We use statically generated documentation from yardoc. However documentation may sometimes be incomplete and miss return type information.

### Example

```
model = Sketchup.active_model
model.selection
```

1. Search `model` in ObjectSpace
  `TokenClassificationByObject(model, is_instance=true)`

2. Search an identifier `selection` in `Sketchup::Model` → We find a method, but don't know its return type.
  `TokenClassificationByDoc("Sketchup::Model#selection", is_instance=true)`

3. Search `Sketchup::Model#selection` in yardoc documentation → It returns an `Sketchup::Selection`, but we don't have a reference to the exact instance.
  `TokenClassificationByClass(Sketchup::Selection, is_instance=true)`

## Backtracking Resolver

This approach tries to guess the most likely type starting from the last token.
Since a token can be member of multiple classes or objects this results in a tree of possibilities, but it can be narrowed down by matches for the previous tokens.

    … → previous token → last token

1. Last token
   ↓
2. Which types (previous token) respond to that token?
   ↓
3. Which of these types can be returned by previous previous token?

Usually already with two tokens, the possibilities can be reduced to one.

### Example:

```ruby
unknown_reference.entities.length.to_s
```

1. Find classes that have a method `to_s`.
  `Array#to_s`, **`Fixnum#to_s`**, `Float#to_s`, `Hash#to_s`, `NilClass#to_s`…

2. Then find classes that have a method `length` which returns an instance of the former classes.
  `Array#length`, `Hash#length`, **`Sketchup::Entities#length`**, …

3. Then find classes that have a method `entities` and return a `Sketchup::Entities` (or `Array` or `Hash`).
  **`Sketchup::Model#entities`**, **`Sketchup::Model#active_entities`**, **`Sketchup::ComponentDefinition#entities`**,
**`Sketchup::Group#entities`**


text:
define(function(require){
    var app = require('app'),
        image = require('components/image'),
        header = require('components/header'),
        search = require('components/search'),
        footer = require('components/footer'),
        subNav = require('components/subNav');

    /** ng异步载入 */
    app.useModule(['image', 'header', 'search', 'footer','subNav']);

    app.controller('shopList',['$scope',function($scope){

    }]);

});


text:
GmailUnlimited

=======

GmailUnlimited is a tweak that removes the account limit in Gmail, which is usually 5.

Planned Features:

- Remove Gmail's initial alert when entering the application (currently in development)
- Redesign the Gmail App UI (Not started)


text:
__declspec(thread) int LIoThreadId = 0;
IocpManager* GIocpManager = nullptr;

IocpManager::IocpManager() : mCompletionPort(NULL), mIoThreadCount(2), mListenSocket(NULL)
{
}

IocpManager::~IocpManager()
{
}

bool IocpManager::Initialize()
{
	//TODO: mIoThreadCount = ...;GetSystemInfo»ç¿ëÇؼ set num of I/O threads
	SYSTEM_INFO systemInfo = { 0, };
	GetSystemInfo(&systemInfo);
	mIoThreadCount = systemInfo.dwNumberOfProcessors * 2;

	/// winsock initializing
	WSADATA wsa;
	if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
		return false;

	/// Create I/O Completion Port
	//TODO: mCompletionPort = CreateIoCompletionPort(...)
	mCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
	if (NULL == mCompletionPort)
		return false;

	/// create TCP socket
	//TODO: mListenSocket = ...
	mListenSocket = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED);
	if (INVALID_SOCKET == mListenSocket)
		return false;

	SOCKADDR_IN listenAddr = { 0, };
	listenAddr.sin_family = AF_INET;
	listenAddr.sin_addr.s_addr = htonl(INADDR_ANY);
	listenAddr.sin_port = htons(LISTEN_PORT);

	int opt = 1;
	setsockopt(mListenSocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, sizeof(int));

	//TODO:  bind
	if (SOCKET_ERROR == bind(mListenSocket, (SOCKADDR*)&listenAddr, sizeof(listenAddr)))
		return false;

	return true;
}

bool IocpManager::StartIoThreads()
{
	/// I/O Thread
	for (int i = 0; i < mIoThreadCount; ++i)
	{
		DWORD dwThreadId;
		//TODO: HANDLE hThread = (HANDLE)_beginthreadex...);
		for (int i = 0; i < mIoThreadCount; ++i)
		{
			HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, IoWorkerThread, (LPVOID)i, 0, (unsigned int*)&dwThreadId);

			if (hThread == INVALID_HANDLE_VALUE)
				return false;
		}
	}

	return true;
}

bool IocpManager::StartAcceptLoop()
{
	/// listen
	if (SOCKET_ERROR == listen(mListenSocket, SOMAXCONN))
		return false;

	/// accept loop
	while (true)
	{
		SOCKET acceptedSock = accept(mListenSocket, NULL, NULL);

		if (acceptedSock == INVALID_SOCKET)
		{
			printf_s("accept: invalid socket\n");
			continue;
		}

		SOCKADDR_IN clientaddr;
		int addrlen = sizeof(clientaddr);
		getpeername(acceptedSock, (SOCKADDR*)&clientaddr, &addrlen);

		/// ¼ÒÄÏ Á¤º¸ ±¸Á¶Ã¼ ÇÒ´ç°ú ÃʱâÈ
		ClientSession* client = GSessionManager->CreateClientSession(acceptedSock);

		/// Ŭ¶ó Á¢¼Ó ó¸®
		if (false == client->OnConnect(&clientaddr))
		{
			client->Disconnect(DR_ONCONNECT_ERROR);
			GSessionManager->DeleteClientSession(client);
		}
	}

	return true;
}

void IocpManager::Finalize()
{
	CloseHandle(mCompletionPort);

	/// winsock finalizing
	WSACleanup();

}

unsigned int WINAPI IocpManager::IoWorkerThread(LPVOID lpParam)
{
	LThreadType = THREAD_IO_WORKER;

	LIoThreadId = reinterpret_cast<int>(lpParam);
	HANDLE hComletionPort = GIocpManager->GetComletionPort();

	while (true)
	{
		DWORD dwTransferred = 0;
		OverlappedIOContext* context = nullptr;
		ClientSession* asCompletionKey = nullptr;

		int ret = GetQueuedCompletionStatus(hComletionPort
								, &dwTransferred
								, (PULONG_PTR)&asCompletionKey
								, (LPOVERLAPPED*)&context
								, GQCS_TIMEOUT);
		/// check time out first
		if (ret == 0 && GetLastError() == WAIT_TIMEOUT)
			continue;

		if (ret == 0 || dwTransferred == 0)
		{
			/// connection closing
			asCompletionKey->Disconnect(DR_RECV_ZERO);
			GSessionManager->DeleteClientSession(asCompletionKey);
			continue;
		}

		if (nullptr == context)
		{
			asCompletionKey->Disconnect(DR_CONTEXT_ERROR);
			GSessionManager->DeleteClientSession(asCompletionKey);
			continue;
		}

		bool completionOk = true;
		switch (context->mIoType)
		{
		case IO_SEND:
			completionOk = SendCompletion(asCompletionKey, context, dwTransferred);
			break;

		case IO_RECV:
			completionOk = ReceiveCompletion(asCompletionKey, context, dwTransferred);
			break;

		default:
			printf_s("Unknown I/O Type: %d\n", context->mIoType);
			break;
		}

		if ( !completionOk )
		{
			/// connection closing
			asCompletionKey->Disconnect(DR_COMPLETION_ERROR);
			GSessionManager->DeleteClientSession(asCompletionKey);
		}

	}

	return 0;
}

bool IocpManager::ReceiveCompletion(const ClientSession* client, OverlappedIOContext* context, DWORD dwTransferred)
{

	/// echo back ó¸® client->PostSend()»ç¿ë.

	if (false == client->PostSend(context->mBuffer, dwTransferred))
	{
		delete context;
		return false;
	}

	delete context;

	return client->PostRecv();
}

bool IocpManager::SendCompletion(const ClientSession* client, OverlappedIOContext* context, DWORD dwTransferred)
{

	// º¸³¾ µ¥ÀÌÅÍ ¾ç°ú º¸³½ µ¥ÀÌÅÍ ¾çÀÌ ´Ù¸§
	// ±×·±µ¥ ¿Ï·á ÅëÁö·Î ¿ÔÀ½
	// ¿¬°áÀ» ²÷ÀÚ

	if (context->mWsaBuf.len != dwTransferred)
	{
		delete context;
		return false;
	}

	delete context;
	return true;
}


text:
.class public Lcom/android/internal/telephony/gsm/GsmCmasMessage;
.super Lcom/android/internal/telephony/CmasMessage;
.source "GsmCmasMessage.java"

# static fields
.field private static final CHANNEL_AMBER:I = 0x111b

.field private static final CHANNEL_AMBER_ADDITIONAL:I = 0x1128

.field private static final CHANNEL_EXERCISE:I = 0x111d

.field private static final CHANNEL_EXERCISE_ADDITIONAL:I = 0x112a

.field private static final CHANNEL_EXTREME_EXTREME_IMMEDIATE_LIKELY:I = 0x1114

.field private static final CHANNEL_EXTREME_EXTREME_IMMEDIATE_LIKELY_ADDITIONAL:I = 0x1121

.field private static final CHANNEL_EXTREME_EXTREME_IMMEDIATE_OBSERVED:I = 0x1113

.field private static final CHANNEL_EXTREME_EXTREME_IMMEDIATE_OBSERVED_ADDITIONAL:I = 0x1120

.field private static final CHANNEL_OPERATOR_DEFINED:I = 0x111e

.field private static final CHANNEL_OPERATOR_DEFINED_ADDITIONAL:I = 0x112b

.field private static final CHANNEL_PRESIDENTIAL:I = 0x1112

.field private static final CHANNEL_PRESIDENTIAL_ADDITIONAL:I = 0x111f

.field private static final CHANNEL_SEVERE_EXTREME_EXPECTED_LIKELY:I = 0x1116

.field private static final CHANNEL_SEVERE_EXTREME_EXPECTED_LIKELY_ADDITIONAL:I = 0x1123

.field private static final CHANNEL_SEVERE_EXTREME_EXPECTED_OBSERVED:I = 0x1115

.field private static final CHANNEL_SEVERE_EXTREME_EXPECTED_OBSERVED_ADDITIONAL:I = 0x1122

.field private static final CHANNEL_SEVERE_SEVERE_EXPECTED_LIKELY:I = 0x111a

.field private static final CHANNEL_SEVERE_SEVERE_EXPECTED_LIKELY_ADDITIONAL:I = 0x1127

.field private static final CHANNEL_SEVERE_SEVERE_EXPECTED_OBSERVED:I = 0x1119

.field private static final CHANNEL_SEVERE_SEVERE_EXPECTED_OBSERVED_ADDITIONAL:I = 0x1126

.field private static final CHANNEL_SEVERE_SEVERE_IMMEDIATE_LIKELY:I = 0x1118

.field private static final CHANNEL_SEVERE_SEVERE_IMMEDIATE_LIKELY_ADDITIONAL:I = 0x1125

.field private static final CHANNEL_SEVERE_SEVERE_IMMEDIATE_OBSERVED:I = 0x1117

.field private static final CHANNEL_SEVERE_SEVERE_IMMEDIATE_OBSERVED_ADDITIONAL:I = 0x1124

.field private static final CHANNEL_TEST_MONTHLY:I = 0x111c

.field private static final CHANNEL_TEST_MONTHLY_ADDITIONAL:I = 0x1129

.field private static final LOG_TAG:Ljava/lang/String; = "GSM"

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 88
    invoke-direct {p0}, Lcom/android/internal/telephony/CmasMessage;-><init>()V

    .line 89
    const/4 v0, 0x1

    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasFormat:I

    .line 90
    return-void
.end method

.method public static getCertainty(I)Ljava/lang/String;
    .locals 2
    .param p0, "msgId"    # I

    .prologue
    .line 269
    invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;

    move-result-object v0

    .line 270
    .local v0, "r":Landroid/content/res/Resources;
    packed-switch p0, :pswitch_data_0

    .line 290
    :pswitch_0
    const/4 v1, 0x0

    :goto_0
    return-object v1

    .line 279
    :pswitch_1
    const v1, 0x3070152

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 288
    :pswitch_2
    const v1, 0x3070153

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 270
    nop

    :pswitch_data_0
    .packed-switch 0x1113
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method public static getSeverity(I)Ljava/lang/String;
    .locals 2
    .param p0, "msgId"    # I

    .prologue
    .line 207
    invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;

    move-result-object v0

    .line 208
    .local v0, "r":Landroid/content/res/Resources;
    packed-switch p0, :pswitch_data_0

    .line 228
    :pswitch_0
    const/4 v1, 0x0

    :goto_0
    return-object v1

    .line 217
    :pswitch_1
    const v1, 0x307014e

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 226
    :pswitch_2
    const v1, 0x307014f

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 208
    nop

    :pswitch_data_0
    .packed-switch 0x1113
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
        :pswitch_2
        :pswitch_2
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
        :pswitch_2
        :pswitch_2
    .end packed-switch
.end method

.method public static getUrgency(I)Ljava/lang/String;
    .locals 2
    .param p0, "msgId"    # I

    .prologue
    .line 238
    invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;

    move-result-object v0

    .line 239
    .local v0, "r":Landroid/content/res/Resources;
    packed-switch p0, :pswitch_data_0

    .line 259
    :pswitch_0
    const/4 v1, 0x0

    :goto_0
    return-object v1

    .line 248
    :pswitch_1
    const v1, 0x3070150

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 257
    :pswitch_2
    const v1, 0x3070151

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 239
    nop

    :pswitch_data_0
    .packed-switch 0x1113
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_2
    .end packed-switch
.end method

.method private setCmasType(I)V
    .locals 4
    .param p1, "channel"    # I

    .prologue
    const/4 v3, 0x2

    const/4 v2, 0x3

    const/4 v1, 0x0

    const/4 v0, 0x1

    .line 121
    packed-switch p1, :pswitch_data_0

    .line 198
    :goto_0
    :pswitch_0
    return-void

    .line 124
    :pswitch_1
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    goto :goto_0

    .line 128
    :pswitch_2
    iput v3, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 129
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 130
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 131
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 135
    :pswitch_3
    iput v3, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 136
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 137
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 138
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 142
    :pswitch_4
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 143
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 144
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 145
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 149
    :pswitch_5
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 150
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 151
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 152
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 156
    :pswitch_6
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 157
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 158
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 159
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 163
    :pswitch_7
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 164
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 165
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 166
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 170
    :pswitch_8
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 171
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 172
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 173
    iput v1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 177
    :pswitch_9
    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    .line 178
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->severity:I

    .line 179
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->urgency:I

    .line 180
    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->certainty:I

    goto :goto_0

    .line 184
    :pswitch_a
    const/4 v0, 0x4

    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    goto :goto_0

    .line 188
    :pswitch_b
    const/4 v0, 0x5

    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    goto :goto_0

    .line 192
    :pswitch_c
    const/4 v0, 0x6

    iput v0, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasType:I

    goto :goto_0

    .line 121
    nop

    :pswitch_data_0
    .packed-switch 0x1112
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
        :pswitch_6
        :pswitch_7
        :pswitch_8
        :pswitch_9
        :pswitch_a
        :pswitch_b
        :pswitch_c
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
        :pswitch_6
        :pswitch_7
        :pswitch_8
        :pswitch_9
        :pswitch_a
        :pswitch_b
        :pswitch_c
    .end packed-switch
.end method

# virtual methods
.method public parseGsmPdu([B)V
    .locals 4
    .param p1, "pdu"    # [B

    .prologue
    .line 99
    :try_start_0
    new-instance v0, Lcom/android/internal/telephony/gsm/CBMessage;

    invoke-direct {v0}, Lcom/android/internal/telephony/gsm/CBMessage;-><init>()V

    .line 100
    .local v0, "cb":Lcom/android/internal/telephony/gsm/CBMessage;
    invoke-virtual {v0, p1}, Lcom/android/internal/telephony/gsm/CBMessage;->parseCBPdu([B)V

    .line 101
    const/4 v2, 0x1

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->cmasFormat:I

    .line 102
    iput-object p1, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->mPdu:[B

    .line 103
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->sn:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->sn:I

    .line 104
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->gs:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->gs:I

    .line 105
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->msg_id:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->msgId:I

    .line 106
    invoke-virtual {v0}, Lcom/android/internal/telephony/gsm/CBMessage;->getMessageClass()Landroid/telephony/SmsMessage$MessageClass;

    move-result-object v2

    iput-object v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->messageClass:Landroid/telephony/SmsMessage$MessageClass;

    .line 107
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->page:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->pageSeg:I

    .line 108
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->pages:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->pageCount:I

    .line 109
    iget v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->mEncodingType:I

    iput v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->charSetEncoding:I

    .line 110
    iget-boolean v2, v0, Lcom/android/internal/telephony/gsm/CBMessage;->mEncodingTypeSet:Z

    iput-boolean v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->charSetEncodingSet:Z

    .line 111
    invoke-virtual {v0}, Lcom/android/internal/telephony/gsm/CBMessage;->getUserData()[B

    move-result-object v2

    iput-object v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->alertText:[B

    .line 112
    invoke-virtual {v0}, Lcom/android/internal/telephony/gsm/CBMessage;->getMessageBody()Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->alertTextStr:Ljava/lang/String;

    .line 113
    iget v2, p0, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->msgId:I

    invoke-direct {p0, v2}, Lcom/android/internal/telephony/gsm/GsmCmasMessage;->setCmasType(I)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    .line 118
    .end local v0    # "cb":Lcom/android/internal/telephony/gsm/CBMessage;
    :goto_0
    return-void

    .line 115
    :catch_0
    move-exception v1

    .line 116
    .local v1, "ex":Ljava/lang/Throwable;
    const-string v2, "GSM"

    const-string v3, "gsm cb parsing failed: "

    invoke-static {v2, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method


text:
<?php

namespace LeoAndLeo\ToDoListBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use LeoAndLeo\ToDoListBundle\Entity\ItemList;
use LeoAndLeo\ToDoListBundle\Form\ItemListType;

class ItemGoogleController extends Controller {

    public function itemIdAction($id, $idItem) {
        $client = $this->get('leo_and_leo_google.item_list_client');

        $item = $client->get($id, $idItem);
        if($item == null || ($item->getMainlist()->getId() != $id)) {
            throw new NotFoundHttpException();
        }

        $request = $this->get('request');
        if($request->getMethod() == 'POST'){
            if($request->request->get('done')) {
                $item->inverseDone();
                $item = $client->update($id, $item);
            }
        }

        return $this->render('LeoAndLeoToDoListBundle:Google:itemid.html.twig', array('item' => $item));
    }

    public function itemAddAction($id) {
        $client = $this->get('leo_and_leo_google.main_list_client');

        $list = $client->get($id);
        if(!$list) {
            throw new NotFoundHttpException();
        }

        // Creation of the form
        $item = new ItemList();
        $form = $this->createForm(new ItemListType(), $item);

        // Exploitation of the form
        $request = $this->get('request');
        if($request->getMethod() == 'POST'){
            $form->handleRequest($request);
            if($form->isValid()){
                $item->setMainlist($list);
                $client = $this->get('leo_and_leo_google.item_list_client');
                $item = $client->insert($id, $item);
                return $this->redirect($this->generateUrl('leo_and_leo_to_do_list.item_google_item_id', array('id' => $id, 'idItem' => $item->getId())));
            }
        }

        return $this->render('LeoAndLeoToDoListBundle:Google:itemadd.html.twig', array('form' => $form->createView()));
    }

    public function itemEditAction($id,$idItem) {
        $client = $this->get('leo_and_leo_google.item_list_client');

        $item = $client->get($id, $idItem);
        if($item == null || ($item->getMainlist()->getId() != $id)) {
            throw new NotFoundHttpException();
        }

        // Creation of the form
        $form = $this->createForm(new ItemListType(), $item);

        // Exploitation of the form
        $request = $this->get('request');
        if($request->getMethod() == 'POST'){
            $form->handleRequest($request);
            if($form->isValid()){
                $item = $client->update($id, $item);
                return $this->redirect($this->generateUrl('leo_and_leo_to_do_list.item_google_item_id', array('id' => $id, 'idItem' => $item->getId())));
            }
        }

        return $this->render('LeoAndLeoToDoListBundle:Google:itemedit.html.twig', array('form' => $form->createView()));
    }

    public function itemRemoveAction($id,$idItem) {
        $client = $this->get('leo_and_leo_google.item_list_client');

        $item = $client->get($id, $idItem);
        if($item == null || ($item->getMainlist()->getId() != $id)) {
            throw new NotFoundHttpException();
        }

        $request = $this->get('request');
        if($request->getMethod() == 'POST') {
            if($request->request->get('remove')) {
                $client->delete($id, $idItem);
                return $this->redirect($this->generateUrl('leo_and_leo_to_do_list.list_google_list_id', array('id' => $id)));
            }
        }

        return $this->render('LeoAndLeoToDoListBundle:Google:itemremove.html.twig');
    }
}


text:
DROP INDEX xml_tree_values_result_path_idx;

DROP TABLE xml_tree_values;


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.arrow.appmenu01opciones.MainActivity"
    android:orientation="horizontal">

    <Button
        android:text="Cambiar Menu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/button_cambiar"
        android:layout_weight="1" />
</LinearLayout>


text:
<?php
namespace CpPress\Application\FrontEnd;

use \Commonhelp\WP\WPController;
use CpPress\Application\WP\Hook\Filter;
use Commonhelp\App\Http\RequestInterface;

class FrontPageController extends WPController{

	private $filter;
	private $widgets;

	public function __construct($appName, RequestInterface $request, $templateDirs = array(), Filter $frontEndFilter, $widgets){
		parent::__construct($appName, $request, $templateDirs);
		$this->filter = $frontEndFilter;
		$this->widgets = $widgets;
	}

	public function layout($post, $layout){
		$layout_data = $this->filter->apply( 'cppress_layout_data', $layout, $post->ID );
		if(empty($layout_data) || empty($layout_data['sections'])){
			return null; /* HANDLE WP ERROR EXCEPTION */
		}

		$sections = array();
		foreach($layout_data['sections'] as $skey => $section){
			$skey = intval($skey);
			$sections[$skey] = array(
				'data' => $section
			);
		}

		foreach($layout_data['grids'] as $gkey => $grid){
			$gkey = intval($gkey);
			$sections[$grid['section']][] = array(
				'data' => $grid
			);
		}

		foreach($layout_data['cells'] as $ckey => $cell){
			$ckey = intval($ckey);
			$sections[$cell['section']][$cell['grid']][] = array(
					'data' => $cell
			);
		}

		foreach($layout_data['widgets'] as $wkey => $widget){
			$sections
			[ intval($widget['widget_info']['section']) ]
			[ intval($widget['widget_info']['grid']) ]
			[ intval($widget['widget_info']['cell']) ][] = $widget;
		}
		$this->assign('sections', $sections);
		$this->assign('layout_data', $layout_data);
		$this->assign('filter', $this->filter);
		$this->assign('widgetsFactory', $this->makeWidgetsFactory());
		$this->assign('post', $post);
	}

	private function makeWidgetsFactory()
    {
        $widgetFactory = [];
        foreach($this->widgets as $className => $widget){
           $widgetFactory[str_replace('\\', '', $className)] = $widget;
        }

        return $widgetFactory;
    }

}


text:
process.throwDeprecation = true

const electron = require('electron')
const app = electron.app
const crashReporter = electron.crashReporter
const ipcMain = electron.ipcMain
const dialog = electron.dialog
const BrowserWindow = electron.BrowserWindow
const protocol = electron.protocol
const webContents = electron.webContents
const v8 = require('v8')

const Coverage = require('electabul').Coverage
const fs = require('fs')
const path = require('path')
const url = require('url')
const util = require('util')

var argv = require('yargs')
  .boolean('ci')
  .string('g').alias('g', 'grep')
  .boolean('i').alias('i', 'invert')
  .argv

var window = null
process.port = 0 // will be used by crash-reporter spec.

v8.setFlagsFromString('--expose_gc')
app.commandLine.appendSwitch('js-flags', '--expose_gc')
app.commandLine.appendSwitch('ignore-certificate-errors')
app.commandLine.appendSwitch('disable-renderer-backgrounding')

// Accessing stdout in the main process will result in the process.stdout
// throwing UnknownSystemError in renderer process sometimes. This line makes
// sure we can reproduce it in renderer process.
process.stdout

// Access console to reproduce #3482.
console

ipcMain.on('message', function (event, ...args) {
  event.sender.send('message', ...args)
})

// Set productName so getUploadedReports() uses the right directory in specs
if (process.platform !== 'darwin') {
  crashReporter.productName = 'Zombies'
}

// Write output to file if OUTPUT_TO_FILE is defined.
const outputToFile = process.env.OUTPUT_TO_FILE
const print = function (_, args) {
  let output = util.format.apply(null, args)
  if (outputToFile) {
    fs.appendFileSync(outputToFile, output + '\n')
  } else {
    console.error(output)
  }
}
ipcMain.on('console.log', print)
ipcMain.on('console.error', print)

ipcMain.on('process.exit', function (event, code) {
  process.exit(code)
})

ipcMain.on('eval', function (event, script) {
  event.returnValue = eval(script) // eslint-disable-line
})

ipcMain.on('echo', function (event, msg) {
  event.returnValue = msg
})

const coverage = new Coverage({
  outputPath: path.join(__dirname, '..', '..', 'out', 'coverage')
})
coverage.setup()

ipcMain.on('get-main-process-coverage', function (event) {
  event.returnValue = global.__coverage__ || null
})

global.isCi = !!argv.ci
if (global.isCi) {
  process.removeAllListeners('uncaughtException')
  process.on('uncaughtException', function (error) {
    console.error(error, error.stack)
    process.exit(1)
  })
}

// Register app as standard scheme.
global.standardScheme = 'app'
protocol.registerStandardSchemes([global.standardScheme], { secure: true })

app.on('window-all-closed', function () {
  app.quit()
})

app.on('ready', function () {
  // Test if using protocol module would crash.
  electron.protocol.registerStringProtocol('test-if-crashes', function () {})

  // Send auto updater errors to window to be verified in specs
  electron.autoUpdater.on('error', function (error) {
    window.send('auto-updater-error', error.message)
  })

  window = new BrowserWindow({
    title: 'Electron Tests',
    show: !global.isCi,
    width: 800,
    height: 600,
    webPreferences: {
      backgroundThrottling: false
    }
  })
  window.loadURL(url.format({
    pathname: path.join(__dirname, '/index.html'),
    protocol: 'file',
    query: {
      grep: argv.grep,
      invert: argv.invert ? 'true' : ''
    }
  }))
  window.on('unresponsive', function () {
    var chosen = dialog.showMessageBox(window, {
      type: 'warning',
      buttons: ['Close', 'Keep Waiting'],
      message: 'Window is not responsing',
      detail: 'The window is not responding. Would you like to force close it or just keep waiting?'
    })
    if (chosen === 0) window.destroy()
  })

  // For session's download test, listen 'will-download' event in browser, and
  // reply the result to renderer for verifying
  var downloadFilePath = path.join(__dirname, '..', 'fixtures', 'mock.pdf')
  ipcMain.on('set-download-option', function (event, needCancel, preventDefault, filePath = downloadFilePath) {
    window.webContents.session.once('will-download', function (e, item) {
      window.webContents.send('download-created',
        item.getState(),
        item.getURLChain(),
        item.getMimeType(),
        item.getReceivedBytes(),
        item.getTotalBytes(),
        item.getFilename(),
        item.getSavePath())
      if (preventDefault) {
        e.preventDefault()
        const url = item.getURL()
        const filename = item.getFilename()
        setImmediate(function () {
          try {
            item.getURL()
          } catch (err) {
            window.webContents.send('download-error', url, filename, err.message)
          }
        })
      } else {
        if (item.getState() === 'interrupted' && !needCancel) {
          item.resume()
        } else {
          item.setSavePath(filePath)
        }
        item.on('done', function (e, state) {
          window.webContents.send('download-done',
            state,
            item.getURL(),
            item.getMimeType(),
            item.getReceivedBytes(),
            item.getTotalBytes(),
            item.getContentDisposition(),
            item.getFilename(),
            item.getSavePath(),
            item.getURLChain(),
            item.getLastModifiedTime(),
            item.getETag())
        })
        if (needCancel) item.cancel()
      }
    })
    event.returnValue = 'done'
  })

  ipcMain.on('prevent-next-input-event', (event, key, id) => {
    webContents.fromId(id).once('before-input-event', (event, input) => {
      if (key === input.key) event.preventDefault()
    })
  })

  ipcMain.on('executeJavaScript', function (event, code, hasCallback) {
    if (hasCallback) {
      window.webContents.executeJavaScript(code, (result) => {
        window.webContents.send('executeJavaScript-response', result)
      }).then((result) => {
        window.webContents.send('executeJavaScript-promise-response', result)
      }).catch((err) => {
        window.webContents.send('executeJavaScript-promise-error', err)
      })
    } else {
      window.webContents.executeJavaScript(code)
      event.returnValue = 'success'
    }
  })
})

ipcMain.on('set-client-certificate-option', function (event, skip) {
  app.once('select-client-certificate', function (event, webContents, url, list, callback) {
    event.preventDefault()
    if (skip) {
      callback()
    } else {
      ipcMain.on('client-certificate-response', function (event, certificate) {
        callback(certificate)
      })
      window.webContents.send('select-client-certificate', webContents.id, list)
    }
  })
  event.returnValue = 'done'
})

ipcMain.on('close-on-will-navigate', (event, id) => {
  const contents = event.sender
  const window = BrowserWindow.fromId(id)
  window.webContents.once('will-navigate', (event, input) => {
    window.close()
    contents.send('closed-on-will-navigate')
  })
})

ipcMain.on('create-window-with-options-cycle', (event) => {
  // This can't be done over remote since cycles are already
  // nulled out at the IPC layer
  const foo = {}
  foo.bar = foo
  foo.baz = {
    hello: {
      world: true
    }
  }
  foo.baz2 = foo.baz
  const window = new BrowserWindow({show: false, foo: foo})
  event.returnValue = window.id
})


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <camelContext id="first" xmlns="http://camel.apache.org/schema/spring">
        <route id="first-route">
            <from uri="direct:inbound"/>
            <setHeader headerName="context">
                <constant>first</constant>
            </setHeader>
            <to uri="mock:outbound"/>
        </route>
    </camelContext>

    <camelContext id="second">

    </camelContext>

</beans>


text:
<?php

namespace Distill\Tests\Method\Command;

use Distill\Method;
use Distill\Format;
use Distill\Tests\Method\AbstractMethodTest;

class Bzip2CommandMethodTest extends AbstractMethodTest
{

    public function setUp()
    {
        $this->method = new Method\Command\Bzip2();

        if (false === $this->method->isSupported()) {
            $this->markTestSkipped('The bzip2 command is not installed');
        }

        parent::setUp();
    }

    public function testExtractCorrectBz2File()
    {
        $target = $this->getTemporaryPath();
        $this->clearTemporaryPath();

        $response = $this->extract('file_ok.bz2', $target, new Format\Bz2());

        $this->assertTrue($response);
        $this->clearTemporaryPath();
    }

    public function testExtractFakeBz2File()
    {
        $target = $this->getTemporaryPath();
        $this->clearTemporaryPath();

        $response = $this->extract('file_fake.bz2', $target, new Format\Bz2());

        $this->assertFalse($response);
        $this->clearTemporaryPath();
    }

    public function testExtractNoBz2File()
    {
        $this->setExpectedException('Distill\\Exception\\Method\\FormatNotSupportedInMethodException');

        $target = $this->getTemporaryPath();
        $this->clearTemporaryPath();

        $this->extract('file_ok.cab', $target, new Format\Cab());
    }

}


text:
Template.managePropertySpaces.events({
  "click #manage-property-add-space": function(event, template){
    FlowRouter.go(newSpacePath(template.data._id))
  }
});


text:
package com.fuyoul.sanwenseller.im.session.widgets;

import android.view.View;

/**
* Created by hzlichengda on 14-3-31.
*/
public interface ToggleListener {
    void toggleOn(View v);
    void toggleOff(View v);
    void toggleDisable(View v);
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Monogr. Discom. Bohem. (Prague) 129 (1934)

#### Original name
Belonidium secalinum Velen.

### Remarks
null


text:
"""
Mixin functionality for experiments, tests, and simulations.
This includes recordings measures used to generate plots in JC's thesis.
"""
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import six
import utool as ut
import ubelt as ub
import pandas as pd
import itertools as it
from ibeis.algo.graph import nx_utils as nxu
from ibeis.algo.graph.state import (POSTV, NEGTV, INCMP, UNREV, UNKWN, NULL)
print, rrr, profile = ut.inject2(__name__)

class SimulationHelpers(object):
    def init_simulation(infr, oracle_accuracy=1.0, k_redun=2,
                        enable_autoreview=True, enable_inference=True,
                        classifiers=None, match_state_thresh=None,
                        max_outer_loops=None, name=None):
        infr.print('INIT SIMULATION', color='yellow')

        infr.name = name
        infr.simulation_mode = True

        infr.verifiers = classifiers
        infr.params['inference.enabled'] = enable_inference
        infr.params['autoreview.enabled'] = enable_autoreview

        infr.params['redun.pos'] = k_redun
        infr.params['redun.neg'] = k_redun

        # keeps track of edges where the decision != the groundtruth
        infr.mistake_edges = set()

        infr.queue = ut.PriorityQueue()

        infr.oracle = UserOracle(oracle_accuracy, rng=infr.name)

        if match_state_thresh is None:
            match_state_thresh = {
                POSTV: 1.0,
                NEGTV: 1.0,
                INCMP: 1.0,
            }

        pb_state_thresh = None
        if pb_state_thresh is None:
            pb_state_thresh = {
                'pb': .5,
                'notpb': .9,
            }

        infr.task_thresh = {
            'photobomb_state': pd.Series(pb_state_thresh),
            'match_state': pd.Series(match_state_thresh)
        }
        infr.params['algo.max_outer_loops'] = max_outer_loops

    def init_test_mode(infr):
        from ibeis.algo.graph import nx_dynamic_graph
        infr.print('init_test_mode')
        infr.test_mode = True
        # infr.edge_truth = {}
        infr.metrics_list = []
        infr.test_state = {
            'n_decision': 0,
            'n_algo': 0,
            'n_manual': 0,
            'n_true_merges': 0,
            'n_error_edges': 0,
            'confusion': None,
        }
        infr.test_gt_pos_graph = nx_dynamic_graph.DynConnGraph()
        infr.test_gt_pos_graph.add_nodes_from(infr.aids)
        infr.nid_to_gt_cc = ut.group_items(infr.aids, infr.orig_name_labels)
        infr.node_truth = ut.dzip(infr.aids, infr.orig_name_labels)

        # infr.real_n_pcc_mst_edges = sum(
        #     len(cc) - 1 for cc in infr.nid_to_gt_cc.values())
        # ut.cprint('real_n_pcc_mst_edges = %r' % (
        #     infr.real_n_pcc_mst_edges,), 'red')

        infr.metrics_list = []
        infr.nid_to_gt_cc = ut.group_items(infr.aids, infr.orig_name_labels)
        infr.real_n_pcc_mst_edges = sum(
            len(cc) - 1 for cc in infr.nid_to_gt_cc.values())
        infr.print('real_n_pcc_mst_edges = %r' % (
            infr.real_n_pcc_mst_edges,), color='red')

    def measure_error_edges(infr):
        for edge, data in infr.edges(data=True):
            true_state = data['truth']
            pred_state = data.get('evidence_decision', UNREV)
            if pred_state != UNREV:
                if true_state != pred_state:
                    error = ut.odict([('real', true_state),
                                      ('pred', pred_state)])
                    yield edge, error

    @profile
    def measure_metrics(infr):
        real_pos_edges = []

        n_true_merges = infr.test_state['n_true_merges']
        confusion = infr.test_state['confusion']

        n_tp = confusion[POSTV][POSTV]
        confusion[POSTV]
        columns = set(confusion.keys())
        reviewd_cols = columns - {UNREV}
        non_postv = reviewd_cols - {POSTV}
        non_negtv = reviewd_cols - {NEGTV}

        n_fn = sum(ut.take(confusion[POSTV], non_postv))
        n_fp = sum(ut.take(confusion[NEGTV], non_negtv))

        n_error_edges = sum(confusion[r][c] + confusion[c][r] for r, c in
                            ut.combinations(reviewd_cols, 2))
        # assert n_fn + n_fp == n_error_edges

        pred_n_pcc_mst_edges = n_true_merges

        if 0:
            import ubelt as ub
            for timer in ub.Timerit(10):
                with timer:
                    # Find undetectable errors
                    num_undetectable_fn = 0
                    for nid1, nid2 in infr.neg_redun_metagraph.edges():
                        cc1 = infr.pos_graph.component(nid1)
                        cc2 = infr.pos_graph.component(nid2)
                        neg_edges = nxu.edges_cross(infr.neg_graph, cc1, cc2)
                        for u, v in neg_edges:
                            real_nid1 = infr.node_truth[u]
                            real_nid2 = infr.node_truth[v]
                            if real_nid1 == real_nid2:
                                num_undetectable_fn += 1
                                break

                    # Find undetectable errors
                    num_undetectable_fp = 0
                    for nid in infr.pos_redun_nids:
                        cc = infr.pos_graph.component(nid)
                        if not ut.allsame(ut.take(infr.node_truth, cc)):
                            num_undetectable_fp += 1

            print('num_undetectable_fn = %r' % (num_undetectable_fn,))
            print('num_undetectable_fp = %r' % (num_undetectable_fp,))

        if 0:
            n_error_edges2 = 0
            n_fn2 = 0
            n_fp2 = 0
            for edge, data in infr.edges(data=True):
                decision = data.get('evidence_decision', UNREV)
                true_state = infr.edge_truth[edge]
                if true_state == decision and true_state == POSTV:
                    real_pos_edges.append(edge)
                elif decision != UNREV:
                    if true_state != decision:
                        n_error_edges2 += 1
                        if true_state == POSTV:
                            n_fn2 += 1
                        elif true_state == NEGTV:
                            n_fp2 += 1
            assert n_error_edges2 == n_error_edges
            assert n_tp == len(real_pos_edges)
            assert n_fn == n_fn2
            assert n_fp == n_fp2
            # pred_n_pcc_mst_edges2 = sum(
            #     len(cc) - 1 for cc in infr.test_gt_pos_graph.connected_components()
            # )
        if False:
            import networkx as nx
            # set(infr.test_gt_pos_graph.edges()) == set(real_pos_edges)
            pred_n_pcc_mst_edges = 0
            for cc in nx.connected_components(nx.Graph(real_pos_edges)):
                pred_n_pcc_mst_edges += len(cc) - 1
            assert n_true_merges == pred_n_pcc_mst_edges

        # Find all annotations involved in a mistake
        assert n_error_edges == len(infr.mistake_edges)
        direct_mistake_aids = {a for edge in infr.mistake_edges for a in edge}
        mistake_nids = set(infr.node_labels(*direct_mistake_aids))
        mistake_aids = set(ut.flatten([infr.pos_graph.component(nid)
                                       for nid in mistake_nids]))

        pos_acc = pred_n_pcc_mst_edges / infr.real_n_pcc_mst_edges
        metrics = {
            'n_decision': infr.test_state['n_decision'],
            'n_manual': infr.test_state['n_manual'],
            'n_algo': infr.test_state['n_algo'],
            'phase': infr.loop_phase,
            'pos_acc': pos_acc,
            'n_merge_total': infr.real_n_pcc_mst_edges,
            'n_merge_remain': infr.real_n_pcc_mst_edges - n_true_merges,
            'n_true_merges': n_true_merges,
            'recovering': infr.is_recovering(),
            # 'recovering2': infr.test_state['recovering'],
            'merge_remain': 1 - pos_acc,
            'n_mistake_aids': len(mistake_aids),
            'frac_mistake_aids': len(mistake_aids) / len(infr.aids),
            'n_mistake_nids': len(mistake_nids),
            'n_errors': n_error_edges,
            'n_fn': n_fn,
            'n_fp': n_fp,
            'refresh_support': len(infr.refresh.manual_decisions),
            'pprob_any': infr.refresh.prob_any_remain(),
            'mu': infr.refresh._ewma,
            'test_action': infr.test_state['test_action'],
            'action': infr.test_state.get('action', None),
            'user_id': infr.test_state['user_id'],
            'pred_decision': infr.test_state['pred_decision'],
            'true_decision': infr.test_state['true_decision'],
            'n_neg_redun': infr.neg_redun_metagraph.number_of_edges(),
            'n_neg_redun1': (infr.neg_metagraph.number_of_edges() -
                             infr.neg_metagraph.number_of_selfloops()),
        }

        return metrics

    def _print_previous_loop_statistics(infr, count):
        # Print stats about what happend in the this loop
        history = infr.metrics_list[-count:]
        recover_blocks = ut.group_items([
            (k, sum(1 for i in g))
            for k, g in it.groupby(ut.take_column(history, 'recovering'))
        ]).get(True, [])
        infr.print((
            'Recovery mode entered {} times, '
            'made {} recovery decisions.').format(
                len(recover_blocks), sum(recover_blocks)), color='green')
        testaction_hist = ut.dict_hist(ut.take_column(history, 'test_action'))
        infr.print(
            'Test Action Histogram: {}'.format(
                ut.repr4(testaction_hist, si=True)), color='yellow')
        if infr.params['inference.enabled']:
            action_hist = ut.dict_hist(
                ut.emap(frozenset, ut.take_column(history, 'action')))
            infr.print(
                'Inference Action Histogram: {}'.format(
                    ub.repr2(action_hist, si=True)), color='yellow')
        infr.print(
            'Decision Histogram: {}'.format(ut.repr2(ut.dict_hist(
                ut.take_column(history, 'pred_decision')
            ), si=True)), color='yellow')
        infr.print(
            'User Histogram: {}'.format(ut.repr2(ut.dict_hist(
                ut.take_column(history, 'user_id')
            ), si=True)), color='yellow')

    @profile
    def _dynamic_test_callback(infr, edge, decision, prev_decision, user_id):
        was_gt_pos = infr.test_gt_pos_graph.has_edge(*edge)

        # prev_decision = infr.get_edge_attr(edge, 'decision', default=UNREV)
        # prev_decision = list(infr.edge_decision_from([edge]))[0]

        true_decision = infr.edge_truth[edge]

        was_within_pred = infr.pos_graph.are_nodes_connected(*edge)
        was_within_gt = infr.test_gt_pos_graph.are_nodes_connected(*edge)
        was_reviewed = prev_decision != UNREV
        is_within_gt = was_within_gt
        was_correct = prev_decision == true_decision

        is_correct = true_decision == decision
        # print('prev_decision = {!r}'.format(prev_decision))
        # print('decision = {!r}'.format(decision))
        # print('true_decision = {!r}'.format(true_decision))

        test_print = ut.partial(infr.print, level=2)
        def test_print(x, **kw):
            infr.print('[ACTION] ' + x, level=2, **kw)
        # test_print = lambda *a, **kw: None  # NOQA

        if 0:
            num = infr.recover_graph.number_of_components()
            old_data = infr.get_nonvisual_edge_data(edge)
            # print('old_data = %s' % (ut.repr4(old_data, stritems=True),))
            print('n_prev_reviews = %r' % (old_data['num_reviews'],))
            print('prev_decision = %r' % (prev_decision,))
            print('decision = %r' % (decision,))
            print('was_gt_pos = %r' % (was_gt_pos,))
            print('was_within_pred = %r' % (was_within_pred,))
            print('was_within_gt = %r' % (was_within_gt,))
            print('num inconsistent = %r' % (num,))
            # is_recovering = infr.is_recovering()

        if decision == POSTV:
            if is_correct:
                if not was_gt_pos:
                    infr.test_gt_pos_graph.add_edge(*edge)
        elif was_gt_pos:
            test_print("UNDID GOOD POSITIVE EDGE", color='darkred')
            infr.test_gt_pos_graph.remove_edge(*edge)
            is_within_gt = infr.test_gt_pos_graph.are_nodes_connected(*edge)

        split_gt = is_within_gt != was_within_gt
        if split_gt:
            test_print("SPLIT A GOOD MERGE", color='darkred')
            infr.test_state['n_true_merges'] -= 1

        confusion = infr.test_state['confusion']
        if confusion is None:
            # initialize dynamic confusion matrix
            # import pandas as pd
            states = (POSTV, NEGTV, INCMP, UNREV, UNKWN)
            confusion = {r: {c: 0 for c in states} for r in states}
            # pandas takes a really long time doing this
            # confusion = pd.DataFrame(columns=states, index=states)
            # confusion[:] = 0
            # confusion.index.name = 'real'
            # confusion.columns.name = 'pred'
            infr.test_state['confusion'] = confusion

        if was_reviewed:
            confusion[true_decision][prev_decision] -= 1
            confusion[true_decision][decision] += 1
        else:
            confusion[true_decision][decision] += 1

        test_action = None
        action_color = None

        if is_correct:
            # CORRECT DECISION
            if was_reviewed:
                if prev_decision == decision:
                    test_action = 'correct duplicate'
                    action_color = 'darkyellow'
                else:
                    infr.mistake_edges.remove(edge)
                    test_action = 'correction'
                    action_color = 'darkgreen'
                    if decision == POSTV:
                        if not was_within_gt:
                            test_action = 'correction redid merge'
                            action_color = 'darkgreen'
                            infr.test_state['n_true_merges'] += 1
            else:
                if decision == POSTV:
                    if not was_within_gt:
                        test_action = 'correct merge'
                        action_color = 'darkgreen'
                        infr.test_state['n_true_merges'] += 1
                    else:
                        test_action = 'correct redundant positive'
                        action_color = 'darkblue'
                else:
                    if decision == NEGTV:
                        test_action = 'correct negative'
                        action_color = 'teal'
                    else:
                        test_action = 'correct uninferrable'
                        action_color = 'teal'
        else:
            action_color = 'darkred'
            # INCORRECT DECISION
            infr.mistake_edges.add(edge)
            if was_reviewed:
                if prev_decision == decision:
                    test_action = 'incorrect duplicate'
                elif was_correct:
                    test_action = 'incorrect undid good edge'
            else:
                if decision == POSTV:
                    if was_within_pred:
                        test_action = 'incorrect redundant merge'
                    else:
                        test_action = 'incorrect new merge'
                else:
                    test_action = 'incorrect new mistake'

        infr.test_state['test_action'] = test_action
        infr.test_state['pred_decision'] = decision
        infr.test_state['true_decision'] = true_decision
        infr.test_state['user_id'] = user_id
        infr.test_state['recovering'] = (infr.recover_graph.has_node(edge[0]) or
                                         infr.recover_graph.has_node(edge[1]))

        infr.test_state['n_decision'] += 1
        if user_id.startswith('algo'):
            infr.test_state['n_algo'] += 1
        elif user_id.startswith('user') or user_id == 'oracle':
            infr.test_state['n_manual'] += 1
        else:
            raise AssertionError('unknown user_id=%r' % (user_id,))

        test_print(test_action, color=action_color)
        assert test_action is not None, 'what happened?'

class UserOracle(object):
    def __init__(oracle, accuracy, rng):
        if isinstance(rng, six.string_types):
            rng = sum(map(ord, rng))
        rng = ut.ensure_rng(rng, impl='python')

        if isinstance(accuracy, tuple):
            oracle.normal_accuracy = accuracy[0]
            oracle.recover_accuracy = accuracy[1]
        else:
            oracle.normal_accuracy = accuracy
            oracle.recover_accuracy = accuracy
        # .5

        oracle.rng = rng
        oracle.states = {POSTV, NEGTV, INCMP}

    def review(oracle, edge, truth, infr, accuracy=None):
        feedback = {
            'user_id': 'user:oracle',
            'confidence': 'absolutely_sure',
            'evidence_decision': None,
            'meta_decision': NULL,
            'timestamp_s1': ut.get_timestamp('int', isutc=True),
            'timestamp_c1': ut.get_timestamp('int', isutc=True),
            'timestamp_c2': ut.get_timestamp('int', isutc=True),
            'tags': [],
        }
        is_recovering = infr.is_recovering()

        if accuracy is None:
            if is_recovering:
                accuracy = oracle.recover_accuracy
            else:
                accuracy = oracle.normal_accuracy

        # The oracle can get anything where the hardness is less than its
        # accuracy

        hardness = oracle.rng.random()
        error = accuracy < hardness

        if error:
            error_options = list(oracle.states - {truth} - {INCMP})
            observed = oracle.rng.choice(list(error_options))
        else:
            observed = truth
        if accuracy < 1.0:
            feedback['confidence'] = 'pretty_sure'
        if accuracy < .5:
            feedback['confidence'] = 'guessing'
        feedback['evidence_decision'] = observed
        if error:
            infr.print(
                'ORACLE ERROR real={} pred={} acc={:.2f} hard={:.2f}'.format(
                    truth, observed, accuracy, hardness), 2, color='red')

            # infr.print(
            #     'ORACLE ERROR edge={}, truth={}, pred={}, rec={}, hardness={:.3f}'.format(edge, truth, observed, is_recovering, hardness),
            #     2, color='red')
        return feedback

if __name__ == '__main__':
    r"""
    CommandLine:
        python -m ibeis.algo.graph.mixin_simulation
        python -m ibeis.algo.graph.mixin_simulation --allexamples
    """
    import multiprocessing
    multiprocessing.freeze_support()  # for win32
    import utool as ut  # NOQA
    ut.doctest_funcs()


text:
using System.Collections.Generic;
using JetBrains.Application.UI.Controls.BulbMenu.Items;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Feature.Services.Resources;
using JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.CallGraph;
using JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.ContextSystem;
using JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.PerformanceCriticalCodeAnalysis.ContextSystem;
using JetBrains.ReSharper.Psi.CSharp.Tree;
using JetBrains.TextControl;

namespace JetBrains.ReSharper.Plugins.Unity.CSharp.Feature.Services.CallGraph.PerformanceAnalysis.AddExpensiveComment
{
    [SolutionComponent]
    public class AddExpensiveCommentBulbItemsProvider : PerformanceCriticalBulbItemsProvider
    {
        private readonly ExpensiveInvocationContextProvider myExpensiveContextProvider;

        public AddExpensiveCommentBulbItemsProvider(ExpensiveInvocationContextProvider expensiveContextProvider, ISolution solution)
            : base(solution)
        {
            myExpensiveContextProvider = expensiveContextProvider;
        }

        protected override bool CheckCallGraph(IMethodDeclaration methodDeclaration, IReadOnlyCallGraphContext context)
        {
            var declaredElement = methodDeclaration.DeclaredElement;

            return !myExpensiveContextProvider.IsMarkedStage(declaredElement, context)
                   && base.CheckCallGraph(methodDeclaration, context);
        }

        protected override IEnumerable<BulbMenuItem> GetActions(IMethodDeclaration methodDeclaration, ITextControl textControl)
        {
            var bulb = new AddExpensiveCommentBulbAction(methodDeclaration);
            var bulbMenuItem = UnityCallGraphUtil.BulbActionToMenuItem(bulb, textControl, Solution, BulbThemedIcons.ContextAction.Id);

            return new[] {bulbMenuItem};
        }
    }
}


text: template<typename... Args> class tuple; // { dg-error "variadic templates" "" { target c++98 } }


text:
"use strict";

define("ace/mode/ada_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
  "use strict";
  var r = e("../lib/oop"),
      i = e("./text_highlight_rules").TextHighlightRules,
      s = function s() {
    var e = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|body|private|then|if|procedure|type|case|in|protected|constant|interface|until||is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor",
        t = "true|false|null",
        n = "count|min|max|avg|sum|rank|now|coalesce|main",
        r = this.createKeywordMapper({ "support.function": n, keyword: e, "constant.language": t }, "identifier", !0);this.$rules = { start: [{ token: "comment", regex: "--.*$" }, { token: "string", regex: '".*?"' }, { token: "string", regex: "'.*?'" }, { token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { token: r, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token: "keyword.operator", regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" }, { token: "paren.lparen", regex: "[\\(]" }, { token: "paren.rparen", regex: "[\\)]" }, { token: "text", regex: "\\s+" }] };
  };r.inherits(s, i), t.AdaHighlightRules = s;
}), define("ace/mode/ada", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/ada_highlight_rules", "ace/range"], function (e, t, n) {
  "use strict";
  var r = e("../lib/oop"),
      i = e("./text").Mode,
      s = e("./ada_highlight_rules").AdaHighlightRules,
      o = e("../range").Range,
      u = function u() {
    this.HighlightRules = s;
  };r.inherits(u, i), function () {
    this.lineCommentStart = "--", this.$id = "ace/mode/ada";
  }.call(u.prototype), t.Mode = u;
});


text:
<?php
namespace Vks\Service;

use BigFileTools\BigFileTools;
use Exception;
use Vks\Core\App;
use Vks\Core\FtpNonBlockingRequest;
use Vks\Models\FtpSharedRecord;

class FtpService
{
    private $ftpConfig = array();

    function __construct()
    {
        $config = file_get_contents(REAL_PATH . "config" . DIRECTORY_SEPARATOR . "recordsFtpConfig.json");
        $this->ftpConfig = json_decode($config, true);
    }

    public function connect($host, $username, $pwd)
    {
        $conn_id = ftp_connect($host);
        if ( !$conn_id ) {
            throw new Exception(sprintf("Can't connect to FTP, address: %s", $host));
        }
        $login_result = ftp_login($conn_id, $username, $pwd);

        if ( !$login_result ) {
            throw new Exception(sprintf("Can't connect to FTP %s with login %s, or used bad password", $host, $username));
            ftp_close($conn_id);
        }

        return $conn_id;
    }

    public function getList($dir = false)
    {
        try {
            $ftp_connection = App::$instance->callService("FtpService")->connect($this->ftpConfig['host'], $this->ftpConfig['username'], $this->ftpConfig['password']);
        } catch (Exception $e) {
            App::$instance->callService("StandartController")->error("base", $e->getMessage());
        }

        $dir = !$dir ? $this->ftpConfig['base_path'] : $dir;

        $tmplist = ftp_rawlist($ftp_connection, $dir);
        $list = array(); //result
        foreach ( $tmplist as $child ) {
            $chunks = preg_split("/\s+/", $child);
            list($item['rights'], $item['user'], $item['rights'], $item['group'], $item['size'], $item['month'], $item['day'], $item['time'],) = $chunks;
            $item['type'] = $chunks[0]{0} === 'd' ? 'dir' : 'file';
            array_splice($chunks, 0, 8);
            $item['path'] = implode(" ", $chunks);
            $parsedStr = date_create()->format("Y") . "-" . $item['month'] . "-" . $item['day'] . " " . $item['time'];
            $item['date'] = date_create_from_format("Y-M-j H:i", $parsedStr)->format("d.m H:i");
            $fn = explode("/", $item['path']);
            $list[array_pop($fn)] = $item;
        };

        ftp_close($ftp_connection);

        return $list;

    }

    public function analizeFilesStatus(array $filesNames, $path)
    {

        $result = array();

        foreach ( $filesNames as $fname ) {
            $result[$fname] = array('record' => null);
            $result[$fname]['base64'] = base64_encode(urlencode($path . "/" . $fname));
        }

        array_walk($filesNames, function (&$e) use ($path) {

            $e = $this->makeHashByFullPath($path . "/" . $e);

        });

        $records = FtpSharedRecord::whereIn("key", $filesNames)->get();

        if ( count($records) ) {
            foreach ( $records as $record ) {
                foreach ( $result as $key => $val ) {
                    if ( $record->key == $this->makeHashByFullPath($path . "/" . $key) ) {
                        $result[$key]['record'] = $record->toArray();
                    }
                }
            }
        }
        //dump($result);
        return $result;

    }

    public function makeHashByFullPath($path)
    {
        //dump($path, sha1($path . $this->ftpConfig['files_hash_salt']));
        return sha1($path . $this->ftpConfig['files_hash_salt']);
    }

    public function generateDownloadLink($fileHash)
    {
        return substr(SERVER_IP, 0, -1) . ":8089?hash=" . $fileHash;
    }

}