text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
javafe.filespace (Javafe)
</TITLE>

<META NAME="date" CONTENT="2010-04-26">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../javafe.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

Javafe
© 2010 IT University of Copenhagen
© 2007,2008,2009,2010 Joseph Kiniry
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006,2007,2008,2009 University College Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package javafe.filespace

Interface Summary

Filter
A simple filter interface for use in filtering out values.

Class Summary

ClassPath
Functions for dealing with classpaths.

EmptyEnum
This class simply implements an enumeration with no elements.

Extension
This module contains functions for decomposing filenames (Strings)
 into a basename and an extension.

ExtTree
A ExtTree is a HashTree that starts out as just a root node, but may
 be extended at any time by (recursively) adding children.

FileTree
A FileTree is a Tree that mirrors the contents of a disk filesystem;
 the constructor takes in a directory and returns a tree representing
 the filesystem rooted at that directory.

FilterEnum
A FilterEnum filters an underlying Enumeration using a client
 supplied Filter.

HashTree
A HashTree is a Tree that uses a Hashtable to store the map between
 labels and its direct children.

LeafTree
A LeafTree is a degenerate form of Tree that never contains
 children.

LookAheadEnum
This layer describes how to implement an Enumeration in
 terms of a single function that returns the next element in a
 series, or null if the series is exhausted.

PathComponent
This module encapsulates how to convert from a Java path-component
 name to the hierarchical filespace it denotes.

PkgTree
A PkgTree is a filtered representation of a filespace Tree
 (cf PathComponent) where some files and directories that
 are clearly not part of the Java namespace have been filtered out;
 the remaining nodes can be divided into two categories: (a)
 (usually interior) nodes that correspond to potential Java
 packages, and (b) exterior nodes that correspond to files that
 reside in one of the potential Java packages and that have an
 extension (e.g., .java).

PkgTree_MatchesExtension
A filter for accepting only node's with a particular extension:

 This filter is for the use of the PkgTree class only; if inner
 classes were available, it would be expressed as an anonymous class.

PkgTree_PackagesOnly
A filter for accepting only packages:

 This filter is for the use of the PkgTree class only; if inner
 classes were available, it would be expressed as an anonymous class.

PreloadedTree
A PreloadedTree is a HashTree whose edges map is loaded exactly once
 before any children-fetching queries complete; the loading is lazy,
 however, and occurs when the first children-fetching method is
 called.

Query
This module defines a very simple query interface for use in
 locating Java files according to a classpath.

Resolve
This module encapsulates how to resolve an ambiguous multi-part
 identifier (i.e., X.Y.Z) into a package + (possibly a) reference
 type + a type field/member multi-part identifier, using the output
 of ClassPath.

Resolve_Result
The normal result type for Resolve.lookup:

SlowQuery
This module implements the Query "interface" by using the Java
 filespace classes (ClassPath, PathComponent, etc.) provided by the
 javafe.filespace package.

StringUtil
Misc. utility functions on Strings

Tree
A Tree is a n-ary tree with data at each node; the direct children of a
 node are unordered but distinguished via String labels on the edges
 to them.

TreeWalker
This class provides a way to enumerate all the nodes of a
 given Tree in depth-first pre-order using lexical ordering on
 siblings.

TreeWalker_ArrayEnum
A Enumeration for enumerating the members of an array of Objects.

UnionTree
A UnionTree is a Tree which represents the union of a series of
 Tree's.

ZipTree
A ZipTree is a Tree that mirrors the contents of a zipfile;
 the constructor takes in a pathname and returns a tree
 representing the filesystem contained in that zipfile.

Exception Summary

Resolve_AmbiguousName
The exceptional result type for lookup:

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

Javafe
© 2010 IT University of Copenhagen
© 2007,2008,2009,2010 Joseph Kiniry
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006,2007,2008,2009 University College Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

The ESC/Java2 Project Homepage


text:
require_dependency "push_type/admin_controller"

module PushType
  class Admin::AssetsController < AdminController

    include PushType::AssetsHelper

    before_action :build_asset, only: [:new, :create, :upload]
    before_action :load_asset,  only: [:edit, :update, :destroy, :restore]

    def index
      respond_to do |format|
        format.html do
          @assets = PushType::Asset.not_trash.page(params[:page]).per(20)
        end
        format.json do
          @assets = PushType::Asset.not_trash.page(params[:page]).per(12)
          render json: { assets: assets_array(@assets).as_json, meta: { current_page: @assets.current_page, total_pages: @assets.total_pages } }
        end
      end
    end

    def trash
      @assets = PushType::Asset.trashed.page(params[:page]).per(20)
    end

    def new
    end

    def create
      if @asset.save
        flash[:notice] = 'File successfully uploaded.'
        redirect_to push_type_admin.assets_path
      else
        render 'new'
      end
    end

    def upload
      respond_to do |format|
        format.json do
          if @asset.save
            hash = params[:froala] ? { link: media_path(@asset) } : { asset: asset_hash(@asset).as_json }
            render json: hash, status: :created
          else
            hash = params[:froala] ? { error: @asset.errors.full_messages.first } : { errors: @asset.errors.as_json }
            render json: hash, status: :unprocessable_entity
          end
        end
      end
    end

    def edit
    end

    def update
      if @asset.update_attributes asset_params
        flash[:notice] = 'Media successfully updated.'
        redirect_to push_type_admin.assets_path
      else
        render 'edit'
      end
    end

    def destroy
      if @asset.trashed?
        @asset.destroy
        flash[:notice] = 'Media permanently deleted.'
        redirect_to push_type_admin.trash_assets_path
      else
        @asset.trash!
        flash[:notice] = 'Media trashed.'
        redirect_to push_type_admin.assets_path
      end
    end

    def restore
      @asset.restore!
      flash[:notice] = 'Media successfully restored.'
      redirect_to push_type_admin.assets_path
    end

    def empty
      PushType::Asset.trashed.destroy_all
      flash[:notice] = 'Trash successfully emptied.'
      redirect_to push_type_admin.assets_path
    end

    private

    def initial_breadcrumb
      breadcrumbs.add 'Media', push_type_admin.assets_path
    end

    def build_asset
      @asset = PushType::Asset.new asset_params.merge(uploader: push_type_user)
    end

    def load_asset
      @asset = PushType::Asset.find params[:id]
    end

    def asset_params
      params.fetch(:asset, {}).permit(:file, :description)
    end

  end
end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="@android:anim/decelerate_interpolator" >

    <translate
        android:duration="700"
        android:fromXDelta="0%"
        android:fromYDelta="150%"
        android:toXDelta="0%"
        android:startOffset="150"
        android:toYDelta="0%" />

    <alpha xmlns:android="http://schemas.android.com/apk/res/android"
           android:interpolator="@android:anim/accelerate_interpolator"
           android:startOffset="150"
           android:fromAlpha="0.5" android:toAlpha="1.0" android:duration="700" />

</set>


text:
require 'spec_helper'
require 'integration_helper'

describe 'compile script', :integration do
  include_context 'integration_helper'

  it 'should return zero if success',
     app_fixture: 'integration_valid' do

    run("bin/compile #{app_dir} #{app_dir + '.cache'}") { |status| expect(status).to be_success }
  end

  it 'should fail to compile when no containers detect' do
    run("bin/compile #{app_dir} #{app_dir + '.cache'}") do |status|
      expect(status).not_to be_success
      expect(stderr.string).to match /No container can run this application/
    end
  end

end


text:
<?php

namespace Crossknowledge\OrderManagementBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class DetailCommandeType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
//            ->add('type', 'choice', array('label' => 'Type', 'read_only' => true,
//                'choices' => array( 'DA' => 'Demande d\'achat',
//                                    'OA' => 'Ordre d\'achat'
//                  )))
            ->add('BU','choice', array('label' => 'detailcommande.service','empty_value' => 'Sélectionnez votre service',
                'choices' => array( 'BU FR 1'           => 'BU FR 1',
                                    'BU FR 2'           => 'BU FR 2',
                                    'BU ESMB'           => 'BU ESMB',
                                    'Admin'             => 'Administration',
                                    'Marketing'         => 'Marketing',
                                    'Solutions'         => 'Solutions',
                                    'Opérations France' => 'Opérations France'
                  )))
            ->add('designation', 'text', array('label' => 'detailcommande.designation'))
            ->add('lettrage', 'checkbox',array('label' => 'detailcommande.lettering', 'required' => false))
            ->add('quantite','integer', array('label' => 'detailcommande.quantite'))
            ->add('dateLivraison', 'date',array('label' => 'detailcommande.datelivraison',
                                                'widget' => 'single_text',
                                                'input' => 'datetime',
                                                'format' => 'dd/MM/yyyy',
                                                'attr' => array('class' => 'date')))
            ->add('remarque', 'textarea', array('label' => 'detailcommande.remarque', 'required' => false))
            ->add('accordBUM', 'checkbox', array('label' => 'detailcommande.accord', 'required' => false))
            ->add('prixHT', 'number', array('label' => 'detailcommande.prixht', 'required' => false))
            ->add('tva', 'number', array('label' => 'detailcommande.tva', 'precision' => '1'))
            ->add('prixTTC', 'hidden', array('label' => 'detailcommande.prixttc'))
            ->add('article', 'entity', array('class' => 'CrossknowledgeOrderManagementBundle:Article', 'label' => 'detailcommande.article','empty_value' => 'Sélectionnez un article', 'empty_data'  => null, 'property' => 'typeArticle'))
            ->add('assignedTo', 'entity', array('class' => 'CrossknowledgeUserBundle:Utilisateur', 'label' => 'detailcommande.assignedto', 'empty_value' => 'Sélectionnez votre manager'))
            ->add('client', 'text', array('label' => 'detailcommande.client'))
        ;
    }

    public function getName()
    {
        return 'crossknowledge_ordermanagementbundle_detailcommandetype';
    }

    public function getDefaultOptions(array $options)
    {
        return array(
            'data_class' => 'Crossknowledge\OrderManagementBundle\Entity\DetailCommande',
        );
    }
}


