text:
/*
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package org.drools.camel.component;

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

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.DataFormatDefinition;
import org.drools.command.impl.GenericCommand;
import org.drools.command.runtime.BatchExecutionCommandImpl;
import org.drools.command.runtime.rule.InsertObjectCommand;
import org.drools.common.InternalFactHandle;
import org.drools.pipeline.camel.Person;
import org.drools.runtime.ExecutionResults;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.help.BatchExecutionHelper;
import org.drools.runtime.rule.FactHandle;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class CamelEndpointWithMarshallersTest extends DroolsCamelTestSupport {
    private String handle;

    @Test
    public void testSimple() {
    }

    @Test
    public void testSessionInsert() throws Exception {

        String cmd = "";
        cmd += "<batch-execution lookup=\"ksession1\">\n";
        cmd += "  <insert out-identifier=\"salaboy\">\n";
        cmd += "      <org.drools.pipeline.camel.Person>\n";
        cmd += "         <name>salaboy</name>\n";
        cmd += "      </org.drools.pipeline.camel.Person>\n";
        cmd += "   </insert>\n";
        cmd += "   <fire-all-rules/>\n";
        cmd += "</batch-execution>\n";

        String outXml = new String( (byte[]) template.requestBody( "direct:test-with-session",
                                                                   cmd ) );

        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
        Person person = (Person) result.getValue( "salaboy" );
        assertEquals( "salaboy",
                      person.getName() );

        String expectedXml = "";
        expectedXml += "<?xml version='1.0' encoding='UTF-8'?><execution-results>";
        expectedXml += "<result identifier=\"salaboy\">";
        expectedXml += "<org.drools.pipeline.camel.Person>";
        expectedXml += "<name>salaboy</name>";
        expectedXml += "</org.drools.pipeline.camel.Person>";
        expectedXml += "</result>";
        expectedXml += "<fact-handle identifier=\"salaboy\" external-form=\"" + ((InternalFactHandle) result.getFactHandle( "salaboy" )).toExternalForm() + "\"/>";
        expectedXml += "</execution-results>";

        assertXMLEqual( expectedXml,
                        outXml );

    }

    @Test
    public void testJSonSessionInsert() throws Exception {

        String inXml = "";
        inXml += "{\"batch-execution\":{\"commands\":[";
        inXml += "{\"insert\":{\"lookup\":\"ksession1\", ";
        inXml += "             \"object\":{\"org.drools.pipeline.camel.Person\":{\"name\":\"salaboy\"}}, \"out-identifier\":\"salaboy\" } }";
        inXml += ", {\"fire-all-rules\":\"\"}";
        inXml += "]}}";

        String outXml = new String( (byte[]) template.requestBody( "direct:test-with-session-json",
                                                                   inXml ) );

        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newJSonMarshaller().fromXML( outXml );
        Person person = (Person) result.getValue( "salaboy" );
        assertEquals( "salaboy",
                      person.getName() );
    }

    @Test
    public void testNoSessionInsert() throws Exception {

        String cmd = "";
        cmd += "<batch-execution lookup=\"ksession1\">\n";
        cmd += "<insert out-identifier=\"salaboy\">\n";
        cmd += "<org.drools.pipeline.camel.Person>\n";
        cmd += "<name>salaboy</name>\n";
        cmd += "</org.drools.pipeline.camel.Person>\n";
        cmd += "</insert>\n";
        cmd += "<fire-all-rules/>\n";
        cmd += "</batch-execution>\n";

        String outXml = new String( (byte[]) template.requestBody( "direct:test-no-session",
                                                                   cmd ) );

        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
        Person person = (Person) result.getValue( "salaboy" );
        assertEquals( "salaboy",
                      person.getName() );

        String expectedXml = "";
        expectedXml += "<?xml version='1.0' encoding='UTF-8'?><execution-results>";
        expectedXml += "<result identifier=\"salaboy\">";
        expectedXml += "<org.drools.pipeline.camel.Person>";
        expectedXml += "<name>salaboy</name>";
        expectedXml += "</org.drools.pipeline.camel.Person>";
        expectedXml += "</result>";
        expectedXml += "<fact-handle identifier=\"salaboy\" external-form=\"" + ((InternalFactHandle) result.getFactHandle( "salaboy" )).toExternalForm() + "\"/>";
        expectedXml += "</execution-results>";

        assertXMLEqual( expectedXml,
                        outXml );
    }

    @Test
    public void testNoSessionInsertCustomXstream() throws Exception {

        String cmd = "";
        cmd += "<batch-execution lookup=\"ksession1\">\n";
        cmd += "<insert out-identifier=\"salaboy\">\n";
        cmd += "<org.drools.pipeline.camel.Person name=\"salaboy\">\n";
        cmd += "</org.drools.pipeline.camel.Person>\n";
        cmd += "</insert>\n";
        cmd += "<fire-all-rules/>\n";
        cmd += "</batch-execution>\n";

        String outXml = new String( (byte[]) template.requestBody( "direct:test-no-session-custom",
                                                                   cmd ) );

        XStream xstream = BatchExecutionHelper.newXStreamMarshaller();
        PersonConverter converter = new PersonConverter();
        xstream.registerConverter( converter );

        ExecutionResults result = (ExecutionResults) xstream.fromXML( outXml );
        Person person = (Person) result.getValue( "salaboy" );
        assertEquals( "salaboy",
                      person.getName() );

        String expectedXml = "";
        expectedXml += "<?xml version='1.0' encoding='UTF-8'?><execution-results>";
        expectedXml += "<result identifier=\"salaboy\">";
        expectedXml += "<org.drools.pipeline.camel.Person name=\"salaboy\"/>";
        expectedXml += "</result>";
        expectedXml += "<fact-handle identifier=\"salaboy\" external-form=\"" + ((InternalFactHandle) result.getFactHandle( "salaboy" )).toExternalForm() + "\"/>";
        expectedXml += "</execution-results>";

        assertXMLEqual( expectedXml,
                        outXml );
    }

    @Test
    public void testSessionGetObject() throws Exception {
        String cmd = "";
        cmd += "<batch-execution lookup=\"ksession1\">\n";
        cmd += "<get-object out-identifier=\"rider\" fact-handle=\"" + this.handle + "\"/>\n";
        cmd += "</batch-execution>\n";

        String outXml = new String( (byte[]) template.requestBody( "direct:test-with-session",
                                                                   cmd ) );

        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
        Person person = (Person) result.getValue( "rider" );
        assertEquals( "Hadrian",
                      person.getName() );

        String expectedXml = "";
        expectedXml += "<?xml version='1.0' encoding='UTF-8'?><execution-results>";
        expectedXml += "<result identifier=\"rider\">";
        expectedXml += "<org.drools.pipeline.camel.Person>";
        expectedXml += "<name>Hadrian</name>";
        expectedXml += "</org.drools.pipeline.camel.Person>";
        expectedXml += "</result>";
        expectedXml += "</execution-results>";

        assertXMLEqual( expectedXml,
                        outXml );

    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                org.apache.camel.model.dataformat.XStreamDataFormat xstreamDataFormat = new org.apache.camel.model.dataformat.XStreamDataFormat();
                xstreamDataFormat.setConverters( Arrays.asList( new String[]{PersonConverter.class.getName()} ) );

                Map<String, DataFormatDefinition> dataFormats = new HashMap<String, DataFormatDefinition>();
                dataFormats.put( "custom-xstream",
                                 xstreamDataFormat );
                getContext().setDataFormats( dataFormats );

                from( "direct:test-with-session" ).policy( new DroolsPolicy() ).unmarshal( "xstream" ).to( "drools:node/ksession1" ).marshal( "xstream" );
                from( "direct:test-with-session-json" ).policy( new DroolsPolicy() ).unmarshal( "json" ).to( "drools:node/ksession1" ).marshal( "json" );
                from( "direct:test-no-session" ).policy( new DroolsPolicy() ).unmarshal( "xstream" ).to( "drools:node" ).marshal( "xstream" );
                from( "direct:test-no-session-custom" ).policy( new DroolsPolicy() ).unmarshal( "custom-xstream" ).to( "drools:node" ).marshal( "custom-xstream" );
            }
        };
    }

    @Override
    protected void configureDroolsContext(javax.naming.Context jndiContext) {
        Person me = new Person();
        me.setName( "Hadrian" );

        StatefulKnowledgeSession ksession = registerKnowledgeRuntime( "ksession1",
                                                                      null );
        InsertObjectCommand cmd = new InsertObjectCommand( me );
        cmd.setOutIdentifier( "camel-rider" );
        cmd.setReturnObject( false );

        BatchExecutionCommandImpl script = new BatchExecutionCommandImpl( Arrays.asList( new GenericCommand< ? >[]{cmd} ) );

        ExecutionResults results = ksession.execute( script );
        handle = ((FactHandle) results.getFactHandle( "camel-rider" )).toExternalForm();

    }

    public static class PersonConverter
        implements
        Converter {

        public PersonConverter() {
        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            Person p = (Person) object;
            writer.addAttribute( "name",
                                 p.getName() );
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            Person p = new Person( reader.getAttribute( "name" ) );
            return p;
        }

        public boolean canConvert(Class clazz) {
            return clazz.equals( Person.class );
        }
    }
}


text:
<?php
return [
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=sr',
            'username' => 'sr',
            'password' => 'sr',
            'charset' => 'utf8',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
             'rules' => [
                '<controller:(holidays|comment)>/<action:(update|delete)>/<id:\d+>/' => '<controller>/<action>',
                '<controller:(holidays|comment)>/<action:(index|create)>/' => '<controller>/<action>',
                '<controller:(holidays|comment)>/<slug:[a-z0-9-_]+>' => '<controller>/view',
                '<module:\w+>/<controller:\w+>/<action:(\w|-)+>' => '<module>/<controller>/<action>',
                '<module:\w+>/<controller:\w+>/<action:(\w|-)+>/<id:\d+>' => '<module>/<controller>/<action>',
            ]
        ],
       'authManager' => [
          'class' => 'yii\rbac\DbManager',
        ],
        'formatter' => [
            'class' => 'yii\i18n\Formatter',
            'dateFormat' => 'long',
            'datetimeFormat' => 'long',
            'defaultTimeZone' => 'Europe/Moscow',
            'timeZone' => 'Europe/Moscow'
        ],
    ],
    'language'=>'ru-RU',
    'aliases' => [
        '@frontweb' => 'http://sr', // ссылка на веб страницу фронта
    ],
    'modules' => [
        'yii2images' => [
            'class' => 'rico\yii2images\Module',
            //be sure, that permissions ok
            //if you cant avoid permission errors you have to create "images" folder in web root manually and set 777 permissions
            'imagesStorePath' => '@frontend/web/images/store', //path to origin images
            'imagesCachePath' => '@frontend/web/images/cache', //path to resized copies
            'graphicsLibrary' => 'GD', //but really its better to use 'Imagick'
            'placeHolderPath' => '@webroot/images/placeHolder.png', // if you want to get placeholder when image not exists, string will be processed by Yii::getAlias
        ],
    ],
    'controllerMap' => [
        'sort' => [
                    'class' => 'arogachev\sortable\controllers\SortController',
                ],
    ],
];

redpajama_set_name: RedPajamaGithub


text:
import {Injector} from '../di/injector';
import {assertLContainer} from '../render3/assert';
import {createLView, renderView} from '../render3/instructions/shared';
import {TContainerNode, TNode, TNodeType} from '../render3/interfaces/node';
import {DECLARATION_LCONTAINER, LView, LViewFlags, QUERIES, TView} from '../render3/interfaces/view';
import {getCurrentTNode, getLView} from '../render3/state';
import {ViewRef as R3_ViewRef} from '../render3/view_ref';
import {assertDefined} from '../util/assert';

import {createElementRef, ElementRef} from './element_ref';
import {EmbeddedViewRef} from './view_ref';

/**
 * Represents an embedded template that can be used to instantiate embedded views.
 * To instantiate embedded views based on a template, use the `ViewContainerRef`
 * method `createEmbeddedView()`.
 *
 * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`
 * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view
 * is injected into the constructor of the directive,
 * using the `TemplateRef` token.
 *
 * You can also use a `Query` to find a `TemplateRef` associated with
 * a component or a directive.
 *
 * @see `ViewContainerRef`
 * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)
 *
 * @publicApi
 */
