text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>wCMF 4.0: Member List</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="A MDSD framework for building reliable, maintainable and extendable web applications with PHP">
  <meta name="keywords" content="PHP, web application framework, model driven development">
  <meta name="author" content="wemove digital solutions">
  <link rel="shortcut icon" href="theme/images/favicon.ico">

  <link href="theme/css/doxstyles.css" rel="stylesheet">

  <link href="theme/bootstrap3/css/bootstrap.min.css" rel="stylesheet">
  <link href="theme/bootstrap3/css/font-awesome.min.css" rel="stylesheet">

  <link href="theme/js/tocify/jquery.tocify.css" rel="stylesheet">

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

          <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".menu-navbar-collapse">
            Toggle navigation
          </button>
          wCMF 4.0

 Guides

Getting started

Architecture

Model

Persistence

Presentation

Configuration

Security

I18n & l10n

Tests

 API

 Code

 Support

                <input id="MSearchField" type="text" class="form-control" placeholder="Search API" name="query" onkeyup="searchBox.OnSearchFieldChange(event)">

wcmf

lib

model

StringQuery

StringQuery Member List

This is the complete list of members for StringQuery, including all inherited members.

__construct($type, $queryId=SelectStatement::NO_CACHE)	ObjectQuery

__destruct()	ObjectQuery

buildQuery($orderby=null, PagingInfo $pagingInfo=null)	StringQuery	protected

checkMapper(PersistenceMapper $mapper)	AbstractQuery	protectedstatic

execute($buildDepth, $orderby=null, $pagingInfo=null)	AbstractQuery

executeInternal(SelectStatement $selectStmt, $buildDepth, PagingInfo $pagingInfo=null)	AbstractQuery	protected

getBind($criteria, array $bindOrder)	ObjectQuery	protected

getBindPosition($criterion, $criteria)	ObjectQuery	protected

getConnection($type)	AbstractQuery	protectedstatic

getId()	ObjectQuery

getLastQueryString()	AbstractQuery

getMapper($type)	AbstractQuery	protectedstatic

getObjectTemplate($type, $alias=null, $combineOperator=Criteria::OPERATOR_AND)	ObjectQuery

getQueryCondition()	ObjectQuery

getQueryString($orderby=null)	AbstractQuery

getQueryType()	ObjectQuery	protected

makeGroup($templates, $combineOperator=Criteria::OPERATOR_AND)	ObjectQuery

mapToDatabase($type, $valueName)	StringQuery	protectedstatic

processObjectTemplate(PersistentObject $tpl, SelectStatement $selectStmt)	ObjectQuery	protected

processOrderBy($orderby, SelectStatement $selectStmt)	ObjectQuery	protected

processTableName(Node $tpl)	ObjectQuery	protected

PROPERTY_COMBINE_OPERATOR	ObjectQuery

PROPERTY_INITIAL_OID	ObjectQuery

PROPERTY_TABLE_NAME	ObjectQuery

registerObjectTemplate(Node $template, $alias=null, $combineOperator=Criteria::OPERATOR_AND)	ObjectQuery

resetInternals()	ObjectQuery	protected

setConditionString($condition)	StringQuery

valueChanged(ValueChangeEvent $event)	ObjectQuery

        © 2016 wemove digital solutions

          Generated on Fri Jul 15 2016 22:20:44 for wCMF by  doxygen 1.8.10


text:
import { POST } from "../constants"
import { fetchJSONWithCSRF } from "redux-hammock/django_csrf_fetch"

export const examEnrollmentEndpoint = {
  name:                "examEnrollment",
  checkNoSpinner:      false,
  namespaceOnUsername: false,
  verbs:               [POST],
  postUrl:             "/api/v0/exam_enrollment/",
  fetchFunc:           fetchJSONWithCSRF,
  postOptions:         (examCourseId: number) => ({
    method: POST,
    body:   JSON.stringify({ exam_course_id: examCourseId })
  })
}

redpajama_set_name: RedPajamaGithub


text:
int cisco80211_in_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t * data,
		                         int len, struct sockaddr *from)
{
	int rid = cw_get_byte(data);
	mbag_t r = mbag_i_get_mbag(conn->radios,rid,NULL);
	if (!r){
		cw_dbg(DBG_ELEM_ERR,"Radio %d not defined. Can't set mac operation.");
		return 0;
	}

	return cw_read_80211_mac_operation(data+3,r);
}


text:
'use strict';
define(['app'], function(App) {
    App.module('Entities', function(Entities, App, Backbone, Marionette, $, _) {
        var contextName = 'Entity';
        Entities.Register = Backbone.Model.extend({
            urlRoot: 'register',

            defaults: {
                name: '',
                slug: ''
            },

            validate: function(attrs) { // , options
                var errors = {};
                if (!attrs.fileName) {
                    errors.fileName = 'can\'t be blank';
                }
                //     if (! attrs.somethingelse) {
                //       errors.lastName = 'can't be blank';
                //     }
                //     else{
                //       if (attrs.somethingelse.length < 2) {
                //         errors.somethingelse = 'is too short';
                //       }
                //     }
                if (!_.isEmpty(errors)) {
                    return errors;
                }
            }
        });

        Entities.RegisterCollection = Backbone.Collection.extend({
            url: '/',
            model: Entities.Register
        });

        var initializeRegisters = function() {
            App.log('Initializing Fake Registers', contextName, 1);

            var fakeRegisters = new Entities.RegisterCollection([{
                name: 'First Register',
                slug: 'page-1'
            }, {
                name: 'Second Register',
                slug: 'page-2'
            }]);

            return fakeRegisters;
        };

        var API = {
            getRegisterEntities: function() {
                App.log('register:entities event detected', contextName, 1);
                var registerCollection = new Entities.RegisterCollection();
                registerCollection.reset(initializeRegisters().models); // update the collection
                return registerCollection;
            },
//          TODO: make this work
            getRegisterEntitiesPromises: function() {
                App.log('register:entities event detected', contextName, 1);
                var registerCollection = new Entities.RegisterCollection();
                var defer = $.Deferred();
                registerCollection.fetch({
                    complete: function() {
                        defer.resolve(registerCollection); // send back the collection
                    },
                    // success: function(data){
                    //     App.log('success data', contextName, 1);
                    //     defer.resolve(data);
                    // }
                });
                // chain the above promise,
                var promise = defer.promise();
                $.when(promise).done(function(registerCollection) {
                    // check to see if it had content:
                    if (registerCollection.length === 0) { // if not, get defaults.
                        // FAKE NETWORK LAG
                        setTimeout(function() {
                            // App.trigger('page:register', models); // add each register to the menu
                            // if we don't have any imageCollection yet, create some for convenience
                            registerCollection.reset(initializeRegisters().models); // update the collection
                        }, 2000);

                    }
                });
                return promise;
            },

        };

        App.reqres.setHandler('register:entities', function() {
            return API.getRegisterEntities();
        });

        // App.reqres.setHandler('register:entity', function(id) {
        // return API.getRegisterEntity(id);
        // });

        App.reqres.setHandler('images:entity:new', function(id) {
            App.log('Making new image: ' + id, this.name, 1);
            return new Entities.Register();
        });
    });

    return;
});


text:
Debian or compatible distrobution

###Features
* Update system software.
* Setting hostname
* Creating a user
  * option ssh-key for passwordless connection
* Option Sql server
  * MariaDb
    * Installing
    * Secure Db
  * Postgresql
* Firewall
  * Blocking all trafic except ping and ssh connection as default. Other choices select in start of script may open port for that application
  * Opens ports depending on which options you choose.

##Depends

Linux Debian distrobution.

###TODO
1. Firewall
  * configuration for email
  * configuration for webservices
2. Optinal webserver
  * NGINX
  * APACHE
3. Other
  * SQL (mysql, mariadb, pregresql) Almost done
    * Optimize sql server configuration on memory limitation.
  * Python
  * Django CMS
  * FLASK


text:
require 'test_helper'

class BanksControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:banks)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create bank" do
    assert_difference('Bank.count') do
      post :create, :bank => { }
    end

    assert_redirected_to bank_path(assigns(:bank))
  end

  test "should show bank" do
    get :show, :id => banks(:one).to_param
    assert_response :success
  end

  test "should get edit" do
    get :edit, :id => banks(:one).to_param
    assert_response :success
  end

  test "should update bank" do
    put :update, :id => banks(:one).to_param, :bank => { }
    assert_redirected_to bank_path(assigns(:bank))
  end

  test "should destroy bank" do
    assert_difference('Bank.count', -1) do
      delete :destroy, :id => banks(:one).to_param
    end

    assert_redirected_to banks_path
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace _04.Numbers_In_Reversed_Order
{
    public class StartUp
    {
        public static void Main()
        {
            string number = Console.ReadLine();
            PrintInReverse(number);
        }

        private static void PrintInReverse(string number)
        {
            var list = new List<char>();
            for (int i = 0; i < number.Length; i++)
            {
                list.Add(number[i]);
            }
            list.Reverse();
            Console.WriteLine(string.Join("", list));
        }
    }
}


text:
/**
 *
 */
package ecologylab.bigsemantics.actions.exceptions;

import ecologylab.bigsemantics.actions.SemanticAction;
import ecologylab.bigsemantics.actions.SemanticActionHandler;
import ecologylab.bigsemantics.html.utils.StringBuilderUtils;
import ecologylab.collections.Scope;

/**
 * @author amathur
 *
 */
public class SemanticActionExecutionException extends RuntimeException
{
	protected static String	ERROR_STRING	= "###########################POSSIBLE CAUSES OF ERROR##############################";

	public SemanticActionExecutionException(SemanticAction action)
	{
		System.out.println("\n########################### ERROR " + action.getActionName()
				+ " FAILED ###########################");
		//System.out.println(ERROR_STRING);
	}

	public SemanticActionExecutionException(SemanticAction action, String message)
	{
		this(action);
		System.out.println(message);
		SemanticActionHandler semanticActionHandler = action.getSemanticActionHandler();
		if (semanticActionHandler != null)
		{
			stackTrace(semanticActionHandler.getSemanticActionVariableMap());
		}
	}

	public SemanticActionExecutionException(Exception e, SemanticAction action,
			Scope<Object> semanticActionReturnValueMap)
	{
		this(action);

		StringBuilder buffy = StringBuilderUtils.acquire();
		buffy.append("Action Object:: ").append(action.getObject())
				.append("  :: is NULL or DOES NOT EXIST\n");
		buffy.append("Action ReturnValue:: ").append(action.getReturnObjectName())
				.append(" ::  is NULL or DOES NOT EXIST FOR SPECIFIED OBJECT");

		String errorMessage = buffy.toString();
		StringBuilderUtils.release(buffy);
		System.out.println(errorMessage);
		stackTrace(semanticActionReturnValueMap);
		//System.out.println("######## POSSIBLE CAUSE:");
		//e.printStackTrace();
		System.out
				.println("############################################################################################");
	}

	public void stackTrace(Scope<Object> map)
	{
		StringBuilder sb = new StringBuilder();
		sb.append("--------------Meta-Metadata Trace--------------\n");
		map.dumpThis(sb, "");
		System.out.println(sb);
		System.out.println("----------------------------------------");
	}

}


text:
using Microsoft.Extensions.DependencyInjection;

