text:
<problems>
  <problem>
    <file>data.kt</file>
    <line>17</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1..10</highlighted_element>
    <language>kotlin</language>
    <offset>14</offset>
    <length>5</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>18</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>'a'..'c'</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>8</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>19</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1..10</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>5</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>20</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1L..10L</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>7</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>21</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="sample.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1U..5U</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>6</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>22</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="sample.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1UL..5UL</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>8</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>23</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1.rangeTo(10)</highlighted_element>
    <language>kotlin</language>
    <offset>11</offset>
    <length>13</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>24</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1..10</highlighted_element>
    <language>kotlin</language>
    <offset>16</offset>
    <length>5</length>
  </problem>
  <problem>
    <file>data.kt</file>
    <line>25</line>
    <package>sample</package>
    <entry_point TYPE="method" FQNAME="data.DataKt void invoke()" />
    <problem_class id="CastDueToProgressionResolutionChangeMigration" severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Progression resolution change since 1.9</problem_class>
    <description>Progression resolution change since 1.9</description>
    <highlighted_element>1.rangeTo(10)</highlighted_element>
    <language>kotlin</language>
    <offset>12</offset>
    <length>13</length>
  </problem>
</problems>


text:
require 'test_helper'
require 'oqgraph_rails'

class TestModel < ActiveRecord::Base
  include OQGraph::Node
end
class TestModelEdge < ActiveRecord::Base
  include OQGraph::Edge
end

class GraphEdgeTest < ActiveSupport::TestCase
  def setup
    ActiveRecord::Base.establish_connection(
        :adapter  => "mysql2",
        :host     => "localhost",
        :username => "root",
        :password => "",
        :database => "test"
      )

    ActiveRecord::Base.connection.execute("CREATE TABLE IF NOT EXISTS test_model_edges(id INTEGER DEFAULT NULL AUTO_INCREMENT PRIMARY KEY, from_id INTEGER, to_id INTEGER, weight DOUBLE);")
    TestModelEdge.create_graph_table
  end

  def teardown
    ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS test_model_edges;")
    ActiveRecord::Base.connection.execute("DELETE FROM test_model_oqgraph;")
  end

  test "the oqgraph table is created" do
    assert_includes ActiveRecord::Base.connection.select_values("SHOW TABLES;"), 'test_model_oqgraph'
  end

  test "the oqgraph is updated when there are records that need to be added" do
    test_model_edge = TestModelEdge.create!(:from_id => 1, :to_id => 2, :weight => 1.0)
    TestModelEdge.create_graph_table
    assert_equal 1, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph;")
  end

  test "adding a new edge to graph" do
    test_model_edge = TestModelEdge.create!(:from_id => 1, :to_id => 2, :weight => 1.0)
    assert_equal 1, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph;")
  end

  test "removing an edge from the graph" do
    test_model_edge = TestModelEdge.create!(:from_id => 1, :to_id => 2, :weight => 1.0)
    test_model_edge.destroy
    assert_equal 0, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph;")
  end

  test "removing an edge does not remove from graph table if other edges with the same nodes exist" do
    test_model_edge = TestModelEdge.create!(:from_id => 3, :to_id => 4, :weight => 1.0)
    test_model_edge_2 = TestModelEdge.create!(:from_id => 3, :to_id => 4, :weight => 1.0)
    test_model_edge.destroy
    assert_equal 1, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph;")
  end

  test "updating an edge" do
    test_model_edge = TestModelEdge.create!(:from_id => 3, :to_id => 4, :weight => 1.0)
    test_model_edge = test_model_edge.update_attributes(:from_id => 4, :to_id => 1, :weight => 2.0)
    assert_equal 1, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph WHERE origid = 4 AND destid = 1 AND weight = 2.0;")
    assert_equal 0, ActiveRecord::Base.connection.select_value("SELECT count(*) FROM test_model_oqgraph WHERE origid = 3 AND destid = 4 AND weight = 1.0;")
  end
end

redpajama_set_name: RedPajamaGithub


text:
"""Script for reporting metrics."""

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

import logging
import os
import pickle
import random
import string
import sys

_LOG_FILE_BASENAME = 'metrics.log'
# pylint:disable=g-import-not-at-top
try:
  from gslib.utils.boto_util import ConfigureCertsFile
  from gslib.utils.boto_util import GetGsutilStateDir
  from gslib.utils.boto_util import GetNewHttp
  from gslib.utils.system_util import CreateDirIfNeeded
  _LOG_FILE_PARENT_DIR = GetGsutilStateDir()
except:  # pylint: disable=bare-except
  # Some environments import their own version of standard Python libraries
  # which might cause the import of some of our gslib.utils modules to fail
  # (e.g. if httplib2 is missing, etc). Try these alternative definitions in
  # such cases.

  _LOG_FILE_PARENT_DIR = os.path.expanduser(os.path.join('~', '.gsutil'))

  # Some environments don't have the httplib2 functionality we need.
  try:
    import errno
    # Fall back to httplib (no proxy) if we can't import libraries normally.
    from six.moves import http_client

    def GetNewHttp():
      """Returns an httplib-based metrics reporter."""

      class HttplibReporter(object):

        def __init__(self):
          pass

        # pylint: disable=invalid-name
        def request(self, endpoint, method=None, body=None, headers=None):
          # Strip 'https://'
          https_con = http_client.HTTPSConnection(endpoint[8:].split('/')[0])
          https_con.request(method, endpoint, body=body, headers=headers)
          response = https_con.getresponse()
          # Return status like an httplib2 response.
          return ({'status': response.status},)

        # pylint: enable=invalid-name

      return HttplibReporter()

    def ConfigureCertsFile():
      pass

    def CreateDirIfNeeded(dir_path, mode=0o777):
      """See the same-named method in gslib.utils.system_util."""
      if not os.path.exists(dir_path):
        try:
          os.makedirs(dir_path, mode)
        except OSError as e:
          if e.errno != errno.EEXIST:
            raise
  except:  # pylint: disable=bare-except
    sys.exit(0)

LOG_FILE_PATH = os.path.join(_LOG_FILE_PARENT_DIR, _LOG_FILE_BASENAME)

def ReportMetrics(metrics_file_path, log_level, log_file_path=None):
  """Sends the specified anonymous usage event to the given analytics endpoint.

  Args:
      metrics_file_path: str, File with pickled metrics (list of tuples).
      log_level: int, The logging level of gsutil's root logger.
      log_file_path: str, The file that this module should write its logs to.
        This parameter is intended for use by tests that need to evaluate the
        contents of the file at this path.

  """
  logger = logging.getLogger()
  if log_file_path is not None:
    # Use a separate logger so that we don't add another handler to the default
    # module-level logger. This is intended to prevent multiple calls from tests
    # running in parallel from writing output to the same file.
    new_name = '%s.%s' % (logger.name, ''.join(
        random.choice(string.ascii_lowercase) for _ in range(8)))
    logger = logging.getLogger(new_name)

  log_file_path = log_file_path or LOG_FILE_PATH
  log_file_parent_dir = os.path.dirname(log_file_path)
  CreateDirIfNeeded(log_file_parent_dir)
  handler = logging.FileHandler(log_file_path, mode='w')
  logger.addHandler(handler)
  logger.setLevel(log_level)

  with open(metrics_file_path, 'rb') as metrics_file:
    metrics = pickle.load(metrics_file)
  os.remove(metrics_file_path)

  ConfigureCertsFile()
  http = GetNewHttp()

  for metric in metrics:
    try:
      headers = {'User-Agent': metric.user_agent}
      response = http.request(metric.endpoint,
                              method=metric.method,
                              body=metric.body,
                              headers=headers)
      logger.debug(metric)
      logger.debug('RESPONSE: %s', response[0]['status'])
    except Exception as e:  # pylint: disable=broad-except
      logger.debug(e)


text:
namespace arrow {
namespace json {
namespace internal {
class ObjectParser;
}  // namespace internal
}  // namespace json
}  // namespace arrow

namespace parquet {
namespace encryption {

// KeyMaterial class represents the "key material", keeping the information that allows
// readers to recover an encryption key (see description of the KeyMetadata class). The
// keytools package (PARQUET-1373) implements the "envelope encryption" pattern, in a
// "single wrapping" or "double wrapping" mode. In the single wrapping mode, the key
// material is generated by encrypting the "data encryption key" (DEK) by a "master key".
// In the double wrapping mode, the key material is generated by encrypting the DEK by a
// "key encryption key" (KEK), that in turn is encrypted by a "master key".
//
// Key material is kept in a flat json object, with the following fields:
// 1. "keyMaterialType" - a String, with the type of  key material. In the current
// version, only one value is allowed - "PKMT1" (stands
//     for "parquet key management tools, version 1"). For external key material storage,
//     this field is written in both "key metadata" and "key material" jsons. For internal
//     key material storage, this field is written only once in the common json.
// 2. "isFooterKey" - a boolean. If true, means that the material belongs to a file footer
// key, and keeps additional information (such as
//     KMS instance ID and URL). If false, means that the material belongs to a column
//     key.
// 3. "kmsInstanceID" - a String, with the KMS Instance ID. Written only in footer key
// material.
// 4. "kmsInstanceURL" - a String, with the KMS Instance URL. Written only in footer key
// material.
// 5. "masterKeyID" - a String, with the ID of the master key used to generate the
// material.
// 6. "wrappedDEK" - a String, with the wrapped DEK (base64 encoding).
// 7. "doubleWrapping" - a boolean. If true, means that the material was generated in
// double wrapping mode.
//     If false - in single wrapping mode.
// 8. "keyEncryptionKeyID" - a String, with the ID of the KEK used to generate the
// material. Written only in double wrapping mode.
// 9. "wrappedKEK" - a String, with the wrapped KEK (base64 encoding). Written only in
// double wrapping mode.
class PARQUET_EXPORT KeyMaterial {
 public:
  // these fields are defined in a specification and should never be changed
  static constexpr const char kKeyMaterialTypeField[] = "keyMaterialType";
  static constexpr const char kKeyMaterialType1[] = "PKMT1";