export abstract class TemplateRef<C> {
  /**
   * The anchor element in the parent view for this embedded view.
   *
   * The data-binding and injection contexts of embedded views created from this `TemplateRef`
   * inherit from the contexts of this location.
   *
   * Typically new embedded views are attached to the view container of this location, but in
   * advanced use-cases, the view can be attached to a different container while keeping the
   * data-binding and injection context from the original location.
   *
   */
  // TODO(i): rename to anchor or location
  abstract readonly elementRef: ElementRef;

  /**
   * Instantiates an unattached embedded view based on this template.
   * @param context The data-binding context of the embedded view, as declared
   * in the `<ng-template>` usage.
   * @param injector Injector to be used within the embedded view.
   * @returns The new embedded view object.
   */
  abstract createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;

  /**
   * @internal
   * @nocollapse
   */
  static __NG_ELEMENT_ID__: () => TemplateRef<any>| null = injectTemplateRef;
}

const ViewEngineTemplateRef = TemplateRef;

// TODO(alxhub): combine interface and implementation. Currently this is challenging since something
// in g3 depends on them being separate.
const R3TemplateRef = class TemplateRef<T> extends ViewEngineTemplateRef<T> {
  constructor(
      private _declarationLView: LView, private _declarationTContainer: TContainerNode,
      public override elementRef: ElementRef) {
    super();
  }

  override createEmbeddedView(context: T, injector?: Injector): EmbeddedViewRef<T> {
    const embeddedTView = this._declarationTContainer.tViews as TView;
    const embeddedLView = createLView(
        this._declarationLView, embeddedTView, context, LViewFlags.CheckAlways, null,
        embeddedTView.declTNode, null, null, null, null, injector || null);

    const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
    ngDevMode && assertLContainer(declarationLContainer);
    embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;

    const declarationViewLQueries = this._declarationLView[QUERIES];
    if (declarationViewLQueries !== null) {
      embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);
    }

    renderView(embeddedTView, embeddedLView, context);

    return new R3_ViewRef<T>(embeddedLView);
  }
};

/**
 * Creates a TemplateRef given a node.
 *
 * @returns The TemplateRef instance to use
 */
export function injectTemplateRef<T>(): TemplateRef<T>|null {
  return createTemplateRef<T>(getCurrentTNode()!, getLView());
}

/**
 * Creates a TemplateRef and stores it on the injector.
 *
 * @param hostTNode The node on which a TemplateRef is requested
 * @param hostLView The `LView` to which the node belongs
 * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type
 */
export function createTemplateRef<T>(hostTNode: TNode, hostLView: LView): TemplateRef<T>|null {
  if (hostTNode.type & TNodeType.Container) {
    ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
    return new R3TemplateRef(
        hostLView, hostTNode as TContainerNode, createElementRef(hostTNode, hostLView));
  }
  return null;
}


text:
<?php