namespace Goofy.Core.Infrastructure
{
    public interface IDependencyAssembler : ISortableTask
    {
        void Register(IServiceCollection services);
    }
}


text:
require 'test_helper'

class MainControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
  end

  test "should get choose" do
    get :choose
    assert_response :success
  end

  test "should cluster stuff" do
    get :cluster, {"Mexico": "on", "Ecuador": "on", "USA": "on"}
    assert_response :success
  end

end


text:
require 'spec_helper'

describe "schools/new" do
  before(:each) do
    assign(:school, stub_model(School,
      :name => "MyString"
    ).as_new_record)
  end

  it "renders new school form" do
    render

    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "form[action=?][method=?]", schools_path, "post" do
      assert_select "input#school_name[name=?]", "school[name]"
    end
  end
end


text:
package com.github.aesteve.vertx.nubes.utils.async;

import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.logging.Logger;
import io.vertx.ext.web.RoutingContext;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public interface AsyncUtils {

  static <T> Handler<AsyncResult<T>> completeFinally(Future<T> fut) {
    return (res -> fut.complete());
  }

  static <T> Handler<AsyncResult<T>> completeOrFail(Future<T> fut) {
    return res -> {
      if (res.failed()) {
        fut.fail(res.cause());
      } else {
        fut.complete(res.result());
      }
    };
  }

  static <T> Handler<AsyncResult<T>> ignoreResult(Future<Void> future) {
    return res -> {
      if (res.failed()) {
        future.fail(res.cause());
      } else {
        future.complete();
      }
    };
  }

  static <T> AsyncResult<Void> withoutResult(AsyncResult<T> res) {
    if (res.failed()) {
      return Future.failedFuture(res.cause());
    } else {
      return Future.succeededFuture();
    }
  }

  static <T> Handler<AsyncResult<T>> onSuccessOnly(Future<Void> future, Handler<T> handler) {
    return res -> {
      if (res.failed()) {
        future.fail(res.cause());
        return;
      }
      handler.handle(res.result());
    };
  }

  static <T> Handler<AsyncResult<T>> onSuccessOnly(NoArgHandler block) {
    return res -> {
      if (res.failed()) {
        return;
      }
      block.handle();
    };
  }

  static <T> Handler<AsyncResult<T>> onSuccessOnly(Handler<T> handler) {
    return res -> {
      if (res.failed()) {
        return;
      }
      handler.handle(res.result());
    };
  }

  static <T> Handler<AsyncResult<T>> onFailureOnly(Handler<T> handler) {
    return res -> {
      if (res.failed()) {
        handler.handle(res.result());
      }
    };
  }

  static <T> Handler<AsyncResult<T>> nextOrFail(RoutingContext context) {
    return res -> {
      if (res.failed()) {
        context.fail(res.cause());
      } else {
        context.next();
      }
    };
  }

  static <T> Handler<AsyncResult<T>> failOr(RoutingContext context, Handler<AsyncResult<T>> handler) {
    return res -> {
      if (res.failed()) {
        context.fail(res.cause());
      } else {
        handler.handle(res);
      }
    };
  }

  static <T, U, V> Future<V> chainOnSuccess(Handler<AsyncResult<T>> globalHandler, Future<U> future, Handler<Future<V>> nextHandler) {
    Future<V> nextFuture = Future.future();
    future.setHandler(res -> {
      if (res.failed()) {
        globalHandler.handle(Future.failedFuture(res.cause()));
      } else {
        nextHandler.handle(nextFuture);
      }
    });
    return nextFuture;
  }

  static <T> void chainHandlers(Handler<AsyncResult<T>> global, List<Handler<Future<T>>> handlers) {
    if (handlers == null || handlers.isEmpty()) {
      global.handle(Future.succeededFuture());
      return;
    }
    int nbHandlers = handlers.size();
    Future<T> firstFuture = Future.future();
    if (nbHandlers == 1) {
      firstFuture.setHandler(global);
      handlers.get(0).handle(firstFuture);
      return;
    }
    List<Future<T>> futures = new ArrayList<>(handlers.size());
    futures.add(firstFuture);
    int i = 0;
    for (Handler<Future<T>> handler : handlers) {
      if (i > 0) {
        Future<T> fut = futures.get(i - 1);
        futures.add(chainOnSuccess(global, fut, handler));
      }
      i++;
    }
    futures.get(futures.size() - 1).setHandler(global);
    handlers.get(0).handle(firstFuture);
  }

  static <T> void chainHandlers(Future<T> global, List<Handler<Future<T>>> handlers) {
    chainHandlers(res -> {
      if (res.failed()) {
        global.fail(res.cause());
      } else {
        global.complete(res.result());
      }
    }, handlers);
  }

  static <T, U> Future<Void> chainOnSuccess(Handler<AsyncResult<T>> globalHandler, Future<U> future, List<Handler<Future<Void>>> list) {
    List<Future<Void>> futures = new ArrayList<>(list.size());
    int i = 0;
    Future<Void> firstFuture = Future.future();
    for (Handler<Future<Void>> handler : list) {
      Future<Void> fut = i == 0 ? firstFuture : futures.get(i - 1);
      futures.add(chainOnSuccess(globalHandler, fut, handler));
      i++;
    }
    future.setHandler(res -> {
      if (res.failed()) {
        globalHandler.handle(Future.failedFuture(res.cause()));
      } else {
        list.get(0).handle(firstFuture);
      }
    });
    return futures.get(futures.size() - 1);
  }

  @SafeVarargs // or we're screwed...
  static <T, U> Future<Void> chainOnSuccess(Handler<AsyncResult<T>> globalHandler, Future<U> future, Handler<Future<Void>>... handlers) {
    List<Handler<Future<Void>>> list = Arrays.asList(handlers);
    return AsyncUtils.chainOnSuccess(globalHandler, future, list);
  }

  static <T> Handler<AsyncResult<T>> logIfFailed(final String msg, final Logger log) {
    return res -> {
      if (res.failed()) {
        if (msg != null) {
          log.error(msg, res.cause());
        } else {
          log.error(res.cause());
        }
      }
    };
  }

}


text:
module AwesomeToyRobotSimulator
  module Moveable
    def left
      raise NotImplementedError
    end

    def right
      raise NotImplementedError
    end

    def step_forward(_)
      raise NotImplementedError
    end
  end
end


text:
/**
 * Created by qianqing on 16/9/9.
 */
import './myun.css';
import Conf from './config';
import Function from './function';
import pcdData from './pcd';

var Lib = {
  Conf, Function, pcdData
};

module.exports = Lib;


text:
package com.ctrip.xpipe.redis.keeper.applier.sequence;

import com.ctrip.xpipe.redis.core.redis.operation.RedisKey;
import com.ctrip.xpipe.redis.keeper.applier.AbstractInstanceComponent;
import com.ctrip.xpipe.redis.keeper.applier.InstanceDependency;
import com.ctrip.xpipe.redis.keeper.applier.command.*;
import com.ctrip.xpipe.redis.keeper.applier.lwm.ApplierLwmManager;

import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

/**
 * @author Slight
 * <p>
 * Jan 29, 2022 4:19 PM
 */
public class DefaultSequenceController extends AbstractInstanceComponent implements ApplierSequenceController {

    @InstanceDependency
    public ApplierLwmManager lwmManager;

    @InstanceDependency
    public ExecutorService stateThread;

    Map<RedisKey, SequenceCommand<?>> runningCommands = new HashMap<>();

    SequenceCommand<?> obstacle;

    ExecutorService workerThreads;

    @Override
    protected void doInitialize() throws Exception {
        workerThreads = Executors.newFixedThreadPool(8);
    }

    @Override
    protected void doDispose() throws Exception {
        workerThreads.shutdown();
    }

    @Override
    public void submit(RedisOpCommand<?> command) {

        stateThread.execute(()->{
            if (logger.isDebugEnabled()) {
                logger.debug("[submit] commandName={} args={}", command.getName(), Arrays.stream(command.redisOp().buildRawOpArgs()).map(String::new).toArray(String[]::new));
            }
            switch (command.type()) {
                case SINGLE_KEY:
                    submitSingleKeyCommand((RedisOpDataCommand<?>) command);
                    break;
                case MULTI_KEY:
                    submitMultiKeyCommand((RedisOpDataCommand<?>) command);
                    break;
                case OTHER:
                    submitObstacle(command);
                    break;
            }
        });
    }

    private void submitSingleKeyCommand(RedisOpDataCommand<?> command) {

        /* find dependencies */

        List<SequenceCommand<?>> dependencies = new ArrayList<>();

        RedisKey key = command.key();
        SequenceCommand<?> lastSameKey = runningCommands.get(key);
        if (lastSameKey != null) {
            dependencies.add(lastSameKey);
        }

        if (obstacle != null) {
            dependencies.add(obstacle);
        }

        /* make command */

        SequenceCommand<?> current = new SequenceCommand<>(dependencies, new StubbornCommand<>(command), stateThread, workerThreads);

        /* make self a dependency */

        runningCommands.put(key, current);
        forgetWhenSuccess(current, key);

        /* do some stuff when finish */

        mergeGtidWhenSuccess(current, command.gtid());

        /* run self */

        current.execute();
    }

    private void submitMultiKeyCommand(RedisOpDataCommand<?> command) {

        List<SequenceCommand<?>> currents = new ArrayList<>();

        for (RedisOpCommand<?> subCommand : command.sharding()) {

            /* find dependencies */

            List<RedisKey> keys = subCommand.keys();
            List<SequenceCommand<?>> dependencies = keys.stream().map(runningCommands::get).filter(Objects::nonNull).collect(Collectors.toList());
            if (obstacle != null) {
                dependencies.add(obstacle);
            }

            /* make command */

            SequenceCommand<?> current = new SequenceCommand<>(dependencies, new StubbornCommand<>(subCommand), stateThread, workerThreads);

            /* make self a dependency */

            for (RedisKey key : keys) {
                runningCommands.put(key, current);
                forgetWhenSuccess(current, key);
            }

            currents.add(current);
        }

        /* run self */

        for (SequenceCommand<?> current : currents) {
            current.execute();
        }

        /* do some stuff when finish */

        SequenceCommand<?> success = new SuccessSequenceCommand(currents, stateThread, workerThreads);
        mergeGtidWhenSuccess(success, command.gtid());

        success.execute();
    }

    private void submitObstacle(RedisOpCommand<?> command) {

        /* find dependencies */

        List<SequenceCommand<?>> dependencies = new ArrayList<>(runningCommands.values());
        if (obstacle != null) {
            dependencies.add(obstacle);
        }

        /* make command */

        SequenceCommand<?> current = new SequenceCommand<>(dependencies, new StubbornCommand<>(command), stateThread, workerThreads);

        /* make self a dependency */

        runningCommands = new HashMap<>();
        obstacle = current;

        forgetObstacleWhenSuccess(current);

        /* do some stuff when finish */

        mergeGtidWhenSuccess(current, command.gtid());

        /* run self */

        current.execute();
    }

    private void forgetObstacleWhenSuccess(SequenceCommand<?> sequenceCommand) {
        sequenceCommand.future().addListener((f)->{
            if (f.isSuccess()) {
                if (sequenceCommand == obstacle) {
                    obstacle = null;
                }
            }
        });
    }

