text:
package org.drools.core.phreak;

import org.drools.core.spi.Tuple;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class AbstractReactiveObject implements ReactiveObject {
    private List<Tuple> lts;

    public void addLeftTuple(Tuple leftTuple) {
        if (lts == null) {
            lts = new ArrayList<Tuple>();
        }
        lts.add(leftTuple);
    }

    public List<Tuple> getLeftTuples() {
        return lts != null ? lts : Collections.emptyList();
    }

    protected void notifyModification() {
        ReactiveObjectUtil.notifyModification(this);
    }

    @Override
    public void removeLeftTuple(Tuple leftTuple) {
        lts.remove(leftTuple);
    }
}

redpajama_set_name: RedPajamaGithub


text:
@interface LBHomeLoginFortgetSecretViewController : UIViewController

@end


text:
var should = require('should');

var validator = require('../../lib/validator');

describe('Validation helper function', function() {
  describe('parseArray', function() {
    var parsed;
    it('should parse csv', function() {
      parsed = validator.parseArray('a,b,c', 'csv');
      parsed.should.be.instanceOf(Array).and.have.lengthOf(3);
    });
    it('should parse ssv', function() {
      parsed = validator.parseArray('a b c', 'ssv');
      parsed.should.be.instanceOf(Array).and.have.lengthOf(3);
    });
    it('should parse tsv', function() {
      parsed = validator.parseArray('a\tb\tc', 'tsv');
      parsed.should.be.instanceOf(Array).and.have.lengthOf(3);
    });
    it('should parse pipes', function() {
      parsed = validator.parseArray('a|b|c', 'pipes');
      parsed.should.be.instanceOf(Array).and.have.lengthOf(3);
    });
    it('should parse multi', function() {
      parsed = validator.parseArray('a=1&b=2&c=3', 'multi');
      parsed.should.be.instanceOf(Object).and.eql({'a': '1', 'b': '2', 'c': '3'});
    });
  });
  describe('checkUnique', function() {
    var res;
    it('should find unique array', function() {
      res = validator.checkUnique([1,2,3]);
      res.should.be.true;
    });
    it('should find not unique array', function() {
      res = validator.checkUnique([3,4,2,4]);
      res.should.be.false;
    });
  });
});


text:
package instructions

import (
	"github.com/zxh0/jvm.go/jvmgo/jvm/rtda"
	rtc "github.com/zxh0/jvm.go/jvmgo/jvm/rtda/class"
)

// Fetch field from object
type getfield struct{ Index16Instruction }

func (self *getfield) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	ref := stack.PopRef()
	if ref == nil {
		frame.Thread().ThrowNPE()
		return
	}

	cp := frame.Method().ConstantPool()
	kFieldRef := cp.GetConstant(self.index).(*rtc.ConstantFieldref)
	field := kFieldRef.InstanceField()
	val := field.GetValue(ref)

	stack.Push(val)
}

// Get static field from class
type getstatic struct{ Index16Instruction }

func (self *getstatic) Execute(frame *rtda.Frame) {
	cp := frame.Method().Class().ConstantPool()
	kFieldRef := cp.GetConstant(self.index).(*rtc.ConstantFieldref)
	field := kFieldRef.StaticField()

	class := field.Class()
	if class.InitializationNotStarted() {
		frame.RevertNextPC() // undo getstatic
		frame.Thread().InitClass(class)
		return
	}

	val := field.GetStaticValue()
	frame.OperandStack().Push(val)
}


text:
package net.lkrnac.blog.spring.encapsulatebean;

import net.lkrnac.blog.spring.encapsulatebean.service.UserService;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
public class ApplicationTests {
	@Autowired
	private UserService userService;

	@Test
	public void isPackagePrivateBeanCalled(){
		//GIVEN - spring context defined by Application class

		//WHEN
		String actualUserDetails = userService.getUserDetails("john");

		//THEN
		Assert.assertEquals("User: john, 3 Dark Corner", actualUserDetails);
	}
}


text:
import { GraphQLBoolean } from 'graphql'

// `dryrun` argument
export const getDryrunArgument = function ({ command }) {
  const hasDryrun = DRYRUN_COMMANDS.has(command)

  if (!hasDryrun) {
    return {}
  }

  return DRYRUN_ARGS
}

const DRYRUN_COMMANDS = new Set(['create', 'upsert', 'patch', 'delete'])

const DRYRUN_ARGS = {
  dryrun: {
    type: GraphQLBoolean,
    description:
      'No modification will be applied to the database, but the response will be the same as if it did.',
    defaultValue: false,
  },
}


text:
import plistlib
import subprocess

factoid = "recovery_device"