text:
<?php

use Mouf\MoufUtils;
use Mouf\MoufManager;

require_once 'Mouf/Mvc/Splash/Controllers/Admin/SplashViewUrlsController.php';

$moufManager = MoufManager::getMoufManager();

$moufManager->declareComponent('splashGenerateService', 'Mouf\\Mvc\\Splash\\SplashGenerateService', true);

$moufManager->declareComponent('splashApacheConfig', 'Mouf\\Mvc\\Splash\\Controllers\\Admin\\SplashAdminApacheConfigureController', true);
$moufManager->bindComponent('splashApacheConfig', 'template', 'moufTemplate');
$moufManager->bindComponents('splashApacheConfig', 'content', 'block.content');
$moufManager->bindComponent('splashApacheConfig', 'splashGenerateService', 'splashGenerateService');

$moufManager->declareComponent('splash9install', 'Mouf\\Mvc\\Splash\\Controllers\\Admin\\SplashInstallController', true);
$moufManager->bindComponent('splash9install', 'template', 'moufInstallTemplate');
$moufManager->bindComponents('splash9install', 'content', 'block.content');
$moufManager->bindComponent('splash9install', 'splashGenerateService', 'splashGenerateService');

$moufManager->declareComponent('splashpurgecache', 'Mouf\\Mvc\\Splash\\Controllers\\Admin\\SplashPurgeCacheController', true);
$moufManager->bindComponent('splashpurgecache', 'template', 'moufTemplate');
$moufManager->bindComponents('splashpurgecache', 'content', 'block.content');

$moufManager->declareComponent('splashViewUrls', 'Mouf\\Mvc\\Splash\\Controllers\\Admin\\SplashViewUrlsController', true);
$moufManager->bindComponent('splashViewUrls', 'template', 'moufTemplate');
$moufManager->bindComponents('splashViewUrls', 'content', 'block.content');

MoufUtils::registerMainMenu('mvcMainMenu', 'MVC', null, 'mainMenu', 100);
MoufUtils::registerMenuItem('mvcSplashSubMenu', 'Splash MVC', null, 'mvcMainMenu', 45);
MoufUtils::registerMenuItem('mvcSplashPurgeCacheItem', 'Purge URLs cache', 'splashpurgecache/', 'mvcSplashSubMenu', 0);
MoufUtils::registerMenuItem('mvcSplashAdminApacheConfig2Item', 'Configure Apache redirection', 'splashApacheConfig/', 'mvcSplashSubMenu', 45);
MoufUtils::registerMenuItem('mvcSplashAdminUrlsListMenuItem', 'View URLs', 'splashViewUrls/', 'mvcSplashSubMenu', 10);


text:
/*
 */
package org.redkale.test.convert;

import java.math.BigInteger;
import java.util.*;
import org.junit.jupiter.api.*;
import org.redkale.convert.ConvertCoder;
import org.redkale.convert.bson.BsonConvert;
import org.redkale.convert.ext.BigIntegerSimpledCoder.BigIntegerHexJsonSimpledCoder;
import org.redkale.convert.json.JsonConvert;

/**
 *
 * @author zhangjx
 */
public class ConvertCoderTest {

    private boolean main;

    public static void main(String[] args) throws Throwable {
        ConvertCoderTest test = new ConvertCoderTest();
        test.main = true;
        test.run();
    }

    @Test
    public void run() throws Exception {
        JsonConvert convert = JsonConvert.root();
        BigMessage msg = new BigMessage();
        msg.big = new BigInteger("255");
        msg.big2 = new BigInteger("255");
        msg.big3 = new BigInteger("255");
        msg.map = new HashMap<>();
        msg.map.put("haha", new BigInteger("254"));

        BigMessage2 msg2 = new BigMessage2();
        msg2.big = new BigInteger("255");
        msg2.big2 = new BigInteger("255");
        msg2.big3 = new BigInteger("255");
        msg2.map = new HashMap<>();
        msg2.map.put("haha", new BigInteger("254"));

        System.out.println(convert.convertTo(msg));
        String json = "{\"big\":\"0xff\",\"big2\":\"0xff\",\"big3\":\"255\",\"map\":{\"haha\":\"0xfe\"},\"num1\":0}";
        if (!main) Assertions.assertEquals(convert.convertTo(msg), json);
        BigMessage msg12 = convert.convertFrom(BigMessage.class, json);
        if (!main) Assertions.assertEquals(convert.convertTo(msg12), json);

        byte[] bs1 = BsonConvert.root().convertTo(msg);
        byte[] bs2 = BsonConvert.root().convertTo(msg2);
        if (!main) Assertions.assertEquals(Arrays.toString(bs1), Arrays.toString(bs2));
    }

    public static class BigMessage {

        @ConvertCoder(coder = BigIntegerHexJsonSimpledCoder.class)
        public BigInteger big;

        @ConvertCoder(encoder = BigIntegerHexJsonSimpledCoder.class, decoder = BigIntegerHexJsonSimpledCoder.class)
        public BigInteger big2;

        public BigInteger big3;

        public int num1;

        @ConvertCoder(coder = BigIntegerHexJsonSimpledCoder.class)
        public Map<String, BigInteger> map;
    }

    public static class BigMessage2 {

        public BigInteger big;

        public BigInteger big2;

        public BigInteger big3;

        public int num1;

        public Map<String, BigInteger> map;
    }
}


text:
#region License

//The MIT License (MIT)

//Copyright (c) 2014 Konrad Huber

//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:

//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.

//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.

#endregion

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Controls;
using System.Xml.Serialization;
using Microsoft.Practices.Unity;
using System.Windows.Input;
using VEX.Model.Scene.Model;
using VEX.Service.Scene;
using VEX.IDAL;
using VEX.Interface.Scene;
using VEF.Interfaces.Services;
using VEF.Interfaces.Controls;
using VEF.IDAL;
using VEF;
using VEF.Model.Services;
using VEF.Interface.History;
using VEX.Core.Shared.Service.Scene;
using NetMsg;
using VEX.Model.UI;
using System.Runtime.Serialization;
using VEX.Core.Shared.Model.Prefabs;

namespace VEX.Model.Project
{
    [KnownType(typeof(AnimationBlendTree))]
    [DataContract]
    public class BlendTreeCategoryModel : PItem
    {
        [Browsable(false)]
        public override List<IMenuItem> MenuOptions
        {
            get
            {

                List<IMenuItem> list = new List<IMenuItem>();
                VEFMenuItem miAddItem = new VEFMenuItem() { Header = "Add Item" };

                foreach (var type in CanAddThisItems)
                {
                    miAddItem.Items.Add(new MenuItem() { Header = type.Name, Command = new CmdAddNewBlendTree(this), CommandParameter = type });
                }

                list.Add(miAddItem);

                //VEFMenuItem miAdd = new VEFMenuItem() { Command = new CmdCreateStaticObj(), CommandParameter = this, Header = "Create static object" };
                //menuOptions.Add(miAdd);

                return list;
            }
        }

        public override List<System.Type> CanAddThisItems
        {
            get
            {
                return new List<Type>() { typeof(AnimationBlendTree) };
            }
        }

        public BlendTreeCategoryModel()
        {
            this.Name = "BlendTreeCategoyModel";
        }

        public bool Create(IUnityContainer unityContainer) { return true; }
        public bool Open(IUnityContainer unityContainer, object id) { return true; }

        public new  bool Save(object param)
        {
            return true;
        }

        public void Refresh() { }

        public bool Delete() { return true; }

        //public StaticObjectCategoryModel()
        //{
        //    SceneItems = new CollectionOfISceneEntity();
        //}
    }

    public class CmdAddNewBlendTree : IHistoryCommand
    {
        private BlendTreeCategoryModel mpm;
        public event EventHandler CanExecuteChanged;

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            Type t = parameter as Type;

            //if (t.Name == "VEXDBFileModel")
        //    BlendTreeCategoyModel parent = parameter as BlendTreeCategoyModel;

            UInt32 id = 0;

            if (mpm != null)
            {
                var tableModel = mpm.Parent as DBTableModel;
                if (tableModel != null)
                {
                    id = tableModel.AutoIncrement();
                }
            }

            //if (id > 0)
            //{
            //    if (t.Name == "RenderableComponent")
            //    {
            //        EntityX newEntity = new EntityX() {  Name = "New Entity" };
            //        RenderableComponent pom = new RenderableComponent() { Parent = newEntity };

            //      //  pom.Create();
            //        mpm.Items.Add(newEntity);
            //        newEntity.Components.Add(pom);
            //    }

