text:
import Bus from '../bus.es6.js';

var BookView = Backbone.View.extend({
    tagName: 'li',
    className: 'list-group-item',
    template: _.template(`

        <img src="<%= picture  %>"/>

<a href="#/books/<%= id %>"><%= title %>

        Author: <%= author %>
        <% if(state.showDetails) { %>

<%= description %>

                Price:  $<%= price %>

                ISBN:  <%= ISBN %>

        <% } %>
        <button class="btn btn-sm btn-success" action="add">
            Add to cart
        </button>
        <button class="btn btn-sm btn-default" action="toggle">
            <%= state.showDetails ? 'Hide details' : 'Show details' %>
        </button>

    `),
    events: {
        'click [action=toggle]' : 'toggleDetails',
        'click [action=add]' : 'addToCart',
    },
    initialize: function () {
        this.state = {
            showDetails: false
        };
        this.render();
    },
    render: function () {
        var data = _.extend(this.model.attributes, {
            state: this.state
        });
        this.$el.html(this.template(data));
        return this;
    },
    toggleDetails: function () {
        this.state.showDetails = !this.state.showDetails;
        this.render();
    },
    addToCart: function () {
        Bus.trigger("cart:add", this.model)
    }
});

export default BookView;


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="HandheldFriendly" content="true" />
  <link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" />
  <meta name="MobileOptimized" content="width" />
  <meta http-equiv="cleartype" content="on" />
  <meta http-equiv="ImageToolbar" content="false" />
  <meta name="viewport" content="width=device-width" />
  <meta name="version" content="20161218" />

  <meta name="DC.description" content="" />
  <meta name="DC.title" content="" />
  <title>
  Environmental Impact of Fuel Cell Power Generation Systems|

  Research Project Database | Grantee Research Project | ORD | US EPA</title>

  <meta name="keywords" content="" />
  <link rel="shortlink" href="" />
  <link rel="canonical" href="" />
  <meta name="DC.creator" content="" />
  <meta name="DC.language" content="en" />
  <meta name="DC.Subject.epachannel" content="" />
  <meta name="DC.type" content="" />
  <meta name="DC.date.created" content="" />
  <meta name="DC.date.modified" content="2005-10-12" />

  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" />

	<link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" />
	<link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" />
	<link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" />

Jump to main content

  <hgroup class="site-name-and-slogan">

US EPA

United States Environmental Protection Agency

  </hgroup>
  <form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch">
    Search
    <input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/>
    <button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button>
    <input type="hidden" name="fld" value="" />
    <input type="hidden" name="areaname" value="" />
    <input type="hidden" name="areacontacts" value="" />
    <input type="hidden" name="areasearchurl" value="" />
    <input type="hidden" name="typeofsearch" value="epa" />
    <input type="hidden" name="result_template" value="2col.ftl" />
    <input type="hidden" name="filter" value="sample4filt.hts" />
  </form>

Contact Us

Project Research Results

Final Report

                        1 publications for this subproject

                          Main Center: R830420

                        34 publications for this center

                          6 journal articles for this center

Related Information

Research Grants

P3: Student Design Competition

Research Fellowships

Small Business Innovation Research (SBIR)

Grantee Research Project Results Search

      Environmental Impact of Fuel Cell Power Generation Systems

    EPA Grant Number: R828737C001

        Subproject: this is subproject number 001 , established and managed by the Center Director under

          grant R830420

        (EPA does not fund or establish subprojects; EPA awards and manages the overall grant for this center).

      Center:

        Center for Environmental and Energy Research (CEER)

      Center Director:

         Earl, David A.

    Title: Environmental Impact of Fuel Cell Power Generation Systems

    Investigators:
     Wang, Xingwu
        ,  Duan, Huihui
        ,  Hawley, Jennifer
        ,  Min, Bigang

    Institution:

      Alfred University

    	EPA Project Officer:

           Karn, Barbara

      Project Period:
      September 1, 2000 through
        August 31, 2002

      RFA:
      Targeted Research Center (2000)

          Recipients Lists

      Research Category:

          Targeted Research

Objective:

The purpose of this study was to compare three unique fuel processor designs
under the paradigm of industrial ecology. The fuel processor is viewed here as
part of an alternative power generation system including three parts: fuel processor,
fuel cell, and power conditioner. Three designs were compared utilizing two different
methods and an evaluation was made regarding each design in three specific impact
areas: environmental impact, economic impact, and methane retail resale cost.
This comparison technique allowed determination of which design would minimize
negative impact on the environment during its production; which design would
be the most economical to produce; and which design would be the greatest producer
of methane for retail resale were this to be a commercial product.

Approach:

A fuel cell power generation system consists of more than just the fuel cell.
    Other components are associated and may include a fuel processor and a power
    conditioner/inverter. Some of the components associated with a fuel cell
    power generation system will be briefly described to visualize the potential
    environmental and economic impact of each component.

The fuel processor is the first step of the conversion of fuel into an electrical
  current. A fuel processor utilizes a combination of steam reforming (SR) and
  partial oxidation (POX) methods to convert hydrocarbons (methane, natural gas)
  into the pure hydrogen necessary as input to the fuel processor. During this
  process the fuel processor should also strip the input gas of its pollutants
  such as carbon and carbon monoxide. The fuel processor is one of the areas
  in which the greatest environmental threat can occur because of this.

There are a number of other considerations to be taken into account when examining
  the fuel cell power generation system. There are numerous other ‘lesser’ components
  vital to the control and monitoring of the processor. The three fuel processors
  compared in this study, with some minor differences, share most of these components.
  Some of these lesser components include several printed circuit boards (PCBs),
  at least one programmable logic controller (PLC), valves, compressors, fans,
  blowers, thermocouples, transducers, LEDs, pumps and relays. While these components
  will not be described in greater detail, their manufacture and existence in
  the processor is taken into consideration for the life cycle assessment.

Taking all aspects of the power generator system, a life cycle assessment was
  undertaken to investigate which of three designs would be the most environmentally
  sound, economically feasible, and would yield the most from methane sale. Specifically,
  the study consisted of:

Fuel Processor

 Processor components (ATR, Shift Converter…)

Materials used

Outputs and emissions

 Product demise

Three designs were reviewed. The initial design was taken ‘as is’ when
  the unit was received by Alfred University. Design 2 refines the system by
  adding a pre-combustion chamber to reduce start-up time and reduce the amount
  of catalyst needed to have an effective reaction. Design 3 sees the addition
  of a hydrogen purifier to further increase the purity of the gas input to the
  fuel cell.

Each addition enhances the system to make it more efficient. However, some
  components have negative environmental impacts associated with them. Also,
  the addition of more expensive parts makes the system less economically sound.

A Life Cycle Analysis was preformed to determine which design is the most
  desirable. Energy use, materials used in the system, and negative environmental
  impact were all considered.

Design 1: Unit ‘as-received’

Design 2: Unit + precombustion chamber

Design 3: Unit + precombustion chamber + hydrogen purifier

Expected Results:

Three environmental impact considerations were taken for each design. These
  include conventional pollutants, global warming potential, and hazardous waste.
  Economic considerations covered material cost, gas resale value, and system
  efficiency.

Design 2 was shown to be most desireable in regard to environmental impacts
  in that it does not produce the most pollution and it has the least hazardous
  waste generation associated with it.

With regard to the economic consequences of the three designs, Design 2 also
  is the most desirable. Designs 1 and 3 both have lesser hydrogen output per
  methane input. Also, while Design 2 produces slightly more pollution than the
  first design, the output of the system is overall more efficient.

A fuel processor power generation system consists of many components. Each
  may have significant environmental impact and these effects must be considered
  during the design of the unit. Various changes to the fuel processor system
  discussed here changed the environmental and economic effects of the system
  as a whole.

Relevant Websites:

 http://ceer.alfred.edu  Exit

Publications and Presentations:

        Publications have been submitted on this subproject: View all 1 publications for this subproject

              | View all 34 publications for this center

Supplemental Keywords:

      fuel processor design, industrial ecology, alternative power generation, environmental impact, economic impact, methane resale, fuel cell, steam reforming, partial oxidation., RFA, Scientific Discipline, Sustainable Industry/Business, Environmental Chemistry, Sustainable Environment, Technology for Sustainable Environment, Environmental Engineering, environmentally friendly fuel cell power system, environmental sustainability, hydrocarbon conversion, alternative materials, alternative energy source, pollution prevention, fuel cell power generation

Progress and Final Reports:

                Final Report