def fact():
    """Returns the boot volume of this Mac"""
    try:
        proc = subprocess.Popen(
            ["/usr/sbin/diskutil", "info", "-plist", "/"],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        stdout, _ = proc.communicate()
        d = plistlib.loads(stdout.strip())
        recovery_device = d["RecoveryDeviceIdentifier"]
    except (IOError, OSError):
        pass

    return {factoid: recovery_device}

if __name__ == "__main__":
    print("<result>%s</result>" % fact()[factoid])


text:
require 'libis/workflow'

require_relative 'intellectual_entity'

module Libis
  module Ingester

    class DavDossier < Libis::Ingester::IntellectualEntity
      include Libis::Workflow::Base::DirItem

      def filepath
        ''
      end

    end

  end
end


text:
using System;
using System.IO;
using FSpot.Utils;
using Hyena;
using TagLib.Image;
using GFileInfo = GLib.FileInfo;

namespace FSpot.Imaging
{
	public interface IImageFile : IDisposable
	{
		SafeUri Uri { get; }
		ImageOrientation Orientation { get; }

		Gdk.Pixbuf Load ();
		Cms.Profile GetProfile ();
		Gdk.Pixbuf Load (int maxWidth, int maxHeight);
		Stream PixbufStream ();
	}

	public class BaseImageFile : IImageFile
	{
		bool disposed;

		public SafeUri Uri { get; private set; }

		public ImageOrientation Orientation { get; private set; }

		public BaseImageFile (SafeUri uri)
		{
			Uri = uri;
			Orientation = ImageOrientation.TopLeft;

			using (var metadata_file = Metadata.Parse (uri)) {
				ExtractMetadata (metadata_file);
			}
		}

		protected virtual void ExtractMetadata (TagLib.Image.File metadata)
		{
			if (metadata != null)
				Orientation = metadata.ImageTag.Orientation;
		}

		public virtual Stream PixbufStream ()
		{
			Log.DebugFormat ("open uri = {0}", Uri);
			return new GLib.GioStream (GLib.FileFactory.NewForUri (Uri).Read (null));
		}

		protected Gdk.Pixbuf TransformAndDispose (Gdk.Pixbuf orig)
		{
			if (orig == null)
				return null;

			Gdk.Pixbuf rotated = FSpot.Utils.PixbufUtils.TransformOrientation (orig, Orientation);

			orig.Dispose ();

			return rotated;
		}

		public Gdk.Pixbuf Load ()
		{
			using (Stream stream = PixbufStream ()) {
				Gdk.Pixbuf orig = new Gdk.Pixbuf (stream);
				return TransformAndDispose (orig);
			}
		}

		public Gdk.Pixbuf Load (int maxWidth, int maxHeight)
		{
			using (Gdk.Pixbuf full = Load ()) {
				return PixbufUtils.ScaleToMaxSize (full, maxWidth, maxHeight);
			}
		}

		// FIXME this need to have an intent just like the loading stuff.
		public virtual Cms.Profile GetProfile ()
		{
			return null;
		}

		public void Dispose ()
		{
			Dispose (true);
			GC.SuppressFinalize (this);
		}

		protected virtual void Dispose (bool disposing)
		{
			if (disposed)
				return;
			disposed = true;

			if (disposing)
				Close ();
		}

		protected virtual void Close ()
		{
		}
	}
}


text:
declare namespace java {
  namespace util {

    class IntSummaryStatistics implements java.util.function$.IntConsumer {
      public constructor()
      public constructor(arg0: number | java.lang.Long, arg1: number | java.lang.Integer, arg2: number | java.lang.Integer, arg3: number | java.lang.Long)
      public accept(arg0: number | java.lang.Integer): void
      public combine(arg0: java.util.IntSummaryStatistics): void
      public getCount(): number
      public getSum(): number
      public getMin(): number
      public getMax(): number
      public getAverage(): number
      public toString(): java.lang.String
    }

  }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jul 13, 2012 6:22:22 AM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
    <class name="schema.Book" table="book" catalog="dblp">
        <id name="id" type="int">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <property name="bookId" type="string">
            <column name="book_id" length="50" not-null="true" />
        </property>
        <property name="title" type="string">
            <column name="title" length="65535" />
        </property>
        <property name="volume" type="string">
            <column name="volume" length="65535" />
        </property>
        <property name="ee" type="string">
            <column name="ee" length="65535" />
        </property>
        <property name="year" type="java.lang.Integer">
            <column name="year" />
        </property>
        <property name="pages" type="string">
            <column name="pages" length="65535" />
        </property>
        <property name="url" type="string">
            <column name="url" length="65535" />
        </property>
        <property name="publisher" type="string">
            <column name="publisher" length="65535" />
        </property>
        <property name="booktitle" type="string">
            <column name="booktitle" length="65535" />
        </property>
        <property name="cite" type="string">
            <column name="cite" length="65535" />
        </property>
        <property name="isbn" type="string">
            <column name="ISBN" length="65535" />
        </property>
        <property name="series" type="string">
            <column name="series" length="65535" />
        </property>
        <property name="cdrom" type="string">
            <column name="cdrom" length="65535" />
        </property>
        <property name="month" type="string">
            <column name="month" length="65535" />
        </property>
    </class>
</hibernate-mapping>


text:
<?php
/**
 * Created by PhpStorm.
 * User: gseidel
 * Date: 31.08.18
 * Time: 22:06
 */

namespace Enhavo\Bundle\SearchBundle\Exception;

class FilterQueryNotSupportedException extends \Exception
{

}


text:
const assert        = require('assert');
const formatDecimal = require('format-decimal');
const jfLogger      = require('./index');
let assertions      = 0;
const levels        = {
    debug : msg => checkMessage(msg, 'debug'),
    error : msg => checkMessage(msg, 'error'),
    fatal : msg => checkMessage(msg, 'fatal'),
    info  : msg => checkMessage(msg, 'info'),
    log   : msg => checkMessage(msg, 'log'),
    trace : msg => checkMessage(msg, 'trace'),
    warn  : msg => checkMessage(msg, 'warn'),
};

function assertEqual(actual, expected)
{
    assert.strictEqual(actual, expected);
    ++assertions;
}

// No hay mucho que verificar ya que del resto se encarga el módulo log4js.
// Solamente verificamos que se llame al método apropiado de log4js y se formatee correctamente el texto.
function checkMessage(msg, name)
{
    // Eliminamos los colores.
    msg          = msg.replace(/\x1B\[\d{2}m/g, '');
    const _parts = msg.match(/\[([^\]]+)\]\s(.+)/);
    if (_parts)
    {
        const _name = _parts[1];
        assertEqual(_name.length, length);
        if (name)
        {
            assertEqual(_name.indexOf(name), 0);
        }
        else
        {
            const _loggerName = logger.constructor.name;
            const _llength    = _loggerName.length;
            if (_llength > length)
            {
                assertEqual(
                    _name.trim(),
                    '*' + _loggerName.substr(_llength - length + 1)
                );
            }
            else if (_llength === length)
            {
                assertEqual(_name, _loggerName);
            }
            else
            {
                assertEqual(_name, (_loggerName + ' '.repeat(length)).substr(0, length));
            }
        }
        msg = _parts[2];
        assertEqual(...(msg.split('=')));
    }
    else
    {
        assertEqual(msg, name);
    }
}

function testLevels()
{
    const logger   = new jfLogger();
    logger._logger = levels;
    Object.keys(levels).forEach(
        name => logger.log(name, false, name)
    );
}

function testMessage()
{
    const logger                = new jfLogger();
    // Realizamos las pruebas sin tomar en cuenta los colores.
    logger.addColorsToLogParams = p => p;
    const names                 = Object.keys(levels);
    for (const length of [5, 10, 20])
    {
        logger._loggerNameLength = length;
        for (const name of [false, '', ...names])
        {
            names.forEach(
                (level, index) => logger.log(level, name, `Test %d {name}=Test ${index} ${name}`, index, { name })
            );
        }
    }
}

function testNameLength()
{
    // Verificamos que al asignar la longitud por defecto, todas las
    // nuevas instancias usen ese valor.
    for (let length = 0; length < 50; ++length)
    {
        jfLogger.setDefaultNameLength(length);
        assertEqual(new jfLogger()._loggerNameLength, length);
    }
}

function testSingleton()
{
    // Verificamos el singleton
    assertEqual(jfLogger.i(), jfLogger.i());
}

testLevels();
testMessage();
testNameLength();
testSingleton();
console.log('\n\nTotal aserciones: %s', formatDecimal(assertions, { precision : 0 }));


text:
% This is my main script to perform experiments : selecting the type of pulses and get MSVD plots
%% Parameters data
clear all
close all
clc

% gaussian : n=12500 width 0.15
% triangle : n=12500 width 0.05
tic
data_options = struct();
data_options.type = 'triangle';
data_options.noise_level = 1;
data_options.k = 2;
data_options.n = 10000 ;
data_options.D = 200;
data_options.gain = 'off';
data_options.circular = 'on';
data_options.width = 0.2;

data_options.neigh = 1000;
data_options.tries = 50;
%% Parameters algo
radius_options = struct('it',5,'it_end',2,'it_start',5,'it_mid',4);

%% Subsampling options
sub_options = struct('state',true,'nb',round(sqrt(data_options.n)));

%% Plotting options
plt_options = struct('sample',true,'sample_nb',2,'avg',true,'msvd',true,'rmsvd',true);

%% Generating dataset of pulses
noisy_data = generate_data(data_options);

%% some key radii
dm = distance_matrix(noisy_data); %Compute the distance matrix

r_min = max(min(dm));
r_max = min(max(dm));
r_max_max = max(max(dm));
pas = (r_max_max-r_min)/50 ;
all_radius = r_min:pas:r_max_max; % first select a wide range of radius

%% finding the relevant scale for this manifold
[relevant_scale, spread] = best_scale(data_options, 0.99)
spread = 0.1 * r_max;
radius = [ linspace(0,relevant_scale-spread,radius_options.it_start), ...
    linspace(relevant_scale-spread, relevant_scale+spread, radius_options.it), ...
    linspace(relevant_scale+spread,r_max,radius_options.it_mid), ...
    linspace(r_max,r_max_max,radius_options.it_end)] ;

radius = unique(radius); % to delete doublons

%%
avg_vector = zeros(1,length(all_radius));
for i = 1:length(all_radius)
    avg_vector(i) = avg_nb_per_ball(dm,all_radius(i));
end

%% nb neighbors wrt radius

if plt_options.avg
    figure;
    plot(all_radius,avg_vector)
    hold on
    scatter(radius',zeros(length(radius),1),'filled');
    hold on
    pmax = scatter(relevant_scale,0, 'filled');
    title(sprintf('Average nb of neighbors, wrt the radius (%s dim %d)', data_options.type ,data_options.k));
    xlabel('radius');
    nb_neighbors = 20;
    relevant_radius = all_radius(find(avg_vector > nb_neighbors, 1));
    fprintf('\nRelevant radius : %d \n', relevant_radius);
end
%% to get the approximate number of neighbors at the best scale
r_idx = find(all_radius > relevant_scale,1);
% avg_nb_neighbors = zeros(1,length(radius));
fprintf('Avg Nb of neighbors at relevant scale : %d \n' , round(avg_vector(r_idx)));

%% some points
if plt_options.sample
    I = linspace(0,1,data_options.D);
    for ii=1:plt_options.sample_nb
        figure;
        plot(I, noisy_data(ii,:))
        title( sprintf('%s pulses with dim %d ' , data_options.type, data_options.k));
    end
end
%% Computing nearest neighbors
[sd_m, nn_m] = NN_matrices(dm);

%% processing multiscale svd
disp('Multiscale in progress ...')

Eeigenval = zeros(min(data_options.n,data_options.D),length(radius));
EReigenval = zeros(min(data_options.n,data_options.D),length(radius));
Stdeigenval = zeros(min(data_options.n,data_options.D),length(radius));
StdReigenval = zeros(min(data_options.n,data_options.D),length(radius));

if sub_options.state
    [~,~,~,~,subsample_idx] = kmedoids(noisy_data, sub_options.nb); % kmedoids + subsample idx

    for i = 1:length(radius)

        local_eigval_matrix = zeros(min(data_options.n,data_options.D),sub_options.nb);
        local_relative_eigval_matrix = zeros(min(data_options.n,data_options.D),sub_options.nb);
        r = radius(i);
        if r < r_max %case r is small enough to perform local svd

            for j = 1:sub_options.nb
                nb_n = find(sd_m(subsample_idx(j),:) > r ,1); %find the number of neighbors
                n_idx = nn_m(subsample_idx(j),1:nb_n); %get indices of these neighbors
                ball_z_r = noisy_data(n_idx,:);
                ball_z_r = bsxfun(@minus,ball_z_r,mean(ball_z_r,1)); % we center the data
                local_eigval = svd(ball_z_r');
                local_eigval_matrix(1:size(local_eigval,1),j) = local_eigval;
                local_relative_eigval_matrix(1:size(local_eigval,1),j) = local_eigval/local_eigval(1); % relative weights of eigvals
            end
            for l = 1:min(data_options.n,data_options.D)
                sv_vec = local_eigval_matrix(l,:);
                Eeigenval(l,i) = mean(sv_vec);
                if isnan(Eeigenval(l,i))
                    Eeigenval(l,i)= 0;
                end
                Stdeigenval(l,i) = std(sv_vec);
                if isnan(Stdeigenval(l,i))
                    Stdeigenval(l,i) = 0;
                end

                rsv_vec = local_relative_eigval_matrix(l,:);
                EReigenval(l,i) = mean(rsv_vec);
                if isnan(EReigenval(l,i))
                    EReigenval(l,i)= 0;
                end
                StdReigenval(l,i) = std(rsv_vec);
                if isnan(StdReigenval(l,i))
                    StdReigenval(l,i) = 0;
                end
            end
        else
            %case global svd
            global_ball = noisy_data;
            global_ball = bsxfun(@minus,global_ball,mean(global_ball,1)); % we center the data
            global_eigval = svd(global_ball);
            Eeigenval(1:size(global_eigval,1),i) = global_eigval;
            EReigenval(1:size(global_eigval,1),i) = global_eigval/global_eigval(1);
        end

    end

    Eeigenval = Eeigenval./sqrt(sub_options.nb); %rescale to fit with the article where they use the matrix X * 1 / sqrt(n)
    Stdeigenval = Stdeigenval./sqrt(sub_options.nb);

else
    for i = 1:length(radius)

        local_eigval_matrix = zeros(min(data_options.n,data_options.D),data_options.n);
        r = radius(i);
        if r < r_max %case r is small enough to perform local svd

            for j = 1:data_options.n
                nb_n = find(sd_m(j,:) > r ,1); %find the number of neighbors
                n_idx = nn_m(j,1:nb_n); %get indices of these neighbors
                ball_z_r = noisy_data(n_idx,:);
                ball_z_r = bsxfun(@minus,ball_z_r,mean(ball_z_r,1)); % we center the data
                local_eigval = svd(ball_z_r');
                local_eigval_matrix(1:size(local_eigval,1),j) = local_eigval;
            end
            for l = 1:min(data_options.n,data_options.D)
                sv_vec = local_eigval_matrix(l,:);
                %Eeigenval(k,i) = mean(sv_vec(sv_vec>0)); %
                Eeigenval(l,i) = mean(sv_vec);
                if isnan(Eeigenval(l,i))
                    Eeigenval(l,i)= 0;
                end
                %Stdeigenval(k,i) = std(sv_vec(sv_vec>0));
                Stdeigenval(l,i) = std(sv_vec);
                if isnan(Stdeigenval(l,i))
                    Stdeigenval(l,i) = 0;
                end
            end
        else
            %case global svd
            global_ball = noisy_data;
            global_ball = bsxfun(@minus,global_ball,mean(global_ball,1)); % we center the data
            global_eigval = svd(global_ball);
            Eeigenval(1:size(global_eigval,1),i) = global_eigval;
        end

    end

    Eeigenval = Eeigenval./sqrt(data_options.n); %rescale to fit with the article where they use the matrix X * 1 / sqrt(n)
    Stdeigenval = Stdeigenval./sqrt(data_options.n);
end
disp('done')

%  Plotting results
disp('Plotting')
y = min(data_options.n,data_options.D);
if plt_options.msvd
    figure;
    for i = 1:y
        plot([0,radius],[0,Eeigenval(i,:)],'-b')
        hold on
        plot([0,radius],[0,Eeigenval(i,:)+Stdeigenval(i,:)],':k')
        hold on
        plot([0,radius],[0,Eeigenval(i,:)-Stdeigenval(i,:)],':r')
        hold on
    end
    ax = gca();
    pmax = plot([r_max, r_max],ax.YLim, '-m');
    hold on
    rbest = plot([relevant_scale, relevant_scale],ax.YLim, '-g');
    hold on
    scatter(radius,zeros(length(radius),1),'filled');
    hold on

    title( sprintf('MSVD %s pulses with dim %d ' , data_options.type, data_options.k));
    xlabel('radius') % x-axis label
    ylabel('$$ E_{z}\left[\sigma_{i}\left(z,r\right)\right] $$', 'Interpreter', 'latex') % y-axis label
end

if plt_options.rmsvd
    figure;
    for i = 1:y
        plot([0,radius],[0,EReigenval(i,:)],'-b')
        hold on
        plot([0,radius],[0,EReigenval(i,:)+StdReigenval(i,:)],':k')
        hold on
        plot([0,radius],[0,EReigenval(i,:)-StdReigenval(i,:)],':r')
        hold on
    end
    ax = gca();
    pmax = plot([r_max, r_max],ax.YLim, '-m');
    hold on
    rbest = plot([relevant_scale, relevant_scale],ax.YLim, '-g');
    hold on
    scatter(radius,zeros(length(radius),1),'filled');
    hold on
    ylim([0, 1.1])
    title( sprintf('Relative MSVD %s pulses with dim %d ' , data_options.type, data_options.k));
    xlabel('radius') % x-axis label
    ylabel('$$ E_{z}\left[\sigma_{i}\left(z,r\right)\right] / E_{z}\left[\sigma_{1}\left(z,r\right)\right] $$', 'Interpreter', 'latex') % y-axis label
end

toc


text:
using namespace std;
using namespace IECore;

namespace asf = foundation;
namespace asr = renderer;

IECoreAppleseed::AttributeState::AttributeState()
{
	m_attributes = new CompoundData;
	m_photonTarget = false;
}

IECoreAppleseed::AttributeState::AttributeState( const AttributeState &other )
{
	m_attributes = other.m_attributes->copy();
	m_shadingState = other.m_shadingState;
	m_alphaMap = other.m_alphaMap;
	m_photonTarget = other.m_photonTarget;
	m_visibilityDictionary = other.m_visibilityDictionary;
}

void IECoreAppleseed::AttributeState::setAttribute( const string &name, ConstDataPtr value )
{
	m_attributes->writable()[name] = value->copy();

	if( name == "name" )
	{
		if( const StringData *f = runTimeCast<const StringData>( value.get() ) )
		{
			m_name = f->readable();
		}
		else
		{
			msg( Msg::Error, "IECoreAppleseed::RendererImplementation::setAttribute", "name attribute expects a StringData value." );
		}
	}
	else if( name == "as:alpha_map" )
	{
		if( const StringData *f = runTimeCast<const StringData>( value.get() ) )
		{
			m_alphaMap = f->readable();
		}
		else
		{
			msg( Msg::Error, "IECoreAppleseed::RendererImplementation::setAttribute", "as:alpha_map attribute expects a StringData value." );
		}
	}
	else if( name == "as:shading_samples" )
	{
		if( const IntData *f = runTimeCast<const IntData>( value.get() ) )
		{
			m_shadingState.setShadingSamples( f->readable() );
		}
		else
		{
			msg( Msg::Error, "IECoreAppleseed::RendererImplementation::setAttribute", "as:shading_samples attribute expects an IntData value." );
		}
	}
	else if( name == "as:photon_target" )
	{
		if( const BoolData *f = runTimeCast<const BoolData>( value.get() ) )
		{
			m_photonTarget = f->readable();
		}
		else
		{
			msg( Msg::Error, "IECoreAppleseed::RendererImplementation::setAttribute", "photon_target attribute expect a BoolData value." );
		}
	}
	else if( 0 == name.compare( 0, 14, "as:visibility:" ) )
	{
		if( const BoolData *f = runTimeCast<const BoolData>( value.get() ) )
		{
			string flag_name( name, 14, string::npos );
			m_visibilityDictionary.insert( flag_name.c_str(), f->readable() ? "true" : "false" );
		}
		else
		{
			msg( Msg::Error, "IECoreAppleseed::RendererImplementation::setAttribute", "visibility attributes expect a BoolData value." );
		}
	}
}

ConstDataPtr IECoreAppleseed::AttributeState::getAttribute( const string &name ) const
{
	return m_attributes->member<Data>( name );
}

const string &IECoreAppleseed::AttributeState::name() const
{
	return m_name;
}

const asf::Dictionary &IECoreAppleseed::AttributeState::visibilityDictionary() const
{
	return m_visibilityDictionary;
}

const std::string &IECoreAppleseed::AttributeState::alphaMap() const
{
	return m_alphaMap;
}

bool IECoreAppleseed::AttributeState::photonTarget() const
{
	return m_photonTarget;
}

void IECoreAppleseed::AttributeState::attributesHash( MurmurHash &hash ) const
{
	hash.append( m_alphaMap );
	hash.append( m_photonTarget );
}

void IECoreAppleseed::AttributeState::addOSLShader( ConstShaderPtr shader )
{
	m_shadingState.addOSLShader( shader );
}

void IECoreAppleseed::AttributeState::setOSLSurface( ConstShaderPtr surface )
{
	m_shadingState.setOSLSurface( surface );
}

bool IECoreAppleseed::AttributeState::shadingStateValid() const
{
	return m_shadingState.valid();
}

void IECoreAppleseed::AttributeState::shaderGroupHash( MurmurHash &hash ) const
{
	m_shadingState.shaderGroupHash( hash );
}

void IECoreAppleseed::AttributeState::materialHash( MurmurHash &hash ) const
{
	m_shadingState.materialHash( hash );
}

string IECoreAppleseed::AttributeState::createShaderGroup( asr::Assembly &assembly )
{
	return m_shadingState.createShaderGroup( assembly, name() );
}

void IECoreAppleseed::AttributeState::editShaderGroup( renderer::Assembly &assembly, const string &name )
{
	m_shadingState.editShaderGroup( assembly, name );
}

string IECoreAppleseed::AttributeState::createMaterial( asr::Assembly &assembly, const string &shaderGroupName )
{
	return m_shadingState.createMaterial( assembly, name(), shaderGroupName );
}


text:
package twizansk.hivemind.api.data;

public interface TrainingSet {

	/**
	 * Get the next training sample in the set.
	 *
	 * @return
	 * 		A training sample
	 */
	public TrainingSample getNext();

	/**
	 * Reset the data set.
	 */
	public void reset();

}


text:
<!DOCTYPE html>

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

        <link rel="apple-touch-icon" href="assets/images/icon/apple-touch-icon.png" />
        <link rel="apple-touch-icon" sizes="57x57" href="assets/images/icon/apple-touch-icon-57x57-precomposed.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="assets/images/icon/apple-touch-icon-72x72-precomposed.png" />
        <link rel="apple-touch-icon" sizes="114x114" href="assets/images/icon/apple-touch-icon-114x114-precomposed.png" />
        <link rel="apple-touch-icon" sizes="144x144" href="assets/images/icon/apple-touch-icon-144x144-precomposed.png" />

        <link href="css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
        <link href="css/print.css" media="print" rel="stylesheet" type="text/css" />


text:
import java.util.concurrent.atomic.AtomicInteger;
class Test {
  AtomicInteger i;

  void foo() {
    i.getAndIncrement();
    i.incrementAndGet();
    i.getAndDecrement();
    i.decrementAndGet();
    System.out.println(i.getAndIncrement());
    System.out.println(i.decrementAndGet());
  }
}


text:
package com.mongodb.client.model;

import org.bson.conversions.Bson;

import java.util.concurrent.TimeUnit;

import static com.mongodb.assertions.Assertions.notNull;

/**
 * The options for a count operation.
 *
 * @since 3.0
 * @mongodb.driver.manual reference/command/count/ Count
 */
public class CountOptions {
    private Bson hint;
    private String hintString;
    private int limit;
    private int skip;
    private long maxTimeMS;
    private Collation collation;

    /**
     * Gets the hint to apply.
     *
     * @return the hint, which should describe an existing
     */
    public Bson getHint() {
        return hint;
    }

    /**
     * Gets the hint string to apply.
     *
     * @return the hint string, which should be the name of an existing index
     */
    public String getHintString() {
        return hintString;
    }

    /**
     * Sets the hint to apply.
     *
     * @param hint a document describing the index which should be used for this operation.
     * @return this
     */
    public CountOptions hint(final Bson hint) {
        this.hint = hint;
        return this;
    }

    /**
     * Sets the hint to apply.
     *
     * @param hint the name of the index which should be used for the operation
     * @return this
     */
    public CountOptions hintString(final String hint) {
        this.hintString = hint;
        return this;
    }

    /**
     * Gets the limit to apply.  The default is 0, which means there is no limit.
     *
     * @return the limit
     * @mongodb.driver.manual reference/method/cursor.limit/#cursor.limit Limit
     */
    public int getLimit() {
        return limit;
    }

    /**
     * Sets the limit to apply.
     *
     * @param limit the limit
     * @return this
     * @mongodb.driver.manual reference/method/cursor.limit/#cursor.limit Limit
     */
    public CountOptions limit(final int limit) {
        this.limit = limit;
        return this;
    }

    /**
     * Gets the number of documents to skip.  The default is 0.
     *
     * @return the number of documents to skip
     * @mongodb.driver.manual reference/method/cursor.skip/#cursor.skip Skip
     */
    public int getSkip() {
        return skip;
    }

    /**
     * Sets the number of documents to skip.
     *
     * @param skip the number of documents to skip
     * @return this
     * @mongodb.driver.manual reference/method/cursor.skip/#cursor.skip Skip
     */
    public CountOptions skip(final int skip) {
        this.skip = skip;
        return this;
    }

    /**
     * Gets the maximum execution time on the server for this operation.  The default is 0, which places no limit on the execution time.
     *
     * @param timeUnit the time unit to return the result in
     * @return the maximum execution time in the given time unit
     */
    public long getMaxTime(final TimeUnit timeUnit) {
        notNull("timeUnit", timeUnit);
        return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS);
    }

    /**
     * Sets the maximum execution time on the server for this operation.
     *
     * @param maxTime  the max time
     * @param timeUnit the time unit, which may not be null
     * @return this
     */
    public CountOptions maxTime(final long maxTime, final TimeUnit timeUnit) {
        notNull("timeUnit", timeUnit);
        this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit);
        return this;
    }

    /**
     * Returns the collation options
     *
     * @return the collation options
     * @since 3.4
     * @mongodb.server.release 3.4
     */
    public Collation getCollation() {
        return collation;
    }

    /**
     * Sets the collation options
     *
     *
A null value represents the server default.

     * @param collation the collation options to use
     * @return this
     * @since 3.4
     * @mongodb.server.release 3.4
     */
    public CountOptions collation(final Collation collation) {
        this.collation = collation;
        return this;
    }
}


text:
namespace link_header_util {

namespace {

void SplitLinkHeaderForTesting(const std::string& header,
                               std::vector<std::string>* values) {
  std::vector<StringIteratorPair> values_iterators = SplitLinkHeader(header);
  values->clear();
  for (const auto& pair : values_iterators)
    values->push_back(std::string(pair.first, pair.second));
}

bool ParseLinkHeaderValueForTesting(
    std::string value,
    std::string* url,
    std::unordered_map<std::string, base::Optional<std::string>>* params) {
  return ParseLinkHeaderValue(value.begin(), value.end(), url, params);
}

TEST(LinkHeaderTest, SplitEmpty) {
  std::vector<std::string> values;
  SplitLinkHeaderForTesting("", &values);
  ASSERT_EQ(0u, values.size());
}

TEST(LinkHeaderTest, SplitSimple) {
  std::vector<std::string> values;
  SplitLinkHeaderForTesting("hello", &values);
  ASSERT_EQ(1u, values.size());
  EXPECT_EQ("hello", values[0]);

  SplitLinkHeaderForTesting("foo, bar", &values);
  ASSERT_EQ(2u, values.size());
  EXPECT_EQ("foo", values[0]);
  EXPECT_EQ("bar", values[1]);

  SplitLinkHeaderForTesting(" 1\t,\t2,3", &values);
  ASSERT_EQ(3u, values.size());
  EXPECT_EQ("1", values[0]);
  EXPECT_EQ("2", values[1]);
  EXPECT_EQ("3", values[2]);
}

TEST(LinkHeaderTest, SplitSkipsEmpty) {
  std::vector<std::string> values;
  SplitLinkHeaderForTesting(", foo, , \t, bar", &values);
  ASSERT_EQ(2u, values.size());
  EXPECT_EQ("foo", values[0]);
  EXPECT_EQ("bar", values[1]);
}

TEST(LinkHeaderTest, SplitQuotes) {
  std::vector<std::string> values;
  SplitLinkHeaderForTesting("\"foo,bar\", 'bar,foo', <hel,lo>", &values);
  ASSERT_EQ(4u, values.size());
  EXPECT_EQ("\"foo,bar\"", values[0]);
  EXPECT_EQ("'bar", values[1]);
  EXPECT_EQ("foo'", values[2]);
  EXPECT_EQ("<hel,lo>", values[3]);
}

TEST(LinkHeaderTest, SplitEscapedQuotes) {
  std::vector<std::string> values;
  SplitLinkHeaderForTesting("\"f\\\"oo,bar\", 'b\\'ar,foo', <hel\\>,lo>",
                            &values);
  ASSERT_EQ(5u, values.size());
  EXPECT_EQ("\"f\\\"oo,bar\"", values[0]);
  EXPECT_EQ("'b\\'ar", values[1]);
  EXPECT_EQ("foo'", values[2]);
  EXPECT_EQ("<hel\\>", values[3]);
  EXPECT_EQ("lo>", values[4]);
}

struct SimpleParseTestData {
  const char* link;
  bool valid;
  const char* url;
  const char* rel;
  const char* as;
};

void PrintTo(const SimpleParseTestData& test, std::ostream* os) {
  *os << ::testing::PrintToString(test.link);
}

class SimpleParseTest : public ::testing::TestWithParam<SimpleParseTestData> {};

TEST_P(SimpleParseTest, Simple) {
  const SimpleParseTestData test = GetParam();

  std::string url;
  std::unordered_map<std::string, base::Optional<std::string>> params;
  EXPECT_EQ(test.valid,
            ParseLinkHeaderValueForTesting(test.link, &url, &params));
  if (test.valid) {
    EXPECT_EQ(test.url, url);
    EXPECT_EQ(test.rel, params["rel"].value_or(""));
    EXPECT_EQ(test.as, params["as"].value_or(""));
  }
}

// Test data mostly copied from blink::LinkHeaderTest. Expectations for a small
// subset of test cases are different though. Mostly because blink::LinkHeader
// factors in knowledge about semantics of Link headers (parameters that are
// required to have a value if they occur, some parameters are auto-lower-cased,
// headers with an "anchor" parameter are rejected by base::LinkHeader).
// The code this tests purely parses without actually interpreting the data, as
// it is expected that another layer on top will do more specific validations.
const SimpleParseTestData simple_parse_tests[] = {
    {"</images/cat.jpg>; rel=prefetch", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>;rel=prefetch", true, "/images/cat.jpg", "prefetch", ""},
    {"</images/cat.jpg>   ;rel=prefetch", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>   ;   rel=prefetch", true, "/images/cat.jpg",
     "prefetch", ""},
    {"< /images/cat.jpg>   ;   rel=prefetch", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/cat.jpg >   ;   rel=prefetch", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/cat.jpg wutwut>   ;   rel=prefetch", true,
     "/images/cat.jpg wutwut", "prefetch", ""},
    {"</images/cat.jpg wutwut  \t >   ;   rel=prefetch", true,
     "/images/cat.jpg wutwut", "prefetch", ""},
    {"</images/cat.jpg>; rel=prefetch   ", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>; Rel=prefetch   ", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>; Rel=PReFetCh   ", true, "/images/cat.jpg", "PReFetCh",
     ""},
    {"</images/cat.jpg>; rel=prefetch; rel=somethingelse", true,
     "/images/cat.jpg", "prefetch", ""},
    {"</images/cat.jpg>\t\t ; \trel=prefetch \t  ", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/cat.jpg>; rel= prefetch", true, "/images/cat.jpg", "prefetch",
     ""},
    {"<../images/cat.jpg?dog>; rel= prefetch", true, "../images/cat.jpg?dog",
     "prefetch", ""},
    {"</images/cat.jpg>; rel =prefetch", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>; rel pel=prefetch", false},
    {"< /images/cat.jpg>", true, "/images/cat.jpg", "", ""},
    {"</images/cat.jpg>; wut=sup; rel =prefetch", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/cat.jpg>; wut=sup ; rel =prefetch", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/cat.jpg>; wut=sup ; rel =prefetch  \t  ;", true,
     "/images/cat.jpg", "prefetch", ""},
    {"</images/cat.jpg> wut=sup ; rel =prefetch  \t  ;", false},
    {"<   /images/cat.jpg", false},
    {"<   http://wut.com/  sdfsdf ?sd>; rel=dns-prefetch", true,
     "http://wut.com/  sdfsdf ?sd", "dns-prefetch", ""},
    {"<   http://wut.com/%20%20%3dsdfsdf?sd>; rel=dns-prefetch", true,
     "http://wut.com/%20%20%3dsdfsdf?sd", "dns-prefetch", ""},
    {"<   http://wut.com/dfsdf?sdf=ghj&wer=rty>; rel=prefetch", true,
     "http://wut.com/dfsdf?sdf=ghj&wer=rty", "prefetch", ""},
    {"<   http://wut.com/dfsdf?sdf=ghj&wer=rty>;;;;; rel=prefetch", true,
     "http://wut.com/dfsdf?sdf=ghj&wer=rty", "prefetch", ""},
    {"<   http://wut.com/%20%20%3dsdfsdf?sd>; rel=preload;as=image", true,
     "http://wut.com/%20%20%3dsdfsdf?sd", "preload", "image"},
    {"<   http://wut.com/%20%20%3dsdfsdf?sd>; rel=preload;as=whatever", true,
     "http://wut.com/%20%20%3dsdfsdf?sd", "preload", "whatever"},
    {"</images/cat.jpg>; rel=prefetch;", true, "/images/cat.jpg", "prefetch",
     ""},
    {"</images/cat.jpg>; rel=prefetch    ;", true, "/images/cat.jpg",
     "prefetch", ""},
    {"</images/ca,t.jpg>; rel=prefetch    ;", true, "/images/ca,t.jpg",
     "prefetch", ""},
    {"<simple.css>; rel=stylesheet; title=\"title with a DQUOTE and "
     "backslash\"",
     true, "simple.css", "stylesheet", ""},
    {"<simple.css>; rel=stylesheet; title=\"title with a DQUOTE \\\" and "
     "backslash: \\\"",
     false},
    {"<simple.css>; title=\"title with a DQUOTE \\\" and backslash: \"; "
     "rel=stylesheet; ",
     true, "simple.css", "stylesheet", ""},
    {"<simple.css>; title=\'title with a DQUOTE \\\' and backslash: \'; "
     "rel=stylesheet; ",
     true, "simple.css", "stylesheet", ""},
    {"<simple.css>; title=\"title with a DQUOTE \\\" and ;backslash,: \"; "
     "rel=stylesheet; ",
     true, "simple.css", "stylesheet", ""},
    {"<simple.css>; title=\"title with a DQUOTE \' and ;backslash,: \"; "
     "rel=stylesheet; ",
     true, "simple.css", "stylesheet", ""},
    {"<simple.css>; title=\"\"; rel=stylesheet; ", true, "simple.css",
     "stylesheet", ""},
    {"<simple.css>; title=\"\"; rel=\"stylesheet\"; ", true, "simple.css",
     "stylesheet", ""},
    {"<simple.css>; rel=stylesheet; title=\"", false},
    {"<simple.css>; rel=stylesheet; title=\"\"", true, "simple.css",
     "stylesheet", ""},
    {"<simple.css>; rel=\"stylesheet\"; title=\"", false},
    {"<simple.css>; rel=\";style,sheet\"; title=\"", false},
    {"<simple.css>; rel=\"bla'sdf\"; title=\"", false},
    {"<simple.css>; rel=\"\"; title=\"\"", true, "simple.css", "", ""},
    {"<simple.css>; rel=''; title=\"\"", true, "simple.css", "''", ""},
    {"<simple.css>; rel=''; bla", true, "simple.css", "''", ""},
    {"<simple.css>; rel='prefetch", true, "simple.css", "'prefetch", ""},
    {"<simple.css>; rel=\"prefetch", false},
    {"<simple.css>; rel=\"", false},
    {"simple.css; rel=prefetch", false},
    {"<simple.css>; rel=prefetch; rel=foobar", true, "simple.css", "prefetch",
     ""},
};

INSTANTIATE_TEST_SUITE_P(LinkHeaderTest,
                         SimpleParseTest,
                         testing::ValuesIn(simple_parse_tests));

}  // namespace

}  // namespace link_header_util


text:
declare namespace SemverDiff {
    type SemverDiffReturn = 'major' | 'minor' | 'patch' | 'prerelease' | 'build' | null;
}

declare function SemverDiff(versionA: string, versionB: string): SemverDiff.SemverDiffReturn;

export = SemverDiff;


text:
namespace viz {

GLOutputSurfaceBufferQueue::GLOutputSurfaceBufferQueue(
    scoped_refptr<VizProcessContextProvider> context_provider,
    gpu::SurfaceHandle surface_handle,
    std::unique_ptr<BufferQueue> buffer_queue)
    : GLOutputSurface(context_provider, surface_handle),
      buffer_queue_(std::move(buffer_queue)) {
  capabilities_.only_invalidates_damage_rect = false;
  capabilities_.uses_default_gl_framebuffer = false;
  capabilities_.output_surface_origin = gfx::SurfaceOrigin::kTopLeft;
  // Set |max_pending_swaps| to 2 for buffer_queue, which aligns scheduling
  // more closely with the previous surfaced behavior.
  // With a surface, swap buffer ack used to return early, before actually
  // presenting the back buffer, enabling the browser compositor to run ahead.
  // BufferQueue implementation acks at the time of actual buffer swap, which
  // shifts the start of the new frame forward relative to the old
  // implementation.
  capabilities_.pending_swap_params.max_pending_swaps = 2;
  // GetCurrentFramebufferDamage will return an upper bound of the part of the
  // buffer that needs to be recomposited.
#if defined(OS_APPLE)
  capabilities_.supports_target_damage = false;
#else
  capabilities_.supports_target_damage = true;
#endif
  // Force the number of max pending frames to one when the switch
  // "double-buffer-compositing" is passed.
  // This will keep compositing in double buffered mode assuming |buffer_queue_|
  // allocates at most one additional buffer.
  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
  if (command_line->HasSwitch(switches::kDoubleBufferCompositing)) {
    capabilities_.pending_swap_params.max_pending_swaps = 1;
    buffer_queue_->SetMaxBuffers(2);
  }

  // It is safe to pass a raw pointer to *this because |buffer_queue_| is fully
  // owned and it doesn't use the SyncTokenProvider after it's destroyed.
  DCHECK(buffer_queue_);
  buffer_queue_->SetSyncTokenProvider(this);
  context_provider_->ContextGL()->GenFramebuffers(1, &fbo_);
}

GLOutputSurfaceBufferQueue::~GLOutputSurfaceBufferQueue() {
  auto* gl = context_provider_->ContextGL();
  DCHECK_NE(0u, fbo_);
  gl->DeleteFramebuffers(1, &fbo_);
  if (stencil_buffer_)
    gl->DeleteRenderbuffers(1, &stencil_buffer_);
  for (const auto& buffer_texture : buffer_queue_textures_)
    gl->DeleteTextures(1u, &buffer_texture.second);
  buffer_queue_textures_.clear();
  current_texture_ = 0u;
  last_bound_texture_ = 0u;
  last_bound_mailbox_.SetZero();

  // Freeing the BufferQueue here ensures that *this is fully alive in case the
  // BufferQueue needs the SyncTokenProvider functionality.
  buffer_queue_.reset();
  fbo_ = 0u;
  stencil_buffer_ = 0u;
}

void GLOutputSurfaceBufferQueue::BindFramebuffer() {
  auto* gl = context_provider_->ContextGL();
  gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);

  // If we have a |current_texture_|, it means we haven't swapped the buffer, so
  // we're just wanting to rebind the GL framebuffer.
  if (current_texture_)
    return;

  DCHECK(buffer_queue_);
  gpu::SyncToken creation_sync_token;
  gfx::GpuFenceHandle release_fence;
  const gpu::Mailbox current_buffer =
      buffer_queue_->GetCurrentBuffer(&creation_sync_token, &release_fence);
  if (current_buffer.IsZero())
    return;
  gl->WaitSyncTokenCHROMIUM(creation_sync_token.GetConstData());
  if (!release_fence.is_null()) {
    auto fence = gfx::GpuFence(std::move(release_fence));
    if (gl::GLFence::IsGpuFenceSupported()) {
      auto id = gl->CreateClientGpuFenceCHROMIUM(fence.AsClientGpuFence());
      gl->WaitGpuFenceCHROMIUM(id);
      gl->DestroyGpuFenceCHROMIUM(id);
    } else {
      fence.Wait();
    }
  }
  unsigned& buffer_texture = buffer_queue_textures_[current_buffer];
  if (!buffer_texture) {
    buffer_texture =
        gl->CreateAndTexStorage2DSharedImageCHROMIUM(current_buffer.name);
  }
  current_texture_ = buffer_texture;
  gl->BeginSharedImageAccessDirectCHROMIUM(
      current_texture_, GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM);
  gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
                           texture_target_, current_texture_, 0);
  last_bound_texture_ = current_texture_;
  last_bound_mailbox_ = current_buffer;

#if DCHECK_IS_ON() && BUILDFLAG(IS_CHROMEOS_ASH)
  const GLenum result = gl->CheckFramebufferStatus(GL_FRAMEBUFFER);
  if (result != GL_FRAMEBUFFER_COMPLETE)
    DLOG(ERROR) << " Incomplete fb: " << gl::GLEnums::GetStringError(result);
#endif

  // Reshape() must be called to go from using a stencil buffer to not using it.
  DCHECK(use_stencil_ || !stencil_buffer_);
  if (use_stencil_ && !stencil_buffer_) {
    gl->GenRenderbuffers(1, &stencil_buffer_);
    CHECK_NE(stencil_buffer_, 0u);
    gl->BindRenderbuffer(GL_RENDERBUFFER, stencil_buffer_);
    gl->RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8,
                            reshape_size_.width(), reshape_size_.height());
    gl->BindRenderbuffer(GL_RENDERBUFFER, 0);
    gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
                                GL_RENDERBUFFER, stencil_buffer_);
  }
}

// We call this on every frame that a value changes, but changing the size once
// we've allocated backing NativePixmapBufferQueue instances will cause a DCHECK
// because Chrome never Reshape(s) after the first one from (0,0). NB: this
// implies that screen size changes need to be plumbed differently. In
// particular, we must create the native window in the size that the hardware
// reports.
void GLOutputSurfaceBufferQueue::Reshape(const gfx::Size& size,
                                         float device_scale_factor,
                                         const gfx::ColorSpace& color_space,
                                         gfx::BufferFormat format,
                                         bool use_stencil) {
  reshape_size_ = size;
  use_stencil_ = use_stencil;
  GLOutputSurface::Reshape(size, device_scale_factor, color_space, format,
                           use_stencil);
  DCHECK(buffer_queue_);
  const bool may_have_freed_buffers =
      buffer_queue_->Reshape(size, color_space, format);
  if (may_have_freed_buffers || (stencil_buffer_ && !use_stencil)) {
    auto* gl = context_provider_->ContextGL();
    gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
    if (stencil_buffer_) {
      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
                                  GL_RENDERBUFFER, 0);
      gl->DeleteRenderbuffers(1, &stencil_buffer_);
      stencil_buffer_ = 0u;
    }

    // Note that |texture_target_| is initially set to 0, and so if it has not
    // been set to a valid value, then no buffers have been allocated.
    if (texture_target_ && may_have_freed_buffers) {
      gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
                               texture_target_, 0, 0);
      for (const auto& buffer_texture : buffer_queue_textures_)
        gl->DeleteTextures(1u, &buffer_texture.second);
      buffer_queue_textures_.clear();
      current_texture_ = 0u;
      last_bound_texture_ = 0u;
      last_bound_mailbox_.SetZero();
    }
  }

  texture_target_ =
      gpu::GetBufferTextureTarget(gfx::BufferUsage::SCANOUT, format,
                                  context_provider_->ContextCapabilities());
}