  static constexpr const char kFooterKeyIdInFile[] = "footerKey";
  static constexpr const char kColumnKeyIdInFilePrefix[] = "columnKey";

  static constexpr const char kIsFooterKeyField[] = "isFooterKey";
  static constexpr const char kDoubleWrappingField[] = "doubleWrapping";
  static constexpr const char kKmsInstanceIdField[] = "kmsInstanceID";
  static constexpr const char kKmsInstanceUrlField[] = "kmsInstanceURL";
  static constexpr const char kMasterKeyIdField[] = "masterKeyID";
  static constexpr const char kWrappedDataEncryptionKeyField[] = "wrappedDEK";
  static constexpr const char kKeyEncryptionKeyIdField[] = "keyEncryptionKeyID";
  static constexpr const char kWrappedKeyEncryptionKeyField[] = "wrappedKEK";

 public:
  KeyMaterial() = default;

  static KeyMaterial Parse(const std::string& key_material_string);

  static KeyMaterial Parse(
      const ::arrow::json::internal::ObjectParser* key_material_json);

  /// This method returns a json string that will be stored either inside a parquet file
  /// or in a key material store outside the parquet file.
  static std::string SerializeToJson(bool is_footer_key,
                                     const std::string& kms_instance_id,
                                     const std::string& kms_instance_url,
                                     const std::string& master_key_id,
                                     bool is_double_wrapped, const std::string& kek_id,
                                     const std::string& encoded_wrapped_kek,
                                     const std::string& encoded_wrapped_dek,
                                     bool is_internal_storage);

  bool is_footer_key() const { return is_footer_key_; }
  bool is_double_wrapped() const { return is_double_wrapped_; }
  const std::string& master_key_id() const { return master_key_id_; }
  const std::string& wrapped_dek() const { return encoded_wrapped_dek_; }
  const std::string& kek_id() const { return kek_id_; }
  const std::string& wrapped_kek() const { return encoded_wrapped_kek_; }
  const std::string& kms_instance_id() const { return kms_instance_id_; }
  const std::string& kms_instance_url() const { return kms_instance_url_; }

 private:
  KeyMaterial(bool is_footer_key, const std::string& kms_instance_id,
              const std::string& kms_instance_url, const std::string& master_key_id,
              bool is_double_wrapped, const std::string& kek_id,
              const std::string& encoded_wrapped_kek,
              const std::string& encoded_wrapped_dek);

  bool is_footer_key_;
  std::string kms_instance_id_;
  std::string kms_instance_url_;
  std::string master_key_id_;
  bool is_double_wrapped_;
  std::string kek_id_;
  std::string encoded_wrapped_kek_;
  std::string encoded_wrapped_dek_;
};

}  // namespace encryption
}  // namespace parquet


text:
package org.wrml.core.transformer;

import java.util.HashMap;
import java.util.Map;

import org.wrml.core.util.observable.ObservableMap;
import org.wrml.core.util.observable.Observables;

public class CachingTransformer<A, B, T extends ConstantTransformation<A, B>> extends DelegatingTransformer<A, B, T> {

    public static <A, B, T extends ConstantTransformation<A, B>> CachingTransformer<A, B, T> create(
            T constantTransformation) {

        return new CachingTransformer<A, B, T>(constantTransformation);
    }

    public static <A, B, T extends ConstantTransformation<A, B>> CachingTransformer<A, B, T> create(
            T constantTransformation, Map<A, B> abMap, Map<B, A> baMap) {

        return new CachingTransformer<A, B, T>(constantTransformation, abMap, baMap);
    }

    private final ObservableMap<A, B> _AbCache;
    private final ObservableMap<B, A> _BaCache;

    public CachingTransformer(T delegate) {
        this(delegate, new HashMap<A, B>(), new HashMap<B, A>());
    }

    public CachingTransformer(T delegate, Map<A, B> abMap, Map<B, A> baMap) {
        this(delegate, Observables.observableMap(abMap), Observables.observableMap(baMap));
    }

    private CachingTransformer(T delegate, ObservableMap<A, B> abCache, ObservableMap<B, A> baCache) {
        super(delegate);
        _AbCache = abCache;
        _BaCache = baCache;
    }

    @Override
    public B aToB(A aValue) {

        if (_AbCache != null) {
            if (_AbCache.containsKey(aValue)) {
                return _AbCache.get(aValue);
            }
        }

        final B bValue = super.aToB(aValue);

        if (_AbCache != null) {
            _AbCache.put(aValue, bValue);
        }

        return bValue;
    }

    @Override
    public A bToA(B bValue) {

        if (_BaCache != null) {
            if (_BaCache.containsKey(bValue)) {
                return _BaCache.get(bValue);
            }
        }

        final A aValue = super.bToA(bValue);

        if (_BaCache != null) {
            _BaCache.put(bValue, aValue);
        }

        return aValue;
    }

}


text:
A temporary notes repo until I get my notes program finished

All notes in this repo are encrypted.

### dependencies
- node
- npm

### setup
- create a notes directory
- add notes
- when you want to encrypt your notes, run:
  - `$ node index.js -e`
  - this will encrypt all notes and throw them into an encrypted directory
- push repo to prefered git server
  - `$ git -am 'MESSAGE_HERE' && git push`
- if you want to sync your notes on a separate machine and need to decrypt, run:
  - `$ node index.js -d`


text:
<?xml version="1.0" encoding="UTF-8"?>

		<item value="324" key="DIALOG_WIDTH"/>
		<item value="90" key="DIALOG_Y_ORIGIN"/>
		<item value="890" key="DIALOG_X_ORIGIN"/>
		<item value="463" key="DIALOG_HEIGHT"/>
		<item value="1|Ubuntu|11.0|0|GTK|1|" key="DIALOG_FONT_NAME"/>

		<item value="true" key="wrap"/>
		<item value="false" key="casesensitive"/>
		<item value="false" key="isRegEx"/>
		<item value="false" key="incremental"/>
		<item value="false" key="wholeword"/>
		<item value="ADC_CalibratedTemperature" key="selection"/>
		<list key="findhistory">
			<item value="ADC_CalibratedTemperature"/>
			<item value="SystemMessageString"/>
			<item value="intpart "/>
			<item value="">"/>
			<item value="'>"/>
			<item value=">"/>
			<item value="\n"/>
			<item value="\r"/>
		</list>
		<list key="replacehistory">
		</list>


text:
package provision

import (
	"github.com/pkg/errors"
	"github.com/tsuru/tsuru/db"
	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
)

var (
	ErrPublicDefaultPollCantHaveTeams = errors.New("Public/Default pool can't have teams.")
	ErrDefaultPoolAlreadyExists       = errors.New("Default pool already exists.")
	ErrPoolNameIsRequired             = errors.New("Pool name is required.")
	ErrPoolNotFound                   = errors.New("Pool does not exist.")
)

type Pool struct {
	Name        string `bson:"_id"`
	Teams       []string
	Public      bool
	Default     bool
	Provisioner string
}

type AddPoolOptions struct {
	Name        string
	Public      bool
	Default     bool
	Force       bool
	Provisioner string
}

type UpdatePoolOptions struct {
	Default     *bool
	Public      *bool
	Force       bool
	Provisioner string
}

func (p *Pool) GetProvisioner() (Provisioner, error) {
	if p.Provisioner != "" {
		return Get(p.Provisioner)
	}
	return GetDefault()
}

func AddPool(opts AddPoolOptions) error {
	if opts.Name == "" {
		return ErrPoolNameIsRequired
	}
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	if opts.Default {
		err = changeDefaultPool(opts.Force)
		if err != nil {
			return err
		}
	}
	pool := Pool{Name: opts.Name, Public: opts.Public, Default: opts.Default, Provisioner: opts.Provisioner}
	return conn.Pools().Insert(pool)
}

func changeDefaultPool(force bool) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	p, err := listPools(bson.M{"default": true})
	if err != nil {
		return err
	}
	if len(p) > 0 {
		if !force {
			return ErrDefaultPoolAlreadyExists
		}
		return conn.Pools().UpdateId(p[0].Name, bson.M{"$set": bson.M{"default": false}})
	}
	return nil
}

func RemovePool(poolName string) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	err = conn.Pools().Remove(bson.M{"_id": poolName})
	if err == mgo.ErrNotFound {
		return ErrPoolNotFound
	}
	return err
}

func AddTeamsToPool(poolName string, teams []string) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	var pool Pool
	err = conn.Pools().Find(bson.M{"_id": poolName}).One(&pool)
	if err == mgo.ErrNotFound {
		return ErrPoolNotFound
	}
	if err != nil {
		return err
	}
	if pool.Public || pool.Default {
		return ErrPublicDefaultPollCantHaveTeams
	}
	for _, newTeam := range teams {
		for _, team := range pool.Teams {
			if newTeam == team {
				return errors.New("Team already exists in pool.")
			}
		}
	}
	return conn.Pools().UpdateId(poolName, bson.M{"$push": bson.M{"teams": bson.M{"$each": teams}}})
}

func RemoveTeamsFromPool(poolName string, teams []string) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	err = conn.Pools().UpdateId(poolName, bson.M{"$pullAll": bson.M{"teams": teams}})
	if err == mgo.ErrNotFound {
		return ErrPoolNotFound
	}
	return err
}

func ListPossiblePools(teams []string) ([]Pool, error) {
	query := bson.M{}
	if teams != nil {
		filter := bson.M{
			"default": false,
			"public":  false,
			"teams":   bson.M{"$in": teams},
		}
		query["$or"] = []bson.M{{"public": true}, {"default": true}, filter}
	}
	return listPools(query)
}

