text:
package net.teamfruit.eewreciever2.common.command;

import java.util.List;
import java.util.SortedSet;

import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;

public interface IModCommand extends ICommand {
	String getFullCommandString();

	@Override
	List<String> getCommandAliases();

	int getRequiredPermissionLevel();

	SortedSet<SubCommand> getChildren();

	void printHelp(ICommandSender arg0);
}


text:
function [momentums,summary]=jnfmatch_geom(source,momentumsInit,defo,objfun,optim)
% Jackknife Match shape. It computes a matching between shapes using a bfgs
% optimization scheme.
%
% Inputs:
%   templateInit:  is a cell array of fshapes containing the initial mean template.
%   momentumsInit : a cell array with momentums
%   funresInit : a cell array with functional residuals.
%   defo: is a structure containing the parameters of the deformations.
%   objfun: is a structure containing the parameters of attachment term.
%   optim: is a structure containing the parameters of the optimization procedure (here gradient descent with adaptative step)
%
% Outputs:
%   meantemplate : a cell array of fshapes containing the mean template
%   momentums: a cell array with momentums
%   funres: a cell array with functional residuals.
%   summary: is a structure containing various informations about the
%       gradient descent.
%
% See also : enr_tan_free, denr_tan_free, fsatlas_tan_free
% Author : B. Charlier (2017)

global data templateG objfunc defoc deflag templatexc templatefc

%------%
% Init %
%------%

% check data
if isempty(data)
    error('Check that data is global variable.')
end
nb_obs = size(data,1); %number of observations
nb_match = size(data,2); % number of shape in each observation

% check template
if ~iscell(source)
    source={source};
end
n = sum(cellfun(@(y) size(y.x,1),source));  %total number of points
deflag = [0,cumsum(cellfun(@(y) size(y.x,1),source))];
d = size(source{1}.x,2); % dimension of the ambient space

templateG  = cellfun(@(y) y.G,source,'uniformOutput',0);
templatexc = cellfun(@(y) y.x,source,'uniformOutput',0);
templatefc = cellfun(@(y) y.f,source,'uniformOutput',0);

% print some informations
disp_info_dimension(data,source);

% check momentums
if isempty(momentumsInit)
    momentums = zeros(d*n,1);
end

%-----------%
%  options  %
%-----------%

list_of_variables = {'p'};

% check functional residuals
if ~iscell(objfun)
    objfun ={objfun};
    objfun = objfun(ones(1,size(data,2)));
end
objfun = set_objfun_option(objfun,source,data,list_of_variables);
% compute normalization coefficients
objfun =  compute_coefficents_normalization(objfun,source,data);

defoc = set_defo_option(defo,list_of_variables);

optim = set_optim_option(optim,objfun,list_of_variables,'enr_geom');

%-----------%
% Call bfgs %
%-----------%

objfunc = objfun;

tstart = tic;

[momentums,summary] = perform_bfgs(optim.bfgs.enr_name,momentums,optim.bfgs);

momentums = reshape(momentums,n,d);

% disp informations
telapsed = toc(tstart);
fprintf('\nTotal number of iterations : %d in %g sec  (%g sec per it)\n\n',summary.bfgs.nb_of_iterations,telapsed,telapsed/summary.bfgs.nb_of_iterations);

% Summary information : save real parameters
summary.parameters.defo = defoc;
summary.parameters.objfun = objfun;
summary.parameters.optim = optim;

end

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by Administrator on 2015/10/10.
 */
var IndexPager = require('../views/indexPager');
var database = require('../database');
module.exports = function(req,res){
    res.end(new IndexPager(database.list,req.session.isLogined).render());
};


text:
/**
 *
 */
package net.sleepymouse.jenkins.plugins.piborg.ledborg;

/**
 *
 */
public class Constants
{
	public enum Colour
	{
		BLUE, CYAN, GREEN, MAGENTA, RED, YELLOW, WHITE, OFF
	}

	/**
	 * Never construct
	 */
	private Constants()
	{}
}


text:
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;

namespace DotNetCore.CAP.Internal
{
    public class PublisherSentFailedException : Exception
    {
        public PublisherSentFailedException(string message) : base(message)
        {
        }

        public PublisherSentFailedException(string message, Exception? ex) : base(message, ex)
        {
        }
    }
}


text:
$(document).ready(function() {

/////page links listener/////
  $('#gem-show-container').on('click', '#comments-container', function(event){
    event.preventDefault();
    var $target = $(event.target)
    var url = ($target.attr('href'));
    $.ajax ({
      url: url,
      method: "GET"
    }).done(function(data){
      var $form = $(data).children('form');
      $('body').append($form)
    })
  })

/////deletes comments/////
  $('#gem-show-container').on('click', '#delete', function(event){
    event.preventDefault()
    var $target = $(event.target)
    var url = $target.attr('href')
    $.ajax({
        url: url,
        method: 'DELETE',
        success: function(){
          $target.closest('#comment-start').remove()
        }
    })
  })

 /////edit submission form listener/////
  $('body').on('submit', '.edit_comment', function(event){
    event.preventDefault();
    var $target = $(event.target)
    var $url = $('body').children('form')["0"].getAttribute('action')
    var data = $target.serialize()
    var $form = $(this).closest('form');
    $.ajax({
      url: $url,
      method: "PUT",
      data: data,
      dataType: 'JSON'
    }).done(function(data){
      var $commentId = $('body').children('form')["0"].getAttribute('action').substring(17)
      var spanId = "#comment-"+ $commentId
      $(spanId).html(data.content)
      $target.remove();
    })
  })

/////new comment submission form listener/////
  $('body').on('submit', '#new_comment', function(event){
    event.preventDefault();
    var $form = $(this);
    var data = $form.serialize();
    var $target = $(event.target)
    var $url = $('body').children('form')["0"].getAttribute('action');
    $.ajax ({
      url: $url,
      method: "POST",
      data: data,
      dataType: 'html'
    }).done(function(response){
      var $commentToPost = $(response).children('#gem-show-page').children('#gem-show-container').children('#comments-container').children('#comment-start:first')
      $('#comments-container').prepend($commentToPost)
      $target.remove();

    })
  })

/////Listener for cancel button/////
  $('body').on('click', '.mapboxgl-popup-close-button', function(event){
    event.preventDefault();
    this.parentElement.remove();
  })

});


text:
/******************************BEGINNING OF FILE******************************/
//Programmer : Gary Steelman
//Date       : 3 Dec 07
//File       : gws4g2_Field.h
//Purpose    : Includes the class Field definition

#ifndef FIELD_H
#define FIELD_H

#include <iostream>
#include <fstream>
#include <cmath>
#include <ctime>
#include "gws4g2_SlugBot.h"
#include "gws4g2_Field.h"
#include "gws4g2_Definitions.h"
#include "gws4g2_Mine.h"
#include "gws4g2_Slug.h"

class Field {
public:
	//Gives the SlugBot class access to the Field class' members
	friend class SlugBot;

	/*Pre: none
    Post: creates a Field with the starting values as indicated */
	Field(int slugs = STARTINGSLUGS,
				int mines = STARTINGMINES,
			  int size = STARTINGSIZE);

	/*Pre: A field object has a value at the passed point
    Post: returns whether or not the location has a slug in it */
	bool hasSlug (const Point &location);

	/*Pre: A field object has a value at the passed point
    Post: returns whether or not the location has a mine in it */
	bool hasMine (const Point &location);

	/*Pre: A field object has a value at the passed point
    Post: returns whether or not the location is empty */
	bool isEmpty(const Point &location);

	/*Pre: A field object has been created
    Post: Outputs the field object */
	friend ostream& operator<<(ostream &o, const Field &f);

	/*Pre: A field object has been created
    Post: returns the length of one side of the field */
	int getFieldSize() const;

  /*Pre: A field object has been created
    Post: returns the damage done by a mine */
  float getMine() const;

  /*Pre: A field object has been created
    Post: returns the energy gained by devouring a slug */
  float getSlug() const;

  /*Pre: A field object has been created
    Post: returns the amount of energy lost by taking a step in the field */
  float getLoss() const;

	/*Pre: A field object has been created
    Post: sets the size of one leg of the field to the passed value */
	void setFieldSize();

	/*Pre: A field object has been created
    Post: sets the number of mines to have on the field */
	void setNumMines();

  /*Pre: A field object has been created
    Post: sets the number of slugs to have on the field */
	void setNumSlugs();

private:
	int m_numSlugs; //The number of slugs on the field
	int m_numMines; //The number of mines on the field
	int m_fieldSize; //The length of one side of the field
	char m_field[MAXFIELDSIZE][MAXFIELDSIZE]; //The field representation