void GLOutputSurfaceBufferQueue::SwapBuffers(OutputSurfaceFrame frame) {
  DCHECK(buffer_queue_);

  // TODO(rjkroege): What if swap happens again before DidReceiveSwapBuffersAck
  // then it would see the wrong size?
  DCHECK(reshape_size_ == frame.size);
  swap_size_ = reshape_size_;

  gfx::Rect damage_rect =
      frame.sub_buffer_rect ? *frame.sub_buffer_rect : gfx::Rect(swap_size_);

  // If the client is currently drawing, we first end access to the
  // corresponding shared image. Then, we can swap the buffers. That way, we
  // know that whatever GL commands GLOutputSurface::SwapBuffers() emits can
  // access the shared image.
  auto* gl = context_provider_->ContextGL();
  if (current_texture_) {
    gl->EndSharedImageAccessDirectCHROMIUM(current_texture_);
    gl->BindFramebuffer(GL_FRAMEBUFFER, 0u);
    current_texture_ = 0u;
  }
  buffer_queue_->SwapBuffers(damage_rect);
  GLOutputSurface::SwapBuffers(std::move(frame));
}

gfx::Rect GLOutputSurfaceBufferQueue::GetCurrentFramebufferDamage() const {
  return buffer_queue_->CurrentBufferDamage();
}