func ListPoolsForTeam(team string) ([]Pool, error) {
	return listPools(bson.M{"teams": team})
}

func listPools(query bson.M) ([]Pool, error) {
	conn, err := db.Conn()
	if err != nil {
		return nil, err
	}
	defer conn.Close()
	pools := []Pool{}
	err = conn.Pools().Find(query).All(&pools)
	if err != nil {
		return nil, err
	}
	return pools, nil
}

// GetPoolByName finds a pool by name
func GetPoolByName(name string) (*Pool, error) {
	conn, err := db.Conn()
	if err != nil {
		return nil, err
	}
	defer conn.Close()
	var p Pool
	err = conn.Pools().FindId(name).One(&p)
	if err != nil {
		if err == mgo.ErrNotFound {
			return nil, ErrPoolNotFound
		}
		return nil, err
	}
	return &p, nil
}

func GetDefaultPool() (*Pool, error) {
	conn, err := db.Conn()
	if err != nil {
		return nil, err
	}
	defer conn.Close()
	var pool Pool
	err = conn.Pools().Find(bson.M{"default": true}).One(&pool)
	if err != nil {
		if err == mgo.ErrNotFound {
			return nil, ErrPoolNotFound
		}
		return nil, err
	}
	return &pool, nil
}

func PoolUpdate(name string, opts UpdatePoolOptions) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	if opts.Default != nil && *opts.Default {
		err = changeDefaultPool(opts.Force)
		if err != nil {
			return err
		}
	}
	query := bson.M{}
	if opts.Default != nil {
		query["default"] = *opts.Default
	}
	if opts.Public != nil {
		query["public"] = *opts.Public
	}
	if opts.Provisioner != "" {
		query["provisioner"] = opts.Provisioner
	}
	err = conn.Pools().UpdateId(name, bson.M{"$set": query})
	if err == mgo.ErrNotFound {
		return ErrPoolNotFound
	}
	return err
}


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/hwpf/fapi2/include/fapi2_mbvpd_access.H $          */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2017                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

///
/// @file fapi2_mbvpd_access.H
///
/// @brief Defines the Memory Buffer VPD functions that platform must implement
///

#ifndef _FAPI2_MBVPDACCESS_H_
#define _FAPI2_MBVPDACCESS_H_

#include <stdint.h>
#include <return_code.H>
#include <target.H>
#include <fapi2_mbvpd_access_defs.H>
#include <plat_mbvpd_access.H>

namespace fapi2
{
///
/// @brief Get Memory Buffer VPD field.
///
/// A Memory Buffer VPD field is specified using a record and keyword enumerator
///
/// Suggested way to call this routine is to call it once with a NULL buffer
/// pointer to to retrieve the size of the record, then allocate the proper
/// size of the buffer and call again.
///
/// @param[in] i_record     Record enumerator
/// @param[in] i_keyword    Keyword enumerator
/// @param[in] i_target     Reference to processor chip target for the record
/// @param[in] i_pBuffer    Pointer to buffer where record will be stored. If
///                         NULL then the size of record will be stored in
///                         io_fieldSize
/// @param[in,out] io_fieldSize Size of i_pBuffer in bytes
///
/// @return fapi2::ReturnCode. FAPI_RC_SUCCESS, or failure value.
///
fapi2::ReturnCode getMBvpdField(const fapi2::MBvpdRecord i_record,
                                const fapi2::MBvpdKeyword i_keyword,
                                const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target,
                                uint8_t* const i_pBuffer,
                                size_t& io_fieldSize);

///
/// @brief Set Memory Buffer VPD field.
///
/// A Memory Buffer VPD field is specified using a record and keyword enumerator
///
/// @param[in] i_record     Record enumerator
/// @param[in] i_keyword    Keyword enumerator
/// @param[in] i_target     Reference to processor chip target for the record
/// @param[in] i_pBuffer    Pointer to buffer where data to set is stored
/// @param[in] i_fieldSize  Size of i_pBuffer in bytes
///
/// @return fapi2::ReturnCode. FAPI_RC_SUCCESS, or failure value.
///
fapi2::ReturnCode setMBvpdField(const fapi2::MBvpdRecord i_record,
                                const fapi2::MBvpdKeyword i_keyword,
                                const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target,
                                const uint8_t* const i_pBuffer,
                                const size_t i_fieldSize);
}

#endif


text:
module Hello
  module SessionModel
    extend ActiveSupport::Concern

    def device_name
      ua
    end

    included do
      belongs_to :user, counter_cache: true
      belongs_to :credential, counter_cache: true

      validates_presence_of :credential, :user, :ua, :token
      validates_uniqueness_of :token

      before_validation on: :create do
        self.user = credential && credential.user
        self.token = SecureRandom.hex(16) # probability = 1 / (32 ** 32)
      end
    end

    module ClassMethods
    end

  end
end


text:
<!DOCTYPE html >

    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <title>A customised and adjustable Gauge chart</title>

    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A Gauge chart that is updated periodically by AJAX" />

        Note:
        For security reasons the AJAX demos don't work offline. You can view the demos on the RGraph website here:
        http://www.rgraph.net/demos

A customised Gauge chart (with AJAX updating)

        This Gauge is much like the previous one but with AJAX updating instead of click updating. Because
        of the AJAX it only works when viewed online - which you can do here.

    <canvas id="cvs" width="250" height="250">[No canvas support]</canvas>

    This goes in the documents header (or you could place it just above the jQuery ready event code):

<script src="/mps/libs/jquery-1.11.3/jquery-1.11.3.js"></script>
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.effects.js"></script>
<script src="RGraph.gauge.js"></script>

    Put this where you want the chart to show up:

<canvas id="cvs" width="250" height="250">
    [No canvas support]
</canvas>

    This is the code that generates the chart. Because it's using the jQuery ready event you can put this at the
    bottom of the document:

<script>
    $(document).ready(function ()
    {
        var gauge = new RGraph.Gauge({
            id: 'cvs',
            min:0,
            max: 100,
            value: 7,
            options: {
                borderOutline: 'transparent',
                needleColors: ['red'],
                needleType: 'line',
                centerpinRadius: 0.1,
                titleTop: 'Speed',
                labelsOffset: 7
            }
        }).on('draw', function (obj)
        {
            var co = obj.context;

            // This circle becomes the border of the centerpin
            RGraph.path(co, ['b', 'a', obj.centerx, obj.centery, 10, 0, RGraph.TWOPI, false, 'f', 'black']);
        })
        .draw();

        var delay = 1500;

        function myAJAXCallback(num)
        {
            gauge.value = num;
            gauge.grow()

            // Make another AJAX call after the delay (which is in milliseconds)
            setTimeout(function ()
            {
                RGraph.AJAX.getNumber('/getdata.html', myAJAXCallback);
            }, delay);
        }

        /**
        * Make the AJAX call every so often (contolled by the delay variable)
        */
        setTimeout(function ()
        {
            RGraph.AJAX.getNumber('/getdata.html', myAJAXCallback);
        }, delay);
    });
</script>

        « Back


text:
package org.perfcake.reporting.reporters.accumulators.weighted;

/**
 * Weighted value is a wrapper for a numeric value with some weight.
 * This is used for statistics. An instance is immutable.
 *
 * @author Martin Večeřa
 */
public class WeightedValue<T extends Number> {
   private final T value;
   private final long weight;

   /**
    * Creates a new immutable instance with the specified value and weight.
    *
    * @param value
    *       The value to be stored.
    * @param weight
    *       The weight of the value.
    */
   public WeightedValue(final T value, final long weight) {
      this.value = value;
      this.weight = weight;
   }

   /**
    * Gets the stored value.
    *
    * @return The stored value.
    */
   public T getValue() {
      return value;
   }

   /**
    * Gets the weight of the value.
    *
    * @return The weight of the value.
    */
   public long getWeight() {
      return weight;
   }

   @Override
   public boolean equals(final Object o) {
      if (this == o) {
         return true;
      }
      if (!(o instanceof WeightedValue)) {
         return false;
      }

      final WeightedValue that = (WeightedValue) o;

      if (weight != that.weight) {
         return false;
      }
      if ((value != null) ? !value.equals(that.value) : (that.value != null)) {
         return false;
      }

      return true;
   }

   @Override
   public int hashCode() {
      int result = value != null ? value.hashCode() : 0;
      result = 31 * result + (int) (weight ^ (weight >>> 32));
      return result;
   }

   @Override
   public String toString() {
      if (weight == 1) {
         return value.toString();
      } else {
         return "[" + value + ", weight=" + weight + ']';
      }
   }
}


text:
import random
import sqlite3
import sys
import tweepy

from tweepy.streaming import StreamListener
from tweepy import Stream
from tweepy.api import API

def get_config(config_file):
    """
    :param config_file: Path to configuration file containing Twitter API keys
    :return: Dictionary of configuration variables, including Twitter API keys
    """
    with open(config_file, 'r') as config_stream:
        split_lines = [line.split("=") for line in config_stream.xreadlines()]
        out = {}
        for s in split_lines:
            if len(s) == 2:
                out[s[0].strip()] = s[1].strip()
        return out

class StoreStatusTextListener(StreamListener):
    """ Records the text of streamed-in statuses in a list field """

    def __init__(self, api, limit=5):
        self.texts = set()
        self.myLimit = limit
        self.api = api or API()

    def on_status(self, status):
        self.texts.add(status.text)
        return len(self.texts) < self.myLimit

    def on_error(self, status):
        print "error", status

def subseqs(s):
    for a in xrange(len(s)):
        for b in xrange(a+1, len(s)+1):
            yield s[a:b]

def first_char(word):
    if len(word) == 0:
        return ''
    if len(word) == 1:
        return word
    if word[0] == "#":
        return word[1]
    return word[0]