Main Center Abstract and Reports:

        R830420

          Center for Environmental and Energy Research (CEER)

 Subprojects under this Center: (EPA does not fund or establish subprojects; EPA awards and manages the overall grant for this center).

            R828737C001 Environmental Impact of Fuel Cell Power Generation Systems

            R828737C002 Regional Economic and Material Flows

            R828737C003 Visualizing Growth and Sustainability of Water Resources

            R828737C004 Vibratory Residual Stress Relief and Modifications in Metals to Conserve Resources and Prevent Pollution

            R828737C005 Detecting and Quantifying the Evolution of Hazardous Air Pollutants Produced During High Temperature Manufacturing:  A Focus on Batching of Nitrate Containing Glasses

            R828737C006 Sulfate and Nitrate Dynamics in the Canacadea Watershed

            R828737C007 Variations in Subsurface Denitrifying and Sulfate-Reducing Microbial Populations as a Result of Acid Precipitation

            R828737C008 Recycling Glass-Reinforced Thermoset Polymer Composite Materials

            R828737C009 Correlating Clay Mineralogy with Performance:  Reducing Manufacturing Waste Through Improved Understanding

            R830420C001 Accelerated Hydrogen Diffusion Through Glass Microspheres: An Enabling Technology for a Hydrogen Economy

            R830420C002 Utilization of Paper Mill Waste in Ceramic Products

            R830420C003 Development of Passive Humidity-Control Materials

            R830420C004 Microarray System for Contaminated Water Analysis

            R830420C005 Material and Environmental Sustainability in Ceramic Processing

            R830420C006 Interaction of Sealing Glasses with Metallic Interconnects in Solid Oxide and Polymer Fuel Cells

            R830420C007 Preparation of Ceramic Glaze Waste for Recycling using Froth Flotation

            R830420C008 Elimination of Lead from Ceramic Glazes by Refractive Index Tailoring

            R830420C010 Nanostructured C6B:  A Novel Boron Rich Carbon for H2 Storage

Top of Page

 The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA.  Conclusions drawn by the principal investigators have not been reviewed by the Agency.

Main menu

Environmental Topics

Laws & Regulations

About EPA

Discover.

Accessibility

EPA Administrator

Budget & Performance

Contracting

Grants

No FEAR Act Data

Privacy and Security

Connect.

Data.gov

Inspector General

Jobs

Newsroom

Open Government

Regulations.gov

Subscribe

USA.gov

White House

Ask.

Contact Us

Hotlines

FOIA Requests

Frequent Questions

Follow.

Facebook

Twitter

YouTube

Flickr

Instagram

Last updated on Wednesday, October 12, 2005

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>gallium.obj.utils — Gallium 2 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css" />

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="gallium.toolkit.docs" href="gallium.toolkit.docs.html" />
    <link rel="prev" title="gallium.obj.test_builder" href="gallium.obj.test_builder.html" />

  <link rel="stylesheet" href="_static/custom.css" type="text/css" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

gallium.obj.utils¶

Gallium

Navigation

Contents:

gallium.cli.core

gallium.cli.form

gallium.obj.builder

gallium.obj.decorator

gallium.obj.encoder

gallium.obj.test_builder

gallium.obj.utils

gallium.toolkit.docs

Related Topics

Documentation overview

Previous: gallium.obj.test_builder

Next: gallium.toolkit.docs

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>

      ©2021, Juti Noppornpitak.

      |
      Powered by Sphinx 4.0.2
      & Alabaster 0.7.12

      |
      Page source


text:
require "update_or_create/activerecord"

module UpdateOrCreate
  require 'update_or_create/railtie' if defined?(Rails)
end


text:
/**
 * 	Zynaptic App Framework
 *	© 2016 Coldmind Ltd
 *
 *	Project files pre processing
 *
 *	@author: Patrik Forsberg <mail@patrik.guru>
 */

/* Old Stuff
var replace				= require('gulp-replace');
var browserSync			= require('browser-sync');
var nodemon				= require('gulp-nodemon');
*/

/// <reference path="./typings/node.d.ts" />

"use strict";

var path				= require("path");
var gulp				= require("gulp");
var typescript			= require('gulp-typescript');

console.log('Hydra Build Machine 1.2.1');

var rootDir = __dirname;

function prepare() {
	console.log("Prepare...");
}

gulp.task("prepare", prepare);

// gulp.task('devmode', ['browser-sync'], function () {
// 	console.log('Staring Development Mode...')
// });

// gulp.task('browser-sync', ['nodemon'], function() {
// 	browserSync.init(null, {
// 		proxy: "http://localhost:6060",
// 		files: ["public/**/*.*","client/**/*.*"],
// 		browser: "google chrome",
// 		port: 8080,
// 	});
// });

/*
const TASK_BUILD_FRAMEWORK	= "build_framework";
const TASK_BUILD_WEBAPP	= "build_web_app";

gulp.task(TASK_DEFAULT, function() {
	gulp.watch(sassSourceFolder, [TASK_STYLES]);
});
*/


text:
@interface MACOperationLogTableViewCell ()

@property (nonatomic, retain) UIView  *workCompletionStatusView;

@property (nonatomic, retain) UILabel *operationTypeLabel;

@property (nonatomic, retain) UILabel *startTimeTitleLabel;
@property (nonatomic, retain) UILabel *startTimeLabel;

@property (nonatomic, retain) UILabel *endTimeTitleLabel;
@property (nonatomic, retain) UILabel *endTimeLabel;

@property (nonatomic, retain) UILabel *elapsedTimeTitleLabel;
@property (nonatomic, retain) UILabel *elapsedTimeLabel;

@property (nonatomic, retain) NSArray *titleLabels;
@property (nonatomic, retain) NSArray *valueLabels;

@end

@implementation MACOperationLogTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup
{
    _workCompletionStatusView = [[UIView alloc] init];

    _operationTypeLabel = [[UILabel alloc] init];
    _operationTypeLabel.textAlignment = NSTextAlignmentLeft;
    _operationTypeLabel.font = [UIFont systemFontOfSize:[UIFont systemFontSize] weight:1.2];

    _startTimeTitleLabel = [[UILabel alloc] init];
    _startTimeTitleLabel.text = @"Start:";
    _endTimeTitleLabel = [[UILabel alloc] init];
    _endTimeTitleLabel.text = @"End:";
    _elapsedTimeTitleLabel = [[UILabel alloc] init];
    _elapsedTimeTitleLabel.text = @"Elapsed Time:";
    _titleLabels = @[_startTimeTitleLabel, _endTimeTitleLabel, _elapsedTimeTitleLabel];

    _startTimeLabel = [[UILabel alloc] init];
    _endTimeLabel = [[UILabel alloc] init];
    _elapsedTimeLabel = [[UILabel alloc] init];
    _valueLabels = @[_startTimeLabel, _endTimeLabel, _elapsedTimeLabel];

    _workCompletionStatusView.translatesAutoresizingMaskIntoConstraints = NO;
    _operationTypeLabel.translatesAutoresizingMaskIntoConstraints = NO;

    [self.contentView addSubview:_workCompletionStatusView];
    [self.contentView addSubview:_operationTypeLabel];

    [_titleLabels enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger idx, BOOL * _Nonnull stop) {
        label.translatesAutoresizingMaskIntoConstraints = NO;
        [self.contentView addSubview:label];
    }];
    [_valueLabels enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger idx, BOOL * _Nonnull stop) {
        label.font = [UIFont systemFontOfSize:[UIFont smallSystemFontSize]];
        label.translatesAutoresizingMaskIntoConstraints = NO;
        [self.contentView addSubview:label];
    }];

    [self setupConstraints];
}

- (void)setupConstraints
{
    NSDictionary *metrics = @{
                              @"statusViewWidth": @(20)
                              };
    NSDictionary *views = NSDictionaryOfVariableBindings(_workCompletionStatusView,
                                                         _operationTypeLabel,
                                                         _startTimeTitleLabel,
                                                         _startTimeLabel,
                                                         _endTimeTitleLabel,
                                                         _endTimeLabel,
                                                         _elapsedTimeTitleLabel,
                                                         _elapsedTimeLabel);

    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_workCompletionStatusView(statusViewWidth)]"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];
    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_workCompletionStatusView]|"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];

    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_operationTypeLabel]-(>=8)-|"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];
    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_startTimeTitleLabel(_elapsedTimeTitleLabel)]-[_startTimeLabel]-(>=8)-|"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];
    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_endTimeTitleLabel(_elapsedTimeTitleLabel)]-[_endTimeLabel(_startTimeLabel)]-(>=8)-|"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];
    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_elapsedTimeTitleLabel]-[_elapsedTimeLabel]-(>=8)-|"
                                                                             options:NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom
                                                                             metrics:metrics
                                                                               views:views]];
    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_operationTypeLabel]-[_startTimeTitleLabel]-[_endTimeTitleLabel]-[_elapsedTimeTitleLabel]-(>=8)-|"
                                                                             options:NSLayoutFormatAlignAllLeft
                                                                             metrics:metrics
                                                                               views:views]];
}