uint32_t GLOutputSurfaceBufferQueue::GetFramebufferCopyTextureFormat() {
  return base::strict_cast<GLenum>(
      gl::BufferFormatToGLInternalFormat(buffer_queue_->buffer_format()));
}

bool GLOutputSurfaceBufferQueue::IsDisplayedAsOverlayPlane() const {
  return true;
}

unsigned GLOutputSurfaceBufferQueue::GetOverlayTextureId() const {
  DCHECK(last_bound_texture_);
  return last_bound_texture_;
}

gpu::Mailbox GLOutputSurfaceBufferQueue::GetOverlayMailbox() const {
  return last_bound_mailbox_;
}

void GLOutputSurfaceBufferQueue::DidReceiveSwapBuffersAck(
    const gfx::SwapResponse& response,
    gfx::GpuFenceHandle release_fence) {
  bool force_swap = false;
  if (response.result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) {
    // Even through the swap failed, this is a fixable error so we can pretend
    // it succeeded to the rest of the system.
    buffer_queue_->FreeAllSurfaces();

    // TODO(andrescj): centralize the logic that deletes the stencil buffer and
    // the textures since we do this in multiple places.
    auto* gl = context_provider_->ContextGL();
    gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
    if (stencil_buffer_) {
      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
                                  GL_RENDERBUFFER, 0);
      gl->DeleteRenderbuffers(1, &stencil_buffer_);
      stencil_buffer_ = 0u;
    }

    // Reshape() must have been called before we got here, so |texture_target_|
    // should contain a valid value.
    DCHECK(texture_target_);
    gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
                             texture_target_, 0, 0);
    for (const auto& buffer_texture : buffer_queue_textures_)
      gl->DeleteTextures(1u, &buffer_texture.second);
    buffer_queue_textures_.clear();
    current_texture_ = 0u;
    last_bound_texture_ = 0u;
    last_bound_mailbox_.SetZero();

    force_swap = true;
  }

  buffer_queue_->PageFlipComplete(release_fence.Clone());
  client()->DidReceiveSwapBuffersAck(response.timings,
                                     std::move(release_fence));

  if (force_swap)
    client()->SetNeedsRedrawRect(gfx::Rect(swap_size_));
}