def get_ngrams(text):
    clean_words = [w.strip("""./?<>!,:;-+&*"'""") for w
                   in text.lower().split()]
    clean_nonempty_words = [cw for cw in clean_words if len(cw) > 0]
    return subseqs(clean_nonempty_words)

def initials(words):
    first_chars = [first_char(word).lower() for word in words if len(word) > 0]
    return "".join(first_chars)

def scrape_twitter(acrostic, api, dbpath):

    sub_acros = set(subseqs(acrostic))
    acros_n = len(acrostic)

    l = StoreStatusTextListener(api, limit=10000)
    try:
        stream = Stream(auth, l, timeout=5.0)
        stream.filter(track=("a", "of", "the", "it", "i"), languages=("en",))
    except:
        print "Problem after", len(l.texts)

    print len(l.texts), "tweets scraped"
    with sqlite3.connect(dbpath+"/acrostician.db") as conn:
        cur = conn.cursor()

        for n in xrange(1, acros_n+1):
            s = str(n)
            cur.execute("create table if not exists GRAM_" + s +
                        " (Term text, Initials text, Count integer, "
                        "Used integer);")
            cur.execute("create unique index if not exists IDX_TERM_GRAM_" + s +
                        " on GRAM_"+s+" (Term);")
            cur.execute("create index if not exists IDX_INIT_GRAM_" + s +
                        " on GRAM_"+s+" (Initials);")
            conn.commit()

        ngram_counts = {}
        for text in l.texts:
            ngrams = [s for s in get_ngrams(text) if initials(s) in sub_acros]
            for n in ngrams:
                term = " ".join(n)
                if "http" in term.lower() or acrostic in term.lower():
                    continue
                ngram_counts[term] = ngram_counts.get(term, 0) + 1
        i = 1
        for term in ngram_counts:
            n = term.split()
            inits = initials(n)
            cur.execute("select Count from GRAM_" + str(len(n)) +
                        " where Term=:term", {"term": term})
            results = cur.fetchall()
            if len(results) == 0:
                count = ngram_counts[term]
                cur.execute("insert into GRAM_" + str(len(n)) +
                            " values (?,?,?,1)", (term, inits, count))
            else:
                count = ngram_counts[term] + results[0][0]
                cur.execute("update GRAM_" + str(len(n)) +
                            " set Count=? where Term=?", (count, term))
            if i % 100 == 0:
                conn.commit()
            i += 1
        conn.commit()

def capitalize_tweet(tw):
    sp_tw = tw.split()
    out = []
    for w in sp_tw:
        if w[0] == "#":
            x = "#"+w[1:].capitalize()
        else:
            x = w.capitalize()
        out.append(x)
    return "\n".join(out)

def score_tup(t):
    """
    Score an ngram tuple returned from a database ngram table. A higher scoring
    term is more deserving of inclusion in the resulting acrostic
    :param t: (Term string, initials string, Corpus count, Used count)
    :return: Fitness score for this term
    """
    term = t[0]
    inits = t[1]
    pop = t[2]
    used = t[3]
    raw = (len(term)*pop/(10*used*used*used))**(len(inits))
    if "#" in term:
        score = 2*raw
    else:
        score = raw
    return max(score, 1)

def post_tweet(target, api, dbpath, test_only=False):
    target_len = len(target)
    with sqlite3.connect(dbpath+"/acrostician.db") as conn:

        print target
        cur = conn.cursor()

        cur.execute("create table if not exists TWEETED (Tweet text)")
        cur.execute("create unique index if not exists IDX_TEXT "
                    "on TWEETED(Tweet)")

        not_yet_posted = True
        tries = 100

        while not_yet_posted and tries > 0:
            tweet = ""
            tweet_word_count = len([t for t in tweet.split() if len(t) > 0])
            while tweet_word_count < target_len:
                desired_inits = target[tweet_word_count:target_len]

                words_left = target_len - tweet_word_count
                options = []
                while len(options) < 200 and words_left > 0:
                    cur.execute("select Term, Initials, Count, Used "
                                "from GRAM_" + str(words_left) +
                                " where Initials=? order by " +
                                "random() limit 200",
                                (desired_inits[:words_left],))
                    for tup in cur.fetchall():
                        if target not in tup[0]:
                            options.append(tup)
                    words_left -= 1
                if len(options) == 0:
                    print "No options left", tweet, desired_inits
                    raise RuntimeError
                total_count = int(sum([score_tup(o) for o in options]))

                r = random.randint(1, total_count)
                i = 0
                while i < len(options):
                    r = r - score_tup(options[i])
                    if r <= 0:
                        break
                    i += 1
                if r > 0:
                    new_word = options[-1][0]
                else:
                    new_word = options[i][0]
                tweet = tweet + "\n"+new_word
                tweet_word_count = len([t for t in tweet.split() if len(t) > 0])

            cap_tweet = capitalize_tweet(tweet)
            length_check = len(cap_tweet) < 141  # Check the length's okay

            dupe_check = True  # Assume it's not a dupe...
            for _ in cur.execute("select Tweet from TWEETED where Tweet = ?",
                                 (cap_tweet.lower(),)):
                print "Duplicate... trying again"
                dupe_check = False  # But if it is, don't post it
                break

            if length_check and dupe_check:
                # Post the poem
                try:
                    print cap_tweet
                except:
                    print "[Trouble printing tweet]"
                api.update_status(cap_tweet)
                not_yet_posted = False

                # Update the used counts for this poem's ngrams
                selected_ngrams = get_ngrams(tweet)
                for ngram in selected_ngrams:
                    n = len(ngram)
                    inits = initials(ngram)
                    term = " ".join(ngram)
                    cur.execute("select Used from GRAM_"+str(n) +
                                " where Term = ?", (term,))
                    rows = cur.fetchall()
                    for tup in rows:  # Should just be a single row...
                        used_count = tup[0]
                        cur.execute("update GRAM_"+str(n)+" set Used = ? " +
                                    "where Term = ?", (used_count+1, term))
                    if len(rows) == 0:
                        cur.execute("insert into GRAM_" + str(n) +
                                    " values (?,?,1,1)", (term, inits))
                    if test_only:
                        print "usage update for", term, inits
                        # Add the tweet to our list of already-posted
                        cur.execute("insert into TWEETED values (?)",
                                    (cap_tweet.lower(),))
                    conn.commit()

            tries -= 1
        print tries, "tries left"

def usage():
    print ("Usage: python acrosticBot.py [config file] "
           "[acrostic word] [read or write]")

if __name__ == "__main__":
    if not (len(sys.argv) == 4 or len(sys.argv) == 5):
        usage()
        sys.exit(0)

    config = get_config(sys.argv[1])
    ckey = config["CONSUMER_KEY"]
    csec = config["CONSUMER_SECRET"]
    akey = config["ACCESS_KEY"]
    asec = config["ACCESS_SECRET"]
    worddb = config["NGRAM_DB_PATH"]

    auth = tweepy.OAuthHandler(ckey, csec)
    auth.set_access_token(akey, asec)
    configapi = tweepy.API(auth)
    testmode = "test" in sys.argv

    if random.randint(1, 69) == 69:
        targetWord = "benghazi"
    else:
        targetWord = sys.argv[2].lower().split()[0]

    if sys.argv[3] == 'read':
        scrape_twitter(targetWord, configapi, worddb)
    elif sys.argv[3] == 'write':
        post_tweet(targetWord, configapi, worddb, testmode)
    elif sys.argv[3] == 'both':
        scrape_twitter(targetWord, configapi, worddb)
        post_tweet(targetWord, configapi, worddb, testmode)
    else:
        usage()


text:
@interface TestDefaults : NSObject

/// Initializes the API communication layer
-(void)setUp;

@end


text:
namespace base {
class SingleThreadTaskRunner;
}

namespace blink {

class LocalFrame;
class WebVideoCaptureImplManager;

// LocalVideoCapturerSource is a delegate used by MediaStreamVideoCapturerSource
// for local video capture. It uses the Render singleton
// WebVideoCaptureImplManager to start / stop and receive I420 frames from
// Chrome's video capture implementation. This is a main Render thread only
// object.
class MODULES_EXPORT LocalVideoCapturerSource : public VideoCapturerSource {
 public:
  static std::unique_ptr<VideoCapturerSource> Create(
      scoped_refptr<base::SingleThreadTaskRunner> task_runner,
      LocalFrame* frame,
      const base::UnguessableToken& session_id);
  LocalVideoCapturerSource(
      scoped_refptr<base::SingleThreadTaskRunner> task_runner,
      LocalFrame* frame,
      const base::UnguessableToken& session_id);

  LocalVideoCapturerSource(const LocalVideoCapturerSource&) = delete;
  LocalVideoCapturerSource& operator=(const LocalVideoCapturerSource&) = delete;

  ~LocalVideoCapturerSource() override;

  // VideoCaptureSource Implementation.
  media::VideoCaptureFormats GetPreferredFormats() override;
  void StartCapture(const media::VideoCaptureParams& params,
                    const VideoCaptureDeliverFrameCB& new_frame_callback,
                    const RunningCallback& running_callback) override;
  void RequestRefreshFrame() override;
  void MaybeSuspend() override;
  void Resume() override;
  void StopCapture() override;
  void OnFrameDropped(media::VideoCaptureFrameDropReason reason) override;
  void OnLog(const std::string& message) override;
  media::VideoCaptureFeedbackCB GetFeedbackCallback() const override;

 private:
  void OnStateUpdate(blink::VideoCaptureState state);

  // |session_id_| identifies the capture device used for this capture session.
  const media::VideoCaptureSessionId session_id_;

  WebVideoCaptureImplManager* const manager_;

  LocalFrameToken frame_token_;
  base::OnceClosure release_device_cb_;