- (void)setOperationLog:(MACOperationLog *)operationLog
{
    self.operationTypeLabel.text = operationLog.operationType;
    self.startTimeLabel.text = operationLog.startTimeString;
    self.endTimeLabel.text = operationLog.endTimeString;
    self.elapsedTimeLabel.text = [NSString stringWithFormat:@"%@ms", operationLog.elapsedTimeString];
    self.workCompletionStatusView.backgroundColor = (operationLog.isSuccesful) ? [UIColor greenColor] : [UIColor redColor];
}

@end


text:
package br.com.mytrips.controller;

import java.util.List;

import javax.validation.Valid;

import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import br.com.mytrips.entity.UsuarioEntity;
import br.com.mytrips.model.ResponseDto;
import br.com.mytrips.model.UsuarioDto;
import br.com.mytrips.repository.UsuarioRepository;

@RestController
@RequestMapping("/api/v1/usuarios")
@CrossOrigin
public class UsuariosController {

	private static final Logger log = LoggerFactory.getLogger(UsuariosController.class);

	@Autowired
	private ModelMapper mapper;

	@Autowired
	private UsuarioRepository repository;

	@GetMapping
	public ResponseDto getAllUsuarios() {
		log.info("## Retornando todos os usuarios cadastradas...");
		List<UsuarioEntity> entityList = repository.findAll();
		return new ResponseDto(entityList);
	}

	@PostMapping
	@ResponseStatus(value = HttpStatus.CREATED)
	public ResponseDto insertUsuario(@Valid @RequestBody UsuarioDto usuario) {
		log.info("## Cadastrando usuario: {}...", usuario);
		UsuarioEntity entity = repository.insert(mapper.map(usuario, UsuarioEntity.class));
		return new ResponseDto(HttpStatus.CREATED.value(), entity);
	}

	@DeleteMapping
	public void deleteAll() {
		log.info("## Apagando todos usuarios...");
		repository.deleteAll();
	}
}


text:
package org.jasig.portal.security;

import java.util.Vector;

import org.jasig.portal.AuthorizationException;
import org.jasig.portal.groups.GroupsException;
import org.jasig.portal.groups.IGroupMember;
import org.jasig.portal.portlet.om.PortletLifecycleState;

/**
 * @author Bernie Durfee, bdurfee@interactivebusiness.com
 * @author Dan Ellentuck, de3@columbia.edu
 * @version $Revision$
 *
 * An IAuthorizationService represents the portal's authorization service.
 * All requests for authorization activities ultimately come here.
 */
public interface IAuthorizationService
{
/**
 * Adds IPermissions to the service.
 * @param permissions IPermission[]
 * @exception AuthorizationException
 */
    public void addPermissions(IPermission[] permissions) throws AuthorizationException;
/**
 * Answers if the principal has permission to use the CONFIG PortletMode on this Channel.
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param channelPublishId int
 * @exception AuthorizationException indicates authorization information could not be retrieved.
 */
    public boolean canPrincipalConfigure(IAuthorizationPrincipal principal, String channelPublishId)
    throws AuthorizationException;
/**
 * Answers if the principal has permission to manage this Channel.
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param channelPublishId int
 * @exception AuthorizationException indicates authorization information could not be retrieved.
 */
    public boolean canPrincipalManage(IAuthorizationPrincipal principal, String channelPublishId)
    throws AuthorizationException;
/**
 * I'm not sure what this means (Dan).  Publish what?
 * @param principal IAuthorizationPrincipal
 * @return boolean
 * @exception AuthorizationException
 */
    public boolean canPrincipalManage(IAuthorizationPrincipal principal, PortletLifecycleState state, String categoryId)
    throws AuthorizationException;
/**
 * Answers if the principal has permission to render this Channel.
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param channelPublishId int
 * @exception AuthorizationException indicates authorization information could not be retrieved.
 */
    public boolean canPrincipalRender(IAuthorizationPrincipal principal, String channelPublishId)
    throws AuthorizationException;
/**
 * Answers if the principal has permission to subscribe to this Channel.
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param channelPublishId int
 * @exception AuthorizationException indicates authorization information could not be retrieved.
 */
    public boolean canPrincipalSubscribe(IAuthorizationPrincipal principal, String channelPublishId)
    throws AuthorizationException;
/**
 * Answers if the owner has given the principal permission to perform the activity on
 * the target.  Params owner and activity must be non-null.
 * If target is null, then target is not checked.
 *
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param owner java.lang.String
 * @param activity java.lang.String
 * @param target java.lang.String
 * @exception AuthorizationException indicates authorization information could not
 * be retrieved.
 */
    public boolean doesPrincipalHavePermission(
      IAuthorizationPrincipal principal,
      String owner,
      String activity,
      String target)
    throws AuthorizationException;
/**
 * Returns the IPermissions owner has granted this Principal for
 * the specified activity and target.  This includes inherited IPermissions.
 * Null parameters will be ignored, that is, all IPermissions matching the
 * non-null parameters are retrieved.  So, getPermissions(principal,null, null, null)
 * should retrieve all IPermissions for a Principal.
 *
 * @return org.jasig.portal.security.IPermission[]
 * @param principal IAuthorizationPrincipal
 * @param owner java.lang.String
 * @param activity java.lang.String
 * @param target java.lang.String
 * @exception AuthorizationException indicates authorization information could not
 * be retrieved.
 */
    public IPermission[] getAllPermissionsForPrincipal (
          IAuthorizationPrincipal principal,
      String owner,
      String activity,
      String target)
    throws AuthorizationException;
/**
 * Does this mean all channels the principal could conceivably subscribe
 * to or all channels principal is specifically authorized to subscribe to,
 * or what?
 *
 * @param principal IAuthorizationPrincipal
 * @return Vector (of channels?)
 * @exception AuthorizationException indicates authorization information could not
 */
    public Vector getAuthorizedChannels(IAuthorizationPrincipal principal)
    throws AuthorizationException;

/**
 * @return org.jasig.portal.groups.IGroupMember
 * @param principal org.jasig.portal.security.IAuthorizationPrincipal
 */
    public IGroupMember getGroupMember(IAuthorizationPrincipal principal)
    throws GroupsException;

/**
 * Returns the IPermissions owner has granted for the specified activity
 * and target.  Null parameters will be ignored, that is, all IPermissions
 * matching the non-null parameters are retrieved.
 *
 * @return org.jasig.portal.security.IPermission[]
 * @param owner java.lang.String
 * @param activity java.lang.String
 * @param target java.lang.String
 * @exception AuthorizationException indicates authorization information could not
 * be retrieved.
 */
    public IPermission[] getPermissionsForOwner(String owner, String activity, String target)
    throws AuthorizationException;
/**
 * Returns the IPermissions owner has granted this Principal for
 * the specified activity and target.  Null parameters will be ignored, that is, all
 * IPermissions matching the non-null parameters are retrieved.  So,
 * getPermissions(principal,null, null, null) should retrieve all IPermissions
 * for a Principal.
 *
 * @return org.jasig.portal.security.IPermission[]
 * @param principal IAuthorizationPrincipal
 * @param owner java.lang.String
 * @param activity java.lang.String
 * @param target java.lang.String
 * @exception AuthorizationException indicates authorization information could not
 * be retrieved.
 */
    public IPermission[] getPermissionsForPrincipal (
      IAuthorizationPrincipal principal,
      String owner,
      String activity,
      String target)
    throws AuthorizationException;
/**
 * Creates a new IPermission for the principal on behalf of the
 * owner.
 *
 * @param owner String
 * @param principal IAuthorizationPrincipal
 */
    public IPermission newPermission(String owner, IAuthorizationPrincipal principal)
    throws AuthorizationException;
/**
 * @param key java.lang.String
 * @return org.jasig.portal.security.IPermissionManager
 * @exception org.jasig.portal.AuthorizationException
 */
    public IPermissionManager newPermissionManager(String key) throws AuthorizationException;
/**
 * Factory method for an IAuthorizationPrincipal.  This type wraps an underlying
 * entity so that the authorization system can treat all principals alike.
 * @param key String
 * @param type Class
 * @return IAuthorizationPrincipal
 */
    public IAuthorizationPrincipal newPrincipal(String key, Class type);

/**
 * Converts an IGroupMember into an IAuthorizationPrincipal.
 * @return org.jasig.portal.security.IAuthorizationPrincipal
 * @param groupMember org.jasig.portal.groups.IGroupMember
 */
    public IAuthorizationPrincipal newPrincipal(IGroupMember groupMember)
    throws GroupsException;
/**
 * @return org.jasig.portal.security.IUpdatingPermissionManager
 * @param key java.lang.String
 * @exception org.jasig.portal.AuthorizationException
 */
    public IUpdatingPermissionManager newUpdatingPermissionManager(String key)
    throws AuthorizationException;
/**
 * Removes IPermissions from the service.
 * @param permissions IPermission[]
 * @exception AuthorizationException
 */
    public void removePermissions(IPermission[] permissions) throws AuthorizationException;

/**
 * Updates IPermissions in the service.
 * @param permissions IPermission[]
 * @exception AuthorizationException
 */
    public void updatePermissions(IPermission[] permissions) throws AuthorizationException;

/**
 * Returns the IAuthorizationPrincipal associated with the IPermission.
 * @param permission IPermission
 */
    public IAuthorizationPrincipal getPrincipal(IPermission permission)
    throws AuthorizationException;

/**
 * Returns a String used to represent the IAuthorizationPrincipal.
 * @param principal IAuthorizationPrincipal
 */
    public String getPrincipalString(IAuthorizationPrincipal principal);

/**
 * Answers if the owner has given the principal permission to perform the activity on
 * the target, as evaluated by the policy.  Params policy, owner
 * and activity must be non-null.  If target is null, then
 * target is not checked.
 *
 * @return boolean
 * @param principal IAuthorizationPrincipal
 * @param owner java.lang.String
 * @param activity java.lang.String
 * @param target java.lang.String
 * @exception AuthorizationException indicates authorization information could not
 * be retrieved.
 */
    public boolean doesPrincipalHavePermission(
      IAuthorizationPrincipal principal,
      String owner,
      String activity,
      String target,
      IPermissionPolicy policy)
    throws AuthorizationException;
}