return array(
	'secret' => array(
		//put your app id and secret
								'appId'  => 'appId',
						  	'secret' => 'secret'
							),
	//Redirect after successfull login
	'redirect' => 'YourSiteURL',
	//When Someone Logout from your Site
	'logout' => 'LogoutPageUrl',
	//you can add scope according to your requirement
	'scope' => 'user_birthday,email,user_hometown,user_location,user_status,user_photos,user_likes,user_education_history'
	);


text:
package com.facebook.buck.util.versioncontrol;

import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;

import com.google.common.collect.ImmutableSet;
import java.util.Optional;
import org.junit.Test;

public class VersionControlStatsGeneratorTest {

  private final FullVersionControlStats expected =
      FullVersionControlStats.builder()
          .setCurrentRevisionId("f00")
          .setBranchedFromMasterRevisionId("b47")
          .setBranchedFromMasterTS(0L)
          .setBaseBookmarks(ImmutableSet.of("remote/master"))
          .setDiff("this is not really a valid diff but whatever")
          .setPathsChangedInWorkingDirectory(ImmutableSet.of("hello.txt"))
          .build();

  private final VersionControlCmdLineInterface versionControlCmdLineInterface =
      new FakeVersionControlCmdLineInterface(expected);

  @Test
  public void fastModeGeneratesBasicStats() throws Exception {
    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty())
            .generateStats(VersionControlStatsGenerator.Mode.FAST);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(actual.get().getCurrentRevisionId(), is(equalTo(expected.getCurrentRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterRevisionId(),
        is(equalTo(expected.getBranchedFromMasterRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterTS(), is(equalTo(expected.getBranchedFromMasterTS())));
    assertThat(actual.get().getBaseBookmarks(), is(equalTo(expected.getBaseBookmarks())));
  }

  @Test
  public void fastModeDoesNotGenerateChangedFilesAndDiff() throws Exception {
    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty())
            .generateStats(VersionControlStatsGenerator.Mode.FAST);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(actual.get().getPathsChangedInWorkingDirectory(), is(empty()));
    assertThat(actual.get().getDiff().isPresent(), is(equalTo(false)));
  }

  @Test
  public void fullModeGeneratesChangedFilesAndDiff() throws Exception {
    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty())
            .generateStats(VersionControlStatsGenerator.Mode.FULL);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(
        actual.get().getPathsChangedInWorkingDirectory(),
        is(equalTo(expected.getPathsChangedInWorkingDirectory())));
    assertThat(actual.get().getDiff(), is(equalTo(expected.getDiff())));
  }

  @Test
  public void fastModeDoesNotReturnChangedFilesAndDiffIfTheyAreGenerated() throws Exception {
    VersionControlStatsGenerator versionControlStatsGenerator =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty());
    versionControlStatsGenerator.generateStats(VersionControlStatsGenerator.Mode.FULL);
    Optional<FullVersionControlStats> actual =
        versionControlStatsGenerator.generateStats(VersionControlStatsGenerator.Mode.FAST);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(actual.get().getPathsChangedInWorkingDirectory(), is(empty()));
    assertThat(actual.get().getDiff().isPresent(), is(equalTo(false)));
  }