  // These two are valid between StartCapture() and StopCapture().
  // |running_call_back_| is run when capture is successfully started, and when
  // it is stopped or error happens.
  RunningCallback running_callback_;
  base::OnceClosure stop_capture_cb_;

  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;

  // Bound to the main render thread.
  THREAD_CHECKER(thread_checker_);

  base::WeakPtrFactory<LocalVideoCapturerSource> weak_factory_{this};
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_LOCAL_VIDEO_CAPTURER_SOURCE_H_


text:
package org.apache.solr.client.solrj;

import java.io.IOException;
import java.io.Serializable;
import org.apache.solr.common.MapWriter;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.util.NamedList;

/**
 * @since solr 1.3
 */
public abstract class SolrResponse implements Serializable, MapWriter {

  /** make this compatible with earlier versions */
  private static final long serialVersionUID = -7931100103360242645L;

  /** Elapsed time in milliseconds for the request as seen from the client. */
  public abstract long getElapsedTime();

  public abstract void setResponse(NamedList<Object> rsp);

  public abstract void setElapsedTime(long elapsedTime);

  public abstract NamedList<Object> getResponse();

  @Override
  public void writeMap(EntryWriter ew) throws IOException {
    getResponse().writeMap(ew);
  }

  public Exception getException() {
    NamedList<?> exp = (NamedList<?>) getResponse().get("exception");
    if (exp == null) {
      return null;
    }
    Integer rspCode = (Integer) exp.get("rspCode");
    ErrorCode errorCode =
        rspCode != null && rspCode != -1 ? ErrorCode.getErrorCode(rspCode) : ErrorCode.SERVER_ERROR;
    return new SolrException(errorCode, (String) exp.get("msg"));
  }
}


text:
var assert = require('assert');
let Test = require('../../option_test');

describe('Option `unitless-zero`, process', function() {
  describe('css', function() {
    it('Should remove units in zero-valued dimensions', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.comb.processString(
          'div { margin: 0em; padding: 0px }'
      ).then(function(actual) {
        assert.equal(actual, 'div { margin: 0; padding: 0 }');
      });
    });

    it('Should remove units in zero-valued dimensions, test 2', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.comb.processString(
          'div { margin: 0% }'
      ).then(function(actual) {
        assert.equal(actual, 'div { margin: 0 }');
      });
    });

    it('Should remove units in zero-valued media-query params', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.comb.processString(
          '@media all and (min-width: 0px) { div { margin: 0em; padding: 0px } }'
      ).then(function(actual) {
        assert.equal(actual, '@media all and (min-width: 0) { div { margin: 0; padding: 0 } }');
      });
    });

    it('Should not remove units (degs) in rotate property', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.comb.processString(
          'div { -webkit-transform: rotate(0deg); }'
      ).then(function(actual) {
        assert.equal(actual, 'div { -webkit-transform: rotate(0deg); }');
      });
    });

    it('Issue 394', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.shouldBeEqual('issue-394.css', 'issue-394.expected.css');
    });
  });

  describe('less', function() {
    it('Issue 389', function() {
      let test = new Test(this, {'unitless-zero': true});
      return test.shouldBeEqual('issue-389.less');
    });
  });
});


text:
'use strict';

angular.module('controllers.profile', [
        'ngRoute',
        'resources.user'
    ])
    .controller('ProfileController', [
        '$scope',
        '$routeParams',
        'User',
        function($scope, $routeParams, User) {

            var _load = function(){
                User.FindById($routeParams.userId, true).then(
                    function(user) {
                        $scope.user = user;
                        $scope.loaded = true;
                    }
                );
            };

            $scope.user = {};

            _load();
        }
    ]);


text:
Assume that we would like to merge branch `dev` to branch: `master`

1. Pull latest commits from `master`

```
$ git checkout master
$ git pull --rebase
```

2. Rebase master

```
$ git rebase master dev
```

or

```
$ git checkout dev
$ git rebase master
```

3. Kickoff a PR


text:
package com.amazonaws.services.ec2.model.transform;

import java.util.Map;
import java.util.Map.Entry;

import javax.xml.stream.events.XMLEvent;

import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.MapEntry;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;

/**
 * Create Reserved Instances Listing Result StAX Unmarshaller
 */
public class CreateReservedInstancesListingResultStaxUnmarshaller implements Unmarshaller<CreateReservedInstancesListingResult, StaxUnmarshallerContext> {

    public CreateReservedInstancesListingResult unmarshall(StaxUnmarshallerContext context) throws Exception {
        CreateReservedInstancesListingResult createReservedInstancesListingResult = new CreateReservedInstancesListingResult();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument()) targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument()) return createReservedInstancesListingResult;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
                if (context.testExpression("reservedInstancesListingsSet/item", targetDepth)) {
                    createReservedInstancesListingResult.getReservedInstancesListings().add(ReservedInstancesListingStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }
            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return createReservedInstancesListingResult;
                }
            }
        }
    }

    private static CreateReservedInstancesListingResultStaxUnmarshaller instance;
    public static CreateReservedInstancesListingResultStaxUnmarshaller getInstance() {
        if (instance == null) instance = new CreateReservedInstancesListingResultStaxUnmarshaller();
        return instance;
    }
}


text:
package com.mxh.weibo.common.o.vo;

import java.io.Serializable;

public class UserVo implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * Column: weibo_user.UUID
	 *
	 * @mbggenerated
	 */
	private String uuid;
	/**
	 * 登录用户名. Column: weibo_user.USERNAME
	 *
	 * @mbggenerated
	 */
	private String username;
	/**
	 * 昵称. Column: weibo_user.NICKNAME
	 *
	 * @mbggenerated
	 */
	private String nickname;

	/**
	 * 个人说明. Column: weibo_user.COMMENT
	 *
	 * @mbggenerated
	 */
	private String comment;

	/**
	 * 头像. Column: weibo_user.HEADIMG
	 *
	 * @mbggenerated
	 */
	private String headimg;
	/**
	 * 微博数目. Column: weibo_user.WEIBO
	 *
	 * @mbggenerated
	 */
	private Integer weibo;
	/**
	 * 关注. Column: weibo_user.FOLLOW
	 *
	 * @mbggenerated
	 */
	private Integer follow;
	/**
	 * 粉丝. Column: weibo_user.FOLLOWER
	 *
	 * @mbggenerated
	 */
	private Integer follower;

	private Byte mutual;

	public Byte getMutual() {
		return mutual;
	}

	public void setMutual(Byte mutual) {
		this.mutual = mutual;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getHeadimg() {
		return headimg;
	}

	public void setHeadimg(String headimg) {
		this.headimg = headimg;
	}

	public Integer getWeibo() {
		return weibo;
	}

	public void setWeibo(Integer weibo) {
		this.weibo = weibo;
	}

	public Integer getFollow() {
		return follow;
	}

	public void setFollow(Integer follow) {
		this.follow = follow;
	}

	public Integer getFollower() {
		return follower;
	}

	public void setFollower(Integer follower) {
		this.follower = follower;
	}

}


text:
const config = require('config');
const fs = require('fs-extra');
const { join } = require('path');
const _ = require('underscore');
const express = require('express');

const cors = require('cors');
const MongoStore = require('connect-mongo')(express);
const helpers = require('view-helpers');
const lessMiddleware = require('less-middleware');
const pkg = require('../package');
const flash = require('connect-flash');
const env = process.env.NODE_ENV || 'development';
const mongoose = require('mongoose');
const Settings = mongoose.model('Settings');
const Mailer = require('../lib/mailer');
const i18n = require('i18next');

// Clone config because i18next tries to mutate object.
const i18nConfig = Object.assign({}, config.get('i18n'));

module.exports = function (app, passport) {
  // Add basic auth for staging
  if (env === 'staging') {
    app.use(
      express.basicAuth(function (user, pass) {
        return user === 'username' && pass === 'password';
      })
    );

    app.use(function (req, res, next) {
      if (req.remoteUser && req.user && !req.user._id) {
        delete req.user;
      }
      next();
    });
  }

  app.set('showStackError', true);

  app.use(express.logger('dev'));

  // views config
  app.set('views', join(global.appRoot, 'app', 'views'));
  app.set('view engine', 'jade');

  app.configure(function () {
    // setup less
    app.use(
      lessMiddleware(join(global.appRoot, 'public'), [
        {
          compress: true,
          force: true
        }
      ])
    );

    // Expose images files in ./media directory
    const imagesPath = join(global.appRoot, ...config.get('imagesPath'));
    fs.ensureDir(imagesPath, err => {
      if (err) {
        // eslint-disable-next-line
        console.log(`Could not initialize media directory at ${imagesPath}, images won't be served.`)
      }
    });
    app.use('/media', express.static(imagesPath));

    // Expose public files
    app.use(express.static(join(global.appRoot, 'public')));

    app.use(express.urlencoded({ limit: '5mb' }));

    // bodyParser should be above methodOverride
    app.use(express.bodyParser());

    // i18next
    i18n.init(i18nConfig);
    app.use(i18n.handle);
    i18n.registerAppHelper(app);

    // cookieParser should be above session
    app.use(express.cookieParser());
    app.use(
      express.session({
        secret: pkg.name,
        store: new MongoStore(
          {
            url: config.get('dbConnectionString'),
            collection: 'sessions'
          },
          function () {
            // eslint-disable-next-line
            console.log('MongoDB connected.');
            // start geocoder
            // new Geocoder();
          }
        )
      })
    );

    // Passport session
    app.use(passport.initialize());
    app.use(passport.session());

    // Flash messages
    app.use(flash());

    // expose pkg and node env to views
    app.use(function (req, res, next) {
      res.locals.pkg = pkg;
      res.locals.env = env;
      next();
    });

    // View helpers
    app.use(helpers(pkg.name));

    // Setup CORS
    app.use(cors());

    // routes should be at the last
    app.use(app.router);

    // custom error handler
    app.use(function (err, req, res, next) {
      if (
        err.message &&
        (~err.message.indexOf('not found') ||
          ~err.message.indexOf('Cast to ObjectId failed'))
      ) {
        return next();
      }

      // eslint-disable-next-line
      console.error(err.stack);
      res.status(500).render('500');
    });

    app.use(function (req, res, next) {
      res.status(404).render('404', { url: req.originalUrl });
    });

    // Load settings from DB
    Settings.load(function (err, settings) {
      if (!err) {
        settings = settings.toObject();
        delete settings.__v;
        delete settings._id;

        // make global
        app.locals({ settings: _.extend(app.locals.settings, settings) });

        app.locals.mailer = new Mailer(settings);
      }
    });
  });

  // development specific stuff
  app.configure('development', function () {
    app.locals.pretty = true;
  });

  // staging specific stuff
  app.configure('staging', function () {
    app.locals.pretty = true;
  });
};


