text:
<?php
declare(strict_types=1);

namespace Happyr\DoctrineSpecification\Query;

use Doctrine\ORM\QueryBuilder;
use Happyr\DoctrineSpecification\Operand\Alias;
use Happyr\DoctrineSpecification\Operand\Field;

final class OrderBy implements QueryModifier
{
    public const ASC = 'ASC';

    public const DESC = 'DESC';

    /**
     * @var Field|Alias
     */
    private $field;

    /**
     * @var string
     */
    private $order;

    /**
     * @var string|null
     */
    private $context;

    /**
     * @param Field|Alias|string $field
     * @param string             $order
     * @param string|null        $context
     */
    public function __construct($field, string $order = self::ASC, ?string $context = null)
    {
        if (!($field instanceof Field) && !($field instanceof Alias)) {
            $field = new Field($field);
        }

        $this->field = $field;
        $this->order = $order;
        $this->context = $context;
    }

    /**
     * @param QueryBuilder $qb
     * @param string       $context
     */
    public function modify(QueryBuilder $qb, string $context): void
    {
        if (null !== $this->context) {
            $context = sprintf('%s.%s', $context, $this->context);
        }

        $qb->addOrderBy($this->field->transform($qb, $context), $this->order);
    }
}


text:
import os
import sys
import imp
import base64
import re
import json
import platform
import shutil
import time
import traceback
import datetime
import subprocess
from redhatPatching import redhatPatching
from Common import *

class centosPatching(redhatPatching):
    def __init__(self,logger,distro_info):
        super(centosPatching,self).__init__(logger,distro_info)
        self.logger = logger
        if(distro_info[1] == "6.7" or distro_info[1] == "6.6" or distro_info[1] == "6.5"):
            self.base64_path = '/usr/bin/base64'
            self.bash_path = '/bin/bash'
            self.blkid_path = '/sbin/blkid'
            self.cat_path = '/bin/cat'
            self.cryptsetup_path = '/sbin/cryptsetup'
            self.dd_path = '/bin/dd'
            self.e2fsck_path = '/sbin/e2fsck'
            self.echo_path = '/bin/echo'
            self.lsblk_path = '/bin/lsblk'
            self.lsscsi_path = '/usr/bin/lsscsi'
            self.mkdir_path = '/bin/mkdir'
            self.mount_path = '/bin/mount'
            self.openssl_path = '/usr/bin/openssl'
            self.resize2fs_path = '/sbin/resize2fs'
            self.umount_path = '/bin/umount'
        else:
            self.base64_path = '/usr/bin/base64'
            self.bash_path = '/usr/bin/bash'
            self.blkid_path = '/usr/bin/blkid'
            self.cat_path = '/bin/cat'
            self.cryptsetup_path = '/usr/sbin/cryptsetup'
            self.dd_path = '/usr/bin/dd'
            self.e2fsck_path = '/sbin/e2fsck'
            self.echo_path = '/usr/bin/echo'
            self.lsblk_path = '/usr/bin/lsblk'
            self.lsscsi_path = '/usr/bin/lsscsi'
            self.mkdir_path = '/usr/bin/mkdir'
            self.mount_path = '/usr/bin/mount'
            self.openssl_path = '/usr/bin/openssl'
            self.resize2fs_path = '/sbin/resize2fs'
            self.umount_path = '/usr/bin/umount'

    def install_extras(self):
        common_extras = ['cryptsetup','lsscsi']
        for extra in common_extras:
            self.logger.log("installation for " + extra + 'result is ' + str(subprocess.call(['yum', 'install','-y', extra])))

redpajama_set_name: RedPajamaGithub


text:
package com.tle.json.entity;

import com.dytech.devlib.PropBagEx;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import com.tle.json.BaseJSONCreator;
import java.util.Collection;
import java.util.Date;

@SuppressWarnings("nls")
public class Items extends BaseJSONCreator {
  public static ObjectNode json(String collection) {
    return jsonXml(collection, null);
  }

  public static ObjectNode editMetadata(
      ObjectNode item, String firstParam, Object value, Object... others) {
    PropBagEx metadata = new PropBagEx(item.get("metadata").asText());
    editXmlMetadata(metadata, firstParam, value, others);
    item.put("metadata", metadata.toString());
    return item;
  }

  public static ObjectNode addAttachment(ObjectNode item, String filename) {
    ObjectNode attachment = mapper.createObjectNode();
    attachment.put("type", "file");
    attachment.put("filename", filename);
    attachment.put("description", filename);
    item.withArray("attachments").add(attachment);
    return item;
  }

  private static PropBagEx editXmlMetadata(
      PropBagEx metadata, String firstParam, Object value, Object... others) {
    metadata.setNode(firstParam, value.toString());
    for (int i = 0; i < others.length; i++) {
      metadata.setNode(others[i].toString(), others[++i].toString());
    }
    return metadata;
  }

  public static ObjectNode json(
      String collection, String firstParam, Object value, Object... others) {
    PropBagEx metadata = new PropBagEx();
    editXmlMetadata(metadata, firstParam, value, others);
    return jsonXml(collection, metadata.toString());
  }

  public static ObjectNode jsonXml(String collection, String xml) {
    ObjectNode item = mapper.createObjectNode();
    item.with("collection").put("uuid", collection);
    item.put("metadata", xml);
    return item;
  }

  public static ObjectNode history(String userId, Date date, String event, String state) {
    return history(userId, date, event, state, null, null, null, null, null);
  }

  public static ObjectNode history(
      String userId,
      Date date,
      String event,
      String state,
      String msg,
      String step,
      String toStep,
      String stepName,
      String toStepName) {
    ObjectNode hevent = mapper.createObjectNode();
    hevent.with("user").put("id", userId);
    hevent.put("date", ISO8601Utils.format(date));
    hevent.put("type", event);
    hevent.put("state", state);
    hevent.put("comment", msg);
    hevent.put("step", step);
    hevent.put("toStep", toStep);
    hevent.put("stepName", stepName);
    hevent.put("toStepName", toStepName);
    return hevent;
  }

  public static ObjectNode importStatus(String uuid, char status) {
    ObjectNode ns = mapper.createObjectNode();
    ns.put("uuid", uuid);
    ns.put("status", Character.toString(status));
    return ns;
  }

  public static ObjectNode statusMsg(char type, String message, String userId, Date date) {
    String typeStr;
    switch (type) {
      case 'a':
        typeStr = "accept";
        break;
      case 'r':
        typeStr = "reject";
        break;
      case 's':
        typeStr = "submit";
        break;
      case 'c':
        typeStr = "comment";
        break;
      default:
        throw new Error("Unsupported type: " + type);
    }
    ObjectNode msg = mapper.createObjectNode();
    msg.put("type", typeStr);
    msg.put("message", message);
    msg.put("date", ISO8601Utils.format(date));
    msg.with("user").put("id", userId);
    return msg;
  }

  public static ObjectNode importTaskStatus(
      String uuid, char status, Date started, Date due, Collection<String> accepted) {
    ObjectNode ns = importStatus(uuid, status);
    ns.put("started", ISO8601Utils.format(started));
    ns.put("due", due != null ? ISO8601Utils.format(due) : null);
    ArrayNode users = ns.withArray("acceptedUsers");
    for (String user : accepted) {
      users.add(user);
    }
    return ns;
  }
}


text:
Puppet::Type.newtype(:nimsoft_oracle_profile) do

  @doc = "The `nimsoft_oracle_connection` type can be used to describe
    a profile of the `oracle` probe to monitor an oracle instance. It is
    most useful together with the `nimsoft_oracle_connection` type."

  newparam(:name) do
    desc "The name of the profile"
    isnamevar
  end

  ensurable

  newproperty(:active) do
    desc "Wether the profile should be active (`yes`) or not (`no`)"

    newvalues :yes, :no
  end

  newproperty(:description) do
    desc "A short description"
  end

  newproperty(:connection) do
    desc "The name of the connection this profile should use. You can
      create the connection with the `nimsoft_oracle_connection` type."
  end

  newproperty(:source) do
    desc "The alarm source that should be used in outgoing events"
  end

  newproperty(:interval) do
    desc "Specifies the default interval between two checkpoint
      executions if no specific value is defined in the checkpoint
      itself"

    validate do |value|
      unless /^\d+ (sec|min)$/.match(value)
        raise Puppet::Error, "interval must be a positive number and must be specified in \"sec\" or \"min\", not #{value.inspect}"
      end
    end
  end

  newproperty(:heartbeat) do
    desc "Specifies the interval at which all checkpoint schedules
      will be tested and trigger eventual checkpoint executions."

    validate do |value|
      unless /^\d+ (sec|min)$/.match(value)
        raise Puppet::Error, "heartbeat must be a positive number and must be specified in \"sec\" or \"min\", not #{value.inspect}"
      end
    end
  end

  newproperty(:profile_timeout) do
    desc "The timeout for the whole profile. Can be expressed in minutes
      (e.g. `10 min`) or seconds (e.g. `30 sec`)"

    validate do |value|
      unless /^\d+ (sec|min)$/.match(value)
        raise Puppet::Error, "profile_timeout must be a positive number and must be specified in \"sec\" or \"min\", not #{value.inspect}"
      end
    end
  end

  newproperty(:sql_timeout) do
    desc "The timeout for each sql query that represents one checkpoint
      Can be expressed in minutes (e.g. `10 min`) or seconds (e.g. `30 sec`)"

    validate do |value|
      unless /^\d+ (sec|min)$/.match(value)
        raise Puppet::Error, "sql_timeout must be a positive number and must be specified in \"sec\" or \"min\", not #{value.inspect}"
      end
    end
  end

  newproperty(:profile_timeout_msg) do
    desc "Messagename for profile timeout alarms"
  end

  newproperty(:sql_timeout_msg) do
    desc "Messagename for sql timeout alarms"
  end

  newproperty(:clear_msg) do
    desc "Messagename for timeout clear messages"
  end

  newproperty(:severity) do
    desc "The severity used for timeout messages"
    newvalues :info, :warning, :minor, :major, :critical
  end

  newproperty(:connection_failed_msg) do
    desc "Messagename fot the message that should be sent in case no
      connection to the database is possible"
  end

  autorequire(:nimsoft_oracle_connection) do
    self[:connection]
  end