  @Test
  public void pregeneratedModeDoesNotGenerateStats() throws Exception {
    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty())
            .generateStats(VersionControlStatsGenerator.Mode.PREGENERATED);
    assertThat(actual.isPresent(), is(equalTo(false)));
  }

  @Test
  public void pregeneratedDoesNotReturnStatsIfTheyAreGenerated() throws Exception {
    VersionControlStatsGenerator versionControlStatsGenerator =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.empty());
    versionControlStatsGenerator.generateStats(VersionControlStatsGenerator.Mode.FAST);
    Optional<FullVersionControlStats> actual =
        versionControlStatsGenerator.generateStats(VersionControlStatsGenerator.Mode.PREGENERATED);
    assertThat(actual.isPresent(), is(equalTo(false)));
  }

  @Test
  public void pregeneratedModeReturnsStats() throws Exception {
    FastVersionControlStats pregenerated =
        FastVersionControlStats.of(
            expected.getCurrentRevisionId(),
            expected.getBaseBookmarks(),
            expected.getBranchedFromMasterRevisionId(),
            expected.getBranchedFromMasterTS());

    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.of(pregenerated))
            .generateStats(VersionControlStatsGenerator.Mode.PREGENERATED);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(actual.get().getCurrentRevisionId(), is(equalTo(expected.getCurrentRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterRevisionId(),
        is(equalTo(expected.getBranchedFromMasterRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterTS(), is(equalTo(expected.getBranchedFromMasterTS())));
    assertThat(actual.get().getBaseBookmarks(), is(equalTo(expected.getBaseBookmarks())));
  }

  @Test
  public void pregeneratedStatsHavePrecedence() throws Exception {
    FastVersionControlStats pregenerated =
        FastVersionControlStats.of("cafe", ImmutableSet.of("remote/master"), "babe", 1L);
    Optional<FullVersionControlStats> actual =
        new VersionControlStatsGenerator(versionControlCmdLineInterface, Optional.of(pregenerated))
            .generateStats(VersionControlStatsGenerator.Mode.FULL);
    assertThat(actual.isPresent(), is(equalTo(true)));
    assertThat(
        actual.get().getCurrentRevisionId(), is(not(equalTo(expected.getCurrentRevisionId()))));
    assertThat(
        actual.get().getCurrentRevisionId(), is(equalTo(pregenerated.getCurrentRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterRevisionId(),
        is(not(equalTo(expected.getBranchedFromMasterRevisionId()))));
    assertThat(
        actual.get().getBranchedFromMasterRevisionId(),
        is(equalTo(pregenerated.getBranchedFromMasterRevisionId())));
    assertThat(
        actual.get().getBranchedFromMasterTS(),
        is(not(equalTo(expected.getBranchedFromMasterTS()))));
    assertThat(actual.get().getBaseBookmarks(), is(equalTo(pregenerated.getBaseBookmarks())));
  }
}


text:
package com.example.lang.generic;

import com.example.lang.generic.Tree.Util;

import junit.framework.TestCase;

public class TreeTest extends TestCase {

    public void testSum() {
        Tree<Integer> x = new Tree<Integer>(1);
        Tree<Integer> y = new Tree<Integer>(2);
        Tree<? extends Number> z = Tree.max(x, y);
        double sum = Tree.sum(z);
        assertEquals(2.0, sum);
    }

    public void testUtil() {
        Boolean[] booleans = Util.fill(new Boolean[100], Boolean.TRUE);
        System.out.println(booleans.length);
        Number[] numbers = Util.fill(new Number[5], new Integer(42));
        System.out.println(numbers.length);
    }
}


text:
function Gfull = nodeGraphToCliqueGraph(G, Tfac)
%% Expand a node graph into a clique graph
% We assume that the input G is the node toplogy, that the first
% size(G, 1) factors in Tfac are node factors, and that the remaining
% factors are edge factors.
%%

% This file is from pmtk3.googlecode.com

G = mkSymmetric(G);
nfacs = numel(Tfac);
nvars = size(G, 1);
Gfull = zeros(nfacs, nfacs);
Gfull(1:nvars, 1:nvars) = G;
edgeFacs = Tfac(nvars+1:end);
for i=1:numel(edgeFacs)
    fac = edgeFacs{i};
    j = nvars+i;
    dom = fac.domain;
    Gfull(j, dom) = 1;
    Gfull(dom, j) = 1;
end
end


text:
stderr_path "/var/log/unicorn/unicorn_errbit.log"
stdout_path "/var/log/unicorn/unicorn_errbit.log"

listen "/var/run/unicorn/unicorn_errbit.sock"

pid "/home/ojajip/errbit/shared/pids/unicorn.pid"

worker_processes 3 # amount of unicorn workers to spin up
timeout 30         # restarts workers that hang for 30 seconds
preload_app true

# Taken from github: https://github.com/blog/517-unicorn
# Though everyone uses pretty miuch the same code
before_fork do |server, worker|
  ##
  # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and
  # immediately start loading up a new version of itself (loaded with a new
  # version of our app). When this new Unicorn is completely loaded
  # it will begin spawning workers. The first worker spawned will check to
  # see if an .oldbin pidfile exists. If so, this means we've just booted up
  # a new Unicorn and need to tell the old one that it can now die. To do so
  # we send it a QUIT.
  #
  # Using this method we get 0 downtime deploys.

  old_pid = "#{server.config[:pid]}.oldbin"
  if File.exists?(old_pid) && server.pid != old_pid
    begin
      Process.kill("QUIT", File.read(old_pid).to_i)
    rescue Errno::ENOENT, Errno::ESRCH
      # someone else did our job for us
    end
  end
end


text:
$(function() {
    'use strict';

    $('.image-url-generator').each(function() {
        var $this = $(this);
        var $form = $this.find('form');
        var $filterMethodField = $form.find('select#id_filter_method');
        var $widthField = $form.find('input#id_width');
        var $heightField = $form.find('input#id_height');
        var $closenessField = $form.find('input#id_closeness');
        var $result = $this.find('#result-url');
        var $loadingMask = $this.find('.loading-mask')
        var $preview = $this.find('img.preview');
        var $sizeNote = $('#note-size')

        var generatorUrl = $this.data('generatorUrl');

        function formChangeHandler() {
            var filterSpec = $filterMethodField.val();

            $loadingMask.addClass('loading');

            if (filterSpec == 'original') {
                $widthField.prop('disabled', true);
                $heightField.prop('disabled', true);
                $closenessField.prop('disabled', true);
            } else if (filterSpec == 'width') {
                $widthField.prop('disabled', false);
                $heightField.prop('disabled', true);
                $closenessField.prop('disabled', true);
                filterSpec += '-' + $widthField.val();
            } else if (filterSpec == 'height') {
                $widthField.prop('disabled', true);
                $heightField.prop('disabled', false);
                $closenessField.prop('disabled', true);
                filterSpec += '-' + $heightField.val();
            } else if (filterSpec == 'min' || filterSpec == 'max' || filterSpec == 'fill') {
                $widthField.prop('disabled', false);
                $heightField.prop('disabled', false);

                if (filterSpec == 'fill') {
                    $closenessField.prop('disabled', false);
                    filterSpec += '-' + $widthField.val() + 'x' + $heightField.val() + '-c' + $closenessField.val();
                } else {
                    $closenessField.prop('disabled', true);
                    filterSpec += '-' + $widthField.val() + 'x' + $heightField.val();
                }
            }

            // Display note about scaled down images if image is large
            if ($widthField.val() > $(window).width()) {
                $sizeNote.show();
            } else {
                $sizeNote.hide();
            }

            // Fields with width and height
            $.getJSON(generatorUrl.replace('__filterspec__', filterSpec))
                .done(function(data) {
                    $result.val(data.url);
                    $preview.attr('src', data.preview_url);
                    $loadingMask.removeClass('loading');
                })
                .fail(function(data) {
                    $result.val(data.responseJSON.error);
                    $preview.attr('src', '');
                    $loadingMask.removeClass('loading');
                });
        }

        $form.on('change', $.debounce(500, formChangeHandler));
        $form.on('keyup', $.debounce(500, formChangeHandler));
        formChangeHandler();

        // When the user clicks the URL, automatically select the whole thing (for easier copying)
        $result.on('click', function() {
            $(this).trigger('select');
        });
    });
});


text:
package com.meetisan.meetisan.model;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.meetisan.meetisan.R;
import com.meetisan.meetisan.utils.HttpBitmap;
import com.meetisan.meetisan.widget.CircleImageView;

public class TagCategoryAdapter extends BaseAdapter {

	private LayoutInflater inflater;
	private List<TagCategory> categoryData;
	private HttpBitmap httpBitmap;

	// private onRightItemClickListener mListener = null;

	public TagCategoryAdapter(Context mContext, List<TagCategory> categoryData) {
		inflater = LayoutInflater.from(mContext);
		this.categoryData = categoryData;
		httpBitmap = new HttpBitmap(mContext);
	}

	@Override
	public int getCount() {
		return categoryData.size();
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {

		final ViewHolder holder;
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.item_listview_tags_category, parent, false);
			holder = new ViewHolder();
			holder.mLeftItem = (RelativeLayout) convertView.findViewById(R.id.item_left);
			holder.mRightItem = (RelativeLayout) convertView.findViewById(R.id.item_right);
			holder.mPortraitView = (CircleImageView) convertView.findViewById(R.id.iv_portrait);
			holder.mNameTxt = (TextView) convertView.findViewById(R.id.txt_name);
			holder.mOneTxt = (TextView) convertView.findViewById(R.id.txt_tag_one);
			holder.mTwoTxt = (TextView) convertView.findViewById(R.id.txt_tag_two);
			holder.mThreeTxt = (TextView) convertView.findViewById(R.id.txt_tag_three);

			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}

		TagCategory mTagCategory = categoryData.get(position);

		holder.mNameTxt.setText(mTagCategory.getTitle());
		holder.mPortraitView.setImageResource(R.drawable.portrait_tag_default);
		if (mTagCategory.getLogoUri() != null) {
			httpBitmap.displayBitmap(holder.mPortraitView, mTagCategory.getLogoUri());
		}

		List<TagInfo> tagsList = mTagCategory.getTags();
		int tagsCount = tagsList.size();
		if (tagsCount >= 1) {
			holder.mOneTxt.setText(tagsList.get(0).getTitle());
			holder.mOneTxt.setVisibility(View.VISIBLE);
		}
		if (tagsCount >= 2) {
			holder.mTwoTxt.setText(tagsList.get(1).getTitle());
			holder.mTwoTxt.setVisibility(View.VISIBLE);
		}
		if (tagsCount >= 3) {
			holder.mThreeTxt.setText(tagsList.get(2).getTitle());
			holder.mThreeTxt.setVisibility(View.VISIBLE);
		}

		// holder.mRightItem.setOnClickListener(new OnClickListener() {
		// public void onClick(View v) {
		// holder.mRightItem.setVisibility(View.GONE);
		// categoryData.remove(position); // remove list item
		// if (mListener != null) {
		// mListener.onRightItemClick(holder.mRightItem, position);
		// }
		// notifyDataSetChanged();
		// }
		// });
		return convertView;
	}

	static class ViewHolder {
		RelativeLayout mLeftItem;
		RelativeLayout mRightItem;
		CircleImageView mPortraitView;
		TextView mNameTxt;
		TextView mOneTxt;
		TextView mTwoTxt;
		TextView mThreeTxt;
	}

	// public void setOnRightItemClickListener(onRightItemClickListener
	// listener) {
	// mListener = listener;
	// }
	//
	// public interface onRightItemClickListener {
	// void onRightItemClick(View view, int position);
	// }
}


text:
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 __());
};
var Subscriber_1 = require('../../Subscriber');
function isEmpty() {
    return this.lift(new IsEmptyOperator());
}
exports.isEmpty = isEmpty;
var IsEmptyOperator = (function () {
    function IsEmptyOperator() {
    }
    IsEmptyOperator.prototype.call = function (observer) {
        return new IsEmptySubscriber(observer);
    };
    return IsEmptyOperator;
})();
var IsEmptySubscriber = (function (_super) {
    __extends(IsEmptySubscriber, _super);
    function IsEmptySubscriber(destination) {
        _super.call(this, destination);
    }
    IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
        var destination = this.destination;
        destination.next(isEmpty);
        destination.complete();
    };
    IsEmptySubscriber.prototype._next = function (value) {
        this.notifyComplete(false);
    };
    IsEmptySubscriber.prototype._complete = function () {
        this.notifyComplete(true);
    };
    return IsEmptySubscriber;
})(Subscriber_1.Subscriber);
//# sourceMappingURL=isEmpty.js.map