    private void forgetWhenSuccess(SequenceCommand<?> sequenceCommand, RedisKey key) {
        sequenceCommand.future().addListener((f)->{
            if (f.isSuccess()) {
                if (sequenceCommand == runningCommands.get(key)) {
                    runningCommands.remove(key);
                }
            }
        });
    }

    private void mergeGtidWhenSuccess(SequenceCommand<?> sequenceCommand, String gtid) {
        sequenceCommand.future().addListener((f)->{
            if (f.isSuccess()) {
                if (gtid != null) {
                    if (lwmManager != null) {
                        lwmManager.submit(gtid);
                    }
                }
            }
        });
    }
}


text:
      <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

      </button>
      Public Apps

Home

About

Login


text:
layout: page
title: Warden Technologies Trade Fair
date: 2016-05-24
author: Ruth Jones
tags: weekly links, java
status: published
summary: Pellentesque habitant morbi tristique senectus.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 10/10/2018
  endDate: 10/15/2018
  ctyhocn: WASOXHX
  groupCode: WTTF
published: true
---
Vivamus in rhoncus metus. Sed non orci gravida lacus mattis aliquet. Vivamus fermentum nisl eget magna euismod lobortis. Fusce sapien quam, porta non maximus et, pellentesque et nisi. Phasellus sit amet est et quam gravida tempus. Mauris cursus dolor in leo pharetra vulputate. Curabitur nec posuere neque. Nullam ut justo in nisl imperdiet elementum sed vel purus. Aenean scelerisque semper convallis. Aenean est nulla, volutpat at ligula id, porttitor sagittis lorem. In sed aliquam magna. Mauris tristique in tortor in interdum. Etiam quis interdum ante, ut ullamcorper odio. Cras ex sapien, dapibus quis dolor sed, consectetur consectetur est.
Praesent a cursus est. Vestibulum tortor quam, consequat id blandit at, euismod a ligula. Donec urna sapien, tristique sit amet lacus et, euismod euismod enim. Aliquam tortor enim, accumsan in luctus eget, porta quis ex. Pellentesque nec congue justo, non varius augue. Praesent at lectus cursus, tempor mauris vitae, faucibus sapien. Proin sed imperdiet massa, at dapibus urna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec orci nec tortor sollicitudin hendrerit.

* Maecenas eu ex non nulla hendrerit ornare vitae quis mauris
* Maecenas vel lorem sit amet eros eleifend tristique sed vitae erat
* Quisque quis orci sit amet arcu feugiat auctor
* Nam euismod arcu in sollicitudin rhoncus
* Duis malesuada nisi quis tortor eleifend, at fringilla mi ornare
* Donec non nibh sed nisl pulvinar egestas eu vel libero.

Aenean pulvinar mauris nec gravida convallis. Aliquam erat volutpat. Fusce vel ultrices est. Morbi felis mi, gravida eu erat sed, faucibus accumsan justo. Morbi est lorem, malesuada et ultricies in, consectetur non lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi vel diam at nisl aliquet aliquet in vitae justo. Nullam consequat sit amet nunc et porta. Praesent hendrerit vitae eros sit amet tincidunt.


text:
<resources>
    <string name="app_name">MemoryLeaks</string>
    <string name="ping_was_send">Ping was sent</string>
    <string name="error_occurred">Error occurred</string>
    <string name="send_ping">Send ping</string>
    <string name="elders_list_label">Elders which remember you</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009 Alexander Teinum

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.
-->
<style-scheme id="blue" _name="Blue" version="1.0">
    <author>Alexander Teinum</author>
    <style name="text"                        foreground="#333333" background="#f8f8f8"/>
    <!-- Comments -->
    <style name="def:comment"                 foreground="#999999" italic="true"/>

    <!-- Constants -->
    <style name="def:constant"                foreground="#0066cc" italic="true"/>
    <style name="def:special-char"            foreground="#0066cc" italic="true"/>

    <!-- Identifiers -->
    <style name="def:identifier"              foreground="#0044aa"/>

    <!-- Statements -->
    <style name="def:statement"               foreground="#0044aa"/>

    <!-- Types -->
    <style name="def:type"                    foreground="#333333"/>
</style-scheme>


text:
package androidx.test.orchestrator;

import static androidx.test.orchestrator.OrchestratorConstants.AJUR_CLASS_ARGUMENT;
import static androidx.test.orchestrator.OrchestratorConstants.AJUR_LIST_TESTS_ARGUMENT;
import static androidx.test.orchestrator.OrchestratorConstants.ISOLATED_ARGUMENT;
import static androidx.test.orchestrator.OrchestratorConstants.TARGET_INSTRUMENTATION_ARGUMENT;

import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.test.services.shellexecutor.ClientNotConnected;
import androidx.test.services.shellexecutor.ShellExecutorImpl;
import com.google.common.io.ByteStreams;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

/** Runnable to run a single am instrument command to execute a single test. */
public class TestRunnable implements Runnable {

  private static final String TAG = "TestRunnable";

  private final Bundle arguments;
  private final RunFinishedListener listener;
  private final OutputStream outputStream;
  private final String test;
  private final boolean collectTests;
  private final Context context;
  private final String secret;

  /**
   * Constructs a TestRunnable executes all tests in arguments.
   *
   * @param context A context
   * @param secret A string representing the speakeasy binder key
   * @param arguments contains arguments to be passed to the target instrumentation
   * @param outputStream the stream to write the results of the test process
   * @param listener a callback listener to know when the run has completed
   */
  public static TestRunnable legacyTestRunnable(
      Context context,
      String secret,
      Bundle arguments,
      OutputStream outputStream,
      RunFinishedListener listener) {
    return new TestRunnable(context, secret, arguments, outputStream, listener, null, false);
  }

  /**
   * Constructs a TestRunnable which will run a single test.
   *
   * @param context A context
   * @param secret A string representing the speakeasy binder key
   * @param arguments contains arguments to be passed to the target instrumentation
   * @param outputStream the stream to write the results of the test process
   * @param listener a callback listener to know when the run has completed
   * @param test contains a specific test#method to run. Will override whatever is specified in the
   *     bundle.
   */
  public static TestRunnable singleTestRunnable(
      Context context,
      String secret,
      Bundle arguments,
      OutputStream outputStream,
      RunFinishedListener listener,
      String test) {
    return new TestRunnable(context, secret, arguments, outputStream, listener, test, false);
  }

  /**
   * Constructs a TestRunnable which will ask the instrumentation to list out its tests.
   *
   * @param context A context
   * @param secret A string representing the speakeasy binder key
   * @param arguments contains arguments to be passed to the target instrumentation
   * @param outputStream the stream to write the results of the test process
   * @param listener a callback listener to know when the run has completed
   */
  public static TestRunnable testCollectionRunnable(
      Context context,
      String secret,
      Bundle arguments,
      OutputStream outputStream,
      RunFinishedListener listener) {
    return new TestRunnable(context, secret, arguments, outputStream, listener, null, true);
  }

  @VisibleForTesting
  TestRunnable(
      Context context,
      String secret,
      Bundle arguments,
      OutputStream outputStream,
      RunFinishedListener listener,
      String test,
      boolean collectTests) {
    this.context = context;
    this.secret = secret;
    this.arguments = new Bundle(arguments);
    this.outputStream = outputStream;
    this.listener = listener;
    this.test = test;
    this.collectTests = collectTests;
  }

  /** Called at the end of a test run. */
  public interface RunFinishedListener {
    void runFinished();
  }

  @Override
  public void run() {
    try {
      InputStream inputStream =
          runShellCommand(buildShellParams(getTargetInstrumentationArguments()));
      try {
        ByteStreams.copy(inputStream, outputStream);
      } finally {
        if (inputStream != null) {
          inputStream.close();
          outputStream.close();
        } else {
          Log.e(TAG, "InputStream returned from shell command is null");
        }
      }
    } catch (IOException e) {
      Log.e(TAG, "IOException thrown when running remote test", e);
    } catch (ClientNotConnected e) {
      Log.e(TAG, "ShellCommandClient not connected, unable to run remote test", e);
    } catch (InterruptedException e) {
      Log.e(TAG, "ShellCommandClient connection interrupted, unable to run remote test", e);
    } catch (RemoteException e) {
      Log.e(TAG, "ShellCommandClient remote execution, unable to run remote test", e);
    }

    listener.runFinished();
  }

  private String getTargetInstrumentation() {
    return arguments.getString(TARGET_INSTRUMENTATION_ARGUMENT);
  }

  private Bundle getTargetInstrumentationArguments() {
    Bundle targetArgs = new Bundle(arguments);
    // Filter out the only argument intended specifically for Listener
    targetArgs.remove(TARGET_INSTRUMENTATION_ARGUMENT);
    targetArgs.remove(ISOLATED_ARGUMENT);

    if (collectTests) {
      targetArgs.putString(AJUR_LIST_TESTS_ARGUMENT, "true");
    } else {
      // If we aren't engaging in test collection, then we should have a specific test target, and
      // the orchestrator will pass a specific class parameter. Passing class and package parameters
      // at the same time breaks AndroidJUnitRunner and is redundant.  Thus, we can remove these
      // parameters.
      targetArgs.remove("package");
      targetArgs.remove("testFile");
    }

    // Override the class parameter with the current test target.
    if (test != null) {
      targetArgs.putString(AJUR_CLASS_ARGUMENT, test);
    }

    return targetArgs;
  }

  private List<String> buildShellParams(Bundle arguments) throws IOException, ClientNotConnected {
    List<String> params = new ArrayList<>();
    params.add("instrument");
    params.add("-w");
    params.add("-r");

    for (String key : arguments.keySet()) {
      params.add("-e");
      params.add(key);
      params.add(arguments.getString(key));
    }
    params.add(getTargetInstrumentation());

    return params;
  }

  InputStream runShellCommand(List<String> params)
      throws IOException, ClientNotConnected, InterruptedException, RemoteException {
    return new ShellExecutorImpl(context, secret).executeShellCommand("am", params, null, false);
  }
}


text:
package org.apache.sshd.common.config;

import java.util.concurrent.TimeUnit;

import org.apache.sshd.util.test.JUnitTestSupport;
import org.apache.sshd.util.test.NoIoTestCase;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runners.MethodSorters;

/**
 * @author Apache MINA SSHD Project
 */
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Category({ NoIoTestCase.class })
public class TimeValueConfigTest extends JUnitTestSupport {
    public TimeValueConfigTest() {
        super();
    }

    @Test
    public void testDurationOf() {
        Object[] values = {
            "600", TimeUnit.SECONDS.toMillis(600L),
            "10m", TimeUnit.MINUTES.toMillis(10L),
            "1h30m", TimeUnit.MINUTES.toMillis(90L),
            "2d", TimeUnit.DAYS.toMillis(2L),
            "3w", TimeUnit.DAYS.toMillis(3L * 7L)
        };
        for (int index = 0; index < values.length; index += 2) {
            String s = (String) values[index];
            Number expected = (Number) values[index + 1];
            long actual = TimeValueConfig.durationOf(s);
            assertEquals(s, expected.longValue(), actual);
        }
    }
}


text:
'use strict';