text:
namespace cel {
namespace {

TEST(Kind, ToString) {
  EXPECT_EQ(KindToString(Kind::kError), "*error*");
  EXPECT_EQ(KindToString(Kind::kNullType), "null_type");
  EXPECT_EQ(KindToString(Kind::kDyn), "dyn");
  EXPECT_EQ(KindToString(Kind::kAny), "any");
  EXPECT_EQ(KindToString(Kind::kType), "type");
  EXPECT_EQ(KindToString(Kind::kBool), "bool");
  EXPECT_EQ(KindToString(Kind::kInt), "int");
  EXPECT_EQ(KindToString(Kind::kUint), "uint");
  EXPECT_EQ(KindToString(Kind::kDouble), "double");
  EXPECT_EQ(KindToString(Kind::kString), "string");
  EXPECT_EQ(KindToString(Kind::kBytes), "bytes");
  EXPECT_EQ(KindToString(Kind::kEnum), "enum");
  EXPECT_EQ(KindToString(Kind::kDuration), "duration");
  EXPECT_EQ(KindToString(Kind::kTimestamp), "timestamp");
  EXPECT_EQ(KindToString(Kind::kList), "list");
  EXPECT_EQ(KindToString(Kind::kMap), "map");
  EXPECT_EQ(KindToString(Kind::kStruct), "struct");
  EXPECT_EQ(KindToString(Kind::kUnknown), "*unknown*");
  EXPECT_EQ(KindToString(static_cast<Kind>(std::numeric_limits<int>::max())),
            "*error*");
}

}  // namespace
}  // namespace cel


text:
package codingbat.string2;

public class RepeatEnd
{
	public static void main(String[] args)
	{
	}

	/**
	 * Given a string and an int N, return a string
	 * made of N repetitions of the last N characters
	 * of the string. You may assume that N is between 0
	 * and the length of the string, inclusive.
	 *
	 * repeatEnd("Hello", 3) → "llollollo"
	 * repeatEnd("Hello", 2) → "lolo"
	 * repeatEnd("Hello", 1) → "o"
	 */
	public String repeatEnd(String str, int n)
	{
		String rep = str.substring(str.length() - n);
		String ret = "";
		for (int i = 0; i < n ; i++)
		{
			ret = ret + rep;
		}

		return ret;
	}
}


text:
.class public Lcom/upsight/mediation/IAPOfferInfo;
.super Ljava/lang/Object;
.source "IAPOfferInfo.java"

# instance fields
.field public endTime:Ljava/util/Date;

.field public itemAmount:I

.field public itemName:Ljava/lang/String;

.field public metadata:Ljava/lang/String;

.field public productID:Ljava/lang/String;

.field public productPrice:F

.field public startTime:Ljava/util/Date;

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

    .prologue
    .line 12
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .registers 7
    .param p1, "o"    # Ljava/lang/Object;

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 38
    if-ne p0, p1, :cond_6

    move v2, v1

    .line 52
    :cond_5
    :goto_5
    return v2

    .line 39
    :cond_6
    if-eqz p1, :cond_5

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    if-ne v3, v4, :cond_5

    move-object v0, p1

    .line 41
    check-cast v0, Lcom/upsight/mediation/IAPOfferInfo;

    .line 43
    .local v0, "that":Lcom/upsight/mediation/IAPOfferInfo;
    iget v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    iget v4, p0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    invoke-static {v3, v4}, Ljava/lang/Float;->compare(FF)I

    move-result v3

    if-nez v3, :cond_5

    .line 44
    iget v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemAmount:I

    iget v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->itemAmount:I

    if-ne v3, v4, :cond_5

    .line 45
    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    if-eqz v3, :cond_6e

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    iget-object v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 47
    :cond_33
    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    if-eqz v3, :cond_73

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    iget-object v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 49
    :cond_41
    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    if-eqz v3, :cond_78

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    iget-object v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    invoke-virtual {v3, v4}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 51
    :cond_4f
    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    if-eqz v3, :cond_7d

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    iget-object v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    invoke-virtual {v3, v4}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 52
    :cond_5d
    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    if-eqz v3, :cond_82

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    iget-object v4, v0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_6c

    :cond_6b
    move v1, v2

    :cond_6c
    :goto_6c
    move v2, v1

    goto :goto_5

    .line 45
    :cond_6e
    iget-object v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    if-eqz v3, :cond_33

    goto :goto_5

    .line 47
    :cond_73
    iget-object v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    if-eqz v3, :cond_41

    goto :goto_5

    .line 49
    :cond_78
    iget-object v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    if-eqz v3, :cond_4f

    goto :goto_5

    .line 51
    :cond_7d
    iget-object v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    if-eqz v3, :cond_5d

    goto :goto_5

    .line 52
    :cond_82
    iget-object v3, v0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    if-nez v3, :cond_6b

    goto :goto_6c
.end method

.method public hashCode()I
    .registers 5

    .prologue
    const/4 v1, 0x0

    .line 58
    iget v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    const/4 v3, 0x0

    cmpl-float v2, v2, v3

    if-eqz v2, :cond_5b

    iget v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    invoke-static {v2}, Ljava/lang/Float;->floatToIntBits(F)I

    move-result v0

    .line 59
    .local v0, "result":I
    :goto_e
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemAmount:I

    add-int v0, v2, v3

    .line 60
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    if-eqz v2, :cond_5d

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_20
    add-int v0, v3, v2

    .line 61
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    if-eqz v2, :cond_5f

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_2e
    add-int v0, v3, v2

    .line 62
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    if-eqz v2, :cond_61

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    invoke-virtual {v2}, Ljava/util/Date;->hashCode()I

    move-result v2

    :goto_3c
    add-int v0, v3, v2

    .line 63
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    if-eqz v2, :cond_63

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    invoke-virtual {v2}, Ljava/util/Date;->hashCode()I

    move-result v2

    :goto_4a
    add-int v0, v3, v2

    .line 64
    mul-int/lit8 v2, v0, 0x1f

    iget-object v3, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    if-eqz v3, :cond_58

    iget-object v1, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    invoke-virtual {v1}, Ljava/lang/String;->hashCode()I

    move-result v1

    :cond_58
    add-int v0, v2, v1

    .line 65
    return v0

    .end local v0    # "result":I
    :cond_5b
    move v0, v1

    .line 58
    goto :goto_e

    .restart local v0    # "result":I
    :cond_5d
    move v2, v1

    .line 60
    goto :goto_20

    :cond_5f
    move v2, v1

    .line 61
    goto :goto_2e

    :cond_61
    move v2, v1

    .line 62
    goto :goto_3c

    :cond_63
    move v2, v1

    .line 63
    goto :goto_4a
.end method

.method public toJSONString()Ljava/lang/String;
    .registers 5

    .prologue
    .line 70
    :try_start_0
    new-instance v0, Lorg/json/JSONStringer;

    invoke-direct {v0}, Lorg/json/JSONStringer;-><init>()V

    invoke-virtual {v0}, Lorg/json/JSONStringer;->object()Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "IAPOfferInfo"

    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v0

    .line 71
    invoke-virtual {v0}, Lorg/json/JSONStringer;->object()Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "productPrice"

    .line 72
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v0

    iget v1, p0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    float-to-double v2, v1

    invoke-virtual {v0, v2, v3}, Lorg/json/JSONStringer;->value(D)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "itemAmount"

    .line 73
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v0

    iget v1, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemAmount:I

    int-to-long v2, v1

    invoke-virtual {v0, v2, v3}, Lorg/json/JSONStringer;->value(J)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "itemName"

    .line 74
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v0

    iget-object v1, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "productID"

    .line 75
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v0

    iget-object v1, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "startTime"

    .line 76
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v1

    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    if-nez v0, :cond_82

    const-string v0, ""

    :goto_51
    invoke-virtual {v1, v0}, Lorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "endTime"

    .line 77
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v1

    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    if-nez v0, :cond_8d

    const-string v0, ""

    :goto_61
    invoke-virtual {v1, v0}, Lorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;

    move-result-object v0

    const-string v1, "metadata"

    .line 78
    invoke-virtual {v0, v1}, Lorg/json/JSONStringer;->key(Ljava/lang/String;)Lorg/json/JSONStringer;

    move-result-object v1

    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    if-nez v0, :cond_98

    const-string v0, ""

    :goto_71
    invoke-virtual {v1, v0}, Lorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;

    move-result-object v0

    .line 79
    invoke-virtual {v0}, Lorg/json/JSONStringer;->endObject()Lorg/json/JSONStringer;

    move-result-object v0

    invoke-virtual {v0}, Lorg/json/JSONStringer;->endObject()Lorg/json/JSONStringer;

    move-result-object v0

    invoke-virtual {v0}, Lorg/json/JSONStringer;->toString()Ljava/lang/String;

    move-result-object v0

    .line 81
    :goto_81
    return-object v0

    .line 76
    :cond_82
    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    goto :goto_51

    .line 77
    :cond_8d
    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    goto :goto_61

    .line 78
    :cond_98
    iget-object v0, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    const/4 v2, 0x2

    invoke-static {v0, v2}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
    :try_end_a2
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_a2} :catch_a4

    move-result-object v0

    goto :goto_71

    .line 80
    :catch_a4
    move-exception v0

    .line 81
    const-string v0, "{ \"IAPOfferInfo\" : \"\" }"

    goto :goto_81