	/*Pre: None
    Post: Scatters the slugs on the field in random spots
    Note: Will not create a slug at position 0,0 */
	void scatterSlugs();

	/*Pre: None
    Post: Scatters the mines on the field in random spots that slugs do not
      already exist
    Note: Will not create a mine at position 0,0 */
	void scatterMines();

	/*Pre: None
    Post: Fills the field with blank spaces */
	void clearField();

};

#endif

/*********************************END OF FILE*********************************/


text:
package com.fhc25.percepcion.osiris.mapviewer.manager.indoor.builders.format2;

import com.fhc25.percepcion.osiris.mapviewer.manager.indoor.builders.BuildingElementBuilder;
import com.fhc25.percepcion.osiris.mapviewer.model.indoor.Elevator;
import com.fhc25.percepcion.osiris.mapviewer.model.location.Feature;
import com.fhc25.percepcion.osiris.mapviewer.model.location.LineString;

import java.util.Locale;

public class ElevatorBuilder2  implements BuildingElementBuilder<Elevator> {

    @Override
    public Elevator build(Feature feature) {

        Elevator elevator = null;

        if (feature.getProperties().containsKey("@type") &&
                feature.getProperties().get("@type").matches("way") &&
                feature.getProperties().containsKey("indoor") &&
                feature.getProperties().get("indoor").matches("elevator")) {
            elevator = createElevator(feature);
        }

        return elevator;
    }

    private Elevator createElevator(Feature feature) {
        LineString line = (LineString) feature.getGeometry();

        Long id = Long.parseLong(feature.getProperties().get("@id"));

        String level = feature.getProperties().get("level");

        String name = "";
        String locale = Locale.getDefault().getLanguage();

        if (feature.getProperties().containsKey("name:" + locale)) {
            name = feature.getProperties().get("name:" + locale);
        } else if (feature.getProperties().containsKey("name")) {
            name = feature.getProperties().get("name");
        }

        try {
            Integer.parseInt(level);
        } catch (NumberFormatException e) {
            return null;
        }

        return new Elevator(id, name, line, level);
    }
}


text:
Role Name
=========

This role creates and enables necessary site configurations for apache to run piwik over ssl. This role also disables default http site configuration 00-default of apache for the sake of hardening apache a bit. Note! Ubuntu's self signed certificates are used by default and should be replaced with properly signed certificates.

Requirements
------------

In order to be able to have a proper ssl capable Piwik site configuration for Apache, you must provide information about the proper server certificate locations in the target system.

Define the server certificate locations in ./roles/piwik-ssl/defaults/main.yml

Role Variables
--------------

./defaults/main.yml

/* the server certificate locations */
sslcert: '/etc/ssl/certs/ssl-cert-snakeoil.pem'
sslkey: '/etc/ssl/private/ssl-cert-snakeoil.key'
#sslchain: '/etc/ssl/forgeservicelab.fi.crt.chain'

/* misc apache related settings */
piwik_ssl:apache:user - the user the piwik is installed for. e.g. www-data
piwik_ssl:apache:group - the group the piwik is installed for. e.g. www-data
piwik_ssl:apache:service - the service to be notified. This is apache2 in Ubuntu.
piwik_ssl:settings:locations:dest - the install dir of piwik
ip_range - defines the IP range where the web access to piwik is allowed from

Dependencies
------------