text:
var url = location.href;
var urlt = decodeURI(url.substring(url.indexOf("=")+1,url.length));
var jsonTask = JSON.parse(urlt,function(key, value){
	if (key=="date") {
		return new Date(value);
	} else {
		return value;
	}
});

$(document).ready(function(){
	$("#taskTitle").text("张三" + "'s " + jsonTask[0].name + "计划");
	$("#supervisor").text(jsonTask[0].supervisor);
	$("#taskDetail").text(jsonTask[0].detail);

	var deadlineString ="";
	for (var i=0; i < jsonTask.length; i++)
	{
		deadlineString += "
" + jsonTask[i].date.getFullYear() + "年" + String(jsonTask[i].date.getMonth()+1) + "月" + String(jsonTask[i].date.getDate()+1)+ "日
"
	}
	$("#deadlines").html(deadlineString);
});


text:
import json
import langid

placeList = []
placeListFile = open('lists/google_place_long.category', 'r')
for line in placeListFile:
    if not line.startswith('#'):
        placeList.append(line.strip())
placeListFile.close()

for index, place in enumerate(placeList):
    print place
    outputFile = open('data/POIHistClean/' + place + '.json', 'w')
    histFile = open('data/POIHist/' + place + '.json', 'r')
    for line in histFile:
        data = json.loads(line.strip())
        max_id = data['max_id']
        user_id = data['user_id']
        statuses = data['statuses']
        outputStatuses = []
        for tweet in statuses:
            if len(tweet['text']) > 5:
                if langid.classify(tweet['text'])[0] == 'en':
                    outputStatuses.append(tweet)
        output = {'max_id': max_id, 'user_id': user_id, 'statuses': outputStatuses}
        outputFile.write(json.dumps(output)+'\n')
    histFile.close()
    outputFile.close()


text:
require 'spec'
require 'isolated/require_spec'
require 'dm-core/spec/setup'

# To really test this behavior, this spec needs to be run in isolation and not
# as part of the typical rake spec run, which requires dm-transactions upfront

if %w[ postgres mysql sqlite oracle sqlserver ].include?(ENV['ADAPTER'])

  describe "require 'dm-transactions' before calling DataMapper.setup" do

    before(:all) do
      require 'dm-transactions'
      @adapter = DataMapper::Spec.adapter
    end

    it_should_behave_like "require 'dm-transactions'"

  end

end


text:
namespace AutoMapper.Configuration.Annotations;

/// <summary>
/// Map destination member using a custom value resolver.
/// Use with <see cref="SourceMemberAttribute" /> to specify an <see cref="IMemberValueResolver{TSource,TDestination,TSourceMember,TDestMember}" /> type.
/// </summary>
/// <remarks>
/// Must be used in combination with <see cref="AutoMapAttribute" />
/// </remarks>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class ValueResolverAttribute : Attribute, IMemberConfigurationProvider
{
    /// <summary>
    /// <see cref="IValueResolver{TSource,TDestination,TDestMember}" /> or <see cref="IMemberValueResolver{TSource,TDestination,TSourceMember,TDestMember}" /> type
    /// </summary>
    public Type Type { get; }

    public ValueResolverAttribute(Type type)
    {
        Type = type;
    }

    public void ApplyConfiguration(IMemberConfigurationExpression memberConfigurationExpression)
    {
        var sourceMemberAttribute = memberConfigurationExpression.DestinationMember.GetCustomAttribute<SourceMemberAttribute>();

        if (sourceMemberAttribute != null)
        {
            memberConfigurationExpression.MapFrom(Type, sourceMemberAttribute.Name);
        }
        else
        {
            memberConfigurationExpression.MapFrom(Type);
        }
    }
}


text:
Quick Links

<a href="/campaigns/show/<%= campaignId%>">Back to Campaign

	<%- partial('../messages') %>

	<form method="post" action="/teams/create">
		<fieldset>
		<legend>Create a new Team</legend>

			Name

<input type="text" name="name" id="name" />

			Captain

<input type="text" name="captain" id="captain" value="" autocomplete="off" />

			Executive Sponsor

<input type="text" name="sponsor" id="sponsor" value="" autocomplete="off" />

			Motto

<textarea name="motto" id="motto" rows=10 cols=50></textarea>

			Select Member

<input type="text" name="user" id="user" autocomplete="off" value="" />
    		Add »

    		Members

			<select name="members[]" class="select-users" id="members" multiple="multiple" size=5>
			</select>

			<select name="members_hidden[]" class="select-hidden" id="members_hidden" multiple="multiple" size=5>
			</select>

			Remove Selected

			<input type="hidden" name="campaignId" id="campaignId" value="<%= campaignId%>" />

				<input class="btn" type="submit" value="Create" />

			</fieldset>
			</form>


text:
#include "dpas-internal.h"

/*
 * Internal structure of a scope item.
 */
struct dpas_scope_item
{
	int					kind;
	char			   *name;
	jit_type_t			type;
	void			   *info;
	jit_meta_free_func	free_info;
	char			   *filename;
	long				linenum;
	dpas_scope_item_t	next;
};

/*
 * Internal structure of a scope.
 */
struct dpas_scope
{
	dpas_scope_t		parent;
	dpas_scope_item_t	first;
	dpas_scope_item_t	last;
	dpas_scope_item_t	first_with;
	dpas_scope_item_t	last_with;
	int					level;
};

dpas_scope_t dpas_scope_create(dpas_scope_t parent)
{
	dpas_scope_t scope;
	scope = jit_new(struct dpas_scope);
	if(!scope)
	{
		dpas_out_of_memory();
	}
	scope->parent = parent;
	scope->first = 0;
	scope->last = 0;
	scope->first_with = 0;
	scope->last_with = 0;
	if(parent)
	{
		scope->level = parent->level + 1;
	}
	else
	{
		scope->level = 0;
	}
	return scope;
}

void dpas_scope_destroy(dpas_scope_t scope)
{
	if(scope)
	{
		dpas_scope_item_t item, next;
		item = scope->first;
		while(item != 0)
		{
			next = item->next;
			if(item->name)
			{
				jit_free(item->name);
			}
			if(item->filename)
			{
				jit_free(item->filename);
			}
			if(item->free_info)
			{
				(*(item->free_info))(item->info);
			}
			jit_type_free(item->type);
			jit_free(item);
			item = next;
		}
		item = scope->first_with;
		while(item != 0)
		{
			next = item->next;
			if(item->name)
			{
				jit_free(item->name);
			}
			if(item->filename)
			{
				jit_free(item->filename);
			}
			if(item->free_info)
			{
				(*(item->free_info))(item->info);
			}
			jit_type_free(item->type);
			jit_free(item);
			item = next;
		}
		jit_free(scope);
	}
}