end


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [2.2.1] - 2022-02-08
### Added
  - default allow all hosts, see play.filters.hosts in application.conf
### Changed
- Working default configuration:
  - log configuration now in conf/logback.conf
  - configure application secret with play.http.secret.key in application.conf
  - configure key- and truststore with play.ws.ssl in application.conf
### Fixed
  - HTTP client does not do SNI [#21](https://github.com/BandwidthOnDemand/nsi-safnari/issues/21)

## [2.2.0] - 2022-02-04
### Added
- Change log.
- Release all artifacts to GitHub.
### Changed
- Upgrade Play framework:
  - Play 2.7.9
  - Scala 2.13.7
  - Sbt 1.5.5
- Using default Akka web server instead of Netty


text:
#import <UIKit/UIKit.h>

@interface FBScrollViewController : UIViewController

@end


text:
ThreeJS 3D model of walipini

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

## Installation

Run the install command:

    npm install --save walipini-model-3d

## Usage

Require this module into your ThreeJS application.

The module exports a `create(options)` function,
which returns with an `THREE.Object()` parent object that holds the whole walipini model.

You can add this model to your scene, with the `scene.add()` function.

## The walipini options

TBD.

---

This project was generated by the
[kickoff](https://github.com/tombenke/kickoff) utility.


text:
<?php

namespace PBlondeau\Bundle\BiographyBundle\Form\Type;

use PBlondeau\Bundle\BiographyBundle\Entity\Biography;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BiographyType extends AbstractType
{

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('content', 'genemu_tinymce', array(
                'required' => true,
                'configs' => array (
                    'width'   => 'auto',
                    'height'  => 400,
                    'theme'   => 'modern',
                    'theme_advanced_toolbar_location' => 'top',
                    'theme_advanced_toolbar_align' => 'left',
                    'theme_advanced_statusbar_location' => 'bottom',
                    'theme_advanced_resizing' => false,
                    'theme_advanced_resizing_use_cookie' => false,
                    'skin_variant' => 'silver',
                    'plugins' => array(
                        "advlist autolink lists link image charmap print preview anchor",
                        "searchreplace visualblocks code fullscreen",
                        "insertdatetime media table contextmenu paste"
                    ),
                    'toolbar' => "undo redo | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link",
                )
            ))
            ->add('file', 'file', array(
                'required' => !$this->isEditMode($options)
            ));
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'PBlondeau\Bundle\BiographyBundle\Entity\Biography',
            'csrf_protection' => false,
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'pblondeau_bundle_biography';
    }

    /**
     * @param $options
     *
     * @return bool
     */
    private function isEditMode($options)
    {
        /** @var Biography $biography */
        $biography = $options['data'];

        if ($biography && !$biography->isNew()) {
            return true;
        }

        return false;
    }
}


text:
package org.terasology.engine.logic.clipboard;

import org.terasology.engine.entitySystem.systems.BaseComponentSystem;
import org.terasology.engine.entitySystem.systems.RegisterMode;
import org.terasology.engine.entitySystem.systems.RegisterSystem;
import org.terasology.engine.registry.Share;

import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;

@RegisterSystem(RegisterMode.CLIENT)
@Share(ClipboardManager.class)
public class ClipboardClientSystem extends BaseComponentSystem implements ClipboardManager {
    @Override
    public String getClipboardContentsAsString() {
        return AccessController.doPrivileged(
                (PrivilegedAction<String>) () -> {
                    Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);

                    try {
                        if (t != null) {
                            return (String) t.getTransferData(DataFlavor.stringFlavor);
                        }
                    } catch (UnsupportedFlavorException | IOException e) {
                        return null;
                    }
                    return null;
                });
    }

    @Override
    public boolean setClipboardContents(String value) {
        return AccessController.doPrivileged(
                (PrivilegedAction<Boolean>) () -> {
                    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
                    try {
                        clipboard.setContents(new StringSelection(value), null);
                    } catch (IllegalStateException exp) {
                        // Some OSs might lock out access to clipboard, if another application uses it.
                        // In this case, this exception is thrown
                        return false;
                    }
                    return true;
                });
    }
}


text:
package OAuth::Lite2::Server::GrantHandler::Password;

use strict;
use warnings;

use parent 'OAuth::Lite2::Server::GrantHandler';
use OAuth::Lite2::Server::Error;
use OAuth::Lite2::ParamMethod::AuthHeader;
use Carp ();

sub handle_request {
    my ($self, $dh) = @_;

    my $req = $dh->request;

    my $parser = OAuth::Lite2::ParamMethod::AuthHeader->new;
    my $header_credentials = $parser->basic_credentials($req);
    my $client_id = ($header_credentials->{client_id}) ? $header_credentials->{client_id} : $req->param("client_id");

    my $username = $req->param("username");
    OAuth::Lite2::Server::Error::InvalidRequest->throw(
        description => "'username' not found"
    ) unless $username;

    my $password = $req->param("password")
        or OAuth::Lite2::Server::Error::InvalidRequest->throw(
            description => "'password' not found"
        );

    my $user_id = $dh->get_user_id($username, $password)
        or OAuth::Lite2::Server::Error::InvalidGrant->throw;

    my $scope = $req->param("scope");

    my $auth_info = $dh->create_or_update_auth_info(
        client_id => $client_id,
        user_id   => $user_id,
        scope     => $scope,
    );
    Carp::croak "OAuth::Lite2::Server::DataHandler::create_or_update_auth_info doesn't return OAuth::Lite2::Model::AuthInfo"
        unless ($auth_info
            && $auth_info->isa("OAuth::Lite2::Model::AuthInfo"));

    my $access_token = $dh->create_or_update_access_token(
        auth_info => $auth_info,
    );
    Carp::croak "OAuth::Lite2::Server::DataHandler::create_or_update_access_token doesn't return OAuth::Lite2::Model::AccessToken"
        unless ($access_token
            && $access_token->isa("OAuth::Lite2::Model::AccessToken"));

    my $res = {
        token_type => 'Bearer',
        access_token => $access_token->token,
    };
    $res->{expires_in} = $access_token->expires_in
        if $access_token->expires_in;
    $res->{refresh_token} = $auth_info->refresh_token
        if $auth_info->refresh_token;
    $res->{scope} = $auth_info->scope
        if $auth_info->scope;

    return $res;
}

=head1 NAME

OAuth::Lite2::Server::GrantHandler::Password - handler for 'password' grant_type request

=head1 SYNOPSIS

    my $handler = OAuth::Lite2::Server::GrantHandler::Password->new;
    my $res = $handler->handle_request( $data_handler );

=head1 DESCRIPTION

handler for 'password' grant_type request.

=head1 METHODS

=head2 handle_request( $req )

See L<OAuth::Lite2::Server::GrantHandler> document.

=head1 AUTHOR

Lyo Kato, E<lt>lyo.kato@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2010 by Lyo Kato

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.

=cut

1;


text:
title:  Inside Story
date:   17/04/2020
---

Potluck Kalpleri Kazandı

Andrew McChesney, Adventist Müjdeleme

Sebt günlerinde, tatilciler Rusya'nın popüler Karadeniz tatil beldesi Gelendzhik'teki Yedinci Gün Adventist kilisesine akın ettiler.

Sibirya, Ural Dağları ve diğer bir çok uzak Rus bölgelerinden gelen ziyaretçiler pastör Andrey Prokopev'e Filipinler'deki Uluslararası Adventist İleri Araştırmalar Enstitüsü'nde okurken öğrendiği özel bir şeyi hatırlattı. Ziyaretçiler kampüs kilisesine geldiğinde, Andrey ve diğer öğrenciler daha sonra sırayla onlara Şabat sofrasından yemek verdiler.

Andrey, Rus kilisesinde misafirlere benzer bir Şabat sofrası yapılmasını önerdi. Kilisenin her biri altı ila yedi üyeden oluşan altı Sebt Okulu sınıfının sırayla yiyecek temin edebileceğini öne sürdü.

Bir sonraki Şabat vaazından sonra, cemaatteki 20 tatilci, kilisenin mutfağında öğle yemeği için kalma davetini memnuniyetle kabul etti. Ziyaretçiler dolduktan ve mutlu olduktan sonra Andrey onlardan kendilerini tanıtmalarını ve nasıl Adventist olduklarını paylaşmalarını istedi.

Ortaya çıkan kişisel tanıklıklar güçlüydü ve kilise üyeleri onları duymaktan zevk alıyordu. Andrey daha fazla insanın bu hikayeleri duymasını istedi ve Adventist olmayan komşuları ibadet ve yemek için kiliseye davet etmeye başladı.

Bir Şabat günü, bir Adventist tatilci, II. Dünya Savaşı sırasında trenle Batı cephesine seyahat eden askerler için yemek hazırlayan bir aşçı olan dedesi hakkında dikkat çekici bir hikaye anlattı. Aşçı, sıkı çalışmasından ve alkolsüz yaşam tarzından dolayı çok saygındı, ancak Sebt günü çalışmayı reddeden bir Adventistti. Üstleri ona cumartesi günleri izin veremedi ama onu kaybetmek istemediler. Sonunda komutan onu çağırdı.

"Arkadaşım, seni cuma günü kovacağım" dedi. "Daha sonra seni pazar günü işe alacağım." Düzenleme iyi çalıştı. Savaşın geri kalanı boyunca, aşçı her cuma kovuldu ve her pazar yeniden işe alındı.

Tatilci büyükbabasının hikayesini anlatmayı bitirdiğinde, masada Adventist olmayan bir ziyaretçi konuştu.

"Adventist olmak istiyorum" dedi.

Andrey sevinç içinde kadını vaftiz etti. Toplamda, kişisel ifadelerle İsa'ya ilgi duyan dört kişi, Şabat yemeklerinin başlamasından bu yana iki yıl içinde vaftiz edildi.

43 yaşındaki Andrey, kişisel tanıklıklarla verilen yemeğin Şabat kilisesi için büyük bir nimet olduğunu ve Sebt Okulu sınıfı üyelerinin misafirlerle ilgilenmeleri için birlikte çalıştıklarında yakınlaşmalarına yardımcı olduğunu söyledi.

"Kişisel tanıklıklar çok önemlidir" dedi. "Bize Tanrıyı, merhametini ve O'nun bizim Tanrımız olmasının arzusunu gösterirler."


