text:
{% extends "admin_doc/base_docs.html" %}
{% load i18n %}

{% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}

                {% trans 'Home' %}
                › {% trans 'Documentation' %}
                › {% trans 'Tags' %}

{% endblock %}
{% block title %}{% trans 'Template tags' %}{% endblock %}

{% block content %}

{% trans 'Template tag documentation' %}

            {% regroup tags|dictsort:"library" by library as tag_libraries %}
            {% for library in tag_libraries %}

  {{ forloop.counter }}. {% firstof library.grouper _("Built-in tags") %}

                    {% if library.grouper %}

                        {% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these
                            tags, put {{ code }} in your template before using the tag.{% endblocktrans %}

{% endif %}

                    {% for tag in library.list|dictsort:"name" %}

{{ tag.name }}

{{ tag.title|striptags }}

                        {{ tag.body }}
                        {% if not forloop.last %}

                            {% endif %}
                    {% endfor %}

            {% endfor %}

{% endblock %}

{% block sidebar %}
    {% regroup tags|dictsort:"library" by library as tag_libraries %}
    {% for library in tag_libraries %}

 {% firstof library.grouper _("Built-in tags") %}

                        {% for tag in library.list|dictsort:"name" %}
                            {{ tag.name }}
                        {% endfor %}

    {% endfor %}
{% endblock %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Marten.Services.Json;
using Marten.Testing.Harness;
using Newtonsoft.Json;
using Shouldly;
using Xunit;

namespace Marten.Testing.Linq
{
    public class TypeWithInnerCollectionsWithJsonConverterAttribute
    {
        public Guid Id { get; set; }
        public string Flatten { get; set; }
        public string[] Array { get; set; }
        public List<string> List { get; set; }
        public IList<string> IList { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public IEnumerable<string> Enumerable { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public IEnumerable<string> IEnumerableFromArray { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public IEnumerable<string> IEnumerbaleFromList { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public ICollection<string> ICollection { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public IReadOnlyCollection<string> IReadonlyCollection { get; set; }

        [JsonConverter(typeof(JsonNetCollectionToArrayJsonConverter))]
        public IReadOnlyCollection<TypeWithInnerCollectionsWithJsonConverterAttribute> IReadonlyCollectionOfInnerClasses { get; set; }

        public static TypeWithInnerCollectionsWithJsonConverterAttribute Create(params string[] array)
        {
            return new TypeWithInnerCollectionsWithJsonConverterAttribute()
            {
                Id = Guid.NewGuid(),
                Flatten = array.Aggregate((i, j) => i + j),
                Array = array,
                List = array.ToList(),
                IList = array.ToList(),
                Enumerable = array.AsEnumerable(),
                IEnumerableFromArray = array,
                IEnumerbaleFromList = array.ToList(),
                ICollection = array.ToList(),
                IReadonlyCollection = array.ToList(),
                IReadonlyCollectionOfInnerClasses = new List<TypeWithInnerCollectionsWithJsonConverterAttribute>
                    {
                        new TypeWithInnerCollectionsWithJsonConverterAttribute()
                        {
                            Id = Guid.NewGuid(),
                            Flatten = array.Aggregate((i, j) => i + j),
                            Array = array,
                            List = array.ToList(),
                            IList = array.ToList(),
                            Enumerable = array.AsEnumerable(),
                            IEnumerableFromArray = array,
                            ICollection = array.ToList(),
                            IEnumerbaleFromList = array.ToList(),
                            IReadonlyCollection = array.ToList(),
                        }
                    }
            };
        }
    };

    [ControlledQueryStoryteller]
    public class query_with_inner_query_with_CollectionToArrayJsonConverter_onProperty : IntegrationContext
    {
        private static readonly TypeWithInnerCollectionsWithJsonConverterAttribute[] TestData = new TypeWithInnerCollectionsWithJsonConverterAttribute[]
        {
            TypeWithInnerCollectionsWithJsonConverterAttribute.Create("one", "two"),
            TypeWithInnerCollectionsWithJsonConverterAttribute.Create("two", "three"),
            TypeWithInnerCollectionsWithJsonConverterAttribute.Create("four", "five"),
        };

        private const string SearchPhrase = "two";

        public static readonly TheoryData<Expression<Func<TypeWithInnerCollectionsWithJsonConverterAttribute, bool>>> Predicates = new TheoryData<Expression<Func<TypeWithInnerCollectionsWithJsonConverterAttribute, bool>>>
        {
            x => x.Array.Contains(SearchPhrase),
            x => x.Enumerable.Contains(SearchPhrase),
            x => x.IEnumerableFromArray.Contains(SearchPhrase),
            x => x.IEnumerbaleFromList.Contains(SearchPhrase),
            x => x.List.Contains(SearchPhrase),
            x => x.IList.Contains(SearchPhrase),
            x => x.ICollection.Contains(SearchPhrase),
            x => x.IReadonlyCollection.Contains(SearchPhrase),
            x => x.IReadonlyCollection.Where(e => e == SearchPhrase).Any(),
            x => x.IReadonlyCollectionOfInnerClasses.Where(e => e.Flatten == "onetwo").Any() || x.IReadonlyCollectionOfInnerClasses.Where(e => e.Flatten == "twothree").Any()
        };

        [Theory]
        [MemberData(nameof(Predicates))]
        public async Task having_type_with_CollectionToArrayJsonConverter_can_query_against_array_of_string(Expression<Func<TypeWithInnerCollectionsWithJsonConverterAttribute, bool>> predicate)
        {
            SetupTestData();

            using (var query = theStore.QuerySession())
            {
                var results = await query.Query<TypeWithInnerCollectionsWithJsonConverterAttribute>()
                    .Where(predicate)
                    .ToListAsync();

                results.Count.ShouldBe(2);
                results.All(e => e.Enumerable.Contains(SearchPhrase)).ShouldBeTrue();
            }
        }

        private void SetupTestData()
        {
            using (var session = theStore.OpenSession())
            {
                session.Store(TestData);
                session.SaveChanges();
            }
        }

        public query_with_inner_query_with_CollectionToArrayJsonConverter_onProperty(DefaultStoreFixture fixture) : base(fixture)
        {
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
run 'rm public/index.html'
run 'rm public/images/rails.png'
run 'rm README'
run 'touch README'
# run 'rm public/favicon.ico'
# get "http://www.quickleft.com/favicon.ico", "public/images/favicon.ico"
# get "http://www.quickleft.com/ati.png", "public/images/ati.png"


text:
import {loginByUsername, logout, getUserInfo} from '../../api/login'
import {getToken, setToken, removeToken} from '../../utils/auth'

const user = {
  state: {
    user: '',
    status: '',
    code: '',
    token: getToken(),
    name: '',
    avatar: '',
    introduction: '',
    roles: [],
    setting: {
      articlePlatform: []
    }
  },
  mutations: {
    SET_CODE: (state, code) => {
      state.code = code
    },
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    SET_INTRODUCTION: (state, introduction) => {
      state.introduction = introduction
    },
    SET_SETTING: (state, setting) => {
      state.setting = setting
    },
    SET_STATUS: (state, status) => {
      state.status = status
    },
    SET_NAME: (state, name) => {
      state.name = name
    },
    SET_AVATAR: (state, avatar) => {
      state.avatar = avatar
    },
    SET_ROLES: (state, roles) => {
      state.roles = roles
    }
  },
  actions: {
    // 用户名登录
    LoginByUsername({commit}, userInfo) {
      const username = userInfo.username.trim()
      return new Promise((resolve, reject) => {
        loginByUsername(username, userInfo.password).then(response => {
          const data = response.data;
          setToken(response.data.token)
          commit('SET_TOKEN', data.token)
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 获取用户信息
    GetUserInfo({commit, state}) {
      return new Promise((resolve, reject) => {
        getUserInfo(state.token).then(response => {
          const data = response.data
          commit('SET_ROLES', data.role)
          commit('SET_NAME', data.name)
          commit('SET_AVATAR', data.avatar)
          commit('SET_INTRODUCTION', data.introduction)
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 第三方验证登录
    // LoginByThirdparty({ commit, state }, code) {
    //   return new Promise((resolve, reject) => {
    //     commit('SET_CODE', code)
    //     loginByThirdparty(state.status, state.email, state.code).then(response => {
    //       commit('SET_TOKEN', response.data.token)
    //       setToken(response.data.token)
    //       resolve()
    //     }).catch(error => {
    //       reject(error)
    //     })
    //   })
    // },
    // 登出
    LogOut({commit, state}) {
      return new Promise((resolve, reject) => {
        logout(state.token).then(() => {
          commit('SET_TOKEN', '')
          commit('SET_ROLES', [])
          removeToken()
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 前端 登出
    FedLogOut({commit}) {
      return new Promise(resolve => {
        commit('SET_TOKEN', '')
        removeToken()
        resolve()
      })
    },
    // 动态修改权限
    ChangeRole({commit}, role) {
      return new Promise(resolve => {
        commit('SET_TOKEN', role)
        setToken(role)
        getUserInfo(role).then(response => {
          const data = response.data
          commit('SET_ROLES', data.role)
          commit('SET_NAME', data.name)
          commit('SET_AVATAR', data.avatar)
          commit('SET_INTRODUCTION', data.introduction)
          resolve()
        })
      })
    }
  }
}
export default user


text:
module Mercadolibre
  module Core
    module CategoriesAndListings
      def get_sites
        results = get_request('/sites')

        results[:body].map { |r| Mercadolibre::Entity::Site.new(r) }
      end

      def get_site(site_id)
        result = get_request("/sites/#{site_id}")

        Mercadolibre::Entity::Site.new(result[:body])
      end

      def get_site_domain_info(domain)
        result = get_request("/site_domains/#{domain}")

        Mercadolibre::Entity::SiteDomain.new(result[:body])
      end

      def get_listing_types(site_id)
        results = get_request("/sites/#{site_id}/listing_types")

        results[:body].map { |r| Mercadolibre::Entity::ListingType.new(r) }
      end

      def get_listing_exposures(site_id)
        results = get_request("/sites/#{site_id}/listing_exposures")

        results[:body].map { |r| Mercadolibre::Entity::ListingExposure.new(r) }
      end

      def get_listing_prices(filters)
        valid_filters = ['price', 'listing_type_id', 'quantity', 'category_id', 'currency_id']
        filters.keep_if { |k,v| valid_filters.include?(k.to_s) }

        results = get_request("/sites/#{site_id}/listing_prices", filters)

        results[:body].map { |r| Mercadolibre::Entity::ListingPrice.new(r) }
      end

      def get_site_categories(site_id)
        results = get_request("/sites/#{site_id}/categories")

        results[:body].map { |r| Mercadolibre::Entity::Category.new(r) }
      end

      def get_category(category_id)
        result = get_request("/categories/#{category_id}")

        Mercadolibre::Entity::Category.new(result[:body])
      end
    end
  end
end


text:
<button *ngIf="!inline" class="btn btn-primary pull-right" title="{{(title | translate) }}" [style.min.width]="width" [style.height]="height" [ngClass]="{'btn-primary-hover': (value.value$ | async)}" (mousedown)="press()" (mouseup)="release()" [attr.title]="value.name">

    <ng-container *ngIf="parameters.buttonText" >{{ parameters.buttonText}}</ng-container>
</button>

<button *ngIf="inline" class="btn btn-primary" title="{{title}}" [ngClass]="{'btn-primary-hover': (value.value$ | async)}" (mousedown)="press()" (mouseup)="release()" [attr.title]="value.name">

    <ng-container *ngIf="parameters.buttonText" >{{ parameters.buttonText}}</ng-container>
</button>


text:
$(document).ready(function (){
	// nav links animation
	$("nav ul li").append($(".nav-anim"));

	$("nav a").click(function() {
		$(".active-nav-item").removeClass("active-nav-item");
		$(this).addClass("active-nav-item");
	});

	var globalUsr = "";
	setTimeout(function(){
		$("#skip-to-order").css({"transition": "all .6s ease-in", "bottom": "7%"}).click(function(){
			$("html body").animate({scrollTop: $("div[role='main']")[0].getBoundingClientRect().top}, 450);
			$("div[role='main'] input[type='search']").focus();
		});
		setTimeout(function(){
			$("#skip-to-order").css({"transition": "none", "animation": "skip-to-content 1s ease-in-out infinite"});
		}, 2000);
	}, 300);

	// Display nav only when user is not signed in
	if ($("#logged-in").html().match(/\W|undefined/)) {
		$("header")[0].insertBefore($("header nav")[0], $("main section #amount")[0]);
	}
	else {
		$("main section nav").replaceWith($("#logged-in").show().css("margin-left", "25%").html("sign out (" + $("#logged-in").html() + ")"));
		$("title").html($("#logged-in").html().slice(10, -1) + " -- Five Star")

		/* why doesnt this work??
		* $("title").html($("#logged-in").html().slice(this.indexOf("sign out ("), -1) + " -- Five Star")
		*/
	}

	// Init input fields if user attempted sign in before
	$("#email").val(localStorage.getItem("_ml"));
	$("#password").val(localStorage.getItem("_pwd"));

	// Fire up login button with colorbox
	var who;
	$("nav ul li a").click(function(e){
		e.preventDefault();
		who = $(this)[0]; // assign what form to show. Data attributes would work too

		// Customizing colorbox
		$("#cboxWrapper").click(function customize(e) {
			var target = e.target, formEl = $("#auth_form, #email, #password, #auth_form input[type='submit'], #auth_form label");
			if (formEl.index(target) == -1) {
				$("#cboxOverlay").trigger("click");
			}
			else {
				target.removeEventListener("click", customize);
			}

			});

			if (e.target == $("#register")[0]) {
				$("#auth_form input[type='submit']").val("Register");
			}
			else $("#auth_form input[type='submit']").val("Login");

			$("#auth_form").show();
			$("body").css("overflow-y", "hidden");
			history.pushState({username: undefined}, "", "/" + $(e.target).attr("id") + "/");
	}).colorbox({inline: true, width: '65%', onClosed: function(){
			$("#auth_form").hide();
			$("body").css("overflow-y", "initial");

			$(".active-nav-item").removeClass("active-nav-item");

			if ($("section").has("nav").length && globalUsr == "") { // if user is not signed in but closes colorbox, go back to home url
				history.back();
			}
		}
	});

	// login logic. if auth user, remove form
	$("#auth_form form").on("submit", function(e) {
		e.preventDefault();

	// persist entered details
	localStorage.setItem("_ml", $("#email").val());
	localStorage.setItem("_pwd", $("#password").val());

	// handle login
	if (who == $("#login")[0]) {
		$.post("/login/", $("#auth_form form").serialize(), function (data){

			if (data.redirectTo == "staff") {
				location.replace(location.protocol + "//" + location.host + "/staff/")
			}

			else if (data.redirectTo == "admin") {
				location.replace(location.protocol + "//" + location.host + "/admin/")
			}

			else if (data.errText !== "") {
				$(".message-text").html(data.errText);
			}
			else {
				globalUsr = data.sessName;
				history.replaceState({username: globalUsr}, "", "/users/" + globalUsr);
				$("title").html(globalUsr + " -- Five Star")
				$("nav").replaceWith($("#logged-in").show().css("margin-left", "25%").html("sign out (" + globalUsr + ")"));
				$.colorbox.close();
			}
		});
	}

	// handle register
	else if (who == $("#register")[0]) {
		$.post("/register/", $("#auth_form form").serialize(), function (data){
			var confirm = document.createElement("INPUT");
			data = JSON.parse(data);
			$(confirm).attr({name: "confirm", id: "confirm"});

			if (data.confirmState) {
				$("#auth_form form")[0].insertBefore($(confirm)[0], $("#auth_form input[type='submit']")[0]);
			}
			else {
				$(".message-text").html(data.errText);
				console.log("didnt works")
			}
		});
	}
});
});

window.onpopstate = function () {
	$.colorbox.close();
};


text:
define(['lodash',
'q',
'log',
'rl',
'server'],
function (_, Q, log, rl, server) {
  var _username;
  var _password;
  var _email;
  var _gender;

  var cmd = function (data) {
    var deferred = Q.defer();

    askUsername()
    .then(askPassword)
    .then(signIn)
    .then(function () {
      deferred.resolve();
    })

    return deferred.promise;
  };

  function askUsername() {
    var deferred = Q.defer();

    rl.ask("Pick a username: ", function (input) {
      _username = input;
      deferred.resolve();
    });

    return deferred.promise;
  }

  function askPassword() {
    var deferred = Q.defer();

    rl.ask("Pick a password: ", function (input) {
      _password = input;
      deferred.resolve();
    });

    return deferred.promise;
  }

  function signIn() {
    var deferred = Q.defer();

    server.getSocket().on("sign_in_response", function (response) {
      if (response.result) {
        log.info("You're logged in.");
      } else {
        log.info("Incorrect data!");
      }
      deferred.resolve();
    });
    server.getSocket().emit("sign_in", {
      username: _username,
      password: _password
    });

    return deferred.promise;
  }

  return cmd;
});


text:
import React from 'react';
import react_png from '../../img/react.png';
import webpack_png from '../../img/webpack.png';
import bootstrap_png from '../../img/bootstrap.png';
import redux_png from '../../img/redux.png';
import sass_png from '../../img/sass.png';
import lodash_png from '../../img/lodash.png';
import babel_png from '../../img/babel.png';
import es6_png from '../../img/es6.png';

export default class Welcome extends React.Component {
  render() {
    return (

Transcend the Web

Use the latest web development technologies.

            Leverage the cutting edge technologies to build web applications that transcend the web.

    );
  }

}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="keywords" content="columbia university, students, technology, entrepreneurship, race, social justice">
    <meta name="description" content="A student initiative at Columbia supporting tech projects by and for underrepresented people of color">
    <link rel="shortcut icon" type="image/png" href="img/fire.png"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">

    <link rel="stylesheet" type="text/css" href="./css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="./style.css">
    <link rel="stylesheet" href="./css/animate.css"/>

    <link rel='stylesheet' href='./css/et-line.min.css'/>
    <link rel='stylesheet' href='./css/font-awesome.min.css'/>
    <link href='http://fonts.googleapis.com/css?family=Montserrat&subset=latin,latin-ext' rel='stylesheet'
          type='text/css'>

    <title>Home</title>

                     ColorCode
                    <button id="nav-toggle" type="button" class="ui-navbar-toggle navbar-toggle" data-toggle="collapse"
                            data-target=".navbar-1">
                        Toggle navigation
                    </button>

                            Our Work

                            Events

                            Team

                            Contact

                            FAQ

WE BELIEVE IN

                        ColorCode is a student initiative founded out of Columbia's Intercultural Resources Center.

 We support tech projects by and for underrepresented people of color.

                        GET IN TOUCH

 This is what we're about

 We're not your usual #diversity incubator. Recognizing that the tech industry routinely exploits communities of color while
                excluding people of color from its ranks, ColorCode aims to support tech projects built by and for
                people of color. We invest our time, energy, and resources into initiatives that dismantle existing systems
                of oppression rather than reinforcing them. Our work revolves around three core tenets.

                        Mentorship

                        Connecting underrepresented people of color to the people, institutions, and resources they need to get things built.

                        Skill Building

                        Empowering underrepresented people of color to build technology for themselves and their own communities.

                        Advocacy

                        Using our platform to demand greater access for underrepresented people of color--first at Columbia University, then at other institutions as well.

                        Our Events

                        Just a sample of what we do.

                        Meet our team

                        We are students at Columbia University.

                      Zainab Aina

                        John Anukem

                        Braxton Gunter

                        Chloé Matthews

                        Justin Woodbridge

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                        eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque
                                        molestias odio aut eius animi. Impedit temporibus nisi accusamus.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                        eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque
                                        molestias odio aut eius animi. Impedit temporibus nisi accusamus.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                        eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque
                                        molestias odio aut eius animi. Impedit temporibus nisi accusamus.

                        Don’t hesitate to contact us now...

                    EMAIL US

 These are our partners

 People at Columbia and beyond who are fighting similar fights.

                        FAQ

                        Get Answers: Frequently Asked Questions

                                    This is a question #1

                                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                    eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque molestias
                                    odio aut eius animi. Impedit temporibus nisi accusamus.

                                    This is a question #2

                                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                    eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque molestias
                                    odio aut eius animi. Impedit temporibus nisi accusamus.

                                    This is a question #3

                                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, veritatis nulla
                                    eum laudantium totam tempore optio doloremque laboriosam quas, quos eaque molestias
                                    odio aut eius animi. Impedit temporibus nisi accusamus.

Created by BootstrapOcean


text:
<?php

namespace Magium\Configuration\Tests\Config;

use Magium\Configuration\Config\Repository\JsonConfigurationRepository;
use PHPUnit\Framework\TestCase;

class JsonConfigurationRepositoryTest extends TestCase
{

    public function testXpath()
    {
        $json = <<<JSON
        {
            "one": {
                "two": {
                    "three": "value"
                }
            }
        }
JSON;
        $obj = new JsonConfigurationRepository(trim($json));
        self::assertEquals('value', $obj->xpath('one/two/three'));
    }

}


text:
<?php

namespace App\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * App\Repository$NatureSupportRepository.
 */
class NatureSupportRepository extends EntityRepository
{
}


text:
namespace ogl
{
  class CAssimpObjectBuilder : public CObjectBuilder
  {
    protected:
    typedef struct {
      float x;
      float y;
    } vec2_t;
    typedef struct {
      float x;
      float y;
      float z;
    } vec3_t;
    typedef struct {
      vec3_t position;
      vec2_t texcoord;
      vec3_t normal;
    } vertex_t;
    typedef struct {
      uint ids[NUM_BONES_PER_VERTEX];
      uint weights[NUM_BONES_PER_VERTEX];
    } bone_t; // vertex_bone_data_t

    protected:
    std::string mFile;

    public:
    CObject* build()
    {
      sys::info << "ogl::CAssimpObjectBuilder::build()" << sys::endl;

      // clear textures?

      CObject* pObject = new CObject;

      Assimp::Importer importer;
      const aiScene* paiScene = importer.ReadFile(mFile.c_str(), aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_GenSmoothNormals | aiProcess_FlipUVs | aiProcess_CalcTangentSpace);

      if(!paiScene)
      {
        sys::info << "> ERROR: Error parsing. " << importer.GetErrorString() << sys::endl;
        throw CException(importer.GetErrorString());
      }

      // bones
      // mGlobalInverseTransform = paiScene->mRootNode->mTransformation.Inverse();

      sys::info << sys::tab << "filepath: " << mFile << sys::endl;

      //pObject->mShapes.resize(paiScene->mNumMeshes);

      //mTextures.resize(paiScene->mNumMaterials);

      std::vector<ushort>      indices;
      std::vector<math::vec3>  positions;
      std::vector<math::vec2>  texcoords;
      std::vector<math::vec3>  normals;
      std::vector<math::vec3>  tangents;
      std::vector<math::ivec4> boneids;
      std::vector<math::vec4>  boneweights;

      ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      sys::info << sys::tab << "mNumMeshes:    " << paiScene->mNumMeshes << sys::endl;
      sys::info << sys::tab << "mNumMaterials: " << paiScene->mNumMaterials << sys::endl;
      sys::info << sys::tab << "mNumTextures:  " << paiScene->mNumTextures << sys::endl;

//      pObject->mNumBones = 0;

      CDdsTextureBuilder* pTextureBuilder = new CDdsTextureBuilder;
      uint nNumTextureTypes = (uint)(CTexture::EScope::GENERIC);
      std::string texpath;
      std::string subpath = mFile.substr(0, mFile.find_last_of('/') + 1).substr(strlen(MODELPATH));
      const aiVector3D zero3d(0.0f, 0.0f, 0.0f);
      GLuint nVertexStart  = 0;
      GLuint nIndicesStart = 0;
      GLuint nVertexEnd    = 0;
      GLuint nIndicesEnd   = 0;
      float  fMax          = 0.0f;
      for(size_t i = 0, l = paiScene->mNumMeshes; i < l; ++i)
      {
        const aiMesh* paiMesh = paiScene->mMeshes[i];
        CShape* pShape    = new CShape;
        pShape->mMaterial = new CMaterial;

        sys::info << sys::tab << "mMaterialIndex: " << paiMesh->mMaterialIndex << sys::endl;

        const aiMaterial* paiMaterial = paiScene->mMaterials[paiMesh->mMaterialIndex];

        for(uint j = 0; j < nNumTextureTypes; j++)
        {
          CTexture::EScope eTextureType = (CTexture::EScope)(j);

          // 0x0 = aiTextureType_NONE
          // 0x1 = aiTextureType_DIFFUSE
          // 0x5 = aiTextureType_HEIGHT
          if(paiMaterial->GetTextureCount((aiTextureType)(eTextureType)) > 0) // load diffuse map
          {
            aiString file;
            if(paiMaterial->GetTexture((aiTextureType)(eTextureType), 0, &file, NULL, NULL, NULL, NULL, NULL) == AI_SUCCESS)
            {
              texpath.clear();
              texpath.append(subpath);
              texpath.append(file.data);
              texpath = texpath.substr(0, texpath.find_last_of('.')).append(".dds");
              pTextureBuilder->setFile(texpath);

              pShape->mMaterial->setTexture((ogl::CTexture::EScope)(eTextureType), pTextureBuilder->build());
            }
          }
        }

        for(size_t j = 0; j < paiMesh->mNumVertices; ++j)
        {
          const aiVector3D* pPosition = &(paiMesh->mVertices[j]);
          const aiVector3D* pNormal   = &(paiMesh->mNormals[j]);
          const aiVector3D* pTexcoord = paiMesh->HasTextureCoords(0) ? &(paiMesh->mTextureCoords[0][j]) : &zero3d;
          const aiVector3D* pTangent  = paiMesh->HasTextureCoords(0) ? &paiMesh->mTangents[j] : &zero3d;

          CVertex v;

          positions.push_back(math::vec3(pPosition->x, pPosition->y, pPosition->z));
          texcoords.push_back(math::vec2(pTexcoord->x, pTexcoord->y));
          normals.push_back(math::vec3(pNormal->x, pNormal->y, pNormal->z));
          tangents.push_back(math::vec3(pTangent->x, pTangent->y, pTangent->z));

          fMax = fMax >= std::abs(positions.back().x) ? fMax : std::abs(positions.back().x);
          fMax = fMax >= std::abs(positions.back().y) ? fMax : std::abs(positions.back().y);
          fMax = fMax >= std::abs(positions.back().z) ? fMax : std::abs(positions.back().z);

          //sys::info << "[" << j << "] " << v.mPosition.x << " " << v.mPosition.y << " " << v.mPosition.z << sys::endl;
        }
        nVertexEnd  = positions.size();

//        // load bones
//        for(size_t j = 0; j < paiMesh->mNumBones; ++j)
//        {
//          size_t      boneIndex = 0;
//          std::string boneName(paiMesh->mBones[i]->mName.data);
//
//          if(pObject->mBoneMap.find(boneName) == pObject->mBoneMap.end()) // if new bone
//          {
//            // allocate index for new bone
//            boneIndex = pObject->mNumBones;
//            pObject->mNumBones++;
//            CObject::bone_t bone;
//            bone.mOffsetMatrix = toMatrix(paiMesh->mBones[i]->mOffsetMatrix);
//            pObject->mBones[boneIndex] = bone;
//            pObject->mBoneMap[boneName] = boneIndex;
//          }
//          else
//          {
//            boneIndex = pObject->mBoneMap[boneName];
//          }
//
//          for(size_t k = 0; k < paiMesh->mBones[i]->mNumWeights; ++k)
//          {
//            size_t vertexId = nVertexStart + paiMesh->mBones[j]->mWeights[k].mVertexId;
//            float weight = paiMesh->mBones[j]->mWeights[k].mWeight;
//            addBoneData(vertices[vertexId], boneIndex, weight);
//          }
//
//          // add bone data to vertexID -> boneIndex, weight
//        } // end load bones

        //sys::info << "paiMesh->mNumFaces: " << paiMesh->mNumFaces << sys::endl;

        for(size_t j = 0; j < paiMesh->mNumFaces; ++j)
        {
          const aiFace& face = paiMesh->mFaces[j];
          assert(face.mNumIndices == 3);
          indices.push_back(face.mIndices[0]);
          indices.push_back(face.mIndices[1]);
          indices.push_back(face.mIndices[2]);

          // sys::info << "[" << j << "] " << face.mIndices[0] << " " << face.mIndices[1] << " " << face.mIndices[2] << sys::endl;
        }
        nIndicesEnd = indices.size();

        pShape->setVertexBufferRange(CBufferRange(nVertexStart, nVertexEnd - nVertexStart,   GL_FLOAT));
        pShape->setIndexBufferRange(CBufferRange(nIndicesStart, nIndicesEnd - nIndicesStart, GL_UNSIGNED_SHORT));

        nVertexStart  = nVertexEnd;
        nIndicesStart = nIndicesEnd;

        pObject->addShape(pShape);
      }
      delete pTextureBuilder;

      ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//      // load nodes
//      buildNodes(pObject->mRootNode, paiScene->mRootNode);
//
//      // load/create animations
//      for(size_t i = 0; i < paiScene->mNumAnimations; ++i)
//      {
//        CObject::animation_t anim;
//        anim.duration = paiScene->mAnimations[i]->mDuration;
//        for(size_t j = 0; j < paiScene->mAnimations[i]->mNumChannels; ++j)
//        {
//          CObject::channel_t channnel;
//          channnel.name = std::string(paiScene->mAnimations[i]->mChannels[j]->mNodeName.data);
//          for(size_t k = 0; k < paiScene->mAnimations[i]->mChannels[j]->mNumPositionKeys; ++k)
//          {
//            CObject::vkey_t key;
//            key.time = paiScene->mAnimations[i]->mChannels[j]->mPositionKeys[k].mTime;
//            key.value.x = paiScene->mAnimations[i]->mChannels[j]->mPositionKeys[k].mValue.x;
//            key.value.y = paiScene->mAnimations[i]->mChannels[j]->mPositionKeys[k].mValue.y;
//            key.value.z = paiScene->mAnimations[i]->mChannels[j]->mPositionKeys[k].mValue.z;
//            channnel.positions.push_back(key);
//          }
//          for(size_t k = 0; k < paiScene->mAnimations[i]->mChannels[j]->mNumRotationKeys; ++k)
//          {
//            CObject::qkey_t key;
//            key.time = paiScene->mAnimations[i]->mChannels[j]->mRotationKeys[k].mTime;
//            key.value.w = paiScene->mAnimations[i]->mChannels[j]->mRotationKeys[k].mValue.w;
//            key.value.x = paiScene->mAnimations[i]->mChannels[j]->mRotationKeys[k].mValue.x;
//            key.value.y = paiScene->mAnimations[i]->mChannels[j]->mRotationKeys[k].mValue.y;
//            key.value.z = paiScene->mAnimations[i]->mChannels[j]->mRotationKeys[k].mValue.z;
//            channnel.rotations.push_back(key);
//          }
//          channnel.name = std::string(paiScene->mAnimations[i]->mChannels[j]->mNodeName.data);
//          for(size_t k = 0; k < paiScene->mAnimations[i]->mChannels[j]->mNumPositionKeys; ++k)
//          {
//            CObject::vkey_t key;
//            key.time = paiScene->mAnimations[i]->mChannels[j]->mScalingKeys[k].mTime;
//            key.value.x = paiScene->mAnimations[i]->mChannels[j]->mScalingKeys[k].mValue.x;
//            key.value.y = paiScene->mAnimations[i]->mChannels[j]->mScalingKeys[k].mValue.y;
//            key.value.z = paiScene->mAnimations[i]->mChannels[j]->mScalingKeys[k].mValue.z;
//            channnel.scalings.push_back(key);
//          }
//          anim.channels.push_back(channnel);
//        }
//      }

      ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      if(hasOption(CObjectBuilder::NORMALIZED) && fMax > 0.0f)
      {
        sys::info << sys::tab << "Normalizing... fMax: " << fMax << sys::endl;
        for(size_t i = 0, l = positions.size(); i < l; i++)
        {
          positions[i].x /= fMax;
          positions[i].y /= fMax;
          positions[i].z /= fMax;
        }
      }

      ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      pObject->setDrawStrategy(mDrawStrategy == nullptr ? new CDrawStrategy : mDrawStrategy);

      // set opengl stuff ////////////////////////////////////////////////////////////////////////////////////////////

      pObject->mNumVertices = nVertexEnd;
      pObject->mNumIndices  = nIndicesEnd;

      sys::info << sys::tab << "mNumIndices:  " << pObject->mNumIndices << sys::endl;
      sys::info << sys::tab << "mNumVertices: " << pObject->mNumVertices << sys::endl;

      //pObject->mBuffers[INDEX_BUFFER_INDEX] = CBuffer(GL_ELEMENT_ARRAY_BUFFER, pObject->mNumIndices * sizeof(ushort), GL_STATIC_DRAW);

      glGenBuffers(1, &(pObject->mBuffers[INDEX_BUFFER_INDEX]));
      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pObject->mBuffers[INDEX_BUFFER_INDEX]);
      glBufferData(GL_ELEMENT_ARRAY_BUFFER, pObject->mNumIndices * sizeof(ushort), &indices[0], GL_STATIC_DRAW);

      glGenVertexArrays(1, &(pObject->mVAO));
      glBindVertexArray(pObject->mVAO);

      glGenBuffers(1, &(pObject->mBuffers[POSITION_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[POSITION_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::vec3), &positions[0], GL_STATIC_DRAW);

      glVertexAttribPointer(POSITION_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, sizeof(math::vec3), (GLvoid*)((0) * sizeof(GLfloat)));             // 0
      glEnableVertexAttribArray(POSITION_ATTRIBUTE); // positions

      glGenBuffers(1, &(pObject->mBuffers[TEXCOORD_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[TEXCOORD_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::vec2), &texcoords[0], GL_STATIC_DRAW);

      glVertexAttribPointer(TEXCOORD_ATTRIBUTE, 2, GL_FLOAT, GL_FALSE, sizeof(math::vec2), (GLvoid*)((0) * sizeof(GLfloat)));         // 1
      glEnableVertexAttribArray(TEXCOORD_ATTRIBUTE); // texcoords

      glGenBuffers(1, &(pObject->mBuffers[NORMAL_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[NORMAL_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::vec3), &normals[0], GL_STATIC_DRAW);

      glVertexAttribPointer(NORMAL_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, sizeof(math::vec3), (GLvoid*)((0) * sizeof(GLfloat)));       // 2
      glEnableVertexAttribArray(NORMAL_ATTRIBUTE);   // normals

      glGenBuffers(1, &(pObject->mBuffers[TANGENT_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[TANGENT_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::vec3), &tangents[0], GL_STATIC_DRAW);

      glVertexAttribPointer(TANGENT_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, sizeof(math::vec3), (GLvoid*)((0) * sizeof(GLfloat)));  // 3
      glEnableVertexAttribArray(TANGENT_ATTRIBUTE);  // tangents

      glGenBuffers(1, &(pObject->mBuffers[BONE_ID_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[BONE_ID_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::ivec4), &boneids[0], GL_STATIC_DRAW);

      glVertexAttribIPointer(BONE_ID_ATTRIBUTE, 4, GL_INT, sizeof(math::ivec4), (GLvoid*)((0) * sizeof(GLfloat)));
      glEnableVertexAttribArray(BONE_ID_ATTRIBUTE);  // bone ids

      glGenBuffers(1, &(pObject->mBuffers[BONE_WEIGHT_BUFFER_INDEX]));
      glBindBuffer(GL_ARRAY_BUFFER, pObject->mBuffers[BONE_WEIGHT_BUFFER_INDEX]);
      glBufferData(GL_ARRAY_BUFFER, pObject->mNumVertices * sizeof(math::vec3), &boneweights[0], GL_STATIC_DRAW);

      glVertexAttribPointer(BONE_WEIGHT_ATTRIBUTE, 4, GL_FLOAT, GL_FALSE, sizeof(math::vec4), (GLvoid*)((0) * sizeof(GLfloat)));
      glEnableVertexAttribArray(BONE_WEIGHT_ATTRIBUTE);  // bone weights

      glBindBuffer(GL_ARRAY_BUFFER, 0);
      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
      glBindVertexArray(0);

      glExitIfError();

      return pObject;
    }

    void setFile(const std::string& file)
    {
      mFile.clear();
      mFile.append(MODELPATH).append(file);
    }

    protected:
    void addBoneData(CVertex& vertex, uint id, float weight) // find free slopt in bone_t structure
    {
      for(uint i = 0; i < MAX_BONES_PER_VERTEX; ++i)
      {
        if(vertex.mBoneWeights[i] == 0.0)
        {
          vertex.mBoneIds[i]     = id;
          vertex.mBoneWeights[i] = weight;
          return;
        }
      }

      assert(0); // should never get here - more bones that there is space for
    }

//    void buildNodes(CObject::node_t* dst, aiNode* src)
//    {
//
//    }

    math::mat4 toMatrix(const aiMatrix4x4& m)
    {
      return math::mat4(
        math::vec4(m.a1, m.a2, m.a3, m.a4),
        math::vec4(m.b1, m.b2, m.b3, m.b4),
        math::vec4(m.c1, m.c2, m.c3, m.c4),
        math::vec4(m.d1, m.d2, m.d3, m.d4)
      );
    }
  };
}

#endif // __cassimpobjectbuilder_hpp__


text:
namespace omaha {

ShutdownEvents::ShutdownEvents(BundleInstaller* installer)
    : installer_(installer) {
  ASSERT1(installer);
}

ShutdownEvents::~ShutdownEvents() {
  CORE_LOG(L2, (_T("[ShutdownEvents::~ShutdownEvents]")));
  __mutexScope(lock_);

  CORE_LOG(L2, (_T("[Destroying shutdown handler]")));
  shutdown_handler_.reset();
  reactor_.reset();
}

HRESULT ShutdownEvents::InitializeShutdownHandler(bool is_machine) {
  CORE_LOG(L3, (_T("[InitializeShutdownHandler]")));

  reactor_.reset(new Reactor);
  shutdown_handler_.reset(new ShutdownHandler);
  return shutdown_handler_->Initialize(reactor_.get(), this, is_machine);
}

// Shutdown() is called from a thread in the OS threadpool. The PostMessage
// marshals the call over to the UI thread, which is where DoClose needs to be
// (and is) called from.
HRESULT ShutdownEvents::Shutdown() {
  CORE_LOG(L2, (_T("[Shutdown]")));

  __mutexScope(lock_);

  CORE_LOG(L2, (_T("[Shutdown][IsWindow: %d]"), installer_->IsWindow()));
  if (installer_->IsWindow()) {
    installer_->PostMessage(WM_CLOSE, 0, 0);
  }

  return S_OK;
}

HRESULT ShutdownEvents::CreateShutdownHandler(
    bool is_machine,
    BundleInstaller* installer,
    std::unique_ptr<ShutdownCallback>* shutdown_callback) {
  ASSERT1(installer);
  ASSERT1(shutdown_callback);

  auto shutdown_events = std::make_unique<ShutdownEvents>(installer);
  HRESULT hr = shutdown_events->InitializeShutdownHandler(is_machine);
  if (FAILED(hr)) {
    CORE_LOG(LE, (_T("[InitializeShutDownHandler failed][0x%08x]"), hr));
    return hr;
  }

  shutdown_callback->reset(shutdown_events.release());
  return S_OK;
}

}  // namespace omaha


text:
layout: kanji
v4: 31
v6: 31
kanji: 胆
keyword: gall bladder
elements: gallbladder, moon, month, flesh, part of the body, nightbreak, sun, day, one, floor
strokes: 9
image: E88386
on-yomi: タン
kun-yomi: きも
permalink: /rtk/胆/
prev: 旦
next: 亘
---

1) [smiro] 11-11-2007(279): The moon has a lot of gall sticking around after sunrise.

2) [arturo] 20-7-2007(124): All the month long I have to start working at nightbreak. This really activates my gall bladder (=I get angry).

3) [randomassortmentofletters] 31-5-2009(88): For a month( 月 ), I was up until nightbreak( 旦 ) because of my gall bladder( 胆 ).

4) [yaban] 15-1-2007(49): The gall bladder digests the flesh (meat) before nightbreak so you are ready to start your new day.

5) [LeoOra] 14-1-2008(26): If you drink all night long (moon), until the night break your gall bladder will have problems...


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/**
 * A base class for the WrappedException that can be used to identify
 * a WrappedException from ExceptionHandler without adding circular
 * dependency.
 */
var BaseWrappedException = (function (_super) {
    __extends(BaseWrappedException, _super);
    function BaseWrappedException(message) {
        _super.call(this, message);
    }
    Object.defineProperty(BaseWrappedException.prototype, "wrapperMessage", {
        get: function () { return ''; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseWrappedException.prototype, "wrapperStack", {
        get: function () { return null; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseWrappedException.prototype, "originalException", {
        get: function () { return null; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseWrappedException.prototype, "originalStack", {
        get: function () { return null; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseWrappedException.prototype, "context", {
        get: function () { return null; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseWrappedException.prototype, "message", {
        get: function () { return ''; },
        enumerable: true,
        configurable: true
    });
    return BaseWrappedException;
}(Error));
exports.BaseWrappedException = BaseWrappedException;
//# sourceMappingURL=base_wrapped_exception.js.map


text:
package org.springframework.security.config.annotation.method.configuration;

import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

/**
 * @author Rob Winch
 * @since 5.0
 */
@Component
public class Authz {

	public boolean check(boolean result) {
		return result;
	}

	public boolean check(long id) {
		return id % 2 == 0;
	}

	public boolean check(Authentication authentication, String message) {
		return message != null &&
				message.contains(authentication.getName());
	}
}


text:
package com.konexios.api.models;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.Objects;

/**
 * Model which is representing node
 */

public final class NodeModel implements Parcelable {
    @SuppressWarnings("unused")
    public static final Parcelable.Creator<NodeModel> CREATOR = new Parcelable.Creator<NodeModel>() {
        @NonNull
        @Override
        public NodeModel createFromParcel(@NonNull Parcel in) {
            return new NodeModel(in);
        }

        @NonNull
        @Override
        public NodeModel[] newArray(int size) {
            return new NodeModel[size];
        }
    };
    @SerializedName("createdBy")
    @Expose
    private String createdBy;
    @SerializedName("createdString")
    @Expose
    private String createdString;
    @SerializedName("description")
    @Expose
    private String description;
    @SerializedName("enabled")
    @Expose
    private boolean enabled;
    /**
     * node hid
     */
    @SerializedName("hid")
    @Expose
    private String hid;
    @SerializedName("lastModifiedBy")
    @Expose
    private String lastModifiedBy;
    @SerializedName("lastModifiedString")
    @Expose
    private String lastModifiedString;
    @SerializedName("links")
    @Expose
    private JsonElement links;
    @SerializedName("name")
    @Expose
    private String name;
    @SerializedName("nodeTypeHid")
    @Expose
    private String nodeTypeHid;
    @SerializedName("parentNodeHid")
    @Expose
    private String parentNodeHid;
    @SerializedName("pri")
    @Expose
    private String pri;

    public NodeModel() {
    }

    protected NodeModel(@NonNull Parcel in) {
        createdBy = in.readString();
        createdString = in.readString();
        description = in.readString();
        enabled = in.readByte() != 0x00;
        hid = in.readString();
        lastModifiedBy = in.readString();
        lastModifiedString = in.readString();
        JsonParser parser = new JsonParser();
        links = parser.parse(in.readString()).getAsJsonObject();
        name = in.readString();
        nodeTypeHid = in.readString();
        parentNodeHid = in.readString();
        pri = in.readString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NodeModel nodeModel = (NodeModel) o;
        return enabled == nodeModel.enabled &&
                Objects.equals(createdBy, nodeModel.createdBy) &&
                Objects.equals(createdString, nodeModel.createdString) &&
                Objects.equals(description, nodeModel.description) &&
                Objects.equals(hid, nodeModel.hid) &&
                Objects.equals(lastModifiedBy, nodeModel.lastModifiedBy) &&
                Objects.equals(lastModifiedString, nodeModel.lastModifiedString) &&
                Objects.equals(links, nodeModel.links) &&
                Objects.equals(name, nodeModel.name) &&
                Objects.equals(nodeTypeHid, nodeModel.nodeTypeHid) &&
                Objects.equals(parentNodeHid, nodeModel.parentNodeHid) &&
                Objects.equals(pri, nodeModel.pri);
    }

    @Override
    public int hashCode() {
        return Objects.hash(createdBy, createdString, description, enabled, hid, lastModifiedBy, lastModifiedString, links, name, nodeTypeHid, parentNodeHid, pri);
    }

    /**
     * @return The createdBy
     */
    public String getCreatedBy() {
        return createdBy;
    }

    /**
     * @param createdBy The createdBy
     */
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    /**
     * @return The createdString
     */
    public String getCreatedString() {
        return createdString;
    }

    /**
     * @param String The String
     */
    public void setCreatedString(String String) {
        this.createdString = String;
    }

    /**
     * @return The description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description The description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return The enabled
     */
    public boolean isEnabled() {
        return enabled;
    }

    /**
     * @param enabled The enabled
     */
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    /**
     * @return The hid
     */
    public String getHid() {
        return hid;
    }

    /**
     * @param hid The hid
     */
    public void setHid(String hid) {
        this.hid = hid;
    }

    /**
     * @return The lastModifiedBy
     */
    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    /**
     * @param lastModifiedBy The lastModifiedBy
     */
    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    /**
     * @return The lastModifiedString
     */
    public String getLastModifiedString() {
        return lastModifiedString;
    }

    /**
     * @param lastModifiedString The lastModifiedString
     */
    public void setLastModifiedString(String lastModifiedString) {
        this.lastModifiedString = lastModifiedString;
    }

    /**
     * @return The links
     */
    public JsonElement getLinks() {
        if (links == null) {
            links = new JsonObject();
        }
        return links;
    }

    /**
     * @param links The links
     */
    public void setLinks(JsonElement links) {
        this.links = links;
    }

    /**
     * @return The name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name The name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return The nodeTypeHid
     */
    public String getNodeTypeHid() {
        return nodeTypeHid;
    }

    /**
     * @param nodeTypeHid The nodeTypeHid
     */
    public void setNodeTypeHid(String nodeTypeHid) {
        this.nodeTypeHid = nodeTypeHid;
    }

    /**
     * @return The parentNodeHid
     */
    public String getParentNodeHid() {
        return parentNodeHid;
    }

    /**
     * @param parentNodeHid The parentNodeHid
     */
    public void setParentNodeHid(String parentNodeHid) {
        this.parentNodeHid = parentNodeHid;
    }

    /**
     * @return The pri
     */
    public String getPri() {
        return pri;
    }

    /**
     * @param pri The pri
     */
    public void setPri(String pri) {
        this.pri = pri;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeString(createdBy);
        dest.writeString(createdString);
        dest.writeString(description);
        dest.writeByte((byte) (enabled ? 0x01 : 0x00));
        dest.writeString(hid);
        dest.writeString(lastModifiedBy);
        dest.writeString(lastModifiedString);
        Gson gson = new Gson();
        String str = gson.toJson(getLinks());
        dest.writeString(str);
        dest.writeString(name);
        dest.writeString(nodeTypeHid);
        dest.writeString(parentNodeHid);
        dest.writeString(pri);
    }
}


text:
<?php

declare(strict_types=1);

namespace spec\Sylius\Component\Taxonomy\Model;

use Doctrine\Common\Collections\Collection;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Taxonomy\Model\TaxonInterface;

final class TaxonSpec extends ObjectBehavior
{
    public function let()
    {
        $this->setCurrentLocale('en_US');
        $this->setFallbackLocale('en_US');
    }

    function it_implements_taxon_interface(): void
    {
        $this->shouldImplement(TaxonInterface::class);
    }

    function it_has_no_id_by_default(): void
    {
        $this->getId()->shouldReturn(null);
    }

    function its_code_is_mutable(): void
    {
        $this->setCode('TX2');
        $this->getCode()->shouldReturn('TX2');
    }

    function it_has_no_parent_by_default(): void
    {
        $this->getParent()->shouldReturn(null);
    }

    function its_parent_is_mutable(TaxonInterface $taxon): void
    {
        $this->setParent($taxon);
        $this->getParent()->shouldReturn($taxon);
    }

    function it_is_root_by_default(): void
    {
        $this->shouldBeRoot();
    }

    function it_is_not_root_when_has_parent(TaxonInterface $taxon): void
    {
        $this->setParent($taxon);
        $this->shouldNotBeRoot();
    }

    function it_is_root_when_has_no_parent(TaxonInterface $taxon): void
    {
        $this->shouldBeRoot();

        $this->setParent($taxon);
        $this->shouldNotBeRoot();
        $this->setParent(null);

        $this->shouldBeRoot();
    }

    function it_returns_a_list_of_ancestors(
        TaxonInterface $categoryTaxon,
        TaxonInterface $tshirtsTaxon
    ): void {
        $tshirtsTaxon->getParent()->willReturn($categoryTaxon);

        $tshirtsTaxon->addChild($this)->shouldBeCalled();
        $this->setParent($tshirtsTaxon);

        $this->getAncestors()->shouldIterateAs([$tshirtsTaxon->getWrappedObject(), $categoryTaxon->getWrappedObject()]);
    }

    function it_returns_a_list_with_single_ancestor(TaxonInterface $parentTaxon): void
    {
        $parentTaxon->getParent()->willReturn(null);
        $parentTaxon->addChild($this)->shouldBeCalled();
        $this->setParent($parentTaxon);

        $this->getAncestors()->shouldIterateAs([$parentTaxon->getWrappedObject()]);
    }

    function it_returns_an_empty_list_of_ancestors_if_called_on_root_taxon(): void
    {
        $this->getAncestors()->shouldIterateAs([]);
    }

    function it_is_unnamed_by_default(): void
    {
        $this->getName()->shouldReturn(null);
    }

    function its_name_is_mutable(): void
    {
        $this->setName('Brand');
        $this->getName()->shouldReturn('Brand');
    }

    function it_returns_name_when_converted_to_string(): void
    {
        $this->setName('T-Shirt material');
        $this->__toString()->shouldReturn('T-Shirt material');
    }

    function its_fullname_is_null_if_unnamed(): void
    {
        $this->getFullname()->shouldReturn(null);
    }

    function its_fullname_equal_name_if_no_parent(): void
    {
        $this->setName('Category');
        $this->getFullname()->shouldReturn('Category');
    }

    function its_fullname_prepends_with_parents_fullname(TaxonInterface $root): void
    {
        $root->getFullname()->willReturn('Category');
        $this->setName('T-shirts');

        $root->addChild($this)->shouldBeCalled();
        $this->setParent($root);

        $this->getFullname()->shouldReturn('Category / T-shirts');
        $this->getFullname(' -- ')->shouldReturn('Category -- T-shirts');
    }

    function it_has_no_description_by_default(): void
    {
        $this->getDescription()->shouldReturn(null);
    }

    function its_description_is_mutable(): void
    {
        $this->setDescription('This is a list of brands.');
        $this->getDescription()->shouldReturn('This is a list of brands.');
    }

    function it_has_no_slug_by_default(): void
    {
        $this->getSlug()->shouldReturn(null);
    }

    function its_slug_is_mutable(): void
    {
        $this->setSlug('t-shirts');
        $this->getSlug()->shouldReturn('t-shirts');
    }

    function it_initializes_child_taxon_collection_by_default(): void
    {
        $this->getChildren()->shouldHaveType(Collection::class);
    }

    function it_allows_to_check_if_given_taxon_is_its_child(TaxonInterface $taxon): void
    {
        $this->hasChild($taxon)->shouldReturn(false);
    }

    function it_allows_to_add_child_taxons(TaxonInterface $taxon): void
    {
        $taxon->getParent()->willReturn(null);
        $taxon->setParent($this)->shouldBeCalled();

        $this->addChild($taxon);
    }

    function it_allows_to_remove_child_taxons(TaxonInterface $taxon): void
    {
        $taxon->getParent()->willReturn(null);
        $taxon->setParent($this)->shouldBeCalled();

        $this->addChild($taxon);

        $taxon->setParent(null)->shouldBeCalled();

        $this->removeChild($taxon);
    }

    function it_has_position(): void
    {
        $this->setPosition(0);
        $this->getPosition()->shouldReturn(0);
    }

    function it_has_not_children_by_default(): void
    {
        $this->hasChildren()->shouldReturn(false);
    }

    function it_has_children_when_you_have_added_child(TaxonInterface $taxon): void
    {
        $this->addChild($taxon);

        $this->hasChildren()->shouldReturn(true);
    }

    function it_returns_enabled_children(
        TaxonInterface $enabledChildTaxon,
        TaxonInterface $disabledChildTaxon
    ): void {
        $enabledChildTaxon->isEnabled()->willReturn(true);
        $enabledChildTaxon->getParent()->willReturn(null);
        $enabledChildTaxon->setParent($this)->shouldBeCalled();
        $this->addChild($enabledChildTaxon);

        $disabledChildTaxon->isEnabled()->willReturn(false);
        $disabledChildTaxon->getParent()->willReturn(null);
        $disabledChildTaxon->setParent($this)->shouldBeCalled();
        $this->addChild($disabledChildTaxon);

        $this->getEnabledChildren()->shouldIterateAs([$enabledChildTaxon->getWrappedObject()]);
    }
}


text:
'use strict'

var yeoman = require('yeoman-generator')
var humps = require('humps')
var config = require('../../config')

module.exports = yeoman.Base.extend({
  prompting: function () {
    var done = this.async()

    var prompts = [{
      type: 'input',
      name: 'moduleName',
      message: 'Module name:',
      store: true
    }, {
      type: 'input',
      name: 'filterName',
      message: 'Filter name:',
      store: true
    }]

    this.prompt(prompts, function (props) {
      this.props = props
      done()
    }.bind(this))
  },

  writing: function () {
    var viewCtx = {}
    viewCtx.moduleName = this.props.moduleName
    viewCtx.moduleCamelName = humps.camelize(viewCtx.moduleName)
    viewCtx.moduleDashedName = humps.decamelize(viewCtx.moduleCamelName, { separator: '-' })
    viewCtx.filterName = this.props.filterName
    viewCtx.filterCamelName = humps.camelize(viewCtx.filterName)
    viewCtx.filterPascalName = humps.pascalize(viewCtx.filterName)
    viewCtx.filterDottedName = humps.decamelize(viewCtx.filterCamelName, { separator: '.' })
    viewCtx.filterDashedName = humps.decamelize(viewCtx.filterCamelName, { separator: '-' })

    this.fs.copyTpl(
      this.templatePath('filter.js.ejs'),
      this.destinationPath(
        `${config.appPath}/${viewCtx.moduleDashedName}/filters/${viewCtx.filterDashedName}.filter.js`
      ),
      viewCtx
    )

    this.fs.copyTpl(
      this.templatePath('filter.spec.js.ejs'),
      this.destinationPath(
        `${config.appPath}/${viewCtx.moduleDashedName}/filters/${viewCtx.filterDashedName}.filter.spec.js`
      ),
      viewCtx
    )
  }
})


text:
<?php

use Kanboard\Model\ProjectModel;
use Kanboard\Model\ProjectTaskPriorityModel;

require_once __DIR__.'/../Base.php';

class ProjectTaskPriorityModelTest extends Base
{
    public function testPriority()
    {
        $projectModel = new ProjectModel($this->container);
        $projectTaskPriorityModel = new ProjectTaskPriorityModel($this->container);

        $this->assertEquals(1, $projectModel->create(array('name' => 'My project 2')));
        $this->assertEquals(0, $projectTaskPriorityModel->getDefaultPriority(1));

        $project = $projectModel->getById(1);
        $this->assertNotEmpty($project);
        $this->assertEquals(0, $project['priority_default']);
        $this->assertEquals(0, $project['priority_start']);
        $this->assertEquals(3, $project['priority_end']);

        $this->assertEquals(
            array(0 => 0, 1 => 1, 2 => 2, 3 => 3),
            $projectTaskPriorityModel->getPriorities($project)
        );

        $this->assertTrue($projectModel->update(array('id' => 1, 'priority_start' => 2, 'priority_end' => 5, 'priority_default' => 4)));

        $project = $projectModel->getById(1);
        $this->assertNotEmpty($project);
        $this->assertEquals(4, $project['priority_default']);
        $this->assertEquals(2, $project['priority_start']);
        $this->assertEquals(5, $project['priority_end']);

        $this->assertEquals(
            array(2 => 2, 3 => 3, 4 => 4, 5 => 5),
            $projectTaskPriorityModel->getPriorities($project)
        );

        $this->assertEquals(4, $projectTaskPriorityModel->getDefaultPriority(1));
    }

    public function testGetPrioritySettings()
    {
        $projectModel = new ProjectModel($this->container);
        $projectTaskPriorityModel = new ProjectTaskPriorityModel($this->container);

        $this->assertEquals(1, $projectModel->create(array('name' => 'My project 2')));

        $expected = array(
            'priority_default' => 0,
            'priority_start' => 0,
            'priority_end' => 3,
        );

        $this->assertEquals($expected, $projectTaskPriorityModel->getPrioritySettings(1));
        $this->assertNull($projectTaskPriorityModel->getPrioritySettings(2));
    }

    public function testGetPriorityForProject()
    {
        $projectModel = new ProjectModel($this->container);
        $projectTaskPriorityModel = new ProjectTaskPriorityModel($this->container);

        $this->assertEquals(1, $projectModel->create(array(
            'name' => 'My project 1',
            'priority_default' => 2,
            'priority_start' => -2,
            'priority_end' => 8,
        )));

        $this->assertEquals(2, $projectTaskPriorityModel->getPriorityForProject(1, 42));
        $this->assertEquals(0, $projectTaskPriorityModel->getPriorityForProject(1, 0));
        $this->assertEquals(1, $projectTaskPriorityModel->getPriorityForProject(1, 1));
        $this->assertEquals(-2, $projectTaskPriorityModel->getPriorityForProject(1, -2));
        $this->assertEquals(-1, $projectTaskPriorityModel->getPriorityForProject(1, -1));
        $this->assertEquals(8, $projectTaskPriorityModel->getPriorityForProject(1, 8));
        $this->assertEquals(5, $projectTaskPriorityModel->getPriorityForProject(1, 5));
        $this->assertEquals(2, $projectTaskPriorityModel->getPriorityForProject(1, 9));
        $this->assertEquals(2, $projectTaskPriorityModel->getPriorityForProject(1, -3));
    }
}


text:
<?xml version="1.0"?>
<project name="Katu" basedir="./">

	<property file="build.properties"/>

	<target name="package" depends="clean" description="package .zip for Chrome Webstore">
        <zip destfile="${target_folder}/${zip_file_name}"
             basedir="${src_folder}"
                />
	</target>

	<target name="clean">
		<delete dir="${target_folder}" />
	</target>

</project>


text:
const Discord = require('discord.js');
const client = new Discord.Client
const fs = require('fs')
client.commands = new Discord.Collection()
let usageMb = process.memoryUsage().heapUsed / 1024 / 1024;
let usage = usageMb.toFixed(2);
const embedClass = require('../classes/embedMessage.js');

module.exports.run = async (client, message, args) => {
  let embedMessage = new embedClass(message);

  const moment = require('moment');
  const ms = require('ms');
  let DiscordMoji = client.guilds.get('361925830521257984').emojis.find('name', 'discord');
  let SocialMoji = client.guilds.get('361925830521257984').emojis.find('name', 'social');

  /**
   * @param {Object} author
   * @param {Array} {Object}
   * @param {String} color
   * @param {String} thumbnail
   * @param {String} footer
   * @return {Error}
   * @return {Promise}
   */
  embedMessage.advanced({
      author: {
          name: `Take a look at my info`,
          pic: client.user.displayAvatarURL
      },
      fields: [{
          title: `My Discord Info:`,
          content: `**Username:** ${client.user.username}\n\
**Descriminator:** ${client.user.tag}\n\
**ID:** ${client.user.id}`
      },
          {
              title: `Process:`,
              content: `**Online since:** ${ms(client.uptime, {long: true})}\n\
**Memory Usage:** ${usage} MB\n\
**Operation System:** Windows 8.1 Pro`,
              inline: true
          },
          {
              title: `Social`,
              content: `**Total Guilds:** ${client.guilds.size}\n\
**Total Users:** ${client.users.filter(i => !i.bot).size}\n\
**Total Bots:** ${client.users.filter(i => i.bot).size}`,
              inline: true
          }
      ],
      color: 0x17B8B3,
      thumbnail: client.user.displayAvatarURL,
      footer: `Requested by ${message.author.username} | ${moment(new Date).format('DD/MM/YYYY [at] hh:mm:ss a')}`
  });
};

module.exports.help = {
    name: "botinfo"
}


text: Simple header only benchmark helpers


text:
package com.ul.core.utils;

/**
 * String 字符串工具类
 */
public class Strings {

    public static String valueOf(Object obj){
        return obj==null?null:obj.toString();
    }

    public static String valueOfStr(Object obj){
        return obj==null?"":obj.toString();
    }

    public static boolean isEmpty(Object v){
        return v==null||"".equals(v instanceof String ?v.toString().trim():v);
    }

    public static boolean isEmpty(Object...obj){
        for (Object v:obj){
            if(v==null||"".equals(v))
            return true;
        }
        return false;
    }

}


text:
package fi.solita.jsonmigraine.internal;

import fi.solita.jsonmigraine.api.Upgrader;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ObjectNode;

public interface UpgraderInvoker {

    JsonNode upgrade(JsonNode data, int dataVersion, Upgrader upgrader);

    ObjectNode upgradeField(ObjectNode container, String fieldName, int dataVersion, Upgrader upgrader);

    ObjectNode upgradeArrayField(ObjectNode container, String fieldName, int dataVersion, Upgrader upgrader);
}


text:
<?php

App::uses('FiscalPrinterHelper', 'Printers.Lib/DriverView/Helper');

class Hasar441FiscalHelper extends FiscalPrinterHelper
{

	/**
	*
	* Mapea el ID del ristornatino con el de la Hasar 441
	**/
  	public $arrayMapTipoTicket = array(
			RISTO_TIPO_FACTURA_A_ID => 'A',
			RISTO_TIPO_FACTURA_B_ID => 'B',
			RISTO_TIPO_FACTURA_C_ID => 'B',
  		);

  	/**
	*
	* Mapea el ID del ristornatino con el de la Hasar 441
	**/
  	public $arrayMapNCTipoTicket = array(
			RISTO_TIPO_FACTURA_A_ID => 'R',
			RISTO_TIPO_FACTURA_B_ID => 'S',
			RISTO_TIPO_FACTURA_C_ID => 'S',
  		);

	/**
	 * Me abre un documento fiscal
	 *
	 * @param $tipo_ticket el topo de ticket que quiero abrir
	 * las psobilidades son:
	 * 			"T": abre un ticket
	 * 			"A": abre ticket factura 'A'
	 * 			"B": abre ticket factura 'B' o 'C'
     *			"a": abre recibo 'A'
     *			"b": abre recibo 'B'
     *			"D": Nota de Débito 'A'
     *			"E": Nota de Débito B/C
     *
	 */
	public function openFiscalReceipt( $tipo_ticket ){
		$tipo_ticket = $this->arrayMapTipoTicket[$tipo_ticket];

		return "@".$this->cm('FS').$tipo_ticket.$this->cm('FS')."T";
	}

	/**
	 * Imprime texto fiscal que se muestra por lo general antes de los articulos.
	 * No puede contener la palabra TOTAL, porque se puede bloquear la impresora
	 */
	public function printFiscalText($texto, $doble_ancho = false ,$display = 0){
		$texto = substr($texto,0,30);
		if($doble_ancho){
			$texto = $this->cm('DOBLE_ANCHO').$texto;
		}
		return "A".$this->cm('FS').$texto.$this->cm('FS').$display;
	}

	/**
	 *  Imprime un articulo, o sea una linea del articulo con su description y su precio, cantidad, etc
	 *
	 *  @param string $descripcion_articulo descripcion del articulo EJ: Coca-Cola hasta 23 caracteres
	 *  @param number $cantidad puede ser un entero o un float depende de la impresora
	 *  @param number $monto float o integer depende de laimpresora
	 *  @param number $porcentaje_iva depende de la impresora algunas hay queponerle el porcentaje estilo 21.00, y otras va un 0.21
	 *  @param boolean $suma dice si el item suma o resta
	 *	@param number $impuesto_interno puede ser float o integer dependiendo laimpresora
	 *	@param number $display si la impresora tiene display aca va un digito especial para que sepa que mostrar en el display
	 *	@param boolean $precio_totalsi es precio tital quiere decir que el precio que le pasé como parametro tiene el IVA incluido, caso contrario, el precio es sin IVA y la impresora se lo va a sumar automaticamente de acuerdo al IVA qe se le pasó cmo parametro
	 */
	public function printLineItem($descripcion_articulo, $cantidad, $monto, $porcentaje_iva = null, $suma = true, $impuesto_interno = 0, $display = 0, $precio_total = true){
		$defaultPorcentajeIva = Configure::read('Afip.default_iva_porcentaje');
		if ( empty($porcentaje_iva) && $defaultPorcentajeIva ){
			$porcentaje_iva = $defaultPorcentajeIva;
		}
		$fs = $this->cm('FS');
		$descripcion_articulo = substr($descripcion_articulo,0,23);

		if(!is_numeric($cantidad)) return false;
		if(!is_numeric($monto)) return false;
		$suma_monto = $suma?'M':'m';
		$precio_total = $precio_total?'T':'B';

		$comando = "B".$fs.$descripcion_articulo.$fs.$cantidad.$fs.$monto.$fs.$porcentaje_iva.$fs.$suma_monto.$fs.$impuesto_interno.$fs.$display.$fs.$precio_total;
		return $comando;
	}

	/**
	 * TotalPago
	 *
	 * @param string $texto Ejemplo: "Pago en efectivo"
	 * @param number $monto_pagado integer o float dependiendo de la impresora
	 * @param $operacion las piopsibilidades son:
	 *          'C': Cancela el ticket
	 *          'T': pago parcial o total
	 *          'R': devolucion de pago
	 * @param $display	 para las impresoras que tengan display
	 */
	public function totalTender($texto, $monto_pagado, $operacion = "T", $display = 0){
		$texto = substr($texto,0,28);

		$operacion = strtoupper($operacion);
		if( is_numeric($monto_pagado) &&
			($operacion == 'C' || $operacion == 'T' || $operacion == 'R'))
		{
			$comando = "D".$this->cm('FS').$texto.$this->cm('FS').$monto_pagado.$this->cm('FS').$operacion.$this->cm('FS').$display;
		}
		else{
			$comando = false;
		}

		return $comando;
	}

        /**
         * Responde:
         *            a. Imprimiendo una línea donde se muestra: descripción del descuento (o recargo), impuestos y monto del
         *                descuento (o recargo) -con posterioridad a la impresión de la línea con la leyenda "Descuento (o Recargo)
         *                   general"-;
         *            b. Restando
         *
         * @param float $importe_descuento
         * @return string comando
         */
        public function generalDiscount($importe_descuento = 0){
            $comando =  "T".$this->cm('FS').
                        'Descuento'.$this->cm('FS').
                        $importe_descuento.$this->cm('FS').
                        'm'.$this->cm('FS').
                        '0'.$this->cm('FS').
                        'T';
            return $comando;
        }

	/**
	 * Cierra el comprobante
	 * @param integer $cant_copias 	pr ahora solo vi que funcione en la Hasar 441. Este parametro dice cuantas copias iprimir del comprobante
	 * 								pr default va cero porque solo funciona en 1 modelo y pr lo general esta funcion no es util
	 */
	public function closeFiscalReceipt($cant_copias = 0){
		$comando =  "E".$this->cm('FS').$cant_copias;
		return $comando;
	}

	/**
	 * Imprime el comprobante X/Z
	 *
	 * @param $tipo_cierre puede ser:
	 * 								'X': imprime un cierre X
	 * 								'Z': imprime un cierre Z
	 */
	public function dailyClose($tipo_cierre = 'X'){
		$tipo_cierre = strtoupper($tipo_cierre);

		return  "9\x1C".$tipo_cierre;
	}

	/**
	 * Consulta de estado
	 */
	public function statusRequest(){
		return "*";
	}

	/**
	 * Consulta de estado aunque se esta ejecutando un comando
	 * es especial para cuando quiero recuperar ael estado de error actual de la impresora PEJ: Falta papel
	 */
	public function statPRN(){
		return chr(161); // ¡ (puse el ASCII porque creo que es un signo de interrogacion, pero no estoy seguro porque se confunde con la i latina
	}

	/**
	 * Setea fecha y hora
	 */
	public function setDateTime($fecha = 'now', $hora = 'now'){
		$ymd = date("ymd",strtotime($fecha)) ;
		$his = date("His",strtotime($hora)) ;
		return "X".$this->cm('FS').$ymd.$this->cm('FS').$his;
	}

	/**
	 * Setea el encabezado y el pie de pagina
	 *
	 * @param integer $numero_de_linea
	 * 		ENCABEZADO: linea 1  - 10
	 * 		COLA: 		linea 11 - 20
	 * 		BORRA ENCABEZADO Y COLA: linea =  0
	 * 		BORRA ENCABEZADO: numero linea = -1
	 * 		BORRA COLA: 	  numero linea = -2
         *
	 * @param $texto 45 caracteres maximo
	 */
	public function setHeaderTrailer($numero_de_linea,$texto = "-",$doble_ancho = false){
		$texto = substr($texto,0,45);
		if ($numero_de_linea > -3 && $numero_de_linea <= 0){
			$comando = "]".$this->cm('FS').$numero_de_linea;
		}
		if ($numero_de_linea > 0 && $numero_de_linea < 21){
			if($doble_ancho){
				$texto = $this->cm('DOBLE_ANCHO').$texto;
			}
			$comando = "]".$this->cm('FS').$numero_de_linea.$this->cm('FS').$texto;
		}
		else{
			$comando = false;
		}
		return $comando;
	}

	/**
	 * Elimina dememoria el encabezado y el pie de pagina
	 * @return string $comando
	 */
	public function delHeaderTrailer(){
		$comando = "]".$this->cm('FS')."0".$this->cm('FS').$this->cm('DEL');
		return $comando;
	}

	/**
	 * Elimina dememoria el encabezado
	 * @return string $comando
	 */
	public function delHeader(){
		$comando = "]".$this->cm('FS')."-1".$this->cm('FS').$this->cm('DEL');
		return $comando;
	}

	/**
	 * Elimina dememoria el pie de pagina
	 * @return string $comando
	 */
	public function delTrailer(){
		$comando = "]".$this->cm('FS')."-2/".$this->cm('FS').$this->cm('DEL');
		return $comando;
	}

	/**
	 * Setea el encabezado
	 *
	 * @param integer $linea de 0 a 9
	 * @param string $texto 45 caracteres maximo
	 */
	public function setHeader($linea ,$texto,$doble_ancho = false){
		//COLA: 		linea 11 - 20
		$texto = substr($texto,0,45);
		if ($linea > -1 && $linea < 10){
			$numero_de_linea = 1+$linea;
			if($doble_ancho){
				$texto = $this->cm('DOBLE_ANCHO').$texto;
			}
			$comando = "]".$this->cm('FS').$numero_de_linea.$this->cm('FS').$texto;
		}
		else{
			$comando = false;
		}
		return $comando;
	}

	/**
	 * Setea el pie de pagina
	 *
	 * @param integer $linea de 0 a 9
	 * @param string $texto 45 caracteres maximo
	 */
	public function setTrailer($linea ,$texto,$doble_ancho = false){
		//COLA: 		linea 11 - 20
		$texto = substr($texto,0,45);
                $comando = '';
		if ($linea > -1 && $linea < 10){
			if($doble_ancho){
				$texto = $this->cm('DOBLE_ANCHO').$texto;
			}
			$numero_de_linea = 11+$linea;
			$comando = "]" . $this->cm('FS') . $numero_de_linea . $this->cm('FS') . $texto;
		}
		return $comando;
	}

	/**
	 * Setea los datos del Cliente, por lo general se usa para hacer factura A
	 *
	 * @param string $nombre_cliente nombre o razon social
	 * @param integer $documento valor del DNI, CIUT, CUIL, etc
	 * @param CHAR $respo_iva
	 * 					'I' responsable inscripto
	 * 					'E' Excento
	 * 					'A' No responsable
	 * 					'C' Consumidor final
	 * 					'T' No categorizado
	 * @param CHAR $tipo_documento
	 * 					'C' CUIT
	 * 					'L' CUIL
	 * 					'0' Lbreta enrolamiento
	 * 					'1' Libreta civica
	 * 					'2' DNI
	 * 					'3' Pasaporte
	 * 					'4' Cedula de Identidad
     *					' ' Sin clasificar (espacio en blanco)
	 * @param string $domicilio
     *
     * @todo Hacer que los tipos de responsabilidad IVA y los tipos de documentos sean arrays pasados como parametros
     *       Con eso podremos utilizar una funcion mas simple y mas extensible como is_in_array(tipos_docs, "C")
	 */
	public function setCustomerData($nombre_cliente = "",$documento = "",$respo_iva = 'C', $tipo_documento = " ", $domicilio = '-'){
		$nombre_cliente = trim(substr($nombre_cliente,0,45));
		$respo_iva = strtoupper($respo_iva);
		$tipo_documento = strtoupper($tipo_documento);
		if ( $tipo_documento === "") {
			$tipo_documento = " ";
		}

		if ( empty($documento) ){
			$documento = "";
		}

		if (empty($tipo_documento)) {
			$tipo_documento = ' ';
		}
		if (empty($domicilio)){
			$domicilio = '-';
		}
		if (empty($respo_iva)) {
			$respo_iva = "C";
		}
		$comando = "b".$this->cm('FS').$nombre_cliente.$this->cm('FS').$documento.$this->cm('FS').$respo_iva.$this->cm('FS').$tipo_documento.$this->cm('FS').$domicilio;

		return $comando;
	}

        /**
         * Longitud
         *   ô (93H - ASCII 147)
         *   FS
         *   No de línea de comprobante original (1-2)
         *   0: borra ambas líneas (sólo modelos SMH/P-PR5F -versión 2.01-, SMH/P-715F
         *   -versiones 3.02 y posteriores-, y SMH/P-441F)
         *   FS
         *   Texto de hasta 20 caracteres
		 *
         *   Ejemplo: ô∟1∟00000118
		 *
         */
        public function setEmbarkNumber($numeroTicket, $nlinea = 1){
            return chr(147).$this->cm('FS') . $nlinea . $this->cm('FS') . trim($numeroTicket);
        }

        /**
         * Tipo de documento
         *   R: Nota de crédito 'A'
         *   S: Nota de crédito 'B/C'
         *   x: Tique recibo 'X'
         *   <: Tique pagaré
         *   ,: Tique presupuesto
         *   -: Comp. de entrega
         *   .: Talón Estacionamiento
         *   /: Cobro de Servicios
         *   0: Ingreso de Dinero
         *   1: Retiro de Dinero
         *   2: Talón de Cambio
         *   3: Talón de reparto
         *   4: Talón de regalo
         *   5: Cuenta Corriente
         *   6: Avisode Operación de Crédito
         *   7: Cupón de Promoción
         *   8: Uso Interno Farmacia
		 *
         *   Ejemplo: Ç∟R∟T∟1211241
		 *
         */
        public function openDNFH($tipoDocumento, $identificacion = 0){
            $comando = chr(128). $this->cm('FS') .$tipoDocumento  . $this->cm('FS') ."T";
            if (!empty ($identificacion)){
                $comando .= $this->cm('FS') .$identificacion;
            }
            return  $comando;
        }

        /**
         *
         *  ASCII 129   ü
		 *
         * Ejemplo: ü∟3
		 *
         */
        public function closeDNFH($numCopias = 0){
            return chr(129) . $this->cm('FS') . $numCopias;
        }

}


text:
require 'httparty'
require 'budurl/url'
require 'budurl/client'
require 'budurl/version'

module Budurl
  # default BudURL.Pro API url
  BUDURL_PRO_BASE_URI = 'http://BudURL.Pro/api/v2'
end


text:
package org.apache.camel.component.netty4.http;

import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;

public class NettyHttpTransferExceptionTest extends BaseNettyTest {

    @Test
    public void testHttpTransferException() throws Exception {
        getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");

        try {
            template.requestBody("netty4-http:http://localhost:{{port}}/foo?transferException=true", "Hello World", String.class);
            fail("Should have failed");
        } catch (CamelExecutionException e) {
            IllegalArgumentException cause = assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
            assertEquals("Camel cannot do this", cause.getMessage());
        }

        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("netty4-http:http://0.0.0.0:{{port}}/foo?transferException=true")
                    .to("mock:input")
                    .throwException(new IllegalArgumentException("Camel cannot do this"));
            }
        };
    }

}


text:
<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Security;

/**
 * Class AuthenticationController
 *
 * @author Raphael De Freitas <raphael@de-freitas.net>
 */
class AuthenticationController extends Controller
{
    /**
     * @Template
     */
    public function loginAction(Request $request)
    {
        /*   if ($this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED'))
            return $this->redirect($this->generateUrl('app_default_index'));*/

        $session = $request->getSession();
        if ($request->attributes->has(Security::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(Security::AUTHENTICATION_ERROR);
        } else {
            $error = $session->get(Security::AUTHENTICATION_ERROR);
            $session->remove(Security::AUTHENTICATION_ERROR);
        }

        return [
            'last_username' => $this->getUser() ? $this->getUser()->getUsername() : $session->get(Security::LAST_USERNAME),
            'error' => $error
        ];
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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.

-->
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
              xmlns:mafp="http://myfaces.apache.org/maven-trinidad-plugin"
              xmlns:xi="http://www.w3.org/2001/XInclude">
  <component>
    <facet>
      <description><![CDATA[the component used to render the table footer.]]></description>
      <facet-name>footer</facet-name>
      <facet-extension>
        <mfp:long-description>This component will be used to render the table footer.
               This must be specified if the "footer" facet on each
               <tr:column> is to be rendered.
        </mfp:long-description>
      </facet-extension>
    </facet>
    <facet>
      <description><![CDATA[the component used to render the table header.]]></description>
      <facet-name>header</facet-name>
      <facet-extension>
        <mfp:long-description>This component will be used to render the table header.</mfp:long-description>
      </facet-extension>
    </facet>
    <facet>
      <description><![CDATA[content to be rendered inline with the navigation bar.]]>
      </description>
      <facet-name>actions</facet-name>
      <facet-extension>
        <mfp:facet-metadata>
          <mfp:preferred>true</mfp:preferred>
        </mfp:facet-metadata>
      </facet-extension>
    </facet>
    <property>
      <description>if the horizontal grid lines will be drawn.</description>
      <property-name>horizontalGridVisible</property-name>
      <property-class>boolean</property-class>
      <default-value>true</default-value>
      <property-extension>
        <mfp:required>false</mfp:required>
      </property-extension>
    </property>
    <property>
      <description>if the vertical grid lines will be drawn.</description>
      <property-name>verticalGridVisible</property-name>
      <property-class>boolean</property-class>
      <default-value>true</default-value>
      <property-extension>
        <mfp:required>false</mfp:required>
      </property-extension>
    </property>
    <property>
      <description>text displayed when a table is empty.</description>
      <property-name>emptyText</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:required>false</mfp:required>
        <mfp:property-metadata>
          <mfp:translatable>true</mfp:translatable>
        </mfp:property-metadata>
      </property-extension>
    </property>
    <property>
      <description>the interval between which the column banding alternates.  For example, a columnBandingInterval of 1 would display alternately banded columns.
      </description>
      <property-name>columnBandingInterval</property-name>
      <property-class>int</property-class>
      <default-value>0</default-value>
      <property-extension>
        <mfp:required>false</mfp:required>
      </property-extension>
    </property>
    <property>
      <description>the interval between which the row banding alternates.  For example, rowBandingInterval=1 would displayalternately banded rows in the Grid.
      </description>
      <property-name>rowBandingInterval</property-name>
      <property-class>int</property-class>
      <default-value>0</default-value>
      <property-extension>
        <mfp:required>false</mfp:required>
      </property-extension>
    </property>
    <property>
      <description>whether rows in this table selectable. Valid values are "none", "single", "multiple"</description>
      <property-name>rowSelection</property-name>
      <property-class>java.lang.String</property-class>
      <default-value>none</default-value>
      <property-extension>
        <mfp:required>false</mfp:required>
        <mfp:property-values>none single multiple</mfp:property-values>
      </property-extension>
    </property>
    <property>
      <description><![CDATA[If set to TRUE on a form element, the component will automatically submit
     the enclosing form when an appropriate action takes place (a click, text
     change, etc.).  This only takes effect if rowSelection attribute enabled.]]>
      </description>
      <property-name>autoSubmit</property-name>
      <property-class>boolean</property-class>
      <default-value>false</default-value>
    </property>
    <property>
      <description><![CDATA[the width of the table.  The value must either be a number of pixels or a percentage - it is not a CSS width.]]></description>
      <property-name>width</property-name>
      <property-class>java.lang.String</property-class>
    </property>
    <property>
      <description><![CDATA[the summary of this table's purpose and structure
         for user agents rendering to non-visual media.]]>
      </description>
      <property-name>summary</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:property-metadata>
          <mfp:preferred>true</mfp:preferred>
          <mfp:translatable>true</mfp:translatable>
        </mfp:property-metadata>
      </property-extension>
    </property>

  </component>
</faces-config>


text:
package org.quickbundle.project.mail.impl;

import org.quickbundle.project.mail.IRmMailService;
import org.quickbundle.tools.helper.RmDateHelper;
import org.quickbundle.tools.support.mail.RmMailHandler;

public class RmMailService implements IRmMailService {
	private String mailSmtpHost;
	private String sendMailUser;
	private String sendMailPassword;
	private String mailFrom;
	//是否使用ssl add by longsebo 2015-04-21
	private String ssl;
	//增加smtp端口属性 add by longsebo 2015-04-21
	private String port;

	public String getSsl() {
		return ssl;
	}
	public void setSsl(String ssl) {
		this.ssl = ssl;
	}
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
	public String getMailSmtpHost() {
		return mailSmtpHost;
	}
	public void setMailSmtpHost(String mailSmtpHost) {
		this.mailSmtpHost = mailSmtpHost;
	}
	public String getSendMailUser() {
		return sendMailUser;
	}
	public void setSendMailUser(String sendMailUser) {
		this.sendMailUser = sendMailUser;
	}
	public String getSendMailPassword() {
		return sendMailPassword;
	}
	public void setSendMailPassword(String sendMailPassword) {
		this.sendMailPassword = sendMailPassword;
	}
	public String getMailFrom() {
		return mailFrom;
	}
	public void setMailFrom(String mailFrom) {
		this.mailFrom = mailFrom;
	}

	/**
	 * @param mailto 收件人
	 * @param subject 标题
	 * @param bodyText 正文文本, 可以为NULL
	 * @param bodyHtml 正文html, 可以为NULL
	 * @param aAffix 附件数组{{"显示名", "附件"}, {"a", "/a.jpg"}}
	 */
	public void send(String mailto, String subject, String bodyText, String bodyHtml, String[][] aAffix) {
		RmMailHandler mh = new RmMailHandler(new String[]{mailSmtpHost, sendMailUser, sendMailPassword, mailFrom,port,ssl});
		mh.send(mailto, subject, bodyText, bodyHtml, aAffix);
	}

	public static void main0(String[] args) {
		RmMailHandler mh = new RmMailHandler(new String[]{"mail.163.com","qb_test","quickbundle","qb_test@163.com"});
		mh.send("test@quickbundle.org", RmDateHelper.getSysDateTime(), "rt", null, null);
	}
}


text:
var cgmAuthModule = require('./cgm_auth'),
  cgmAuth = cgmAuthModule.cgmAuth;

$(function () {
  $('#formLogin').on('submit', function (e) {
    e.preventDefault();
    var loginString = "=user=" + $('#user').val() + ",password=" + $('#pass').val();

    cgmAuth.login(loginString).then(
      function () {
        window.location.href = '/';
      },
      function () {
        $('#formLogin').find('.form-group.error-msg').removeClass('invisible');
      }
    );
  });
});


text:
typedef NS_ENUM( NSUInteger, SSDataSourcesExample ) {
    SSDataSourcesExampleTable,
    SSDataSourcesExampleSectionedTable,
    SSDataSourcesExampleCollectionView,
    SSDataSourcesExampleExpandingTable,
};

@interface SSRootViewController ()

@property (nonatomic, strong) SSArrayDataSource *dataSource;

@end

@implementation SSRootViewController

- (instancetype)init {
    if ((self = [super initWithStyle:UITableViewStyleGrouped])) {
        self.title = NSLocalizedString(@"SSDataSources", nil);

        _dataSource = [[SSArrayDataSource alloc] initWithItems:@[
                                                     @(SSDataSourcesExampleTable),
                                                     @(SSDataSourcesExampleSectionedTable),
                                                     @(SSDataSourcesExampleCollectionView),
                                                     @(SSDataSourcesExampleExpandingTable),
                                                 ]];

        self.dataSource.cellConfigureBlock = ^(SSBaseTableCell *cell,
                                               NSNumber *exampleType,
                                               UITableView *tableView,
                                               NSIndexPath *indexPath) {
            NSString *title;

            switch( [exampleType unsignedIntegerValue] ) {
                case SSDataSourcesExampleTable:
                    title =  NSLocalizedString(@"Table View", nil);
                    break;
                case SSDataSourcesExampleCollectionView:
                    title = NSLocalizedString(@"Collection View", nil);
                    break;
                case SSDataSourcesExampleSectionedTable:
                    title = NSLocalizedString(@"Sectioned Table", nil);
                    break;
                case SSDataSourcesExampleExpandingTable:
                    title = NSLocalizedString(@"Expanding Table", nil);
                    break;
                default:
                    break;
            }

            cell.textLabel.text = title;
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        };

        self.dataSource.tableActionBlock = ^BOOL(SSCellActionType action,
                                                 UITableView *tableView,
                                                 NSIndexPath *indexPath) {
            // Disallow both moving and editing.
            // You could instead do something like disallow move but allow editing:
            // return action == SSCellActionTypeEdit;
            return NO;
        };
    }

    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.dataSource.tableView = self.tableView;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    UIViewController *viewController;
    SSDataSourcesExample example = [[self.dataSource itemAtIndexPath:indexPath] unsignedIntegerValue];

    switch (example) {
        case SSDataSourcesExampleTable:
            viewController = [SSTableViewController new];
            break;
        case SSDataSourcesExampleCollectionView:
            viewController = [SSCollectionViewController new];
            break;
        case SSDataSourcesExampleSectionedTable:
            viewController = [SSSectionedViewController new];
            break;
        case SSDataSourcesExampleExpandingTable:
            viewController = [SSExpandingViewController new];
            break;
        default:
            break;
    }

    if (viewController) {
        [self.navigationController pushViewController:viewController
                                             animated:YES];
    }
}

@end


text:
<!doctype html>

		<link rel="stylesheet" href="css/rickshaw.min.css">