/**
 * Get the IMAGE_SERVICE_URL configuration value.
 * Defaults to lorempixel if IMAGE_SERVICE_URL is not defined.
 * Lorempixel does not maintain an SSL certificate properly.
 * image service must be SSL for use with this app (except development).
 * Note: To use Cloudinary, set IMAGE_SERVICE_URL to 'https://res.cloudinary.com'
 *  AND set CLOUD_NAME appropriately.
 *
 * @returns {String} The IMAGE_SERVICE_URL configuration value.
 */
function IMAGE_SERVICE_URL () {
  return process.env.IMAGE_SERVICE_URL || 'http://lorempixel.com';
}

/**
 * Get the CLOUD_NAME configuration value.
 * This is used in Cloudinary to identify the account.
 *
 * @returns {String} The CLOUD_NAME configuration value.
 */
function CLOUD_NAME () {
  return process.env.CLOUD_NAME;
}

/**
 * Make the images configuration object.
 *
 * @returns the images configuration object.
 */
function makeConfig () {
  return {
    service: {
      url: IMAGE_SERVICE_URL,
      cloudName: CLOUD_NAME
    }
  };
}

module.exports = makeConfig;


text:
using System;
using System.Collections.Generic;

namespace KeyPay.DomainModels.V2.Report
{
    public class PaygPaymentSummaryModel
    {
        public int EmployeeId { get; set; }
        public int? EmployingEntityId { get; set; }
        public DateTime DateGenerated { get; set; }
        public string PaymentSummaryType { get; set; }
        public string Status { get; set; }

        public bool IsAmended { get; set; }

        public string PayeeName { get; set; }
        public string PayeeAddress { get; set; }
        public string PayeeAddressLine2 { get; set; }
        public string PayeeSuburb { get; set; }
        public string PayeePostCode { get; set; }
        public string PayeeState { get; set; }

        public DateTime PaymentPeriodStart { get; set; }
        public DateTime PaymentPeriodEnd { get; set; }
        public string PayeeTaxFileNumber { get; set; }
        public int TotalTaxWithheld { get; set; }
        public int GrossPayments { get; set; }
        public int CdepPayments { get; set; }
        public int FringeBenefits { get; set; }
        public int EmployerSuperContributions { get; set; }
        public int TotalAllowances { get; set; }
        public int LumpSumA { get; set; }
        public int LumpSumB { get; set; }
        public int LumpSumD { get; set; }
        public int LumpSumE { get; set; }
        public string LumpSumAType { get; set; }
        public int NotReportedAmount { get; set; }

        public Dictionary<string, int> Allowances { get; set; }
        public Dictionary<string, int> UnionFeeDeductions { get; set; }
        public int WorkplaceGiving { get; set; } // Shown on summary as "Workplace Giving DGR(s)"
        public int ExemptForeignEmploymentIncome { get; set; } // Shown on summary as "Exempt foreign employment income"
        public int DeductibleAmountOfUndeductedAnnuityPrice { get; set; } // Shown on summart as "Deductible amount of the undeducted purchase price of the annuity"

        public string PayerABN { get; set; }
        public string PayerName { get; set; }
        public string PayerBranch { get; set; }
        public string PayerSignatory { get; set; }

        //additional information for the employment termination payment summary
        public DateTime PaymentDate { get; set; }
        public bool IsTransitionalTerminationPayment { get; set; }
        public bool IsPartOfEarlierPayment { get; set; }
        public int TaxableComponent { get; set; }
        public int TaxFreeComponent { get; set; }

        //additional information for the business and personal services income payment summary
        public string PayeeABN { get; set; }
        public string PaymentType { get; set; }

        //additional information for the foreign employment payment summary
        public string GrossPaymentType { get; set; }
        public int ForeignTaxPaid { get; set; }

        //additional information for the superannuation income stream payment summary
        public int TaxableComponentTaxedElement { get; set; }
        public int TaxableComponentUntaxedElement { get; set; }
        public int TaxableComponentTaxFreeComponent { get; set; }
        public int TaxableComponentTaxOffsetAmount { get; set; }

        public int LumpSumInArrearsTaxedElement { get; set; }
        public int LumpSumInArrearsUntaxedElement { get; set; }
        public int LumpSumInArrearsTaxFreeComponent { get; set; }

        //additional information for the superannuation lump sum payment summary
        public bool IsDeathBenefit { get; set; }
        public string DeathBenefitType { get; set; }
    }
}


text:
process.env.TZ = 'UTC'
var expect = require('chai').expect
var ini_set = require('../../../../src/php/info/ini_set') // eslint-disable-line no-unused-vars,camelcase
var ini_get = require('../../../../src/php/info/ini_get') // eslint-disable-line no-unused-vars,camelcase
var set_time_limit = require('../../../../src/php/info/set_time_limit.js') // eslint-disable-line no-unused-vars,camelcase

describe.skip('src/php/info/set_time_limit.js (tested in test/languages/php/info/test-set_time_limit.js)', function () {
  it('should pass example 1', function (done) {
    var expected = undefined
    var result = set_time_limit(4)
    expect(result).to.deep.equal(expected)
    done()
  })
})


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_HOST_CHROMOTING_MESSAGES_H_
#define REMOTING_HOST_CHROMOTING_MESSAGES_H_

#include "ipc/ipc_platform_file.h"
#include "media/video/capture/screen/mouse_cursor_shape.h"
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkSize.h"

#endif  // REMOTING_HOST_CHROMOTING_MESSAGES_H_

// Multiply-included message file, no traditional include guard.
#include "ipc/ipc_message_macros.h"

#define IPC_MESSAGE_START ChromotingMsgStart

//-----------------------------------------------------------------------------
// Chromoting messages sent from the daemon to the network process.

// Requests the network process to crash producing a crash dump. The daemon
// sends this message when a fatal error has been detected indicating that
// the network process misbehaves. The daemon passes the location of the code
// that detected the error.
IPC_MESSAGE_CONTROL3(ChromotingDaemonNetworkMsg_Crash,
                     std::string /* function_name */,
                     std::string /* file_name */,
                     int /* line_number */)

// Delivers the host configuration (and updates) to the network process.
IPC_MESSAGE_CONTROL1(ChromotingDaemonNetworkMsg_Configuration, std::string)

// Notifies the network process that the terminal |terminal_id| has been
// disconnected from the desktop session.
IPC_MESSAGE_CONTROL1(ChromotingDaemonNetworkMsg_TerminalDisconnected,
                     int /* terminal_id */)

// Notifies the network process that |terminal_id| is now attached to
// a desktop integration process. |desktop_process| is the handle of the desktop
// process |desktop_pipe| is the client end of the desktop-to-network pipe
// opened.
//
// Windows only: |desktop_pipe| has to be duplicated from the desktop process
// by the receiver of the message. |desktop_process| is already duplicated by
// the sender.
IPC_MESSAGE_CONTROL3(ChromotingDaemonNetworkMsg_DesktopAttached,
                     int /* terminal_id */,
                     IPC::PlatformFileForTransit /* desktop_process */,
                     IPC::PlatformFileForTransit /* desktop_pipe */)

//-----------------------------------------------------------------------------
// Chromoting messages sent from the network to the daemon process.

// Asks the daemon to send Secure Attention Sequence (SAS) to the current
// console session.
IPC_MESSAGE_CONTROL0(ChromotingNetworkDaemonMsg_SendSasToConsole)

// Connects the terminal |terminal_id| (i.e. the remote client) to a desktop
// session.
IPC_MESSAGE_CONTROL1(ChromotingNetworkHostMsg_ConnectTerminal,
                     int /* terminal_id */)

// Disconnects the terminal |terminal_id| from the desktop session it was
// connected to.
IPC_MESSAGE_CONTROL1(ChromotingNetworkHostMsg_DisconnectTerminal,
                     int /* terminal_id */)

//-----------------------------------------------------------------------------
// Chromoting messages sent from the daemon to the desktop process.

// Requests the desktop process to crash producing a crash dump. The daemon
// sends this message when a fatal error has been detected indicating that
// the desktop process misbehaves. The daemon passes the location of the code
// that detected the error.
IPC_MESSAGE_CONTROL3(ChromotingDaemonDesktopMsg_Crash,
                     std::string /* function_name */,
                     std::string /* file_name */,
                     int /* line_number */)

//-----------------------------------------------------------------------------
// Chromoting messages sent from the desktop to the daemon process.

// Notifies the daemon that a desktop integration process has been initialized.
// |desktop_pipe| specifies the client end of the desktop pipe. It is to be
// forwarded to the desktop environment stub.
//
// Windows only: |desktop_pipe| has to be duplicated from the desktop process by
// the receiver of the message.
IPC_MESSAGE_CONTROL1(ChromotingDesktopDaemonMsg_DesktopAttached,
                     IPC::PlatformFileForTransit /* desktop_pipe */)

// Asks the daemon to inject Secure Attention Sequence (SAS) in the session
// where the desktop process is running.
IPC_MESSAGE_CONTROL0(ChromotingDesktopDaemonMsg_InjectSas)

//-----------------------------------------------------------------------------
// Chromoting messages sent from the desktop to the network process.

// Notifies the network process that a shared buffer has been created. Receipt
// of this message must be confirmed by replying with
// ChromotingNetworkDesktopMsg_SharedBufferCreated message.
IPC_MESSAGE_CONTROL3(ChromotingDesktopNetworkMsg_CreateSharedBuffer,
                     int /* id */,
                     IPC::PlatformFileForTransit /* handle */,
                     uint32 /* size */)

// Request the network process to stop using a shared buffer.
IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_ReleaseSharedBuffer,
                     int /* id */)

IPC_STRUCT_TRAITS_BEGIN(SkIPoint)
  IPC_STRUCT_TRAITS_MEMBER(fX)
  IPC_STRUCT_TRAITS_MEMBER(fY)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(SkIRect)
  IPC_STRUCT_TRAITS_MEMBER(fLeft)
  IPC_STRUCT_TRAITS_MEMBER(fTop)
  IPC_STRUCT_TRAITS_MEMBER(fRight)
  IPC_STRUCT_TRAITS_MEMBER(fBottom)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(SkISize)
  IPC_STRUCT_TRAITS_MEMBER(fWidth)
  IPC_STRUCT_TRAITS_MEMBER(fHeight)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(media::MouseCursorShape)
  IPC_STRUCT_TRAITS_MEMBER(size)
  IPC_STRUCT_TRAITS_MEMBER(hotspot)
  IPC_STRUCT_TRAITS_MEMBER(data)
IPC_STRUCT_TRAITS_END()

// Serialized media::ScreenCaptureData structure.
IPC_STRUCT_BEGIN(SerializedCapturedData)
  // ID of the shared memory buffer containing the pixels.
  IPC_STRUCT_MEMBER(int, shared_buffer_id)

  // Width of a single row of pixels in bytes.
  IPC_STRUCT_MEMBER(int, bytes_per_row)

  // Captured region.
  IPC_STRUCT_MEMBER(std::vector<SkIRect>, dirty_region)

  // Dimentions of the buffer in pixels.
  IPC_STRUCT_MEMBER(SkISize, dimensions)

  // Time spent in capture. Unit is in milliseconds.
  IPC_STRUCT_MEMBER(int, capture_time_ms)

  // Sequence number supplied by client for performance tracking.
  IPC_STRUCT_MEMBER(int64, client_sequence_number)

  // DPI for this frame.
  IPC_STRUCT_MEMBER(SkIPoint, dpi)