                if (t.Name == "AnimationBlendTree")
                {
                // EntityX newEntity = new EntityX() { Name = "New Entity" };
                AnimationBlendTree pom = new AnimationBlendTree();// { Parent = newEntity };

                  //  pom.Create();
                    mpm.Items.Add(pom);
                  //  newEntity.Components.Add(pom);

                }
            //}
            //else
            //{
            //    (VEFModule.UnityContainer.Resolve(typeof(ILoggerService), "") as ILoggerService).Log("Error: CmdCreateStaticObj id =  (" + id.ToString() + ")", LogCategory.Error, LogPriority.High);
            //}
        }

        public CmdAddNewBlendTree(BlendTreeCategoryModel pm)
        {
            mpm = pm;
        }

        public bool CanRedo() { return true; }
        public bool CanUndo() { return true; }
        public void Redo() { }
        public string ShortMessage() { return "add item"; }
        public void Undo() { }

    }
}


text:
namespace Shadow.SchoolGame.Game.Buttons {
  using Data;
  using System;
  using UnityEngine;
  using UnityEngine.UI;

  public class PointButton : MonoBehaviour {
    public int value;
    CurrentData data;

    void Start() {
      data = Core.data;
      var txt = GetComponentInChildren<Text>();
      var enable = data.currentTopic.HasQuestions(value);
      GetComponent<Button>().enabled = enable;
      txt.text = Convert.ToString(value) + (enable ? "" : " - No Questions Left");
    }

    public void Click() {
      data.currentValue = value;
      data.currentQuestion = data.currentTopic.GetQuestion(value);
      Core.inst.question.SetActive(true);
      Core.inst.pntSelect.SetActive(false);
    }
  }
}


text:
package org.gsweb.components.ui;

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

import javax.servlet.jsp.PageContext;

import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.gsweb.components.util.ComponentResourceUtils;
import org.gsweb.components.util.UIComponent;

import com.netsteadfast.greenstep.base.model.YesNo;

public class Label implements UIComponent {
	private PageContext pageContext = null;
	private String id="";
	private String text="";
	private String requiredFlag=YesNo.NO;
	private StringBuilder htmlOut=new StringBuilder();

	private Map<String, Object> getParameters() {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", this.id);
		params.put("text", StringEscapeUtils.escapeHtml4(StringUtils.defaultString(this.text)));
		params.put("requiredFlag", (YesNo.YES.equals(requiredFlag) ? YesNo.YES : YesNo.NO));
		return params;
	}

	private void generateHtml() {
		try {
			htmlOut.append( ComponentResourceUtils.generatorResource(
					Label.class, IS_HTML, "META-INF/resource/label/ui.label.htm.ftl", this.getParameters()) );
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String getId() {
		return this.id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Override
	public String getScript() throws Exception {
		return "";
	}

	@Override
	public String getHtml() throws Exception {
		this.generateHtml();
		return htmlOut.toString();
	}

	public PageContext getPageContext() {
		return pageContext;
	}

	@Override
	public void setPageContext(PageContext pageContext) {
		this.pageContext = pageContext;
	}

	@Override
	public void setName(String name) {

	}

	@Override
	public String getName() {
		return "";
	}

	public String getRequiredFlag() {
		return requiredFlag;
	}

	public void setRequiredFlag(String requiredFlag) {
		this.requiredFlag = requiredFlag;
	}

}


text:
require_relative '../../spec_helper'

ruby_version_is ""..."3.1" do
  require_relative 'shared/conjugate'

  describe "Matrix#conj" do
    it_behaves_like :matrix_conjugate, :conj
  end
end


text:
     background-image: url(../img/icon-download.png);
 }


text:
package tsocket.zby.com.tsocket.connection.bluetooth;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.content.Intent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
import tsocket.zby.com.tsocket.AppConstants;
import tsocket.zby.com.tsocket.connection.ConnectAction;
import tsocket.zby.com.tsocket.connection.ICmdParseInterface;
import tsocket.zby.com.tsocket.connection.agreement.CmdProcess;
import tsocket.zby.com.tsocket.utils.LogUtils;
import tsocket.zby.com.tsocket.utils.MyHexUtils;

/**
 * This class does all the work for setting up and managing Bluetooth
 * connections with other devices. It has a thread that listens for
 * incoming connections, a thread for connecting with a device, and a
 * thread for performing data transmissions when connected.
 */
public class BluetoothChatManager {
    private static final String TAG = "Bluetooth";
    private static final boolean D = true;
    //    public static String type;
//    public static final String Link="link";
//    public static final String Cut="cut";
    private  boolean isLink=false;
    // Name for the SDP record when creating server socket
    private static final String NAME = "HomeSecurity";

    // Unique UUID for this application
    // private static final UUID MY_UUID = UUID.fromString("fa87c0d0-afac-11de-8a39-0800200c9a66");
    private static final UUID MY_UUID = UUID
            .fromString("00001101-0000-1000-8000-00805F9B34FB");

    //00001101-0000-1000-8000-00805F9B34FB
    // Member fields
    private final BluetoothAdapter mAdapter;
    private AcceptThread mAcceptThread;
    private ConnectThread mConnectThread;
    private ConnectedThread mConnectedThread;
    private int mState;

    // Constants that indicate the current connection state
    public static final int STATE_NONE = 20;       // we're doing nothing
    public static final int STATE_LISTEN = 21;     // now listening for incoming connections
    public static final int STATE_CONNECTING = 22; // now initiating an outgoing connection
    public static final int STATE_CONNECTED = 23;  // now connected to a remote device
    private Context mContext;

    private CmdProcess mCmdProcess;

    /**
     * Constructor. Prepares a new HomeSecurity session.
     * @param context  The UI Activity Context
     */
    public BluetoothChatManager(Context context) {
        mContext = context;
        isLink=false;
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        mState = STATE_NONE;
    }

    /**
     * Set the current state of the chat connection
     * @param state  An integer defining the current connection state
     */
    private synchronized void setState(int state) {
        if (D) LogUtils.d(TAG, "setState() " + mState + " -> " + state);
        mState = state;

        // Give the new state to the Handler so the UI Activity can update
        //    mHandler.obtainMessage(BodyHeight.MESSAGE_STATE_CHANGE, state, -1).sendToTarget();
    }

    /**
     * Return the current connection state. */
    public synchronized int getState() {
        return mState;
    }

    /**
     * Start the chat service. Specifically start AcceptThread to begin a
     * session in listening (server) mode. Called by the Activity onResume() */
    public synchronized void start() {
        if (D) LogUtils.d(TAG, "start");

        // Cancel any thread attempting to make a connection
        if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}

        // Cancel any thread currently running a connection
        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}

        // Start the thread to listen on a BluetoothServerSocket
        if (mAcceptThread == null) {
            mAcceptThread = new AcceptThread();
            mAcceptThread.start();
        }
        setState(STATE_LISTEN);
    }

    /**
     * Start the ConnectThread to initiate a connection to a remote device.
     * @param device  The BluetoothDevice to connect
     */
    //�õ�Ҫ���ӵ������豸������ �ͷ���
    public synchronized void connect(BluetoothDevice device) {
        if (D) LogUtils.d(TAG, "connect to: " + device);

        // Cancel any thread attempting to make a connection
        if (mState == STATE_CONNECTING) {
            if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
        }

        // Cancel any thread currently running a connection
        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}

        // Start the thread to connect with the given device
        mConnectThread = new ConnectThread(device);
        mConnectThread.start();
        setState(STATE_CONNECTING);
    }

    /**
     * Start the ConnectedThread to begin managing a Bluetooth connection
     * @param socket  The BluetoothSocket on which the connection was made
     * @param device  The BluetoothDevice that has been connected
     */
    public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {
        if (D) LogUtils.d(TAG, "connected");

        // Cancel the thread that completed the connection
        if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}

        // Cancel any thread currently running a connection
        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}

        // Cancel the accept thread because we only want to connect to one device
        if (mAcceptThread != null) {mAcceptThread.cancel(); mAcceptThread = null;}

        // Start the thread to manage the connection and perform transmissions
        mConnectedThread = new ConnectedThread(socket);
        mConnectedThread.start();

        // Send the name of the connected device back to the UI Activity
