text:
describe BubbleWrap::App do
  describe '.documents_path' do
    it 'should end in "/Documents"' do
      App.documents_path[-10..-1].should == '/Documents'
    end
  end

  describe '.resources_path' do
    it 'should end in "/testSuite.app"' do
      if App.osx?
        App.resources_path.should =~ /\/testSuite(_spec)?.app\/Contents\/Resources$/
      else
        App.resources_path.should =~ /\/testSuite(_spec)?.app$/
      end
    end
  end

  describe '.notification_center' do
    it 'should be a NSNotificationCenter' do
      App.notification_center.should == NSNotificationCenter.defaultCenter
    end
  end

  describe '.user_cache' do
    it 'should be a NSUserDefaults' do
      App.user_cache.should == NSUserDefaults.standardUserDefaults
    end
  end

  describe '.states' do
    it 'returns a hash' do
      App.states.class.should == Hash
    end
    it "returns the real instance variable" do
      App.states.should == App.instance_variable_get(:@states)
    end
  end

  describe '.info_plist' do
    it 'returns the information property list hash' do
      App.info_plist.should == NSBundle.mainBundle.infoDictionary
    end
  end

  describe '.name' do
    it 'returns the application name' do
      App.name.should == 'testSuite'
    end
  end

  describe '.identifier' do
    it 'returns the application identifier' do
      App.identifier.should == 'io.bubblewrap.testSuite_spec'
    end
  end

  describe '.version' do
    it 'returns the application version' do
      App.version.should == '1.2.3'
    end
  end

  describe '.short_version' do
    it 'returns the application short version' do
      App.short_version.should == '3.2.1'
    end
  end

  describe '.run_after' do
    class DelayedRunAfterTest; attr_accessor :test_value end

    it 'should run a block after the provided delay' do
      @test_obj = DelayedRunAfterTest.new

      App.run_after(0.1){ @test_obj.test_value = true }
      wait_for_change(@test_obj, 'test_value') do
        @test_obj.test_value.should == true
      end
    end

  end

  describe ".open_url" do

    it "uses NSURL or converts NSString in NSURL and opens it" do
      if Kernel.const_defined?(:UIApplication)
        application = UIApplication.sharedApplication
      else
        application = NSWorkspace.sharedWorkspace
      end
      def application.url; @url end
      def application.openURL(url); @url = url end

      url = NSURL.URLWithString('http://localhost')
      App.open_url(url)
      application.url.should.equal url

      url = 'http://localhost'
      App.open_url(url)
      application.url.class.should.equal NSURL
      application.url.description.should.equal url
    end

  end

  describe ".environment" do

    it 'returns current application environment' do
      App.environment.should.equal "test"
    end

  end

  describe ".test? .release? .development?" do

    it 'tests if current application environment is test' do
      App.test?.should.equal true
    end

    it 'tests if current application environment is release' do
      App.release?.should.equal false
    end

    it 'tests if current application environment is development' do
      App.development?.should.equal false
    end

  end

end


text:
========
Overview
========

Numba supports CUDA GPU programming by directly compiling a restricted subset
of Python code into CUDA kernels and device functions following the CUDA
execution model.  Kernels written in Numba appear to have direct access
to NumPy arrays.  NumPy arrays are transferred between the CPU and the
GPU automatically.

Terminology
===========

Several important terms in the topic of CUDA programming are listed here:

- *host*: the CPU
- *device*: the GPU
- *host memory*: the system main memory
- *device memory*: onboard memory on a GPU card
- *kernels*: a GPU function launched by the host and executed on the device
- *device function*: a GPU function executed on the device which can only be
  called from the device (i.e. from a kernel or another device function)

Programming model
=================

Most CUDA programming facilities exposed by Numba map directly to the CUDA
C language offered by NVidia.  Therefore, it is recommended you read the
official `CUDA C programming guide <http://docs.nvidia.com/cuda/cuda-c-programming-guide>`_.

Requirements
============

Supported GPUs
--------------

Numba supports CUDA-enabled GPU with compute capability 2.0 or above with an
up-to-data Nvidia driver.

Software
--------

You will need the CUDA toolkit installed.  If you are using Conda, just
type::

   $ conda install cudatoolkit

Missing CUDA Features
=====================

Numba does not implement all features of CUDA, yet.  Some missing features
are listed below:

* dynamic parallelism
* texture memory

redpajama_set_name: RedPajamaGithub


text:
<?php
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' );

if ( defined( 'WPB_VC_VERSION' ) && class_exists( 'Vc_Manager' ) ) :
	/*
     * Disable nonce checking for Visual Composer grid
     */
	add_filter( 'vc_grid_get_grid_data_access','__return_true' );
endif;


text:
package org.ensembl.healthcheck.testcase.compara;

import java.sql.Connection;

import org.ensembl.healthcheck.DatabaseRegistryEntry;
import org.ensembl.healthcheck.ReportManager;
import org.ensembl.healthcheck.Team;
import org.ensembl.healthcheck.testcase.compara.AbstractComparaTestCase;

/**
 * An EnsEMBL Healthcheck test case that looks for broken foreign-key
 * relationships in the species-tree tables of the Compara schema.
 */

public class ForeignKeySpeciesTreeTables extends AbstractComparaTestCase {

	public ForeignKeySpeciesTreeTables() {
		setDescription("Check for broken foreign-key relationships in the species-tree tables.");
		setTeamResponsible(Team.COMPARA);
	}

	public boolean run(DatabaseRegistryEntry dbre) {
		Connection con = dbre.getConnection();

		boolean result = true;
		result &= checkForOrphansSameTable(con, "species_tree_node", "root_id", "node_id", false);
		result &= checkForOrphansSameTable(con, "species_tree_node", "parent_id", "node_id", true);
		result &= checkForOrphans(con, "species_tree_node_tag", "node_id", "species_tree_node", "node_id");
		result &= checkForOrphans(con, "species_tree_root", "root_id", "species_tree_node", "node_id");
		result &= checkForOrphans(con, "species_tree_node", "root_id", "species_tree_root", "root_id");
		result &= checkOptionalRelation(con, "species_tree_node", "genome_db_id", "genome_db", "genome_db_id");
		result &= checkOptionalRelation(con, "species_tree_node", "taxon_id", "ncbi_taxa_node", "taxon_id");
		result &= checkOptionalRelation(con, "species_tree_node", "taxon_id", "ncbi_taxa_name", "taxon_id");
		return result;
	}

} // ForeignKeySpeciesTreeTables


text:
<?php

namespace Rithis\BECRussiaBundle\Entity;

use Doctrine\ORM\EntityRepository;

class PageRepository extends EntityRepository
{
    public function createIsRealQueryBuilder()
    {
        return $this->createQueryBuilder('p')
            ->where('p.uri IS NOT NULL');
    }
}


text:
import {Map, OrderedMap} from 'immutable';
import {bufferToBlob} from '@webex/react-component-utils';

export const FETCH_SHARE = 'share/FETCH_SHARE';
export const RECEIVE_SHARE = 'share/RECEIVE_SHARE';

export const initialState = new Map({
  files: new OrderedMap({})
});

export default function reducer(state = initialState, action) {
  switch (action.type) {
    case RECEIVE_SHARE: {
      const {
        file,
        fileObject
      } = action.payload;
      const {blob, objectUrl} = bufferToBlob(file);
      const key = fileObject.url;

      return state.setIn(['files', key], new Map({
        name: fileObject.displayName,
        mimeType: fileObject.mimeType,
        fileSize: fileObject.fileSize,
        isFetching: false,
        blob,
        objectUrl
      }));
    }

    case FETCH_SHARE: {
      const key = action.payload.fileObject.url;

      return state.setIn(['files', key, 'isFetching'], true);
    }

    default: {
      return state;
    }
  }
}

function fetchShare(fileObject) {
  return {
    type: FETCH_SHARE,
    payload: {
      fileObject
    }
  };
}

function receiveShare(payload) {
  return {
    type: RECEIVE_SHARE,
    payload
  };
}

export function retrieveSharedFile(fileObject, spark) {
  return (dispatch) => {
    dispatch(fetchShare(fileObject));

    return spark.internal.conversation.download(fileObject)
      .then((file) => {
        dispatch(receiveShare({file, fileObject}, false));

        return file;
      });
  };
}


text:
playing-with-codemirror
=======================


text:
<!DOCTYPE html>

		<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<meta name="format-detection" content="telephone=no">
		<meta content="always" name="referrer">
		<base href="/">
		<link rel="icon" href="static/favicon.png">
		<title>Qoncrete - Platform: self service big data analytics PaaS</title>
	    <meta name="description" content="Qoncrete - platform">
	    <meta name="keywords" content="">
	    <link rel="stylesheet" href="static/main.css">

			Products ▾

				Features Overview
				Qoncrete Platform
				Qoncrete White Label
				Qoncrete Private

			Resources ▾

				Business & Product Use-cases
				Common Concepts & Questions
				Developer Guides
				SDK/API Documentation
				Support & About Qoncrete

		🔒 Login

🇺🇸 English ▾

				🇺🇸 English
				🇨🇳 中文

Qoncrete Cloud Platform
Limitless Analytics

Lowest cost analytics platform on the planet.

Starting at $0.02/GB a month

Track Everything
at Limitless Scalability

Supercharge your product with programmatic data-driven decisions.

Collect, store, organize, analyze, predict, visualize and correlate
any amount of data just the way you like it.

Flexible and Customizable
Immediate Actionable Insights

Use default settings or customize to your hearts desire.

Data retention, tables & graphs, reports and dashboards, user and team access.

Real-time, even at a billion events per second.

60 Seconds or Less

1GB Free Every Month. Free Signup.

			Get Started

		© 2009-2016 QONCRETE. All Rights Reserved.


text:
.. _higher_order_composites:

=======================
Higher-Order Composites
=======================

The `dimod` package includes several example higher-order composed samplers.

.. currentmodule:: dimod.reference.composites

HigherOrderComposite
====================

.. autoclass:: HigherOrderComposite

Properties
~~~~~~~~~~

.. autosummary::
   :toctree: generated/

   HigherOrderComposite.child
   HigherOrderComposite.children
   HigherOrderComposite.parameters
   HigherOrderComposite.properties

Methods
~~~~~~~

.. autosummary::
   :toctree: generated/

   HigherOrderComposite.sample_poly
   HigherOrderComposite.sample_hising
   HigherOrderComposite.sample_hubo

PolyFixedVariableComposite
==========================

.. autoclass:: PolyFixedVariableComposite

Properties
~~~~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyFixedVariableComposite.child
   PolyFixedVariableComposite.children
   PolyFixedVariableComposite.parameters
   PolyFixedVariableComposite.properties

Methods
~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyFixedVariableComposite.sample_poly
   PolyFixedVariableComposite.sample_hising
   PolyFixedVariableComposite.sample_hubo

PolyScaleComposite
==================

.. autoclass:: PolyScaleComposite