IPC_STRUCT_END()

// Notifies the network process that a shared buffer has been created.
IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CaptureCompleted,
                     SerializedCapturedData /* capture_data */ )

// Carries a cursor share update from the desktop session agent to the client.
IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CursorShapeChanged,
                     media::MouseCursorShape /* cursor_shape */ )

// Carries a clipboard event from the desktop session agent to the client.
// |serialized_event| is a serialized protocol::ClipboardEvent.
IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_InjectClipboardEvent,
                     std::string /* serialized_event */ )

// Requests the network process to terminate the client session.
IPC_MESSAGE_CONTROL0(ChromotingDesktopNetworkMsg_DisconnectSession)

// Carries an audio packet from the desktop session agent to the client.
// |serialized_packet| is a serialized AudioPacket.
IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_AudioPacket,
                     std::string /* serialized_packet */ )

//-----------------------------------------------------------------------------
// Chromoting messages sent from the network to the desktop process.

// Passes the client session data to the desktop session agent and starts it.
// This must be the first message received from the host.
IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_StartSessionAgent,
                     std::string /* authenticated_jid */ )

// Notifies the desktop process that the shared memory buffer has been mapped to
// the memory of the network process and so it can be safely dropped by
// the network process at any time.
IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_SharedBufferCreated,
                     int /* id */)

IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InvalidateRegion,
                     std::vector<SkIRect> /* invalid_region */ )

IPC_MESSAGE_CONTROL0(ChromotingNetworkDesktopMsg_CaptureFrame)

// Carries a clipboard event from the client to the desktop session agent.
// |serialized_event| is a serialized protocol::ClipboardEvent.
IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectClipboardEvent,
                     std::string /* serialized_event */ )

// Carries a keyboard event from the client to the desktop session agent.
// |serialized_event| is a serialized protocol::KeyEvent.
IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectKeyEvent,
                     std::string /* serialized_event */ )

// Carries a mouse event from the client to the desktop session agent.
// |serialized_event| is a serialized protocol::MouseEvent.
IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectMouseEvent,
                     std::string /* serialized_event */ )


text:
@interface MLSShareViewController ()

@property(nonatomic, strong) UIButton *closeBtn;
@property (strong, nonatomic) UIView *shareView;
@property(nonatomic, assign) BOOL firstAppear;
@end

@implementation MLSShareViewController
- (instancetype)init
{
        self = [super init];
        if (self) {
                CGFloat w = __MAIN_SCREEN_WIDTH__;
                CGFloat h = __WGWidth(150.0f);
                self.contentSizeInPopup = CGSizeMake(w,h);
                self.landscapeContentSizeInPopup = CGSizeMake(w,h);
                self.firstAppear = YES;
        }
        return self;
}
- (void)viewDidLoad
{
        [super viewDidLoad];
        self.view.backgroundColor = [UIColor brownColor];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive) name:UIApplicationWillEnterForegroundNotification object:nil];
        [self _LayoutViews];

}
- (void)applicationDidBecomeActive
{
        @weakify(self);
        [self.popupController dismissWithCompletion:^{
                @strongify(self);
                if (self.dismissBlock)
                {
                }
        }];
}
- (void)viewDidAppear:(BOOL)animated
{
        [super viewDidAppear:animated];
        if (!self.firstAppear)
        {
                @weakify(self);
                [self.popupController dismissWithCompletion:^{
                        @strongify(self);
                        if (self.dismissBlock)
                        {
                        }
                }];
        }
        self.firstAppear = NO;
}

- (STPopupController *)getPopUpController
{
        STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:self];
        popupController.navigationBarHidden = YES;
        popupController.style = STPopupStyleBottomSheet;
        @weakify(self);
        popupController.DissmissCallBack = ^{
                @strongify(self);
                if (self.dismissBlock)
                {
                }
        };
        return popupController;
}
- (void)_LayoutViews
{
        [self.view addSubview:self.closeBtn];

        [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.bottom.equalTo(self.view.mas_bottom).offset(-10);
                make.centerX.equalTo(self.view.mas_centerX);
                make.height.width.mas_equalTo(30.0f);
        }];

        ShareType type = ShareTypeDefault;

        self.shareView = [CZShare shareView:@"" text:@"" url:@"" image:@"" shareType:type completion:^(BOOL success, NSString *errorReason,ShareType type) {

                if (errorReason != nil)
                {
                        [WGTipTool showWithText:errorReason inView:self.view hideAfterDelay:1.5];

                }
                else
                {
                        [WGTipTool showWithText:@"分享成功" inView:self.view hideAfterDelay:1.5];
                }
        }];

        [self.view addSubview:self.shareView];

        [self.shareView mas_makeConstraints:^(MASConstraintMaker *make) {

                make.top.equalTo(self.view.mas_top);

                make.leading.trailing.equalTo(self.view);

                make.height.offset(__WGWidth(100.0f));
        }];
}

- (UIButton *)closeBtn
{
        if (_closeBtn == nil) {
                _closeBtn = [[UIButton alloc] init];
                [_closeBtn setImage:[UIImage imageNamed:@"store_close"] forState:UIControlStateNormal];
                [_closeBtn addTarget:self action:@selector(closeClick:) forControlEvents:(UIControlEventTouchUpInside)];
        }
        return _closeBtn;
}

-(void)closeClick:(UIButton *)closeBtn
{
        [self.popupController dismiss];
}

@end


text:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TeamBlueberry
{
    public class TeamRoleSniper : TeamRoleBase
    {
        Cell targetPos;
        Cell lookAtPos;

        public TeamRoleSniper(SoldierTeamBlueberry mySoldier, Team myTeam) : base(mySoldier, myTeam)
        {
            MemberIndex = myTeam.MemberCount;
            mySoldier.gameObject.name += "_Sniper" + myTeam.Name + "_" + MemberIndex;
        }

        public override void StartRole()
        {
            base.StartRole();

            InitializeTargetPositions();

            navAgent.targetCell = targetPos;
        }

        public override void UpdateRole()
        {
            base.UpdateRole();

            if (enemiesInSight.Count > 0)
            {
                if (mySoldier.LookAt(Vector3Extensions.GetPositionWithSmallestDiffAngle(enemiesInSight, mySoldier)))
                    mySoldier.Shoot();

                navAgent.moveToTarget = false;
                underFireCell = null;
            }
            else if (underFireCell != null)
            {
                mySoldier.LookAt(underFireCell.GetPosition());
                if (CellExtentions.IsCellAngleSmaller(underFireCell, 50, mySoldier))
                    underFireCell = null;
            }
            else if (reportedEnemyPositions.Count > 0)
            {
                mySoldier.LookAt(Vector3Extensions.GetPositionWithSmallestDiffAngle(reportedEnemyPositions, mySoldier));
            }
            else
            {
                if (navAgent.pathGenerated.Count > 0)
                {
                    navAgent.moveToTarget = true;
                    mySoldier.MoveTowards(navAgent.pathGenerated[0]);
                }
                if (backToHome && (navAgent.pathGenerated.Count > 0))
                    mySoldier.LookAt(navAgent.pathGenerated[0]);
                else
                {
                    Vector3 dir = MyCell.GetPosition() + lookAtPos.GetPosition();
                    mySoldier.LookAt(dir);
                }
            }
        }

        public override void ReceiveMessage(TeamMessage message)
        {
            if ((message.messageType == TeamMessageTypes.EnemyLocated) && (message.content != null))
            {
                MessageContentEnemyLocated content = (MessageContentEnemyLocated)message.content;
                content.positions.ForEach(v => {
                    Cell cell = v.ToCell();
                    AddReportedEnemyPosition(cell);
                });
            }
            else if ((message.messageType == TeamMessageTypes.UnderFire) && (message.content != null))
            {
                MessageContentUnderFire content = (MessageContentUnderFire)message.content;
                underFireCell = content.position;
            }
        }

        private void InitializeTargetPositions()
        {
            if (myTeam.MyFlagPosition.x < 0)
            {
                if (myTeam.Name == SNIPER_TEAM1_NAME)
                {
                    targetPos = new Cell(-15, -1, 0);
                    if (MemberIndex == 1)
                        lookAtPos = new Cell(10, 0, 0);
                    else if (MemberIndex == 2)
                        lookAtPos = new Cell(0, -10, 0);
                    else
                        lookAtPos = new Cell(-10, 0, 0);
                }
                else
                {
                    targetPos = new Cell(-10, -11, 0);
                    targetPos = new Cell(-4, -17, 0);
                    if (MemberIndex == 1)
                        lookAtPos = new Cell(-10, 0, 0);
                    else if (MemberIndex == 2)
                        lookAtPos = new Cell(10, -10, 0);
                    else
                        lookAtPos = new Cell(0, 10, 0);
                }
            }
            else
            {
                if (myTeam.Name == SNIPER_TEAM1_NAME)
                {
                    targetPos = new Cell(3, 17, 0);
                    if (MemberIndex == 1)
                        lookAtPos = new Cell(-10, 10, 0);
                    else if (MemberIndex == 2)
                        lookAtPos = new Cell(10, 10, 0);
                    else
                        lookAtPos = new Cell(10, -10, 0);
                }
                else
                {
                    targetPos = new Cell(15, 1, 0);
                    if (MemberIndex == 1)
                        lookAtPos = new Cell(-10, 0, 0);
                    else if (MemberIndex == 2)
                        lookAtPos = new Cell(0, 10, 0);
                    else
                        lookAtPos = new Cell(10, 0, 0);
                }
            }
        }
    }
}


text:
Categories

        All {{site.posts | size}}

    {% for category in site.categories %}

        {{ category | first }} {{ category | last | size }}

    {% endfor %}


text:
package org.apache.olingo.server.core.uri.parser;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

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

import org.junit.Test;

public class RawUriTest {

  private RawUri runRawParser(final String path, final String query, final int skipSegments)
      throws UriParserSyntaxException {
    return UriDecoder.decodeUri(path, query, null, skipSegments);
  }

  @Test
  public void testOption() throws Exception {
    RawUri rawUri;
    rawUri = runRawParser("", "", 0);
    checkOptionCount(rawUri, 0);

    rawUri = runRawParser("", "a", 0);
    checkOption(rawUri, 0, "a", "");

    rawUri = runRawParser("", "a=b", 0);
    checkOption(rawUri, 0, "a", "b");

    rawUri = runRawParser("", "=", 0);
    checkOption(rawUri, 0, "", "");

    rawUri = runRawParser("", "=b", 0);
    checkOption(rawUri, 0, "", "b");

    rawUri = runRawParser("", "a&c", 0);
    checkOption(rawUri, 0, "a", "");
    checkOption(rawUri, 1, "c", "");

    rawUri = runRawParser("", "a=b&c", 0);
    checkOption(rawUri, 0, "a", "b");
    checkOption(rawUri, 1, "c", "");

    rawUri = runRawParser("", "a=b&c=d", 0);
    checkOption(rawUri, 0, "a", "b");
    checkOption(rawUri, 1, "c", "d");

    rawUri = runRawParser("", "=&=", 0);
    checkOption(rawUri, 0, "", "");
    checkOption(rawUri, 1, "", "");

    rawUri = runRawParser("", "=&c=d", 0);
    checkOption(rawUri, 0, "", "");
    checkOption(rawUri, 1, "c", "d");
  }