//        Message msg = mHandler.obtainMessage(BodyHeight.MESSAGE_DEVICE_NAME);
//        Bundle bundle = new Bundle();
//        bundle.putString(BodyHeight.DEVICE_NAME, device.getName());
//        msg.setData(bundle);
//        mHandler.sendMessage(msg);
        setState(STATE_CONNECTED);
    }

    /**
     * Stop all threads
     */
    public synchronized void stop() {
        if (D) LogUtils.d(TAG, "stop");
        if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
        if (mAcceptThread != null) {mAcceptThread.cancel(); mAcceptThread = null;}
        setState(STATE_NONE);
    }

    /**
     * Write to the ConnectedThread in an unsynchronized manner
     * @param out The bytes to write
     * @see ConnectedThread#write(byte[])
     */
    public boolean write(byte[] out) {
        // Create temporary object
        LogUtils.logD(TAG, "发送:" + MyHexUtils.buffer2String(out));
        if(AppConstants.isDemo) {
            return true;
        }
        ConnectedThread r;

        // Synchronize a copy of the ConnectedThread
        synchronized (this) {
            if (mState != STATE_CONNECTED) return false;
            r = mConnectedThread;
        }

        // Perform the write unsynchronized
        r.write(out);
        return true;
    }

    /**
     * Indicate that the connection attempt failed and notify the UI Activity.
     */
    private void connectionFailed() {
        setState(STATE_LISTEN);
       sendBroadcast(ConnectAction.ACTION_GATT_DISCONNECTED);
        // Send a failure message back to the Activity
//        Message msg = mHandler.obtainMessage(BodyHeight.MESSAGE_TOAST);
//        Bundle bundle = new Bundle();
//        bundle.putString(BodyHeight.TOAST, "���Ӳ��������豸");
//        msg.setData(bundle);
//        mHandler.sendMessage(msg);
    }

    public static  boolean promptLost=true;
    private void connectionLost() {
        if(!promptLost){
            promptLost=true;
            return;
        }

        setState(STATE_LISTEN);
        sendBroadcast(ConnectAction.ACTION_GATT_DISCONNECTED);
    }

    /**
     * This thread runs while listening for incoming connections. It behaves
     * like a server-side client. It runs until a connection is accepted
     * (or until cancelled).
     */
    private class AcceptThread extends Thread {
        // The local server socket
        private final BluetoothServerSocket mmServerSocket;

        public AcceptThread() {
            BluetoothServerSocket tmp = null;

            // Create a new listening server socket
            try {
                tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
            } catch (IOException e) {
                LogUtils.e(TAG, "listen() failed", e);
            }
            mmServerSocket = tmp;
        }

        public void run() {
            if (D) LogUtils.d(TAG, "BEGIN mAcceptThread" + this);
            setName("AcceptThread");
            BluetoothSocket socket = null;

            // Listen to the server socket if we're not connected
            while (mState != STATE_CONNECTED) {
                try {
                    // This is a blocking call and will only return on a
                    // successful connection or an exception
                    socket = mmServerSocket.accept();
                } catch (IOException e) {
                    LogUtils.e(TAG, "accept() failed", e);
                    break;
                }

                // If a connection was accepted
                if (socket != null) {
                    synchronized (BluetoothChatManager.this) {
                        switch (mState) {
                            case STATE_LISTEN:
                            case STATE_CONNECTING:
                                // Situation normal. Start the connected thread.
                                connected(socket, socket.getRemoteDevice());
                                break;
                            case STATE_NONE:
                            case STATE_CONNECTED:
                                // Either not ready or already connected. Terminate new socket.
                                try {
                                    socket.close();
                                } catch (IOException e) {
                                    LogUtils.e(TAG, "Could not close unwanted socket", e);
                                }
                                break;
                        }
                    }
                }
            }
            if (D) LogUtils.i(TAG, "END mAcceptThread");
        }

        public void cancel() {
            if (D) LogUtils.d(TAG, "cancel " + this);
            try {
                mmServerSocket.close();
            } catch (IOException e) {
                LogUtils.e(TAG, "close() of server failed", e);
            }
        }
    }

    /**
     * This thread runs while attempting to make an outgoing connection
     * with a device. It runs straight through; the connection either
     * succeeds or fails.
     */
    private class ConnectThread extends Thread {
        private final BluetoothSocket mmSocket;
        private final BluetoothDevice mmDevice;

        public ConnectThread(BluetoothDevice device) {
            mmDevice = device;
            BluetoothSocket tmp = null;

            // Get a BluetoothSocket for a connection with the
            // given BluetoothDevice
            try {
                tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
            } catch (IOException e) {
                LogUtils.e(TAG, "create() failed", e);
            }
            mmSocket = tmp;
        }

        public void run() {
            LogUtils.i(TAG, "BEGIN mConnectThread");
            setName("ConnectThread");

            // Always cancel discovery because it will slow down a connection
            mAdapter.cancelDiscovery();//ȡ����ҵĽ��

            // Make a connection to the BluetoothSocket
            try {
                // This is a blocking call and will only return on a
                // successful connection or an exception
               sendBroadcast(ConnectAction.ACTION_GATT_CONNECTING);

                LogUtils.v(TAG,"is linking");
                mmSocket.connect();
                isLink=true;
                LogUtils.v(TAG,"link success");

                sendBroadcast(ConnectAction.ACTION_GATT_CONNECTED);

            } catch (IOException e) {

                isLink = false;

                // 第二次连接
                try {
                    Thread.sleep(1000);
                   sendBroadcast(ConnectAction.ACTION_GATT_CONNECTING);

                    LogUtils.v(TAG,"第二次正在连接");
                    mmSocket.connect();
                    isLink = true;
                    LogUtils.v(TAG,"第二次连接成功");

                    sendBroadcast(ConnectAction.ACTION_GATT_CONNECTED);
                } catch (InterruptedException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } finally {
                    if (!isLink) {
                        connectionFailed();
                        // Close the socket
                        try {
                            mmSocket.close();
                        } catch (IOException e2) {
                            LogUtils.e(TAG,
                                    "unable to close() socket during connection failure",
                                    e2);
                        }
                        // Start the service over to restart listening mode
                        // BluetoothChatManager.this.start();
                        return;
                    }
                }

            }

            // Reset the ConnectThread because we're done
            synchronized (BluetoothChatManager.this) {
                mConnectThread = null;
            }

            // Start the connected thread
            connected(mmSocket, mmDevice);
        }

        public void cancel() {
            try {
                if(mmSocket!=null) {
                    mmSocket.close();
                }
            } catch (IOException e) {
                LogUtils.e(TAG, "close() of connect socket failed", e);
            }
        }
    }

    /**
     * This thread runs during a connection with a remote device.
     * It handles all incoming and outgoing transmissions.
     */
    private class ConnectedThread extends Thread {
        private final BluetoothSocket mmSocket;
        private final InputStream mmInStream;
        private final OutputStream mmOutStream;

        public ConnectedThread(BluetoothSocket socket) {
            LogUtils.d(TAG, "create ConnectedThread");
            mmSocket = socket;
            InputStream tmpIn = null;
            OutputStream tmpOut = null;

            // Get the BluetoothSocket input and output streams
            try {
                tmpIn = socket.getInputStream();
                tmpOut = socket.getOutputStream();
            } catch (IOException e) {
                LogUtils.e(TAG, "temp sockets not created", e);
            }

            mmInStream = tmpIn;
            mmOutStream = tmpOut;
        }

        public void run() {
            LogUtils.i(TAG, "BEGIN mConnectedThread");
            byte[] buffer;
            int bytes;

            // Keep listening to the InputStream while connected
            while (true) {
                try {
                    // Read from the InputStream
                    buffer = new byte[512];
                    bytes = mmInStream.read(buffer);
                    mCmdProcess.ProcessDataCommand(buffer,bytes);
                } catch (IOException e) {
                    e.printStackTrace();
                    isLink=false;
                    connectionLost();
                    break;
                }

            }
        }

        private long lastSendTime = 0l;//上次发送数据时间
        private int DELAY_TIME = 50;//默认两条数据间隔时间
        /**
         * Write to the connected OutStream.
         * @param buffer  The bytes to write
         */
        public void write(byte[] buffer) {
            if(mmOutStream==null) {
                LogUtils.d(TAG, "BluetoothChatManager.write   mmOutStream  is null");
                return;
            }
            try {
                if (System.currentTimeMillis() - lastSendTime < DELAY_TIME) {
                    try {
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                mmOutStream.write(buffer);
                lastSendTime = System.currentTimeMillis();
            } catch (IOException e) {
                LogUtils.e(TAG, "Exception during write", e);
            }
        }

        public void cancel() {
            try {
                mmSocket.close();
            } catch (IOException e) {
                LogUtils.e(TAG, "close() of connect socket failed", e);
            }
        }
    }

    boolean islink() {
        return isLink;
    }

    private void sendBroadcast(String action){
        mContext.sendBroadcast(new Intent(action));
    }

    public void setCmdParse(ICmdParseInterface cmdParse) {
        mCmdProcess = new CmdProcess(cmdParse);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="FrameworkDetectionExcludesConfiguration">
    <file type="android" url="file://$PROJECT_DIR$" />
  </component>
  <component name="JsBowerSettings">
    <exe-path />
    <config-path />
  </component>
  <component name="MavenProjectsManager">
    <option name="originalFiles">
      <list>
        <option value="$PROJECT_DIR$/pom.xml" />
      </list>
    </option>
  </component>
  <component name="ProjectInspectionProfilesVisibleTreeState">
    <entry key="Project Default">
      <profile-state>
        <expanded-state>
          <State>
            <id />
          </State>
          <State>
            <id>Class structureJava</id>
          </State>
          <State>
            <id>Code maturity issuesJava</id>
          </State>
          <State>
            <id>Google Web Toolkit issues</id>
          </State>
          <State>
            <id>Java</id>
          </State>
          <State>
            <id>Java language level migration aidsJava</id>
          </State>
          <State>
            <id>Javadoc issuesJava</id>
          </State>
          <State>
            <id>Performance issuesJava</id>
          </State>
          <State>
            <id>Spring</id>
          </State>
          <State>
            <id>Spring AOPSpring</id>
          </State>
          <State>
            <id>TestNG</id>
          </State>
          <State>
            <id>Threading issuesJava</id>
          </State>
        </expanded-state>
        <selected-state>
          <State>
            <id>Android</id>
          </State>
        </selected-state>
      </profile-state>
    </entry>
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 17 Platform" project-jdk-type="Android SDK" />
  <component name="ProjectType">
    <option name="id" value="Android" />
  </component>
</project>


text:
Elektromagnetische Version einer Gematriakartei, hilfreich für Studenten auf dem Pfad des Lebensbaums.

Demo: https://gematria.scratchbook.ch/

## Installation

Das Verzeichnis *htdocs* auf einem Webserver installieren.

Das Verzeichnis *htdocs/db* muss für den Webserver schreibbar sein.

In der *htdocs/application/config.php* die Baseurl und das Passwort für den Bearbeitungsmodus definieren.

*/login* - Passwort eingeben - die Hinzufüge- und Bearbeitungsfelder sind jetzt sichtbar.

*/logout* um sich auszuloggen.


text:
package me.chanjar.weixin.mp.api;

import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.bean.result.WxMpUserBlacklistGetResult;

import java.util.List;

/**
 * @author miller
 */
public interface WxMpUserBlacklistService {
  /**
   *

   * 获取公众号的黑名单列表
   * 详情请见http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1471422259_pJMWA&token=&lang=zh_CN
   *

   */
  WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException;

  /**
   *

   *   拉黑用户
   *   详情请见http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1471422259_pJMWA&token=&lang=zh_CN
   *

   */
  void pushToBlacklist(List<String> openidList) throws WxErrorException;

  /**
   *

   *   取消拉黑用户
   *   详情请见http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1471422259_pJMWA&token=&lang=zh_CN
   *

   */
  void pullFromBlacklist(List<String> openidList) throws WxErrorException;
}


text:
<ion-view view-title="Login">
  <ion-content class="padding">

    <form name="loginAdminForm" novalidate ng-submit="loginAsAdmin()">
  		<button class="button button-positive">Login as Admin</button>
	</form>

	<form name="loginManagerForm" novalidate ng-submit="loginAsManager()">
	  <button class="button button-positive">Login as Manager</button>
	</form>

	<form name="loginMikeForm" novalidate ng-submit="loginAsMike()">
	  <button class="button button-positive">Login as employee Mike</button>
	</form>

	<form name="loginJohnForm" novalidate ng-submit="loginAsJohn()">
	  <button class="button button-positive">Login as employee John</button>
	</form>

	<form name="logoutForm" novalidate ng-submit="logout()">
	  <button class="button button-positive">Logout</button>
	</form>

Current User

	Name: {{currentPerson.username}}

	ID: {{currentUser.getCurrentId()}}

  </ion-content>
</ion-view>


text:
class AddGeneratedScoreToAssessmentItemEvent < ActiveRecord::Migration[5.0]
  def change
    add_column :assessment_item_events, :generated_score, :float
  end
end


text:
{{game.name}}

by {{game.ownerName}}

		 Play
		 Edit

		<like-button game-id="game.id" liked-count="game.likedCount" liked-game="doesUserLikeGame" button-classes="['btn-xs']"></like-button>

 {{game.forkCount}} forks

 Mixed from {{game.mixedFromGameIds.length || 0}} and into {{game.mixedToGameIds.length || 0 }}

 Last updated {{formatDate(game.lastUpdatedTime)}}

 {{game.playCount}} plays

 {{game.versionCount}} versions

{{game.description}}


text:
#include "UEPyEdGraphPin.h"

#if WITH_EDITOR

#include "Runtime/Engine/Classes/EdGraph/EdGraphPin.h"
#include "Editor/UnrealEd/Public/Kismet2/BlueprintEditorUtils.h"

static PyObject *py_ue_edgraphpin_make_link_to(ue_PyEdGraphPin *self, PyObject * args)
{
	PyObject *other_pin;
	if (!PyArg_ParseTuple(args, "O:make_link_to", &other_pin))
	{
		return NULL;
	}

	ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin(other_pin);
	if (!py_other_pin)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a UEdGraphPin");
	}

	self->pin->MakeLinkTo(py_other_pin->pin);

	if (UBlueprint *bp = Cast<UBlueprint>(self->pin->GetOwningNode()->GetGraph()->GetOuter()))
	{
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(bp);
	}

	Py_RETURN_NONE;
}

static PyObject *py_ue_edgraphpin_connect(ue_PyEdGraphPin *self, PyObject * args)
{
	PyObject *other_pin;
	if (!PyArg_ParseTuple(args, "O:connect", &other_pin))
	{
		return NULL;
	}

	ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin(other_pin);
	if (!py_other_pin)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a UEdGraphPin");
	}

	if (!self->pin->GetSchema()->TryCreateConnection(self->pin, py_other_pin->pin))
	{
		return PyErr_Format(PyExc_Exception, "unable to connect pins");
	}

	if (UBlueprint *bp = Cast<UBlueprint>(self->pin->GetOwningNode()->GetGraph()->GetOuter()))
	{
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(bp);
	}

	Py_RETURN_NONE;
}

static PyObject *py_ue_edgraphpin_break_link_to(ue_PyEdGraphPin *self, PyObject * args)
{
	PyObject *other_pin;
	if (!PyArg_ParseTuple(args, "O:break_link_to", &other_pin))
	{
		return NULL;
	}

	ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin(other_pin);
	if (!py_other_pin)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a UEdGraphPin");
	}

	self->pin->BreakLinkTo(py_other_pin->pin);

	if (UBlueprint *bp = Cast<UBlueprint>(self->pin->GetOwningNode()->GetGraph()->GetOuter()))
	{
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(bp);
	}

	Py_RETURN_NONE;
}