gpu::SyncToken GLOutputSurfaceBufferQueue::GenSyncToken() {
  // This should only be called as long as the BufferQueue is alive. We cannot
  // use |buffer_queue_| to detect this because in the dtor, |buffer_queue_|
  // becomes nullptr before BufferQueue's dtor is called, so GenSyncToken()
  // would be called after |buffer_queue_| is nullptr when in fact, the
  // BufferQueue is still alive. Hence, we use |fbo_| to detect that the
  // BufferQueue is still alive.
  DCHECK(fbo_);
  gpu::SyncToken sync_token;
  context_provider_->ContextGL()->GenUnverifiedSyncTokenCHROMIUM(
      sync_token.GetData());
  return sync_token;
}

void GLOutputSurfaceBufferQueue::SetDisplayTransformHint(
    gfx::OverlayTransform transform) {
  display_transform_ = transform;

  if (context_provider_)
    context_provider_->ContextSupport()->SetDisplayTransform(transform);
}

gfx::OverlayTransform GLOutputSurfaceBufferQueue::GetDisplayTransform() {
  return display_transform_;
}

}  // namespace viz


text:
<!DOCTYPE HTML>

    <title>117</title>

117

Skrymir rises from the ground, seeming to tower up and up. His beard flows like rivulets from a glacier; his eyes
    burn like frost. He raises his arms towards the cavern roof and gives a great wordless bellow of exultation. The
    walls seem to shake. If the magi in the city above hear it, they must be trembling now.

'Life!' he thunders. 'To live again! To turn about the yoke of death and place it about the magi's necks! This is
    what I have dreamed of in my centuried sleep. And now, quake, you magi. Bolt the gates of your citadels. Marshal
    your armies and your puny magics. Skrymir strides the earth once more, and this time his iron-shod feet shall tread
    your mortal bodies into the mire!'

Skrymir is obviously getting ready to return to the surface to put some of his plans for vengeance into immediate
    effect.

If you would like to point out that you have just restored him to life, turn to
    84.

If you say nothing, turn to 257.


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

namespace Apworks.Querying
{
    /// <summary>
    /// Represents that the implemented classes are the collection
    /// that contains a specific page of the records along with
    /// the pagination information.
    /// </summary>
    public interface IPagedResult
    {
        /// <summary>
        /// Gets or sets the size of the page.
        /// </summary>
        /// <value>
        /// The size of the page.
        /// </value>
        int PageSize { get; set; }

        /// <summary>
        /// Gets or sets the page number.
        /// </summary>
        /// <value>
        /// The page number.
        /// </value>
        int PageNumber { get; set; }

        /// <summary>
        /// Gets or sets the number of total records.
        /// </summary>
        /// <value>
        /// The number of total records.
        /// </value>
        long TotalRecords { get; set; }

        /// <summary>
        /// Gets or sets the total pages.
        /// </summary>
        /// <value>
        /// The total pages.
        /// </value>
        long TotalPages { get; set; }
    }
}


text:
package us.kbase.inferelator;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.io.FileUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import us.kbase.auth.AuthException;
import us.kbase.auth.AuthService;
import us.kbase.auth.AuthToken;
import us.kbase.common.service.JacksonTupleModule;
import us.kbase.common.service.JsonClientException;
import us.kbase.common.service.ServerException;
import us.kbase.userandjobstate.InitProgress;
import us.kbase.userandjobstate.UserAndJobStateClient;

public class InferelatorServerCaller {

	private static SimpleDateFormat dateFormat = new SimpleDateFormat(
			"yyyy-MM-dd'T'HH:mm:ssZ");

	public static String findInteractionsWithInferelator(String wsName, InferelatorRunParameters params, AuthToken authPart) throws Exception{

		URL jobServiceUrl = new URL(InferelatorServerConfig.JOB_SERVICE_URL);
		Date date = new Date();
		date.setTime(date.getTime() + 100000L);

		UserAndJobStateClient jobClient = new UserAndJobStateClient(
				jobServiceUrl, authPart);
		//jobClient.setAuthAllowedForHttp(true);
		String returnVal = jobClient.createJob();
		jobClient.startJob(returnVal, AuthService.login(InferelatorServerConfig.SERVICE_LOGIN, new String(InferelatorServerConfig.SERVICE_PASSWORD)).getToken().toString(),
				"Starting new Inferelator service job...",
				"Inferelator service job " + returnVal + ". Method: findInteractionsWithInferelator. Input: cmonkeyRunResult " + params.getCmonkeyRunResultWsRef() +
				", expressionDataSeries " + params.getExpressionSeriesWsRef() + ", regulators list " + params.getTfListWsRef() + ". Workspace: " + wsName + ".",
				new InitProgress().withPtype("task").withMax(5L),
				dateFormat.format(date));
		jobClient = null;

		if (InferelatorServerConfig.DEPLOY_AWE) {
			String jsonArgs = formatAWEConfig(returnVal, wsName, params, authPart.toString());

			if (InferelatorServerConfig.LOG_AWE_CALLS) {
				System.out.println(jsonArgs);
				PrintWriter out = new PrintWriter(new FileWriter(
						"/var/tmp/inferelator/inferelator-awe.log", true));
				out.write("Job " + returnVal + " : call to AWE\n" + jsonArgs
						+ "\n***\n");
				out.write("***");
				if (out != null) {
					out.close();
				}
			}

			String result = submitJob(jsonArgs);
			reportAweStatus(authPart, returnVal, result);

			if (InferelatorServerConfig.LOG_AWE_CALLS) {
				System.out.println(result);
				PrintWriter out = new PrintWriter(new FileWriter(
						"/var/tmp/inferelator/inferelator-awe.log", true));
				out.write("Job " + returnVal + " : AWE response\n" + result
						+ "\n***\n");
				if (out != null) {
					out.close();
				}
			}
		} else {
			InferelatorServerThread thread = new InferelatorServerThread (returnVal, wsName, params, authPart);
			thread.start();
		}
		return returnVal;
	}