  private void checkOption(final RawUri rawUri, final int index, final String name, final String value) {
    RawUri.QueryOption option = rawUri.queryOptionListDecoded.get(index);

    assertEquals(name, option.name);
    assertEquals(value, option.value);
  }

  private void checkOptionCount(final RawUri rawUri, final int count) {
    assertEquals(count, rawUri.queryOptionListDecoded.size());
  }

  @Test
  public void testPath() throws Exception {
    RawUri rawUri;

    rawUri = runRawParser("", null, 0);
    checkPath(rawUri, "", Collections.<String> emptyList());

    rawUri = runRawParser("/", null, 0);
    checkPath(rawUri, "/", Collections.<String> emptyList());

    rawUri = runRawParser("/entitySet", null, 0);
    checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));

    rawUri = runRawParser("//entitySet", null, 0);
    checkPath(rawUri, "//entitySet", Arrays.asList("entitySet"));

    rawUri = runRawParser("entitySet", null, 0);
    checkPath(rawUri, "entitySet", Arrays.asList("entitySet"));

    rawUri = runRawParser("/nonServiceSegment/entitySet", null, 0);
    checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));

    rawUri = runRawParser("/nonServiceSegment/entitySet", null, 1);
    checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("entitySet"));

    rawUri = runRawParser("nonServiceSegment/entitySet", null, 0);
    checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));

    rawUri = runRawParser("nonServiceSegment/entitySet", null, 1);
    checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("entitySet"));

    rawUri = runRawParser("non//Service/Segment///entitySet/", null, 3);
    checkPath(rawUri, "non//Service/Segment///entitySet/", Arrays.asList("entitySet"));

    rawUri = runRawParser("/a", "abc=xx+yz", 0);
    checkPath(rawUri, "/a", Arrays.asList("a"));
  }

  @Test
  public void testSplit() {
    assertTrue(UriDecoder.splitSkipEmpty("", '/').isEmpty());
    assertTrue(UriDecoder.splitSkipEmpty("/", '/').isEmpty());
    assertEquals(Arrays.asList("a"), UriDecoder.splitSkipEmpty("a", '/'));
    assertEquals(Arrays.asList("a"), UriDecoder.splitSkipEmpty("a/", '/'));
    assertEquals(Arrays.asList("a"), UriDecoder.splitSkipEmpty("/a", '/'));
    assertEquals(Arrays.asList("a", "a"), UriDecoder.splitSkipEmpty("a/a", '/'));
    assertEquals(Arrays.asList("a", "a"), UriDecoder.splitSkipEmpty("/a/a", '/'));
  }

  private void checkPath(final RawUri rawUri, final String path, final List<String> list) {
    assertEquals(path, rawUri.path);

    assertEquals(list.size(), rawUri.pathSegmentListDecoded.size());

    for (int i = 0; i < list.size(); i++) {
      assertEquals(list.get(i), rawUri.pathSegmentListDecoded.get(i));
    }
  }

  @Test(expected = UriParserSyntaxException.class)
  public void wrongPercentEncoding() throws Exception {
    runRawParser("%wrong", null, 0);
  }
}


text:
package hu.blackbelt.cd.bintray.deploy

import java.io.{BufferedInputStream, InputStream}
import java.nio.file.{Files, Path}
import java.util.UUID
import java.util.stream.Collectors

import hu.blackbelt.cd.bintray.VFS.FS
import org.apache.commons.compress.archivers.{ArchiveEntry, ArchiveInputStream, ArchiveStreamFactory}
import org.apache.commons.compress.compressors.{CompressorInputStream, CompressorStreamFactory}
import org.apache.maven.model.io.xpp3.MavenXpp3Reader
import org.rauschig.jarchivelib.IOUtils

import scala.annotation.tailrec
import scala.collection.JavaConverters._

case class Art(groupId: String, artifactId: String, version: String, artifact: Path, pomFile: Path)

object TarGzExtract {

  def extract(archive: InputStream): Path = {
    val destDirName = s"/tmp/${UUID.randomUUID().toString}"

    val destination = FS.getPath(destDirName)

    val compressorInput = new CompressorStreamFactory().createCompressorInputStream(new BufferedInputStream(archive))

    extractInternal2(destination, compressorInput)

    destination
  }

  private def extractInternal2(destination: Path, compressorInput: CompressorInputStream): Unit = {
    var archiveInput: ArchiveInputStream = null
    try {
      archiveInput = new ArchiveStreamFactory().createArchiveInputStream("tar", compressorInput)

      val entryStream = Stream.continually(Option(archiveInput.getNextEntry)).takeWhile(_.isDefined).map(_.get)

      entryStream.foreach { entry =>
        val path: Path = destination.resolve(entry.getName)
        if (entry.isDirectory) {
          Files.createDirectories(path)
        }
        else {
          Files.createDirectories(path.getParent)
          Files.copy(archiveInput, path)
        }
      }
    } finally {
      IOUtils.closeQuietly(archiveInput)
    }

  }

  def list(dir: Path, filter: Path => Boolean = _ => true): Seq[Path] = {

    Option(getFiles(dir)).map { paths =>
      paths.filter(p => Files.isRegularFile(p) && filter(p)) ++ paths.filter(Files.isDirectory(_)).flatMap(list(_, filter))
    }.getOrElse(Seq())

  }

  private def fileNameEndsWith(path: Path, suffix: String) = path.getFileName.toString.endsWith(suffix)

  private def isPomFile(file: Path) = fileNameEndsWith(file, ".pom")

  private def listPomDirs(dir: Path) = list(dir, isPomFile).map(_.getParent)

  private def getJarByPomFromDir(dir: Path) = {
    val files = getFiles(dir)
    val poms = files.filter(f => Files.isRegularFile(f) && isPomFile(f))
    poms.map { pomFile =>

      val model = new MavenXpp3Reader().read(Files.newBufferedReader(pomFile))

      val groupId = Option(model.getGroupId).getOrElse(model.getParent.getGroupId)
      val artifactId = model.getArtifactId
      val version = Option(model.getVersion).getOrElse(model.getParent.getVersion)

      val packaging = model.getPackaging match {
        case "bundle" => "jar"
        case "karaf-assembly" => "zip"
        case anythingElse => anythingElse
      }
      files.find(f => fileNameEndsWith(f, s".$packaging") && !fileNameEndsWith(f, s"-sources.$packaging")).map(
        Art(groupId, artifactId, version, _, pomFile)
      )

    }.filter(_.isDefined).map(_.get).headOption

  }

  def getArtifacts(archive: InputStream): Seq[Art] = {
    val pomDirs = TarGzExtract.listPomDirs _ compose TarGzExtract.extract
    pomDirs(archive).map(TarGzExtract.getJarByPomFromDir).filter(_.isDefined).map(_.get)
  }

  def getFiles(path: Path) = {
    Files.list(path).collect(Collectors.toList()).asScala.toSeq
  }
}


text:
<?php
/* Smarty version 3.1.30, created on 2017-09-09 14:07:23
  from "D:\glider_sky\data_center\templates\reg.tpl" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.30',
  'unifunc' => 'content_59b3851bafe186_48068712',
  'has_nocache_code' => false,
  'file_dependency' =>
  array (
    '66b8c6bf30ffb1d99dbd7b8d2c8847318f71b48e' =>
    array (
      0 => 'D:\\glider_sky\\data_center\\templates\\reg.tpl',
      1 => 1504937216,
      2 => 'file',
    ),
  ),
  'includes' =>
  array (
    'file:header.tpl' => 1,
    'file:footer.tpl' => 1,
  ),
),false)) {
function content_59b3851bafe186_48068712 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

注册

                    <form action="/guest.php" method="post" name="f" id="f">
                    用户名不能为空
                    密码长度不能少于8位
                    两次密码不一致
                    邮箱名不合法
                    接受协议才可以继续注册

                           &nbsp用户名
                        <input type="username" id="username" name="username" placeholder="" onChange='check("username")'>
                        <input id="is_reg" name="is_reg" type="hidden" value="reg">

                             密码
                        <input type="password" name="password" id="password" placeholder="" onChange='check("password")'>

                        请再次输入密码
                        <input type="password" name="cpassword" id="cpassword" placeholder="" onChange='check("cpassword")'>

                             邮箱
                        <input type="username" id="email" name="email" placeholder="" onChange='check("email")'>

                        <input type="checkbox" id="regsign" name="regsign" value="accept"/>
                        我同意签署下面《用户注册协议》

                         注册

                        <input type="hidden" id="business" name="business" value="dc">
                        <input type="hidden" id="controller" name="controller" value="reg">
                        <input type="hidden" id="action" name="action" value="register">
                        <input type="hidden" id="action" name="vendor" value="guest">

                    </form>

<?php $_smarty_tpl->_subTemplateRender("file:footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php }
}


text:
from django.db.models import F

from oscar.core.loading import get_model

ProductRecord = get_model('analytics', 'ProductRecord')
Product = get_model('catalogue', 'Product')

class Calculator(object):

    # Map of field name to weight
    weights = {
        'num_views': 1,
        'num_basket_additions': 3,
        'num_purchases': 5
    }

    def __init__(self, logger):
        self.logger = logger

    def run(self):
        self.calculate_scores()

    def calculate_scores(self):
        self.logger.info("Calculating product scores")
        total_weight = float(sum(self.weights.values()))
        weighted_fields = [
            self.weights[name] * F(name) for name in self.weights.keys()]
        ProductRecord.objects.update(
            score=sum(weighted_fields) / total_weight)


text:
import { FormError } from '../states/patientFormState';
import { requiredValidation } from '../validations/requiredValidation';

class RequiredValidator {
  validateRequiredField(value: any): FormError {
    let formError = new FormError();
    formError.isValid = requiredValidation.isValid(value);

    if (!formError.isValid) {
      formError.errorMessage = "Mandatory field";
    }

    return formError;
  }
}

const requiredValidator = new RequiredValidator();

export {
  requiredValidator
}


text:
<!-- This issue tracker is only for technical issues related to Viacoin Core.

General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com.

For reporting security issues, please contact the Viacoin developers

If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

<!-- Describe the issue -->
<!--- What behavior did you expect? -->

<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

<!--- How reliably can you reproduce the issue, what are the steps to do so? -->

<!-- What version of Viacoin Core are you using, where did you get it (website, self-compiled, etc)? -->

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

<!-- Any extra information that might be useful in the debugging process. -->
<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->


text:
class MergeRequestBasicEntity < Grape::Entity
  expose :public_merge_status, as: :merge_status
  expose :merge_error
  expose :state
  expose :source_branch_exists?, as: :source_branch_exists
  expose :rebase_in_progress?, as: :rebase_in_progress
  expose :milestone, using: API::Entities::Milestone
  expose :labels, using: LabelEntity
  expose :assignees, using: API::Entities::UserBasic
  expose :task_status, :task_status_short
  expose :lock_version, :lock_version
end


text:
#include "condor_common.h"
#include "condor_classad.h"
#include "condor_version.h"
#include "condor_debug.h"
#include "condor_config.h"
#include "condor_distribution.h"

#include "read_user_log.h"
#include "file_modified_trigger.h"
#include "wait_for_user_log.h"
#include "match_prefix.h"

#include <set>
/*
XXX XXX XXX WARNING WARNING WARNING
The exit codes in this program are slightly different than
in other Condor tools.  This program should only exit success
if it is positively confirmed that the desired jobs have completed.
Any other exit should indicate EXIT_FAILURE.
*/