.end method

.method public toString()Ljava/lang/String;
    .registers 5

    .prologue
    const/16 v3, 0x27

    .line 24
    new-instance v0, Ljava/lang/StringBuffer;

    const-string v1, "IAPOfferInfo{"

    invoke-direct {v0, v1}, Ljava/lang/StringBuffer;-><init>(Ljava/lang/String;)V

    .line 25
    .local v0, "sb":Ljava/lang/StringBuffer;
    const-string v1, "productPrice="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productPrice:F

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(F)Ljava/lang/StringBuffer;

    .line 26
    const-string v1, ", itemAmount="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemAmount:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(I)Ljava/lang/StringBuffer;

    .line 27
    const-string v1, ", itemName=\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->itemName:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, v3}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 28
    const-string v1, ", productID=\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->productID:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, v3}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 29
    const-string v1, ", startTime="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->startTime:Ljava/util/Date;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/Object;)Ljava/lang/StringBuffer;

    .line 30
    const-string v1, ", endTime="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->endTime:Ljava/util/Date;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/Object;)Ljava/lang/StringBuffer;

    .line 31
    const-string v1, ", metadata=\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Lcom/upsight/mediation/IAPOfferInfo;->metadata:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, v3}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 32
    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 33
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method


text:
@interface MHAudioHelper : NSObject

MHSingletonH(Instance)

/// 是否正在震动
@property (nonatomic, readonly, assign , getter = isVibration) BOOL vibration;

/// 播放震动
- (void)playVibration;
/// 停止震动
- (void)stopVibration;

/// 播放音频文件
+ (void)playSoundWithName:(NSString *)soundName;
/// 播放音乐文件
+ (AVAudioPlayer *)playMusicWithName:(NSString *)musicName;
/// 暂停音乐
+ (void)pauseMusicWithName:(NSString *)musicName;
/// 停止音乐
+ (void)stopMusicWithName:(NSString *)musicName;
@end


text:
OpenBazaar Cookbook CHANGELOG
=============================

This file is used to list changes made in each version of the openbazaar cookbook.

0.6.0
-----
- Remove unneeded dependencies after the service lwrp refactor

0.5.0
-----
- Initial support for Debian 7 and 8.  Partial support for CentOS

0.4.2
-----
- added another supported platform, ubuntu 15.04

0.4.1
-----
- added some additional ubuntu > 14.04 service manipulation protection

0.4.0
-----
- initial support for Ubuntu 16.04 (no service manipulation yet)

0.3.12
------
- removed upstart provider within service resources

0.3.11
------
- travis-ci integration

0.3.10
------
- rubocop updates

0.3.9
-----
- Test coverage, minor code updates

0.3.8
-----
- Added some more examples to the documentation

0.3.7
-----
- Documentation whitespace cleanup

0.3.6
-----
- Documentation whitespace cleanup

0.3.5
-----
- Documentation and metadata cleanup

0.3.4
-----
- Changed to table layout for attributes

0.3.2
-----
- Added skeleton for tests
- updated readme for tested platforms

0.3.1
-----
- Documentation clean up

0.3.0
-----
- defaults to the binary installation unless over-ridden.
- clean up of code base

0.2.3
-----
- Updated the full list of dependencies (and the sub-dependencies) in the documentation.
- Added some project related support files

0.2.2
-----
- Joshua C. Burt - Initial release of openbazaar

- - -
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.

The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.


text: std::wostream *outputStream = &std::wcout;


text:
#system-fluid {
    display: flex;
    flex-wrap: wrap;
    height: 100%;
}

/* Small layout: stack all graphs on top of each other, space split equally */
@media (min-width: 0px) {
    #system-fluid {
        flex-direction: column;
    }
    #system-fluid .system-item {
        flex: 1;
    }
}

/* Large layout: as many rows as necessary, each item consuming at least
 * half of the width */
@media (min-width: 992px) {
    #system-fluid {
        flex-direction: row;
    }
    #system-fluid .system-item {
        flex: 1 50%;
    }
}


text:
package org.meqantt;

import java.net.InetSocketAddress;
import java.util.concurrent.Executors;

import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
import org.meqantt.message.ConnectMessage;
import org.meqantt.message.DisconnectMessage;
import org.meqantt.message.PingReqMessage;
import org.meqantt.message.PublishMessage;
import org.meqantt.message.QoS;
import org.meqantt.message.SubscribeMessage;
import org.meqantt.message.UnsubscribeMessage;
import org.meqantt.netty.MqttMessageDecoder;
import org.meqantt.netty.MqttMessageEncoder;
import org.meqantt.netty.MqttMessageHandler;

public class NettyClient {

	private Channel channel;
	private ClientBootstrap bootstrap;
	private final String id;
	private MqttListener listener;
	private MqttMessageHandler handler;

	public NettyClient(String id) {
		this.id = id;
	}