text:
local class = require("riritools.lua.class")
local queue = require("riritools.lua.queue")
local d_msgs = require("riritools.lua.defold_msgs")

local animation_done = d_msgs.ANIMATION_DONE
local play_animation = d_msgs.PLAY_ANIMATION
local gmatch = string.gmatch

local animation_queue = class("rt.animation_queue")

local hash = hash
local post = msg.post

function animation_queue:__initialize()
	self.component = nil
	self.animation_collision_updater = nil
	self.animation_sound = nil
	self.before_change_function = nil
	self.before_change_function_args = nil
	self.after_change_function = nil
	self.after_change_function_args = nil

	self.__todo = queue:new()
	self.__current_animation = nil
end

function animation_queue:__start_animation()
	local animation = self.__todo:pop()
	if (self.before_change_function and self.__current_animation ~= animation) then
		self.before_change_function(self, self.before_change_function_args)
	end
	self.__current_animation = animation
	post(self.component, play_animation, {id=hash(animation)})
	self:update_collision_body(animation)
	self:update_animation_sound(animation)
	if (self.after_change_function) then
		self.after_change_function(self, self.after_change_function_args)
	end
end

function animation_queue:on_message(message_id, message)
	if (self.animation_sound) then
		self.animation_sound:on_message(message_id, message)
	end
	if (message_id == animation_done) then
		self.__current_animation = nil
		if (self.component and self.__todo:size() > 0) then
			self:__start_animation()
		end
	end
end

function animation_queue:play_animations(animation_names)
	self.__todo = queue:new()
	self.__current_animation = nil
	for token in gmatch(animation_names, "([^|]+)") do
		self.__todo:push(token)
	end
	if (self.__todo:size() > 0) then
		self:__start_animation()
	end
end

function animation_queue:get_current_animation()
	return self.__current_animation
end

function animation_queue:update_collision_body(animation)
	if (animation and self.animation_collision_updater) then
		self.animation_collision_updater:update(animation)
	end
end

function animation_queue:update_animation_sound(animation)
	if (animation and self.animation_sound) then
		self.animation_sound:update(animation)
	end
end

return animation_queue


text:
import { List } from 'immutable';
import { SIGN_OUT_SUCCESS } from 'src/core/auth';

import {
  CREATE_TASK_SUCCESS,
  DELETE_TASK_SUCCESS,
  FILTER_TASKS,
  LOAD_TASKS_SUCCESS,
  UPDATE_TASK_SUCCESS
} from './action-types';

import { Task } from './task';
import { tasksReducer, TasksState } from './reducer';

describe('tasks', () => {
  describe('tasksReducer', () => {
    let task1;
    let task2;

    beforeEach(() => {
      task1 = new Task({ collected: false, key: '0', title: 'task 1'});
      task2 = new Task({ collected: false, key: '1', title: 'task 2'});
    });

    describe('CREATE_TASK_SUCCESS', () => {
      it('should prepend new task to list', () => {
        let state = new TasksState({list: new List([task1])});

        let nextState = tasksReducer(state, {
          type: CREATE_TASK_SUCCESS,
          payload: task2
        });

        expect(nextState.list.get(0)).toBe(task2);
        expect(nextState.list.get(1)).toBe(task1);
      });
    });

    describe('DELETE_TASK_SUCCESS', () => {
      it('should remove task from list', () => {
        let state = new TasksState({list: new List([task1, task2])});

        let nextState = tasksReducer(state, {
          type: DELETE_TASK_SUCCESS,
          payload: task2
        });

        expect(nextState.deleted).toBe(task2);
        expect(nextState.list.size).toBe(1);
        expect(nextState.list.get(0)).toBe(task1);
        expect(nextState.previous).toBe(state.list);
      });
    });

    describe('FILTER_TASKS', () => {
      it('should set filter with provided value', () => {
        let state = new TasksState();

        let nextState = tasksReducer(state, {
          type: FILTER_TASKS,
          payload: {
            filterType: 'collected'
          }
        });

        expect(nextState.filter).toBe('collected');
      });
    });

    describe('LOAD_TASKS_SUCCESS', () => {
      it('should set task list', () => {
        let state = new TasksState();

        let nextState = tasksReducer(state, {
          type: LOAD_TASKS_SUCCESS,
          payload: [task1, task2]
        });

        expect(nextState.list.size).toBe(2);
      });

      it('should order tasks newest first', () => {
        let state = new TasksState();

        let nextState = tasksReducer(state, {
          type: LOAD_TASKS_SUCCESS,
          payload: [task1, task2]
        });

        expect(nextState.list.get(0)).toBe(task2);
        expect(nextState.list.get(1)).toBe(task1);
      });
    });

    describe('UPDATE_TASK_SUCCESS', () => {
      it('should update task', () => {
        let state = new TasksState({list: new List([task1, task2])});
        let changedTask = task2.set('title', 'changed');

        let nextState = tasksReducer(state, {
          type: UPDATE_TASK_SUCCESS,
          payload: changedTask
        });

        expect(nextState.list.get(0)).toBe(task1);
        expect(nextState.list.get(1)).toBe(changedTask);
      });
    });

    describe('SIGN_OUT_SUCCESS', () => {
      it('should reset state', () => {
        let state = new TasksState({
          delete: task1,
          list: new List([task1, task2]),
          previous: new List()
        });

        let nextState = tasksReducer(state, {
          type: SIGN_OUT_SUCCESS
        });

        expect(nextState.deleted).toBe(null);
        expect(nextState.list.size).toBe(0);
        expect(nextState.previous).toBe(null);
      });
    });
  });
});


text:
package conversion

import (
	"errors"
	"fmt"
	"github.com/SPANDigital/presidium-hugo/pkg/config"
	"github.com/SPANDigital/presidium-hugo/pkg/domain/service/hugo"
	"github.com/SPANDigital/presidium-hugo/pkg/utils"
	"io"
	"io/fs"
	"log"
	"os"
	"path/filepath"
	"strings"

	"github.com/SPANDigital/presidium-hugo/pkg/configtranslation"
	"github.com/SPANDigital/presidium-hugo/pkg/domain/service/conversion/fileactions"
	"github.com/SPANDigital/presidium-hugo/pkg/domain/service/conversion/resources"
	"github.com/spf13/viper"

	"github.com/SPANDigital/presidium-hugo/pkg/domain/service/conversion/colors"
	"github.com/SPANDigital/presidium-hugo/pkg/filesystem"
	"github.com/logrusorgru/aurora"

	"github.com/otiai10/copy"
)

var (
	ErrSourceIsNotDirectory        = errors.New("source is not directory")
	ErrConversionAlreadyRunning    = errors.New("conversion is already running")
	ErrSourceDirectoryDoesNotExist = errors.New("source directory does not exists")
	ErrUnableToCreateDestDirectory = errors.New("unable to create destination directory")
)

type Converter struct {
	ConvertJekyllConfig        bool
	EnableColorOutput          bool
	EraseMarkdownWithNoContent bool
	FixImages                  bool
	FixHtmlImages              bool
	LogoPrefix                 string
	RemoveRawTags              bool
	RemoveTargetBlank          bool
	ReplaceBaseUrl             bool
	ReplaceBaseUrlWithSpaces   bool
	ReplaceCallOuts            bool
	ReplaceIfVariables         bool
	ReplaceComments            bool
	ReplaceRootWith            string
	ReplaceToolTips            bool
	SlugBasedOnFileName        bool
	SilenceUserMessages        bool
	WeightBasedOnFileName      bool
	CommonMarkdownAttributes   bool
	CopyMediaToStatic          bool
	FixTables                  bool
	FixFigureCaptions          bool
	GenerateHugoModule         bool
	SiteModuleName             string

	// --- private state follows from here on: --
	stagingDir        string
	stagingContentDir string
	running           bool
	fs                filesystem.FsUtil

	// --- source directory structure (Jekyll)
	sourceDir               string
	sourceRepoContentDir    string
	sourceRepoStaticDir     string
	sourceRepoConfigYmlFile string

	// -- destination directory structure
	destinationRepoDir       string
	destinationContentDir    string
	destinationStaticDir     string
	destinationMediaDir      string
	destinationConfigYmlFile string
	hugoConfig               configtranslation.HugoConfig
}

func (c *Converter) IsRunning() bool {
	return c.running
}

func (c *Converter) GetSourceDir() string {
	return c.sourceDir
}

func (c *Converter) GetDestDir() string {
	return c.destinationRepoDir
}

func (c *Converter) initSourceDir(sourceDir string) error {
	if info, err := filesystem.AFS.Stat(sourceDir); err != nil {
		return ErrSourceDirectoryDoesNotExist
	} else if !info.IsDir() {
		return ErrSourceIsNotDirectory
	}

	sourceDir, err := c.fs.AbsolutePath(sourceDir)
	if err != nil {
		return err
	}

	c.sourceDir = sourceDir
	c.sourceRepoContentDir = filepath.Join(c.sourceDir, "content")
	c.sourceRepoStaticDir = filepath.Join(c.sourceDir, "media")
	c.sourceRepoConfigYmlFile = filepath.Join(c.sourceDir, "_config.yml")

	return nil
}

func (c *Converter) initDestinationDir(destinationDir string) error {
	if destinationDir == "" {
		destinationDir = "."
	}

	destinationDir, err := c.fs.AbsolutePath(destinationDir)
	if err != nil {
		return err
	}

	if _, err := filesystem.AFS.Stat(destinationDir); err == nil {
		if err = filesystem.AFS.MkdirAll(destinationDir, 0666); err != nil {
			return ErrUnableToCreateDestDirectory
		}
	}

	c.destinationRepoDir = destinationDir
	c.destinationContentDir = filepath.Join(destinationDir, "content")
	c.destinationStaticDir = filepath.Join(destinationDir, "static")
	c.destinationMediaDir = filepath.Join(destinationDir, "media")
	c.destinationConfigYmlFile = filepath.Join(destinationDir, "config.yml")

	return nil
}

type terminalMessage struct {
	content      string
	label        string
	labelStyle   func(arg interface{}) aurora.Value
	contentStyle func(arg interface{}) aurora.Value
}

func message(label string, content string) *terminalMessage {
	return &terminalMessage{
		content:      content,
		label:        label,
		labelStyle:   colors.Labels.Underline,
		contentStyle: colors.Labels.Info,
	}
}