Properties
~~~~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyScaleComposite.child
   PolyScaleComposite.children
   PolyScaleComposite.parameters
   PolyScaleComposite.properties

Methods
~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyScaleComposite.sample_poly
   PolyScaleComposite.sample_hising
   PolyScaleComposite.sample_hubo

PolyTruncateComposite
=====================

.. autoclass:: PolyTruncateComposite

Properties
~~~~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyTruncateComposite.child
   PolyTruncateComposite.children
   PolyTruncateComposite.parameters
   PolyTruncateComposite.properties

Methods
~~~~~~~

.. autosummary::
   :toctree: generated/

   PolyTruncateComposite.sample_poly
   PolyTruncateComposite.sample_hising
   PolyTruncateComposite.sample_hubo


text:
<?php

require_once __DIR__ . '/../init.php';
require_once __DIR__ . '/TestCase.php';


text:
#include "config.h"
#include "FontPlatformData.h"

#include "Font.h"
#include "FontCache.h"
#include "FontData.h"
#include "SimpleFontData.h"
#include "UnicodeRange.h"
#include "wtf/OwnPtr.h"
#include <wtf/StdLibExtras.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>

#include <windows.h>
#include <mlang.h>

namespace WebCore {

extern HDC g_screenDC;

static wchar_t songTiStr[] = { 0x5b8b, 0x4f53, 0 };
static wchar_t heiTiStr[] = { 0x9ed1, 0x4f53, 0 };

class FontFamilyCodePageInfo {
public:
    FontFamilyCodePageInfo()
        : m_codePage(0), m_codePages(0)
    {
    }
    FontFamilyCodePageInfo(const wchar_t* family, UINT codePage)
        : m_family(family), m_codePage(codePage), m_codePages(0)
    {
    }
    DWORD codePages() const
    {
        if (!m_codePages) {
            if (IMLangFontLinkType* langFontLink = fontCache()->getFontLinkInterface())
                langFontLink->CodePageToCodePages(m_codePage, &m_codePages);
        }
        return m_codePages;
    }

    String m_family;
    UINT m_codePage;
private:
    mutable DWORD m_codePages;
};

class FontFamilyChecker {
public:
    FontFamilyChecker(const wchar_t* family)
        : m_exists(false)
    {
        EnumFontFamilies(g_screenDC, family, enumFontFamProc, (LPARAM)this);
    }
    bool isSupported() const { return m_exists; }
private:
    bool m_exists;
    static int CALLBACK enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam);
};

class ValidFontFamilyFinder {
public:
    ValidFontFamilyFinder()
    {
        EnumFontFamilies(g_screenDC, 0, enumFontFamProc, (LPARAM)this);
    }
    const String& family() const { return m_family; }
private:
    String m_family;
    static int CALLBACK enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam);
};

class FixedSizeFontData: public RefCounted<FixedSizeFontData> {
public:
    LOGFONT m_font;
    OwnPtr<HFONT> m_hfont;
    TEXTMETRIC m_metrics;
    DWORD m_codePages;
    unsigned m_weight;
    bool m_italic;

    static PassRefPtr<FixedSizeFontData> create(const AtomicString& family, unsigned weight, bool italic);
private:
    FixedSizeFontData()
        : m_codePages(0)
        , m_weight(0)
        , m_italic(false)
    {
        memset(&m_font, 0, sizeof(m_font));
        memset(&m_metrics, 0, sizeof(m_metrics));
    }
};

struct FixedSizeFontDataKey {
    FixedSizeFontDataKey(const AtomicString& family = AtomicString(), unsigned weight = 0, bool italic = false)
        : m_family(family)
        , m_weight(weight)
        , m_italic(italic)
    {
    }

    FixedSizeFontDataKey(WTF::HashTableDeletedValueType) : m_weight(-2) { }
    bool isHashTableDeletedValue() const { return m_weight == -2; }

    bool operator==(const FixedSizeFontDataKey& other) const
    {
        return equalIgnoringCase(m_family, other.m_family)
            && m_weight == other.m_weight
            && m_italic == other.m_italic;
    }

    AtomicString m_family;
    unsigned m_weight;
    bool m_italic;
};

struct FixedSizeFontDataKeyHash {
    static unsigned hash(const FixedSizeFontDataKey& font)
    {
        unsigned hashCodes[] = {
            CaseFoldingHash::hash(font.m_family),
            font.m_weight,
            // static_cast<unsigned>(font.m_italic);
        };
        return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
    }

    static bool equal(const FixedSizeFontDataKey& a, const FixedSizeFontDataKey& b)
    {
        return a == b;
    }

    static const bool safeToCompareToEmptyOrDeleted = true;
};

struct FixedSizeFontDataKeyTraits : WTF::GenericHashTraits<FixedSizeFontDataKey> {
    static const bool emptyValueIsZero = true;
    static const FixedSizeFontDataKey& emptyValue()
    {
        DEFINE_STATIC_LOCAL(FixedSizeFontDataKey, key, (nullAtom));
        return key;
    }
    static void constructDeletedValue(FixedSizeFontDataKey& slot)
    {
        new (&slot) FixedSizeFontDataKey(WTF::HashTableDeletedValue);
    }
    static bool isDeletedValue(const FixedSizeFontDataKey& value)
    {
        return value.isHashTableDeletedValue();
    }
};

int CALLBACK FontFamilyChecker::enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam)
{
    ((FontFamilyChecker*)lParam)->m_exists = true;
    return 0;
}

int CALLBACK ValidFontFamilyFinder::enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam)
{
    if (lpelf->lfCharSet != SYMBOL_CHARSET) {
        ((ValidFontFamilyFinder*)lParam)->m_family = String(lpelf->lfFaceName);
        return 0;
    }
    return 1;
}

typedef Vector<FontFamilyCodePageInfo> KnownFonts;
static KnownFonts& knownFonts()
{
    static KnownFonts fonts;
    static bool firstTime = true;
    if (firstTime) {
        firstTime = false;
        if (FontPlatformData::isSongTiSupported())
            fonts.append(FontFamilyCodePageInfo(songTiStr, 936));
    }
    return fonts;
}

static String getDefaultFontFamily()
{
    if (FontFamilyChecker(L"Tahoma").isSupported())
        return String(L"Tahoma");

    bool good = false;
    String family;
    HKEY key;
    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SYSTEM\\GDI\\SysFnt", 0, 0, &key) == ERROR_SUCCESS) {
        DWORD maxlen, type;
        if (RegQueryValueEx(key, L"Nm", 0, &type, 0, &maxlen) == ERROR_SUCCESS && type == REG_SZ) {
            ++maxlen;
            if (wchar_t* buffer = new wchar_t[maxlen]) {
                if (RegQueryValueEx(key, L"Nm", 0, &type, (LPBYTE)buffer, &maxlen) == ERROR_SUCCESS) {
                    family = String(buffer, maxlen);
                    good = true;
                }
                delete[] buffer;
            }
        }
        RegCloseKey(key);
    }
    if (good)
        return family;

    return ValidFontFamilyFinder().family();
}

typedef HashMap<FixedSizeFontDataKey, RefPtr<FixedSizeFontData>, FixedSizeFontDataKeyHash, FixedSizeFontDataKeyTraits> FixedSizeFontCache;
FixedSizeFontCache g_fixedSizeFontCache;

PassRefPtr<FixedSizeFontData> FixedSizeFontData::create(const AtomicString& family, unsigned weight, bool italic)
{
    FixedSizeFontData* fontData = new FixedSizeFontData();

    fontData->m_weight = weight;
    fontData->m_italic = italic;

    LOGFONT& winFont = fontData->m_font;
    // The size here looks unusual.  The negative number is intentional.
    winFont.lfHeight = -72;
    winFont.lfWidth = 0;
    winFont.lfEscapement = 0;
    winFont.lfOrientation = 0;
    winFont.lfUnderline = false;
    winFont.lfStrikeOut = false;
    winFont.lfCharSet = DEFAULT_CHARSET;
    winFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
    winFont.lfQuality = CLEARTYPE_QUALITY; //DEFAULT_QUALITY;
    winFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
    winFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
    winFont.lfItalic = italic;
    winFont.lfWeight = FontPlatformData::adjustedGDIFontWeight(weight, family);

    int len = std::min(family.length(), (unsigned int)LF_FACESIZE - 1);
    wmemcpy(winFont.lfFaceName, family.characters(), len);
    winFont.lfFaceName[len] = L'\0';

    fontData->m_hfont = adoptPtr(CreateFontIndirect(&winFont));

    HGDIOBJ oldFont = SelectObject(g_screenDC, fontData->m_hfont.get());

    GetTextMetrics(g_screenDC, &fontData->m_metrics);

    if (IMLangFontLinkType* langFontLink = fontCache()->getFontLinkInterface()) {
        langFontLink->GetFontCodePages(g_screenDC, fontData->m_hfont.get(), &fontData->m_codePages);
        fontData->m_codePages |= FontPlatformData::getKnownFontCodePages(winFont.lfFaceName);
    }

    SelectObject(g_screenDC, oldFont);

    return adoptRef(fontData);
}

static PassRefPtr<FixedSizeFontData> createFixedSizeFontData(const AtomicString& family, unsigned weight, bool italic)
{
    FixedSizeFontDataKey key(family, weight, italic);
    FixedSizeFontCache::AddResult result = g_fixedSizeFontCache.add(key, RefPtr<FixedSizeFontData>());
    if (result.isNewEntry)
        result.iterator->value = FixedSizeFontData::create(family, weight, italic);

    return result.iterator->value;
}

static LONG toGDIFontWeight(FontWeight fontWeight)
{
    static LONG gdiFontWeights[] = {
        FW_THIN,        // FontWeight100
        FW_EXTRALIGHT,  // FontWeight200
        FW_LIGHT,       // FontWeight300
        FW_NORMAL,      // FontWeight400
        FW_MEDIUM,      // FontWeight500
        FW_SEMIBOLD,    // FontWeight600
        FW_BOLD,        // FontWeight700
        FW_EXTRABOLD,   // FontWeight800
        FW_HEAVY        // FontWeight900
    };
    return gdiFontWeights[fontWeight];
}

class FontPlatformPrivateData {
public:
    int m_reference;
    RefPtr<FixedSizeFontData> m_rootFontData;
    AtomicString m_family;
    FontDescription m_fontDescription;
    OwnPtr<HFONT> m_hfontScaled;
    int m_size;
    long m_fontScaledWidth;
    long m_fontScaledHeight;
    bool m_disabled;
    FontPlatformPrivateData(int size, unsigned weight)
        : m_reference(1)
        , m_family(FontPlatformData::defaultFontFamily())
        , m_size(size)
        , m_fontScaledWidth(0)
        , m_fontScaledHeight(0)
        , m_disabled(false)
    {
        m_rootFontData = createFixedSizeFontData(m_family, weight, false);
    }
    FontPlatformPrivateData(const FontDescription& fontDescription, const AtomicString& family)
        : m_reference(1)
        , m_size(fontDescription.computedPixelSize())
        , m_fontDescription(fontDescription)
        , m_family(family)
        , m_fontScaledWidth(0)
        , m_fontScaledHeight(0)
        , m_disabled(!fontDescription.specifiedSize())
    {
        m_rootFontData = FixedSizeFontData::create(family, toGDIFontWeight(fontDescription.weight()), fontDescription.italic());
    }
};

FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& desiredFamily, bool useDefaultFontIfNotPresent)
{
    String family(desiredFamily);
    if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family.charactersWithNullTermination().data()).isSupported()) {
        if (equalIgnoringCase(family, String(heiTiStr)) && isSongTiSupported())
            family = String(songTiStr);
        else if (useDefaultFontIfNotPresent)
            family = defaultFontFamily();
    }

    m_private = new FontPlatformPrivateData(fontDescription, family);
}

FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
{
    if (!size)
        m_private = 0;
    else
        m_private = new FontPlatformPrivateData((int)(size + 0.5), bold ? FW_BOLD : FW_NORMAL);
}

FontPlatformData::~FontPlatformData()
{
    if (isValid() && !--m_private->m_reference) {
        if (m_private->m_rootFontData->refCount() == 2) {
            FixedSizeFontDataKey key(m_private->m_family, m_private->m_rootFontData->m_weight, m_private->m_rootFontData->m_italic);
            g_fixedSizeFontCache.remove(key);
        }
        delete m_private;
    }
}

FontPlatformData& FontPlatformData::operator=(const FontPlatformData& o)
{
    if (isValid() && !--m_private->m_reference)
        delete m_private;

    if (m_private = o.m_private)
        ++m_private->m_reference;

    return *this;
}

HFONT FontPlatformData::hfont() const
{
    if (!isValid())
        return 0;

    if (m_private->m_disabled)
        return 0;

    if (!m_private->m_rootFontData->m_hfont)
        m_private->m_rootFontData->m_hfont = adoptPtr(CreateFontIndirect(&m_private->m_rootFontData->m_font));

    return m_private->m_rootFontData->m_hfont.get();
}

HFONT FontPlatformData::getScaledFontHandle(int height, int width) const
{
    if (!isValid() || m_private->m_disabled)
        return 0;

    if (!m_private->m_hfontScaled || m_private->m_fontScaledHeight != height || m_private->m_fontScaledWidth != width) {
        m_private->m_fontScaledHeight = height;
        m_private->m_fontScaledWidth = width;
        LOGFONT font = m_private->m_rootFontData->m_font;
        font.lfHeight = -height;
        font.lfWidth = width;
        m_private->m_hfontScaled = adoptPtr(CreateFontIndirect(&font));
    }

    return m_private->m_hfontScaled.get();
}

bool FontPlatformData::discardFontHandle()
{
    if (!isValid())
        return false;

    if (m_private->m_rootFontData->m_hfont) {
        m_private->m_rootFontData->m_hfont = nullptr;
        return true;
    }

    if (m_private->m_hfontScaled) {
        m_private->m_hfontScaled = nullptr;
        return true;
    }
    return false;
}

const TEXTMETRIC& FontPlatformData::metrics() const
{
    return m_private->m_rootFontData->m_metrics;
}

bool FontPlatformData::isSystemFont() const
{
    return false;
}

int FontPlatformData::size() const
{
    return m_private->m_size;
}

const FontDescription& FontPlatformData::fontDescription() const
{
    return m_private->m_fontDescription;
}

const AtomicString& FontPlatformData::family() const
{
    return m_private->m_family;
}

const LOGFONT& FontPlatformData::logFont() const
{
    return m_private->m_rootFontData->m_font;
}

bool FontPlatformData::isDisabled() const
{
    return !isValid() || m_private->m_disabled;
}

DWORD FontPlatformData::codePages() const
{
    return m_private->m_rootFontData->m_codePages;
}

bool FontPlatformData::isSongTiSupported()
{
    static bool exists = FontFamilyChecker(songTiStr).isSupported();
    return exists;
}

bool FontPlatformData::mapKnownFont(DWORD codePages, String& family)
{
    KnownFonts& fonts = knownFonts();
    for (KnownFonts::iterator i = fonts.begin(); i != fonts.end(); ++i) {
        if (i->codePages() & codePages) {
            family = i->m_family;
            return true;
        }
    }
    return false;
}

DWORD FontPlatformData::getKnownFontCodePages(const wchar_t* family)
{
    KnownFonts& fonts = knownFonts();
    for (KnownFonts::iterator i = fonts.begin(); i != fonts.end(); ++i) {
        if (equalIgnoringCase(i->m_family, String(family)))
            return i->codePages();
    }
    return 0;
}

const String& FontPlatformData::defaultFontFamily()
{
    static String family(getDefaultFontFamily());
    return family;
}

LONG FontPlatformData::adjustedGDIFontWeight(LONG gdiFontWeight, const String& family)
{
    static AtomicString lucidaStr("Lucida Grande");
    if (equalIgnoringCase(family, lucidaStr)) {
        if (gdiFontWeight == FW_NORMAL)
            return FW_MEDIUM;
        if (gdiFontWeight == FW_BOLD)
            return FW_SEMIBOLD;
    }
    return gdiFontWeight;
}

#ifndef NDEBUG
String FontPlatformData::description() const
{
    return String();
}
#endif

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.Storage;
using Newtonsoft.Json;

namespace LiPTT
{
    public class SettingProperty : INotifyPropertyChanged
    {
        public SettingProperty()
        {
            ConnectionSecurity = true;
            AlwaysAlive = false;
            LineSpaceDisabled = false;
            OpenShortUri = false;
            googleURLShortenerAPIKey = "AIzaSyCEcRFJD94zXZeab1yDSZ__SLBISmpPm6Y";
            Space = 0.5;
            FontSizePercent = 0.5;
            BoardTitleColor = Colors.White;
            color = Colors.White;
        }

        /// <summary>
        /// 圖片大小,預設70%
        /// </summary>
        public double Space
        {
            get
            {
                return space;
            }
            set
            {
                space = value;
                NotifyPropertyChanged("Space");
            }
        }

        /// <summary>
        /// 是否安全連線
        /// </summary>
        public bool? ConnectionSecurity
        {
            get
            {
                PTT ptt = Application.Current.Resources["PTT"] as PTT;
                return ptt.ConnectionSecurity;
            }
            set
            {
                if (value is bool b)
                {
                    PTT ptt = Application.Current.Resources["PTT"] as PTT;
                    ptt.ConnectionSecurity = b;
                    NotifyPropertyChanged("ConnectionSecurity");
                }
            }
        }

        /// <summary>
        /// 總是自動重新連線
        /// </summary>
        public bool AlwaysAlive
        {
            get
            {
                return alwaysAlive;
            }
            set
            {
                alwaysAlive = value;
                NotifyPropertyChanged("AlwaysAlive");
            }
        }

        /// <summary>
        /// 全螢幕選項
        /// </summary>
        public bool FullScreen
        {
            get
            {
                return fullScreen;
            }
            set
            {
                var app = Application.Current.Resources["ApplicationProperty"] as ApplicationProperty;
                fullScreen = value;
                app.FullScreen = fullScreen;
                NotifyPropertyChanged("FullScreen");
            }
        }

        /// <summary>
        /// 文字大小
        /// </summary>
        public double FontSizePercent
        {
            get
            {
                return fontSize;
            }
            set
            {
                fontSize = value;
                NotifyPropertyChanged("FontSizePercent");
            }
        }

        /// <summary>
        /// 行與行之間不要留空白
        /// </summary>
        public bool LineSpaceDisabled
        {
            get
            {
                return disabledlinespace;
            }
            set
            {
                disabledlinespace = value;
                NotifyPropertyChanged("LineSpaceDisabled");
            }
        }

        public bool OpenShortUri
        {
            get
            {
                return openshort;
            }
            set
            {
                openshort = value;
                NotifyPropertyChanged("OpenShortUri");
            }
        }

        public string GoogleURLShortenerAPIKey
        {
            get
            {
                return googleURLShortenerAPIKey;
            }
            set
            {
                googleURLShortenerAPIKey = value;
                NotifyPropertyChanged("GoogleURLShortenerAPIKey");
            }
        }

        public bool AutoLoad
        {
            get
            {
                return autoload;
            }
            set
            {
                autoload = value;
                NotifyPropertyChanged("AutoLoad");
            }
        }

        public Color TextColor
        {
            get
            {
                return color;
            }
            set
            {
                color = value;
                NotifyPropertyChanged("TextColor");
            }
        }

        public Color BoardTitleColor
        {
            get
            {
                return boardTitleColor;
            }
            set
            {
                boardTitleColor = value;
                NotifyPropertyChanged("BoardTitleColor");
            }
        }

        private bool alwaysAlive;
        private double space;
        private bool fullScreen;
        private double fontSize;
        private bool disabledlinespace;
        private bool openshort;
        private string googleURLShortenerAPIKey;
        private bool autoload;
        private Color color;
        private Color boardTitleColor;

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged([CallerMemberName]string propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    public static partial class LiPTT
    {
        private static void DefaultSetting()
        {
            var container = ApplicationData.Current.RoamingSettings.CreateContainer(SettingPropertyName, ApplicationDataCreateDisposition.Always);

            if (container != null)
            {
                SettingProperty Setting = Application.Current.Resources["SettingProperty"] as SettingProperty;
                container.Values["Setting"] = JsonConvert.SerializeObject(Setting);
            }
        }

        private static void LoadSetting()
        {
            var container = ApplicationData.Current.RoamingSettings.Containers[SettingPropertyName].Values;

            if (container != null && container["Setting"] is string json)
            {
                SettingProperty Setting = JsonConvert.DeserializeObject<SettingProperty>(json);
                Application.Current.Resources["SettingProperty"] = Setting;
            }
        }

        private static void SaveSetting()
        {
            var container = ApplicationData.Current.RoamingSettings.CreateContainer(SettingPropertyName, ApplicationDataCreateDisposition.Always);

            if (container != null)
            {
                SettingProperty Setting = Application.Current.Resources["SettingProperty"] as SettingProperty;
                container.Values["Setting"] = JsonConvert.SerializeObject(Setting);
            }
        }

        private const string SettingPropertyName = "SettingProperty";

    }
}


text:
package org.apache.flex.forks.batik.svggen;

import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;

import org.w3c.dom.Element;

/**
 * Utility class that converts an Arc2D object into
 * a corresponding SVG element, i.e., a path with an elliptical arc
 * and optionally lines..
 *
 * @author Thomas DeWeese
 * @version $Id: SVGArc.java 476924 2006-11-19 21:13:26Z dvholten $
 */
public class SVGArc extends SVGGraphicObjectConverter {

    /**
     * Line converter used for degenerate cases
     */
    private SVGLine svgLine;