	public void setListener(MqttListener listener) {
		this.listener = listener;
		if (handler != null) {
			handler.setListener(listener);
		}
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#connect(java.lang.String, int)
	 */
	public void connect(String host, int port) {
		bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(
				Executors.newCachedThreadPool(),
				Executors.newCachedThreadPool()));

		handler = new MqttMessageHandler();
		handler.setListener(listener);
		bootstrap.setPipelineFactory(new ChannelPipelineFactory() {

			public ChannelPipeline getPipeline() throws Exception {
				return Channels.pipeline(new MqttMessageEncoder(),
						new MqttMessageDecoder(), handler);
			}
		});

		bootstrap.setOption("tcpNoDelay", true);
		bootstrap.setOption("keepAlive", true);

		ChannelFuture future = bootstrap.connect(new InetSocketAddress(host,
				port));

		channel = future.awaitUninterruptibly().getChannel();
		if (!future.isSuccess()) {
			future.getCause().printStackTrace();
			bootstrap.releaseExternalResources();
			return;
		}

		channel.write(new ConnectMessage(id, true, 30));
		// TODO: Should probably wait for the ConnAck message
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#disconnect()
	 */
	public void disconnect() {
		channel.write(new DisconnectMessage()).awaitUninterruptibly();
		channel.close().awaitUninterruptibly();
		bootstrap.releaseExternalResources();
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#subscribe(java.lang.String)
	 */
	public void subscribe(String topic) {
		channel.write(new SubscribeMessage(topic, QoS.AT_MOST_ONCE));
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#unsubscribe(java.lang.String)
	 */
	public void unsubscribe(String topic) {
		channel.write(new UnsubscribeMessage(topic));
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#publish(java.lang.String, java.lang.String)
	 */
	public void publish(String topic, String msg) {
		channel.write(new PublishMessage(topic, msg));
	}

	/* (non-Javadoc)
	 * @see com.albin.mqtt.MqttClient#ping()
	 */
	public void ping() {
		channel.write(new PingReqMessage());
	}

}


text: document.title += " with appendix";


text:
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/sync/interprocess_semaphore.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include "named_creation_template.hpp"
#include "mutex_test_template.hpp"

static const std::size_t SemCount      = 1;
static const std::size_t RecSemCount   = 100;

//This wrapper is necessary to plug this class
//in named creation tests and interprocess_mutex tests
class semaphore_test_wrapper
   : public boost::interprocess::interprocess_semaphore
{
   public:
   semaphore_test_wrapper()
      :  boost::interprocess::interprocess_semaphore(SemCount)
   {}

   void lock()
   {  this->wait();  }

   bool try_lock()
   {  return this->try_wait();  }

   bool timed_lock(const boost::posix_time::ptime &pt)
   {  return this->timed_wait(pt);  }

   void unlock()
   {  this->post();  }

   protected:
   semaphore_test_wrapper(int initial_count)
      :  boost::interprocess::interprocess_semaphore(initial_count)
   {}
};

//This wrapper is necessary to plug this class
//in recursive tests
class recursive_semaphore_test_wrapper
   :  public semaphore_test_wrapper
{
   public:
   recursive_semaphore_test_wrapper()
      :  semaphore_test_wrapper(RecSemCount)
   {}
};

int main ()
{
   using namespace boost::interprocess;

   test::test_all_lock<semaphore_test_wrapper>();
   test::test_all_recursive_lock<recursive_semaphore_test_wrapper>();
   test::test_all_mutex<semaphore_test_wrapper>();
   return 0;
}

#include <boost/interprocess/detail/config_end.hpp>


text:
layout: page
title: Owen Sub Company Show
date: 2016-05-24
author: Daniel Frederick
tags: weekly links, java
status: published
summary: Etiam lobortis nisi vel hendrerit imperdiet. Fusce et.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 03/24/2019
  endDate: 03/27/2019
  ctyhocn: BZNMTHX
  groupCode: OSCS
published: true
---
Curabitur at dui ut enim consectetur facilisis. In vel nisi sed enim dignissim eleifend ac non ex. Praesent imperdiet sit amet ligula a semper. Morbi in magna arcu. Nunc consequat pharetra augue, sit amet vehicula libero mattis non. Aliquam quam lectus, volutpat vel mauris a, feugiat suscipit erat. Sed lacus quam, feugiat at velit ac, dapibus dictum felis. Quisque sed tincidunt nibh, eu commodo leo. Praesent facilisis eros nec lorem porta, eu sollicitudin turpis molestie. Donec nec massa eget urna vulputate aliquet. Donec tempor et nibh malesuada tincidunt. Curabitur bibendum lectus tincidunt, egestas massa nec, luctus lacus. Duis vel vestibulum felis. Quisque convallis rutrum tortor eu aliquet.

* Ut sagittis augue id sagittis feugiat
* Pellentesque ut eros eget urna varius ullamcorper eget ac mauris.

Suspendisse vel viverra tellus. Nunc sit amet tristique orci, at viverra nibh. Fusce sagittis sapien eu tempus efficitur. Ut interdum quis mauris sit amet vestibulum. Curabitur placerat diam sit amet libero mattis iaculis. Nulla vulputate quis tortor ac condimentum. Sed bibendum blandit urna, et lacinia justo pretium in. Donec volutpat ullamcorper mauris nec ultrices. Suspendisse congue quam metus, sit amet egestas sapien sagittis condimentum. Aenean nisi mauris, laoreet sed neque eu, molestie viverra tellus.


text:
package org.olat.course.nodes.basiclti;

import org.olat.core.commons.fullWebApp.LayoutMain3ColsPreviewController;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.tabbedpane.TabbedPane;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.ControllerEventListener;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController;
import org.olat.course.ICourse;
import org.olat.course.assessment.AssessmentHelper;
import org.olat.course.condition.Condition;
import org.olat.course.condition.ConditionEditController;
import org.olat.course.editor.NodeEditController;
import org.olat.course.groupsandrights.CourseGroupManager;
import org.olat.course.nodes.BasicLTICourseNode;
import org.olat.course.run.environment.CourseEnvironment;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
import org.olat.modules.ModuleConfiguration;

/**
 * Description:

 * This edit controller is used to edit a course building block of type basic lti
 *

 * Initial Date: march 2010
 *
 * @author guido
 * @author Charles Severance
 */
public class LTIEditController extends ActivateableTabbableDefaultController implements ControllerEventListener {

	public static final String PANE_TAB_LTCONFIG = "pane.tab.ltconfig";
	public static final String PANE_TAB_ACCESSIBILITY = "pane.tab.accessibility";

	private static final String[] paneKeys = { PANE_TAB_LTCONFIG, PANE_TAB_ACCESSIBILITY };

	private ModuleConfiguration config;
	private final CourseEnvironment editCourseEnv;
	private final VelocityContainer myContent;

	private final LTIConfigForm ltConfigForm;
	private final BasicLTICourseNode courseNode;
	private final ConditionEditController accessibilityCondContr;
	private TabbedPane myTabbedPane;
	private LayoutMain3ColsPreviewController previewLayoutCtr;
	private final Link previewButton;
	private Controller tunnelRunCtr;

	/**
	 * Constructor for tunneling editor controller
	 *
	 * @param config The node module configuration
	 * @param ureq The user request
	 * @param wControl The window controller
	 * @param tuCourseNode The current single page course node
	 * @param course
	 */
	public LTIEditController(final ModuleConfiguration config, final UserRequest ureq, final WindowControl wControl, final BasicLTICourseNode ltCourseNode,
			final ICourse course, final UserCourseEnvironment euce) {
		super(ureq, wControl);

		this.config = config;
		this.courseNode = ltCourseNode;
		this.editCourseEnv = course.getCourseEnvironment();

		myContent = this.createVelocityContainer("edit");
		previewButton = LinkFactory.createButtonSmall("command.preview", myContent, this);

		ltConfigForm = new LTIConfigForm(ureq, wControl, config);
		listenTo(ltConfigForm);

		myContent.put("ltConfigForm", ltConfigForm.getInitialComponent());

		final CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
		final CourseEditorTreeModel editorModel = course.getEditorTreeModel();
		// Accessibility precondition
		final Condition accessCondition = courseNode.getPreConditionAccess();
		accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessabilityConditionForm",
				AssessmentHelper.getAssessableNodes(editorModel, ltCourseNode), euce);
		this.listenTo(accessibilityCondContr);

		// Enable preview button only if node configuration is valid
		if (!(ltCourseNode.isConfigValid().isError())) {
			myContent.contextPut("showPreviewButton", Boolean.TRUE);
		} else {
			myContent.contextPut("showPreviewButton", Boolean.FALSE);
		}

	}

	/**
	 * config.set
	 *
	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
	 */
	@Override
	public void event(final UserRequest ureq, final Component source, final Event event) {
		if (source == previewButton) { // those must be links

			removeAsListenerAndDispose(tunnelRunCtr);
			tunnelRunCtr = new LTIRunController(getWindowControl(), config, ureq, courseNode, editCourseEnv);
			listenTo(tunnelRunCtr);

			// preview layout: only center column (col3) used
			removeAsListenerAndDispose(previewLayoutCtr);
			previewLayoutCtr = new LayoutMain3ColsPreviewController(ureq, getWindowControl(), null, null, tunnelRunCtr.getInitialComponent(), null);
			previewLayoutCtr.addDisposableChildController(tunnelRunCtr); // cascade dispose
			listenTo(previewLayoutCtr);

			previewLayoutCtr.activate();
		}
	}

	/**
	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
	 */
	@Override
	public void event(final UserRequest ureq, final Controller source, final Event event) {
		if (source == accessibilityCondContr) {
			if (event == Event.CHANGED_EVENT) {
				final Condition cond = accessibilityCondContr.getCondition();
				courseNode.setPreConditionAccess(cond);
				fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
			}
		} else if (source == ltConfigForm) {
			if (event == Event.CANCELLED_EVENT) {
				// do nothing
			} else if (event == Event.DONE_EVENT) {
				config = ltConfigForm.getUpdatedConfig();
				fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
				// form valid -> node config valid -> show preview button
				myContent.contextPut("showPreviewButton", Boolean.TRUE);
			}
		}
	}

	/**
	 * @see org.olat.core.gui.control.generic.tabbable.TabbableDefaultController#addTabs(org.olat.core.gui.components.TabbedPane)
	 */
	@Override
	public void addTabs(final TabbedPane tabbedPane) {
		myTabbedPane = tabbedPane;
		tabbedPane.addTab(translate(PANE_TAB_ACCESSIBILITY), accessibilityCondContr.getWrappedDefaultAccessConditionVC(translate("condition.accessibility.title")));
		tabbedPane.addTab(translate(PANE_TAB_LTCONFIG), myContent);
	}

	/**
	 * @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
	 */
	@Override
	protected void doDispose() {
		//
	}

	@Override
	public String[] getPaneKeys() {
		return paneKeys;
	}

	@Override
	public TabbedPane getTabbedPane() {
		return myTabbedPane;
	}

}


text:
package com.bkromhout.ruqus.transformers;

import android.support.annotation.NonNull;
import com.bkromhout.ruqus.*;
import io.realm.RealmModel;
import io.realm.RealmQuery;

import java.util.Date;

import static com.bkromhout.ruqus.ReadableStringUtils.notNOT;

/**
 * Transformer which wraps the various {@link RealmQuery} {@code equalTo()} methods.
 */
@Transformer(name = Names.EQUAL_TO, validArgTypes = {Boolean.class, Date.class, Double.class, Float.class,
                                                     Integer.class, Long.class, Short.class, String.class})
public class EqualTo extends RUQTransformer {
    @Override
    public <T extends RealmModel> RealmQuery<T> transform(RealmQuery<T> realmQuery, Condition condition) {
        // Checks.
        if (!condition.isValid()) throw new IllegalArgumentException("Condition isn't valid.");
        if (condition.getType() != Condition.Type.NORMAL)
            throw new IllegalArgumentException("Condition type is not NORMAL.");

        // Get data from Conditions.
        String field = condition.getField();
        FieldType fieldType = condition.getFieldType();
        Object[] args = condition.getArgs();

        // Use different methods based on field type.
        if (FieldType.BOOLEAN == fieldType) return realmQuery.equalTo(field, (Boolean) args[0]);
        else if (FieldType.DATE == fieldType) return realmQuery.equalTo(field, (Date) args[0]);
        else if (FieldType.DOUBLE == fieldType) return realmQuery.equalTo(field, (Double) args[0]);
        else if (FieldType.FLOAT == fieldType) return realmQuery.equalTo(field, (Float) args[0]);
        else if (FieldType.INTEGER == fieldType) return realmQuery.equalTo(field, (Integer) args[0]);
        else if (FieldType.LONG == fieldType) return realmQuery.equalTo(field, (Long) args[0]);
        else if (FieldType.SHORT == fieldType) return realmQuery.equalTo(field, (Short) args[0]);
        else if (FieldType.STRING == fieldType) return realmQuery.equalTo(field, (String) args[0]);
        else
            throw new IllegalArgumentException(String.format("Illegal argument type \"%s\".", fieldType.getTypeName()));
    }

    @Override
    public String makeReadableString(@NonNull Condition current, Condition previous, Condition next) {
        return String.format(current.getFieldType() == FieldType.STRING ? "%s %s "%s"" : "%s %s %s",
                ReadableStringUtils.visibleFieldNameFrom(current),
                notNOT(previous) ? "is" : "is not",
                ReadableStringUtils.argToString(current.getFieldType(), current.getArgs()[0]));
    }
}


text:
@interface FansCell : MCSwipeTableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *photo;

@property (weak, nonatomic) IBOutlet UILabel *nicknameLbl;
@property (weak, nonatomic) IBOutlet UILabel *schoolLbl;
@property (weak, nonatomic) IBOutlet UILabel *departmentLbl;
@property (weak, nonatomic) IBOutlet UILabel *gradeLbl;

@property(strong,nonatomic) User *user;

@end


text:
module Friends
  POST_INSTALL_MESSAGE = "\nfriends is a volunteer project. If you find it useful, please "\
                         "consider making a small donation:\n\n\t"\
                         "https://github.com/JacobEvelyn/friends#contributing-its-encouraged\n\n"
end