func infoMessage(content string) *terminalMessage {
	m := message("INFO: ", content)
	m.withContentStyle(colors.Labels.Normal)
	m.withLabelStyle(colors.Labels.Info)
	return m
}

func (m *terminalMessage) withLabelStyle(style colors.StyleLabel) *terminalMessage {
	m.labelStyle = style
	return m
}

func (m *terminalMessage) withContentStyle(style colors.StyleLabel) *terminalMessage {
	m.contentStyle = style
	return m
}

func (m *terminalMessage) getLabel() aurora.Value {
	return m.labelStyle(m.label)
}

func (m *terminalMessage) getContent() aurora.Value {
	return m.contentStyle(m.content)
}

func (c *Converter) messageUser(messages ...*terminalMessage) {

	if c.SilenceUserMessages || len(messages) == 0 {
		return
	}

	for _, m := range messages {
		fmt.Println(m.getLabel(), m.getContent())
	}
}

func (c *Converter) Execute(sourceDir string, destDir string) error {

	if c.running {
		return ErrConversionAlreadyRunning
	}
	if err := c.initStaging(); err != nil {
		return err
	}
	if err := c.initSourceDir(sourceDir); err != nil {
		return err
	}
	if err := c.initDestinationDir(destDir); err != nil {
		return err
	}

	c.messageUser(
		message("Source repo dir: ", c.sourceDir),
		message("Destination repo: ", c.destinationRepoDir),
		message("Staging directory: ", c.stagingDir),
		infoMessage(fmt.Sprintf("starting to convert %s", c.sourceDir)))

	// NB: ⚠ order may be important here:
	c.prepareStaging()
	c.gatherResources()
	c.performFileActions()
	c.processStaticMedia()
	c.convertConfig()
	c.generateHugoModule()
	c.finalize()

	return nil
}

func (c *Converter) initStaging() error {

	workDir, err := filesystem.AFS.TempDir(os.TempDir(), "staging")
	if err != nil {
		log.Fatalf("could not create staging directrory [%s]: %s", workDir, err.Error())
		return err
	}

	c.stagingDir = workDir
	c.stagingContentDir = filepath.Join(c.stagingDir, "content")
	if err := c.fs.MakeDirs(c.stagingDir); err != nil {
		log.Fatalf("could not create staging content dir [%s]: %s", c.stagingContentDir, err.Error())
		return err
	}

	return nil
}

// New returns an uninitialized Converter configured with default values.
func New() *Converter {
	return &Converter{
		ConvertJekyllConfig:        true,
		EnableColorOutput:          true,
		EraseMarkdownWithNoContent: true,
		FixImages:                  true,
		FixHtmlImages:              true,
		LogoPrefix:                 "/images/",
		RemoveRawTags:              true,
		RemoveTargetBlank:          true,
		ReplaceBaseUrl:             true,
		ReplaceBaseUrlWithSpaces:   true,
		ReplaceCallOuts:            true,
		ReplaceComments:            true,
		ReplaceIfVariables:         true,
		ReplaceRootWith:            "",
		ReplaceToolTips:            true,
		SlugBasedOnFileName:        false,
		SilenceUserMessages:        false,
		WeightBasedOnFileName:      true,
		CommonMarkdownAttributes:   false,
		CopyMediaToStatic:          true,
		FixTables:                  true,
		FixFigureCaptions:          true,
		fs:                         filesystem.New(),
		GenerateHugoModule:         true,
	}
}

var Defaults = New()

func (c *Converter) prepareStaging() {
	if config.Flags.CleanTarget {
		c.messageUser(infoMessage("cleaning destination directory"))
		if utils.FileExists(c.destinationRepoDir) {
			if err := c.fs.EmptyDir(c.destinationRepoDir); err != nil {
				log.Fatalf("unable to clean out destination [%s]: %s", c.stagingDir, err.Error())
			}
		}
	}

	if err := c.fs.EmptyDir(c.stagingDir); err != nil {
		log.Fatalf("unable to clean out staging [%s]: %s", c.stagingDir, err.Error())
	}

	err := c.fs.CopyWithOptions(c.sourceRepoContentDir, c.stagingContentDir, copy.Options{
		Skip: func(src string) (bool, error) {
			_, file := filepath.Split(src)
			if strings.HasPrefix(file, ".") {
				return true, nil
			}
			return false, nil
		},
	})

	if err != nil {
		log.Fatal(err)
	}

	c.messageUser(message(
		"With: ",
		c.stagingContentDir,
	).withLabelStyle(colors.Labels.Underline).withContentStyle(colors.Labels.Wanted))

}

func (c *Converter) gatherResources() {
	if err := resources.GatherResources(c.stagingContentDir); err != nil {
		log.Fatal(err)
	}
}

func (c *Converter) performFileActions() {
	c.messageUser(infoMessage("check directories for rename"))
	if err := fileactions.RemoveUnderscoreDirPrefix(c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("check directories for indexes"))
	if err := fileactions.CheckForDirIndex(c.stagingDir, c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("check directories for titles"))
	if err := fileactions.CheckForTitles(c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("add front matter"))
	if err := fileactions.AddFrontMatter(c.stagingDir, c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("unslugify remaining directories and articles"))
	if err := fileactions.RemoveWeightIndicatorsFromFilePaths(c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("setting root url"))
	if err := fileactions.SetRootUrl(c.stagingContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("preparing to copy content over"))
	if err := c.fs.MakeDirs(c.destinationContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage(fmt.Sprintf("copying: %s -> %s", c.stagingDir, c.destinationContentDir)))
	if err := copy.Copy(c.stagingContentDir, c.destinationContentDir); err != nil {
		log.Fatal(err)
	}

	c.messageUser(infoMessage("renaming directories"))
	if err := fileactions.RenameDirectories(c.destinationContentDir, c.destinationRepoDir); err != nil {
		log.Fatal(err)
	}
}

func (c *Converter) processStaticMedia() {

	if !viper.GetBool("copyMediaToStatic") {
		return
	}

	if !c.fs.DirExists(c.sourceRepoStaticDir) {
		return
	}

	_ = c.fs.MakeDirs(c.destinationStaticDir)
	_ = c.fs.CopyDir(c.sourceRepoStaticDir, c.destinationStaticDir)

}

func (c *Converter) convertConfig() {

	if !viper.GetBool("convertConfigYml") {
		return
	}

	jekylConfig, _ := configtranslation.ReadJekyllConfig(c.sourceRepoConfigYmlFile)
	hugoConfig := configtranslation.ConvertConfig(jekylConfig, viper.GetString("logoPrefix"), map[string]interface{}{})
	err := configtranslation.WriteHugoConfig(c.destinationConfigYmlFile, hugoConfig)
	if err != nil {
		log.Fatal(err)
	}

	c.hugoConfig = *hugoConfig
}

func (c *Converter) finalize() {

	_ = c.fs.DeleteDir(c.stagingDir)

	copyOver("package.json", c.destinationRepoDir)
	copyOver(".gitignore", c.destinationRepoDir)
	copyOver("package-lock.json", c.destinationRepoDir)

	c.messageUser(infoMessage("Completed").withContentStyle(colors.Labels.Wanted))
}

func (c *Converter) generateHugoModule() {

	if !c.GenerateHugoModule {
		return
	}

	c.messageUser(infoMessage("Adding Hugo GO module to site").withContentStyle(colors.Labels.Wanted))
	hugo.New().Execute("--source", c.stagingDir, "mod", "init", c.moduleName())
	srcModFile := filepath.Join(c.stagingDir, "go.mod")
	dstModFile := filepath.Join(c.destinationRepoDir, "go.mod")
	_ = c.fs.Copy(srcModFile, dstModFile, fs.ModePerm)
	c.messageUser(infoMessage("Copied over hugo mod file"))

}

func (c *Converter) moduleName() string {
	siteModuleName := c.SiteModuleName
	if len(siteModuleName) == 0 {
		siteModuleName = filepath.Base(c.sourceDir)
	}
	return siteModuleName
}