ansible-piwik (https://git.forgeservicelab.fi/ansible-roles/ansible-piwik) should be executed to deploy a default piwik prior to configuring it further with this role.

Example Usage
----------------

````
# requirements.yml
- src: git+ssh://gitlab@git.forgeservicelab.fi:10022/ansible-roles/ansible-piwik.git
  path: roles/
  name: ansible-piwik

- src: git+ssh://gitlab@git.forgeservicelab.fi:10022/ansible-roles/piwik-ssl.git
  path: roles/
  name: piwik-ssl
````

Install roles defined in your requirements.yml

````
$ ansible-galaxy install -r requirements.yml
````

````
# site.yml
- hosts: all
  sudo: True
  roles:
    - ansible-piwik
    - piwik-ssl
````
Run your playbook site.yml. Extra variable IP is used to configure apache to allow web browser access to piwik from the defined IP address"

````
$ ansible-playbook -i inventory site.yml --extra-vars "ip_range=IP"
````

License
-------

MIT

Author Information
------------------

Pasi Kivikangas, pasi.kivikangas@digile.fi


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Etilic.Text
{
    /// <summary>
    /// Represents a position in an input source.
    /// </summary>
    public struct Position
    {
        #region Properties
        /// <summary>
        /// Gets the line number.
        /// </summary>
        public Int32 Line
        {
            get;
            private set;
        }
        /// <summary>
        /// Gets the column number.
        /// </summary>
        public Int32 Column
        {
            get;
            private set;
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Constructs a new position from a line and column number.
        /// </summary>
        /// <param name="line">The line number.</param>
        /// <param name="column">The column number.</param>
        public Position(Int32 line, Int32 column) : this()
        {
            this.Line = line;
            this.Column = column;
        }
        #endregion
    }
}


text:
Have a question? [![Join the chat at https://gitter.im/AutoDIContainer/Lobby](https://badges.gitter.im/AutoDIContainer/Lobby.svg)](https://gitter.im/AutoDIContainer/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.svg?style=flat&label=AutoDI)](https://www.nuget.org/packages/AutoDI/)
[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.Build.svg?style=flat&label=AutoDI.Build)](https://www.nuget.org/packages/AutoDI.Build/)
[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.AspNetCore.svg?style=flat&label=AutoDI.AspNetCore)](https://www.nuget.org/packages/AutoDI.AspNetCore/)

![Build Status](https://github.com/Keboo/AutoDI/workflows/.NET%20Core/badge.svg?branch=master)

AutoDI is both a dependency injection container and a framework to simplify working with dependency injection (DI). It is built on top of the [Microsoft.Extensions.DependencyInjection.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/) library, and it works very similar to [the way ASP.NET Core handles dependency injection](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection).

AutoDI delivers delivers two excellent features:
1. It is built on [Microsoft.Extensions.DependencyInjection.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/) library to bring the same flavor of dependency injection enjoyed on ASP.NET Core to other platforms (.NET Framework, WPF, Xamarin, UWP, etc).
2. It generates container registrations _at compile time_ using conventions (of course you can also add more at run-time as well).

See the [wiki](https://github.com/Keboo/AutoDI/wiki) for more details or check out the [Quick Start](https://github.com/Keboo/AutoDI/wiki/Quick-Start) page to get up and running fast.

## Why do I need this?

The goal of this library is to make dependency injection as simple as adding a NuGet package.

In addition to standard constructor dependency injection, it also allows optional constructor parameters that will be resolved when the constructor is invoked.

In a typical DI setup, you can often find objects needing to take in dependencies that the object itself is not using, but needs them to pass into some other object. The bigger and deeper the object model gets, the worse this becomes.
As a specific example, imagine you are inside of class `Foo` and wish to create an instance of `Bar`, but `Bar` has a dependency on `IService`.
In many cases, one of several options can be used:
* Pass a facade to either the DI container or a factory that can create a `Bar`
* Add a dependency on `Foo` to take in an `IService` so that when it needs to create a `Bar` it can simply pass the instance to `Bar`'s constructor.

Though both these options work, they add additional effort. After all, in many cases, when we want a `Bar` we simply call `new Bar();`. AutoDI lets you write exactly that, and moves the dependency resolution inside of `Bar`'s constructor.
This dependency resolution is then forwarded to the DI container to resolve it.

## Does it work with <my favorite DI container / framework>?
Probably.
Take a look at the [AutoDI.Examples](https://github.com/Keboo/AutoDI.Examples) repository for samples. There are examples of adding support for other DI containers as well as simple examples for most frameworks.

*Don't see your favorite listed? I accept PRs.*

### Icon
<img src="https://raw.github.com/Keboo/AutoDI/master/Icons/needle.png" width="64">

[Needle](https://materialdesignicons.com/icon/needle) designed by [Austin Andrews](https://thenounproject.com/prosymbols/) from [Material Design Icons](https://materialdesignicons.com/)


text:
<resources>

    <!--
        Base application theme for API 14+. This theme completely replaces
        AppBaseTheme from BOTH res/values/styles.xml and
        res/values-v11/styles.xml on API 14+ devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
        <!-- API 14 theme customizations can go here. -->
        <item name="android:actionModeCloseDrawable">@drawable/ic_action_back</item>
    </style>

</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/anticipate_interpolator">
    <alpha
        android:fromAlpha="1"
        android:toAlpha="0"
        android:duration="200" />
    <translate
        android:fromYDelta="0"
        android:toYDelta="30%p"
        android:duration="200" />

</set>


text:
package it.univaq.mwt.common.spring;

import org.springframework.security.core.GrantedAuthority;

public class GrantedAuthorityImpl implements GrantedAuthority {

	private String role;

	public GrantedAuthorityImpl(String role) {
		super();
		this.role = role;
	}

	@Override
	public String getAuthority() {
		return role;
	}

	@Override
	public String toString() {
		return "[autority=" + role + "]";
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/panel_bg"
    android:orientation="vertical" >

    <include layout="@layout/order_top_bar" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:scrollbarSize="3dip"
        android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb" >

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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:background="@drawable/shape"
                android:gravity="center"
                android:orientation="horizontal" >

                <TextView
                    style="@style/order_detail.state"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dip"
                    android:layout_marginTop="5dip"
                    android:text="@string/current_state" />

                <TextView
                    android:id="@+id/current_state_value"
                    style="@style/order_detail.state"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dip"
                    android:layout_marginTop="5dip" />
            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/tool_bar_bg" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_marginLeft="5dip"
                    android:text="@string/receipt_base_top_title"
                    android:textColor="@color/black" />
            </RelativeLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:orientation="vertical" >

                <!-- 客户名称 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/receipt_base_customer_name" />

                <EditText
                    android:id="@+id/receipt_base_customer_name_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:editable="false"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 税号 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_customer_tax" />

                <EditText
                    android:id="@+id/receipt_base_customer_tax_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:editable="false"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 税务分局 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_tax_officer" />

                <EditText
                    android:id="@+id/receipt_base_tax_officer_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:editable="false"
                    android:background="@drawable/edit_text_state_bg" />
                <!-- 上门地址 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_service_address" />

                <EditText
                    android:id="@+id/receipt_base_service_address_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />
                <!-- 联系人 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_contact_name" />

                <EditText
                    android:id="@+id/receipt_base_contact_name_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 客户电话 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_customer_tel" />

                <EditText
                    android:id="@+id/receipt_base_customer_tel_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 客户手机 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_customer_mobile" />

                <EditText
                    android:id="@+id/receipt_base_customer_mobile_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 到达时间 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_service_time" />

                <EditText
                    android:id="@+id/receipt_base_service_time_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:editable="false"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 单据号 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:editable="false"
                    android:text="@string/receipt_base_number" />

                <EditText
                    android:id="@+id/receipt_base_number_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 客户签名 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_customer_sign" />

                <EditText
                    android:id="@+id/receipt_base_customer_sign_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <!-- 备注 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:text="@string/receipt_base_customer_remark" />

                <EditText
                    android:id="@+id/receipt_base_customer_remark_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edit_text_state_bg" />

                <LinearLayout
                    android:id="@+id/tec_name_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/receipt_base_tec_name" />

                    <EditText
                        android:id="@+id/receipt_base_tec_name_value"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:editable="false"
                        android:background="@drawable/edit_text_state_bg" />
                </LinearLayout>

                <!-- 上门维护单Panel -->

                <LinearLayout
                    android:id="@+id/maintance_panel"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" >

                    <!-- 服务方式 -->

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/receipt_base_customer_solve" />

                    <RadioGroup
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal" >

                        <RadioButton
                            android:id="@+id/serviceRadio1"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="上门"
                            android:checked="true"
                            android:textColor="@color/black" />

                        <RadioButton
                            android:id="@+id/serviceRadio2"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="用户送修"
                            android:textColor="@color/black" />
                    </RadioGroup>

                    <!-- 是否收费 -->

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/order_is_charge" />

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

                        <RadioGroup
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal" >

                            <RadioButton
                                android:id="@+id/feeRadio1"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="否"
                                android:textColor="@color/black" />

                            <RadioButton
                                android:id="@+id/feeRadio2"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="2dip"
                                android:text="是"
                                android:textColor="@color/black"
                                android:textSize="16sp" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="10dip"
                                android:text="金额"
                                android:textColor="@color/black"
                                android:textSize="16sp" />

                            <EditText
                                android:id="@+id/fee_value"
                                android:layout_width="30dip"
                                android:layout_height="wrap_content"
                                android:background="@drawable/edit_text_state_bg"
                                android:inputType="numberDecimal" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="3dip"
                                android:text="元"
                                android:textColor="@color/black"
                                android:textSize="16sp" />
                        </RadioGroup>
                    </LinearLayout>
                    <!-- 软件型号及编号 -->

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/receipt_base_software_type" />

                    <EditText
                        android:id="@+id/receipt_base_software_type_value"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/edit_text_state_bg" />

                    <!-- 软件版本号 -->

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/receipt_base_software_version" />

                    <EditText
                        android:id="@+id/receipt_base_software_version_value"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/edit_text_state_bg" />

                    <!-- 使用环境 -->

                    <TextView
                        style="@style/order_detail.baseinfo_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="3dip"
                        android:text="@string/receipt_base_software_env" />

                    <EditText
                        android:id="@+id/receipt_base_software_env_value"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/edit_text_state_bg" />
                </LinearLayout>

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

                    <CheckBox
                        android:id="@+id/is_upload_base_info"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:button="@drawable/checkbox_state_bg" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dip"
                        android:text="@string/is_upload_base_info" />
                </LinearLayout>
            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dip"
                android:background="@drawable/tool_bar_bg" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_marginLeft="5dip"
                    android:text="@string/receipt_fee"
                    android:textColor="@color/black" />
            </RelativeLayout>

            <!-- 费用过程 -->

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dip"
                android:layout_marginRight="30dip"
                android:text="@string/receipt_base_customer_charge"
                android:textColor="@color/baidu_blue"
                android:textSize="16sp" />

            <EditText
                android:id="@+id/receipt_base_customer_charge_value"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dip"
                android:layout_marginRight="30dip"
                android:layout_marginTop="3dip"
                android:text="无"
                android:background="@drawable/edit_text_state_bg" />

            <LinearLayout
                android:id="@+id/cost_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:orientation="vertical" >
            </LinearLayout>

            <LinearLayout
                android:id="@+id/receipt_visit_order"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:visibility="gone" >

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dip"
                    android:background="@drawable/tool_bar_bg" >

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_marginLeft="5dip"
                        android:text="@string/receipt_information"
                        android:textColor="@color/black" />
                </RelativeLayout>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:text="@string/receipt_type"
                    android:textColor="@color/black"
                    android:textSize="16sp" />

                <!--<EditText
                    android:id="@+id/receipt_type_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:singleLine="false" />-->
                <Spinner
                        android:id="@+id/receipt_type_value"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="15dip"
                        android:layout_marginRight="15dip"
                        >

                </Spinner>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:text="@string/product_case"
                    android:textColor="@color/black"
                    android:textSize="16sp" />

                <EditText
                    android:id="@+id/product_case_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:singleLine="false"
                    android:text="开票系统运行正常" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:text="@string/dispose_result"
                    android:textColor="@color/black"
                    android:textSize="16sp" />

                <EditText
                    android:id="@+id/dispose_result_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dip"
                    android:layout_marginRight="15dip"
                    android:singleLine="false"
                    android:text="检测开票,备份数据" />

                <!-- 您对我公司服务的总体评价是 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:layout_marginLeft="10dip"
                    android:textColor="@color/black"
                    android:textSize="16sp"
                    android:text="@string/receipt_base_customer_satisfied1" />

                <RadioGroup
                    android:id="@+id/receipt_base_customer_satisfied1_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dip"
                    android:orientation="horizontal" >

                    <RadioButton
                        android:id="@+id/satisfied1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied1"
                        android:checked="true"
                        android:textColor="@color/black" />

                    <RadioButton
                        android:id="@+id/satisfied2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied2"
                        android:textColor="@color/black" />

                    <RadioButton
                        android:id="@+id/satisfied3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied3"
                        android:textColor="@color/black" />
                </RadioGroup>

                <!-- 您对我公司产品的总体评价是 -->

                <TextView
                    style="@style/order_detail.baseinfo_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dip"
                    android:textColor="@color/black"
                    android:layout_marginLeft="10dip"
                    android:textSize="16sp"
                    android:text="@string/receipt_base_customer_satisfied2" />

                <RadioGroup
                    android:id="@+id/receipt_base_customer_satisfied2_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dip"
                    android:orientation="horizontal" >

                    <RadioButton
                        android:id="@+id/satisfied21"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied1"
                        android:checked="true"
                        android:textColor="@color/black" />

                    <RadioButton
                        android:id="@+id/satisfied22"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied2"
                        android:textColor="@color/black" />

                    <RadioButton
                        android:id="@+id/satisfied23"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/satisfied3"
                        android:textColor="@color/black" />
                </RadioGroup>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/service_help"
                    android:textColor="@color/black"
                    android:textSize="20sp"
                    android:layout_marginLeft="10dip"  />
            </LinearLayout>

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="20dip"
                android:background="@drawable/normal_btn_click"
                android:onClick="SaveBaseInfoBtnClick"
                android:text="@string/make_sure" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="15dip"
                android:background="@drawable/normal_btn_click"
                android:onClick="BackBtnClick"
                android:text="@string/back" />
        </LinearLayout>
    </ScrollView>

</LinearLayout>


text:
<?php
// 用户模型
namespace Home\Model;
use \Home\Model\CommonModel;
class UserModel extends CommonModel {
	public $_validate	=	array(
		array('account','/^[a-z]\w{3,}$/i','帐号格式错误'),
		array('password','require','密码必须'),
		array('nickname','require','昵称必须'),
		array('repassword','require','确认密码必须'),
		array('repassword','password','确认密码不一致',self::EXISTS_VALIDATE,'confirm'),
		array('account','','帐号已经存在',self::EXISTS_VALIDATE,'unique',self::MODEL_INSERT),
		);

	public $_auto		=	array(
		array('password','pwdHash',self::MODEL_BOTH,'callback'),
		array('create_time','time',self::MODEL_INSERT,'function'),
		array('update_time','time',self::MODEL_UPDATE,'function'),
		);

	protected function pwdHash() {
		if(isset($_POST['password'])) {
			return pwdHash($_POST['password']);
		}else{
			return false;
		}
	}

    function hasRole($userId) {
        $table = $this->tablePrefix.'role_user';
        $rs = $this->db->query('select role_id from '.$table.' where user_id='.$userId);
        if (isset($rs)) {
            return true;
        }
        return false;
    }
}


text:
package org.spdx.rdfparser;

import java.util.ArrayList;

import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Resource;

/**
 * Special class of license to represent no asserted license license in the file or packages
 * @author Gary O'Neall
 *
 */
public class SpdxNoAssertionLicense extends SPDXLicenseInfo {

	/**
	 * @param model
	 * @param licenseInfoNode
	 * @throws InvalidSPDXAnalysisException
	 */
	public SpdxNoAssertionLicense(Model model, Node licenseInfoNode)
			throws InvalidSPDXAnalysisException {
		super(model, licenseInfoNode);
	}

	/**
	 *
	 */
	public SpdxNoAssertionLicense() {
		super();
	}

	/* (non-Javadoc)
	 * @see org.spdx.rdfparser.SPDXLicenseInfo#_createResource(com.hp.hpl.jena.rdf.model.Model)
	 */
	@Override
	protected Resource _createResource(Model model) {
		return model.createResource(SpdxRdfConstants.SPDX_NAMESPACE+SpdxRdfConstants.TERM_LICENSE_NOASSERTION);
	}

	/* (non-Javadoc)
	 * @see org.spdx.rdfparser.SPDXLicenseInfo#toString()
	 */
	@Override
	public String toString() {
		return SPDXLicenseInfoFactory.NOASSERTION_LICENSE_NAME;
	}

	/* (non-Javadoc)
	 * @see org.spdx.rdfparser.SPDXLicenseInfo#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if (o instanceof SpdxNoAssertionLicense) {
			// All instances of this type are considered equal
			return true;
		} else {
			// covers o == null, as null is not an instance of anything
			return false;
		}
	}

	/* (non-Javadoc)
	 * @see org.spdx.rdfparser.SPDXLicenseInfo#verify()
	 */
	@Override
	public ArrayList<String> verify() {
		return new ArrayList<String>();
	}

}


text:
author: jeffatwood
comments: true
date: 2010-01-06 00:19:09+00:00
layout: post
redirect_from: /2010/01/eating-our-own-careers-dogfood
hero:
slug: eating-our-own-careers-dogfood
title: Eating Our Own Careers Dogfood
wordpress_id: 2454
tags:
- company
- careers
- community
---

In software development circles, [eating your own dogfood](http://www.codinghorror.com/blog/archives/000287.html) is shorthand for using your own software.

I was ecstatic the first time I used Stack Overflow to ask a programming question about the code that goes into Stack Overflow. And I was even _more_ thrilled when I performed a programming related search that returned a useful Stack Overflow link in the results. This is "dogfooding" at its best.

![](/images/wordpress/dogfood.jpg)

Dogfood. There's nothing more delicious. Mmm, mmm good!

Well, I'm proud to announce that we've reached yet another dogfooding milestone -- we're thinking of **hiring another programmer to work on Stack Overflow ... through [Stack Overflow Careers](http://careers.stackoverflow.com/)**. Naturally.

Now, this will just be **a part-time gig to start**. It's difficult to expand the Stack Overflow team because we all have the unusual benefit of extensive prior work history together. [Jarrod](http://blog.stackoverflow.com/2009/01/welcome-stack-overflow-valued-associate-00002/) and [Geoff](http://blog.stackoverflow.com/2009/05/welcome-stack-overflow-valued-associate-00003/) knew what they were getting into when they signed up -- we're like a happy little dysfunctional family. It's highly likely this will turn into a full time thing, but we need some time to get to know each other first.

Some broad guidelines:

  * Everyone on the SO team works remotely from home, and sets their own schedule (mostly). We communicate through Skype and email, so you can be anywhere in the world. Good communication skills and sweet internet connection are of course a must.

  * If you are _in any way_ averse to the utility of an expedient hack, it is unlikely we're the right team for you. We appreciate elegance and continual refactoring as much as the next developer, but we love results even more.

  * We will be looking for people with some kind of track record on the public internet. Doesn't have to be an empire, but we want to see evidence of someone who ... do I really have to say it? ... is [Smart and Gets Things Done](http://rads.stackoverflow.com/amzn/click/1590598385).

  * While we are platform agnostic, the bulk of our work runs on Windows Server 2008, is written in C# 3.5 / ASP.NET MVC, and talks to SQL Server 2008. If any of that stuff is a turn-off, we're not the team for you.

Anyway, if you'd like to work on Stack Overflow with us, and the above guidelines seem reasonable -- I encourage you to [list your CV at Stack Overflow Careers](http://careers.stackoverflow.com/). Along with many other employers, that's where we will be looking. Because as responsible software developers, we gotta **eat our own dogfood**.


text:
resourceGroupName=$1
if [ "x$2" = "x" ]; then deploymentsToSkip=0; else deploymentsToSkip=$2; fi

# Get the name of the last deployment
deploymentName=$(azure group deployment list $resourceGroupName --json | jq "[.[] | {name:.name, timestamp: .properties.timestamp } ] | sort_by(.timestamp) | reverse | .[$deploymentsToSkip].name" --raw-output)

# Get a summary of the operations for the last deployment
azure group deployment operation list --resource-group $resourceGroupName --name $deploymentName --json | jq "[.[] | .properties | { provisioningState : .provisioningState, timestamp: .timestamp, resourceType:.targetResource.resourceType, resourceName:.targetResource.resourceName, error:.statusMessage.error}] | sort_by(.timestamp)"


text:
<?php

namespace Oro\Component\Action\Tests\Unit\Action;

use Doctrine\Common\Persistence\ManagerRegistry;

use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\PropertyAccess\PropertyPath;

use Oro\Component\Action\Model\ContextAccessor;
use Oro\Component\Action\Action\ActionInterface;
use Oro\Component\Action\Action\RemoveEntity;

class RemoveEntityTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ContextAccessor
     */
    protected $contextAccessor;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject|ManagerRegistry
     */
    protected $registry;

    /**
     * @var ActionInterface
     */
    protected $action;

    protected function setUp()
    {
        $this->contextAccessor = new ContextAccessor();

        $this->registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')
            ->getMock();

        $this->action = new RemoveEntity($this->contextAccessor, $this->registry);

        /** @var EventDispatcher $dispatcher */
        $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
            ->disableOriginalConstructor()
            ->getMock();
        $this->action->setDispatcher($dispatcher);
    }

    /**
     * @expectedException \Oro\Component\Action\Exception\InvalidParameterException
     * @dataProvider invalidOptionsDataProvider
     * @param array $options
     */
    public function testInitializeException(array $options)
    {
        $this->action->initialize($options);
    }

    /**
     * @return array
     */
    public function invalidOptionsDataProvider()
    {
        return [
            [[]],
            [[1, 2]]
        ];
    }

    public function testInitialize()
    {
        $target = new \stdClass();
        $this->action->initialize([$target]);
        $this->assertAttributeEquals($target, 'target', $this->action);
    }

    /**
     * @expectedException \Oro\Component\Action\Exception\InvalidParameterException
     * @expectedExceptionMessage Action "remove_entity" expects reference to entity as parameter, string is given.
     */
    public function testExecuteNotObjectException()
    {
        $context = new \stdClass();
        $target = 'test';
        $this->action->initialize([$target]);
        $this->action->execute($context);
    }

    /**
     * @expectedException \Oro\Component\Action\Exception\NotManageableEntityException
     * @expectedExceptionMessage Entity class "stdClass" is not manageable.
     */
    public function testExecuteNotManageableException()
    {
        $context = new \stdClass();
        $context->test = new \stdClass();
        $target = new PropertyPath('test');

        $this->registry->expects($this->once())
            ->method('getManagerForClass')
            ->with(get_class($context->test))
            ->will($this->returnValue(null));

        $this->action->initialize([$target]);
        $this->action->execute($context);
    }

    public function testExecute()
    {
        $context = new \stdClass();
        $context->test = new \stdClass();
        $target = new PropertyPath('test');

        $em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
            ->disableOriginalConstructor()
            ->getMock();
        $em->expects($this->once())
            ->method('remove')
            ->with($context->test);

        $this->registry->expects($this->once())
            ->method('getManagerForClass')
            ->with(get_class($context->test))
            ->will($this->returnValue($em));

        $this->action->initialize([$target]);
        $this->action->execute($context);
    }
}


text:
package org.kie.workbench.common.stunner.core.client.components.toolbox.actions;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.annotation.PreDestroy;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.inject.Inject;

import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler;
import org.kie.workbench.common.stunner.core.client.canvas.event.selection.CanvasClearSelectionEvent;
import org.kie.workbench.common.stunner.core.client.canvas.event.selection.CanvasSelectionEvent;
import org.kie.workbench.common.stunner.core.client.canvas.util.CanvasLayoutUtils;
import org.kie.workbench.common.stunner.core.client.command.CanvasCommandFactory;
import org.kie.workbench.common.stunner.core.client.command.CanvasViolation;
import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager;
import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService;
import org.kie.workbench.common.stunner.core.client.shape.view.event.MouseClickEvent;
import org.kie.workbench.common.stunner.core.command.CommandResult;
import org.kie.workbench.common.stunner.core.command.util.CommandUtils;
import org.kie.workbench.common.stunner.core.definition.morph.MorphDefinition;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
import org.kie.workbench.common.stunner.core.graph.content.view.View;
import org.kie.workbench.common.stunner.core.util.DefinitionUtils;
import org.kie.workbench.common.stunner.core.util.HashUtil;

/**
 * A toolbox action/operation for an Element in order to morph it into another one.
 */
@Dependent
public class MorphNodeToolboxAction extends AbstractToolboxAction {

    private static Logger LOGGER = Logger.getLogger(MorphNodeToolboxAction.class.getName());
    static final String KEY_TITLE = "org.kie.workbench.common.stunner.core.client.toolbox.morphInto";

    private final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager;
    private final CanvasCommandFactory<AbstractCanvasHandler> commandFactory;
    private final Event<CanvasSelectionEvent> selectionEvent;
    private final Event<CanvasClearSelectionEvent> clearSelectionEventEvent;

    private MorphDefinition morphDefinition;
    private String targetDefinitionId;

    @Inject
    public MorphNodeToolboxAction(final DefinitionUtils definitionUtils,
                                  final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                  final CanvasCommandFactory<AbstractCanvasHandler> commandFactory,
                                  final ClientTranslationService translationService,
                                  final Event<CanvasSelectionEvent> selectionEvent,
                                  final Event<CanvasClearSelectionEvent> clearSelectionEventEvent) {
        super(definitionUtils,
              translationService);
        this.sessionCommandManager = sessionCommandManager;
        this.commandFactory = commandFactory;
        this.selectionEvent = selectionEvent;
        this.clearSelectionEventEvent = clearSelectionEventEvent;
    }

    public MorphNodeToolboxAction setMorphDefinition(final MorphDefinition morphDefinition) {
        this.morphDefinition = morphDefinition;
        return this;
    }

    public MorphNodeToolboxAction setTargetDefinitionId(final String targetDefinitionId) {
        this.targetDefinitionId = targetDefinitionId;
        return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
                                                             final String uuid,
                                                             final MouseClickEvent event) {
        final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
        final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler,
                                                                                uuid).asNode();

        //deselect node to be morphed, to avoid showing toolbar while morphing
        clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler));

        //delay is used to overcome the toolbar animation while morphing the node
        final CommandResult<CanvasViolation> result =
                sessionCommandManager.execute(canvasHandler,
                                              commandFactory.morphNode(sourceNode,
                                                                       morphDefinition,
                                                                       targetDefinitionId,
                                                                       ssid));
        if (CommandUtils.isError(result)) {
            LOGGER.log(Level.SEVERE,
                       result.toString());
        } else {
            CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent,
                                                       canvasHandler,
                                                       uuid);
        }

        return this;
    }

    @Override
    protected String getTitleKey(final AbstractCanvasHandler canvasHandler,
                                 final String uuid) {
        return KEY_TITLE;
    }

    @Override
    protected String getTitleDefinitionId(final AbstractCanvasHandler canvasHandler,
                                          final String uuid) {
        return targetDefinitionId;
    }

    @Override
    protected String getGlyphId(final AbstractCanvasHandler canvasHandler,
                                final String uuid) {
        return targetDefinitionId;
    }

    @PreDestroy
    public void destroy() {
        morphDefinition = null;
        targetDefinitionId = null;
    }

    @Override
    public int hashCode() {
        return HashUtil.combineHashCodes(morphDefinition.hashCode(),
                                         targetDefinitionId.hashCode());
    }

    @Override
    public boolean equals(final Object o) {
        if (o instanceof MorphNodeToolboxAction) {
            MorphNodeToolboxAction other = (MorphNodeToolboxAction) o;
            return other.morphDefinition.equals(morphDefinition) &&
                    other.targetDefinitionId.equals(targetDefinitionId);
        }
        return false;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid
        android:color="@color/translucentActionbar">
    </solid>

    <padding
        android:left="20dp"
        android:top="4dp"
        android:right="20dp"
        android:bottom="4dp"    >
    </padding>

    <!-- Here is the corner radius -->
    <corners
        android:radius="50dp"   >
    </corners>
</shape>


text:
package org.januslabs.consul.kv.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class URLConfig extends BaseConfig {

  private String url;
  private String serviceName;

}


text:
/**@file tsk_xml.h
 * @brief Useful functions to manipulate xml document.
 *
 * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
 *

 */
#ifndef _TINYSAK_XML_H_
#define _TINYSAK_XML_H_

#include "tinysak_config.h"
#include "tsk_list.h"

#if HAVE_LIBXML2_H
#include <libxml/tree.h>

#define TSK_XML_NODE_IS_TEXTVALUE(node)							(node && node->type==XML_TEXT_NODE)
#define TSK_XML_NODE_SAFE_GET_TEXTVALUE(node)					(const char*)(TSK_XML_NODE_IS_TEXTVALUE(node)?(node->content):0)
#define TSK_XML_NODE_SKIP_COMMENTS(node)						while(node && (node->type==XML_COMMENT_NODE)) node = tsk_xml_find_node(node, 0, nft_next);

#define TSK_XML_NODE_SELECT_BY_NAME(qname)						nst_by_name, qname
#define TSK_XML_NODE_SELECT_BY_ATT(qname, att_name, att_value)	nst_by_att, qname, att_name, att_value
#define TSK_XML_NODE_SELECT_ATT_VALUE(qname, att_name)			nst_att_value, qname, att_name
#define TSK_XML_NODE_SELECT_CONTENT()							nst_content
#define TSK_XML_NODE_SELECT_END()								nst_end

#define TSK_XML_NAMESPACE_CREATE()								tsk_object_new(tsk_xml_namespace_def_t)
#define TSK_XML_NAMESPACE_FREE(self)							tsk_object_unref(self), self = 0

#define TSK_XML_ELEMENT_CREATE(element)							tsk_object_new(tsk_xml_element_def_t)
#define TSK_XML_ELEMENT_FREE(self)								tsk_object_unref(self), self = 0

#define TSK_XML_ATTRIBUTE_CREATE(attribute)						tsk_object_new(tsk_xml_attribute_def_t)
#define TSK_XML_ATTRIBUTE_FREE(self)							tsk_object_unref(self), self = 0

#define TSK_XML_SERIALIZE(result, element, strValue)\
	if(strValue) tsk_sprintf(&result, "<"##element##">%s</"##element##">", strValue); \
	else tsk_strupdate(&result, "");

/** C and XML Schema mapping */
typedef enum tsk_xml_type_e
{
	xt_none,
	xt_string,			/* xsd:string */
	xt_byte,			/* xsd:byte */
	xt_unsignedByte,	/* xsd:unsignedByte */
	xt_short,			/* xsd:short */
	xt_unsignedShort,	/* xsd:unsignedShort */
	xt_int,				/* xsd:int */
	xt_unsignedInt,		/* xsd:unsignedInt */
	xt_long,			/* xsd:long */
	xt_boolean,			/* xsd:boolean */
	xt_float,			/* xsd:float */
	xt_double			/* xsd:double */
}
tsk_xml_type_t;

/** Node finding types */
typedef enum tsk_xml_node_find_type_s
{
	nft_none,
	nft_children,
	nft_parent,
	nft_next,
	nft_prev
}
tsk_xml_node_find_type_t;

/** Element selection types */
typedef enum tsk_xml_node_select_type_s
{
	nst_by_name,
	nst_by_att,
	nst_att_value,
	nst_content,
	nst_end
}
tsk_xml_node_select_type_t;

/** XML namespace */
typedef struct tsk_xml_namespace_s
{
	TSK_DECLARE_OBJECT;

	char* prefix;
	char* value;
}
tsk_xml_namespace_t;

/** XML attribute */
typedef struct tsk_xml_attribute_s
{
	TSK_DECLARE_OBJECT;

	char* name;
	void* value;
	tsk_xml_type_t type;
}
tsk_xml_attribute_t;

/** XML element */
typedef struct tsk_xml_element_s
{
	TSK_DECLARE_OBJECT;

	char* name;
	void* value;
	tsk_list_t* elements;
	tsk_list_t* attributes;
	tsk_list_t* namespaces;
	tsk_xml_type_t type;
}
tsk_xml_element_t;

typedef tsk_list_t tsk_xml_elements_t;
typedef tsk_list_t tsk_xml_attributes_t;
typedef tsk_list_t tsk_xml_namespaces_t;

#define tsk_xml_elements_init		tsk_list_init
#define tsk_xml_attributes_init		tsk_list_init
#define tsk_xml_namespaces_init		tsk_list_init

#define tsk_xml_elements_add		tsk_list_add_data
#define tsk_xml_attributes_add		tsk_list_add_data
#define tsk_xml_namespaces_add		tsk_list_add_data

#define tsk_xml_elements_free		tsk_list_free
#define tsk_xml_attributes_free		tsk_list_free
#define tsk_xml_namespaces_free		tsk_list_free

//TINYSAK_API void tsk_xml_namespace_init(tsk_xml_namespace_t* _namespace);
//TINYSAK_API void tsk_xml_namespace_free(tsk_xml_namespace_t** _namespace);

//TINYSAK_API void tsk_xml_element_init(tsk_xml_element_t* element);
TINYSAK_API void tsk_xml_element_init_set(tsk_xml_element_t** element, const char* name, const char* value, tsk_xml_type_t type);
//TINYSAK_API void tsk_xml_element_free(void** element);

//TINYSAK_API void tsk_xml_attribute_init(tsk_xml_attribute_t* attribute);
//TINYSAK_API void tsk_xml_attribute_free(tsk_xml_attribute_t** attribute);

TINYSAK_API xmlNsPtr tsk_xml_get_namespace(xmlDocPtr docPtr, xmlNodePtr node, const char *href);
TINYSAK_API xmlNodePtr tsk_xml_find_node(const xmlNodePtr curr, const char* name, tsk_xml_node_find_type_t ftype);
TINYSAK_API xmlNodePtr tsk_xml_select_node(const xmlNodePtr root, ...);

TINYSAK_GEXTERN const void *tsk_xml_namespace_def_t;
TINYSAK_GEXTERN const void *tsk_xml_attribute_def_t;
TINYSAK_GEXTERN const void *tsk_xml_element_def_t;

#endif /* HAVE_LIBXML2_H */

#endif /* _TINYSAK_XML_H_ */


text:
using System;
using System.Threading.Tasks;
using Qlue.Logging;

namespace Qlue
{
    public class InvokeContext
    {
        private Func<object, string, ILog, Task<string>> notifyFunction;

        private ILog log;

        public string MessageId { get; private set; }

        public string CustomSessionId { get; private set; }

        public InvokeContext(string messageId, string customSessionId, Func<object, string, ILog, Task<string>> notifyFunction, ILog log)
        {
            this.MessageId = messageId;
            this.CustomSessionId = customSessionId;
            this.notifyFunction = notifyFunction;
            this.log = log;
        }

        public void SendNotify(object notifyObject, string topicName = null)
        {
            this.notifyFunction(notifyObject, topicName, this.log);
        }

        public Task<string> SendNotifyAsync(object notifyObject, string topicName = null)
        {
            return this.notifyFunction(notifyObject, topicName, this.log);
        }
    }
}


text:
package org.locationtech.geomesa.filter.function

import java.io.ByteArrayOutputStream

import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

@RunWith(classOf[JUnitRunner])
class Convert2ViewerFunctionTest extends Specification {

  "Convert2ViewerFunction" should {

    "encode and decode simple attributes" in {
      val initial = BasicValues(45.0f, 49.0f, System.currentTimeMillis(), Some("1200"))
      val encoded = Convert2ViewerFunction.encodeToByteArray(initial)
      encoded must haveLength(16)
      val decoded = Convert2ViewerFunction.decode(encoded)
      decoded.lat mustEqual(initial.lat)
      decoded.lon mustEqual(initial.lon)
      Math.abs(decoded.dtg - initial.dtg) must beLessThan(1000L) // dates get truncated to nearest second
      decoded.trackId.get.toInt mustEqual(initial.trackId.get.hashCode)
    }

    "encode and decode optional simple attributes" in {
      val initial = BasicValues(45.0f, 49.0f, System.currentTimeMillis(), None)
      val encoded = Convert2ViewerFunction.encodeToByteArray(initial)
      encoded must haveLength(16)
      val decoded = Convert2ViewerFunction.decode(encoded)
      decoded.lat mustEqual(initial.lat)
      decoded.lon mustEqual(initial.lon)
      Math.abs(decoded.dtg - initial.dtg) must beLessThan(1000L) // dates get truncated to nearest second
      decoded.trackId mustEqual(initial.trackId)
    }

    "encode and decode extended attributes" in {
      val initial = ExtendedValues(45.0f,
                                   49.0f,
                                   System.currentTimeMillis(),
                                   Some("1200"),
                                   Some(10))
      val encoded = Convert2ViewerFunction.encodeToByteArray(initial)
      encoded must haveLength(24)
      val decoded = Convert2ViewerFunction.decode(encoded)
      decoded must beAnInstanceOf[ExtendedValues]
      decoded.lat mustEqual(initial.lat)
      decoded.lon mustEqual(initial.lon)
      Math.abs(decoded.dtg - initial.dtg) must beLessThan(1000L) // dates get truncated to nearest second
      decoded.trackId.get.toInt mustEqual(initial.trackId.get.hashCode)
      decoded.asInstanceOf[ExtendedValues].label mustEqual(initial.label)
    }

    "encode and decode to an output stream" in {
      val time = System.currentTimeMillis()
      val one = ExtendedValues(45.0f,
        49.0f,
        time,
        Some("1200"),
        Some(1000))
      val two = ExtendedValues(45.0f,
        49.0f,
        time - 100,
        Some("1201"),
        Some(3000))
      val out = new ByteArrayOutputStream(48)
      Convert2ViewerFunction.encode(one, out)
      Convert2ViewerFunction.encode(two, out)
      val array = out.toByteArray
      array must haveLength(48)

      val decodedOne = Convert2ViewerFunction.decode(array.splitAt(24)._1)
      decodedOne must beAnInstanceOf[ExtendedValues]
      decodedOne.lat mustEqual(one.lat)
      decodedOne.lon mustEqual(one.lon)
      Math.abs(decodedOne.dtg - one.dtg) must beLessThan(1000L) // dates get truncated to nearest second
      decodedOne.trackId.get.toInt mustEqual(one.trackId.get.hashCode)
      decodedOne.asInstanceOf[ExtendedValues].label mustEqual(one.label)

      val decodedTwo = Convert2ViewerFunction.decode(array.splitAt(24)._2)
      decodedTwo must beAnInstanceOf[ExtendedValues]
      decodedTwo.lat mustEqual(two.lat)
      decodedTwo.lon mustEqual(two.lon)
      Math.abs(decodedTwo.dtg - two.dtg) must beLessThan(1000L) // dates get truncated to nearest second
      decodedTwo.trackId.get.toInt mustEqual(two.trackId.get.hashCode)
      decodedTwo.asInstanceOf[ExtendedValues].label mustEqual(two.label)
    }

    "encode faster to an output stream" in {
      skipped("integration")
      val times = 10000
      val one = ExtendedValues(45.0f, 49.0f, System.currentTimeMillis(), Some("1200"), Some(10000))
      val out = new ByteArrayOutputStream(24 * times)

      // the first test run always takes a long time, even with some initialization...
      // flip the order to get a sense of how long each takes
      val start2 = System.currentTimeMillis()
      val arrays = (0 to times).map(_ => Convert2ViewerFunction.encodeToByteArray(one))
      val total2 = System.currentTimeMillis() - start2
      println(s"array took $total2 ms")

      val start = System.currentTimeMillis()
      (0 to times).foreach(_ => Convert2ViewerFunction.encode(one, out))
      val total = System.currentTimeMillis() - start
      println(s"stream took $total ms")

      println
      success
    }
  }
}


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

<TITLE>
Uses of Class org.apache.hadoop.mapreduce.Counter (Hadoop 0.20.205.0 API)
</TITLE>

<META NAME="date" CONTENT="2011-10-07">

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.hadoop.mapreduce.Counter

Packages that use Counter

org.apache.hadoop.mapred
A software framework for easily writing applications which process vast
amounts of data (multi-terabyte data-sets) parallelly on large clusters
(thousands of nodes) built of commodity hardware in a reliable, fault-tolerant
manner.

org.apache.hadoop.mapreduce

Uses of Counter in org.apache.hadoop.mapred

Subclasses of Counter in org.apache.hadoop.mapred

static class
Counters.Counter

          A counter record, comprising its name and value.

Methods in org.apache.hadoop.mapred with parameters of type Counter

protected static

<INKEY,INVALUE,OUTKEY,OUTVALUE>

Reducer.Context

Task.<A HREF="../../../../../org/apache/hadoop/mapred/Task.html#createReduceContext(org.apache.hadoop.mapreduce.Reducer, org.apache.hadoop.conf.Configuration, org.apache.hadoop.mapreduce.TaskAttemptID, org.apache.hadoop.mapred.RawKeyValueIterator, org.apache.hadoop.mapreduce.Counter, org.apache.hadoop.mapreduce.Counter, org.apache.hadoop.mapreduce.RecordWriter, org.apache.hadoop.mapreduce.OutputCommitter, org.apache.hadoop.mapreduce.StatusReporter, org.apache.hadoop.io.RawComparator, java.lang.Class, java.lang.Class)">createReduceContext(Reducer<INKEY,INVALUE,OUTKEY,OUTVALUE> reducer,
                    Configuration job,
                    TaskAttemptID taskId,
                    RawKeyValueIterator rIter,
                    Counter inputKeyCounter,
                    Counter inputValueCounter,
                    RecordWriter<OUTKEY,OUTVALUE> output,
                    OutputCommitter committer,
                    StatusReporter reporter,
                    RawComparator<INKEY> comparator,
                    Class<INKEY> keyClass,
                    Class<INVALUE> valueClass)

Uses of Counter in org.apache.hadoop.mapreduce

Methods in org.apache.hadoop.mapreduce that return Counter

 Counter
Counters.findCounter(Enum<?> key)

          Find the counter for the given enum.

 Counter
CounterGroup.findCounter(String counterName)

protected  Counter
CounterGroup.findCounter(String counterName,
            String displayName)

          Internal to find a counter in a group.

 Counter
Counters.findCounter(String groupName,
            String counterName)

abstract  Counter
StatusReporter.getCounter(Enum<?> name)

 Counter
TaskInputOutputContext.getCounter(Enum<?> counterName)

abstract  Counter
StatusReporter.getCounter(String group,
           String name)

 Counter
TaskInputOutputContext.getCounter(String groupName,
           String counterName)

Methods in org.apache.hadoop.mapreduce that return types with arguments of type Counter

 Iterator<Counter>
CounterGroup.iterator()

Constructors in org.apache.hadoop.mapreduce with parameters of type Counter

ReduceContext(Configuration conf,
              TaskAttemptID taskid,
              RawKeyValueIterator input,
              Counter inputKeyCounter,
              Counter inputValueCounter,
              RecordWriter<KEYOUT,VALUEOUT> output,
              OutputCommitter committer,
              StatusReporter reporter,
              RawComparator<KEYIN> comparator,
              Class<KEYIN> keyClass,
              Class<VALUEIN> valueClass)

Reducer.Context(Configuration conf,
                TaskAttemptID taskid,
                RawKeyValueIterator input,
                Counter inputKeyCounter,
                Counter inputValueCounter,
                RecordWriter<KEYOUT,VALUEOUT> output,
                OutputCommitter committer,
                StatusReporter reporter,
                RawComparator<KEYIN> comparator,
                Class<KEYIN> keyClass,
                Class<VALUEIN> valueClass)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2009 The Apache Software Foundation


text:
<?php

namespace FSi\Bundle\FormExtensionsBundle\Behat\Context;

use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

class WebUserContext extends PageObjectContext
{
    /**
     * @When /^I open "([^"]*)" page$/
     */
    public function iOpenPage($pageName)
    {
        $this->getPage($pageName)->open();
    }

    /**
     * @Then /^I should see form field with label "([^"]*)" that is CKEditor$/
     */
    public function iShouldSeeFormFieldWithLabelThatIsCKEditor($label)
    {
        expect($this->getElement('Form')->hasField($label))->toBe(true);
        expect($this->getElement('Form')->isCKEditor($label))->toBe(true);
    }

    /**
     * @Given /^"([^"]*)" page should have CKEditor included once from "([^"]*)" url$/
     */
    public function pageShouldHaveCkeditorIncludedOnceFromUrl($pageName, $scriptUrl)
    {
        expect($this->getPage($pageName)->getScriptIncludes($scriptUrl))->toHaveCount(1);
    }
}


text:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonModGlossaryEditPage } from './edit';
import { CoreEditorComponentsModule } from '@core/editor/components/components.module';

@NgModule({
    declarations: [
        AddonModGlossaryEditPage,
    ],
    imports: [
        CoreComponentsModule,
        CoreDirectivesModule,
        CoreEditorComponentsModule,
        IonicPageModule.forChild(AddonModGlossaryEditPage),
        TranslateModule.forChild()
    ],
})
export class AddonModGlossaryNewDiscussionPageModule {}


text:
GNaP.Owin.Authentication.Jwt
============================

## Usage

Install from NuGet in your OWIN project: ```Install-Package GNaP.Owin.Authentication.Jwt```

You can now use ```app.UseJwtTokenIssuer()``` in your OWIN configuration.

## Example

```csharp
app.UseJwtTokenIssuer(new JwtTokenIssuerOptions
{
    Issuer = "urn:issuer",
    Audience = "urn:audience",
    TokenSigningKey = "U0lHTklOR19LRVlfR09FU19IRVJF",
    Authenticate = (username, password) =>
    {
        // Dummy example authentication check
        if (username.Equals("gnap"))
        {
            return new[]
            {
                new Claim(ClaimTypes.AuthenticationInstant, DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")),
                new Claim(ClaimTypes.AuthenticationMethod, AuthenticationTypes.Password),
                new Claim(ClaimTypes.Name, username),
                new Claim(ClaimTypes.Role, "Administrator")
            };
        }

        // Invalid user
        return null;
    }
});
```

## Request

```
POST /tokens HTTP/1.1
Content-Type: application/json
Accept: application/json

{ "username": "gnap", "password": "super secure pass!" }
```

## Response

```
HTTP/1.1 200 OK
Content-Type: application/json

{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdXRoX3RpbWUiOiIyMDE0LTEyLTA1VDIzOjAyOjE3Ljc3OFoiLCJhdXRobWV0aG9kIjoiUGFzc3dvcmQiLCJ1bmlxdWVfbmFtZSI6ImduYXAiLCJyb2xlIjoiQWRtaW5pc3RyYXRvciIsImlzcyI6InVybjppc3N1ZXIiLCJhdWQiOiJ1cm46YXVkaWVuY2UiLCJleHAiOjE0MTc4MjQxMzd9.YbEKE2Jktssh47uwbWwEM5MQmiunrrA4s7Umrm_9Fv8"}
```

## Debugging

You can paste the returned token in [jwt.io](http://jwt.io/) which will show you the content of the JWT.

![jwt.io debug](https://raw.githubusercontent.com/infrabel/GNaP.Owin.Authentication.Jwt/master/jwt.png)

## Options

### Issuer, Audience

Self-explanatory, the issuer and audience for the JWT.

### TokenSigningKey

A Base64 encoded secret. This secret should only be known on the server.

### IssuerPath

The REST endpoint from where to issue tokens from.

**Default**: /tokens

### TokenLifetime

The lifetime of the JWT.

**Default**: 1 hour

### Authenticate

A callback method which receives the username and password to be used in the authentication process.

If the user is valid, a list of claims should be returned.

If the user is invalid, return ```null```.

## NuGet

[GNaP.Owin.Authentication.Jwt](http://www.nuget.org/packages/GNaP.Owin.Authentication.Jwt/)

## Copyright

Copyright © 2014 Infrabel and contributors.

## License

GNaP.Owin.Authentication.Jwt is licensed under [BSD (3-Clause)](http://choosealicense.com/licenses/bsd-3-clause/ "Read more about the BSD (3-Clause) License"). Refer to [LICENSE](https://github.com/infrabel/GNaP.Owin.Authentication.Jwt/blob/master/LICENSE) for more information.


text:
    <input type="text" class="form-control" placeholder="Search for client" (keyup)="onKey($event)" />

    <ng-container *ngFor="let c of displayClients">

              {{ c.firstName }} {{ c.lastName }}

              $ {{ c.portfolioValue }}

    </ng-container>


text:
/* global Tracker */

import { compose as _compose } from 'react-komposer';

function getTrackerLoader(reactiveMapper) {
  return (props, onData, env) => {
    let trackerCleanup = null;
    const handler = Tracker.nonreactive(() => Tracker.autorun(() => {
      // assign the custom clean-up function.
      trackerCleanup = reactiveMapper(props, onData, env);
    }));

    return () => {
      if (typeof trackerCleanup === 'function') trackerCleanup();
      return handler.stop();
    };
  };
}

export const compose = (reactiveMapper, ...args) =>
  _compose(getTrackerLoader(reactiveMapper), ...args);

export default compose;


text:
using System;
using System.Runtime.InteropServices;
using DDS.OpenSplice.Kernel;

namespace DDS.OpenSplice.User
{
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    public delegate void observableActionFn(IntPtr p, IntPtr arg);

    public class Observable
    {
        /*
         *     void *
         *     u_observableGetUserData(
         *         const u_observable _this);
         */
        [DllImport("ddskernel", EntryPoint = "u_observableGetUserData", CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr GetUserData (
            IntPtr _this);

        /*
         *     void *
         *     u_observableSetUserData(
         *         const u_observable _this,
         *         void *userData);
         */
        [DllImport("ddskernel", EntryPoint = "u_observableSetUserData", CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr SetUserData (
            IntPtr _this,
            IntPtr userData);

        /*
         *     u_result
         *     u_observableAction(
         *         const u_observable _this,
         *         void (*action)(v_public p, void *arg),
         *         void *arg);
         */
        [DllImport("ddskernel", EntryPoint = "u_observableAction", CallingConvention = CallingConvention.Cdecl)]
        public static extern V_RESULT Action (
            IntPtr _this,
            observableActionFn action,
            IntPtr arg);
    }
}


text:
package eventstreams.agent

case class ResetEventsourceState() extends AgentControllerMessage


text:
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = 'Set Password';

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}"
];
?>

        <?= Html::img('@web/images/logo.png');?>

Hi <?= $model->username ?>, please set your password

        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>

        <?= $form
            ->field($model, 'new_pwd', $fieldOptions1)
            ->label(false)
            ->passwordInput(['placeholder' => 'New Password']) ?>

        <?= $form
            ->field($model, 'confirm_pwd', $fieldOptions2)
            ->label(false)
            ->passwordInput(['placeholder' => 'Confirm Password']) ?>

                <?= Html::submitButton('Save', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>

        <?php ActiveForm::end(); ?>

                    powered  by

                        <?= Html::img('@web/images/globe.png');?>


text:
module Copy
  class Revision < Base

    attr_accessor :id, :revision_id, :modified_time, :size, :latest, :conflict,
      :type, :creator

    def initialize(attributes = {})
      super(attributes)
      parse_creator
    end

    protected

    def parse_creator
      return unless creator
      @creator = Copy::User.new(creator)
    end

    # Parses UNIX timestamps and creates Time objects.
    def parse_timestamps
      super
      @modified_time = Time.at(modified_time) if modified_time
    end
  end
end


text:
layout: default
category: consumers
title: "OData Powershell Explorer"
link: "http://psodata.codeplex.com/"
---
An 'OData Explorer' PowerShell application designed to allow ad-hoc browsing of OData Services using the command line or GUI using WPK from the Microsoft PowerShell Pack.


text:
package edu.harvard.iq.dataverse.engine.command.impl;

import edu.harvard.iq.dataverse.Dataverse;
import edu.harvard.iq.dataverse.authorization.Permission;
import edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser;
import edu.harvard.iq.dataverse.engine.command.AbstractCommand;
import edu.harvard.iq.dataverse.engine.command.CommandContext;
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
import edu.harvard.iq.dataverse.engine.command.RequiredPermissions;
import edu.harvard.iq.dataverse.engine.command.exception.CommandException;
import edu.harvard.iq.dataverse.engine.command.exception.IllegalCommandException;
import edu.harvard.iq.dataverse.search.IndexResponse;
import java.sql.Timestamp;
import java.util.Date;

@RequiredPermissions(Permission.PublishDataverse)
public class PublishDataverseCommand extends AbstractCommand<Dataverse> {

    private final Dataverse dataverse;

    public PublishDataverseCommand(DataverseRequest aRequest, Dataverse dataverse) {
        super(aRequest, dataverse);
        this.dataverse = dataverse;
    }

    @Override
    public Dataverse execute(CommandContext ctxt) throws CommandException {
        if (dataverse.isReleased()) {
            throw new IllegalCommandException("Dataverse " + dataverse.getAlias() + " has already been published.", this);
        }

        Dataverse parent = dataverse.getOwner();
        // root dataverse doesn't have a parent
        if (parent != null) {
            if (!parent.isReleased()) {
                throw new IllegalCommandException("Dataverse " + dataverse.getAlias() + " may not be published because its host dataverse (" + parent.getAlias() + ") has not been published.", this);
            }
        }

        dataverse.setPublicationDate(new Timestamp(new Date().getTime()));
        dataverse.setReleaseUser((AuthenticatedUser) getUser());
        Dataverse savedDataverse = ctxt.dataverses().save(dataverse);
        /**
         * @todo consider also
         * ctxt.solrIndex().indexPermissionsOnSelfAndChildren(savedDataverse.getId());
         */
        /**
         * @todo what should we do with the indexRespose?
         */
        IndexResponse indexResponse = ctxt.solrIndex().indexPermissionsForOneDvObject(savedDataverse);
        return savedDataverse;

    }

}


text:
CREATE TABLE if not exists my_schema.my_table_delete2
             (id VARCHAR not null primary key, name VARCHAR) SALT_BUCKETS=4;
UPSERT INTO my_schema.my_table_delete2 values ('a','a_name');


text:
<!--

    The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
    (the "License"). You may not use this work except in compliance with the License, which is
    available at www.apache.org/licenses/LICENSE-2.0

    This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied, as more fully set forth in the License.

    See the NOTICE file distributed with this work for information regarding copyright ownership.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>alluxio-core-server</artifactId>
    <groupId>org.alluxio</groupId>
    <version>1.5.1-SNAPSHOT</version>
  </parent>
  <artifactId>alluxio-core-server-worker</artifactId>
  <packaging>jar</packaging>
  <name>Alluxio Core - Server - Worker</name>
  <description>Alluxio worker service</description>

  <properties>
    <!-- The following paths need to be defined here as well as in the parent pom so that mvn can -->
    <!-- run properly from sub-project directories -->
    <license.header.path>${project.parent.parent.parent.basedir}/build/license/</license.header.path>
    <checkstyle.path>${project.parent.parent.parent.basedir}/build/checkstyle/</checkstyle.path>
    <findbugs.path>${project.parent.parent.parent.basedir}/build/findbugs/</findbugs.path>
  </properties>

  <dependencies>
    <!-- External dependencies -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>com.qmino</groupId>
      <artifactId>miredot-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-all</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-server</artifactId>
    </dependency>

    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-client-fs</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-protobuf</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-server-common</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- External test dependencies -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Internal test dependencies -->
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-common</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <!-- Used by reflection -->
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-underfs-local</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- REST API documentation -->
      <plugin>
        <groupId>com.qmino</groupId>
        <artifactId>miredot-plugin</artifactId>
        <configuration>
          <!-- This following license only works for groupId org.alluxio and artifactId alluxio-core-server-worker -->
          <license>
            cHJvamVjdHxvcmcuYWxsdXhpby5hbGx1eGlvLWNvcmUtc2VydmVyLXdvcmtlcnwyMDE5LTAzLTMxfHRydWV8LTEjTUN3Q0ZHdEUzWjV6TlhPdkY2SXM3c3BWK3hGekhCZ0dBaFF6am5MdWJhSVNLRFBmSXhEV0FiN1V0VFd2U1E9PQ==
          </license>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/white" />
    <stroke android:width="1dp" android:color="@color/light_gray" />
    <corners android:topLeftRadius="6dp" android:topRightRadius="6dp"
        android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp"/>
</shape>