dpas_scope_item_t dpas_scope_lookup(dpas_scope_t scope,
									const char *name, int up)
{
	dpas_scope_item_t item;
	int check_with = 1;
	while(scope != 0)
	{
		/* Search through the "with" items for a field match */
		if(check_with)
		{
			item = scope->first_with;
			if(!item)
			{
				/* We are exiting from the top-most "with" scope
				   in the current procedure.  Ignore the rest of
				   the "with" scopes on the stack because we only
				   care about local/global variables from now on */
				check_with = 0;
			}
			while(item != 0)
			{
				if(dpas_type_find_name(item->type, name) != JIT_INVALID_NAME)
				{
					return item;
				}
				item = item->next;
			}
		}

		/* Search the regular items for a match */
		item = scope->first;
		while(item != 0)
		{
			if(!jit_stricmp(item->name, name))
			{
				return item;
			}
			item = item->next;
		}

		/* Move up to the parent scope if necessary */
		if(!up)
		{
			break;
		}
		scope = scope->parent;
	}
	return 0;
}

/*
 * Add an item to a scope list.
 */
static void scope_add(dpas_scope_item_t *first, dpas_scope_item_t *last,
					  const char *name, jit_type_t type, int kind,
					  void *info, jit_meta_free_func free_info,
					  char *filename, long linenum)
{
	dpas_scope_item_t item;
	item = jit_new(struct dpas_scope_item);
	if(!item)
	{
		dpas_out_of_memory();
	}
	if(name)
	{
		item->name = jit_strdup(name);
		if(!(item->name))
		{
			dpas_out_of_memory();
		}
	}
	else
	{
		item->name = 0;
	}
	item->type = jit_type_copy(type);
	item->kind = kind;
	item->info = info;
	item->free_info = free_info;
	if(filename)
	{
		item->filename = jit_strdup(filename);
		if(!(item->filename))
		{
			dpas_out_of_memory();
		}
	}
	else
	{
		item->filename = 0;
	}
	item->linenum = linenum;
	item->next = 0;
	if(*last)
	{
		(*last)->next = item;
	}
	else
	{
		*first = item;
	}
	*last = item;
}

void dpas_scope_add(dpas_scope_t scope, const char *name, jit_type_t type,
					int kind, void *info, jit_meta_free_func free_info,
					char *filename, long linenum)
{
	scope_add(&(scope->first), &(scope->last),
			  name, type, kind, info, free_info, filename, linenum);
}

void dpas_scope_add_with(dpas_scope_t scope, jit_type_t type,
						 void *with_info, jit_meta_free_func free_info)
{
	scope_add(&(scope->first_with), &(scope->last_with),
			  0, type, DPAS_ITEM_WITH, with_info, free_info, 0, 0);
}

void dpas_scope_add_const(dpas_scope_t scope, const char *name,
						  jit_constant_t *value, char *filename, long linenum)
{
	jit_constant_t *new_value;
	new_value = jit_new(jit_constant_t);
	if(!new_value)
	{
		dpas_out_of_memory();
	}
	*new_value = *value;
	scope_add(&(scope->first), &(scope->last), name, value->type,
			  DPAS_ITEM_CONSTANT, new_value, jit_free, filename, linenum);
}

void dpas_scope_check_undefined(dpas_scope_t scope)
{
	dpas_scope_item_t item = scope->first;
	jit_type_t type, new_type;
	while(item != 0)
	{
		if(item->kind == DPAS_ITEM_TYPE)
		{
			type = item->type;
			if(jit_type_get_tagged_kind(type) == DPAS_TAG_NAME &&
			   jit_type_get_tagged_type(type) == 0)
			{
				dpas_error_on_line
					(item->filename, item->linenum,
					 "forward-referenced record type `%s' was not "
					 "declared", item->name);
				new_type = jit_type_create_struct(0, 0, 0);
				if(!new_type)
				{
					dpas_out_of_memory();
				}
				jit_type_set_tagged_type(type, new_type, 0);
			}
		}
		item = item->next;
	}
}

const char *dpas_scope_item_name(dpas_scope_item_t item)
{
	return item->name;
}

int dpas_scope_item_kind(dpas_scope_item_t item)
{
	return item->kind;
}

jit_type_t dpas_scope_item_type(dpas_scope_item_t item)
{
	return item->type;
}

void *dpas_scope_item_info(dpas_scope_item_t item)
{
	return item->info;
}

void dpas_scope_item_set_info(dpas_scope_item_t item, void *info)
{
	item->info = info;
}

const char *dpas_scope_item_filename(dpas_scope_item_t item)
{
	return item->filename;
}

long dpas_scope_item_linenum(dpas_scope_item_t item)
{
	return item->linenum;
}

int dpas_scope_level(dpas_scope_t scope)
{
	return scope->level;
}

/*
 * The global and current scopes.
 */
static dpas_scope_t global_scope = 0;
static dpas_scope_t current_scope = 0;

dpas_scope_t dpas_scope_current(void)
{
	if(!current_scope)
	{
		/* Create the global scope for the first time */
		global_scope = dpas_scope_create(0);

		/* Create a wrapper around the global scope to contain
		   the program-private definitions.  This allows the
		   program to override the global scope if it wants to */
		current_scope = dpas_scope_create(global_scope);
	}
	return current_scope;
}

dpas_scope_t dpas_scope_global(void)
{
	if(!current_scope)
	{
		dpas_scope_current();
	}
	return global_scope;
}

dpas_scope_t dpas_scope_push(void)
{
	current_scope = dpas_scope_create(dpas_scope_current());
	return current_scope;
}

void dpas_scope_pop(void)
{
	dpas_scope_t scope = dpas_scope_current();
	if(scope->parent && scope->parent != global_scope)
	{
		current_scope = scope->parent;
		dpas_scope_destroy(scope);
	}
}

int dpas_scope_is_module(void)
{
	return (dpas_scope_current()->parent == dpas_scope_global());
}


text:
package it.geosolutions.geoserver.rest.decoder;

import it.geosolutions.geoserver.rest.decoder.utils.JDOMBuilder;
import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;

import org.jdom.Element;

/**
 * Parses list of summary data about Wms.
 *
 *
This is the XML REST representation:
 *
{@code <wmsLayers>
	<wmsLayer>
		<name>comunilazio</name>
		<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://172.27.30.25:8080/geoserver/rest/workspaces/arit/wmsstores/regione/wmslayers/comunilazio.xml" type="application/xml"/>
	</wmsLayer>
</wmsLayers>
 *
}

 *
 * @author cip
 */
public class RESTWmsList extends RESTAbstractList<NameLinkElem> {

    public static RESTWmsList build(String response) {
        Element elem = JDOMBuilder.buildElement(response);
        return elem == null? null : new RESTWmsList(elem);
	}

    protected RESTWmsList(Element list) {
        super(list);
    }

}


text:
'use strict';

//Setting up route
angular.module('strategies').config(['$stateProvider',
	function($stateProvider) {
		// Strategies state routing
		$stateProvider.
		state('listStrategies', {
			url: '/strategies',
			templateUrl: 'modules/strategies/views/list-strategies.client.view.html'
		}).
		state('createStrategy', {
			url: '/strategies/create',
			templateUrl: 'modules/strategies/views/create-strategy.client.view.html'
		}).
		state('viewStrategy', {
			url: '/strategies/:strategyId',
			templateUrl: 'modules/strategies/views/view-strategy.client.view.html'
		}).
		state('editStrategy', {
			url: '/strategies/:strategyId/edit',
			templateUrl: 'modules/strategies/views/edit-strategy.client.view.html'
		});
	}
]);


text:
#include <windows.h>

#include "webrtc/modules/desktop_capture/desktop_geometry.h"

namespace webrtc {

// Output the window rect, with the left/right/bottom frame border cropped if
// the window is maximized. |cropped_rect| is the cropped rect relative to the
// desktop. |original_rect| is the original rect returned from GetWindowRect.
// Returns true if all API calls succeeded.
bool GetCroppedWindowRect(HWND window,
                          DesktopRect* cropped_rect,
                          DesktopRect* original_rect);

typedef HRESULT (WINAPI *DwmIsCompositionEnabledFunc)(BOOL* enabled);
class AeroChecker {
 public:
  AeroChecker();
  ~AeroChecker();