static PyObject *py_ue_edgraphpin_break_all_pin_links(ue_PyEdGraphPin *self, PyObject * args)
{
	PyObject *py_notify_nodes = nullptr;
	if (!PyArg_ParseTuple(args, "O:break_all_pin_links", &py_notify_nodes))
	{
		return NULL;
	}

	bool notify_nodes = true;
	if (py_notify_nodes && !PyObject_IsTrue(py_notify_nodes))
		notify_nodes = false;

	self->pin->BreakAllPinLinks(notify_nodes);

	if (UBlueprint *bp = Cast<UBlueprint>(self->pin->GetOwningNode()->GetGraph()->GetOuter()))
	{
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(bp);
	}

	Py_RETURN_NONE;
}

static PyObject *py_ue_edgraphpin_get_linked_to(ue_PyEdGraphPin * self, PyObject * args)
{
	PyObject *pins = PyList_New(0);

	TArray<UEdGraphPin*> Links = self->pin->LinkedTo;

	for (int32 i = 0; i < Links.Num(); i++)
	{
		UEdGraphPin *pin = Links[i];
		ue_PyUObject *item = (ue_PyUObject *)py_ue_new_edgraphpin(pin);
		if (item)
			PyList_Append(pins, (PyObject *)item);
	}
	return pins;
}

static PyMethodDef ue_PyEdGraphPin_methods[] = {
	{ "make_link_to", (PyCFunction)py_ue_edgraphpin_make_link_to, METH_VARARGS, "" },
	{ "break_link_to", (PyCFunction)py_ue_edgraphpin_break_link_to, METH_VARARGS, "" },
	{ "break_all_pin_links", (PyCFunction)py_ue_edgraphpin_break_all_pin_links, METH_VARARGS, "" },
	{ "get_linked_to", (PyCFunction)py_ue_edgraphpin_get_linked_to, METH_VARARGS, "" },
	{ "connect", (PyCFunction)py_ue_edgraphpin_connect, METH_VARARGS, "" },
	{ NULL }  /* Sentinel */
};

static PyObject *py_ue_edgraphpin_get_name(ue_PyEdGraphPin *self, void *closure)
{
#if ENGINE_MINOR_VERSION > 18
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinName.ToString())));
#else
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinName)));
#endif
}

static PyObject *py_ue_edgraphpin_get_category(ue_PyEdGraphPin *self, void *closure)
{
#if ENGINE_MINOR_VERSION > 18
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinCategory.ToString())));
#else
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinCategory)));
#endif
}

static PyObject *py_ue_edgraphpin_get_sub_category(ue_PyEdGraphPin *self, void *closure)
{
#if ENGINE_MINOR_VERSION > 18
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinSubCategory.ToString())));
#else
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinSubCategory)));
#endif
}

static PyObject *py_ue_edgraphpin_get_default_value(ue_PyEdGraphPin *self, void *closure)
{
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->DefaultValue)));
}

static int py_ue_edgraphpin_set_default_value(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value && PyUnicodeOrString_Check(value))
	{
		const char *str = UEPyUnicode_AsUTF8(value);
		self->pin->DefaultValue = UTF8_TO_TCHAR(str);
		return 0;
	}
	PyErr_SetString(PyExc_TypeError, "value is not a string");
	return -1;
}

static PyObject *py_ue_edgraphpin_get_default_text_value(ue_PyEdGraphPin *self, void *closure)
{
	return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->DefaultTextValue.ToString())));
}

static int py_ue_edgraphpin_set_default_text_value(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value && PyUnicodeOrString_Check(value))
	{
		const char *str = UEPyUnicode_AsUTF8(value);
		self->pin->DefaultTextValue = FText::FromString(UTF8_TO_TCHAR(str));
		return 0;
	}
	PyErr_SetString(PyExc_TypeError, "value is not a string");
	return -1;
}

static PyObject *py_ue_edgraphpin_get_default_object(ue_PyEdGraphPin *self, void *closure)
{
	UObject *u_object = self->pin->DefaultObject;
	if (!u_object)
	{
		Py_RETURN_NONE;
	}
	Py_RETURN_UOBJECT(u_object);
}