text:
package com.yidejia.app.mall.qiandao;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import org.json.JSONException;
import org.json.JSONObject;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Message;
//import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.baidu.mobstat.StatService;
import com.yidejia.app.mall.BaseActivity;
import com.yidejia.app.mall.MyApplication;
import com.yidejia.app.mall.R;
import com.yidejia.app.mall.jni.JNICallBack;
import com.yidejia.app.mall.util.Consts;
import com.yidejia.app.mall.util.HttpClientUtil;
import com.yidejia.app.mall.util.IHttpResp;
import com.yidejia.app.mall.util.SharedPreferencesUtil;

public class QiandaoActivity extends BaseActivity implements OnClickListener,
		Callback {

	private ImageView backImagView;
	private ImageView ivSignAdd;
	private TextView tvSignCount1;// 显示天数的个位数字
	private TextView tvSignCount2;// 显示天数的十位数字
	private TextView tvSignCount3;// 显示天数的百位数字

	private String userId;
	private String token;
	private JNICallBack jniCallBack;
	private String url;

	private int lxSign = 0; // 已连续签到天数
	private int signCount = 0; // 总签到天数
	private String respMsg; // 签到返回信息
	private SharedPreferencesUtil sp;// 保存日期
	private SimpleDateFormat sdf;// 日期转换的格式
	private Calendar cal;// 获取日期对象
	private String nowDate;// 当前日期
	private String lastDate;// 保存的日期
	private String lastId;// 保存的用户的Id
	private Handler handler;// 用来更新界面

	private boolean isCanSign = true;	//是否可以点击签到

	@SuppressLint("SimpleDateFormat")
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.qiandao);
		handler = new Handler(this);
		backImagView = (ImageView) findViewById(R.id.iv_qiandao_back);
		backImagView.setOnClickListener(this);

		ivSignAdd = (ImageView) findViewById(R.id.iv_qiandao_button);
		ivSignAdd.setOnClickListener(this);

		tvSignCount1 = (TextView) findViewById(R.id.tv_sign_count1);
		tvSignCount2 = (TextView) findViewById(R.id.tv_sign_count2);
		tvSignCount3 = (TextView) findViewById(R.id.tv_sign_count3);

		userId = MyApplication.getInstance().getUserId();
		token = MyApplication.getInstance().getToken();
		jniCallBack = new JNICallBack();
		url = jniCallBack.HTTPURL;

		getSignCount();

		sp = new SharedPreferencesUtil(this);
		// MyApplication.getInstance().getSharedPreferences("TIME",MODE_PRIVATE);
		sdf = new SimpleDateFormat("yyyy-MM-dd");// 日期转换的格式
		cal = Calendar.getInstance();// 获取日期对象
		cal.add(Calendar.DAY_OF_MONTH, -1);
		nowDate = sdf.format(cal.getTime());
		lastDate = sp.getData("TIME", "Date", "");
		lastId = sp.getData("TIME", "User", "");
		if (nowDate.equals(lastDate) && lastId.equals(userId)) {
//			ivSignAdd.setImageResource(R.drawable.yiqiandao);
			ivSignAdd.setSelected(true);
			isCanSign = false;
		} else {
//			ivSignAdd.setImageResource(R.drawable.qiandao_button);
			ivSignAdd.setSelected(false);
			isCanSign = true;
		}

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.iv_qiandao_back:
			this.finish();
			break;
		case R.id.iv_qiandao_button:
			if(!isCanSign) return;
			signUp();
			break;
		default:
			break;
		}
	}

	private void getSignCount() {
		String param = jniCallBack.getHttp4SignCount(userId, token);
		HttpClientUtil httpClientUtil = new HttpClientUtil(this);
		httpClientUtil.setIsShowLoading(true);
		httpClientUtil.setShowErrMessage(true);
		httpClientUtil.getHttpResp(url, param, new IHttpResp() {

			@Override
			public void onSuccess(String content) {
				if (parseGetCount(content)) {
					if (!"".equals(signCount)) {
						int gewei = signCount % 10;
						int shiwei = signCount / 10 % 10;
						int baiwei = signCount / 100;
						tvSignCount3.setText(gewei + "");
						tvSignCount2.setText(shiwei + "");
						tvSignCount1.setText(baiwei + "");
					}
				}
			}
		});
	}

	/** 解析总签到天数和连续签到天数 **/
	private boolean parseGetCount(String content) {
		try {
			JSONObject httpObject = new JSONObject(content);
			int code = httpObject.optInt("code");
			String strResp = httpObject.optString("response");
			if (1 == code) {
				JSONObject respObject = new JSONObject(strResp);
				lxSign = respObject.optInt("lxSign");
				signCount = respObject.optInt("countSign") ;
				return true;
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return false;
	}

	private void signUp() {

		String param = new JNICallBack().getHttp4SignUp(userId, token);
		HttpClientUtil httpClientUtil = new HttpClientUtil(this);
		httpClientUtil.setIsShowLoading(true);
		httpClientUtil.setShowErrMessage(true);
		httpClientUtil.getHttpResp(url, param, new IHttpResp() {

			@Override
			public void onSuccess(String content) {
				String showMsg;
//				Log.e("info", content);
				if (parseSignAdd(content)) {
					showMsg = "您已连续签到"+ (lxSign + 1) + "天,本次签到获得" + respMsg + "个爱豆";
//					ivSignAdd.setImageResource(R.drawable.yiqiandao);
					signCount++;
					handler.sendEmptyMessage(Consts.QIANDAO);
					isCanSign = false;
				} else {
					showMsg = respMsg;
				}

				cal.add(Calendar.DAY_OF_MONTH, 0);// 保存当天的数据
				sp.saveData("TIME", "Date", sdf.format(cal.getTime()));
				sp.saveData("TIME", "User", userId);

				isCanSign = false;
				ivSignAdd.setSelected(true);
				Toast.makeText(QiandaoActivity.this, showMsg,
						Toast.LENGTH_LONG).show();
			}
		});
	}

	private boolean parseSignAdd(String content) {
		try {
			JSONObject httpObject = new JSONObject(content);
			int code = httpObject.optInt("code");
			respMsg = httpObject.optString("response");
			if (1 == code) {
				return true;
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	protected void onResume() {
		super.onResume();
		StatService.onPageStart(this, "签到页面");
	}

	@Override
	protected void onPause() {
		super.onPause();
		StatService.onPageEnd(this, "签到页面");
	}

	@Override
	public boolean handleMessage(Message msg) {
		if (msg.what == Consts.QIANDAO) {
			int gewei = signCount % 10;
			int shiwei = signCount / 10 % 10;
			int baiwei = signCount / 100;
			tvSignCount3.setText(gewei + "");
			tvSignCount2.setText(shiwei + "");
			tvSignCount1.setText(baiwei + "");

		}
		return false;
	}
}


text:
.PHONY: all
all: install test

.PHONY: install
install:
	go install -v ./cmd/...

.PHONY: protoc
protoc:
	go get github.com/gogo/protobuf/protoc-gen-gogofaster

.PHONY: proto
proto: protoc
	protoc -I ../../../:. --gogofaster_out=plugins=grpc:. rkvpb/rkv.proto

.PHONY: test
test:
	go test ./cmd/... -v

.PHONY: bench
bench:
	go test ./cmd/... -v -run ^none -bench .

.PHONY: check
check:
	gometalinter --config metalinter.json ./...

.PHONY: clean
clean:
	go clean -i ./cmd/...

.PHONY: prometheus
prometheus:
	prometheus -config.file=prometheus.yml -web.listen-address ":59090"


text:
<?php

namespace Omnipay\Vindicia\Message;

/**
 * Purchase something! Money will be transferred. Calling purchase is the equivalent of
 * calling authorize and then calling capture.
 *
 * Takes the same parameters as authorize, plus those listed below. See Message\AuthorizeRequest.
 *
 * Parameters:
 * - ignoreAvsPolicy: Determines whether to check AVS validation on payment method. Default value is false.
 * - ignoreCvnPolicy: Determines whether to check CVN validation on payment method. Default value is false.
 *
 * Example:
 * <code>
 *   // set up the gateway
 *   $gateway = \Omnipay\Omnipay::create('Vindicia');
 *   $gateway->setUsername('your_username');
 *   $gateway->setPassword('y0ur_p4ssw0rd');
 *   $gateway->setTestMode(false);
 *
 *   // purchase!
 *   $purchaseResponse = $gateway->purchase(array(
 *       'items' => array(
 *           array('name' => 'Item 1', 'sku' => '1', 'price' => '3.50', 'quantity' => 1),
 *           array('name' => 'Item 2', 'sku' => '2', 'price' => '9.99', 'quantity' => 2)
 *       ),
 *       'amount' => '23.48', // not necessary since items are provided
 *       'currency' => 'USD',
 *       'customerId' => '123456', // will be created if it doesn't already exist
 *       'card' => array(
 *           'number' => '5555555555554444',
 *           'expiryMonth' => '01',
 *           'expiryYear' => '2020',
 *           'cvv' => '123',
 *           'postcode' => '12345'
 *       ),
 *       'paymentMethodId' => 'cc-123456', // this ID will be assigned to the card, which will
 *                                         // be attached to the customer's account
 *       'attributes' => array(
 *           'location' => 'FL'
 *       )
 *   ))->send();
 *
 *   if ($purchaseResponse->isSuccessful()) {
 *       // Note: Your transaction ID begins with a prefix you specified in your initial
 *       // Vindicia configuration. The ID is automatically assigned by Vindicia.
 *       echo "Transaction id: " . $purchaseResponse->getTransactionId() . PHP_EOL;
 *       echo "Transaction reference: " . $purchaseResponse->getTransactionReference() . PHP_EOL;
 *   } else {
 *       // error handling
 *   }
 *
 * </code>
 */
class PurchaseRequest extends AuthorizeRequest
{
    /**
     * The name of the function to be called in Vindicia's API
     *
     * @return string
     */
    protected function getFunction()
    {
        return 'authCapture';
    }

    /**
     * @param string $paymentMethodType
     * @return array
     */
    public function getData($paymentMethodType = self::PAYMENT_METHOD_CREDIT_CARD)
    {
        $data = parent::getData($paymentMethodType);

        $ignore_avs = $this->getIgnoreAvsPolicy();
        $ignore_cvn = $this->getIgnoreCvnPolicy();
        $data['ignoreAvsPolicy'] = $ignore_avs ? $ignore_avs : false;
        $data['ignoreCvnPolicy'] = $ignore_cvn ? $ignore_cvn : false;

        return $data;
    }

    /**
     * @return null|bool
     */
    public function getIgnoreAvsPolicy()
    {
        return $this->getParameter('ignoreAvsPolicy');
    }

    /**
     * @param bool $ignore
     * @return static
     */
    public function setIgnoreAvsPolicy($ignore)
    {
        return $this->setParameter('ignoreAvsPolicy', $ignore);
    }

    /**
     * @return null|bool
     */
    public function getIgnoreCvnPolicy()
    {
        return $this->getParameter('ignoreCvnPolicy');
    }

    /**
     * @param bool $ignore
     * @return static
     */
    public function setIgnoreCvnPolicy($ignore)
    {
        return $this->setParameter('ignoreCvnPolicy', $ignore);
    }
}


text:
package com.thirdpart.model;

import java.util.concurrent.ConcurrentHashMap;

import org.apache.http.Header;

import android.app.Fragment.InstantiationException;
import android.content.Context;
import android.util.Log;

import com.jameschen.framework.base.UINetworkHandler;

public abstract class ManagerService {

public final static String ISSUE_SERVICE = "issue_serive";

public static interface OnUploadReqHttpCallbackListener extends OnReqHttpCallbackListener{

	public void onProgress(String name,int statusCode,
			int totalSize, String response);
}

public static interface OnReqHttpCallbackListener{

	public void start(String name);

	public void failed(String name,int statusCode,
			Header[] headers, String response);

	public void finish(String name);

	public void succ(String name,int statusCode,
			Header[] headers, Object response);
}

private static ConcurrentHashMap<String, Class<?>> managerServiceMap = new ConcurrentHashMap<String, Class<?>>();

public static final String CODE = "code",REASON="reanson",SUCC="succ",DATA="data";

protected Context context;
protected  OnReqHttpCallbackListener reqHttpCallbackListener;
ManagerService(OnReqHttpCallbackListener reqHttpCallbackListener){
	this.reqHttpCallbackListener = reqHttpCallbackListener;
}

public ManagerService(){
}

public static  ManagerService getNewManagerService(Context context,Class<?> mClass,OnReqHttpCallbackListener reqHttpCallbackListener){
    String serviceName = mClass.getName();
	try {
        Class<?> clazz = managerServiceMap.get(serviceName);
        if (clazz == null) {
            // Class not found in the cache, see if it's real, and try to add it
            clazz = context.getClassLoader().loadClass(serviceName);
            if (!ManagerService.class.isAssignableFrom(clazz)) {
                throw new InstantiationException("Trying to instantiate a class " + serviceName
                        + " that is not a ManagerService", new ClassCastException());
            }
            managerServiceMap.put(serviceName, clazz);
        }
        ManagerService managerService = (ManagerService)clazz.newInstance();
        managerService.context = context;
        managerService.reqHttpCallbackListener = reqHttpCallbackListener;
        return managerService;
    } catch (ClassNotFoundException e) {
        throw new InstantiationException("Unable to instantiate managerService " + serviceName
                + ": make sure class name exists, is public, and has an"
                + " empty constructor that is public", e);
    } catch (java.lang.InstantiationException e) {
        throw new InstantiationException("Unable to instantiate managerService " + serviceName
                + ": make sure class name exists, is public, and has an"
                + " empty constructor that is public", e);
    } catch (IllegalAccessException e) {
        throw new InstantiationException("Unable to instantiate managerService " + serviceName
                + ": make sure class name exists, is public, and has an"
                + " empty constructor that is public", e);
    }
}

protected   ManagerNetworkHandler getManagerNetWorkHandler(String action){
	return null;
};

 protected  class ManagerNetworkHandler<T> extends UINetworkHandler<T>{
	 private String action;
	public ManagerNetworkHandler(Context context,String action) {
		super(context);
		// TODO Auto-generated constructor stub
		this.action = action;
	}

	@Override
	public void onProgress(int bytesWritten, int totalSize) {
		// TODO Auto-generated method stub
		super.onProgress(bytesWritten, totalSize);
		//send
		if (reqHttpCallbackListener instanceof OnUploadReqHttpCallbackListener) {

			int percent = bytesWritten*100/totalSize;
			if (percent>=100) {//ok
				Log.i("upload", "count==="+percent);
				percent=99;
			}
			String content = "已上传"+percent+"%";
			((OnUploadReqHttpCallbackListener)reqHttpCallbackListener).onProgress(action,bytesWritten, totalSize,content);
		}
	}

	@Override
	public void start() {
		// TODO Auto-generated method stub
		notifyStart(action);
	}

	@Override
	public void finish() {
		// TODO Auto-generated method stub
		notifyFinish(action);
	}

	@Override
	public void callbackFailure(int statusCode,
			Header[] headers, String response) {
		// TODO Auto-generated method stub
		notifyFailedResult(action, statusCode,headers,
				response);
	}

	@Override
	public void callbackSuccess(int statusCode,
			Header[] headers, T response) {

		notifySuccResult(action, statusCode,headers,response);
	}

}

 private void  notifyStart(String action){
	 reqHttpCallbackListener.start(action);

}

 private void  notifyFinish(String action){

	 reqHttpCallbackListener.finish(action);
}

 private void  notifyFailedResult(String action,int statusCode,Header[] headers, String response){
	 reqHttpCallbackListener.failed(action, statusCode, headers, response);

}

 private void  notifySuccResult(String action,int statusCode, Header[] headers, Object response){
	 reqHttpCallbackListener.succ(action, statusCode, headers, response);
}

}


text:
<?php
namespace Aura\Http\Message;

use Aura\Http\Cookie\Factory as CookieFactory;
use Aura\Http\Header\Factory as HeaderFactory;
use Aura\Http\Cookie\Collection as Cookies;
use Aura\Http\Header\Collection as Headers;
use Aura\Http\MessageTest;

class ResponseTest extends MessageTest
{
    protected function setUp()
    {
        $this->message = new Response(
            new Headers(new HeaderFactory),
            new Cookies(new CookieFactory)
        );
    }

    public function testSetAndGetStatusCode()
    {
        $this->assertSame(200, $this->message->getStatusCode());

        $this->message->setStatusCode(101);
        $this->assertSame(101, $this->message->getStatusCode());
        $this->assertSame(101, $this->message->status_code);
    }

    public function testSetStatusCodeNoDefaultText()
    {
        $this->message->setStatusCode(569);
        $this->assertSame(569, $this->message->getStatusCode());
        $this->assertSame(569, $this->message->status_code);

        $this->assertSame('', $this->message->getStatusText());
        $this->assertSame('', $this->message->status_text);
    }

    public function testSetStatusCodeExceptionLessThan100()
    {
        $this->setExpectedException('Aura\Http\Exception');
        $this->message->setStatusCode(99);
    }

    public function testSetStatusCodeExceptionGreaterThan599()
    {
        $this->setExpectedException('Aura\Http\Exception');
        $this->message->setStatusCode(600);
    }

    public function testSetAndGetStatusText()
    {
        $this->assertSame('OK', $this->message->getStatusText());

        $this->message->setStatusText("I'm a teapot");
        $this->assertSame("I'm a teapot", $this->message->getStatusText());
        $this->assertSame("I'm a teapot", $this->message->status_text);
    }
}


text:
package eu.voho.jhttpmock.model;

import eu.voho.jhttpmock.model.http.RequestWrapper;
import eu.voho.jhttpmock.model.misc.MultiValueStringMap;

import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;

/**
 * HTTP request matcher.
 * By default, it matches all requests.
 * Only one matcher is enabled for: URL, HTTP method, request body, and only one custom predicate.
 */
class RequestPredicate implements Predicate<RequestWrapper> {
    private Predicate<String> urlMatcher;
    private Predicate<String> methodMatcher;
    private Predicate<char[]> bodyMatcher;
    private Predicate<RequestWrapper> customPredicate;
    private final List<Predicate<MultiValueStringMap>> headerMatchers;
    private final List<Predicate<MultiValueStringMap>> queryParameterMatchers;

    RequestPredicate() {
        headerMatchers = new LinkedList<>();
        queryParameterMatchers = new LinkedList<>();
    }

    @Override
    public boolean test(final RequestWrapper request) {
        return nullOrTest(urlMatcher, request.getUrl())
                && nullOrTest(methodMatcher, request.getMethod())
                && nullOrTest(bodyMatcher, request.getBody())
                && nullOrTest(customPredicate, request)
                && nullOrTest(headerMatchers, new MultiValueStringMap(request.getHeaders()))
                && nullOrTest(queryParameterMatchers, new MultiValueStringMap(request.getQueryParameters()));
    }

    void setUrlMatcher(final Predicate<String> urlMatcher) {
        checkNull(this.urlMatcher, "Only one matcher for URL is allowed.");
        this.urlMatcher = urlMatcher;
    }

    void setMethodMatcher(final Predicate<String> methodMatcher) {
        checkNull(this.methodMatcher, "Only one matcher for HTTP method is allowed.");
        this.methodMatcher = methodMatcher;
    }

    void setBodyMatcher(final Predicate<char[]> bodyMatcher) {
        checkNull(this.bodyMatcher, "Only one matcher for HTTP request body is allowed.");
        this.bodyMatcher = bodyMatcher;
    }

    void setCustomPredicate(final Predicate<RequestWrapper> customPredicate) {
        checkNull(methodMatcher, "Only one custom predicate is allowed.");
        this.customPredicate = customPredicate;
    }

    void addHeaderMatcher(final Predicate<String> nameMatcher, final Predicate<Set<String>> valueMatcher) {
        headerMatchers.add(map -> map.contains(nameMatcher, valueMatcher));
    }

    void addQueryParameterMatcher(final Predicate<String> nameMatcher, final Predicate<Set<String>> valueMatcher) {
        queryParameterMatchers.add(map -> map.contains(nameMatcher, valueMatcher));
    }

    private static void checkNull(final Predicate<?> matcher, final String messageIfNull) {
        if (matcher != null) {
            throw new UnsupportedOperationException(messageIfNull);
        }
    }

    private static <T> boolean nullOrTest(final List<Predicate<T>> predicates, final T value) {
        return predicates == null || predicates.isEmpty() || predicates.stream().allMatch(predicate -> predicate.test(value));
    }

    private static <T> boolean nullOrTest(final Predicate<T> predicate, final T value) {
        return predicate == null || predicate.test(value);
    }
}


text:
typedef NS_ENUM(NSUInteger, BTCScriptVerification) {
    BTCScriptVerificationStrictEncoding = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys (aka SCRIPT_VERIFY_STRICTENC)
    BTCScriptVerificationEvenS          = (1U << 2), // enforce lower S values (below curve halforder) in signatures (aka SCRIPT_VERIFY_EVEN_S, depends on STRICTENC)
};

@class BTCScript;
@class BTCTransaction;

// ScriptMachine is a stack machine (like Forth) that evaluates a predicate
// returning a bool indicating valid or not. There are no loops.
// You can -copy a machine which will copy all the parameters and the stack state.
@interface BTCScriptMachine : NSObject <NSCopying>

// "To" transaction that is signed by an inputScript.
// Required parameter.
@property(nonatomic) BTCTransaction* transaction;

// An index of the tx input in the `transaction`.
// Required parameter.
@property(nonatomic) uint32_t inputIndex;

// Overrides inputScript from transaction.inputs[inputIndex].
// Useful for testing, but useless if you need to test CHECKSIG operations. In latter case you still need a full transaction.
@property(nonatomic) BTCScript* inputScript;

// A timestamp of the current block. Default is current timestamp.
// This is used to test for P2SH scripts or other changes in the protocol that may happen in the future.
// If not specified, defaults to current timestamp thus using the latest protocol rules.
@property(nonatomic) uint32_t blockTimestamp;

// Flags affecting verification. Default is the most liberal verification.
// One can be stricter to not relay transactions with non-canonical signatures and pubkey (as BitcoinQT does).
// Defaults in CoreBitcoin: be liberal in what you accept and conservative in what you send.
// So we try to create canonical purist transactions but have no problem accepting and working with non-canonical ones.
@property(nonatomic) BTCScriptVerification verificationFlags;

// Returns a copy of a stack in its current state. Mostly used for testing.
@property(nonatomic, copy, readonly) NSArray* stack;

// Returns a copy of an altstack in its current state. Mostly used for testing.
@property(nonatomic, copy, readonly) NSArray* altstack;

// This will return nil if the transaction is nil, or inputIndex is out of bounds.
// You can use -init if you want to run scripts without signature verification (so no transaction is needed).
- (id) initWithTransaction:(BTCTransaction*)tx inputIndex:(uint32_t)inputIndex;

// Verifies input script taken from transaction's input at `inputIndex` and if it doesn't fail,
// on the same stack verifies the output script.
// Returns YES if both scripts did not fail and left boolean true as a top item on the stack.
// If any transaction or outputScript is nil, or inputIndex is out of bounds, raises and exception.
// In case of a normal failure, sets an error object.
// Output script is a redemption script from a previous transaction output referenced by this transaction's input.
// Leaves stack as is after execution.
- (BOOL) verifyWithOutputScript:(BTCScript*)outputScript error:(NSError**)errorOut;

// Runs the specified script and returns YES if it does not fail.
// Does not require transaction and inputIndex unless it hits one of signature check opcodes.
// Leaves stack as is after execution.
// This function is a utility function to test scripts. It is used internally by -verifyWithOutputScript:error:
- (BOOL) runScript:(BTCScript*)script error:(NSError**)errorOut;

@end


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Connect.Models;
using Thinktecture.IdentityServer.Core.Services;
using Thinktecture.IdentityServer.Core.Services.InMemory;
using UnitTests.Plumbing;

namespace UnitTests.TokenRequest_Validation
{
    [TestClass]
    public class TokenRequestValidation_Valid
    {
        const string Category = "TokenRequest Validation - General - Valid";

        IClientService _clients = Factory.CreateClientService();

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_Code_Request()
        {
            var client = await _clients.FindClientByIdAsync("codeclient");
            var store = new InMemoryAuthorizationCodeStore();

            var code = new AuthorizationCode
            {
                Client = client,
                IsOpenId = true,
                RedirectUri = new Uri("https://server/cb"),
            };

            await store.StoreAsync("valid", code);

            var validator = Factory.CreateTokenValidator(
                authorizationCodeStore: store);

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, Constants.GrantTypes.AuthorizationCode);
            parameters.Add(Constants.TokenRequest.Code, "valid");
            parameters.Add(Constants.TokenRequest.RedirectUri, "https://server/cb");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_ClientCredentials_Request()
        {
            var client = await _clients.FindClientByIdAsync("client");

            var validator = Factory.CreateTokenValidator();

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, Constants.GrantTypes.ClientCredentials);
            parameters.Add(Constants.TokenRequest.Scope, "resource");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_ClientCredentials_Request_Restricted_Client()
        {
            var client = await _clients.FindClientByIdAsync("client_restricted");

            var validator = Factory.CreateTokenValidator();

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, Constants.GrantTypes.ClientCredentials);
            parameters.Add(Constants.TokenRequest.Scope, "resource");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_ResourceOwner_Request()
        {
            var client = await _clients.FindClientByIdAsync("roclient");

            var validator = Factory.CreateTokenValidator();

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, Constants.GrantTypes.Password);
            parameters.Add(Constants.TokenRequest.UserName, "bob");
            parameters.Add(Constants.TokenRequest.Password, "bob");
            parameters.Add(Constants.TokenRequest.Scope, "resource");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_ResourceOwner_Request_Restricted_Client()
        {
            var client = await _clients.FindClientByIdAsync("roclient_restricted");

            var validator = Factory.CreateTokenValidator();

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, Constants.GrantTypes.Password);
            parameters.Add(Constants.TokenRequest.UserName, "bob");
            parameters.Add(Constants.TokenRequest.Password, "bob");
            parameters.Add(Constants.TokenRequest.Scope, "resource");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_AssertionFlow_Request()
        {
            var client = await _clients.FindClientByIdAsync("assertionclient");

            var validator = Factory.CreateTokenValidator();

            var parameters = new NameValueCollection();
            parameters.Add(Constants.TokenRequest.GrantType, "assertionType");
            parameters.Add(Constants.TokenRequest.Assertion, "assertion");
            parameters.Add(Constants.TokenRequest.Scope, "resource");

            var result = await validator.ValidateRequestAsync(parameters, client);

            Assert.IsFalse(result.IsError);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Diagnostics;
using System.Text;
using NUnit.Framework;

namespace OpenQA.Selenium.Environment
{
    public class TestWebServer
    {
        private Process webserverProcess;

        private string standaloneTestJar = @"java/client/test/org/openqa/selenium/environment/appserver_deploy.jar";
        private string projectRootPath;
        private bool captureWebServerOutput;
        private bool hideCommandPrompt;

        private StringBuilder outputData = new StringBuilder();

        public TestWebServer(string projectRoot, bool captureWebServerOutput, bool hideCommandPrompt)
        {
            projectRootPath = projectRoot;
            this.captureWebServerOutput = captureWebServerOutput;
            this.hideCommandPrompt = hideCommandPrompt;
        }

        public void Start()
        {
            if (webserverProcess == null || webserverProcess.HasExited)
            {
                standaloneTestJar = standaloneTestJar.Replace('/', Path.DirectorySeparatorChar);
                if (!File.Exists(Path.Combine(projectRootPath, standaloneTestJar)))
                {
                    throw new FileNotFoundException(
                        string.Format(
                            "Test webserver jar at {0} didn't exist. Project root is {2}. Please build it using something like {1}.",
                            standaloneTestJar,
                            "bazel build //java/client/test/org/openqa/selenium/environment:appserver_deploy.jar",
                            projectRootPath));
                }

                string javaExecutableName = "java";
                if (System.Environment.OSVersion.Platform == PlatformID.Win32NT || System.Environment.OSVersion.Platform == PlatformID.Win32Windows)
                {
                    javaExecutableName = javaExecutableName + ".exe";
                }

                List<string> javaSystemProperties = new List<string>();
                javaSystemProperties.Add("org.openqa.selenium.environment.webserver.ignoreMissingJsRoots=true");

                StringBuilder processArgsBuilder = new StringBuilder();
                foreach (string systemProperty in javaSystemProperties)
                {
                    if (processArgsBuilder.Length > 0)
                    {
                        processArgsBuilder.Append(" ");
                    }

                    processArgsBuilder.AppendFormat("-D{0}", systemProperty);
                }

                if (processArgsBuilder.Length > 0)
                {
                    processArgsBuilder.Append(" ");
                }

                processArgsBuilder.AppendFormat("-jar {0}", standaloneTestJar);

                webserverProcess = new Process();
                webserverProcess.StartInfo.FileName = javaExecutableName;
                webserverProcess.StartInfo.Arguments = processArgsBuilder.ToString();
                webserverProcess.StartInfo.WorkingDirectory = projectRootPath;
                webserverProcess.StartInfo.UseShellExecute = !(hideCommandPrompt || captureWebServerOutput);
                webserverProcess.StartInfo.CreateNoWindow = hideCommandPrompt;
                if (captureWebServerOutput)
                {
                    webserverProcess.StartInfo.RedirectStandardOutput = true;
                    webserverProcess.StartInfo.RedirectStandardError = true;
                }

                webserverProcess.Start();

                TimeSpan timeout = TimeSpan.FromSeconds(30);
                DateTime endTime = DateTime.Now.Add(TimeSpan.FromSeconds(30));
                bool isRunning = false;
                while (!isRunning && DateTime.Now < endTime)
                {
                    // Poll until the webserver is correctly serving pages.
                    HttpWebRequest request = WebRequest.Create(EnvironmentManager.Instance.UrlBuilder.LocalWhereIs("simpleTest.html")) as HttpWebRequest;
                    try
                    {
                        HttpWebResponse response = request.GetResponse() as HttpWebResponse;
                        if (response.StatusCode == HttpStatusCode.OK)
                        {
                            isRunning = true;
                        }
                    }
                    catch (WebException)
                    {
                    }
                }

                if (!isRunning)
                {
                    string output = "'CaptureWebServerOutput' parameter is false. Web server output not captured";
                    string error = "'CaptureWebServerOutput' parameter is false. Web server output not being captured.";
                    if (captureWebServerOutput)
                    {
                        error = webserverProcess.StandardError.ReadToEnd();
                        output = webserverProcess.StandardOutput.ReadToEnd();
                    }

                    string errorMessage = string.Format("Could not start the test web server in {0} seconds.\nWorking directory: {1}\nProcess Args: {2}\nstdout: {3}\nstderr: {4}", timeout.TotalSeconds, projectRootPath, processArgsBuilder, output, error);
                    throw new TimeoutException(errorMessage);
                }
            }
        }

        public void Stop()
        {
            HttpWebRequest request = WebRequest.Create(EnvironmentManager.Instance.UrlBuilder.LocalWhereIs("quitquitquit")) as HttpWebRequest;
            try
            {
                request.GetResponse();
            }
            catch (WebException)
            {
            }

            if (webserverProcess != null)
            {
                try
                {
                    webserverProcess.WaitForExit(10000);
                    if (!webserverProcess.HasExited)
                    {
                        webserverProcess.Kill();
                    }
                }
                catch (Exception)
                {
                }
                finally
                {
                    webserverProcess.Dispose();
                    webserverProcess = null;
                }
            }
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Phomopsis alni-incanae Sandu

### Remarks
null


text:
FROM maven:3.8.1-openjdk-11-slim AS build
LABEL maintainer michael.vonrueden@h-da.de
LABEL stage build

RUN mkdir -p /app
COPY sources/ /app/
WORKDIR /app
RUN mvn package

##
## Run stage
##
FROM openjdk:11.0-jre-slim
LABEL maintainer michael.vonrueden@h-da.de
EXPOSE 6543/udp

RUN mkdir -p /app
COPY --from=build /app/target/socket-server-1.0-SNAPSHOT.jar /app
CMD [ "java", "-jar", "/app/socket-server-1.0-SNAPSHOT.jar" ]


text:
require 'spec_helper'

describe Salmon::MagicSigEnvelope do

end


text:
package org.betelnut.modules.metrics.reporter;

import org.betelnut.modules.metrics.Counter;
import org.betelnut.modules.metrics.Histogram;
import org.betelnut.modules.metrics.Timer;

import java.util.Map;

/**
 * Reporter的公共接口,被ReportScheduler定时调用。
 *
 */
public interface Reporter {
	void report(Map<String, Counter> counters, Map<String, Histogram> histograms, Map<String, Timer> timers);
}


text:
namespace allocgc { namespace details { namespace collectors {

gc_serial::gc_serial()
    : gc_core(nullptr)
{}

void gc_serial::wbarrier(gc_handle& dst, const gc_handle& src)
{
    gc_unsafe_scope unsafe_scope;
    byte* ptr = gc_handle_access::get<std::memory_order_relaxed>(src);
    gc_handle_access::set<std::memory_order_relaxed>(dst, ptr);
}

gc_runstat gc_serial::gc_impl(const gc_options& options)
{
    if (options.kind != gc_kind::COLLECT) {
        return gc_runstat();
    }

    gc_runstat stats = sweep();
    shrink();
    return stats;
}

gc_runstat gc_serial::sweep()
{
    auto snapshot = stop_the_world();

    trace_uninit(snapshot);
    trace_roots(snapshot);
    trace_pins(snapshot);

    start_concurrent_marking(threads_available());
    start_marking();

    gc_runstat stats;
    stats.collection = collect(snapshot, threads_available());
    stats.pause   = snapshot.time_since_stop_the_world();

    return stats;
}

gc_info gc_serial::info() const
{
    static gc_info inf = {
            .incremental_flag                = false,
            .support_concurrent_marking      = false,
            .support_concurrent_collecting   = false
    };
    return inf;
}

}}}


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\Pack;

/**
 * PackSearch represents the model behind the search form about `backend\models\Pack`.
 */
class PackSearch extends Pack
{
    /**
     * @inheritdoc
     */
	public $productos;
    public function rules()
    {
        return [
            [['id_pack', 'precio', 'estado'], 'integer'],
            [['nombre', 'descripcion', 'path_imagen', 'productos'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Pack::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

		$query->joinWith(['productos']);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id_pack' => $this->id_pack,
            'precio' => $this->precio,
            'estado' => $this->estado,
        ]);

        $query->andFilterWhere(['like', 'nombre', $this->nombre])
            ->andFilterWhere(['like', 'descripcion', $this->descripcion])
            ->andFilterWhere(['like', 'path_imagen', $this->path_imagen]);

        return $dataProvider;
    }
}


text:
package com.htmlhifive.pitalium.core.config;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * テストツールで利用する設定ファイルの属性
 */
@Inherited
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface PtlConfiguration {

	/**
	 * JVM起動引数のキーを取得します。デフォルトはクラス名のlowerCamelCaseです。
	 */
	String argumentName() default "";

	/**
	 * 設定ファイルのデフォルトファイル名を取得します。デフォルトはクラス名のlowerCamelCase + ".json"です。
	 */
	String defaultFileName() default "";

}


text:
#include "pspgl_internal.h"

void __pspgl_enable_state (GLenum cap, GLboolean enable)
{
	int i;
	unsigned char opcode = 0;

	switch (cap) {
	case GL_FOG:
		opcode = CMD_ENA_FOG;
		break;
	case GL_LIGHTING: {
		unsigned long c;
		opcode = CMD_ENA_LIGHTING;

		/* switch material ambient around depending on lighting state */
		if (enable)
			c = pspgl_curctx->material.ambient;
		else
			c = pspgl_curctx->current.color;
		sendCommandi(CMD_MATERIAL_AMB_C, c);
		sendCommandi(CMD_MATERIAL_AMB_A, c>>24);
		break;
		}
	case GL_TEXTURE_2D:
		opcode = CMD_ENA_TEXTURE;
		break;
	case GL_CULL_FACE:
		opcode = CMD_ENA_CULL;
		break;
	case GL_ALPHA_TEST:
		opcode = CMD_ENA_ALPHA_TEST;
		break;
	case GL_BLEND:
		opcode = CMD_ENA_BLEND;
		break;
	case GL_COLOR_LOGIC_OP:
		opcode = CMD_ENA_LOGIC;
		break;
	case GL_DITHER:
		opcode = CMD_ENA_DITHER;
		break;
	case GL_STENCIL_TEST:
		opcode = CMD_ENA_STENCIL_TEST;
		enable = enable && pspgl_curctx->draw->stencil_mask;
		if (enable)
			sendCommandi(CMD_ALPHA_MASK, ~pspgl_curctx->write_mask.stencil);
		else
			sendCommandi(CMD_ALPHA_MASK, ~pspgl_curctx->write_mask.alpha);
		break;
	case GL_DEPTH_TEST:
		opcode = CMD_ENA_DEPTH_TEST;
		enable = enable && pspgl_curctx->draw->depth_buffer;
		break;
	case GL_LIGHT0:
	case GL_LIGHT1:
	case GL_LIGHT2:
	case GL_LIGHT3:
		opcode = cap - GL_LIGHT0 + CMD_ENA_LIGHT0;
		break;
	case GL_LINE_SMOOTH:
	case GL_POINT_SMOOTH:
		opcode = CMD_ENA_ANTIALIAS;	/* XXX : antialiasing. both line and point? */
		break;
	case GL_SCISSOR_TEST:
		pspgl_curctx->scissor_test.enabled = enable;
		__pspgl_set_scissor();
		return;

	case GL_VERTEX_BLEND_PSP:
		/* There's no specific enable flag for vertex
		   blending, but disabling the matricies (=identity)
		   should have the same effect. */
		pspgl_curctx->vertexblend.enabled = enable;
		for(i = 0; i < NBONES; i++) {
			struct pspgl_matrix_stack *m = &pspgl_curctx->bone_stacks[i];

			m->flags = (m->flags & ~MF_DISABLED) |
				(enable ? 0 : MF_DISABLED) | MF_DIRTY;
		}
		break;

	case GL_TEXTURE_GEN_S:
	case GL_TEXTURE_GEN_T:
		/* TODO */
		break;
	case GL_NORMALIZE:
		/* ? */
		break;

	case GL_COLOR_MATERIAL:
	case GL_RESCALE_NORMAL:
	case GL_POLYGON_OFFSET_FILL:
	case GL_VERTEX_ARRAY:
	case GL_NORMAL_ARRAY:
	case GL_COLOR_ARRAY:
	case GL_TEXTURE_COORD_ARRAY:
	case GL_MULTISAMPLE:
	case GL_SAMPLE_ALPHA_TO_COVERAGE:
	case GL_SAMPLE_ALPHA_TO_ONE:
	case GL_SAMPLE_COVERAGE:
	default:
		GLERROR(GL_INVALID_ENUM);
		return;
	}

	if (opcode)
		sendCommandi(opcode, enable);
}

void glEnable (GLenum cap)
{
	__pspgl_enable_state(cap, 1);
}

void glDisable (GLenum cap)
{
	__pspgl_enable_state(cap, 0);
}