// copyOver ensures that these files exists on at the destinationDir.
//
// This function will create such a file it does not exist.
func copyOver(file string, destinationDir string) {
	from, err := filesystem.AFS.Open(file)
	if err != nil {
		log.Fatal(err)
	}
	defer from.Close()

	to, err := filesystem.AFS.OpenFile(filepath.Join(destinationDir, file), os.O_RDWR|os.O_CREATE, 0666)

	if err != nil {
		log.Fatal(err)
	}
	defer to.Close()
	_, err = io.Copy(to, from)
	if err != nil {
		log.Fatal(err)
	}
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// System.Security.Cryptography.RSA
struct RSA_t2466814310;
// System.String
struct String_t;

#include "codegen/il2cpp-codegen.h"
#include "mscorlib_System_String7231557.h"
#include "mscorlib_System_Security_Cryptography_RSAParameter3219890992.h"

// System.Void System.Security.Cryptography.RSA::.ctor()
extern "C"  void RSA__ctor_m1717134245 (RSA_t2466814310 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Security.Cryptography.RSA System.Security.Cryptography.RSA::Create()
extern "C"  RSA_t2466814310 * RSA_Create_m3157832121 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Security.Cryptography.RSA System.Security.Cryptography.RSA::Create(System.String)
extern "C"  RSA_t2466814310 * RSA_Create_m1188512233 (Il2CppObject * __this /* static, unused */, String_t* ___algName0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void System.Security.Cryptography.RSA::ZeroizePrivateKey(System.Security.Cryptography.RSAParameters)
extern "C"  void RSA_ZeroizePrivateKey_m3364848340 (RSA_t2466814310 * __this, RSAParameters_t3219890992  ___parameters0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void System.Security.Cryptography.RSA::FromXmlString(System.String)
extern "C"  void RSA_FromXmlString_m3641838305 (RSA_t2466814310 * __this, String_t* ___xmlString0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.String System.Security.Cryptography.RSA::ToXmlString(System.Boolean)
extern "C"  String_t* RSA_ToXmlString_m2919494468 (RSA_t2466814310 * __this, bool ___includePrivateParameters0, const MethodInfo* method) IL2CPP_METHOD_ATTR;


text:
//
//  AVIMMessage.h
//  AVOSCloudIM
//
//  Created by Qihe Bian on 12/4/14.
//  Copyright (c) 2014 LeanCloud Inc. All rights reserved.
//

#import "AVIMCommon.h"

typedef NS_ENUM(int8_t, AVIMMessageIOType) {
    AVIMMessageIOTypeIn = 1,
    AVIMMessageIOTypeOut,
};

typedef NS_ENUM(int8_t, AVIMMessageStatus) {
    AVIMMessageStatusNone = 0,
    AVIMMessageStatusSending = 1,
    AVIMMessageStatusSent,
    AVIMMessageStatusDelivered,
    AVIMMessageStatusFailed,
    AVIMMessageStatusRead
};

NS_ASSUME_NONNULL_BEGIN

@interface AVIMMessage : NSObject <NSCopying, NSCoding>

/*!
 * 表示接收和发出的消息
 */
@property (nonatomic, assign, readonly) AVIMMessageIOType ioType;

/*!
 * 表示消息状态
 */
@property (nonatomic, assign, readonly) AVIMMessageStatus status;

/*!
 * 消息 id
 */
@property (nonatomic, copy, readonly, nullable) NSString *messageId;

/*!
 * 消息发送/接收方 id
 */
@property (nonatomic, copy, readonly, nullable) NSString *clientId;

/*!
 * 消息所属对话的 id
 */
@property (nonatomic, copy, readonly, nullable) NSString *conversationId;

/*!
 * 消息文本
 */
@property (nonatomic, copy, nullable) NSString *content;

/*!
 * 发送时间(精确到毫秒)
 */
@property (nonatomic, assign, readonly) int64_t sendTimestamp;

/*!
 * 接收时间(精确到毫秒)
 */
@property (nonatomic, assign, readonly) int64_t deliveredTimestamp;

/*!
 * 被标记为已读的时间(精确到毫秒)
 */
@property (nonatomic, assign, readonly) int64_t readTimestamp;

/*!
 * 是否是暂态消息
 */
@property (nonatomic, assign, readonly) BOOL transient;

- (nullable NSString *)payload;

/*!
 创建文本消息。
 @param content - 消息文本.
 */
+ (instancetype)messageWithContent:(NSString *)content;

@end

NS_ASSUME_NONNULL_END


text:
<link rel="import" href="../../polymer/polymer.html">

<link rel="import" href="../../io-boolean/io-boolean.html">
<link rel="import" href="../../io-input/io-input.html">
<link rel="import" href="../../io-object/io-object.html">

<link rel="import" href="../io-value.html">

<dom-module id="demo-app">
  <template>

    boolean
    string
    number
    undef.
    null
    NaN
    object
    array
    funct.

    boolean
    <io-boolean class="demo" value="{{boolvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{strvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{numvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{undefvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{nullvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{nanvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{objvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{arrayvalue}}"></io-boolean>
    <io-boolean class="demo" value="{{funcvalue}}"></io-boolean>

    any
    <io-input class="demo" value="{{boolvalue}}"></io-input>
    <io-input class="demo" value="{{strvalue}}"></io-input>
    <io-input class="demo" value="{{numvalue}}"></io-input>
    <io-input class="demo" value="{{undefvalue}}"></io-input>
    <io-input class="demo" value="{{nullvalue}}"></io-input>
    <io-input class="demo" value="{{nanvalue}}"></io-input>
    <io-input class="demo" value="{{objvalue}}"></io-input>
    <io-input class="demo" value="{{arrayvalue}}"></io-input>
    <io-input class="demo" value="{{funcvalue}}"></io-input>

    string
    <io-input class="demo" value="{{boolvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{strvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{numvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{undefvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{nullvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{nanvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{objvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{arrayvalue}}" type="string"></io-input>
    <io-input class="demo" value="{{funcvalue}}" type="string"></io-input>

    float
    <io-input class="demo" value="{{boolvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{strvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{numvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{undefvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{nullvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{nanvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{objvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{arrayvalue}}" type="float"></io-input>
    <io-input class="demo" value="{{funcvalue}}" type="float"></io-input>

    integer
    <io-input class="demo" value="{{boolvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{strvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{numvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{undefvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{nullvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{nanvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{objvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{arrayvalue}}" type="integer"></io-input>
    <io-input class="demo" value="{{funcvalue}}" type="integer"></io-input>

    io-value
    <io-value class="demo" value="{{boolvalue}}"></io-value>
    <io-value class="demo" value="{{strvalue}}"></io-value>
    <io-value class="demo" value="{{numvalue}}"></io-value>
    <io-value class="demo" value="{{undefvalue}}"></io-value>
    <io-value class="demo" value="{{nullvalue}}"></io-value>
    <io-value class="demo" value="{{nanvalue}}"></io-value>
    <io-value class="demo" value="{{objvalue}}"></io-value>
    <io-value class="demo" value="{{arrayvalue}}"></io-value>
    <io-value class="demo" value="{{funcvalue}}"></io-value>

    <io-value value="{{boolvalue}}"></io-value>
    <io-value value="{{strvalue}}"></io-value>
    <io-value value="{{numvalue}}"></io-value>
    <io-value value="{{undefvalue}}"></io-value>
    <io-value value="{{nullvalue}}"></io-value>
    <io-value value="{{nanvalue}}"></io-value>
    <io-value value="{{objvalue}}"></io-value>
    <io-value value="{{arrayvalue}}"></io-value>
    <io-value value="{{funcvalue}}"></io-value>

  </template>
</dom-module>


text:
namespace Org.Apache.Etch.Bindings.Csharp.Transport.Fmt
{
    /// <summary>
    /// Class that provides methods for :
    /// 1) Converting a single value from byte to sbyte.
    /// 2) Converting a single value for sbyte to byte.
    /// 3) Converting an array of values of the 2 above.
    /// </summary>
    public static class ByteConverter
    {
        /// <summary>
        /// Converts a byte value to an sbyte value.
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static sbyte ByteToSbyte( byte value )
        {
            sbyte convertedValue = 0;

            if ( value > 127 )
                convertedValue = ( sbyte ) ( 127 - value );

            return convertedValue;
        }

        public static byte SbyteToByte( sbyte value )
        {
            byte convertedValue = 0;

            if ( value < 0 )
                convertedValue = ( byte ) ( 127 - value );

            return convertedValue;
        }
    }
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Enum2862688501.h"
#include "mscorlib_System_Runtime_CompilerServices_LoadHint2899402799.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Runtime.CompilerServices.LoadHint
struct  LoadHint_t2899402799
{
public:
	// System.Int32 System.Runtime.CompilerServices.LoadHint::value__
	int32_t ___value___1;

public:
	inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(LoadHint_t2899402799, ___value___1)); }
	inline int32_t get_value___1() const { return ___value___1; }
	inline int32_t* get_address_of_value___1() { return &___value___1; }
	inline void set_value___1(int32_t value)
	{
		___value___1 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
import inspect

import six

from debtcollector import _utils

_KIND_MOVED_PREFIX_TPL = "%s '%s' has moved to '%s'"
_CLASS_MOVED_PREFIX_TPL = "Class '%s' has moved to '%s'"
_MOVED_METHOD_POSTFIX = "()"

def _moved_decorator(kind, new_attribute_name, message=None,
                     version=None, removal_version=None, stacklevel=3,
                     attr_postfix=None, category=None):
    """Decorates a method/property that was moved to another location."""

    def decorator(f):
        fully_qualified, old_attribute_name = _utils.get_qualified_name(f)
        if attr_postfix:
            old_attribute_name += attr_postfix

        @six.wraps(f)
        def wrapper(self, *args, **kwargs):
            base_name = _utils.get_class_name(self, fully_qualified=False)
            if fully_qualified:
                old_name = old_attribute_name
            else:
                old_name = ".".join((base_name, old_attribute_name))
            new_name = ".".join((base_name, new_attribute_name))
            prefix = _KIND_MOVED_PREFIX_TPL % (kind, old_name, new_name)
            out_message = _utils.generate_message(
                prefix, message=message,
                version=version, removal_version=removal_version)
            _utils.deprecation(out_message, stacklevel=stacklevel,
                               category=category)
            return f(self, *args, **kwargs)

        return wrapper

    return decorator

def moved_method(new_method_name, message=None,
                 version=None, removal_version=None, stacklevel=3,
                 category=None):
    """Decorates a *instance* method that was moved to another location."""
    if not new_method_name.endswith(_MOVED_METHOD_POSTFIX):
        new_method_name += _MOVED_METHOD_POSTFIX
    return _moved_decorator('Method', new_method_name, message=message,
                            version=version, removal_version=removal_version,
                            stacklevel=stacklevel,
                            attr_postfix=_MOVED_METHOD_POSTFIX,
                            category=category)

def moved_property(new_attribute_name, message=None,
                   version=None, removal_version=None, stacklevel=3,
                   category=None):
    """Decorates a *instance* property that was moved to another location."""
    return _moved_decorator('Property', new_attribute_name, message=message,
                            version=version, removal_version=removal_version,
                            stacklevel=stacklevel, category=category)

def moved_class(new_class, old_class_name, old_module_name,
                message=None, version=None, removal_version=None,
                stacklevel=3, category=None):
    """Deprecates a class that was moved to another location.

    This creates a 'new-old' type that can be used for a
    deprecation period that can be inherited from. This will emit warnings
    when the old locations class is initialized, telling where the new and
    improved location for the old class now is.
    """

    if not inspect.isclass(new_class):
        _qual, type_name = _utils.get_qualified_name(type(new_class))
        raise TypeError("Unexpected class type '%s' (expected"
                        " class type only)" % type_name)

    old_name = ".".join((old_module_name, old_class_name))
    new_name = _utils.get_class_name(new_class)
    prefix = _CLASS_MOVED_PREFIX_TPL % (old_name, new_name)
    out_message = _utils.generate_message(
        prefix, message=message, version=version,
        removal_version=removal_version)

    def decorator(f):

        @six.wraps(f, assigned=("__name__", "__doc__"))
        def wrapper(self, *args, **kwargs):
            _utils.deprecation(out_message, stacklevel=stacklevel,
                               category=category)
            return f(self, *args, **kwargs)

        return wrapper

    old_class = type(old_class_name, (new_class,), {})
    old_class.__module__ = old_module_name
    old_class.__init__ = decorator(old_class.__init__)
    return old_class


text:
package com.amazonaws.services.logs.model;

import java.io.Serializable;

/**
 * <p>
 * A log stream is sequence of log events from a single emitter of logs.
 * </p>
 */
public class LogStream implements Serializable, Cloneable {

    private String logStreamName;

    private Long creationTime;

    private Long firstEventTimestamp;

    private Long lastEventTimestamp;

    private Long lastIngestionTime;

    private String uploadSequenceToken;

    private String arn;

    private Long storedBytes;

    /**
     * @param logStreamName
     */
    public void setLogStreamName(String logStreamName) {
        this.logStreamName = logStreamName;
    }

    /**
     * @return
     */
    public String getLogStreamName() {
        return this.logStreamName;
    }

    /**
     * @param logStreamName
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withLogStreamName(String logStreamName) {
        setLogStreamName(logStreamName);
        return this;
    }

    /**
     * @param creationTime
     */
    public void setCreationTime(Long creationTime) {
        this.creationTime = creationTime;
    }

    /**
     * @return
     */
    public Long getCreationTime() {
        return this.creationTime;
    }

    /**
     * @param creationTime
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withCreationTime(Long creationTime) {
        setCreationTime(creationTime);
        return this;
    }

    /**
     * @param firstEventTimestamp
     */
    public void setFirstEventTimestamp(Long firstEventTimestamp) {
        this.firstEventTimestamp = firstEventTimestamp;
    }

    /**
     * @return
     */
    public Long getFirstEventTimestamp() {
        return this.firstEventTimestamp;
    }

    /**
     * @param firstEventTimestamp
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withFirstEventTimestamp(Long firstEventTimestamp) {
        setFirstEventTimestamp(firstEventTimestamp);
        return this;
    }

    /**
     * @param lastEventTimestamp
     */
    public void setLastEventTimestamp(Long lastEventTimestamp) {
        this.lastEventTimestamp = lastEventTimestamp;
    }

    /**
     * @return
     */
    public Long getLastEventTimestamp() {
        return this.lastEventTimestamp;
    }

    /**
     * @param lastEventTimestamp
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withLastEventTimestamp(Long lastEventTimestamp) {
        setLastEventTimestamp(lastEventTimestamp);
        return this;
    }

    /**
     * @param lastIngestionTime
     */
    public void setLastIngestionTime(Long lastIngestionTime) {
        this.lastIngestionTime = lastIngestionTime;
    }

    /**
     * @return
     */
    public Long getLastIngestionTime() {
        return this.lastIngestionTime;
    }

    /**
     * @param lastIngestionTime
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withLastIngestionTime(Long lastIngestionTime) {
        setLastIngestionTime(lastIngestionTime);
        return this;
    }

    /**
     * @param uploadSequenceToken
     */
    public void setUploadSequenceToken(String uploadSequenceToken) {
        this.uploadSequenceToken = uploadSequenceToken;
    }

    /**
     * @return
     */
    public String getUploadSequenceToken() {
        return this.uploadSequenceToken;
    }

    /**
     * @param uploadSequenceToken
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withUploadSequenceToken(String uploadSequenceToken) {
        setUploadSequenceToken(uploadSequenceToken);
        return this;
    }

    /**
     * @param arn
     */
    public void setArn(String arn) {
        this.arn = arn;
    }

    /**
     * @return
     */
    public String getArn() {
        return this.arn;
    }

    /**
     * @param arn
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withArn(String arn) {
        setArn(arn);
        return this;
    }

    /**
     * @param storedBytes
     */
    public void setStoredBytes(Long storedBytes) {
        this.storedBytes = storedBytes;
    }

    /**
     * @return
     */
    public Long getStoredBytes() {
        return this.storedBytes;
    }

    /**
     * @param storedBytes
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public LogStream withStoredBytes(Long storedBytes) {
        setStoredBytes(storedBytes);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getLogStreamName() != null)
            sb.append("LogStreamName: " + getLogStreamName() + ",");
        if (getCreationTime() != null)
            sb.append("CreationTime: " + getCreationTime() + ",");
        if (getFirstEventTimestamp() != null)
            sb.append("FirstEventTimestamp: " + getFirstEventTimestamp() + ",");
        if (getLastEventTimestamp() != null)
            sb.append("LastEventTimestamp: " + getLastEventTimestamp() + ",");
        if (getLastIngestionTime() != null)
            sb.append("LastIngestionTime: " + getLastIngestionTime() + ",");
        if (getUploadSequenceToken() != null)
            sb.append("UploadSequenceToken: " + getUploadSequenceToken() + ",");
        if (getArn() != null)
            sb.append("Arn: " + getArn() + ",");
        if (getStoredBytes() != null)
            sb.append("StoredBytes: " + getStoredBytes());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof LogStream == false)
            return false;
        LogStream other = (LogStream) obj;
        if (other.getLogStreamName() == null ^ this.getLogStreamName() == null)
            return false;
        if (other.getLogStreamName() != null
                && other.getLogStreamName().equals(this.getLogStreamName()) == false)
            return false;
        if (other.getCreationTime() == null ^ this.getCreationTime() == null)
            return false;
        if (other.getCreationTime() != null
                && other.getCreationTime().equals(this.getCreationTime()) == false)
            return false;
        if (other.getFirstEventTimestamp() == null
                ^ this.getFirstEventTimestamp() == null)
            return false;
        if (other.getFirstEventTimestamp() != null
                && other.getFirstEventTimestamp().equals(
                        this.getFirstEventTimestamp()) == false)
            return false;
        if (other.getLastEventTimestamp() == null
                ^ this.getLastEventTimestamp() == null)
            return false;
        if (other.getLastEventTimestamp() != null
                && other.getLastEventTimestamp().equals(
                        this.getLastEventTimestamp()) == false)
            return false;
        if (other.getLastIngestionTime() == null
                ^ this.getLastIngestionTime() == null)
            return false;
        if (other.getLastIngestionTime() != null
                && other.getLastIngestionTime().equals(
                        this.getLastIngestionTime()) == false)
            return false;
        if (other.getUploadSequenceToken() == null
                ^ this.getUploadSequenceToken() == null)
            return false;
        if (other.getUploadSequenceToken() != null
                && other.getUploadSequenceToken().equals(
                        this.getUploadSequenceToken()) == false)
            return false;
        if (other.getArn() == null ^ this.getArn() == null)
            return false;
        if (other.getArn() != null
                && other.getArn().equals(this.getArn()) == false)
            return false;
        if (other.getStoredBytes() == null ^ this.getStoredBytes() == null)
            return false;
        if (other.getStoredBytes() != null
                && other.getStoredBytes().equals(this.getStoredBytes()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getLogStreamName() == null) ? 0 : getLogStreamName()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getCreationTime() == null) ? 0 : getCreationTime()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getFirstEventTimestamp() == null) ? 0
                        : getFirstEventTimestamp().hashCode());
        hashCode = prime
                * hashCode
                + ((getLastEventTimestamp() == null) ? 0
                        : getLastEventTimestamp().hashCode());
        hashCode = prime
                * hashCode
                + ((getLastIngestionTime() == null) ? 0
                        : getLastIngestionTime().hashCode());
        hashCode = prime
                * hashCode
                + ((getUploadSequenceToken() == null) ? 0
                        : getUploadSequenceToken().hashCode());
        hashCode = prime * hashCode
                + ((getArn() == null) ? 0 : getArn().hashCode());
        hashCode = prime
                * hashCode
                + ((getStoredBytes() == null) ? 0 : getStoredBytes().hashCode());
        return hashCode;
    }

    @Override
    public LogStream clone() {
        try {
            return (LogStream) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
//  TLTableViewController.m
//
//  Copyright (c) 2013 Tim Moose (http://tractablelabs.com)
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.

#import "TLTableViewController.h"
#import "TLIndexPathItem.h"
#import "TLDynamicSizeView.h"
#import "TLDynamicHeightCell.h"

@interface TLTableViewController ()
@property (strong, nonatomic) NSMutableDictionary *prototypeCells;
@property (strong, nonatomic) NSMutableDictionary *viewControllerByCellInstanceId;
@property (weak, nonatomic) NSIndexPath *currentCellForRowAtIndexPath;
@end

@implementation TLTableViewController

#pragma mark - Initialization

- (id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super initWithCoder:aDecoder]) {
        [self initialize];
    }
    // Temporary workaround for "Unknown class TLDynamicHeightCell in Interface Builder file."
    // error. Still trying to figure that one out, but any reference to this class in code resolves it.
    [TLDynamicHeightCell class];
    return self;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        [self initialize];
    }
    return self;
}

- (id)initWithStyle:(UITableViewStyle)style
{
    if (self = [super initWithStyle:style]) {
        [self initialize];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)initialize
{
    _indexPathController = [[TLIndexPathController alloc] init];
    _indexPathController.delegate = self;
    _rowAnimationStyle = UITableViewRowAnimationFade;
//    [TLDynamicHeightCell class];
}

#pragma mark - Index path controller

- (void)setIndexPathController:(TLIndexPathController *)indexPathController
{
    if (_indexPathController != indexPathController) {
        _indexPathController = indexPathController;
        _indexPathController.delegate = self;
        [self.tableView reloadData];
    }
}

#pragma mark - Configuration

- (NSString *)tableView:(UITableView *)tableView cellIdentifierAtIndexPath:(NSIndexPath *)indexPath
{
    id item = [self.indexPathController.dataModel itemAtIndexPath:indexPath];
    NSString *cellId;
    if ([item isKindOfClass:[TLIndexPathItem class]]) {
        TLIndexPathItem *i = item;
        cellId = i.cellIdentifier;
    }
    if (cellId.length == 0) {
        cellId = @"Cell";
    }
    return cellId;

}

- (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
}

- (void)reconfigureVisibleCells
{
    for (UITableViewCell *cell in [self.tableView visibleCells]) {
        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
        [self tableView:self.tableView configureCell:cell atIndexPath:indexPath];
    }
}

#pragma mark - Prototype cells

- (UITableViewCell *)tableView:(UITableView *)tableView prototypeForCellIdentifier:(NSString *)cellIdentifier
{
    UITableViewCell *cell;
    if (cellIdentifier) {
        cell = [self.prototypeCells objectForKey:cellIdentifier];
        if (!cell) {
            if (!self.prototypeCells) {
                self.prototypeCells = [[NSMutableDictionary alloc] init];
            }
            cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
            //this will cause a view controller to be configured for the prototype cell
            //if there's supposed to be one
            [self tableView:tableView viewControllerForCell:cell];
            //TODO this will fail if multiple tables are being used and they have
            //overlapping identifiers. The key needs to be unique to the table
            [self.prototypeCells setObject:cell forKey:cellIdentifier];
        }
    }
    return cell;

}

#pragma mark - Backing cells with view controllers

- (void)setViewController:(UIViewController *)controller forKey:(NSString *)key
{
    if (!self.viewControllerByCellInstanceId) {
        self.viewControllerByCellInstanceId = [NSMutableDictionary dictionary];
    }
    UIViewController *currentViewController = [self.viewControllerByCellInstanceId objectForKey:key];
    if (currentViewController) {
        [currentViewController.view removeFromSuperview];
        [currentViewController removeFromParentViewController];
    }
    [self.viewControllerByCellInstanceId setObject:controller forKey:key];
}

- (UIViewController *)tableView:(UITableView *)tableView viewControllerForCell:(UITableViewCell *)cell
{
    NSString *key = [self instanceId:cell];
    UIViewController *controller = [self.viewControllerByCellInstanceId objectForKey:key];

    // This bit of code solves an issue in `TLCollectionViewController` (see the comments
    // there) and is included here for good measure.
    if (controller && [controller.view superview] == nil) {
        controller = nil;
        [self.viewControllerByCellInstanceId removeObjectForKey:key];
    }

    if (!controller) {
        NSIndexPath *indexPath = self.currentCellForRowAtIndexPath;
        if (indexPath == nil) {
            indexPath = [self.tableView indexPathForCell:cell];
        }
        controller = [self tableView:tableView instantiateViewControllerForCell:cell atIndexPath:indexPath];
        if (controller) {
            [self setViewController:controller forKey:key];
        }
    }
    return controller;
}

- (UIViewController *)tableView:(UITableView *)tableView instantiateViewControllerForCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

- (NSString *)instanceId:(id)object
{
    return [NSString stringWithFormat:@"%p", object];
}

#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.indexPathController.dataModel.numberOfSections;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.indexPathController.dataModel numberOfRowsInSection:section];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    self.currentCellForRowAtIndexPath = indexPath;
    NSString *cellId = [self tableView:tableView cellIdentifierAtIndexPath:indexPath];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    UIViewController *controller = [self tableView:tableView viewControllerForCell:cell];
    if (controller) {
        [self addChildViewController:controller];
    }
    [self tableView:tableView configureCell:cell atIndexPath:indexPath];
    self.currentCellForRowAtIndexPath = nil;
    return cell;
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self tableView:tableView configureCell:cell atIndexPath:indexPath];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return [self.indexPathController.dataModel sectionTitleForSection:section];
}

/**
 Automatically calculate cell height by retrieving a prototype and either a)
 returning the existing height or b) if the cell implements the `TLDynamicHeightView`
 protocol, returning the value of sizeWithData:. For (b), the data passed to the
 cell will be the item returned by the data model or, if the item is an instance
 of `TLIndexPathItem`, the value of the item's `data` property.
 */
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    id item = [self.indexPathController.dataModel itemAtIndexPath:indexPath];
    NSString *cellId = [self tableView:tableView cellIdentifierAtIndexPath:indexPath];
    if (cellId) {
        UITableViewCell *cell = [self tableView:tableView prototypeForCellIdentifier:cellId];
        if ([cell conformsToProtocol:@protocol(TLDynamicSizeView)]) {
            id<TLDynamicSizeView> v = (id<TLDynamicSizeView>)cell;
            if ([v respondsToSelector:@selector(sizeWithData:)]) {
                // cell knows how to calculate its size
                id data;
                if ([item isKindOfClass:[TLIndexPathItem class]]) {
                    TLIndexPathItem *i = (TLIndexPathItem *)item;
                    data = i.data;
                } else {
                    data = item;
                }
                CGSize computedSize = [v sizeWithData:data];
                return computedSize.height;
            } else {
                id tmp = self.currentCellForRowAtIndexPath;
                self.currentCellForRowAtIndexPath = indexPath;
                // automatically calculate size
                [self tableView:tableView configureCell:cell atIndexPath:indexPath];
                CGSize systemSize = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
                self.currentCellForRowAtIndexPath = tmp;
                CGFloat separatorHeight = tableView.separatorStyle == UITableViewCellSeparatorStyleNone ? 0 : 1 / [UIScreen mainScreen].scale;
                return systemSize.height + separatorHeight;
            }
        } else if (CGRectIsEmpty(cell.bounds)) {
            // Fix for adaptive storyboards. New adaptive storyboards (created in iOS8 or later),
            // which dequeue cells with empty bounds. If we see empty bounds, then fall back
            // (or perhaps forward) to self-sizing cells
            return UITableViewAutomaticDimension;
        } else {
            return cell.bounds.size.height;
        }
    }

    return 44.0;
}

- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIViewController *controller = [self tableView:tableView viewControllerForCell:cell];
    [controller removeFromParentViewController];
}

#pragma mark - TLIndexPathControllerDelegate

- (void)controller:(TLIndexPathController *)controller didUpdateDataModel:(TLIndexPathUpdates *)updates
{
    if (!updates.hasChanges) { return; }
    //only perform batch udpates if view is visible
    if (self.isViewLoaded && self.view.window) {
        [updates performBatchUpdatesOnTableView:self.tableView withRowAnimation:self.rowAnimationStyle];
    } else {
        [self.tableView reloadData];
    }
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <parent>
    <artifactId>dcm4chee-audit</artifactId>
    <groupId>dcm4che</groupId>
    <version>2.14.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>dcm4che</groupId>
  <artifactId>dcm4chee-audit-logger</artifactId>
  <version>2.14.0</version>
  <name>JMX Service for emitting DICOM Supp95 Audit Trail Messages</name>
  <dependencies>
    <dependency>
      <groupId>dcm4che</groupId>
      <artifactId>dcm4che-audit</artifactId>
      <version>2.0.14</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-j2ee</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-system</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-jmx</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-common</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jbosssx</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>


text:
function str = cell2delim(c,delim)
% CELL2DELIM
%        converts a cell array of strings to a delimited string
%
%    str = cell2delim(c,delim)
%
% parameters
%----------------------------------------------------------------
%    "c"        - an array of cells containing strings or numbers
%    "delim"    - a multi character delimiter or printf string to
%                 use as a delimiter (default is a single space).
%                 Delimiter will be directly copied to output,
%                 and NOT converted using sprintf
% outputs
%----------------------------------------------------------------
%    "str"      - a char row vector with the elements of "c" delimited by
%                 "delim", and without any trailing delimiter
%----------------------------------------------------------------
%
%    Hy Carrinski
%    Broad Institute
%    Created  16 July  2009

if nargin < 2
    delim = ' ';
end

if iscellstr(c) && ischar(delim)
   c        = vertcat(transpose(c(:)),repmat({delim},1,numel(c)));
   str      = [ c{:} ];
   str((end-numel(delim)+1):end) = [];
else
   error('ccbr:BadInput','cell2delim works on cell arrays of strings');
end


text:
/* API method to get paging information */
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) {
    return {
        "iStart":         oSettings._iDisplayStart,
        "iEnd":           oSettings.fnDisplayEnd(),
        "iLength":        oSettings._iDisplayLength,
        "iTotal":         oSettings.fnRecordsTotal(),
        "iFilteredTotal": oSettings.fnRecordsDisplay(),
        "iPage":          Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
        "iTotalPages":    Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
    };
}

/* Bootstrap style pagination control */
$.extend( $.fn.dataTableExt.oPagination, {
    "bootstrap_full": {
        "fnInit": function( oSettings, nPaging, fnDraw ) {
            var oLang = oSettings.oLanguage.oPaginate;
            var fnClickHandler = function ( e ) {
                e.preventDefault();
                if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
                    fnDraw( oSettings );
                }
            };

            $(nPaging).addClass('pagination').append(
                '
'+
                    '
« '+oLang.sFirst+'
'+
                    '
‹ '+oLang.sPrevious+'
'+
                    '
'+oLang.sNext+' ›
'+
                    '
'+oLang.sLast+' »
'+
                '
'
            );
            var els = $('a', nPaging);
            $(els[0]).bind( 'click.DT', { action: "first" }, fnClickHandler );
            $(els[1]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
            $(els[2]).bind( 'click.DT', { action: "next" }, fnClickHandler );
            $(els[3]).bind( 'click.DT', { action: "last" }, fnClickHandler );
        },

        "fnUpdate": function ( oSettings, fnDraw ) {
            var oPaging = oSettings.oInstance.fnPagingInfo();
            var an = oSettings.aanFeatures.p;
            var i;

            for ( i=0, iLen=an.length ; i<iLen ; i++ ) {
                // Add / remove disabled classes from the static elements
                if ( oPaging.iPage === 0 ) {
                    $('li:first', an[i]).addClass('disabled');
                    $('li:nth-child(2)', an[i]).addClass('disabled');
                } else {
                    $('li:first', an[i]).removeClass('disabled');
                    $('li:nth-child(2)', an[i]).removeClass('disabled');
                }

                if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
                    $('li:last', an[i]).addClass('disabled');
                    $('li:nth-last-child(2)', an[i]).addClass('disabled');
                } else {
                    $('li:last', an[i]).removeClass('disabled');
                    $('li:nth-last-child(2)', an[i]).removeClass('disabled');
                }
            }
        }
    }
} );


text:
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'little_ruby_scripts/history'
require 'little_ruby_scripts'


text:
package org.apache.lucene.analysis;

import java.io.IOException;
import java.io.Reader;

/**
 * "Tokenizes" the entire stream as a single token. This is useful
 * for data like zip codes, ids, and some product names.
 */
public class KeywordAnalyzer extends Analyzer {
  public KeywordAnalyzer() {
    setOverridesTokenStreamMethod(KeywordAnalyzer.class);
  }
  @Override
  public TokenStream tokenStream(String fieldName,
                                 final Reader reader) {
    return new KeywordTokenizer(reader);
  }
  @Override
  public TokenStream reusableTokenStream(String fieldName,
                                         final Reader reader) throws IOException {
    if (overridesTokenStreamMethod) {
      // LUCENE-1678: force fallback to tokenStream() if we
      // have been subclassed and that subclass overrides
      // tokenStream but not reusableTokenStream
      return tokenStream(fieldName, reader);
    }
    Tokenizer tokenizer = (Tokenizer) getPreviousTokenStream();
    if (tokenizer == null) {
      tokenizer = new KeywordTokenizer(reader);
      setPreviousTokenStream(tokenizer);
    } else
      tokenizer.reset(reader);
    return tokenizer;
  }
}


text:
// (C) Copyright 2015 Moodle Pty Ltd.
//
// 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.

import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavParams } from 'ionic-angular';
import { AddonModUrlIndexComponent } from '../../components/index/index';

/**
 * Page that displays a url.
 */
@IonicPage({ segment: 'addon-mod-url-index' })
@Component({
    selector: 'page-addon-mod-url-index',
    templateUrl: 'index.html',
})
export class AddonModUrlIndexPage {
    @ViewChild(AddonModUrlIndexComponent) urlComponent: AddonModUrlIndexComponent;

    title: string;
    module: any;
    courseId: number;

    constructor(navParams: NavParams) {
        this.module = navParams.get('module') || {};
        this.courseId = navParams.get('courseId');
        this.title = this.module.name;
    }

    /**
     * Update some data based on the url instance.
     *
     * @param url Url instance.
     */
    updateData(url: any): void {
        this.title = url.name || this.title;
    }
}


text:
@implementation NSWindow (AKWindowResizingAdditions)

- (void)ak_resizeAndSwapToContentView:(NSView *)aView animate:(BOOL)performAnimation {
    // Compute view size delta.
    NSSize currentSize = [[self contentView] frame].size;
    NSSize newSize = [aView frame].size;
    CGFloat deltaWidth = newSize.width - currentSize.width;
    CGFloat deltaHeight = newSize.height - currentSize.height;

    // Compute new window size.
    NSRect windowFrame = [self frame];
    windowFrame.size.height += deltaHeight;
    windowFrame.origin.y -= deltaHeight;
    windowFrame.size.width += deltaWidth;

    // Show temp view while changing views.
    NSView *tempView = [[NSView alloc] initWithFrame:[[self contentView] frame]];
    [self setContentView:tempView];

    // Set new window frame.
    [self setFrame:windowFrame display:YES animate:performAnimation];

    // Swap to the new view.
    [self setContentView:aView];
}

- (void)ak_resizeAndSwapToContentView:(NSView *)aView {
    [self ak_resizeAndSwapToContentView:aView animate:NO];
}

@end


text:
/* db.c
 * wrapper class for rubyscan database object
 * written by Alex Fulton
 * Dec 2016
 */
#ifndef RSCAN_DB_H
#define RSCAN_DB_H

extern VALUE rscan_cDatabase;

typedef struct db {
    hs_database_t *obj;
} rscan_db_t;

extern VALUE rscan_db_define(VALUE root);
extern void rscan_db_set(VALUE self, hs_database_t *val);

extern VALUE rscan_class_db();

#define Get_Db(value,pointer) \
        Data_Get_Struct(value,rscan_db_t,pointer)
#endif


text:
/* 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.
 */
package org.camunda.bpm.engine.impl;

import java.util.Collections;
import java.util.List;

import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.impl.core.variable.value.UntypedValueImpl;
import org.camunda.bpm.engine.impl.persistence.entity.ByteArrayEntity;
import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer;
import org.camunda.bpm.engine.impl.variable.serializer.ValueFields;
import org.camunda.bpm.engine.impl.variable.serializer.VariableSerializers;
import org.camunda.bpm.engine.impl.variable.serializer.jpa.JPAVariableSerializer;
import org.camunda.bpm.engine.variable.type.ValueType;
import org.camunda.bpm.engine.variable.value.TypedValue;

/**
 * @author Thorben Lindhauer
 *
 */
public class SingleQueryVariableValueCondition extends AbstractQueryVariableValueCondition
    implements ValueFields {

  protected String textValue;
  protected String textValue2;
  protected Long longValue;
  protected Double doubleValue;
  protected String type;

  public SingleQueryVariableValueCondition(QueryVariableValue variableValue) {
    super(variableValue);
  }

  public void initializeValue(VariableSerializers serializers) {
    TypedValue typedValue = wrappedQueryValue.getTypedValue();
    initializeValue(serializers, typedValue);
  }

  public void initializeValue(VariableSerializers serializers, TypedValue typedValue) {
    TypedValueSerializer serializer = determineSerializer(serializers, typedValue);

    if(typedValue instanceof UntypedValueImpl) {
      // type has been detected
      typedValue = serializer.convertToTypedValue((UntypedValueImpl) typedValue);
    }
    serializer.writeValue(typedValue, this);
    this.type = serializer.getName();
  }

  protected TypedValueSerializer determineSerializer(VariableSerializers serializers, TypedValue value) {
    TypedValueSerializer serializer = serializers.findSerializerForValue(value);

    if(serializer.getType() == ValueType.BYTES){
      throw new ProcessEngineException("Variables of type ByteArray cannot be used to query");

    }
    else if(serializer instanceof JPAVariableSerializer) {
      if(wrappedQueryValue.getOperator() != QueryOperator.EQUALS) {
        throw new ProcessEngineException("JPA entity variables can only be used in 'variableValueEquals'");
      }

    }
    else {
      if(!serializer.getType().isPrimitiveValueType()) {
        throw new ProcessEngineException("Object values cannot be used to query");
      }

    }

    return serializer;
  }

  public List<SingleQueryVariableValueCondition> getDisjunctiveConditions() {
    return Collections.singletonList(this);
  }

  public String getName() {
    return wrappedQueryValue.getName();
  }

  public String getTextValue() {
    return textValue;
  }
  public void setTextValue(String textValue) {
    this.textValue = textValue;
  }
  public String getTextValue2() {
    return textValue2;
  }
  public void setTextValue2(String textValue2) {
    this.textValue2 = textValue2;
  }
  public Long getLongValue() {
    return longValue;
  }
  public void setLongValue(Long longValue) {
    this.longValue = longValue;
  }
  public Double getDoubleValue() {
    return doubleValue;
  }
  public void setDoubleValue(Double doubleValue) {
    this.doubleValue = doubleValue;
  }
  public String getByteArrayValueId() {
    return null;
  }

  public ByteArrayEntity getByteArrayValue() {
    return null;
  }

  public void setByteArrayValue(byte[] bytes) {
  }

  public String getType() {
    return type;
  }

}


text:
'use strict';

module.exports = app => {
  app.post('/home', 'home.select');
  app.post('/essay', 'essay.select');
};


text:
@interface CategoryContents : NSObject

@property (nonatomic, assign) NSInteger ret;
@property (nonatomic, strong) NSArray *list;

@end


text:
var typescript = require('typescript');
var path = require('path');
var cloneExtend = require('cloneextend');

//Will not bother to normalize file paths and filter out external references
var defaultOptions = {
  normalize:true,
  files: [],
  compiler: {
    noLib:true
  }
};

var filesort = function(givenOptions) {

  var options =  cloneExtend.add(givenOptions,defaultOptions);

  var targetedFiles = [];

  if (!options.normalize) {
    targetedFiles = options.files;
  }
  else {
    options.files.forEach(function(file) {
      targetedFiles.push(path.normalize(file));
    });
  }

  //Gives files to the compiler
  var host = typescript.createCompilerHost(options.compiler);
  var program = typescript.createProgram(targetedFiles,options.compiler, host);

  /**
   * retrieve sorted files
   * which seems to not be normalized on windows (come back
   * with '/' and not '\')
   */
  var sortedFiles = program.getSourceFiles();

  var result = [];

  sortedFiles.forEach(function(sourceFile) {
    if(!options.normalize) {
      result.push(sourceFile.filename);
    }
    else {
      result.push(path.normalize(sourceFile.filename));
    }
  });

  return result;
}

module.exports = filesort;


text:
using System;
using System.Runtime.Serialization;

namespace Lollipop
{
    [Serializable]
    public class LeagueException : Exception
    {
        public LeagueException()
        {
        }

        public LeagueException(string message) : base(message)
        {
        }

        public LeagueException(string message, Exception inner) : base(message, inner)
        {
        }

        protected LeagueException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }

    [Serializable]
    public class LoginFailedException : LeagueException
    {
        public LoginFailedException()
        {
        }

        public LoginFailedException(string message) : base(message)
        {
        }

        public LoginFailedException(string message, Exception inner) : base(message, inner)
        {
        }

        protected LoginFailedException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }

    [Serializable]
    public class GameNotFoundException : LeagueException
    {
        public GameNotFoundException()
        {
        }

        public GameNotFoundException(string message) : base(message)
        {
        }

        public GameNotFoundException(string message, Exception inner) : base(message, inner)
        {
        }

        protected GameNotFoundException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }

    [Serializable]
    public class GameNotObservableException : LeagueException
    {
        public GameNotObservableException()
        {
        }

        public GameNotObservableException(string message) : base(message)
        {
        }

        public GameNotObservableException(string message, Exception inner) : base(message, inner)
        {
        }

        protected GameNotObservableException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }
}


text:
def make_tree(item, depth):
    if depth > 0:
        item2 = 2 * item
        depth -= 1
        return (item, make_tree(item2 - 1, depth), make_tree(item2, depth))
    else:
        return (item, None, None)

def check_tree(tree):
    (item, left, right) = tree
    if left is not None:
        return item + check_tree(left) - check_tree(right)
    else:
        return item

def main():
    min_depth = 4
    max_depth = max(min_depth + 2, 16) #int(argv[1]))
    stretch_depth = max_depth + 1

    print "stretch tree of depth %d\t check: %d" % (stretch_depth, check_tree(make_tree(0, stretch_depth)))

    long_lived_tree = make_tree(0, max_depth)

    for depth in xrange(min_depth, stretch_depth, 2):
        iterations = 2**(max_depth - depth + min_depth)

        check = 0
        for i in xrange(1, iterations + 1):
            check += check_tree(make_tree(i, depth)) + check_tree(make_tree(-i, depth))

        print "%d\t trees of depth %d\t check: %d" % (iterations * 2, depth, check)

    print "long lived tree of depth %d\t check: %d" % (max_depth, check_tree(long_lived_tree))

if __name__ == "__main__":
    main()


text: SELECT utid, tag, msg FROM android_logs;