static int py_ue_edgraphpin_set_default_object(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value && ue_is_pyuobject(value))
	{
		ue_PyUObject *py_obj = (ue_PyUObject *)value;
		self->pin->DefaultObject = py_obj->ue_object;
		return 0;
	}
	PyErr_SetString(PyExc_TypeError, "value is not a UObject");
	return -1;
}

static int py_ue_edgraphpin_set_category(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value && PyUnicodeOrString_Check(value))
	{
		const char *str = UEPyUnicode_AsUTF8(value);
#if ENGINE_MINOR_VERSION > 18
		self->pin->PinType.PinCategory = FName(UTF8_TO_TCHAR(str));
#else
		self->pin->PinType.PinCategory = FString(UTF8_TO_TCHAR(str));
#endif
		return 0;
	}
	PyErr_SetString(PyExc_TypeError, "value is not a string");
	return -1;
}

static int py_ue_edgraphpin_set_sub_category(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value)
	{
		if (ue_is_pyuobject(value))
		{
			ue_PyUObject *py_obj = (ue_PyUObject *)value;
			self->pin->PinType.PinSubCategoryObject = py_obj->ue_object;
			return 0;
		}
		if (PyUnicodeOrString_Check(value))
		{
			const char *str = UEPyUnicode_AsUTF8(value);
#if ENGINE_MINOR_VERSION > 18
			self->pin->PinType.PinSubCategory = FName(UTF8_TO_TCHAR(str));
#else
			self->pin->PinType.PinSubCategory = FString(UTF8_TO_TCHAR(str));
#endif
			return 0;
		}
	}
	PyErr_SetString(PyExc_TypeError, "value is not a UObject");
	return -1;
}

static PyGetSetDef ue_PyEdGraphPin_getseters[] = {
	{ (char*)"name", (getter)py_ue_edgraphpin_get_name, NULL, (char *)"", NULL },
	{ (char*)"category", (getter)py_ue_edgraphpin_get_category, (setter)py_ue_edgraphpin_set_category, (char *)"", NULL },
	{ (char*)"sub_category", (getter)py_ue_edgraphpin_get_sub_category, (setter)py_ue_edgraphpin_set_sub_category, (char *)"", NULL },
	{ (char*)"default_value", (getter)py_ue_edgraphpin_get_default_value, (setter)py_ue_edgraphpin_set_default_value, (char *)"", NULL },
	{ (char*)"default_text_value", (getter)py_ue_edgraphpin_get_default_text_value, (setter)py_ue_edgraphpin_set_default_text_value, (char *)"", NULL },
	{ (char*)"default_object", (getter)py_ue_edgraphpin_get_default_object, (setter)py_ue_edgraphpin_set_default_object, (char *)"", NULL },
	{ NULL }  /* Sentinel */
};

static PyObject *ue_PyEdGraphPin_str(ue_PyEdGraphPin *self)
{
	return PyUnicode_FromFormat("<unreal_engine.EdGraphPin {'name': '%s', 'type': '%s'}>",
#if ENGINE_MINOR_VERSION > 18
		TCHAR_TO_UTF8(*self->pin->PinName.ToString()), TCHAR_TO_UTF8(*self->pin->PinType.PinCategory.ToString()));
#else
		TCHAR_TO_UTF8(*self->pin->PinName), TCHAR_TO_UTF8(*self->pin->PinType.PinCategory));
#endif
}

static PyTypeObject ue_PyEdGraphPinType = {
	PyVarObject_HEAD_INIT(NULL, 0)
	"unreal_engine.EdGraphPin", /* tp_name */
	sizeof(ue_PyEdGraphPin), /* tp_basicsize */
	0,                         /* tp_itemsize */
	0,       /* tp_dealloc */
	0,                         /* tp_print */
	0,                         /* tp_getattr */
	0,                         /* tp_setattr */
	0,                         /* tp_reserved */
	0,                         /* tp_repr */
	0,                         /* tp_as_number */
	0,                         /* tp_as_sequence */
	0,                         /* tp_as_mapping */
	0,                         /* tp_hash  */
	0,                         /* tp_call */
	(reprfunc)ue_PyEdGraphPin_str,                         /* tp_str */
	0,                         /* tp_getattro */
	0,                         /* tp_setattro */
	0,                         /* tp_as_buffer */
	Py_TPFLAGS_DEFAULT,        /* tp_flags */
	"Unreal Engine Editor GraphPin",           /* tp_doc */
	0,                         /* tp_traverse */
	0,                         /* tp_clear */
	0,                         /* tp_richcompare */
	0,                         /* tp_weaklistoffset */
	0,                         /* tp_iter */
	0,                         /* tp_iternext */
	ue_PyEdGraphPin_methods,             /* tp_methods */
	0,
	ue_PyEdGraphPin_getseters,
};

void ue_python_init_edgraphpin(PyObject *ue_module)
{
	ue_PyEdGraphPinType.tp_new = PyType_GenericNew;

	if (PyType_Ready(&ue_PyEdGraphPinType) < 0)
		return;

	Py_INCREF(&ue_PyEdGraphPinType);
	PyModule_AddObject(ue_module, "EdGraphPin", (PyObject *)&ue_PyEdGraphPinType);
}

PyObject *py_ue_new_edgraphpin(UEdGraphPin *pin)
{
	ue_PyEdGraphPin *ret = (ue_PyEdGraphPin *)PyObject_New(ue_PyEdGraphPin, &ue_PyEdGraphPinType);
	ret->pin = pin;
	return (PyObject *)ret;
}

ue_PyEdGraphPin *py_ue_is_edgraphpin(PyObject *obj)
{
	if (!PyObject_IsInstance(obj, (PyObject *)&ue_PyEdGraphPinType))
		return nullptr;
	return (ue_PyEdGraphPin *)obj;
}

#endif


text:
'use strict';

var proxyquire = require('proxyquire').noPreserveCache();

var userCtrlStub = {
  index: 'userCtrl.index',
  destroy: 'userCtrl.destroy',
  me: 'userCtrl.me',
  changePassword: 'userCtrl.changePassword',
  show: 'userCtrl.show',
  create: 'userCtrl.create',
  accept: 'userCtrl.accept',
  invite: 'userCtrl.invite',
  leaderboard: 'userCtrl.leaderboard'
};

var authServiceStub = {
  isAuthenticated: function() {
    return 'authService.isAuthenticated';
  },
  hasRole: function(role) {
    return 'authService.hasRole.' + role;
  }
};

var routerStub = {
  get: sinon.spy(),
  put: sinon.spy(),
  post: sinon.spy(),
  delete: sinon.spy()
};

// require the index with our stubbed out modules
var userIndex = proxyquire('./index', {
  'express': {
    Router: function() {
      return routerStub;
    }
  },
  './user.controller': userCtrlStub,
  '../../auth/auth.service': authServiceStub
});

describe('User API Router:', function() {

  it('should return an express router instance', function() {
    expect(userIndex).to.equal(routerStub);
  });

  describe('GET /api/users', function() {

    it('should verify admin role and route to user.controller.index', function() {
      expect(routerStub.get
        .withArgs('/', 'authService.hasRole.admin', 'userCtrl.index')
      ).to.have.been.calledOnce;
    });

  });

  describe('DELETE /api/users/:id', function() {

    it('should verify admin role and route to user.controller.destroy', function() {
      expect(routerStub.delete
        .withArgs('/:id', 'authService.hasRole.admin', 'userCtrl.destroy')
      ).to.have.been.calledOnce;
    });

  });

  describe('GET /api/users/me', function() {

    it('should be authenticated and route to user.controller.me', function() {
      expect(routerStub.get
        .withArgs('/me', 'authService.isAuthenticated', 'userCtrl.me')
      ).to.have.been.calledOnce;
    });

  });

  describe('PUT /api/users/:id/password', function() {

    it('should be authenticated and route to user.controller.changePassword', function() {
      expect(routerStub.put
        .withArgs('/:id/password', 'authService.isAuthenticated', 'userCtrl.changePassword')
      ).to.have.been.calledOnce;
    });

  });

  describe('POST /api/users', function() {

    it('should route to user.controller.create', function() {
      expect(routerStub.post
        .withArgs('/', 'userCtrl.create')
      ).to.have.been.calledOnce;
    });

  });

  describe('POST /api/users/accept', function() {

    it('should be authenticated and route to user.controller.accept', function() {
      expect(routerStub.post
        .withArgs('/accept', 'authService.isAuthenticated', 'userCtrl.accept')
      ).to.have.been.calledOnce;
    });

  });

  describe('POST /api/users/invite', function() {

    it('should be authenticated and route to user.controller.invite', function() {
      expect(routerStub.post
        .withArgs('/invite', 'authService.isAuthenticated', 'userCtrl.invite')
      ).to.have.been.calledOnce;
    });

  });

  describe('GET /api/users/leaderboard', function() {

    it('should be authenticated and route to user.controller.leaderboard', function() {
      expect(routerStub.get
        .withArgs('/leaderboard', 'authService.isAuthenticated', 'userCtrl.leaderboard')
      ).to.have.been.calledOnce;
    });

  });
});


text:
<?php

// Protect from unauthorized access
defined('_JEXEC') or die;

if (!class_exists('JFormFieldCheckbox'))
{
	require_once JPATH_LIBRARIES . '/joomla/form/fields/checkbox.php';
}

/**
 * Form Field class for the FOF framework
 * A single checkbox
 *
 * @package  FrameworkOnFramework
 * @since    2.0
 */