/* on Windows, and perhaps other OS's, EXIT_SUCCESS and EXIT_FAILURE are
   defined in stdlib.h as the numbers 0 and 1, respectively. Since they
   are used differently in this file, we undefine them first.
*/

#if defined(EXIT_SUCCESS)
	#undef EXIT_SUCCESS
#endif
#if defined(EXIT_FAILURE)
	#undef EXIT_FAILURE
#endif

#define EXIT_SUCCESS exit(0)
#define EXIT_FAILURE exit(1)

#define ANY_NUMBER -1

static void usage( char *cmd )
{
	fprintf(stderr,"\nUse: %s [options] <log-file> [job-number]\nWhere options are:",cmd);
	fprintf(stderr,R"opts(
    -help             Display options
    -version          Display Condor version
    -debug            Show extra debugging info
    -status           Show job start and terminate info
    -echo[:<fmt>]     Echo log events relevant to [job-number]
       optional <fmt> is one or more log format options:
         ISO_DATE     date in Year-Month-Day form
         UTC          echo time as UTC time
         XML          echo in XML log format
         JSON         echo in JSON log format
    -num <number>     Wait for this many jobs to end
                       (default is all jobs)
    -wait <seconds>   Wait no more than this time
                       (default is unlimited)
    -allevents        Continue on even if all jobs have ended.
                      use with -echo to transcribe the whole log
                      cannot be used with -num

This command watches a log file, and indicates when
a specific job (or all jobs mentioned in the log)
have completed or aborted. It returns success if
all such jobs have completed or aborted, and returns
failure otherwise.

)opts");

	fprintf(stderr,"Examples:\n");
	fprintf(stderr,"    %s logfile\n",cmd);
	fprintf(stderr,"    %s logfile 35\n",cmd);
	fprintf(stderr,"    %s logfile 1406.35\n",cmd);
	fprintf(stderr,"    %s -wait 60 logfile 13.25.3\n",cmd);
	fprintf(stderr,"    %s -num 2 logfile\n",cmd);
	fprintf(stderr,"\nTranscribe an entire log to UTC timestamps:\n    %s -all -echo:UTC logfile\n", cmd);
}

static void version()
{
	printf( "%s\n%s\n", CondorVersion(), CondorPlatform() );
}

static int jobnum_matches( ULogEvent *event, int cluster, int process, int subproc )
{
	return
		( (event->cluster==cluster) || (cluster==ANY_NUMBER) ) &&
		( (event->proc==process)    || (process==ANY_NUMBER) ) &&
		( (event->subproc==subproc) || (subproc==ANY_NUMBER) );
}

int main( int argc, char *argv[] )
{
	int i;
	char *log_file_name = 0;
	char *job_name = 0;
	time_t waittime=0, stoptime=0;
	int minjobs = 0;
	int print_status = false;
	int echo_events = false;
	int dont_wait = false; // set to true when the wait is 0 - read all events then exit.
	int format_opts = 0;
	const char * pcolon;

	set_priv_initialize(); // allow uid switching if root
	config();

	format_opts = 0;
	auto_free_ptr fmt(param("DEFAULT_USERLOG_FORMAT_OPTIONS"));
	if (fmt) {
		format_opts = ULogEvent::parse_opts(fmt, format_opts);
	}

	for( i=1; i<argc; i++ ) {
		if(!strcmp(argv[i],"-help")) {
			usage(argv[0]);
			EXIT_SUCCESS;
		} else if(!strcmp(argv[i],"-version")) {
			version();
			EXIT_FAILURE;
		} else if(is_dash_arg_colon_prefix(argv[i], "debug", &pcolon, 1)) {
			// dprintf to console
			dprintf_set_tool_debug("TOOL", (pcolon && pcolon[1]) ? pcolon+1 : nullptr);
			print_status = false;
		} else if(!strcmp(argv[i],"-status")) {
			if (dprintf_to_term_check()) {
				fprintf(stderr,"-status is implied by -debug\n");
			} else {
				print_status = true;
			}
		} else if(is_dash_arg_colon_prefix(argv[i],"echo", &pcolon, -1)) {
			echo_events = true;
			if (pcolon) {
				format_opts = ULogEvent::parse_opts(pcolon + 1, format_opts);
			}
		} else if (is_dash_arg_prefix(argv[i], "allevents", 3)) {
			if (minjobs) {
				fprintf(stderr, "-allevents cannot be used with -num\n");
				usage(argv[0]);
				EXIT_FAILURE;
			}
			minjobs = INT_MAX; // don't use job exits as a reason to stop
			if ( ! waittime) dont_wait = true;  // stop when we get to the end (unless -wait is also specfied)
		} else if(!strcmp(argv[i],"-wait")) {
			i++;
			if(i>=argc) {
				fprintf(stderr,"-wait requires an argument\n");
				usage(argv[0]);
				EXIT_FAILURE;
			}
			waittime = atoi(argv[i]);
			if (waittime) {
				dont_wait = false;
				stoptime = time(0) + waittime;
				dprintf(D_FULLDEBUG,"Will wait until %s\n",ctime(&stoptime));
			} else {
				dprintf(D_FULLDEBUG,"Will exit at EOF\n");
				dont_wait = true;
			}
		} else if( !strcmp( argv[i], "-num" ) ) {
			i++;
			if( i >= argc ) {
				fprintf( stderr, "-num requires an argument\n" );
				usage( argv[0] );
				EXIT_FAILURE;
			}
			if (minjobs == INT_MAX) {
				fprintf(stderr, "-num cannot be used with -allevents\n");
				usage(argv[0]);
				EXIT_FAILURE;
			}
			minjobs = atoi( argv[i] );
			if( minjobs < 1 ) {
				fprintf( stderr, "-num must be greater than zero\n" );
				usage( argv[0] );
				EXIT_FAILURE;
			}
			dprintf( D_FULLDEBUG, "Will wait until %d jobs end\n", minjobs );
		} else if (log_file_name != NULL && job_name == NULL && !strcmp(argv[i], "-1")) {
			job_name = argv[i]; // treat a bare -1 as 'all clusters'
		} else if(argv[i][0]!='-') {
			if(!log_file_name) {
				log_file_name = argv[i];
			} else if(!job_name) {
				job_name = argv[i];
			} else {
				fprintf(stderr,"Extra argument: %s\n\n",argv[i]);
				usage(argv[0]);
				EXIT_FAILURE;
			}
		} else {
			usage(argv[0]);
			EXIT_FAILURE;
		}
	}

	if( !log_file_name ) {
		usage(argv[0]);
		EXIT_FAILURE;
	}

	int cluster=ANY_NUMBER;
	int process=ANY_NUMBER;
	int subproc=ANY_NUMBER;

	if( job_name ) {
		int fields = sscanf(job_name,"%d.%d.%d",&cluster,&process,&subproc);
		if(fields>=1 && fields<=3) {
			/* number is fine */
		} else {
			fprintf(stderr,"Couldn't understand job number: %s\n",job_name);
			EXIT_FAILURE;
		}
	}

	dprintf(D_FULLDEBUG,"Reading log file %s\n",log_file_name);
	int submitted = 0, aborted = 0, completed = 0;
	std::set<std::string> table;

	// in case we want to echo in XML format
	classad::ClassAdXMLUnParser xmlunp;
	classad::ClassAdJsonUnParser jsonunp;
	if (format_opts & ULogEvent::formatOpt::XML) {
		xmlunp.SetCompactSpacing(false);
	}

	WaitForUserLog wful( log_file_name );
	if(! wful.isInitialized()) {
		fprintf( stderr, "Couldn't open %s: %s\n", log_file_name, strerror(errno) );
		EXIT_FAILURE;
	}

	bool initial_scan = true;
	while( 1 ) {
		int timeout_ms = -1;
		if(! dont_wait) {
			int now = time(NULL);
			if( stoptime && now > stoptime ) {
				printf( "Time expired.\n" );
				EXIT_FAILURE;
			}
			timeout_ms = (stoptime - now) * 1000;
		}

		ULogEventOutcome outcome;
		ULogEvent * event;
		outcome = wful.readEvent( event, initial_scan ? 0 : timeout_ms );
		if( outcome == ULOG_OK ) {
			char key[1024];
			sprintf(key,"%d.%d.%d",event->cluster,event->proc,event->subproc);
			if( jobnum_matches( event, cluster, process, subproc ) ) {
				if (echo_events) {
					std::string event_str;
					if (format_opts & ULogEvent::formatOpt::CLASSAD) {
						ClassAd* ad = event->toClassAd((format_opts & ULogEvent::formatOpt::UTC) != 0);
						if (ad) {
							if (format_opts & ULogEvent::formatOpt::JSON) {
								jsonunp.Unparse(event_str, ad);
								printf("%s\n", event_str.c_str());
							} else {
								xmlunp.Unparse(event_str, ad);
								printf("%s", event_str.c_str());
							}
							delete ad;
						}
					} else {
						event->formatEvent(event_str, format_opts);
						printf("%s...\n", event_str.c_str());
					}
				}

				if(event->eventNumber==ULOG_SUBMIT) {
					dprintf(D_FULLDEBUG,"%s submitted\n",key);
					if (print_status) printf("%s submitted\n", key);
					table.insert(key);
					submitted++;
				} else if(event->eventNumber==ULOG_JOB_TERMINATED) {
					dprintf(D_FULLDEBUG,"%s completed\n",key);
					if (print_status) printf("%s completed\n", key);
					table.erase(key);
					completed++;
				} else if(event->eventNumber==ULOG_JOB_ABORTED) {
					dprintf(D_FULLDEBUG,"%s aborted\n",key);
					if (print_status) printf("%s aborted\n", key);
					table.erase(key);
					aborted++;
				} else if (event->eventNumber==ULOG_EXECUTE) {
					if (print_status) {
						printf("%s executing on host %s\n", key, ((ExecuteEvent*)event)->getExecuteHost());
					}
				} else {
					/* nothing to do */
				}
			}
			delete event;

			if( minjobs && (completed + aborted >= minjobs ) ) {
				printf( "Specifed number of jobs (%d) done.\n", minjobs );
				EXIT_SUCCESS;
			}

			if( table.size() == 0 && submitted > 0 && (!minjobs) && !initial_scan) {
				printf( "All jobs done.\n" );
				EXIT_SUCCESS;
			}
		} else if( outcome == ULOG_NO_EVENT ) {
			if (initial_scan) {
				// we are done with the initial scan when we find no events without waiting.
				initial_scan = false;
				if (table.size() == 0 && !minjobs) {
					printf("All jobs done.\n");
					EXIT_SUCCESS;
				}
			} else if (table.size() == 0 && submitted == 0) {
				if( cluster == ANY_NUMBER ) {
					fprintf(stderr,"This log does not mention any jobs!\n");
				} else {
					fprintf(stderr,"This log does not mention that job!\n");
				}
				if ( ! dont_wait) {
					EXIT_FAILURE;
				}
			}
			if (dont_wait) {
				EXIT_SUCCESS;
			}
		} else if( outcome == ULOG_RD_ERROR ) {
			dprintf( D_FULLDEBUG, "Got ULOG_RD_ERROR, done.\n" );
			EXIT_FAILURE;
		} else if( outcome == ULOG_MISSED_EVENT ) {
			dprintf( D_FULLDEBUG, "Got ULOG_MISSED_EVENT, done.\n" );
			EXIT_FAILURE;
		} else if( outcome == ULOG_UNK_ERROR ) {
			dprintf( D_FULLDEBUG, "Got ULOG_UNK_ERROR, done.\n" );
			EXIT_FAILURE;
		} else {
			EXCEPT( "Unknown result reading user log." );
		}
	}

	EXIT_FAILURE;
	return 1; /* meaningless, but it makes Windows happy */
}


