text:
package org.apache.thrift.transport;

public class TestTSSLTransportFactoryCustomClient2 extends TestTSSLTransportFactory {

  @Override
  public TTransport getClientTransport(TTransport underlyingTransport)
  throws Exception {
    TSSLTransportFactory.TSSLTransportParameters params = new
      TSSLTransportFactory.TSSLTransportParameters();

    params.setTrustStore(System.getProperty("javax.net.ssl.trustStore"), null);

    return TSSLTransportFactory.getClientSocket(HOST, PORT, 0/*timeout*/, params);
  }
}

redpajama_set_name: RedPajamaGithub


text:
from boto.sns.connection import SNSConnection
from boto.regioninfo import RegionInfo, get_regions

def regions():
    """
    Get all available regions for the SNS service.

    :rtype: list
    :return: A list of :class:`boto.regioninfo.RegionInfo` instances
    """
    return get_regions('sns', connection_cls=SNSConnection)

def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`boto.sns.connection.SNSConnection`.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`boto.sns.connection.SNSConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    """
    for region in regions():
        if region.name == region_name:
            return region.connect(**kw_params)
    return None


text:
RSpec.describe Swarm::Pollen::Reader do
  let(:pollen) { File.read(fixture_path("#{process_type}.pollen")) }
  let(:json) { File.read(fixture_path("#{process_type}.json")) }
  subject { described_class.new(pollen) }

  describe "#to_hash" do
    context "with metadata-decorated process" do
      let(:process_type) { "conditional_process" }
      it "should return hash of transformed pollen" do
        expect(subject.to_hash).to eq(JSON.parse(json))
      end
    end

    context "with process containing argument-less commands" do
      let(:process_type) { "concurrence_process" }
      it "should return hash of transformed pollen" do
        expect(subject.to_hash).to eq(JSON.parse(json))
      end
    end
  end

  describe "#to_json" do
    let(:process_type) { "conditional_process" }
    it "returns JSON version of #to_hash" do
      expect(subject).to receive(:to_hash).
        and_return(double(:to_json => :a_json_version))
      expect(subject.to_json).to eq(:a_json_version)
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.joanzapata.iconify">

</manifest>


text:
/*
 *
 */
package net.community.chest.net.snmp;

import java.util.Collection;
import java.util.LinkedList;
import java.util.Map;

/**
 *
Copyright GPLv2

 *
 *
Class representing a group of entries - usually read from a MIB file

 * @author Lyor G.
 * @since May 25, 2009 2:24:28 PM
 */
public class MIBGroup {
    /**
     * Default (empty) constructor
     */
    public MIBGroup ()
    {
        super();
    }
    /**
     * MIB group name (null/empty if not set)
     */
    private String    _mibName    /* =null */;
    public String getMibName ()
    {
        return _mibName;
    }

    public void setMibName (String mibName)
    {
        _mibName = mibName;
    }
    /**
     * @param mibName MIB group name
     * @throws IllegalArgumentException if null/empty name supplied
     */
    public MIBGroup (final String mibName) throws IllegalArgumentException
    {
        if ((null == (_mibName=mibName)) || (mibName.length() <= 0))
            throw new IllegalArgumentException("Null/empty MIB group name");
    }
    /**
     * MIB group entries - key=entry OID, value=entry
     */
    private Map<String,MIBAttributeEntry>    _entries    /* =null */;
    public Map<String,? extends MIBAttributeEntry> getEntries ()
    {
        return _entries;
    }
    /**
     * Longest common OID prefix of all entries in group (null/empty) if
     * no such prefix exists (usually an error...). Lazy initialized by
     * first call to (@link #getBaseOID()). Note: calling
     * (@link #setEntries(Collection)) or (@link #addEntry(MIBAttributeEntry))
     * null-ifies this value in order to force its re-evaluation. It is
     * therefore, highly recommended that the base OID not be used
     * until all entries have been added
     */
    private String    _baseOid    /* =null */;
    public synchronized String getBaseOID ()
    {
        if ((null == _baseOid) || (_baseOid.length() <= 0))
        {
            final Map<String,? extends MIBAttributeEntry>    eMap=getEntries();
            final Collection<? extends MIBAttributeEntry>    entries=
                ((null == eMap) || (eMap.size() <= 0)) ? null : eMap.values();
            _baseOid = MIBAttributeEntry.findBaseOid(entries);
        }

        return _baseOid;
    }
    /**
     * @param eMap entries (@link Map) - key=OID, matching (@link MIBAttributeEntry)
     * value - may be null/empty
     * @return (@link Map) key=entry OID, matching value=(@link MIBRowEntry),
     * may be null/empty if no entries or no (@link MIBRowEntry) instances
     */
    public static final OIDStringsMap<MIBRowEntry> extractRowsEntries (final Map<String,? extends MIBAttributeEntry> eMap)
    {
        return MIBRowEntry.extractRowsEntries(((null == eMap) || (eMap.size() <= 0)) ? null : eMap.values());
    }
    /**
     * dummy empty rows map - auto-allocated/cleared by call to (@link #getEmptyRows())
     */
    private static OIDStringsMap<MIBRowEntry>    _EMPTY_ROWS    /* =null */;
    private static synchronized OIDStringsMap<MIBRowEntry> getEmptyRows ()
    {
        if (null == _EMPTY_ROWS)
            _EMPTY_ROWS = new OIDStringsMap<MIBRowEntry>();
        else
            _EMPTY_ROWS.clear();

        return _EMPTY_ROWS;
    }
    /**
     * (@link Map) of defined "rows" in this group (key=OID,value=(@link MIBRowEntry) - lazy
     * initialized by first call to (@link #getRows()) and dynamically re-initialized
     * after any changes to the current entries
     */
    private Map<String,? extends MIBRowEntry>    _rows    /* =null */;
    public synchronized Map<String,? extends MIBRowEntry> getRows ()
    {
        if (null == _rows)
        {
            if (null == (_rows=extractRowsEntries(getEntries())))
                _rows = getEmptyRows();    // mark as non-null to avoid re-evaluation
        }

        return _rows;
    }
    /**
     * (@link Map) of defined "scalars" in this group (key=OID,value=base type) - lazy
     * initialized by first call to (@link #getScalars()) and dynamically re-initialized
     * after any changes to the current entries
     */
    private Map<String,? extends MIBAttributeEntry>    _scalars    /* =null */;
    public Map<String,? extends MIBAttributeEntry> getScalars ()
    {
        if (null == _scalars)
        {
            final Map<String,? extends MIBAttributeEntry>    eMap=getEntries();
            final Collection<? extends MIBAttributeEntry>        entries=((null == eMap) || (eMap.size() <= 0)) ? null : eMap.values();

            final OIDStringsMap<MIBAttributeEntry>    sMap=new OIDStringsMap<MIBAttributeEntry>();
            if ((entries != null) && (entries.size() > 0))
            {
                for (final MIBAttributeEntry e : entries)
                {
                    if ((null == e) || (e instanceof MIBRowEntry))
                        continue;

                    sMap.put(e.getOid(), e);
                }
            }

            _scalars = sMap;
        }

        return _scalars;
    }
    /**
     * Forces re-evaluation of fields whose values are derived/calculated
     * from the entries map
     */
    protected void resetCalculatedFields ()
    {
        _rows = null;
        _scalars = null;
        _baseOid = null;
    }

    public void setEntries (final Map<String,MIBAttributeEntry> entries)
    {
        _entries = entries;
        resetCalculatedFields();
    }
    /**
     * @param e entry to be added
     * @return previous entry mapped to the OID (null if none)
     * @throws IllegalArgumentException if null entry/OID
     */
    public MIBAttributeEntry addEntry (final MIBAttributeEntry e) throws IllegalArgumentException
    {
        final String    oid=(null == e) ? null : e.getOid();
        if ((null == oid) || (oid.length() <= 0))
            throw new IllegalArgumentException("addEntry(" + e + ") no OID/entry");

        if (null == _entries)
            _entries = new OIDStringsMap<MIBAttributeEntry>();

        resetCalculatedFields();

        return _entries.put(oid, e);
    }
    /**
     * Adds all entries to the MIB group
     * @param entries entries to be added - may be null/empty
     * @param unique if TRUE then throws (@link IllegalStateException) if
     * an added entry already exists
     * @return updated entries map
     * @throws IllegalStateException if an added entry already exists and the
     * unique parameter has been set to TRUE
     * @throws IllegalArgumentException if null OID was found
     * @see #addEntry(MIBAttributeEntry)
     */
    public Map<String,? extends MIBAttributeEntry> addEntries (final Collection<? extends MIBAttributeEntry> entries, final boolean unique) throws IllegalStateException
    {
        if ((entries != null) && (entries.size() > 0))
        {
            for (final MIBAttributeEntry e : entries)
            {
                if (e != null)    // should not be otherwise
                {
                    final MIBAttributeEntry    prev=addEntry(e);
                    if ((prev != null) && unique)
                        throw new IllegalStateException("addEntries() ambiguous entries (" + e.getAttrName() + "/" + prev.getAttrName() + ") for OID=" + e.getOid());
                }
            }
        }

        return getEntries();
    }
    /**
     * @param entries read entries - may be null/empty
     * @return (@link Map) of entries - key=OID, value=entry instance (may be
     * null/empty if no entries to begin with)
     * @throws RuntimeException if null/empty OID or same OID mapped for
     * another entry
     */
    private static final Map<String,? extends MIBAttributeEntry> mapReadEntries (final Collection<? extends MIBAttributeEntry> entries) throws RuntimeException
    {
        if ((null == entries) || (entries.size() <= 0))
            return null;

        final Map<String,MIBAttributeEntry>    eMap=new OIDStringsMap<MIBAttributeEntry>();
        for (final MIBAttributeEntry e : entries)
        {
            final String    oid=(null == e) /* should not happen */ ? null : e.getOid();
            if ((null == oid) || (oid.length() <= 0))    // should not happen
                throw new IllegalArgumentException("mapReadEntries() no OID for entry=" + e);

            final MIBAttributeEntry    prev=eMap.put(oid, e);
            if (prev != null)    // not allowed to have duplicate mappings for same OID
                throw new IllegalStateException("mapReadEntries() OID=" + oid + " already assigned to entry=" + prev);
        }

        return eMap;
    }
    // returns updated collection of removed entries
    private static final Collection<MIBAttributeEntry> removeOID (final Collection<MIBAttributeEntry> eColl, final Map<String,? extends MIBAttributeEntry> eMap, final String oid)
    {
        if ((null == oid) || (oid.length() <= 0)
         || (null == eMap) || (eMap.size() <= 0))
            return eColl;

        final MIBAttributeEntry    e=eMap.remove(oid);
        if (null == e)
            return eColl;

        // allocate a collection if one not provided
        if (null == eColl)
        {
            final Collection<MIBAttributeEntry>    entries=new LinkedList<MIBAttributeEntry>();
            entries.add(e);
            return entries;
        }

        eColl.add(e);
        return eColl;
    }
    // returns updated collection of removed entries
    private static final Collection<MIBAttributeEntry> removeRowEntries (final Collection<MIBAttributeEntry> eColl, final Map<String,? extends MIBAttributeEntry> eMap, final MIBRowEntry row)
    {
        if ((null == row) || (null == eMap) || (eMap.size() <= 0))
            return eColl;

        Collection<MIBAttributeEntry>    entries=removeOID(eColl, eMap, row.getOid());

        // remove the columns (if any)
        final Map<String,? extends MIBAttributeEntry>    cMap=row.getColumns();
        final Collection<? extends MIBAttributeEntry>    cols=((null == cMap) || (cMap.size() <= 0)) ? null : cMap.values();
        if ((cols != null) && (cols.size() > 0))
        {
            for (final MIBAttributeEntry c : cols)
            {
                if (c != null)    // should not be otherwise
                {
                    if (c instanceof MIBRowEntry)
                        entries = removeRowEntries(entries, eMap, (MIBRowEntry) c);
                    else
                        entries = removeOID(entries, eMap, c.getOid());
                }
            }
        }

        return entries;
    }
    // returns collection of removed entries
    private static final Collection<? extends MIBAttributeEntry> removeRowsEntries (final Map<String,? extends MIBAttributeEntry> eMap, final Map<String,? extends MIBRowEntry> rMap)
    {
        if ((null == rMap) || (rMap.size() <= 0)
         || (null == eMap) || (eMap.size() <= 0))
            return null;

        final Collection<? extends MIBRowEntry>    rows=rMap.values();
        Collection<MIBAttributeEntry>            entries=null;
        for (final MIBRowEntry r : rows)
            entries = removeRowEntries(entries, eMap, r);

        return entries;
    }
    /**
     * Builds a MIB group from the "raw" entries (i.e., rows/columns are all
     * "mixed" in as "simple" entries)
     * @param mibName logical name for the MIB group - may NOT be null/empty
     * @param entries "raw" entries
     * @return MIB group data
     * @throws RuntimeException if unable to process the entries
     */
    public static final MIBGroup buildMIBGroup (final String mibName, final Collection<? extends MIBAttributeEntry> entries) throws RuntimeException
    {
        final Map<String,? extends MIBAttributeEntry>    eMap=mapReadEntries(entries);
        final MIBGroup                                        grp=new MIBGroup(mibName);

        // first process all rows - thus "cleaning up" the entries map and leaving only the scalars in it
        {
            Map<String,MIBRowEntry>    rMap=null;
            for (final MIBAttributeEntry e : entries)
            {
                final String    type=(null == e) /* should not happen */ ? null : e.getSyntax();
                if (!SNMPProtocol.SEQUENCEMod.equalsIgnoreCase(type))
                    continue;

                final MIBRowEntry    row=MIBRowEntry.buildMIBRowEntry(e, eMap);
                if (null == rMap)
                    rMap = new OIDStringsMap<MIBRowEntry>();

                rMap.put(row.getOid(), row);
                grp.addEntry(row);
            }

            // remove the rows and all their columns from the entries map - thus leaving only scalars
            removeRowsEntries(eMap, rMap);
        }

        // assume whatever is left is a scalar
        final Collection<? extends MIBAttributeEntry>    scalars=
            ((null == eMap) || (eMap.size() <= 0)) ? null : eMap.values();
        if ((null == scalars) || (scalars.size() <= 0))
            return grp;

        for (final MIBAttributeEntry s : scalars)
        {
            if (s == null)    // should not be otherwise
                continue;

            s.adjustScalarOid();
            grp.addEntry(s);
        }

        return grp;
    }
    /*
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString ()
    {
        return getMibName();
    }
}


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

<title>Debugging with GDB: Ravenscar Profile</title>

<meta name="description" content="Debugging with GDB: Ravenscar Profile">
<meta name="keywords" content="Debugging with GDB: Ravenscar Profile">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Ada.html#Ada" rel="up" title="Ada">
<link href="Ada-Glitches.html#Ada-Glitches" rel="next" title="Ada Glitches">
<link href="Ada-Tasks-and-Core-Files.html#Ada-Tasks-and-Core-Files" rel="prev" title="Ada Tasks and Core Files">

Next: Ada Glitches, Previous: Ada Tasks and Core Files, Up: Ada   [Contents][Index]

15.4.10.9 Tasking Support when using the Ravenscar Profile

The Ravenscar Profile is a subset of the Ada tasking features,
specifically designed for systems with safety-critical real-time
requirements.

set ravenscar task-switching on

Allows task switching when debugging a program that uses the Ravenscar
Profile.  This is the default.

set ravenscar task-switching off

Turn off task switching when debugging a program that uses the Ravenscar
Profile.  This is mostly intended to disable the code that adds support
for the Ravenscar Profile, in case a bug in either GDB or in
the Ravenscar runtime is preventing GDB from working properly.
To be effective, this command should be run before the program is started.

show ravenscar task-switching

Show whether it is possible to switch from task to task in a program
using the Ravenscar Profile.


text:
<html>
<head><title>MIDI frame test</title></head>
<body style="margin: 0; cursor: none">
<script src="../tma.js"></script>
<script src="mv_common.js"></script>
<script>
tma.extlibs = [ 'ext/gl-matrix.js', 'ext/mv/MajVj.js' ];
tma.onload = function () {
  var r = 1;
  var width = 1920 / r;
  var height = 1080 / r;
  var vj = new MajVj(width, height, true);
  MajVj.loadAllPlugins().then(function () {
    var frame = vj.create('frame', 'astalight');
    frame.properties.keymap = MajVj.misc.midi.keymap
    var sound = vj.create('misc', 'sound', { delay: 0.0 });
    //sound.fetch('data/bustling.mp3', true);
    controller.sound.wave = new Float32Array(sound.getWaveTableCount());
    vj.run(function (delta) {
      sound.getFloatWaveTable(controller.sound.wave);
      var rms = 0.0;
      for (var i = 0; i < controller.sound.wave.length; ++i) {
        var data = controller.sound.wave[i];
        rms += data * data;
      }
      rms = Math.sqrt(rms / controller.sound.wave.length);
      controller.sound.volume = rms;

      vj.screen().fillColor(0.0, 0.0, 0.0, 1.0);
      //MajVj.misc.midi.auto();
      MajVj.misc.midi.decay();
      frame.draw(delta);
    });
    window.onresize = function () {
      vj.onresize();
      frame.onresize(vj.aspect());
    };
  }, function (e) { console.log('plugin load error: ' + e); });
};
</script>
</body>
</html>


text:
<?php
namespace Dappur\Model;

use Cartalyst\Sentinel\Users\EloquentUser;

class Users extends EloquentUser
{
    protected $table = 'users';
    protected $primaryKey = 'id';
    protected $fillable = [
        'email',
        'username',
        'password',
        '2fa',
        'last_name',
        'first_name',
        'permissions',
    ];
    protected $loginNames = ['username', 'email'];
    protected $hidden = array('pivot');

    public function profile()
    {
        return $this->hasOne('\Dappur\Model\UsersProfile', 'user_id', 'id');
    }

    public function posts()
    {
        return $this->hasMany('\Dappur\Model\BlogPosts', 'user_id', 'id');
    }

    public function oauth2()
    {
        return $this->hasMany('\Dappur\Model\Oauth2Users', 'user_id', 'id');
    }

    public function notActivated()
    {
        return $this->hasOne('\Dappur\Model\Activations', 'user_id', 'id')
            ->where('completed', 0);
    }
}


text:
<?php
namespace User\View\Helper;
use User\Entity\User;
use Zend\View\Helper\AbstractHelper;

/**
 * Class GetActivateUrl
 *
 * @package User\View\Helper
 */
class GetActivateUrl extends AbstractHelper
{

    /**
     * @param User $user
     *
     * @return string
     */
    public function __invoke(User $user)
    {
        $url = $this->getView()->plugin('url');
        $href = $url('user', array('action' => 'unDelete', 'id' => $user->getId()));

        if ($user->isActive()) {
            $href = $url('user', array('action' => 'delete', 'id' => $user->getId()));
        }

        return $href;
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.jitstatic</groupId>
        <artifactId>jitstatic-parent</artifactId>
        <version>0.40.2-SNAPSHOT</version>
    </parent>
    <artifactId>injection</artifactId>

    <dependencies>
        <dependency>
            <groupId>io.jitstatic</groupId>
            <artifactId>utils</artifactId>
            <version>0.40.2-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>zone.dragon.dropwizard</groupId>
            <artifactId>dropwizard-hk2</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.inject</groupId>
                    <artifactId>javax.inject</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.activation</groupId>
            <artifactId>jakarta.activation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.hk2</groupId>
            <artifactId>hk2-api</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.inject</groupId>
                    <artifactId>javax.inject</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId> org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.8.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
using net::URLFetcher;

const char kApiUrl[] = "https://safesearch.googleapis.com/v1:report";
const char kApiScope[] = "https://www.googleapis.com/auth/safesearch.reporting";

const int kNumRetries = 1;

const char kAuthorizationHeaderFormat[] = "Authorization: Bearer %s";

// Request keys
const char kUrlKey[] = "url";

struct SafeSearchURLReporter::Report {
  Report(const GURL& url, const SuccessCallback& callback, int url_fetcher_id);
  ~Report();

  GURL url;
  SuccessCallback callback;
  std::unique_ptr<OAuth2TokenService::Request> access_token_request;
  std::string access_token;
  bool access_token_expired;
  int url_fetcher_id;
  std::unique_ptr<URLFetcher> url_fetcher;
};

SafeSearchURLReporter::Report::Report(const GURL& url,
                                      const SuccessCallback& callback,
                                      int url_fetcher_id)
    : url(url),
      callback(callback),
      access_token_expired(false),
      url_fetcher_id(url_fetcher_id) {}

SafeSearchURLReporter::Report::~Report() {}

SafeSearchURLReporter::SafeSearchURLReporter(
    OAuth2TokenService* oauth2_token_service,
    const std::string& account_id,
    net::URLRequestContextGetter* context)
    : OAuth2TokenService::Consumer("safe_search_url_reporter"),
      oauth2_token_service_(oauth2_token_service),
      account_id_(account_id),
      context_(context),
      url_fetcher_id_(0) {}

SafeSearchURLReporter::~SafeSearchURLReporter() {}

// static
std::unique_ptr<SafeSearchURLReporter> SafeSearchURLReporter::CreateWithProfile(
    Profile* profile) {
  ProfileOAuth2TokenService* token_service =
      ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
  SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile);
  return base::WrapUnique(new SafeSearchURLReporter(
      token_service, signin->GetAuthenticatedAccountId(),
      profile->GetRequestContext()));
}

void SafeSearchURLReporter::ReportUrl(const GURL& url,
                                      const SuccessCallback& callback) {
  reports_.push_back(base::MakeUnique<Report>(url, callback, url_fetcher_id_));
  StartFetching(reports_.back().get());
}

void SafeSearchURLReporter::StartFetching(Report* report) {
  OAuth2TokenService::ScopeSet scopes;
  scopes.insert(kApiScope);
  report->access_token_request =
      oauth2_token_service_->StartRequest(account_id_, scopes, this);
}

void SafeSearchURLReporter::OnGetTokenSuccess(
    const OAuth2TokenService::Request* request,
    const std::string& access_token,
    const base::Time& expiration_time) {
  ReportIterator it = reports_.begin();
  while (it != reports_.end()) {
    if (request == (*it)->access_token_request.get())
      break;
    it++;
  }
  DCHECK(it != reports_.end());

  (*it)->access_token = access_token;

  (*it)->url_fetcher = URLFetcher::Create((*it)->url_fetcher_id, GURL(kApiUrl),
                                          URLFetcher::POST, this);

  (*it)->url_fetcher->SetRequestContext(context_);
  (*it)->url_fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
                                   net::LOAD_DO_NOT_SAVE_COOKIES);
  (*it)->url_fetcher->SetAutomaticallyRetryOnNetworkChanges(kNumRetries);
  (*it)->url_fetcher->AddExtraRequestHeader(
      base::StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()));

  base::DictionaryValue dict;
  dict.SetStringWithoutPathExpansion(kUrlKey, (*it)->url.spec().c_str());

  std::string body;
  base::JSONWriter::Write(dict, &body);
  (*it)->url_fetcher->SetUploadData("application/json", body);

  (*it)->url_fetcher->Start();
}

void SafeSearchURLReporter::OnGetTokenFailure(
    const OAuth2TokenService::Request* request,
    const GoogleServiceAuthError& error) {
  ReportIterator it = reports_.begin();
  while (it != reports_.end()) {
    if (request == (*it)->access_token_request.get())
      break;
    it++;
  }
  DCHECK(it != reports_.end());
  LOG(WARNING) << "Token error: " << error.ToString();
  DispatchResult(it, false);
}

void SafeSearchURLReporter::OnURLFetchComplete(const URLFetcher* source) {
  ReportIterator it = reports_.begin();
  while (it != reports_.end()) {
    if (source == (*it)->url_fetcher.get())
      break;
    ++it;
  }
  DCHECK(it != reports_.end());

  const net::URLRequestStatus& status = source->GetStatus();
  if (!status.is_success()) {
    LOG(WARNING) << "Network error " << status.error();
    DispatchResult(it, false);
    return;
  }

  int response_code = source->GetResponseCode();
  if (response_code == net::HTTP_UNAUTHORIZED && !(*it)->access_token_expired) {
    (*it)->access_token_expired = true;
    OAuth2TokenService::ScopeSet scopes;
    scopes.insert(kApiScope);
    oauth2_token_service_->InvalidateAccessToken(account_id_, scopes,
                                                 (*it)->access_token);
    StartFetching((*it).get());
    return;
  }

  if (response_code != net::HTTP_OK) {
    LOG(WARNING) << "HTTP error " << response_code;
    DispatchResult(it, false);
    return;
  }

  DispatchResult(it, true);
}

void SafeSearchURLReporter::DispatchResult(ReportIterator it, bool success) {
  (*it)->callback.Run(success);
  reports_.erase(it);
}


text:
#pragma once

#include "common/common.h"

class Mutex;
class CondVarBase;

//! Mutual exclusion lock utility
/*!
This class locks a mutex or condition variable in the c'tor and unlocks
it in the d'tor.  It's easier and safer than manually locking and
unlocking since unlocking must usually be done no matter how a function
exits (including by unwinding due to an exception).
*/
class Lock {
public:
	//! Lock the mutex \c mutex
	Lock(const Mutex* mutex);
	//! Lock the condition variable \c cv
	Lock(const CondVarBase* cv);
	//! Unlock the mutex or condition variable
	~Lock();

private:
	// not implemented
	Lock(const Lock&);
	Lock& operator=(const Lock&);

private:
	const Mutex*		m_mutex;
};


text:
.. EN-Revision: none
.. _zendpdf.introduction:

Introducción
============

El componente ``ZendPdf`` es un motor para manipular documentos *PDF* (Portable Document Format). Puede cargar,
crear, modificar y guardar documentos. Por lo tanto, puede ayudar a cualquier aplicación *PHP* a crear
dinámicamente documentos *PDF* modificando los documentos existentes o generar unos nuevos desde cero.
``ZendPdf`` ofrece las siguientes características:

   - Crear un documento nuevo o cargar uno existente. [#]_

   - Recuperar una determinada revisión del documento.

   - Manipular páginas desde dentro de un documento. Cambiar el orden de las páginas, añadir nuevas páginas,
     eliminar páginas de un documento.

   - Diferentes primitivas de dibujo (líneas, rectángulos, polígonos, círculos, elipses y sectores).

   - Dibujo de texto utilizando alguno de las 14 fuentes estándar (incorporadas) o sus propias fuentes
     personalizadas TrueType.

   - Rotaciones.

   - Dibujo de imágenes. [#]_

   - Actualización incremental de archivos *PDF*.

.. [#] La carga de documentos *PDF* V1.4 (Acrobat 5) ahora está soportada.
.. [#] Están soportados los formatos de imagen JPG, PNG [hasta 8bit por channel+Alpha] y TIFF.


text:
package org.n52.iceland.event.events;

import javax.servlet.http.HttpServletRequest;

import org.n52.janmayen.event.Event;

/**
 * Event is thrown if a new {@link HttpServletRequest} arrives.
 *
 * @author Carsten Hollmann
 * @since 1.0.0
 *
 */
public class IncomingRequestEvent implements Event {

    private final HttpServletRequest request;

    private final long requestNumber;

    public IncomingRequestEvent(final HttpServletRequest request, long requestNumber) {
        this.request = request;
        this.requestNumber = requestNumber;
    }

    public HttpServletRequest getRequest() {
        return request;
    }

    public long getRequestNumber() {
        return requestNumber;
    }

    @Override
    public String toString() {
        return String.format("IncomingRequestEvent[request=%s, requestNumber=%d]", getRequest(), getRequestNumber());
    }

}


text:
#ifndef EFX_ETHTOOL_H
#define EFX_ETHTOOL_H

#include "net_driver.h"

/*
 * Ethtool support
 */

extern int efx_ethtool_get_settings(struct net_device *net_dev,
				    struct ethtool_cmd *ecmd);
extern int efx_ethtool_set_settings(struct net_device *net_dev,
				    struct ethtool_cmd *ecmd);

extern const struct ethtool_ops efx_ethtool_ops;

#endif /* EFX_ETHTOOL_H */


text:
#ifndef _TCOD_CONSOLE_H
#define _TCOD_CONSOLE_H

#include "libtcod_portability.h"

#ifdef TCOD_CONSOLE_SUPPORT

#include "color.h"
#include "console_types.h"
#include "image.h"
#include "list.h"

#ifdef __cplusplus
extern "C" {
#endif

#define TCOD_BKGND_ALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ALPH|(((uint8_t)(alpha*255))<<8)))
#define TCOD_BKGND_ADDALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ADDA|(((uint8_t)(alpha*255))<<8)))

TCODLIB_API void TCOD_console_init_root(int w, int h, const char * title, bool fullscreen, TCOD_renderer_t renderer);
TCODLIB_API void TCOD_console_set_window_title(const char *title);
TCODLIB_API void TCOD_console_set_fullscreen(bool fullscreen);
TCODLIB_API bool TCOD_console_is_fullscreen(void);
TCODLIB_API bool TCOD_console_is_window_closed(void);
TCODLIB_API bool TCOD_console_has_mouse_focus(void);
TCODLIB_API bool TCOD_console_is_active(void);

TCODLIB_API void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic);
TCODLIB_API void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY);
TCODLIB_API void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCharX, int fontCharY);
TCODLIB_API void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY);

TCODLIB_API void TCOD_console_set_dirty(int x, int y, int w, int h);
TCODLIB_API void TCOD_console_set_default_background(TCOD_console_t con,TCOD_color_t col);
TCODLIB_API void TCOD_console_set_default_foreground(TCOD_console_t con,TCOD_color_t col);
TCODLIB_API void TCOD_console_clear(TCOD_console_t con);
TCODLIB_API void TCOD_console_set_char_background(TCOD_console_t con,int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag);
TCODLIB_API void TCOD_console_set_char_foreground(TCOD_console_t con,int x, int y, TCOD_color_t col);
TCODLIB_API void TCOD_console_set_char(TCOD_console_t con,int x, int y, int c);
TCODLIB_API void TCOD_console_put_char(TCOD_console_t con,int x, int y, int c, TCOD_bkgnd_flag_t flag);
TCODLIB_API void TCOD_console_put_char_ex(TCOD_console_t con,int x, int y, int c, TCOD_color_t fore, TCOD_color_t back);

TCODLIB_API void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag);
TCODLIB_API TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con);
TCODLIB_API void TCOD_console_set_alignment(TCOD_console_t con,TCOD_alignment_t alignment);
TCODLIB_API TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con);
TCODLIB_API void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...);
TCODLIB_API void TCOD_console_print_ex(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...);
TCODLIB_API int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...);
TCODLIB_API int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...);
TCODLIB_API int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...);

TCODLIB_API void TCOD_console_rect(TCOD_console_t con,int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag);
TCODLIB_API void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag);
TCODLIB_API void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag);
TCODLIB_API void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...);

#ifndef NO_UNICODE
/* unicode support */
TCODLIB_API void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY);
TCODLIB_API void TCOD_console_print_utf(TCOD_console_t con,int x, int y, const wchar_t *fmt, ...);
TCODLIB_API void TCOD_console_print_ex_utf(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...);
TCODLIB_API int TCOD_console_print_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...);
TCODLIB_API int TCOD_console_print_rect_ex_utf(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...);
TCODLIB_API int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...);
#endif

TCODLIB_API TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con);
TCODLIB_API TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con);
TCODLIB_API TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con,int x, int y);
TCODLIB_API TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con,int x, int y);
TCODLIB_API int TCOD_console_get_char(TCOD_console_t con,int x, int y);

TCODLIB_API TCOD_image_t TCOD_console_get_background_color_image(TCOD_console_t con);
TCODLIB_API TCOD_image_t TCOD_console_get_foreground_color_image(TCOD_console_t con);

TCODLIB_API void TCOD_console_set_fade(uint8_t val, TCOD_color_t fade);
TCODLIB_API uint8_t TCOD_console_get_fade(void);
TCODLIB_API TCOD_color_t TCOD_console_get_fading_color(void);

TCODLIB_API void TCOD_console_flush(void);

TCODLIB_API void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back);

TCODLIB_API TCOD_key_t TCOD_console_check_for_keypress(int flags);
TCODLIB_API TCOD_key_t TCOD_console_wait_for_keypress(bool flush);
TCODLIB_API bool TCOD_console_is_key_pressed(TCOD_keycode_t key);

/* ASCII paint file support */
TCODLIB_API TCOD_console_t TCOD_console_from_file(const char *filename);
TCODLIB_API bool TCOD_console_load_asc(TCOD_console_t con, const char *filename);
TCODLIB_API bool TCOD_console_load_apf(TCOD_console_t con, const char *filename);
TCODLIB_API bool TCOD_console_save_asc(TCOD_console_t con, const char *filename);
TCODLIB_API bool TCOD_console_save_apf(TCOD_console_t con, const char *filename);

TCODLIB_API TCOD_console_t TCOD_console_new(int w, int h);
TCODLIB_API int TCOD_console_get_width(TCOD_console_t con);
TCODLIB_API int TCOD_console_get_height(TCOD_console_t con);
TCODLIB_API void TCOD_console_set_key_color(TCOD_console_t con,TCOD_color_t col);
TCODLIB_API void TCOD_console_blit(TCOD_console_t src,int xSrc, int ySrc, int wSrc, int hSrc, TCOD_console_t dst, int xDst, int yDst, float foreground_alpha, float background_alpha);
TCODLIB_API void TCOD_console_delete(TCOD_console_t console);

TCODLIB_API void TCOD_console_credits(void);
TCODLIB_API void TCOD_console_credits_reset(void);
TCODLIB_API bool TCOD_console_credits_render(int x, int y, bool alpha);
#ifdef __cplusplus
}
#endif

#endif /* TCOD_CONSOLE_SUPPORT */

#endif /* _TCOD_CONSOLE_H */


text:
/* */
System.register([], function (_export) {
  "use strict";

  var View;

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

  return {
    setters: [],
    execute: function () {
      View = (function () {
        function View(fragment, behaviors, bindings, children, systemControlled, contentSelectors) {
          _classCallCheck(this, View);

          this.fragment = fragment;
          this.behaviors = behaviors;
          this.bindings = bindings;
          this.children = children;
          this.systemControlled = systemControlled;
          this.contentSelectors = contentSelectors;
          this.firstChild = fragment.firstChild;
          this.lastChild = fragment.lastChild;
          this.isBound = false;
          this.isAttached = false;
        }

        View.prototype.created = function created(executionContext) {
          var i,
              ii,
              behaviors = this.behaviors;
          for (i = 0, ii = behaviors.length; i < ii; ++i) {
            behaviors[i].created(executionContext);
          }
        };

        View.prototype.bind = function bind(executionContext, systemUpdate) {
          var context, behaviors, bindings, children, i, ii;

          if (systemUpdate && !this.systemControlled) {
            context = this.executionContext || executionContext;
          } else {
            context = executionContext || this.executionContext;
          }

          if (this.isBound) {
            if (this.executionContext === context) {
              return;
            }

            this.unbind();
          }

          this.isBound = true;
          this.executionContext = context;

          if (this.owner) {
            this.owner.bind(context);
          }

          bindings = this.bindings;
          for (i = 0, ii = bindings.length; i < ii; ++i) {
            bindings[i].bind(context);
          }

          behaviors = this.behaviors;
          for (i = 0, ii = behaviors.length; i < ii; ++i) {
            behaviors[i].bind(context);
          }

          children = this.children;
          for (i = 0, ii = children.length; i < ii; ++i) {
            children[i].bind(context, true);
          }
        };

        View.prototype.addBinding = function addBinding(binding) {
          this.bindings.push(binding);

          if (this.isBound) {
            binding.bind(this.executionContext);
          }
        };

        View.prototype.unbind = function unbind() {
          var behaviors, bindings, children, i, ii;

          if (this.isBound) {
            this.isBound = false;

            if (this.owner) {
              this.owner.unbind();
            }

            bindings = this.bindings;
            for (i = 0, ii = bindings.length; i < ii; ++i) {
              bindings[i].unbind();
            }

            behaviors = this.behaviors;
            for (i = 0, ii = behaviors.length; i < ii; ++i) {
              behaviors[i].unbind();
            }

            children = this.children;
            for (i = 0, ii = children.length; i < ii; ++i) {
              children[i].unbind();
            }
          }
        };

        View.prototype.insertNodesBefore = function insertNodesBefore(refNode) {
          var parent = refNode.parentNode;
          parent.insertBefore(this.fragment, refNode);
        };

        View.prototype.appendNodesTo = function appendNodesTo(parent) {
          parent.appendChild(this.fragment);
        };

        View.prototype.removeNodes = function removeNodes() {
          var start = this.firstChild,
              end = this.lastChild,
              fragment = this.fragment,
              next;

          var current = start,
              loop = true,
              nodes = [];

          while (loop) {
            if (current === end) {
              loop = false;
            }

            next = current.nextSibling;
            this.fragment.appendChild(current);
            current = next;
          }
        };

        View.prototype.attached = function attached() {
          var behaviors, children, i, ii;

          if (this.isAttached) {
            return;
          }

          this.isAttached = true;

          if (this.owner) {
            this.owner.attached();
          }

          behaviors = this.behaviors;
          for (i = 0, ii = behaviors.length; i < ii; ++i) {
            behaviors[i].attached();
          }

          children = this.children;
          for (i = 0, ii = children.length; i < ii; ++i) {
            children[i].attached();
          }
        };

        View.prototype.detached = function detached() {
          var behaviors, children, i, ii;

          if (this.isAttached) {
            this.isAttached = false;

            if (this.owner) {
              this.owner.detached();
            }

            behaviors = this.behaviors;
            for (i = 0, ii = behaviors.length; i < ii; ++i) {
              behaviors[i].detached();
            }

            children = this.children;
            for (i = 0, ii = children.length; i < ii; ++i) {
              children[i].detached();
            }
          }
        };

        return View;
      })();

      _export("View", View);
    }
  };
});


text:
@class PMObjectIndex;

@interface PMObjectContext ()

- (NSArray*)pmd_fetchIndexesForObjectWithID:(PMObjectID*)objectID;

- (void)pmd_didRegisterIndex:(PMObjectIndex*)index object:(PMBaseObject*)object;
- (void)pmd_didDeleteIndex:(PMObjectIndex*)index object:(PMBaseObject*)object;

@end


text:
package org.aying.echarts.series;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.aying.echarts.base.SymbolType;

/**
 * @author Fuchun
 * @since 1.0
 */
public class MarkArea extends Mark<MarkArea> {

    private static final long serialVersionUID = -4049625519115442903L;

    public MarkArea() {
        super();
    }

    @Override
    @JsonIgnore
    public SymbolType getSymbol() {
        return null;
    }

    @Override
    @JsonIgnore
    public Integer getSymbolSize() {
        return null;
    }

    @Override
    @JsonIgnore
    public Integer getSymbolRotate() {
        return null;
    }

    @Override
    @JsonIgnore
    public Object[] getSymbolOffset() {
        return null;
    }

    @Override
    public MarkArea symbol(SymbolType symbolType) {
        return this;
    }

    @Override
    public MarkArea symbolSize(Integer size) {
        return this;
    }

    @Override
    public MarkArea symbolRotate(Integer rotate) {
        return this;
    }

    @Override
    public MarkArea offset(Object x, Object y) {
        return this;
    }
}