	protected static String submitJob(String aweConfig) throws Exception {

		String postResponse = null;
		try {
			CloseableHttpClient httpClient = HttpClients.createDefault();
			HttpPost httpPost = new HttpPost(
					InferelatorServerConfig.AWE_SERVICE_URL);
			MultipartEntityBuilder builder = MultipartEntityBuilder.create();
			InputStream stream = new ByteArrayInputStream(
					aweConfig.getBytes("UTF-8"));
			builder.addBinaryBody("upload", stream,
					ContentType.APPLICATION_OCTET_STREAM, "inferelator.awf");
			httpPost.setEntity(builder.build());
			HttpResponse response = httpClient.execute(httpPost);
			postResponse = EntityUtils.toString(response.getEntity());
		} catch (Exception e) {
			throw new Exception("Can not submit AWE post request: "
					+ e.getMessage());
		}
		return postResponse;
	}

	protected static String formatAWEConfig(String jobId, String wsName,
			InferelatorRunParameters params, String token
			) throws Exception {

		String formattedConfig;
		try {
			String config = FileUtils.readFileToString(new File(
					InferelatorServerConfig.AWF_CONFIG_FILE));
			String args = " --job " + jobId	+ " --method find_interactions_with_inferelator --ws '" + wsName
					+ "' --series '" + params.getExpressionSeriesWsRef() + "' --tflist '"
					+ params.getTfListWsRef()  + "' --cmonkey '" + params.getCmonkeyRunResultWsRef() + "'"
					+ " --token '" + token + "'";
			formattedConfig = String.format(config, jobId, args, jobId);
		} catch (IOException e) {
			throw new Exception("Can not load AWE config file: "
					+ InferelatorServerConfig.AWF_CONFIG_FILE);
		}
		return formattedConfig;
	}

	protected static void updateJobProgress(String jobId, String status,
			Long tasks, String token) throws MalformedURLException, IOException, JsonClientException, AuthException {
		Date date = new Date();
		date.setTime(date.getTime() + 100000L);
		UserAndJobStateClient jobClient = new UserAndJobStateClient(new URL(
				InferelatorServerConfig.JOB_SERVICE_URL), new AuthToken(token));
		// jobClient.setAuthAllowedForHttp(true);
		jobClient.updateJobProgress(jobId, AuthService.login(InferelatorServerConfig.SERVICE_LOGIN, new String(InferelatorServerConfig.SERVICE_PASSWORD)).getToken().toString(), status, tasks,
				dateFormat.format(date));
		jobClient = null;
	}

	protected static void reportAweStatus(AuthToken authPart, String returnVal,
			String result) throws IOException, JsonProcessingException,
			MalformedURLException, JsonClientException,
			JsonParseException, JsonMappingException, ServerException, AuthException {
		JsonNode rootNode = new ObjectMapper().registerModule(new JacksonTupleModule()).readTree(result);
		String aweId = "";
		if (rootNode.has("data")){
			JsonNode dataNode = rootNode.get("data");
			if (dataNode.has("id")){
				aweId = InferelatorServerConfig.AWE_SERVICE_URL + "/" + dataNode.get("id").textValue();
				System.out.println(aweId);
				updateJobProgress(returnVal, "AWE job submitted: " + aweId, 1L, authPart.toString());
			}
		}
		if (rootNode.has("error")){
			if (rootNode.get("error").textValue()!=null){
				System.out.println(rootNode.get("error").textValue());
				updateJobProgress(returnVal, "AWE reported error on job " + aweId, 1L, authPart.toString());
				throw new ServerException(rootNode.get("error").textValue(), 0, "Unknown", null);
			}
		}
	}

}


text:
#include <asn_internal.h>
#include <NativeInteger.h>

asn_enc_rval_t
NativeInteger_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
                         int ilevel, enum jer_encoder_flags_e flags,
                         asn_app_consume_bytes_f *cb, void *app_key) {
    const asn_INTEGER_specifics_t *specs =
        (const asn_INTEGER_specifics_t *)td->specifics;
    char scratch[32];  /* Enough for 64-bit int */
    asn_enc_rval_t er = {0,0,0};
    const long *native = (const long *)sptr;

    (void)ilevel;
    (void)flags;

    if(!native) ASN__ENCODE_FAILED;

    er.encoded = snprintf(scratch, sizeof(scratch),
                          (specs && specs->field_unsigned)
                              ? "%lu" : "%ld", *native);
    if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch)
        || cb(scratch, er.encoded, app_key) < 0)
        ASN__ENCODE_FAILED;

    ASN__ENCODED_OK(er);
}


text:
import { injectable } from 'inversify';

import { IEscapeSequenceEncoder } from '../interfaces/utils/IEscapeSequenceEncoder';

@injectable()
export class EscapeSequenceEncoder implements IEscapeSequenceEncoder {
    /**
     * https://bytefreaks.net/gnulinux/regular-expression-to-match-any-ascii-character
     *
     * @type {RegExp}
     */
    private static readonly ASCIICharactersRegExp: RegExp = /[\x00-\x7F]/;

    /**
     * https://en.wikipedia.org/wiki/List_of_Unicode_characters
     * \x00-\x1F\x7F-\x9F are the control unicode characters
     *
     * @type {RegExp}
     */
    private static readonly forceEscapeCharactersRegExp: RegExp = /[\x00-\x1F\x7F-\x9F'"\\\s]/;

    /**
     * @type {Map<string, string>}
     */
    private readonly stringsCache: Map <string, string> = new Map();

    /**
     * @param {string} string
     * @param {boolean} encodeAllSymbols
     * @returns {string}
     */
    public encode (string: string, encodeAllSymbols: boolean): string {
        const cacheKey: string = `${string}-${String(encodeAllSymbols)}`;

        if (this.stringsCache.has(cacheKey)) {
            return <string>this.stringsCache.get(cacheKey);
        }

        const radix: number = 16;
        const replaceRegExp: RegExp = new RegExp('[\\s\\S]', 'g');

        let prefix: string;
        let template: string;

        const result: string = string.replace(replaceRegExp, (character: string): string => {
            const shouldEncodeCharacter: boolean = encodeAllSymbols
                || EscapeSequenceEncoder.forceEscapeCharactersRegExp.test(character);

            if (!shouldEncodeCharacter) {
                return character;
            }

            if (EscapeSequenceEncoder.ASCIICharactersRegExp.test(character)) {
                prefix = '\\x';
                template = '00';
            } else {
                prefix = '\\u';
                template = '0000';
            }

            return `${prefix}${(template + character.charCodeAt(0).toString(radix)).slice(-template.length)}`;
        });

        this.stringsCache.set(cacheKey, result);
        this.stringsCache.set(`${result}-${String(encodeAllSymbols)}`, result);

        return result;
    }
}


text:
package com.cloudbees.gasp.model;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * User: Mark Prichard (mprichard@cloudbees.com)
 * Date: 8/27/13
 */
public class Location implements Serializable {
    private BigDecimal lat;
    private BigDecimal lng;

    public BigDecimal getLat() {
        return lat;
    }

    public BigDecimal getLng() {
        return lng;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public void setLng(BigDecimal lng) {
        this.lng = lng;
    }
}


text:
ICControlEvents ICConcreteControlEvent(ICMouseButton mouseButton,
                                       ICAbstractControlEvents abstractControlEvent)
{
    NSUInteger buttonIndex;
    switch (mouseButton) {
        case ICLeftMouseButton: buttonIndex = 0; break;
        case ICRightMouseButton: buttonIndex = 1; break;
        case ICOtherMouseButton: buttonIndex = 2; break;
        default: {
            [NSException raise:NSInvalidArgumentException format:@"mouseButton is invalid"];
            break;
        }
    }
    return abstractControlEvent << buttonIndex*8;
}
#endif

@implementation ICAction

@synthesize target = _target;
@synthesize action = _action;

- (id)initWithTarget:(id)target action:(SEL)action
{
    if ((self = [super init])) {
        self.target = target;
        self.action = action;
    }
    return self;
}

- (BOOL)isEqual:(id)object
{
    if ([object isKindOfClass:[ICAction class]]) {
        ICAction *compareAction = (ICAction *)object;
        if (compareAction.action == self.action && compareAction.target == self.target) {
            return YES;
        } else {
            return NO;
        }
    }
    return NO;
}

@end

@implementation ICControl

- (id)initWithSize:(kmVec3)size
{
    if ((self = [super initWithSize:size])) {
        _actions = [[NSMutableDictionary alloc] init];
        _state = ICControlStateNormal;
    }
    return self;
}

- (void)dealloc
{
    [_actions release];

    [super dealloc];
}

#ifdef __IC_PLATFORM_MAC
- (void)sendAction:(SEL)action to:(id)target forEvent:(ICOSXEvent *)event
#elif defined(__IC_PLATFORM_IOS)
- (void)sendAction:(SEL)action to:(id)target forEvent:(ICTouchEvent *)event
#endif
{
    ICAction *actionObject = [[ICAction alloc] initWithTarget:target action:action];
    NSDictionary *actionDict = [NSDictionary dictionaryWithObjectsAndKeys:
                                self, @"sender", event, @"event", actionObject, @"action", nil];
    [actionObject release];

    ICTargetActionDispatcher *taDispatcher = [[self hostViewController] targetActionDispatcher];
    [taDispatcher performSelector:@selector(dispatchActionWithActionDictionary:)
                         onThread:[[self hostViewController] thread]
                       withObject:actionDict
                    waitUntilDone:NO];
}

#ifdef __IC_PLATFORM_MAC
- (void)sendActionsForControlEvent:(ICControlEvents)controlEvent forEvent:(ICOSXEvent *)event
#elif defined(__IC_PLATFORM_IOS)
- (void)sendActionsForControlEvent:(ICControlEvents)controlEvent forEvent:(ICTouchEvent *)event
#endif
{
    NSArray *actions = [_actions objectForKey:[NSNumber numberWithLong:controlEvent]];
    for (ICAction *action in actions) {
        [self sendAction:action.action to:action.target forEvent:event];
    }
}

- (void)sendActionsForControlEvents:(ICControlEvents)controlEvents
{
    for (NSUInteger flag=1; controlEvents>=flag; flag*=2) {
        if (controlEvents & flag) {
            NSArray *actions = [_actions objectForKey:[NSNumber numberWithLong:flag]];
            for (ICAction *action in actions) {
                [self sendAction:action.action to:action.target forEvent:nil];
            }
        }
    }
}

- (void)addTarget:(id)target action:(SEL)action forControlEvents:(ICControlEvents)controlEvents
{
    for (NSUInteger flag=1; controlEvents>=flag; flag*=2) {
        if (controlEvents & flag) {
            NSNumber *flagNumber = [NSNumber numberWithLong:flag];
            NSMutableArray *actions = [_actions objectForKey:flagNumber];
            if (!actions) {
                actions = [NSMutableArray arrayWithCapacity:1];
                [_actions setObject:actions forKey:flagNumber];
            }
            ICAction *actionObject = [[ICAction alloc] initWithTarget:target action:action];
            if (![actions containsObject:actionObject])
                [actions addObject:actionObject];
            [actionObject release];
        }
    }
}

- (void)removeTarget:(id)target action:(SEL)action forControlEvents:(ICControlEvents)controlEvents
{
    for (NSUInteger flag=1; controlEvents>=flag; flag*=2) {
        if (controlEvents & flag) {
            NSNumber *flagNumber = [NSNumber numberWithLong:flag];
            NSMutableArray *actions = [_actions objectForKey:flagNumber];
            if (actions) {
                for (ICAction *theAction in actions) {
                    if (theAction.target == target && theAction.action == action) {
                        [actions removeObject:theAction];
                        break;
                    }
                }
            }
        }
    }
}

- (NSArray *)actionsForTarget:(id)target forControlEvent:(ICControlEvents)controlEvent
{
    NSMutableArray *resultActions = [NSMutableArray array];
    NSArray *actions = [_actions objectForKey:[NSNumber numberWithLong:controlEvent]];
    if (actions) {
        for (ICAction *action in actions) {
            if (action.target == target) {
                [resultActions addObject:NSStringFromSelector(action.action)];
            }
        }
    }
    return resultActions;
}

- (ICControlEvents)allControlEvents
{
    ICControlEvents controlEvents = 0x0;
    for (NSNumber *flagNumber in [_actions allKeys]) {
        controlEvents |= [flagNumber longLongValue];
    }
    return controlEvents;
}

- (NSArray *)allTargets
{
    NSMutableArray *targets = [NSMutableArray array];
    for (NSArray *actions in [_actions allValues]) {
        for (ICAction *action in actions) {
            [targets addObject:action.target];
        }
    }
    return targets;
}

- (BOOL)enabled
{
    return !(_state & ICControlStateDisabled);
}

- (void)setEnabled:(BOOL)enabled
{
    if (enabled) {
        _state &= ~ICControlStateDisabled;
    } else {
        _state |= ICControlStateDisabled;
    }
}

- (BOOL)highlighted
{
    return (_state & ICControlStateHighlighted);
}

- (void)setHighlighted:(BOOL)highlighted
{
    if (highlighted) {
        _state |= ICControlStateHighlighted;
    } else {
        _state &= ~ICControlStateHighlighted;
    }
}

- (BOOL)selected
{
    return (_state & ICControlStateSelected);
}

- (void)setSelected:(BOOL)selected
{
    if (selected) {
        _state |= ICControlStateSelected;
    } else {
        _state &= ~ICControlStateSelected;
    }
}

- (ICControlState)state
{
    return _state;
}

- (void)setState:(ICControlState)state
{
    _state = state;
    [self setNeedsDisplay];
}

@end


text:
// <copyright file="GiftWrappingPriceCalculationService.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>http://automatetheplanet.com/</site>

namespace DecoratorDesignPattern.Services
{
    public class GiftWrappingPriceCalculationService
    {
        public decimal Calculate(Enums.GiftWrappingStyles giftWrappingStyle)
        {
            var giftWrappingPrice = default(decimal);

            // Call Real Web Service to determine the Gift Wrapping Tax.
            switch (giftWrappingStyle)
            {
                case Enums.GiftWrappingStyles.Fancy:
                    giftWrappingPrice = 10.5M;
                    break;
                case Enums.GiftWrappingStyles.Cheap:
                    giftWrappingPrice = 1.5M;
                    break;
                case Enums.GiftWrappingStyles.UltraFancy:
                    giftWrappingPrice = 30.2M;
                    break;
                case Enums.GiftWrappingStyles.Paper:
                    giftWrappingPrice = 0.2M;
                    break;
                case Enums.GiftWrappingStyles.None:
                default:
                    giftWrappingPrice = 0.0M;
                    break;
            }

            return giftWrappingPrice;
        }
    }
}


text:
import { isValidElement } from 'react';

const jsxToPlainObject = function jsxToPlainObject(children) {
	if (isValidElement(children)) {
		return {
			...children.props,
			component: children.type,
		};
	}
	else if (Array.isArray(children)) {
		return children.map(jsxToPlainObject);
	}
	return children;
};

export default jsxToPlainObject;


text:
using System;

namespace Rimss.GraphicsProcessing.Palette.Ditherers.ErrorDiffusion
{
    public class TwoRowSierraDitherer : BaseErrorDistributionDitherer
    {
        /// <summary>
        /// See <see cref="BaseColorDitherer.CreateCoeficientMatrix"/> for more details.
        /// </summary>
        protected override Byte[,] CreateCoeficientMatrix()
        {
            return new Byte[,]
            {
                { 0, 0, 0, 0, 0 },
                { 0, 0, 0, 4, 3 },
                { 1, 2, 3, 2, 1 }
            };
        }