  bool IsAeroEnabled();

 private:
  HMODULE dwmapi_library_;
  DwmIsCompositionEnabledFunc func_;

  RTC_DISALLOW_COPY_AND_ASSIGN(AeroChecker);
};

}  // namespace webrtc


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SkillyWilly</title>

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

    <link href="css/freelancer.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

    <link href="css/style.css" rel="stylesheet">

                        The capacity to learn is a gift, the ability to learn is a skill, and the willingness to learn is a choice.
 Chinese Proverb

                                <input type="text" class="form-control" id="searchLocations" placeholder="Choose the Location">
                                <input type="text" class="form-control" id="searchCourses" placeholder="Search for Courses">

                            <button class="btn btn-default">Search</button>

We bring you closer to your skill. SkillyWilly will allow you to explore and learn skills from the best teachers and institutions near you.

Use SkillyWilly

Discover a Skill

Choose your instructor or Institution

Deals

We will help you get the best deals that instructors/ institutions are providing for the skill that you always wanted to learn.

About

SkillyWilly brings you closer to the skill that you have always wanted to learn.

SkillyWilly partners only with highly skilled individuals and Institutions to offer courses to anyone who wants to learn.

Who is skillywilly for ?

 Anybody who ceases to learn !

Contact SkillyWilly

                    <form name="sentMessage" id="contactForm" novalidate>

                                    Name
                                    <input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name.">

                                    Email Address
                                    <input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address.">

                                    Phone Number
                                    <input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number.">

                                    Message
                                    <textarea rows="6" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-success btn-lg">Send</button>

                    </form>

Connect With SkillyWilly


text:
import unittest

import pytest