text:
#include <bb/cascades/Application>
#include <bb/cascades/AbstractPane>
#include <bb/cascades/NavigationPane>
#include <bb/cascades/Menu>
#include <bb/cascades/TabbedPane>

#include "ActionCommand.h"
#include "Connection.h"

using bb::cascades::AbstractPane;
using bb::cascades::AbstractActionItem;
using bb::cascades::Application;
using bb::cascades::NavigationPane;
using bb::cascades::Menu;
using bb::cascades::Page;
using bb::cascades::TabbedPane;

namespace truphone
{
namespace test
{
namespace cascades
{
    const QString ActionCommand::CMD_NAME = "action";

    ActionCommand::ActionCommand(Connection * const socket,
                                 QObject * parent)
        : Command(parent),
          client(socket)
    {
    }

    ActionCommand::~ActionCommand()
    {
    }

    bool ActionCommand::executeCommand(QStringList * const arguments)
    {
        bool ret = false;

        if (arguments->size() >= 1)
        {
            const QString name = arguments->first();
            arguments->removeFirst();
            if (name.isEmpty())
            {
                this->client->write(tr("ERROR: The name of the action is empty") + "\r\n");
            }
            else
            {
                const AbstractPane * const pane = Application::instance()->scene();
                if (name == "menu")
                {
                    if (arguments->size() == 1)
                    {
                        const Menu * const menu = Application::instance()->menu();
                        const QString settingsOrIndex = arguments->first();
                        arguments->removeFirst();

                        if (settingsOrIndex == "settings")
                        {
                            if (menu->settingsAction())
                            {
                                ret = executeAction(reinterpret_cast<AbstractActionItem*>(
                                                        menu->settingsAction()));
                                if (not ret)
                                {
                                    this->client->write(tr("ERROR: Failed to execute the menu " \
                                                        "settings action") + "\r\n");
                                }
                            }
                            else
                            {
                                this->client->write(tr("ERROR: There is no settings action " \
                                                    "in the menu") + "\r\n");
                            }
                        }
                        else
                        {
                            bool ok = false;
                            const int index = settingsOrIndex.toInt(&ok);
                            if (ok)
                            {
                                if (menu->actionAt(index))
                                {
                                    ret = executeAction(reinterpret_cast<AbstractActionItem*>(
                                                            menu->actionAt(index)));
                                    if (not ret)
                                    {
                                        this->client->write(tr("ERROR: Failed to execute the " \
                                                            "indexed menu action") + "\r\n");
                                    }
                                }
                                else
                                {
                                    this->client->write(tr("ERROR: That index is an invalid " \
                                                        "action") + "\r\n");
                                }
                            }
                            else
                            {
                                this->client->write(tr("ERROR: Menu index couldn't be converted"\
                                                    " to an integer") + "\r\n");
                            }
                        }
                    }
                    else
                    {
                        this->client->write(tr("ERROR: action menu <settings|index>") + "\r\n");
                    }
                }
                else if (name == "page")
                {
                    if (arguments->size() == 1)
                    {
                        const Page * const currentPage = findCurrentPage(pane);
                        if (currentPage)
                        {
                            bool ok = false;
                            const QString indexString = arguments->first();
                            arguments->removeFirst();
                            const int index = indexString.toInt(&ok);
                            if (ok)
                            {
                                if (currentPage->actionAt(index))
                                {
                                    ret = executeAction(currentPage->actionAt(index));
                                    if (not ret)
                                    {
                                        this->client->write(tr("ERROR: Failed to execute the " \
                                                            "indexed page action") + "\r\n");
                                    }
                                }
                                else
                                {
                                    this->client->write(tr("ERROR: Failed to find an action " \
                                                        "at that index") + "\r\n");
                                }
                            }
                            else
                            {
                                this->client->write(tr("ERROR: Page index couldn't be converted"\
                                                    "to an integer") + "\r\n");
                            }
                        }
                        else
                        {
                            this->client->write(tr("ERROR: Can't find the current page to "\
                                                "run the action") + "\r\n");
                        }
                    }
                    else
                    {
                        this->client->write(tr("ERROR: action page <index>") + "\r\n");
                    }
                }
                else if (pane)
                {
                    AbstractActionItem * action = pane->findChild<AbstractActionItem*>(name);
                    if (action)
                    {
                        ret = executeAction(action);
                    }
                    else
                    {
                        action = Application::instance()->findChild<AbstractActionItem*>(name);
                        if (action)
                        {
                            ret = executeAction(action);
                        }
                        else
                        {
                            action = findAction(pane, name);
                            if (action)
                            {
                                ret = executeAction(action);
                                if (not ret)
                                {
                                    this->client->write(tr("ERROR: Failed to execute the"\
                                                        " named action") + "\r\n");
                                }
                            }
                            else
                            {
                                this->client->write(
                                            tr("ERROR: Unable to find the named action") + "\r\n");
                            }
                        }
                    }
                }
                else
                {
                    this->client->write(tr("ERROR: Unable to obtain the root pane") + "\r\n");
                }
            }
        }
        else
        {
            this->client->write(tr("ERROR: You need to specify which action to run") + "\r\n");
        }

        return ret;
    }

    bool ActionCommand::executeAction(AbstractActionItem * const action)
    {
        bool ret = false;
        if (action)
        {
            bb::cascades::Application::processEvents();
            ret = QMetaObject::invokeMethod(action, "triggered");
            bb::cascades::Application::processEvents();
        }
        return ret;
    }

    AbstractActionItem * ActionCommand::findAction(
            const QObject * const obj,
            const QString& name,
            const size_t call_depth,
            const size_t max_call_depth)
    {
        AbstractActionItem *ret = NULL, *tmp = NULL;

        // check the call depth to avoid stack thrash
        if (call_depth < max_call_depth)
        {
            tmp = qobject_cast<AbstractActionItem*>(const_cast<QObject*>(obj));
            if (tmp)
            {
                // check this object
                const QString title = tmp->title();
                if (not title.isEmpty())
                {
                    if (title == name)
                    {
                        ret = tmp;
                    }
                }
            }
            // isn't this object, check the children
            if (not ret)
            {
                Q_FOREACH(const QObject * const child, obj->children())
                {
                    ret = findAction(child, name, call_depth+1, max_call_depth);
                    if (ret)
                    {
                        break;
                    }
                }
            }
        }

        return ret;
    }

    Page * ActionCommand::findCurrentPage(
            const AbstractPane * const pane,
            const size_t callLevel,
            const size_t maxCallLevel)
    {
        Page * ret = NULL;

        if (callLevel < maxCallLevel)
        {
            // the root scene has to be either be a tabbed pane, navigation pane
            // or a page. a page can't pop itself so we must be dealing with either
            // a navigation pane OR a tabbed pane
            const NavigationPane * const navPane = qobject_cast<const NavigationPane*>(pane);
            if (navPane)
            {
                ret = navPane->top();
            }
            else
            {
                const TabbedPane * const tabbedPane = qobject_cast<const TabbedPane*>(pane);
                if (tabbedPane)
                {
                    // we don't know what the tabbed pane is looked at so we need
                    // to recurse down and find out
                    ret = findCurrentPage(tabbedPane->activePane(),
                                          callLevel + 1,
                                          maxCallLevel);
                }
            }
        }

        return ret;
    }

    void ActionCommand::showHelp()
    {
        this->client->write(tr("> action <objectName/title>") + "\r\n");
        this->client->write(tr("> action menu <index>") + "\r\n");
        this->client->write(tr("> action page <index>") + "\r\n");
        this->client->write(tr("Execute an Action Item") + "\r\n");
    }
}  // namespace cascades
}  // namespace test
}  // namespace truphone


text:
<?php

namespace Tumblr\Post;

/* @class BaseClass
 * This abstract class is shared by all the different Post types
 */
abstract class BaseClass
{
	// date format string which the Tumblr API expects
	const DATE_FORMAT = "Y-m-d H:i:s T";

	// These are the fields present on all Post types
	protected $type;
	protected $state;
	protected $tags;
	protected $date;
	protected $markdown;
	protected $slug;
	protected $id;

	// when this is enabled, the __set will reject invalid attempts to update property values
	private $_enforce_set = true;

	// Populates this object with the fields from the provided Post object if provided
	public function __construct($post = null) {
		$this->_enforce_set = false;
		if(!is_null($post)) {
			foreach(get_object_vars($post) as $key=>$value) {
				$this->$key = $value;
			}
		}
		$this->type = end(explode("\\", strtolower(get_called_class())));
		$this->_enforce_set = true;
	}

	// standard getter
	public function __get($key) {
		return property_exists($this, $key) ? $this->$key : null;
	}

	// this setter adds logic to handle conversion of several format types
	// as well as enforces access rules on certain fields
	public function __set($key, $value) {
		switch(strtolower($key)) {
			case 'date':
				$value = gmdate(self::DATE_FORMAT, strtotime($value));
				break;
			case 'type':
				if($this->_enforce_set) throw new \Tumblr\Exception("Can not change Post type after creation.", \Tumblr\Exception::INVALID_PARAMS);
				break;
			case 'tags':
				if(is_array($value)) {
					$value = implode(", ", $value);
				}
				break;
		}

		if($this->_enforce_set && !property_exists($this, $key)) {
			throw new \Tumblr\Exception(sprintf("Unknown Tumblr Post field: %s", $key), \Tumblr\Exception::UNKNOWN_POST_FIELD);
		}

		$this->$key = $value;
	}

	// This method serializes the object into an options array for submitting to the API
	public function serialize() {
		$vars = array();
		// We do this because we only want the defined properties on the class
		// otherwise if we were saving a post which we retrieved from the API, the additional fields would cause it to be rejected
		foreach(get_class_vars(get_class($this)) as $key=>$value) {
			$vars[$key] = $this->$key;
		}
		return $vars;
	}
}


text:
package com.pl.tagc.tagcwebapp;

import org.junit.Test;
import org.meanbean.test.BeanTester;

/**
 *
 * @author Jeffrey Helgers.
 * Test the metaDataObject.
 */
public class MetaDataObjectTest {

	/**
	 * Test getters and setters.
	 */
	@Test
	public void test() {
		BeanTester beanTester = new BeanTester();
        beanTester.testBean(MetaDataObject.class);
	}

}


text:
using System;

class ConcatenationAndTypeCasting
{
    static void Main(string[] args)
    {
        string hello = "Hello";
        string world = "World";
        object c = hello + ' ' + world;
        string sentece = (string)c;
        Console.WriteLine(sentece);
    }
}