        /// <summary>
        /// See <see cref="BaseErrorDistributionDitherer.MatrixSideWidth"/> for more details.
        /// </summary>
        protected override Int32 MatrixSideWidth
        {
            get { return 2; }
        }

        /// <summary>
        /// See <see cref="BaseErrorDistributionDitherer.MatrixSideHeight"/> for more details.
        /// </summary>
        protected override Int32 MatrixSideHeight
        {
            get { return 1; }
        }
    }
}


text:
#ifndef _ASM_X86_MWAIT_H
#define _ASM_X86_MWAIT_H

#include <linux/sched.h>

#include <asm/cpufeature.h>

#define MWAIT_SUBSTATE_MASK		0xf
#define MWAIT_CSTATE_MASK		0xf
#define MWAIT_SUBSTATE_SIZE		4
#define MWAIT_HINT2CSTATE(hint)		(((hint) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK)
#define MWAIT_HINT2SUBSTATE(hint)	((hint) & MWAIT_CSTATE_MASK)

#define CPUID_MWAIT_LEAF		5
#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
#define CPUID5_ECX_INTERRUPT_BREAK	0x2

#define MWAIT_ECX_INTERRUPT_BREAK	0x1
#define MWAITX_ECX_TIMER_ENABLE		BIT(1)
#define MWAITX_MAX_LOOPS		((u32)-1)
#define MWAITX_DISABLE_CSTATES		0xf

static inline void __monitor(const void *eax, unsigned long ecx,
			     unsigned long edx)
{
	/* "monitor %eax, %ecx, %edx;" */
	asm volatile(".byte 0x0f, 0x01, 0xc8;"
		     :: "a" (eax), "c" (ecx), "d"(edx));
}

static inline void __monitorx(const void *eax, unsigned long ecx,
			      unsigned long edx)
{
	/* "monitorx %eax, %ecx, %edx;" */
	asm volatile(".byte 0x0f, 0x01, 0xfa;"
		     :: "a" (eax), "c" (ecx), "d"(edx));
}

static inline void __mwait(unsigned long eax, unsigned long ecx)
{
	/* "mwait %eax, %ecx;" */
	asm volatile(".byte 0x0f, 0x01, 0xc9;"
		     :: "a" (eax), "c" (ecx));
}

/*
 * MWAITX allows for a timer expiration to get the core out a wait state in
 * addition to the default MWAIT exit condition of a store appearing at a
 * monitored virtual address.
 *
 * Registers:
 *
 * MWAITX ECX[1]: enable timer if set
 * MWAITX EBX[31:0]: max wait time expressed in SW P0 clocks. The software P0
 * frequency is the same as the TSC frequency.
 *
 * Below is a comparison between MWAIT and MWAITX on AMD processors:
 *
 *                 MWAIT                           MWAITX
 * opcode          0f 01 c9           |            0f 01 fb
 * ECX[0]                  value of RFLAGS.IF seen by instruction
 * ECX[1]          unused/#GP if set  |            enable timer if set
 * ECX[31:2]                     unused/#GP if set
 * EAX                           unused (reserve for hint)
 * EBX[31:0]       unused             |            max wait time (P0 clocks)
 *
 *                 MONITOR                         MONITORX
 * opcode          0f 01 c8           |            0f 01 fa
 * EAX                     (logical) address to monitor
 * ECX                     #GP if not zero
 */
static inline void __mwaitx(unsigned long eax, unsigned long ebx,
			    unsigned long ecx)
{
	/* "mwaitx %eax, %ebx, %ecx;" */
	asm volatile(".byte 0x0f, 0x01, 0xfb;"
		     :: "a" (eax), "b" (ebx), "c" (ecx));
}

static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
{
	trace_hardirqs_on();
	/* "mwait %eax, %ecx;" */
	asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
		     :: "a" (eax), "c" (ecx));
}

/*
 * This uses new MONITOR/MWAIT instructions on P4 processors with PNI,
 * which can obviate IPI to trigger checking of need_resched.
 * We execute MONITOR against need_resched and enter optimized wait state
 * through MWAIT. Whenever someone changes need_resched, we would be woken
 * up from MWAIT (without an IPI).
 *
 * New with Core Duo processors, MWAIT can take some hints based on CPU
 * capability.
 */
static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
{
	if (!current_set_polling_and_test()) {
		if (static_cpu_has_bug(X86_BUG_CLFLUSH_MONITOR)) {
			mb();
			clflush((void *)&current_thread_info()->flags);
			mb();
		}

		__monitor((void *)&current_thread_info()->flags, 0, 0);
		if (!need_resched())
			__mwait(eax, ecx);
	}
	current_clr_polling();
}

#endif /* _ASM_X86_MWAIT_H */


text:
package AlarmLightDoor;

public interface Alarm {

	void alarm();

}


text:
.class public Landroid/graphics/ComposeShader;
.super Landroid/graphics/Shader;
.source "ComposeShader.java"

# static fields
.field private static final TYPE_PORTERDUFFMODE:I = 0x2

.field private static final TYPE_XFERMODE:I = 0x1

# instance fields
.field private mPorterDuffMode:Landroid/graphics/PorterDuff$Mode;

.field private final mShaderA:Landroid/graphics/Shader;

.field private final mShaderB:Landroid/graphics/Shader;

.field private mType:I

.field private mXferMode:Landroid/graphics/Xfermode;

# direct methods
.method public constructor <init>(Landroid/graphics/Shader;Landroid/graphics/Shader;Landroid/graphics/PorterDuff$Mode;)V
    .locals 4
    .param p1, "shaderA"    # Landroid/graphics/Shader;
    .param p2, "shaderB"    # Landroid/graphics/Shader;
    .param p3, "mode"    # Landroid/graphics/PorterDuff$Mode;

    .prologue
    .line 75
    invoke-direct {p0}, Landroid/graphics/Shader;-><init>()V

    .line 76
    const/4 v0, 0x2

    iput v0, p0, Landroid/graphics/ComposeShader;->mType:I

    .line 77
    iput-object p1, p0, Landroid/graphics/ComposeShader;->mShaderA:Landroid/graphics/Shader;

    .line 78
    iput-object p2, p0, Landroid/graphics/ComposeShader;->mShaderB:Landroid/graphics/Shader;

    .line 79
    iput-object p3, p0, Landroid/graphics/ComposeShader;->mPorterDuffMode:Landroid/graphics/PorterDuff$Mode;

    .line 80
    iget v0, p1, Landroid/graphics/Shader;->native_instance:I

    iget v1, p2, Landroid/graphics/Shader;->native_instance:I

    iget v2, p3, Landroid/graphics/PorterDuff$Mode;->nativeInt:I

    invoke-static {v0, v1, v2}, Landroid/graphics/ComposeShader;->nativeCreate2(III)I

    move-result v0

    iput v0, p0, Landroid/graphics/ComposeShader;->native_instance:I

    .line 82
    iget v0, p0, Landroid/graphics/ComposeShader;->native_instance:I

    iget v1, p1, Landroid/graphics/Shader;->native_shader:I

    iget v2, p2, Landroid/graphics/Shader;->native_shader:I

    iget v3, p3, Landroid/graphics/PorterDuff$Mode;->nativeInt:I

    invoke-static {v0, v1, v2, v3}, Landroid/graphics/ComposeShader;->nativePostCreate2(IIII)I

    move-result v0

    iput v0, p0, Landroid/graphics/ComposeShader;->native_shader:I

    .line 84
    return-void
.end method

.method public constructor <init>(Landroid/graphics/Shader;Landroid/graphics/Shader;Landroid/graphics/Xfermode;)V
    .locals 5
    .param p1, "shaderA"    # Landroid/graphics/Shader;
    .param p2, "shaderB"    # Landroid/graphics/Shader;
    .param p3, "mode"    # Landroid/graphics/Xfermode;

    .prologue
    const/4 v2, 0x0

    .line 51
    invoke-direct {p0}, Landroid/graphics/Shader;-><init>()V

    .line 52
    const/4 v1, 0x1

    iput v1, p0, Landroid/graphics/ComposeShader;->mType:I

    .line 53
    iput-object p1, p0, Landroid/graphics/ComposeShader;->mShaderA:Landroid/graphics/Shader;

    .line 54
    iput-object p2, p0, Landroid/graphics/ComposeShader;->mShaderB:Landroid/graphics/Shader;

    .line 55
    iput-object p3, p0, Landroid/graphics/ComposeShader;->mXferMode:Landroid/graphics/Xfermode;

    .line 56
    iget v3, p1, Landroid/graphics/Shader;->native_instance:I

    iget v4, p2, Landroid/graphics/Shader;->native_instance:I