class FOFFormFieldCheckbox extends JFormFieldCheckbox implements FOFFormField
{
	protected $static;

	protected $repeatable;

	/** @var   FOFTable  The item being rendered in a repeatable form field */
	public $item;

	/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
	public $rowid;

	/**
	 * Method to get certain otherwise inaccessible properties from the form field object.
	 *
	 * @param   string  $name  The property name for which to the the value.
	 *
	 * @return  mixed  The property value or null.
	 *
	 * @since   2.0
	 */
	public function __get($name)
	{
		switch ($name)
		{
			case 'static':
				if (empty($this->static))
				{
					$this->static = $this->getStatic();
				}

				return $this->static;
				break;

			case 'repeatable':
				if (empty($this->repeatable))
				{
					$this->repeatable = $this->getRepeatable();
				}

				return $this->static;
				break;

			default:
				return parent::__get($name);
		}
	}

	/**
	 * Get the rendering of this field type for static display, e.g. in a single
	 * item view (typically a "read" task).
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getStatic()
	{
		$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$value = $this->element['value'] ? (string) $this->element['value'] : '1';
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$onclick = $this->element['onclick'] ? ' onclick="' . (string) $this->element['onclick'] . '"' : '';
		$required = $this->required ? ' required="required" aria-required="true"' : '';

		if (empty($this->value))
		{
			$checked = (isset($this->element['checked'])) ? ' checked="checked"' : '';
		}
		else
		{
			$checked = ' checked="checked"';
		}

		return 'id . '" ' . $class . '>' .
			'<input type="checkbox" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
			. htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $checked . $disabled . $onclick . $required . ' />' .
			'';
	}

	/**
	 * Get the rendering of this field type for a repeatable (grid) display,
	 * e.g. in a view listing many item (typically a "browse" task)
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getRepeatable()
	{
		$class = $this->element['class'] ? (string) $this->element['class'] : '';
		$value = $this->element['value'] ? (string) $this->element['value'] : '1';
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$onclick = $this->element['onclick'] ? ' onclick="' . (string) $this->element['onclick'] . '"' : '';
		$required = $this->required ? ' required="required" aria-required="true"' : '';

		if (empty($this->value))
		{
			$checked = (isset($this->element['checked'])) ? ' checked="checked"' : '';
		}
		else
		{
			$checked = ' checked="checked"';
		}

		return 'id . ' ' . $class . '">' .
			'<input type="checkbox" name="' . $this->name . '" class="' . $this->id . ' ' . $class . '"' . ' value="'
			. htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $disabled . $onclick . $required . ' />' .
			'';
	}
}


text:
package org.omg.CosNaming;

/**
* org/omg/CosNaming/BindingType.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u91/7017/corba/src/share/classes/org/omg/CosNaming/nameservice.idl
* Friday, May 20, 2016 5:44:09 PM PDT
*/

/**
   * Specifies whether the given binding is for a object (that is not a
   * naming context) or for a naming context.
   */
public class BindingType implements org.omg.CORBA.portable.IDLEntity
{
  private        int __value;
  private static int __size = 2;
  private static org.omg.CosNaming.BindingType[] __array = new org.omg.CosNaming.BindingType [__size];

  public static final int _nobject = 0;
  public static final org.omg.CosNaming.BindingType nobject = new org.omg.CosNaming.BindingType(_nobject);
  public static final int _ncontext = 1;
  public static final org.omg.CosNaming.BindingType ncontext = new org.omg.CosNaming.BindingType(_ncontext);

  public int value ()
  {
    return __value;
  }

  public static org.omg.CosNaming.BindingType from_int (int value)
  {
    if (value >= 0 && value < __size)
      return __array[value];
    else
      throw new org.omg.CORBA.BAD_PARAM ();
  }

  protected BindingType (int value)
  {
    __value = value;
    __array[__value] = this;
  }
} // class BindingType


text:
<resources>
    <string name="app_name">208. Google Map with Programming Zoom Controls</string>
</resources>


text:
#include <aws/kendra/model/DescribeQuerySuggestionsConfigResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::kendra::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeQuerySuggestionsConfigResult::DescribeQuerySuggestionsConfigResult() :
    m_mode(Mode::NOT_SET),
    m_status(QuerySuggestionsStatus::NOT_SET),
    m_queryLogLookBackWindowInDays(0),
    m_includeQueriesWithoutUserInformation(false),
    m_minimumNumberOfQueryingUsers(0),
    m_minimumQueryCount(0),
    m_totalSuggestionsCount(0)
{
}

DescribeQuerySuggestionsConfigResult::DescribeQuerySuggestionsConfigResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
    m_mode(Mode::NOT_SET),
    m_status(QuerySuggestionsStatus::NOT_SET),
    m_queryLogLookBackWindowInDays(0),
    m_includeQueriesWithoutUserInformation(false),
    m_minimumNumberOfQueryingUsers(0),
    m_minimumQueryCount(0),
    m_totalSuggestionsCount(0)
{
  *this = result;
}

DescribeQuerySuggestionsConfigResult& DescribeQuerySuggestionsConfigResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("Mode"))
  {
    m_mode = ModeMapper::GetModeForName(jsonValue.GetString("Mode"));

  }

  if(jsonValue.ValueExists("Status"))
  {
    m_status = QuerySuggestionsStatusMapper::GetQuerySuggestionsStatusForName(jsonValue.GetString("Status"));

  }

  if(jsonValue.ValueExists("QueryLogLookBackWindowInDays"))
  {
    m_queryLogLookBackWindowInDays = jsonValue.GetInteger("QueryLogLookBackWindowInDays");

  }

  if(jsonValue.ValueExists("IncludeQueriesWithoutUserInformation"))
  {
    m_includeQueriesWithoutUserInformation = jsonValue.GetBool("IncludeQueriesWithoutUserInformation");

  }

  if(jsonValue.ValueExists("MinimumNumberOfQueryingUsers"))
  {
    m_minimumNumberOfQueryingUsers = jsonValue.GetInteger("MinimumNumberOfQueryingUsers");

  }

  if(jsonValue.ValueExists("MinimumQueryCount"))
  {
    m_minimumQueryCount = jsonValue.GetInteger("MinimumQueryCount");

  }

  if(jsonValue.ValueExists("LastSuggestionsBuildTime"))
  {
    m_lastSuggestionsBuildTime = jsonValue.GetDouble("LastSuggestionsBuildTime");

  }

  if(jsonValue.ValueExists("LastClearTime"))
  {
    m_lastClearTime = jsonValue.GetDouble("LastClearTime");

  }

  if(jsonValue.ValueExists("TotalSuggestionsCount"))
  {
    m_totalSuggestionsCount = jsonValue.GetInteger("TotalSuggestionsCount");

  }

  return *this;
}


text:
// { "path" : "client/views/__viewName__/__viewName__.js" }

/**
 * Events in the scope of the template "login". Elements outside of this template won't be affected, even if the selector
 * is the same.
 */
Template.__viewName__.events({

    /**
     * Submit the login form. Attempt to login. If the login fails, change the button color to red (to indicate an error)
     * @param e
     */
    'submit #login-form': function(e) {
        e.preventDefault();

        // read values from form
        var email = $('#username').val();
        var password = $('#password').val();

        // show loading animation
        $('.fa-spinner').show();

        // login with local account
        Meteor.loginWithPassword(email, password, function(err) {
            if (err) {
                // login failed
                $('.fa-spinner').hide();
                $('#login-button').removeClass('btn-primary').addClass('btn-danger');
            }
            else {
                // login successful - the route will take care of the redirect
            }
        });
    },

    /**
     * If the user provides username / password, make sure that any previous error markers are removed.
     * @param e
     */
    'keyup input': function(e) {
        $('#login-button').removeClass('btn-danger').addClass('btn-primary');
    }
});


text:
require 'spec_helper'