class TestQcowStagingServer(unittest.TestCase):

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_create_hierarchy_dir_exist(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_create_hierarchy_success(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_teardown_success(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_teardown_no_dir(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_stage_info(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_promote_overcloud_images_success(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_promote_overcloud_images_link_exist(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_setup_dir_exist(self):
        assert False

    @pytest.mark.xfail(reason="Not Implemented", run=False)
    def test_setup_success(self):
        assert False


text:
class InterfaceBase():
    """
    Main base class for all interfaces
    """
    pass

class UnitBase():
    """
    Main base class for all units
    """
    pass


text:
package org.ihtsdo.otf.refset.jpa;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.envers.Audited;
import org.ihtsdo.otf.refset.ReleaseInfo;
import org.ihtsdo.otf.refset.ReleaseProperty;

/**
 * JPA enabled implementation of a {@link ReleaseInfo}.
 */
@Entity
@Table(name = "release_infos", uniqueConstraints = {
  @UniqueConstraint(columnNames = {
      "name", "terminology"
  })
})
@Audited
@XmlRootElement(name = "releaseInfo")
public class ReleaseInfoJpa implements ReleaseInfo {

  /** The id. */
  @Id
  @GeneratedValue
  private Long id;

  /** The name. */
  @Column(nullable = false, length = 255)
  private String name;

  /** The description. */
  @Column(nullable = false, length = 4000)
  private String description;

  /** The effective time. */
  @Temporal(TemporalType.TIMESTAMP)
  private Date effectiveTime;

  /** The release begin date. */
  @Temporal(TemporalType.TIMESTAMP)
  private Date releaseBeginDate;

  /** The release finish date. */
  @Temporal(TemporalType.TIMESTAMP)
  private Date releaseFinishDate;

  /** The planned flag. */
  @Column(nullable = false)
  private boolean planned;

  /** The published flag. */
  @Column(nullable = false)
  private boolean published;

  /** The terminology. */
  @Column(nullable = false)
  private String terminology;

  /** The version. */
  @Column(nullable = false)
  private String version;

  /** The last modified by. */
  @Column(nullable = false)
  private String lastModifiedBy;

  /** The last modified. */
  @Column(nullable = false)
  private Date lastModified = new Date();

  /** The refset id. */
  @Column(nullable = true)
  private String refsetId;

  /** The translation id. */
  @Column(nullable = true)
  private String translationId;

  /** The release properties. */
  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true, targetEntity = ReleasePropertyJpa.class)
  private List<ReleaseProperty> properties;

  /**
   * Instantiates an empty {@link ReleaseInfoJpa}.
   */
  public ReleaseInfoJpa() {
    // do nothing
  }

  /**
   * Instantiates a {@link ReleaseInfoJpa} from the specified parameters.
   *
   * @param releaseInfo the release info
   */
  public ReleaseInfoJpa(ReleaseInfo releaseInfo) {
    id = releaseInfo.getId();
    name = releaseInfo.getName();
    description = releaseInfo.getDescription();
    releaseBeginDate = releaseInfo.getReleaseBeginDate();
    releaseFinishDate = releaseInfo.getReleaseFinishDate();
    planned = releaseInfo.isPlanned();
    published = releaseInfo.isPublished();
    terminology = releaseInfo.getTerminology();
    version = releaseInfo.getVersion();
    lastModified = releaseInfo.getLastModified();
    lastModifiedBy = releaseInfo.getLastModifiedBy();
    refsetId = releaseInfo.getRefsetId();
    translationId = releaseInfo.getTranslationId();
  }

  /* see superclass */
  @Override
  public Long getId() {
    return id;
  }

  /* see superclass */
  @Override
  public void setId(Long id) {
    this.id = id;
  }

  /* see superclass */
  @Override
  public String getName() {
    return name;
  }

  /* see superclass */
  @Override
  public void setName(String name) {
    this.name = name;
  }

  /* see superclass */
  @Override
  public String getDescription() {
    return description;
  }

  /* see superclass */
  @Override
  public void setDescription(String description) {
    this.description = description;
  }

  /* see superclass */
  @Override
  public Date getReleaseBeginDate() {
    return releaseBeginDate;
  }

  /* see superclass */
  @Override
  public void setReleaseBeginDate(Date releaseBeginDate) {
    this.releaseBeginDate = releaseBeginDate;

  }

  /* see superclass */
  @Override
  public Date getReleaseFinishDate() {
    return releaseFinishDate;
  }

  /* see superclass */
  @Override
  public void setReleaseFinishDate(Date releaseFinishDate) {
    this.releaseFinishDate = releaseFinishDate;
  }

  /* see superclass */
  @Override
  public boolean isPlanned() {
    return planned;
  }

  /* see superclass */
  @Override
  public void setPlanned(boolean planned) {
    this.planned = planned;
  }

  /* see superclass */
  @Override
  public boolean isPublished() {
    return published;
  }

  /* see superclass */
  @Override
  public void setPublished(boolean published) {
    this.published = published;
  }

  /* see superclass */
  @Override
  public String getTerminology() {
    return terminology;
  }

  /* see superclass */
  @Override
  public void setTerminology(String terminology) {
    this.terminology = terminology;
  }

  /* see superclass */
  @Override
  public String getVersion() {
    return version;
  }

  /* see superclass */
  @Override
  public void setVersion(String version) {
    this.version = version;
  }

  /* see superclass */
  @Override
  public String getRefsetId() {
    return refsetId;
  }

  /* see superclass */
  @Override
  public void setRefsetId(String refsetId) {
    this.refsetId = refsetId;
  }

  /* see superclass */
  @Override
  public String getTranslationId() {
    return translationId;
  }

  /* see superclass */
  @Override
  public void setTranslationId(String translationId) {
    this.translationId = translationId;
  }

  /* see superclass */
  @Override
  public String getLastModifiedBy() {
    return lastModifiedBy;
  }

  /* see superclass */
  @Override
  public void setLastModifiedBy(String lastModifiedBy) {
    this.lastModifiedBy = lastModifiedBy;
  }

  /* see superclass */
  @Override
  public Date getLastModified() {
    return lastModified;
  }

  /* see superclass */
  @Override
  public void setLastModified(Date lastModified) {
    this.lastModified = lastModified;
  }

  /* see superclass */
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result =
        prime * result + ((description == null) ? 0 : description.hashCode());
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    result = prime * result + (planned ? 1231 : 1237);
    result = prime * result + (published ? 1231 : 1237);
    result =
        prime * result + ((terminology == null) ? 0 : terminology.hashCode());
    result = prime * result + ((version == null) ? 0 : version.hashCode());
    result = prime * result + ((refsetId == null) ? 0 : refsetId.hashCode());
    result =
        prime * result
            + ((translationId == null) ? 0 : translationId.hashCode());
    return result;
  }

  /* see superclass */
  @Override
  @XmlElement(type = ReleasePropertyJpa.class)
  public List<ReleaseProperty> getProperties() {
    return properties;
  }

  /* see superclass */
  @Override
  public void setProperties(List<ReleaseProperty> properties) {
    this.properties = properties;
  }

  /* see superclass */
  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    ReleaseInfoJpa other = (ReleaseInfoJpa) obj;
    if (description == null) {
      if (other.description != null)
        return false;
    } else if (!description.equals(other.description))
      return false;
    if (name == null) {
      if (other.name != null)
        return false;
    } else if (!name.equals(other.name))
      return false;
    if (planned != other.planned)
      return false;
    if (published != other.published)
      return false;
    if (terminology == null) {
      if (other.terminology != null)
        return false;
    } else if (!terminology.equals(other.terminology))
      return false;
    if (version == null) {
      if (other.version != null)
        return false;
    } else if (!version.equals(other.version))
      return false;
    if (refsetId == null) {
      if (other.refsetId != null)
        return false;
    } else if (!refsetId.equals(other.refsetId))
      return false;
    if (translationId == null) {
      if (other.translationId != null)
        return false;
    } else if (!translationId.equals(other.translationId))
      return false;
    return true;
  }

  /* see superclass */
  @Override
  public String toString() {
    return "ReleaseInfoJpa [name=" + name + ", description=" + description
        + ", effectiveTime=" + effectiveTime + ", planned=" + planned
        + ", published=" + published + ", terminology=" + terminology
        + ", version=" + version + ", lastModifiedBy=" + lastModifiedBy
        + ", lastModified=" + lastModified + ", refsetId=" + refsetId
        + ", translationId=" + translationId + ", properties=" + properties
        + "]";
  }

}


text:
Originally published: 2011-02-19 23:18:00
Last updated: 2011-02-19 23:18:01
Author: ilon asolot

This discusses about using Perl, how we can obtain a data file in a particular desired format, given a data file in a random format. By format, we refer to the order of columns in the input data file. Using this Perl script, we obtain output data file in a particular format and we get another file having discarded data lines, based on some filtering condition.


text:
<?php

namespace PHPCI\Plugin;

use PHPCI\Builder;
use PHPCI\Model\Build;

/**
 * Codeception Plugin - Enables full acceptance, unit, and functional testing.
 * @author       Don Gilbert <don@dongilbert.net>
 * @package      PHPCI
 * @subpackage   Plugins
 */
class Codeception implements \PHPCI\Plugin
{
    /**
     * @var string
     */
    protected $args = '';

    /**
     * @var Builder
     */
    protected $phpci;

    protected $build;

    /**
     * @var string|string[] $xmlConfigFile The path (or array of paths) of an xml config for PHPUnit
     */
    protected $xmlConfigFile;

    public function __construct(Builder $phpci, Build $build, array $options = array())
    {
        $this->phpci = $phpci;
        $this->build = $build;

        if (isset($options['config'])) {
            $this->xmlConfigFile = $options['config'];
        }
        if (isset($options['args'])) {
            $this->args = (string) $options['args'];
        }
    }

    /**
     * Runs Codeception tests, optionally using specified config file(s).
     */
    public function execute()
    {
        $success = true;

        // Run any config files first. This can be either a single value or an array.
        if ($this->xmlConfigFile !== null) {
            $success &= $this->runConfigFile($this->xmlConfigFile);
        }

        return $success;
    }

    protected function runConfigFile($configPath)
    {
        if (is_array($configPath)) {
            return $this->recurseArg($configPath, array($this, "runConfigFile"));
        } else {

            $codecept = $this->phpci->findBinary('codecept');

            if (!$codecept) {
                $this->phpci->logFailure('Could not find codeception.');
                return false;
            }

            $cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
            if (IS_WIN) {
                $cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
            }

            $configPath = $this->phpci->buildPath . $configPath;
            $success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);

            return $success;
        }
    }

    protected function recurseArg($array, $callable)
    {
        $success = true;
        foreach ($array as $subItem) {
            $success &= call_user_func($callable, $subItem);
        }
        return $success;
    }
}


text:
<ion-view >
    <ion-nav-title>
        Home
    </ion-nav-title>

    <ion-content class="padding">

Your latest reported issues

        =1">

{{issue.issueType.name}}

{{issue.description}}

        <a class="item item-avatar" ui-sref="menu.issueDetails({issueId:issue.id})" ng-if="issues.data.length<1">

You do not have any issues

            <button class="button button-small icon-left ion-plus-round button-calm" ui-sref="menu.newIssue"> Report new
                Issue
            </button>

        <button class="button button-small button-calm" ui-sref="menu.userListIssues" ng-if="issues.data.length>=1">
            View all
        </button>

Issues near you

            <leaflet class="full-image" defaults="mapDefaults" center="mapCenter" markers="mapMarkers" height="200px" data-tap-disabled="true"></leaflet>

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


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/ElasticLoadBalancingDeleteLoadBalancerPolicyRequestMarshaller.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/ElasticLoadBalancingDeleteLoadBalancerPolicyRequestMarshaller</TokenIdentifier>
			<Abstract type="html">Delete Load Balancer Policy Request Marshaller</Abstract>
			<DeclaredIn>ElasticLoadBalancingDeleteLoadBalancerPolicyRequestMarshaller.h</DeclaredIn>

			<NodeRef refid="874"/>
		</Token>

	</File>
</Tokens>


text: import './components';


text:
package org.codehaus.xfire.management.mbeans.listeners;

import javax.management.Notification;
import javax.management.NotificationListener;
import javax.management.monitor.MonitorNotification;

public class GaugeListener implements NotificationListener {

	public GaugeListener() {
		super();
		// TODO Auto-generated constructor stub
	}

	public void handleNotification(Notification arg0, Object arg1) {
		System.out.println("Attribute Observed "+((MonitorNotification)arg0).getObservedAttribute());
		System.out.println("Notification "+((MonitorNotification)arg0).getType());
		System.out.println("TimeStamp "+((MonitorNotification)arg0).getTimeStamp());
		System.out.println("Threshold "+((MonitorNotification)arg0).getTrigger().toString());
		System.out.println("Derived Gauge "+((MonitorNotification)arg0).getDerivedGauge());

	}

}


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

<routes xmlns="http://symfony.com/schema/routing"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="dcs_opauth_connect" pattern="/login/{strategy}">
        <default key="_controller">DCSOpauthBundle:Connect:login</default>
        <default key="strategy"></default>
    </route>
    <route id="dcs_opauth_connect_callback" pattern="/login/{strategy}/{oauthCallbackPath}">
        <default key="_controller">DCSOpauthBundle:Connect:login</default>
    </route>
</routes>