    if-eqz p3, :cond_1

    iget v1, p3, Landroid/graphics/Xfermode;->native_instance:I

    :goto_0
    invoke-static {v3, v4, v1}, Landroid/graphics/ComposeShader;->nativeCreate1(III)I

    move-result v1

    iput v1, p0, Landroid/graphics/ComposeShader;->native_instance:I

    .line 58
    instance-of v1, p3, Landroid/graphics/PorterDuffXfermode;

    if-eqz v1, :cond_2

    .line 59
    check-cast p3, Landroid/graphics/PorterDuffXfermode;

    .end local p3    # "mode":Landroid/graphics/Xfermode;
    iget-object v0, p3, Landroid/graphics/PorterDuffXfermode;->mode:Landroid/graphics/PorterDuff$Mode;

    .line 60
    .local v0, "pdMode":Landroid/graphics/PorterDuff$Mode;
    iget v1, p0, Landroid/graphics/ComposeShader;->native_instance:I

    iget v3, p1, Landroid/graphics/Shader;->native_shader:I

    iget v4, p2, Landroid/graphics/Shader;->native_shader:I

    if-eqz v0, :cond_0

    iget v2, v0, Landroid/graphics/PorterDuff$Mode;->nativeInt:I

    :cond_0
    invoke-static {v1, v3, v4, v2}, Landroid/graphics/ComposeShader;->nativePostCreate2(IIII)I

    move-result v1

    iput v1, p0, Landroid/graphics/ComposeShader;->native_shader:I

    .line 66
    .end local v0    # "pdMode":Landroid/graphics/PorterDuff$Mode;
    :goto_1
    return-void

    .restart local p3    # "mode":Landroid/graphics/Xfermode;
    :cond_1
    move v1, v2

    .line 56
    goto :goto_0

    .line 63
    :cond_2
    iget v1, p0, Landroid/graphics/ComposeShader;->native_instance:I

    iget v3, p1, Landroid/graphics/Shader;->native_shader:I

    iget v4, p2, Landroid/graphics/Shader;->native_shader:I

    if-eqz p3, :cond_3

    iget v2, p3, Landroid/graphics/Xfermode;->native_instance:I

    :cond_3
    invoke-static {v1, v3, v4, v2}, Landroid/graphics/ComposeShader;->nativePostCreate1(IIII)I

    move-result v1

    iput v1, p0, Landroid/graphics/ComposeShader;->native_shader:I

    goto :goto_1
.end method

.method private static native nativeCreate1(III)I
.end method

.method private static native nativeCreate2(III)I
.end method

.method private static native nativePostCreate1(IIII)I
.end method

.method private static native nativePostCreate2(IIII)I
.end method

# virtual methods
.method protected copy()Landroid/graphics/Shader;
    .locals 4

    .prologue
    .line 92
    iget v1, p0, Landroid/graphics/ComposeShader;->mType:I

    packed-switch v1, :pswitch_data_0

    .line 100
    new-instance v1, Ljava/lang/IllegalArgumentException;

    const-string v2, "ComposeShader should be created with either Xfermode or PorterDuffMode"

    invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 94
    :pswitch_0
    new-instance v0, Landroid/graphics/ComposeShader;

    iget-object v1, p0, Landroid/graphics/ComposeShader;->mShaderA:Landroid/graphics/Shader;

    invoke-virtual {v1}, Landroid/graphics/Shader;->copy()Landroid/graphics/Shader;

    move-result-object v1

    iget-object v2, p0, Landroid/graphics/ComposeShader;->mShaderB:Landroid/graphics/Shader;

    invoke-virtual {v2}, Landroid/graphics/Shader;->copy()Landroid/graphics/Shader;

    move-result-object v2

    iget-object v3, p0, Landroid/graphics/ComposeShader;->mXferMode:Landroid/graphics/Xfermode;

    invoke-direct {v0, v1, v2, v3}, Landroid/graphics/ComposeShader;-><init>(Landroid/graphics/Shader;Landroid/graphics/Shader;Landroid/graphics/Xfermode;)V

    .line 103
    .local v0, "copy":Landroid/graphics/ComposeShader;
    :goto_0
    invoke-virtual {p0, v0}, Landroid/graphics/ComposeShader;->copyLocalMatrix(Landroid/graphics/Shader;)V

    .line 104
    return-object v0

    .line 97
    .end local v0    # "copy":Landroid/graphics/ComposeShader;
    :pswitch_1
    new-instance v0, Landroid/graphics/ComposeShader;

    iget-object v1, p0, Landroid/graphics/ComposeShader;->mShaderA:Landroid/graphics/Shader;

    invoke-virtual {v1}, Landroid/graphics/Shader;->copy()Landroid/graphics/Shader;

    move-result-object v1

    iget-object v2, p0, Landroid/graphics/ComposeShader;->mShaderB:Landroid/graphics/Shader;

    invoke-virtual {v2}, Landroid/graphics/Shader;->copy()Landroid/graphics/Shader;

    move-result-object v2

    iget-object v3, p0, Landroid/graphics/ComposeShader;->mPorterDuffMode:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {v0, v1, v2, v3}, Landroid/graphics/ComposeShader;-><init>(Landroid/graphics/Shader;Landroid/graphics/Shader;Landroid/graphics/PorterDuff$Mode;)V

    .line 98
    .restart local v0    # "copy":Landroid/graphics/ComposeShader;
    goto :goto_0

    .line 92
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


text:
module TingYun
  module Agent
    module Threading
      class AgentThread

        def self.create(label, &blk)
          TingYun::Agent.logger.debug("Creating Ting Yun thread: #{label}")
          wrapped_blk = Proc.new do
            begin
              blk.call
            rescue => e
              TingYun::Agent.logger.error("Thread #{label} exited with error", e)
            rescue Exception => e
              TingYun::Agent.logger.error("Thread #{label} exited with exception. Re-raising in case of interupt.", e)
              raise
            ensure
              TingYun::Agent.logger.debug("Exiting TingYun thread: #{label}")
            end
          end

          thread = backing_thread_class.new(&wrapped_blk)
          thread[:TingYun_label] = label
          thread
        end

        # Simplifies testing if we don't directly use ::Thread.list, so keep
        # the accessor for it here on AgentThread to use and stub.
        def self.list
          backing_thread_class.list
        end

        # To allow tests to swap out Thread for a synchronous alternative,
        # surface the backing class we'll use from the class level.
        @backing_thread_class = ::Thread

        def self.backing_thread_class
          @backing_thread_class
        end

        def self.backing_thread_class=(clazz)
          @backing_thread_class = clazz
        end
      end
    end
  end
end


text:
package org.vaadin.training.fundamentals.happening.ui;

import java.util.Map;

import org.vaadin.training.fundamentals.happening.ui.view.VaadinView;

/**
 * Base interface for {@link VaadinView} and as such for all of the views in the
 * application's Model-View-Presenter based architecture.
 *
 * @author Johannes
 *
 */
public interface HasNavigation {
    public <T extends VaadinView<?>> void navigateTo(Class<T> view,
            Map<String, String> params);

    /**
     * Specialized {@link HasNavigation} view that needs to user prompt before
     * {@link Navigation} navigates away from this view.
     *
     * @author Johannes
     *
     */
    public interface WithUserPrompt {

        /**
         * The view should show a user prompt and return a boolean value
         * indicating whether the prompt was shown or not. The view should also
         * store the callback interface and use it to communicate to the
         * Navigation that it is ok to do the pending view change.
         *
         * @param callback
         * @return true if a user prompt was shown and {@link Navigation} should
         *         not proceed with changing the current view.
         */
        boolean showUserPrompt(Navigation.PendingNavigationCallback callback);

    }
}


text:
package com.dp1wms.model;

public class ReporteAlmacen {
    private String codigo;
    private String nombreproducto;
    private String descripcion;
    private int stockMinimo;
    private int stockFisico;
    private float precioCompra;
    private int cantidadPedido;
    private int stockLogico;

    public ReporteAlmacen(String codigo, String nombreproducto, String descripcion, int stockMinimo, int stockFisico, float precioCompra, int cantidadPedido, int stockLogico) {
        this.codigo = codigo;
        this.nombreproducto = nombreproducto;
        this.descripcion = descripcion;
        this.stockMinimo = stockMinimo;
        this.stockFisico = stockFisico;
        this.precioCompra = precioCompra;
        this.cantidadPedido = cantidadPedido;
        this.stockLogico = stockLogico;
    }

    public ReporteAlmacen() {
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getNombreproducto() {
        return nombreproducto;
    }

    public void setNombreproducto(String nombreproducto) {
        this.nombreproducto = nombreproducto;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public int getStockMinimo() {
        return stockMinimo;
    }

    public void setStockMinimo(int stockMinimo) {
        this.stockMinimo = stockMinimo;
    }

    public int getStockFisico() {
        return stockFisico;
    }

    public void setStockFisico(int stockFisico) {
        this.stockFisico = stockFisico;
    }

    public float getPrecioCompra() {
        return precioCompra;
    }

    public void setPrecioCompra(float precioCompra) {
        this.precioCompra = precioCompra;
    }

    public int getCantidadPedido() {
        return cantidadPedido<0?0:cantidadPedido;
    }

    public void setCantidadPedido(int cantidadPedido) {
        this.cantidadPedido = cantidadPedido;
    }

    public int getStockLogico() {
        return stockLogico<0?0:stockLogico;
    }

    public void setStockLogico(int stockLogico) {
        this.stockLogico = stockLogico;
    }
}


text:
import PinInput from './PinInput';

export default PinInput;


text:
layout: post
title: The Tsinghua University Library joins DataCite
author:
- lrueda
date: '2016-10-24'
tags:
- members
location: Beijing, China
doi: 10.5438/esys-f867
---
DataCite is delighted to welcome the [Tsinghua University Library](http://www.lib.tsinghua.edu.cn/english/) to the DataCite community! The Tsinghua University Library supports the University's mission of education and research. It engages with the ongoing environment to deliver world-class physical and digital content and services critical to research, education, and outreach, contributes to discover, preserve, and disseminate knowledge and creative expression worldwide.READMORE

The Tsinghua University Library has a long history of innovation and service. It was established in 1912, just one year after the university was built. During the last century, it has gone through multiple restructuring processes, changing focuses and amassing an amazing collection of almost 5 million items.

![The Tsinghua University Library](/images/2016/10/tsinghua.png)

In the latest years, the Tsinghua University Library has made great progress in automation and networking. It provides access to an increasing number of electronic  and virtual resources. These form a global open and multi-level information system for all its researchers and students, with more than 450 electronic databases, near 69,000 full-text e-journals, almost a million e-books and more than 35,000 multimedia collections.

Now, the Tsinghua University Library joins DataCite on a new effort to promote data culture by making it discoverable and citable. The Library has implemented many projects related to DOI successfully in the past, and it is currently working on the development of data management and data publishing in China.


text:
<?php

namespace phpeffi\plugin\cron;

use phpeffi\plugin\Trigger;

class Crontab extends Trigger implements ICronjob {
	public function run($time) {
		$this->delegateFire ( 'run', array ($time ) );
	}
}


text:
// This code is auto-generated, do not modify

using Ds3.Calls;
using Ds3.Models;
using Ds3.Runtime;
using System.Linq;
using System.Net;
using System.Xml.Linq;

namespace Ds3.ResponseParsers
{
    internal class GetUserSpectraS3ResponseParser : IResponseParser<GetUserSpectraS3Request, GetUserSpectraS3Response>
    {
        public GetUserSpectraS3Response Parse(GetUserSpectraS3Request request, IWebResponse response)
        {
            using (response)
            {
                ResponseParseUtilities.HandleStatusCode(response, (HttpStatusCode)200);
                using (var stream = response.GetResponseStream())
                {
                    return new GetUserSpectraS3Response(
                        ModelParsers.ParseSpectraUser(
                            XmlExtensions.ReadDocument(stream).ElementOrThrow("Data"))
                    );
                }
            }
        }
    }
}