describe Suspiciouss::Result::PlainText do

  let(:result) { {'filename.css' => ['error1']} }

  subject { described_class.new(result).format }

  describe '#format' do

    it { expect(subject).to eq "Check file filename.css for:\n error1\n" }
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fresco="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="@style/CardViewCustom"
    app:cardElevation="@dimen/card_elevation_static">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/ll_card_user"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:foreground="?attr/selectableItemBackground"
            android:orientation="vertical">

            <com.facebook.drawee.view.SimpleDraweeView
                android:id="@+id/simple_drawee_card_user_avatar"
                android:layout_width="@dimen/pin_detail_avatar_size"
                android:layout_height="@dimen/pin_detail_avatar_size"
                android:layout_gravity="center"
                android:layout_marginTop="@dimen/activity_vertical_margin"/>

            <TextView
                android:id="@+id/text_view_card_user_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:maxLines="1"
                android:ellipsize="marquee"
                android:padding="@dimen/activity_vertical_margin"
                android:textColor="@color/primary_text"
                android:textSize="@dimen/text_size_18sp"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/pin_detail_divider_height"
                android:background="@color/grey_a700"/>

            <TextView
                android:id="@+id/text_view_card_user_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:maxLines="1"
                android:ellipsize="marquee"
                android:padding="@dimen/half_activity_default_margin"
                android:textColor="@color/secondary_text"
                android:textSize="@dimen/text_size_16sp"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/pin_detail_divider_height"
                android:background="@color/grey_a700"/>

            <LinearLayout
                android:id="@+id/ll_card_user_thumbnails"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:padding="@dimen/thumbnail_padding"
                android:orientation="horizontal">

                <com.facebook.drawee.view.SimpleDraweeView
                    android:id="@+id/simple_drawee_view_card_user_thumbnail_first"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:padding="@dimen/thumbnail_padding"
                    fresco:viewAspectRatio="1.0"
                    fresco:failureImage="@drawable/ic_broken_image_grey_700_48dp"/>

                <com.facebook.drawee.view.SimpleDraweeView
                    android:id="@+id/simple_drawee_view_card_user_thumbnail_second"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:padding="@dimen/thumbnail_padding"
                    fresco:viewAspectRatio="1.0"
                    fresco:failureImage="@drawable/ic_broken_image_grey_700_48dp"/>

                <com.facebook.drawee.view.SimpleDraweeView
                    android:id="@+id/simple_drawee_view_card_user_thumbnail_third"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:padding="@dimen/thumbnail_padding"
                    fresco:viewAspectRatio="1.0"
                    fresco:failureImage="@drawable/ic_broken_image_grey_700_48dp"/>

            </LinearLayout>

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/pin_detail_divider_height"
            android:background="@color/grey_a700"/>

        <LinearLayout
            android:id="@+id/ll_card_user_operate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:foreground="?attr/selectableItemBackground"
            android:orientation="vertical">

            <TextView
                android:id="@+id/text_view_card_user_operate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:padding="@dimen/half_activity_default_margin"
                android:textColor="@color/secondary_text"
                android:textSize="@dimen/text_size_14sp"/>

        </LinearLayout>

    </LinearLayout>

</android.support.v7.widget.CardView>


text:
package thangiee.riotapi.matchhistory

case class ParticipantTimelineData(
  tenToTwenty: Double = 0,
  thirtyToEnd: Double = 0,
  twentyToThirty: Double = 0,
  zeroToTen: Double = 0
  )


text:
using System.Collections.Generic;
using System.Linq;
using Lix.Commons.Specifications;
using Lix.Commons.Testing;
using Lix.Commons.Tests.Examples;
using Lix.Commons.Tests.Examples.Specifications;
using MbUnit.Framework;
using Moq;

namespace Lix.Commons.Tests.Testing
{
    [TestFixture]
    public class SpecificationTestHelperTests
    {
        [Test]
        public void should_build_the_specification()
        {
            var specification = new Mock<FindFishWithIdSpecification>(1);

            specification.Setup(x => ((ISpecification<IQueryable<Fish>, IQueryable<Fish>>) x).Build());

            SpecificationTestHelper.Test(specification.Object, new List<Fish>());

            specification.Verify();
        }

        [Test]
        public void should_return_an_empty_result_when_the_specification_is_null()
        {
            var result = SpecificationTestHelper.Test(null, new List<Fish>());

            result.Count().ShouldBeEqualTo(0);
        }

        [Test]
        public void should_return_an_empty_result_when_the_source_data_is_null()
        {
            var result = SpecificationTestHelper.Test(new FindFishWithDescriptionSpecification("smelly"), null);

            result.Count().ShouldBeEqualTo(0);
        }
    }
}


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\ProyectoPresupuesto;
use AppBundle\Form\Type\ProyectoPresupuestoType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

/**
 * ProyectoPresupuesto controller.
 *
 * @Security("is_granted('ROLE_USER')")
 * @Route("/proyectopresupuesto")
 */
class ProyectoPresupuestoController extends Controller
{
    /**
     * Lists all ProyectoPresupuesto entities.
     *
     * @Route("/", name="proyectopresupuesto")
     * @Method("GET")
     * @Security("is_granted('ROLE_VER_PRESUPUESTOS')")
     * @Template("AppBundle:ProyectoPresupuesto:indexProyectoPresupuesto.html.twig")
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $discriminator = $this->container->get('pugx_user.manager.user_discriminator');
        $claseActual = $discriminator->getClass();
        $usuarioActual = $this->getUser();
        //mostrar todo en caso de ser socio
        //o ser El código 69, Ciro Salay.
        if ($claseActual == "UserBundle\Entity\UsuarioSocio" ||
          $usuarioActual->getCodigo()->getCodigo() === 69
          ) {
            $entities = $em->getRepository('AppBundle:ProyectoPresupuesto')->findAllFetch();

            return array(
            'entities' => $entities,
        );
        }
        //obtener solo los registros creados por el usuario

        $entities = $em
        ->getRepository('AppBundle:ProyectoPresupuesto')
        ->findBy(['creadoPor' => $usuarioActual->getCodigo()]);

        return ['entities' => $entities];
    }
    /**
     * Creates a new ProyectoPresupuesto entity.
     *
     * @Route("/", name="proyectopresupuesto_create")
     * @Method("POST")
     * @Security("is_granted('ROLE_CREAR_PRESUPUESTOS')")
     * @Template("AppBundle:ProyectoPresupuesto:newProyectoPresupuesto.html.twig")
     */
    public function createAction(Request $request)
    {
        $entity = new ProyectoPresupuesto();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

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

            if ($form->get('submitAndSave')->isClicked()) {
                return $this->redirectToRoute('proyectopresupuesto_new');
            }

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

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }

    /**
    * Change the state to finalized of a Presupuesto entity;
    *
    * @Route("/state/{id}", name="proyectopresupuesto_state")
    * @Method("GET")
    **/
    public function chageStateAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:ProyectoPresupuesto')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find ProyectoPresupuesto entity.');
        }
        $entity->finalizeState();
        $em->persist($entity);
        $em->flush();

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

    /**
     * Creates a form to create a ProyectoPresupuesto entity.
     *
     * @param ProyectoPresupuesto $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(ProyectoPresupuesto $entity)
    {
        $form = $this->createForm(ProyectoPresupuestoType::class, $entity, array(
            'action' => $this->generateUrl('proyectopresupuesto_create'),
            'method' => 'POST',
            'user' => $this->getUser()
        ));
        $form->add('submitAndSave', SubmitType::class, [
                    'label' => 'Guardar e ingresar otro',
                    'attr' => [
                        'class' => 'btn btn-primary btn-block',
                    ],
            ]);
        $form->add('submit', SubmitType::class, [
                    'label' => 'Guardar y ver detalle',
                    'attr' => [
                        'class' => 'btn btn-primary btn-block',
                    ],
            ]);

        return $form;
    }

    /**
     * Displays a form to create a new ProyectoPresupuesto entity.
     *
     * @Route("/new", name="proyectopresupuesto_new")
     * @Method("GET")
     * @Security("is_granted('ROLE_CREAR_PRESUPUESTOS')")
     * @Template("AppBundle:ProyectoPresupuesto:newProyectoPresupuesto.html.twig")
     */
    public function newAction()
    {
        $entity = new ProyectoPresupuesto();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }

    /**
     * Finds and displays a ProyectoPresupuesto entity.
     *
     * @Route("/{id}", name="proyectopresupuesto_show")
     * @Method("GET")
     * @Template("AppBundle:ProyectoPresupuesto:showProyectoPresupuesto.html.twig")
     * @Security("is_granted('ROLE_VER_PRESUPUESTOS')")
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:ProyectoPresupuesto')->find($id);

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

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

        return array(
            'entity' => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Displays a form to edit an existing ProyectoPresupuesto entity.
     *
     * @Route("/{id}/edit", name="proyectopresupuesto_edit")
     * @Method("GET")
     * @Template("AppBundle:ProyectoPresupuesto:editProyectoPresupuesto.html.twig")
     * @Security("is_granted('ROLE_EDITAR_PRESUPUESTO')")
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:ProyectoPresupuesto')->find($id);

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

        if ($entity->getEstado() === 'FINALIZADO') {
            throw $this->createNotFoundException('Trying to edit finalized ProyectoPresupuesto Entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity' => $entity,
            'editable' => $entity->getEstado() === 'FINALIZADO' ? false: true,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Creates a form to edit a ProyectoPresupuesto entity.
     *
     * @param ProyectoPresupuesto $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createEditForm(ProyectoPresupuesto $entity)
    {
        $form = $this->createForm(ProyectoPresupuestoType::class, $entity, array(
            'action' => $this->generateUrl('proyectopresupuesto_update', array('id' => $entity->getId())),
            'method' => 'PUT',
            'user' => $this->getUser()
        ));
        if ($entity->getEstado() !== 'FINALIZADO') {
            $form->add('submit', SubmitType::class, array('label' => 'Update'));
        }

        return $form;
    }
    /**
     * Edits an existing ProyectoPresupuesto entity.
     *
     * @Route("/{id}", name="proyectopresupuesto_update")
     * @Method("PUT")
     * @Security("is_granted('ROLE_EDITAR_PRESUPUESTO')")
     * @Template("AppBundle:ProyectoPresupuesto:editProyectoPresupuesto.html.twig")
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:ProyectoPresupuesto')->find($id);

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

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

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

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

        return array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
    /**
     * Deletes a ProyectoPresupuesto entity.
     *
     * @Route("/{id}", name="proyectopresupuesto_delete")
     * @Security("is_granted('ROLE_ELIMINAR_PRESUPUESTOS')")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

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

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

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

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

    /**
     * Creates a form to delete a ProyectoPresupuesto entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('proyectopresupuesto_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', SubmitType::class, array('label' => 'Delete', 'attr' => array('class' => 'hide-submit')))
            ->getForm()
        ;
    }
}