    /**
     * Ellipse converter for 360 degree arcs.
     */
    private SVGEllipse svgEllipse;

    /**
     * @param generatorContext used to build Elements
     */
    public SVGArc(SVGGeneratorContext generatorContext) {
        super(generatorContext);
    }

    /**
     * @param arc the Arc2D object to be converted
     */
    public Element toSVG(Arc2D arc) {
        double ext    = arc.getAngleExtent();
        double width  = arc.getWidth();
        double height = arc.getHeight();

        if (width == 0 || height == 0) {
            Line2D line = new Line2D.Double
                (arc.getX(), arc.getY(),
                 arc.getX() + width,
                 arc.getY() + height);
            if (svgLine == null) {
                svgLine = new SVGLine(generatorContext);
            }
            return svgLine.toSVG(line);
        }

        if (ext >= 360 || ext <= -360) {
            Ellipse2D ellipse = new Ellipse2D.Double
                (arc.getX(), arc.getY(), width, height);
            if (svgEllipse == null) {
                svgEllipse = new SVGEllipse(generatorContext);
            }
            return svgEllipse.toSVG(ellipse);
        }

        Element svgPath = generatorContext.domFactory.createElementNS
            (SVG_NAMESPACE_URI, SVG_PATH_TAG);
        StringBuffer d = new StringBuffer( 64 );

        Point2D startPt = arc.getStartPoint();
        Point2D endPt   = arc.getEndPoint();
        int     type    = arc.getArcType();

        d.append(PATH_MOVE);
        d.append(doubleString(startPt.getX()));
        d.append(SPACE);
        d.append(doubleString(startPt.getY()));
        d.append(SPACE);

        d.append(PATH_ARC);
        d.append(doubleString(width / 2));
        d.append(SPACE);
        d.append(doubleString(height / 2));
        d.append(SPACE);
        d.append( '0' );  // no rotation with J2D arc.
        d.append(SPACE);
        if (ext > 0) {
            // CCW sweep case, ext > 0
            if (ext > 180)  d.append( '1' );  // use large arc.
            else            d.append( '0' );  // use small arc.
            d.append(SPACE);
            d.append( '0' );  // sweep ccw
        } else {
            // CW sweep case, ext < 0
            if (ext < -180)  d.append( '1' );  // use large arc.
            else             d.append( '0' );  // use small arc.
            d.append(SPACE);
            d.append( '1' );  // sweep cw
        }

        d.append(SPACE);
        d.append(doubleString(endPt.getX()));
        d.append(SPACE);
        d.append(doubleString(endPt.getY()));

        if (type == Arc2D.CHORD) {
            d.append(PATH_CLOSE);
        } else if (type == Arc2D.PIE) {
            double cx = arc.getX() + width / 2;
            double cy = arc.getY() + height / 2;
            d.append(PATH_LINE_TO);
            d.append(SPACE);
            d.append(doubleString(cx));
            d.append(SPACE);
            d.append(doubleString(cy));
            d.append(SPACE);
            d.append(PATH_CLOSE);
        }
        svgPath.setAttributeNS(null, SVG_D_ATTRIBUTE, d.toString());
        return svgPath;
    }
}


text:
Codify PHP
==========

[![Build Status](https://travis-ci.org/ralouphie/codify.svg?branch=master)](https://travis-ci.org/ralouphie/codify)
[![Coverage Status](https://coveralls.io/repos/ralouphie/codify/badge.png?branch=master)](https://coveralls.io/r/ralouphie/codify?branch=master)
[![Latest Stable Version](https://poser.pugx.org/ralouphie/codify/v/stable.png)](https://packagist.org/packages/ralouphie/codify)
[![Latest Unstable Version](https://poser.pugx.org/ralouphie/codify/v/unstable.png)](https://packagist.org/packages/ralouphie/codify)
[![License](https://poser.pugx.org/ralouphie/codify/license.png)](https://packagist.org/packages/ralouphie/codify)

A simple PHP package for saving and autoloading generated PHP files. It's useful when writing frameworks that generate and save code on the fly.

## Usage

```php
<?php

// Create a code store.
$store = new \Codify\Stores\Filesystem(
    'Some\\Name\\Space',
    'directory/to/save/code'
);

// Hook up code store to an autoloader and register it.
$autoloader = new \Codify\Autoloader($store);
$autoloader->register();

// Now you can save classes.
$class = 'Some\\Name\\Space\\Foo';
$store->save($class, 'namespace Some\\Name\\Space;
    class Foo {
        public function foo() { echo "foo"; }
    }
');

// And use the classes you save.
$instance = new $class;
$instance->foo(); // Outputs "foo".
```

## Dynamic Compilation

```php
<?php

$store = new \Codify\Stores\Filesystem(/* ... */);

// Create a compiled store that will generate code for missing classes
// under the code store's namespace.
$compiled_store = new CompiledStore($store, function ($class) {

    // Generate code.
    return $code_generated;
});

$autoloader = new \Codify\Autoloader($compiled_store);
$autoloader->register();

$missing_class = 'Some\\Name\\Space\\Bar';

// This will trigger the compiled store above.
$instance = new $missing_class;

// If the compile was successful, we can now use the object.
$instance->doSomething();

// To avoid fatal errors (compile skipped),
// you can check if the class exists first.
if (class_exists($missing_class)) {
    // Compile was successful!
} else {
    // The compile was skipped.
}

```


text:
package com.emc.ecs.management.sdk.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

@XmlRootElement(name = "base_urls")
public class BaseUrlList {

    private List<BaseUrl> baseUrls;

    public BaseUrlList() {
        super();
    }

    public BaseUrlList(List<BaseUrl> baseUrls) {
        super();
        this.baseUrls = baseUrls;
    }

    @XmlElement(name = "base_url")
    public List<BaseUrl> getBaseUrls() {
        return baseUrls;
    }

    public void setBaseUrls(List<BaseUrl> baseUrls) {
        this.baseUrls = baseUrls;
    }

}


text:
package sakuracloud

import (
	"context"
	"errors"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
	"github.com/sacloud/iaas-api-go"
	"github.com/sacloud/iaas-api-go/search"
	"github.com/sacloud/iaas-api-go/types"
)

func expandPrivateHostPlanID(ctx context.Context, d resourceValueGettable, client *APIClient, zone string) (types.ID, error) {
	op := iaas.NewPrivateHostPlanOp(client)
	searched, err := op.Find(ctx, zone, &iaas.FindCondition{
		Filter: search.Filter{
			search.Key("Class"): search.ExactMatch(d.Get("class").(string)),
		},
	})
	if err != nil {
		return types.ID(0), err
	}
	if searched.Count == 0 {
		return types.ID(0), errors.New("finding PrivateHostPlan is failed: plan is not found")
	}
	return searched.PrivateHostPlans[0].ID, nil
}

func expandPrivateHostCreateRequest(d *schema.ResourceData, planID types.ID) *iaas.PrivateHostCreateRequest {
	return &iaas.PrivateHostCreateRequest{
		Name:        d.Get("name").(string),
		Description: d.Get("description").(string),
		Tags:        expandTags(d),
		IconID:      expandSakuraCloudID(d, "icon_id"),
		PlanID:      planID,
	}
}

func expandPrivateHostUpdateRequest(d *schema.ResourceData) *iaas.PrivateHostUpdateRequest {
	return &iaas.PrivateHostUpdateRequest{
		Name:        d.Get("name").(string),
		Description: d.Get("description").(string),
		Tags:        expandTags(d),
		IconID:      expandSakuraCloudID(d, "icon_id"),
	}
}


text:
package org.zalando.stups.fullstop.jobs.utils;

import com.amazonaws.services.ec2.model.IpPermission;
import com.amazonaws.services.ec2.model.IpRange;
import com.github.jgonian.ipmath.Ipv4Range;
import com.github.jgonian.ipmath.Ipv6Range;

import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.IntStream;

import static java.util.Arrays.asList;

public final class Predicates {

    /**
     * https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces
     */
    private static final List<Ipv4Range> PRIVATE_IPV4_RANGES = asList(
            Ipv4Range.parseCidr("10.0.0.0/8"),
            Ipv4Range.parseCidr("172.16.0.0/12"),
            Ipv4Range.parseCidr("192.168.0.0/16"));

    /**
     * https://en.wikipedia.org/wiki/Unique_local_address
     */
    private static final Ipv6Range PRIVATE_IPV6_RANGE = Ipv6Range.parseCidr("fc00::/7");

    private Predicates() {
    }

    public static Predicate<IpPermission> securityGroupExposesNotAllowedPorts(final Set<Integer> allowedPorts) {
        return rule -> opensUnallowedPorts(rule, allowedPorts) && hasExternalSource(rule);
    }

    private static boolean hasExternalSource(final IpPermission rule) {
        final boolean hasExternalIpv4Range = rule.getIpv4Ranges().stream()
                .map(IpRange::getCidrIp)
                .map(Ipv4Range::parseCidr)
                .anyMatch(range -> PRIVATE_IPV4_RANGES.stream().noneMatch(privateRange -> privateRange.contains(range)));

        final boolean hasExternalIpv6Ranges = rule.getIpv6Ranges().stream()
                .map(com.amazonaws.services.ec2.model.Ipv6Range::getCidrIpv6)
                .map(Ipv6Range::parseCidr)
                .anyMatch(range -> !PRIVATE_IPV6_RANGE.contains(range));

        return hasExternalIpv4Range || hasExternalIpv6Ranges;
    }

    @SuppressWarnings({"SimplifiableIfStatement"})
    private static boolean opensUnallowedPorts(final IpPermission rule, final Set<Integer> allowedPorts) {
        final String protocol = rule.getIpProtocol();
        if (protocol != null) {
            // match logical names as well as protocol numbers
            switch (protocol.toLowerCase()) {
                case "tcp":
                case "6":
                case "udp":
                case "17":
                    // check port ranges
                    break;

                case "icmp":
                case "1":
                case "icmpv6":
                case "58":
                    return false;

                default:
                    // From http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html
                    // [...] specifying -1 or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6)
                    // allows traffic on all ports, regardless of any port range you specify. [...]
                    return true;
            }
        }

        final Integer fromPort = rule.getFromPort();
        final Integer toPort = rule.getToPort();

        // No port range means: All traffic
        if (fromPort == null || toPort == null) {
            return true;
        }

        // Is there at least one non-allowed port?
        return IntStream.rangeClosed(fromPort, toPort).anyMatch(port -> !allowedPorts.contains(port));
    }
}


text:
import _helper
import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

_DB_DIR = os.path.join(_helper.SITECONFIG_DIR, 'db/')
try:
    os.mkdir(_DB_DIR)
except OSError:
    pass

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(_DB_DIR, 'stage.sqlite3'),
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

MEDIA_ROOT  = '/home/<PROJECT_USERNAME>/public_html/media/'
STATIC_ROOT = '/home/<PROJECT_USERNAME>/public_html/static/'

MEDIA_URL   = 'http://<PROJECT_USERNAME>.twistsystems.com/media/'
STATIC_URL  = 'http://<PROJECT_USERNAME>.twistsystems.com/static/'


text:
package com.nd.android.u.square.business.parser;

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

import android.util.Log;

import com.nd.android.u.square.constant.ContactConst;

public class MusicCommitJsonParser {
	public static int parseListenerCount(String json) {
		JSONObject jsonObject;
		int count;

		try {
			jsonObject = new JSONObject(json);
			count = jsonObject.getInt("count");
		} catch (JSONException e) {
			// TODO: handle exception
			Log.e(ContactConst.TAG, "error: parseListenerCount");
			return -1;
		}

		return count;
	}
}


text:
package net.wizardsoflua.lua.classes.event;

import com.google.auto.service.AutoService;

import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
import net.sandius.rembulan.Table;
import net.wizardsoflua.annotation.GenerateLuaClassTable;
import net.wizardsoflua.annotation.GenerateLuaDoc;
import net.wizardsoflua.annotation.GenerateLuaInstanceTable;
import net.wizardsoflua.extension.api.inject.Resource;
import net.wizardsoflua.extension.spell.api.resource.Injector;
import net.wizardsoflua.extension.spell.api.resource.LuaConverters;
import net.wizardsoflua.extension.spell.spi.LuaConverter;
import net.wizardsoflua.lua.classes.BasicLuaClass;
import net.wizardsoflua.lua.classes.LuaClassAttributes;
import net.wizardsoflua.lua.classes.common.Delegator;

/**
 * The UseItemStopEvent class is fired when a [Mob](/modules/Mob)
 * or [Player](/modules/Player) stops using an [Item](/modules/Item) without
 * [finishing](/modules/UseItemStopEvent) it. Currently the only vanilla item that is affected by
 * canceling this event is the bow. If this event is canceled the bow does not shoot an arrow.
 *
 * #### Example
 *
 * Print a message when the player stops eating a golden apple.
 *
 *
 * Events.on('UseItemStopEvent'):call(function(event)
 *   if event.item.id == 'golden_apple' then
 *     print('Are you not hungry?')
 *   end
 * end)
 *
 */
@AutoService(LuaConverter.class)
@LuaClassAttributes(name = UseItemStopEventClass.NAME, superClass = UseItemEventClass.class)
@GenerateLuaClassTable(instance = UseItemStopEventClass.Instance.class)
@GenerateLuaDoc(subtitle = "When an Entity Stops Using an Item", type = EventClass.TYPE)
public final class UseItemStopEventClass extends
    BasicLuaClass<LivingEntityUseItemEvent.Stop, UseItemStopEventClass.Instance<LivingEntityUseItemEvent.Stop>> {
  public static final String NAME = "UseItemStopEvent";
  @Resource
  private LuaConverters converters;
  @Resource
  private Injector injector;

  @Override
  protected Table createRawTable() {
    return new UseItemStopEventClassTable<>(this, converters);
  }

  @Override
  protected Delegator<Instance<LivingEntityUseItemEvent.Stop>> toLuaInstance(
      LivingEntityUseItemEvent.Stop javaInstance) {
    return new UseItemStopEventClassInstanceTable<>(
        new Instance<>(javaInstance, getName(), injector), getTable(), converters);
  }

  @GenerateLuaInstanceTable
  public static class Instance<D extends LivingEntityUseItemEvent.Stop>
      extends UseItemEventClass.Instance<D> {
    public Instance(D delegate, String name, Injector injector) {
      super(delegate, name, injector);
    }
  }
}


text:
"""Benchmark script for TensorFlow.

See the README for more information.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from absl import app
from absl import flags as absl_flags
import tensorflow as tf

import benchmark_cnn
import cnn_util
import flags
import mlperf
from cnn_util import log_fn

flags.define_flags()
for name in flags.param_specs.keys():
  absl_flags.declare_key_flag(name)

absl_flags.DEFINE_boolean(
    'ml_perf_compliance_logging', False,
    'Print logs required to be compliant with MLPerf. If set, must clone the '
    'MLPerf training repo https://github.com/mlperf/training and add '
    'https://github.com/mlperf/training/tree/master/compliance to the '
    'PYTHONPATH')

def main(positional_arguments):
  # Command-line arguments like '--distortions False' are equivalent to
  # '--distortions=True False', where False is a positional argument. To prevent
  # this from silently running with distortions, we do not allow positional
  # arguments.
  assert len(positional_arguments) >= 1
  if len(positional_arguments) > 1:
    raise ValueError('Received unknown positional arguments: %s'
                     % positional_arguments[1:])

  params = benchmark_cnn.make_params_from_flags()
  with mlperf.mlperf_logger(absl_flags.FLAGS.ml_perf_compliance_logging,
                            params.model):
    params = benchmark_cnn.setup(params)
    bench = benchmark_cnn.BenchmarkCNN(params)

    tfversion = cnn_util.tensorflow_version_tuple()
    log_fn('TensorFlow:  %i.%i' % (tfversion[0], tfversion[1]))

    bench.print_info()
    bench.run()

if __name__ == '__main__':
  app.run(main)  # Raises error on invalid flags, unlike tf.app.run()


text:
package com.github.nyrkovalex.ironadmin.core.pages;

import com.github.nyrkovalex.ironadmin.core.utils.IronContracts;
import com.github.nyrkovalex.ironadmin.core.utils.IronStrings;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;

public class PropertyDefinition {
    private final String name;
    private final String displayName;

    public PropertyDefinition(@NotNull String name) {
        this(name, IronStrings.camelCaseToSentence(name));
    }

    public PropertyDefinition(@NotNull String name, @NotNull String displayName) {
        IronContracts.notNullOrEmpty(name, "name", displayName, "displayName");

        this.name = name;
        this.displayName = displayName;
    }

    public String getName() {
        return name;
    }

    public String getDisplayName() {
        return displayName;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 71 * hash + Objects.hashCode(this.name);
        hash = 71 * hash + Objects.hashCode(this.displayName);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PropertyDefinition other = (PropertyDefinition) obj;
        return Objects.equals(this.name, other.name)
                && Objects.equals(this.displayName, other.displayName);
    }

}


text:
package com.hazelcast.transaction;

import com.hazelcast.config.SplitBrainProtectionConfig;
import com.hazelcast.multimap.BaseMultiMap;
import com.hazelcast.multimap.MultiMap;

import java.util.Collection;

/**
 * Transactional implementation of {@link BaseMultiMap}.
 * <p>
 * Supports split brain protection {@link SplitBrainProtectionConfig} since 3.10 in
 * cluster versions 3.10 and higher.
 *
 * @param <K> type of the multimap key
 * @param <V> type of the multimap value
 * @see BaseMultiMap
 * @see MultiMap
 */
public interface TransactionalMultiMap<K, V> extends BaseMultiMap<K, V>, TransactionalObject {

    /**
     * {@inheritDoc}
     */
    @Override
    boolean put(K key, V value);

    /**
     * {@inheritDoc}
     */
    @Override
    Collection<V> get(K key);

    /**
     * {@inheritDoc}
     */
    @Override
    boolean remove(Object key, Object value);

    /**
     * {@inheritDoc}
     */
    @Override
    Collection<V> remove(Object key);

    /**
     * {@inheritDoc}
     */
    @Override
    int valueCount(K key);

    /**
     * {@inheritDoc}
     */
    @Override
    int size();
}


text:
<?php

/**
 * Base class that represents a query for the 'product_download' table.
 *
 *
 *
 * @method     Oops_Db_ProductDownloadQuery orderByIdProductDownload($order = Criteria::ASC) Order by the id_product_download column
 * @method     Oops_Db_ProductDownloadQuery orderByIdProduct($order = Criteria::ASC) Order by the id_product column
 * @method     Oops_Db_ProductDownloadQuery orderByDisplayFilename($order = Criteria::ASC) Order by the display_filename column
 * @method     Oops_Db_ProductDownloadQuery orderByPhysicallyFilename($order = Criteria::ASC) Order by the physically_filename column
 * @method     Oops_Db_ProductDownloadQuery orderByDateDeposit($order = Criteria::ASC) Order by the date_deposit column
 * @method     Oops_Db_ProductDownloadQuery orderByDateExpiration($order = Criteria::ASC) Order by the date_expiration column
 * @method     Oops_Db_ProductDownloadQuery orderByNbDaysAccessible($order = Criteria::ASC) Order by the nb_days_accessible column
 * @method     Oops_Db_ProductDownloadQuery orderByNbDownloadable($order = Criteria::ASC) Order by the nb_downloadable column
 * @method     Oops_Db_ProductDownloadQuery orderByActive($order = Criteria::ASC) Order by the active column
 *
 * @method     Oops_Db_ProductDownloadQuery groupByIdProductDownload() Group by the id_product_download column
 * @method     Oops_Db_ProductDownloadQuery groupByIdProduct() Group by the id_product column
 * @method     Oops_Db_ProductDownloadQuery groupByDisplayFilename() Group by the display_filename column
 * @method     Oops_Db_ProductDownloadQuery groupByPhysicallyFilename() Group by the physically_filename column
 * @method     Oops_Db_ProductDownloadQuery groupByDateDeposit() Group by the date_deposit column
 * @method     Oops_Db_ProductDownloadQuery groupByDateExpiration() Group by the date_expiration column
 * @method     Oops_Db_ProductDownloadQuery groupByNbDaysAccessible() Group by the nb_days_accessible column
 * @method     Oops_Db_ProductDownloadQuery groupByNbDownloadable() Group by the nb_downloadable column
 * @method     Oops_Db_ProductDownloadQuery groupByActive() Group by the active column
 *
 * @method     Oops_Db_ProductDownloadQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method     Oops_Db_ProductDownloadQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method     Oops_Db_ProductDownloadQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method     Oops_Db_ProductDownload findOne(PropelPDO $con = null) Return the first Oops_Db_ProductDownload matching the query
 * @method     Oops_Db_ProductDownload findOneOrCreate(PropelPDO $con = null) Return the first Oops_Db_ProductDownload matching the query, or a new Oops_Db_ProductDownload object populated from the query conditions when no match is found
 *
 * @method     Oops_Db_ProductDownload findOneByIdProductDownload(int $id_product_download) Return the first Oops_Db_ProductDownload filtered by the id_product_download column
 * @method     Oops_Db_ProductDownload findOneByIdProduct(int $id_product) Return the first Oops_Db_ProductDownload filtered by the id_product column
 * @method     Oops_Db_ProductDownload findOneByDisplayFilename(string $display_filename) Return the first Oops_Db_ProductDownload filtered by the display_filename column
 * @method     Oops_Db_ProductDownload findOneByPhysicallyFilename(string $physically_filename) Return the first Oops_Db_ProductDownload filtered by the physically_filename column
 * @method     Oops_Db_ProductDownload findOneByDateDeposit(string $date_deposit) Return the first Oops_Db_ProductDownload filtered by the date_deposit column
 * @method     Oops_Db_ProductDownload findOneByDateExpiration(string $date_expiration) Return the first Oops_Db_ProductDownload filtered by the date_expiration column
 * @method     Oops_Db_ProductDownload findOneByNbDaysAccessible(int $nb_days_accessible) Return the first Oops_Db_ProductDownload filtered by the nb_days_accessible column
 * @method     Oops_Db_ProductDownload findOneByNbDownloadable(int $nb_downloadable) Return the first Oops_Db_ProductDownload filtered by the nb_downloadable column
 * @method     Oops_Db_ProductDownload findOneByActive(boolean $active) Return the first Oops_Db_ProductDownload filtered by the active column
 *
 * @method     array findByIdProductDownload(int $id_product_download) Return Oops_Db_ProductDownload objects filtered by the id_product_download column
 * @method     array findByIdProduct(int $id_product) Return Oops_Db_ProductDownload objects filtered by the id_product column
 * @method     array findByDisplayFilename(string $display_filename) Return Oops_Db_ProductDownload objects filtered by the display_filename column
 * @method     array findByPhysicallyFilename(string $physically_filename) Return Oops_Db_ProductDownload objects filtered by the physically_filename column
 * @method     array findByDateDeposit(string $date_deposit) Return Oops_Db_ProductDownload objects filtered by the date_deposit column
 * @method     array findByDateExpiration(string $date_expiration) Return Oops_Db_ProductDownload objects filtered by the date_expiration column
 * @method     array findByNbDaysAccessible(int $nb_days_accessible) Return Oops_Db_ProductDownload objects filtered by the nb_days_accessible column
 * @method     array findByNbDownloadable(int $nb_downloadable) Return Oops_Db_ProductDownload objects filtered by the nb_downloadable column
 * @method     array findByActive(boolean $active) Return Oops_Db_ProductDownload objects filtered by the active column
 *
 * @package    propel.generator.prestashop.om
 */
abstract class Oops_Db_Propel_ProductDownloadQuery extends ModelCriteria
{

	/**
	 * Initializes internal state of Oops_Db_Propel_ProductDownloadQuery object.
	 *
	 * @param     string $dbName The dabase name
	 * @param     string $modelName The phpName of a model, e.g. 'Book'
	 * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
	 */
	public function __construct($dbName = 'prestashop', $modelName = 'Oops_Db_ProductDownload', $modelAlias = null)
	{
		parent::__construct($dbName, $modelName, $modelAlias);
	}

	/**
	 * Returns a new Oops_Db_ProductDownloadQuery object.
	 *
	 * @param     string $modelAlias The alias of a model in the query
	 * @param     Criteria $criteria Optional Criteria to build the query from
	 *
	 * @return    Oops_Db_ProductDownloadQuery
	 */
	public static function create($modelAlias = null, $criteria = null)
	{
		if ($criteria instanceof Oops_Db_ProductDownloadQuery) {
			return $criteria;
		}
		$query = new Oops_Db_ProductDownloadQuery();
		if (null !== $modelAlias) {
			$query->setModelAlias($modelAlias);
		}
		if ($criteria instanceof Criteria) {
			$query->mergeWith($criteria);
		}
		return $query;
	}

	/**
	 * Find object by primary key.
	 * Propel uses the instance pool to skip the database if the object exists.
	 * Go fast if the query is untouched.
	 *
	 *
	 * $obj  = $c->findPk(12, $con);
	 *
	 *
	 * @param     mixed $key Primary key to use for the query
	 * @param     PropelPDO $con an optional connection object
	 *
	 * @return    Oops_Db_ProductDownload|array|mixed the result, formatted by the current formatter
	 */
	public function findPk($key, $con = null)
	{
		if ($key === null) {
			return null;
		}
		if ((null !== ($obj = Oops_Db_ProductDownloadPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
			// the object is alredy in the instance pool
			return $obj;
		}
		if ($con === null) {
			$con = Propel::getConnection(Oops_Db_ProductDownloadPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}
		$this->basePreSelect($con);
		if ($this->formatter || $this->modelAlias || $this->with || $this->select
		 || $this->selectColumns || $this->asColumns || $this->selectModifiers
		 || $this->map || $this->having || $this->joins) {
			return $this->findPkComplex($key, $con);
		} else {
			return $this->findPkSimple($key, $con);
		}
	}

	/**
	 * Find object by primary key using raw SQL to go fast.
	 * Bypass doSelect() and the object formatter by using generated code.
	 *
	 * @param     mixed $key Primary key to use for the query
	 * @param     PropelPDO $con A connection object
	 *
	 * @return    Oops_Db_ProductDownload A model object, or null if the key is not found
	 */
	protected function findPkSimple($key, $con)
	{
		$sql = 'SELECT `ID_PRODUCT_DOWNLOAD`, `ID_PRODUCT`, `DISPLAY_FILENAME`, `PHYSICALLY_FILENAME`, `DATE_DEPOSIT`, `DATE_EXPIRATION`, `NB_DAYS_ACCESSIBLE`, `NB_DOWNLOADABLE`, `ACTIVE` FROM `' . _DB_PREFIX_ . 'product_download` WHERE `ID_PRODUCT_DOWNLOAD` = :p0';
		try {
			$stmt = $con->prepare($sql);
			$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
			$stmt->execute();
		} catch (Exception $e) {
			Propel::log($e->getMessage(), Propel::LOG_ERR);
			throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
		}
		$obj = null;
		if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$obj = new Oops_Db_ProductDownload();
			$obj->hydrate($row);
			Oops_Db_ProductDownloadPeer::addInstanceToPool($obj, (string) $row[0]);
		}
		$stmt->closeCursor();

		return $obj;
	}

	/**
	 * Find object by primary key.
	 *
	 * @param     mixed $key Primary key to use for the query
	 * @param     PropelPDO $con A connection object
	 *
	 * @return    Oops_Db_ProductDownload|array|mixed the result, formatted by the current formatter
	 */
	protected function findPkComplex($key, $con)
	{
		// As the query uses a PK condition, no limit(1) is necessary.
		$criteria = $this->isKeepQuery() ? clone $this : $this;
		$stmt = $criteria
			->filterByPrimaryKey($key)
			->doSelect($con);
		return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
	}

	/**
	 * Find objects by primary key
	 *
	 * $objs = $c->findPks(array(12, 56, 832), $con);
	 *
	 * @param     array $keys Primary keys to use for the query
	 * @param     PropelPDO $con an optional connection object
	 *
	 * @return    PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
	 */
	public function findPks($keys, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
		}
		$this->basePreSelect($con);
		$criteria = $this->isKeepQuery() ? clone $this : $this;
		$stmt = $criteria
			->filterByPrimaryKeys($keys)
			->doSelect($con);
		return $criteria->getFormatter()->init($criteria)->format($stmt);
	}

	/**
	 * Filter the query by primary key
	 *
	 * @param     mixed $key Primary key to use for the query
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByPrimaryKey($key)
	{
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT_DOWNLOAD, $key, Criteria::EQUAL);
	}

	/**
	 * Filter the query by a list of primary keys
	 *
	 * @param     array $keys The list of primary key to use for the query
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByPrimaryKeys($keys)
	{
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT_DOWNLOAD, $keys, Criteria::IN);
	}

	/**
	 * Filter the query on the id_product_download column
	 *
	 * Example usage:
	 *
	 * $query->filterByIdProductDownload(1234); // WHERE id_product_download = 1234
	 * $query->filterByIdProductDownload(array(12, 34)); // WHERE id_product_download IN (12, 34)
	 * $query->filterByIdProductDownload(array('min' => 12)); // WHERE id_product_download > 12
	 *
	 *
	 * @param     mixed $idProductDownload The value to use as filter.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByIdProductDownload($idProductDownload = null, $comparison = null)
	{
		if (is_array($idProductDownload) && null === $comparison) {
			$comparison = Criteria::IN;
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT_DOWNLOAD, $idProductDownload, $comparison);
	}

	/**
	 * Filter the query on the id_product column
	 *
	 * Example usage:
	 *
	 * $query->filterByIdProduct(1234); // WHERE id_product = 1234
	 * $query->filterByIdProduct(array(12, 34)); // WHERE id_product IN (12, 34)
	 * $query->filterByIdProduct(array('min' => 12)); // WHERE id_product > 12
	 *
	 *
	 * @param     mixed $idProduct The value to use as filter.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByIdProduct($idProduct = null, $comparison = null)
	{
		if (is_array($idProduct)) {
			$useMinMax = false;
			if (isset($idProduct['min'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT, $idProduct['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($idProduct['max'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT, $idProduct['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT, $idProduct, $comparison);
	}

	/**
	 * Filter the query on the display_filename column
	 *
	 * Example usage:
	 *
	 * $query->filterByDisplayFilename('fooValue');   // WHERE display_filename = 'fooValue'
	 * $query->filterByDisplayFilename('%fooValue%'); // WHERE display_filename LIKE '%fooValue%'
	 *
	 *
	 * @param     string $displayFilename The value to use as filter.
	 *              Accepts wildcards (* and % trigger a LIKE)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByDisplayFilename($displayFilename = null, $comparison = null)
	{
		if (null === $comparison) {
			if (is_array($displayFilename)) {
				$comparison = Criteria::IN;
			} elseif (preg_match('/[\%\*]/', $displayFilename)) {
				$displayFilename = str_replace('*', '%', $displayFilename);
				$comparison = Criteria::LIKE;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::DISPLAY_FILENAME, $displayFilename, $comparison);
	}

	/**
	 * Filter the query on the physically_filename column
	 *
	 * Example usage:
	 *
	 * $query->filterByPhysicallyFilename('fooValue');   // WHERE physically_filename = 'fooValue'
	 * $query->filterByPhysicallyFilename('%fooValue%'); // WHERE physically_filename LIKE '%fooValue%'
	 *
	 *
	 * @param     string $physicallyFilename The value to use as filter.
	 *              Accepts wildcards (* and % trigger a LIKE)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByPhysicallyFilename($physicallyFilename = null, $comparison = null)
	{
		if (null === $comparison) {
			if (is_array($physicallyFilename)) {
				$comparison = Criteria::IN;
			} elseif (preg_match('/[\%\*]/', $physicallyFilename)) {
				$physicallyFilename = str_replace('*', '%', $physicallyFilename);
				$comparison = Criteria::LIKE;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::PHYSICALLY_FILENAME, $physicallyFilename, $comparison);
	}

	/**
	 * Filter the query on the date_deposit column
	 *
	 * Example usage:
	 *
	 * $query->filterByDateDeposit('2011-03-14'); // WHERE date_deposit = '2011-03-14'
	 * $query->filterByDateDeposit('now'); // WHERE date_deposit = '2011-03-14'
	 * $query->filterByDateDeposit(array('max' => 'yesterday')); // WHERE date_deposit > '2011-03-13'
	 *
	 *
	 * @param     mixed $dateDeposit The value to use as filter.
	 *              Values can be integers (unix timestamps), DateTime objects, or strings.
	 *              Empty strings are treated as NULL.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByDateDeposit($dateDeposit = null, $comparison = null)
	{
		if (is_array($dateDeposit)) {
			$useMinMax = false;
			if (isset($dateDeposit['min'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_DEPOSIT, $dateDeposit['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($dateDeposit['max'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_DEPOSIT, $dateDeposit['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_DEPOSIT, $dateDeposit, $comparison);
	}

	/**
	 * Filter the query on the date_expiration column
	 *
	 * Example usage:
	 *
	 * $query->filterByDateExpiration('2011-03-14'); // WHERE date_expiration = '2011-03-14'
	 * $query->filterByDateExpiration('now'); // WHERE date_expiration = '2011-03-14'
	 * $query->filterByDateExpiration(array('max' => 'yesterday')); // WHERE date_expiration > '2011-03-13'
	 *
	 *
	 * @param     mixed $dateExpiration The value to use as filter.
	 *              Values can be integers (unix timestamps), DateTime objects, or strings.
	 *              Empty strings are treated as NULL.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByDateExpiration($dateExpiration = null, $comparison = null)
	{
		if (is_array($dateExpiration)) {
			$useMinMax = false;
			if (isset($dateExpiration['min'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_EXPIRATION, $dateExpiration['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($dateExpiration['max'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_EXPIRATION, $dateExpiration['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::DATE_EXPIRATION, $dateExpiration, $comparison);
	}

	/**
	 * Filter the query on the nb_days_accessible column
	 *
	 * Example usage:
	 *
	 * $query->filterByNbDaysAccessible(1234); // WHERE nb_days_accessible = 1234
	 * $query->filterByNbDaysAccessible(array(12, 34)); // WHERE nb_days_accessible IN (12, 34)
	 * $query->filterByNbDaysAccessible(array('min' => 12)); // WHERE nb_days_accessible > 12
	 *
	 *
	 * @param     mixed $nbDaysAccessible The value to use as filter.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByNbDaysAccessible($nbDaysAccessible = null, $comparison = null)
	{
		if (is_array($nbDaysAccessible)) {
			$useMinMax = false;
			if (isset($nbDaysAccessible['min'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DAYS_ACCESSIBLE, $nbDaysAccessible['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($nbDaysAccessible['max'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DAYS_ACCESSIBLE, $nbDaysAccessible['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DAYS_ACCESSIBLE, $nbDaysAccessible, $comparison);
	}

	/**
	 * Filter the query on the nb_downloadable column
	 *
	 * Example usage:
	 *
	 * $query->filterByNbDownloadable(1234); // WHERE nb_downloadable = 1234
	 * $query->filterByNbDownloadable(array(12, 34)); // WHERE nb_downloadable IN (12, 34)
	 * $query->filterByNbDownloadable(array('min' => 12)); // WHERE nb_downloadable > 12
	 *
	 *
	 * @param     mixed $nbDownloadable The value to use as filter.
	 *              Use scalar values for equality.
	 *              Use array values for in_array() equivalent.
	 *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByNbDownloadable($nbDownloadable = null, $comparison = null)
	{
		if (is_array($nbDownloadable)) {
			$useMinMax = false;
			if (isset($nbDownloadable['min'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DOWNLOADABLE, $nbDownloadable['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($nbDownloadable['max'])) {
				$this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DOWNLOADABLE, $nbDownloadable['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::NB_DOWNLOADABLE, $nbDownloadable, $comparison);
	}

	/**
	 * Filter the query on the active column
	 *
	 * Example usage:
	 *
	 * $query->filterByActive(true); // WHERE active = true
	 * $query->filterByActive('yes'); // WHERE active = true
	 *
	 *
	 * @param     boolean|string $active The value to use as filter.
	 *              Non-boolean arguments are converted using the following rules:
	 *                * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
	 *                * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
	 *              Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function filterByActive($active = null, $comparison = null)
	{
		if (is_string($active)) {
			$active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
		}
		return $this->addUsingAlias(Oops_Db_ProductDownloadPeer::ACTIVE, $active, $comparison);
	}

	/**
	 * Exclude object from result
	 *
	 * @param     Oops_Db_ProductDownload $productDownload Object to remove from the list of results
	 *
	 * @return    Oops_Db_ProductDownloadQuery The current query, for fluid interface
	 */
	public function prune($productDownload = null)
	{
		if ($productDownload) {
			$this->addUsingAlias(Oops_Db_ProductDownloadPeer::ID_PRODUCT_DOWNLOAD, $productDownload->getIdProductDownload(), Criteria::NOT_EQUAL);
		}

		return $this;
	}

} // Oops_Db_Propel_ProductDownloadQuery


text:
package seedu.address.logic;

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

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

import org.junit.Before;
import org.junit.Test;

public class ListElementPointerTest {
    private static final String FIRST_ELEMENT = "first";
    private static final String SECOND_ELEMENT = "second";
    private List<String> pointerElements;
    private ListElementPointer pointer;

    @Before
    public void setUp() {
        pointerElements = new ArrayList<>();
        pointerElements.add(FIRST_ELEMENT);
        pointerElements.add(SECOND_ELEMENT);
    }

    @Test
    public void emptyList() {
        pointer = new ListElementPointer(new ArrayList<>());
        assertCurrentFailure();
        assertPreviousFailure();
        assertNextFailure();

        pointer.add(FIRST_ELEMENT);
        assertNextSuccess(FIRST_ELEMENT);
    }

    @Test
    public void singleElementList() {
        List<String> list = new ArrayList<>();
        list.add(FIRST_ELEMENT);
        pointer = new ListElementPointer(list);

        assertCurrentSuccess(FIRST_ELEMENT);
        assertPreviousFailure();
        assertCurrentSuccess(FIRST_ELEMENT);
        assertNextFailure();
        assertCurrentSuccess(FIRST_ELEMENT);

        pointer.add(SECOND_ELEMENT);
        assertNextSuccess(SECOND_ELEMENT);
    }

    @Test
    public void multipleElementsList() {
        pointer = new ListElementPointer(pointerElements);
        String thirdElement = "third";
        pointer.add(thirdElement);

        assertCurrentSuccess(SECOND_ELEMENT);

        assertNextSuccess(thirdElement);
        assertNextFailure();

        assertPreviousSuccess(SECOND_ELEMENT);
        assertPreviousSuccess(FIRST_ELEMENT);
        assertPreviousFailure();
    }

    @Test
    public void equals() {
        ListElementPointer firstPointer = new ListElementPointer(pointerElements);

        // same object -> returns true
        assertTrue(firstPointer.equals(firstPointer));

        // same values -> returns true
        ListElementPointer firstPointerCopy = new ListElementPointer(pointerElements);
        assertTrue(firstPointer.equals(firstPointerCopy));

        // different types -> returns false
        assertFalse(firstPointer.equals(1));

        // null -> returns false
        assertFalse(firstPointer.equals(null));

        // different elements -> returns false
        ListElementPointer differentElementPointer = new ListElementPointer(Collections.singletonList(SECOND_ELEMENT));
        assertFalse(firstPointer.equals(differentElementPointer));

        // different index -> returns false
        firstPointerCopy.previous();
        assertFalse(firstPointer.equals(firstPointerCopy));
    }

    /**
     * Asserts that {@code pointer#hasNext()} returns true and the return value
     * of {@code pointer#next()} equals to {@code element}.
     */
    private void assertNextSuccess(String element) {
        assertTrue(pointer.hasNext());
        assertEquals(element, pointer.next());
    }

    /**
     * Asserts that {@code pointer#hasPrevious()} returns true and the return value
     * of {@code pointer#previous()} equals to {@code element}.
     */
    private void assertPreviousSuccess(String element) {
        assertTrue(pointer.hasPrevious());
        assertEquals(element, pointer.previous());
    }

    /**
     * Asserts that {@code pointer#hasCurrent()} returns true and the return value
     * of {@code pointer#current()} equals to {@code element}.
     */
    private void assertCurrentSuccess(String element) {
        assertTrue(pointer.hasCurrent());
        assertEquals(element, pointer.current());
    }

    /**
     * Asserts that {@code pointer#hasNext()} returns false and the following
     * {@code pointer#next()} call throws {@code NoSuchElementException}.
     */
    private void assertNextFailure() {
        assertFalse(pointer.hasNext());
        try {
            pointer.next();
            fail("The expected NoSuchElementException was not thrown");
        } catch (NoSuchElementException e) {
            // expected exception thrown
        }
    }

    /**
     * Asserts that {@code pointer#hasPrevious()} returns false and the following
     * {@code pointer#previous()} call throws {@code NoSuchElementException}.
     */
    private void assertPreviousFailure() {
        assertFalse(pointer.hasPrevious());
        try {
            pointer.previous();
            fail("The expected NoSuchElementException was not thrown");
        } catch (NoSuchElementException e) {
            // expected exception thrown
        }
    }

    /**
     * Asserts that {@code pointer#hasCurrent()} returns false and the following
     * {@code pointer#current()} call throws {@code NoSuchElementException}.
     */
    private void assertCurrentFailure() {
        assertFalse(pointer.hasCurrent());
        try {
            pointer.current();
            fail("The expected NoSuchElementException was not thrown");
        } catch (NoSuchElementException e) {
            // expected exception thrown
        }
    }
}


text:
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Atlas::PathResolver do
  let(:root) { Pathname.new(Dir.mktmpdir) }

  before do
    # Create a directory structure like this:
    #
    # |- ./fallback
    # | |- both.txt
    # | |- fallback.txt
    # | |- ./inner-both
    # | | |- both.txt
    # | | |- fallback.txt
    # | |- ./inner-fallback
    # | | |- fallback.txt
    # |
    # |- ./preferred
    #   |- both.txt
    #   |- preferred.txt
    #   |- ./inner-both
    #   | |- both.txt
    #   | |- preferred.txt
    #   |- ./inner-preferred
    #   | |- preferred.txt
    #
    root.join('fallback').mkdir
    root.join('fallback/both.txt').write('')
    root.join('fallback/fallback.txt').write('')
    root.join('fallback/inner-both').mkdir
    root.join('fallback/inner-fallback').mkdir

    root.join('fallback/inner-both/both.txt').write('')
    root.join('fallback/inner-both/fallback.txt').write('')

    root.join('fallback/inner-fallback/fallback.txt').write('')

    root.join('preferred').mkdir
    root.join('preferred/both.txt').write('')
    root.join('preferred/preferred.txt').write('')
    root.join('preferred/inner-both').mkdir
    root.join('preferred/inner-preferred').mkdir

    root.join('preferred/inner-both/both.txt').write('')
    root.join('preferred/inner-both/preferred.txt').write('')

    root.join('preferred/inner-preferred/preferred.txt').write('')
  end

  after do
    root.rmtree
  end

  context 'when created with a single directory path' do
    let(:resolver) { described_class.create(root.join('fallback')) }

    it 'returns the basename' do
      expect(resolver.basename).to eq(Pathname.new('fallback'))
    end

    it 'returns the extname' do
      expect(resolver.extname).to eq('')
    end

    it 'exists' do
      expect(resolver).to be_exist
    end

    it 'is a directory' do
      expect(resolver).to be_directory
    end

    it 'is not a file' do
      expect(resolver).not_to be_file
    end

    it 'can return all children' do
      expect(resolver.children.sort_by(&:basename)).to eq([
        root.join('fallback/both.txt'),
        root.join('fallback/fallback.txt'),
        root.join('fallback/inner-both'),
        root.join('fallback/inner-fallback')
      ])
    end

    it 'joins the path with a basename' do
      expect(resolver.join('a.txt')).to eq(root.join('fallback/a.txt'))
    end

    it 'looks up a basename' do
      expect(resolver.resolve('a.txt')).to eq(root.join('fallback/a.txt'))
    end

    it 'can return glob matches in the same path' do
      expect(resolver.glob('*.txt').sort).to eq([
        root.join('fallback/both.txt'),
        root.join('fallback/fallback.txt')
      ])
    end

    it 'can return glob matches in the nested paths' do
      expect(resolver.glob('**/*.txt').sort).to eq([
        root.join('fallback/both.txt'),
        root.join('fallback/fallback.txt'),
        root.join('fallback/inner-both/both.txt'),
        root.join('fallback/inner-both/fallback.txt'),
        root.join('fallback/inner-fallback/fallback.txt')
      ])
    end
  end

  context 'when created with a fallback directory path' do
    let(:resolver) do
      described_class.create(root.join('preferred'), root.join('fallback'))
    end

    it 'returns the basename' do
      expect(resolver.basename).to eq(Pathname.new('fallback'))
    end

    it 'returns the extname' do
      expect(resolver.extname).to eq('')
    end

    it 'exists' do
      expect(resolver).to be_exist
    end

    it 'is a directory' do
      expect(resolver).to be_directory
    end

    it 'is not a file' do
      expect(resolver).not_to be_file
    end

    # children
    # --------

    # rubocop:disable RSpec/NestedGroups
    describe '#children' do
      context 'when the fallback does not exist' do
        before do
          root.join('fallback').rmtree
        end

        it 'returns children of the preferred' do
          expect(resolver.children.sort).to eq([
            root.join('preferred/both.txt'),
            root.join('preferred/inner-both'),
            root.join('preferred/inner-preferred'),
            root.join('preferred/preferred.txt')
          ])
        end
      end

      context 'when the preferred does not exist' do
        before do
          root.join('preferred').rmtree
        end

        it 'returns children of the fallback' do
          expect(resolver.children.sort).to eq([
            root.join('fallback/both.txt'),
            root.join('fallback/fallback.txt'),
            root.join('fallback/inner-both'),
            root.join('fallback/inner-fallback')
          ])
        end
      end

      context 'when neither directory exists' do
        before do
          root.join('fallback').rmtree
          root.join('preferred').rmtree
        end

        it 'returns an empty array' do
          expect(resolver.children).to eq([])
        end
      end

      context 'when both directories exist' do
        it 'can returns all unique children' do
          expect(resolver.children.sort).to eq([
            root.join('fallback/fallback.txt'),
            root.join('fallback/inner-fallback'),
            root.join('preferred/both.txt'),
            described_class.create(
              root.join('preferred/inner-both'),
              root.join('fallback/inner-both')
            ),
            root.join('preferred/inner-preferred'),
            root.join('preferred/preferred.txt')
          ])
        end
      end
    end
    # rubocop:enable RSpec/NestedGroups

    # glob
    # ----

    it 'can glob direct children of both directories, without duplicates' do
      expect(resolver.glob('*.txt').sort).to eq([
        root.join('fallback/fallback.txt'),
        root.join('preferred/both.txt'),
        root.join('preferred/preferred.txt')
      ])
    end

    it 'can glob direct nested children of both directories, without duplicates' do
      expect(resolver.glob('**/*.txt').sort).to eq([
        root.join('fallback/fallback.txt'),
        root.join('fallback/inner-both/fallback.txt'),
        root.join('fallback/inner-fallback/fallback.txt'),
        root.join('preferred/both.txt'),
        root.join('preferred/inner-both/both.txt'),
        root.join('preferred/inner-both/preferred.txt'),
        root.join('preferred/inner-preferred/preferred.txt'),
        root.join('preferred/preferred.txt')
      ])
    end

    # join
    # ----

    context 'when joining a file which exists in both directories' do
      it 'returns a PathResolver' do
        expect(resolver.join('both.txt')).to be_a(described_class)
      end

      it 'returns the path to the file in the preferred' do
        expect(resolver.join('both.txt')).to eq(root.join('preferred/both.txt'))
      end
    end

    context 'when joining a file which only exists in the fallback' do
      it 'returns a PathResolver' do
        expect(resolver.join('fallback.txt')).to be_a(described_class)
      end

      it 'returns the path to the file' do
        expect(resolver.join('fallback.txt')).to eq(root.join('fallback/fallback.txt'))
      end
    end

    context 'when joining a file which only exists in the preferred' do
      it 'returns a PathResolver' do
        expect(resolver.join('preferred.txt')).to be_a(described_class)
      end

      it 'returns the path to the file' do
        expect(resolver.join('preferred.txt')).to eq(root.join('preferred/preferred.txt'))
      end
    end

    context 'when joining a directory which exists in both directories' do
      it 'returns a PathResolver::WithFallback' do
        expect(resolver.join('inner-both')).to be_a(Atlas::PathResolver::WithFallback)
      end
    end

    context 'when joining a directory which only exists in the fallback' do
      it 'returns a PathResolver' do
        expect(resolver.join('inner-fallback')).to be_a(described_class)
      end
    end

    context 'when joining a directory which only exists in the preferred' do
      it 'returns a PathResolver' do
        expect(resolver.join('inner-preferred')).to be_a(described_class)
      end
    end

    # resolve
    # -------

    context 'when resolving a file which exists in both directories' do
      it 'returns a Pathname' do
        expect(resolver.resolve('both.txt')).to be_a(Pathname)
      end

      it 'returns the path to the file in the preferred' do
        expect(resolver.resolve('both.txt')).to eq(root.join('preferred/both.txt'))
      end
    end

    context 'when resolving a file which only exists in the fallback' do
      it 'returns a Pathname' do
        expect(resolver.resolve('fallback.txt')).to be_a(Pathname)
      end

      it 'returns the path to the file' do
        expect(resolver.resolve('fallback.txt')).to eq(root.join('fallback/fallback.txt'))
      end
    end

    context 'when resolving a file which only exists in the preferred' do
      it 'returns a Pathname' do
        expect(resolver.resolve('preferred.txt')).to be_a(Pathname)
      end

      it 'returns the path to the file' do
        expect(resolver.resolve('preferred.txt')).to eq(root.join('preferred/preferred.txt'))
      end
    end
  end
end


text:
<title>Solaris 2 Options - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options">
<link rel="prev" href="SH-Options.html#SH-Options" title="SH Options">
<link rel="next" href="SPARC-Options.html#SPARC-Options" title="SPARC Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: SPARC Options,
Previous: SH Options,
Up: Submodel Options

3.17.39 Solaris 2 Options

These ‘<samp>-m</samp>’ options are supported on Solaris 2:

-mimpure-text
<samp>-mimpure-text</samp>, used in addition to <samp>-shared</samp>, tells
the compiler to not pass <samp>-z text</samp> to the linker when linking a
shared object.  Using this option, you can link position-dependent
code into a shared object.

<samp>-mimpure-text</samp> suppresses the “relocations remain against
allocatable but non-writable sections” linker error message.
However, the necessary relocations trigger copy-on-write, and the
shared object is not actually shared across processes.  Instead of
using <samp>-mimpure-text</samp>, you should compile all source code with
<samp>-fpic</samp> or <samp>-fPIC</samp>.

These switches are supported in addition to the above on Solaris 2:

-pthreads
Add support for multithreading using the POSIX threads library.  This
option sets flags for both the preprocessor and linker.  This option does
not affect the thread safety of object code produced  by the compiler or
that of libraries supplied with it.

-pthread
This is a synonym for <samp>-pthreads</samp>.


text:
class FontHandler
{
private:
    static bool initialized;

public:
    static ALLEGRO_FONT *font;

    FontHandler();
    void Load();
};

#endif // FONT_HANDLER_HPP_INCLUDED


text:
package com.netflix.curator.framework.state;

import com.netflix.curator.framework.CuratorFrameworkFactory;

/**
 * Represents state changes in the connection to ZK
 */
public enum ConnectionState
{
    /**
     * Sent for the first successful connection to the server. NOTE: You will only
     * get one of these messages for any CuratorFramework instance.
     */
    CONNECTED,

    /**
     * There has been a loss of connection. Leaders, locks, etc. should suspend
     * until the connection is re-established. If the connection times-out you will
     * receive a {@link #LOST} notice
     */
    SUSPENDED,

    /**
     * A suspended or read-only connection has been re-established
     */
    RECONNECTED,

    /**
     * The connection is confirmed to be lost. Close any locks, leaders, etc. and
     * attempt to re-create them. NOTE: it is possible to get a {@link #RECONNECTED}
     * state after this but you should still consider any locks, etc. as dirty/unstable
     */
    LOST,

    /**
     * The connection has gone into read-only mode. This can only happen if you pass true
     * for {@link CuratorFrameworkFactory.Builder#canBeReadOnly()}. See the ZooKeeper doc
     * regarding read only connections:
     * http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode.
     * The connection will remain in read only mode until another state change is sent.
     */
    READ_ONLY
}


text:
package org.apache.camel.component.jms;

import javax.jms.ConnectionFactory;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
import static org.apache.camel.component.jms.JmsComponent.jmsComponentTransacted;

/**
 * @version
 */
public class JmsTransactedRouteTest extends CamelTestSupport {

    @Test
    public void testJmsRouteWithTextMessage() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        String expectedBody = "Hello there!";
        String expectedBody2 = "Goodbye!";

        resultEndpoint.expectedBodiesReceived(expectedBody, expectedBody2);
        resultEndpoint.message(0).header("cheese").isEqualTo(123);

        template.sendBodyAndHeader("activemq:test.a", expectedBody, "cheese", 123);
        template.sendBodyAndHeader("activemq:test.a", expectedBody2, "cheese", 124);

        resultEndpoint.assertIsSatisfied();
    }

    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();

        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        JmsComponent component = jmsComponentTransacted(connectionFactory);
        camelContext.addComponent("activemq", component);
        return camelContext;
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").to("activemq:test.b");
                from("activemq:test.b").to("mock:result");
            }
        };
    }
}