text:
class AddMinimumAgeToGame < ActiveRecord::Migration[6.0]
  def change
    add_column :games, :minimum_age, :integer, default: 16
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace SevenShores\Hubspot\Tests\integration\Endpoints;

use SevenShores\Hubspot\Tests\Integration\Abstraction\CrmPipelinesTestCase;

/**
 * @internal
 * @coversNothing
 */
class CrmPipelinesDealsTest extends CrmPipelinesTestCase
{
}


text:
module Graphics.Rendering.OpenGL.GL.Polygons (
   polygonSmooth, cullFace,
   PolygonStipple, makePolygonStipple, getPolygonStippleBytes, polygonStipple,
   PolygonMode(..), polygonMode, polygonOffset,
   polygonOffsetPoint, polygonOffsetLine, polygonOffsetFill
) where

import Control.Monad ( liftM2 )
import Foreign.Marshal.Array ( withArray )
import Foreign.Ptr ( Ptr )
import Graphics.Rendering.OpenGL.GL.Capability (
   EnableCap(CapPolygonSmooth,CapCullFace,CapPolygonStipple,
             CapPolygonOffsetPoint,CapPolygonOffsetLine,CapPolygonOffsetFill),
   makeCapability, makeStateVarMaybe )
import Graphics.Rendering.OpenGL.GL.BasicTypes (
   GLenum, GLubyte, GLfloat, Capability )
import Graphics.Rendering.OpenGL.GL.Face ( marshalFace, unmarshalFace )
import Graphics.Rendering.OpenGL.GL.Colors ( Face(..) )
import Graphics.Rendering.OpenGL.GL.PolygonMode (
   PolygonMode(..), marshalPolygonMode, unmarshalPolygonMode )
import Graphics.Rendering.OpenGL.GL.QueryUtils (
   GetPName(GetCullFaceMode,GetPolygonMode,GetPolygonOffsetFactor,
            GetPolygonOffsetUnits),
   getInteger2, getEnum1, getFloat1, getArrayWith )
import Graphics.Rendering.OpenGL.GL.StateVar ( StateVar, makeStateVar )

--------------------------------------------------------------------------------

polygonSmooth :: StateVar Capability
polygonSmooth = makeCapability CapPolygonSmooth

--------------------------------------------------------------------------------

cullFace :: StateVar (Maybe Face)
cullFace = makeStateVarMaybe (return CapCullFace)
                             (getEnum1 unmarshalFace GetCullFaceMode)
                             (glCullFace . marshalFace)

foreign import stdcall unsafe "HsOpenGL.h glCullFace" glCullFace :: GLenum -> IO ()

--------------------------------------------------------------------------------

newtype PolygonStipple = PolygonStipple [GLubyte]
   deriving ( Eq, Ord, Show )

numPolygonStippleBytes :: Int
numPolygonStippleBytes = 32

makePolygonStipple :: [GLubyte] -> PolygonStipple
makePolygonStipple pattern
   | length pattern == numPolygonStippleBytes = PolygonStipple pattern
   | otherwise =
        error ("makePolygonStipple: expected " ++ show numPolygonStippleBytes ++
               " pattern bytes")

getPolygonStippleBytes :: PolygonStipple -> [GLubyte]
getPolygonStippleBytes (PolygonStipple pattern) = pattern

--------------------------------------------------------------------------------

polygonStipple :: StateVar (Maybe PolygonStipple)
polygonStipple =
   makeStateVarMaybe
      (return CapPolygonStipple)
      (getArrayWith PolygonStipple numPolygonStippleBytes glGetPolygonStipple)
      (\(PolygonStipple pattern) -> withArray pattern $ glPolygonStipple)

foreign import stdcall unsafe "HsOpenGL.h glGetPolygonStipple" glGetPolygonStipple ::
   Ptr GLubyte -> IO ()

foreign import stdcall unsafe "HsOpenGL.h glPolygonStipple" glPolygonStipple ::
   Ptr GLubyte -> IO ()

--------------------------------------------------------------------------------

polygonMode :: StateVar (PolygonMode, PolygonMode)
polygonMode = makeStateVar getPolygonMode setPolygonMode

getPolygonMode :: IO (PolygonMode, PolygonMode)
getPolygonMode = getInteger2 (\front back -> (un front, un back)) GetPolygonMode
   where un = unmarshalPolygonMode . fromIntegral

setPolygonMode :: (PolygonMode, PolygonMode) -> IO ()
setPolygonMode (front, back) = do
   glPolygonMode (marshalFace Front) (marshalPolygonMode front)
   glPolygonMode (marshalFace Back ) (marshalPolygonMode back )

foreign import stdcall unsafe "HsOpenGL.h glPolygonMode" glPolygonMode ::
   GLenum -> GLenum -> IO ()

--------------------------------------------------------------------------------

polygonOffset :: StateVar (GLfloat, GLfloat)
polygonOffset =
   makeStateVar (liftM2 (,) (getFloat1 id GetPolygonOffsetFactor)
                            (getFloat1 id GetPolygonOffsetUnits))
                (uncurry glPolygonOffset)

foreign import stdcall unsafe "HsOpenGL.h glPolygonOffset" glPolygonOffset ::
   GLfloat -> GLfloat -> IO ()

--------------------------------------------------------------------------------

polygonOffsetPoint :: StateVar Capability
polygonOffsetPoint = makeCapability CapPolygonOffsetPoint

polygonOffsetLine :: StateVar Capability
polygonOffsetLine = makeCapability CapPolygonOffsetLine

polygonOffsetFill :: StateVar Capability
polygonOffsetFill = makeCapability CapPolygonOffsetFill


text:
package org.hsqldb.jdbc.pool;

import javax.sql.ConnectionEventListener;
import javax.sql.PooledConnection;

import java.sql.Connection;
import java.sql.SQLException;

//#ifdef JAVA6
import javax.sql.StatementEventListener;

//#endif JAVA6
// boucherb@users 20051207 - patch 1.8.0.x initial JDBC 4.0 support work

/**
 * @author Jakob Jenkov
 */
public class JDBCPooledConnection implements PooledConnection {

    private LifeTimeConnectionWrapper connectionWrapper = null;

    public JDBCPooledConnection(LifeTimeConnectionWrapper connectionWrapper) {
        this.connectionWrapper = connectionWrapper;
    }

    public void close() throws SQLException {

        connectionWrapper.closePhysically();

        this.connectionWrapper = null;
    }

    public Connection getConnection() throws SQLException {
        return this.connectionWrapper;
    }

    public void addConnectionEventListener(ConnectionEventListener listener) {
        this.connectionWrapper.addConnectionEventListener(listener);
    }

    public void removeConnectionEventListener(
            ConnectionEventListener listener) {
        this.connectionWrapper.removeConnectionEventListener(listener);
    }

/** @todo - implement methods */

//#ifdef JAVA6
    public void addStatementEventListener(StatementEventListener listener) {}

    public void removeStatementEventListener(
            StatementEventListener listener) {}

//#endif JAVA6
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob;

import com.azure.storage.common.StorageSharedKeyCredential;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;

/**
 * This class shows how to upload the file as fast as possible in parallel using the optimized upload API.
 */
public class FileTransferExample {
    private static final String LARGE_TEST_FOLDER = "test-large-files/";

    /**
     * Entry point into the file transfer examples for Storage blobs.
     * @param args Unused. Arguments to the program.
     * @throws IOException If an I/O error occurs
     * @throws NoSuchAlgorithmException If {@code MD5} isn't supported
     * @throws RuntimeException If the uploaded or downloaded file wasn't found
     */
    public static void main(String[] args) throws IOException, NoSuchAlgorithmException {

        /*
         * From the Azure portal, get your Storage account's name and account key.
         */
        String accountName = SampleHelper.getAccountName();
        String accountKey = SampleHelper.getAccountKey();

        /*
         * Use your Storage account's name and key to create a credential object; this is used to access your account.
         */
        StorageSharedKeyCredential credential = new StorageSharedKeyCredential(accountName, accountKey);

        /*
         * From the Azure portal, get your Storage account blob service URL endpoint.
         * The URL typically looks like this:
         */
        String endPoint = String.format(Locale.ROOT, "https://%s.blob.core.windows.net", accountName);

        /*
         * Create a BlobServiceClient object that wraps the service endpoint, credential and a request pipeline.
         * Now you can use the storageClient to perform various container and blob operations.
         */
        BlobServiceClient storageClient = new BlobServiceClientBuilder().endpoint(endPoint).credential(credential).buildClient();

        /*
         * This example shows several common operations just to get you started.
         */

        /*
         * Create a client that references a to-be-created container in your Azure Storage account. This returns a
         * ContainerClient uses the same endpoint, credential and pipeline from storageClient.
         * Note that container names require lowercase.
         */
        BlobContainerClient blobContainerClient = storageClient.getBlobContainerClient("myjavacontainerparallelupload" + System.currentTimeMillis());

        /*
         * Create a container in Storage blob account.
         */
        blobContainerClient.create();

        /*
         * Create a BlockBlobClient object that wraps a blob's endpoint and a default pipeline, the blockBlobClient give us access to upload the file.
         */
        String filename = "BigFile.bin";
        BlobClient blobClient = blobContainerClient.getBlobClient(filename);

        /*
         * Create the empty uploadFile and downloadFile.
         */
        File largeFile = createTempEmptyFile(filename);

        File downloadFile = createTempEmptyFile("downloadFile.bin");

        Files.deleteIfExists(downloadFile.toPath());

        /*
         * Generate random things to uploadFile, which makes the file with size of 100MB.
         */
        long fileSize = 100 * 1024 * 1024L;
        createTempFileWithFileSize(largeFile, fileSize);

        /*
         * Upload the large file to storage blob.
         */
        blobClient.uploadFromFile(largeFile.getPath());

        /*
         * Download the large file from storage blob to the local downloadFile path.
         */
        blobClient.downloadToFile(downloadFile.getPath());

        /*
         * Check the files are same after the round-trip.
         */
        if (Files.exists(downloadFile.toPath()) && Files.exists(largeFile.toPath())) {
            checkTwoFilesAreTheSame(largeFile, downloadFile);
            System.out.println("The file we upload is the same as the one we download.");
        } else {
            throw new RuntimeException("Did not find the upload or download file.");
        }

        /*
         * Clean up the local files and storage container.
         */
        blobContainerClient.delete();
        Files.deleteIfExists(largeFile.toPath());
        Files.deleteIfExists(downloadFile.toPath());
    }

    private static File createTempEmptyFile(String fileName) throws IOException {
        String pathName = "./folderPath/" + LARGE_TEST_FOLDER;

        File dirPath = new File(pathName);

        if (dirPath.exists() || dirPath.mkdirs()) {
            File f = new File(pathName + fileName);
            if (f.exists() || f.createNewFile()) {
                return f;
            } else {
                throw new RuntimeException("Failed to create the large file.");
            }
        } else {
            throw new RuntimeException("Failed to create the large file dir.");
        }
    }

    private static void createTempFileWithFileSize(File f, long size) throws IOException {
        RandomAccessFile raf = new RandomAccessFile(f, "rw");
        raf.setLength(size);
        raf.close();
    }

    private static void checkTwoFilesAreTheSame(File f1, File f2) throws IOException, NoSuchAlgorithmException {
        String checksumUpload = getFileChecksum(f1);
        String checksumDownload = getFileChecksum(f2);
        if (!checksumUpload.equals(checksumDownload)) {
            throw new RuntimeException("The file upload does not match the file download.");
        }
    }

    private static String getFileChecksum(File file) throws IOException, NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("MD5");

        try (FileInputStream fis = new FileInputStream(file); FileChannel ch = fis.getChannel()) {
            final ByteBuffer buf = ByteBuffer.allocateDirect(8192);
            int b = ch.read(buf);
            while (b != -1 && b != 0) {
                buf.flip();
                final byte[] bytes = new byte[b];
                buf.get(bytes);
                md.update(bytes, 0, b);
                buf.clear();
                b = ch.read(buf);
            }

            return new String(md.digest(), StandardCharsets.UTF_8);
        }
    }

}


text:
["Sea Pain", "Great Wheezy", "DJ Chewie",
 "Lil' Bitey", "Finmaster Flex", "Swim Khalifa",
 "Ice Teeth", "The Notorious J.A.W."]

// But they've got a problem with their assignLaser function. Something is up,
// and now there's a traffic jam at the last shark's station.
//
// Figure out what happened and apply the following fixes:
//  1. Don't change the position of the function inside the for loop.
//  2. Instead of assigning to the stationAssignment variable, return the anonymous function.
//  3. Remove the subsequently unnecessary lines with stationAssignment.
//  4. Note: You do not need to call the assignLaser function.
//
// Use the code below in your solution:

function assignLaser(shark, sharkList) {
  var stationAssignment;
  for (var i = 0; i < sharkList.length; i++) {
    if (shark == sharkList[i]) {
      stationAssignment = function() {
        alert("Yo, " + shark + "!\n" +
              "Visit underwater strapping station " +
              (i + 1) + " for your sweet laser.");
      };
    }
  }
  return stationAssignment;
}


text:
angular.module('bridge.services')
  .factory('UserSimulation', ['$resource', function($resource) {
    return $resource('//mission-control.orbitable.tech/users/:id/simulations');
  }])
  .factory('Simulation', ['$resource', function($resource) {
    return $resource('//mission-control.orbitable.tech/simulations/:id');
  }]);


text:
package com.novaordis.gc.model;

import com.novaordis.gc.UserErrorException;
import com.novaordis.gc.cli.Configuration;
import com.novaordis.gc.model.event.FullCollection;
import com.novaordis.gc.model.event.GCEvent;
import com.novaordis.gc.parser.BeforeAfterMax;
import com.novaordis.series.metric.DoubleHeader;
import com.novaordis.series.metric.DoubleMetric;
import com.novaordis.series.metric.LongHeader;
import com.novaordis.series.metric.LongMetric;
import com.novaordis.series.metric.StringHeader;
import com.novaordis.series.metric.StringMetric;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;

public class FieldTypeTest extends Assert
{
    // Constants ---------------------------------------------------------------------------------------------------------------------------

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

    // Static ------------------------------------------------------------------------------------------------------------------------------

    // Attributes --------------------------------------------------------------------------------------------------------------------------

    // Constructors ------------------------------------------------------------------------------------------------------------------------

    // Public ------------------------------------------------------------------------------------------------------------------------------

    // toHeader() --------------------------------------------------------------------------------------------------------------------------

    @Test
    public void toHeader_OFFSET() throws Exception
    {
        StringHeader h = (StringHeader)FieldType.OFFSET.toHeader(null);
        assertEquals(FieldType.OFFSET.label, h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_COLLECTION_TYPE() throws Exception
    {
        StringHeader h = (StringHeader)FieldType.COLLECTION_TYPE.toHeader(null);
        assertEquals(FieldType.COLLECTION_TYPE.label, h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_DURATION() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.DURATION.toHeader(null);
        assertEquals(FieldType.DURATION.label + " (" + Unit.ms.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_BEFORE() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.NG_BEFORE.toHeader(null);
        assertEquals(FieldType.NG_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_AFTER() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.NG_AFTER.toHeader(null);
        assertEquals(FieldType.NG_AFTER.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_CAPACITY() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.NG_CAPACITY.toHeader(null);
        assertEquals(FieldType.NG_CAPACITY.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_HEAP_BEFORE() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_BEFORE.toHeader(null);
        assertEquals(FieldType.HEAP_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_HEAP_AFTER() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_AFTER.toHeader(null);
        assertEquals(FieldType.HEAP_AFTER.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_NG_HEAP_CAPACITY() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_CAPACITY.toHeader(null);
        assertEquals(FieldType.HEAP_CAPACITY.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_OG_BEFORE() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.OG_BEFORE.toHeader(null);
        assertEquals(FieldType.OG_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_OG_AFTER() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.OG_AFTER.toHeader(null);
        assertEquals(FieldType.OG_AFTER.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_OG_CAPACITY() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.OG_CAPACITY.toHeader(null);
        assertEquals(FieldType.OG_CAPACITY.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_PG_BEFORE() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.PG_BEFORE.toHeader(null);
        assertEquals(FieldType.PG_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_PG_AFTER() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.PG_AFTER.toHeader(null);
        assertEquals(FieldType.PG_AFTER.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_PG_CAPACITY() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.PG_CAPACITY.toHeader(null);
        assertEquals(FieldType.PG_CAPACITY.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_HEAP_BEFORE() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_BEFORE.toHeader(null);
        assertEquals(FieldType.HEAP_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_HEAP_AFTER() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_AFTER.toHeader(null);
        assertEquals(FieldType.HEAP_AFTER.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    @Test
    public void toHeader_HEAP_CAPACITY() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.HEAP_CAPACITY.toHeader(null);
        assertEquals(FieldType.HEAP_CAPACITY.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat());
    }

    // toHeader() and unit conversion ------------------------------------------------------------------------------------------------------

    @Test
    public void toHeader_WeDonTConvertNonMemory() throws Exception
    {
        try
        {
            FieldType.DURATION.toHeader(Unit.b);
            fail("because we don't convert non-MEMORY types");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void toHeader_NG_BEFORE_Unit_byte() throws Exception
    {
        LongHeader h = (LongHeader)FieldType.NG_BEFORE.toHeader(Unit.b);
        assertEquals(FieldType.NG_BEFORE.label + " (" + Unit.b.label + ")", h.getLabel());
        assertNull(h.getFormat()); // no special format
    }

    @Test
    public void toHeader_NG_BEFORE_Unit_Kilobyte() throws Exception
    {
        DoubleHeader h = (DoubleHeader)FieldType.NG_BEFORE.toHeader(Unit.K);
        assertEquals(FieldType.NG_BEFORE.label + " (" + Unit.K.label + ")", h.getLabel());
        assertEquals(Configuration.MEMORY_FORMAT, h.getFormat());
    }

    @Test
    public void toHeader_NG_BEFORE_Unit_Megabyte() throws Exception
    {
        DoubleHeader h = (DoubleHeader)FieldType.NG_BEFORE.toHeader(Unit.M);
        assertEquals(FieldType.NG_BEFORE.label + " (" + Unit.M.label + ")", h.getLabel());
        assertEquals(Configuration.MEMORY_FORMAT, h.getFormat());
    }

    @Test
    public void toHeader_NG_BEFORE_Unit_Gigabyte() throws Exception
    {
        DoubleHeader h = (DoubleHeader)FieldType.NG_BEFORE.toHeader(Unit.G);
        assertEquals(FieldType.NG_BEFORE.label + " (" + Unit.G.label + ")", h.getLabel());
        assertEquals(Configuration.MEMORY_FORMAT, h.getFormat());
    }

    @Test
    public void toHeader_MismatchedUnit_MemoryToMs() throws Exception
    {
        try
        {
            FieldType.NG_BEFORE.toHeader(Unit.s);
            fail("should fail with UserErrorException");
        }
        catch(UserErrorException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void toHeader_MismatchedUnit_MemoryToS() throws Exception
    {
        try
        {
            FieldType.NG_BEFORE.toHeader(Unit.ms);
            fail("should fail with UserErrorException");
        }
        catch(UserErrorException e)
        {
            log.info(e.getMessage());
        }
    }

    // toMetric() String types -------------------------------------------------------------------------------------------------------------

    @Test
    public void testOFFSET_NullValue() throws Exception
    {
        try
        {
            FieldType.OFFSET.toMetric(null, null);
            fail("should have failed with IllegalArgumentException");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testOFFSET_NonString() throws Exception
    {
        try
        {
            FieldType.OFFSET.toMetric(10L, null);
            fail("should have failed with type mismatch");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testOFFSET_String() throws Exception
    {
        StringMetric m = (StringMetric)FieldType.OFFSET.toMetric("3177.325", null);

        assertEquals("3177.325", m.getString());
    }

    // toMetric() CollectionType -----------------------------------------------------------------------------------------------------------

    @Test
    public void testCOLLECTION_TYPE_NullValue() throws Exception
    {
        try
        {
            FieldType.COLLECTION_TYPE.toMetric(null, null);
            fail("should have failed with IllegalArgumentException");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testCOLLECTION_TYPE_NonCollectionType() throws Exception
    {
        try
        {
            FieldType.COLLECTION_TYPE.toMetric(10L, null);
            fail("should have failed with type mismatch");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testCOLLECTION_TYPE_Full() throws Exception
    {
        StringMetric m = (StringMetric)FieldType.COLLECTION_TYPE.toMetric(CollectionType.FULL_COLLECTION, null);
        assertEquals("FULL", m.getString());
    }

    @Test
    public void testCOLLECTION_TYPE_NG() throws Exception
    {
        StringMetric m = (StringMetric)FieldType.COLLECTION_TYPE.toMetric(CollectionType.NEW_GENERATION_COLLECTION, null);
        assertEquals(CollectionType.NEW_GENERATION_COLLECTION.label, m.getString());
    }

    // toMetric() Long types ---------------------------------------------------------------------------------------------------------------

    @Test
    public void testDURATION_NullValue() throws Exception
    {
        try
        {
            FieldType.DURATION.toMetric(null, null);
            fail("should have failed with IllegalArgumentException");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testDURATION_NonLong() throws Exception
    {
        try
        {
            FieldType.DURATION.toMetric("something", null);
            fail("should have failed with type mismatch");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }
    }

    @Test
    public void testDURATION_Long() throws Exception
    {
        LongMetric m = (LongMetric)FieldType.DURATION.toMetric(777L, null);
        assertEquals(777L, m.getLong());
    }

    // toMetric() Unit conversion tests ----------------------------------------------------------------------------------------------------

    @Test
    public void invalidConversionUnit() throws Exception
    {
        try
        {
            FieldType.OFFSET.toMetric("blah", Unit.K);
            fail("should fail, cannot convert String to KB");
        }
        catch(IllegalArgumentException e)
        {
            log.info(e.getMessage());
        }

    }

    @Test
    public void testNG_BEFORE_NoConversion() throws Exception
    {
        LongMetric m = (LongMetric)FieldType.NG_BEFORE.toMetric(1024L, null);
        assertEquals(1024L, m.getLong());
    }

    @Test
    public void testNG_BEFORE_ConversionToBytes() throws Exception
    {
        LongMetric m = (LongMetric)FieldType.NG_BEFORE.toMetric(111L, Unit.b);
        assertEquals(111, m.getLong());
    }

    @Test
    public void testNG_BEFORE_ConversionToKilobytes() throws Exception
    {
        DoubleMetric m = (DoubleMetric)FieldType.NG_BEFORE.toMetric(1024L, Unit.K);
        assertEquals(1.00, m.getDouble(), 0.001);
    }

    @Test
    public void testNG_BEFORE_ConversionToMegabytes() throws Exception
    {
        DoubleMetric m = (DoubleMetric)FieldType.NG_BEFORE.toMetric(1024L * 1024L, Unit.M);
        assertEquals(1.00, m.getDouble(), 0.001);
    }

    @Test
    public void testNG_BEFORE_ConversionToGigabytes() throws Exception
    {
        DoubleMetric m = (DoubleMetric)FieldType.NG_BEFORE.toMetric(1024L * 1024L * 1024L, Unit.G);
        assertEquals(1.00, m.getDouble(), 0.001);
    }

    // Double types ------------------------------------------------------------------------------------------------------------------------

    // TODO - add double types tests when I have a double FieldType.

    // evaluate() --------------------------------------------------------------------------------------------------------------------------

    @Test
    public void testEvaluate_OFFSET_null() throws Exception
    {
        assertNull(FieldType.OFFSET.evaluate(null));
    }

    @Test
    public void testEvaluate_OFFSET_GCEvent_Contains() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, null, null, null, false);
        Value v = FieldType.OFFSET.evaluate(e);
        assertNotNull(v);
        assertEquals("1.012", v.getValue());
        assertEquals(FieldType.OFFSET, v.getType());
    }

    @Test
    public void testEvaluate_NG_BEFORE_null() throws Exception
    {
        assertNull(FieldType.NG_BEFORE.evaluate(null));
    }

    @Test
    public void testEvaluate_NG_BEFORE_GCEvent_DoesNotContain() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, null, null, null, false);
        Value v = FieldType.NG_BEFORE.evaluate(e);
        assertNull(v);
    }

    @Test
    public void testEvaluate_NG_BEFORE_GCEvent_Contains() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, new BeforeAfterMax(2, 1, 3, Unit.G), null, null, null, false);
        Value v = FieldType.NG_BEFORE.evaluate(e);
        assertNotNull(v);
        assertEquals(2L * 1024 * 1024 * 1024, v.getValue());
        assertEquals(FieldType.NG_BEFORE, v.getType());
    }

    @Test
    public void testEvaluate_OG_AFTER_null() throws Exception
    {
        assertNull(FieldType.OG_AFTER.evaluate(null));
    }

    @Test
    public void testEvaluate_OG_AFTER_GCEvent_DoesNotContain() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, null, null, null, false);
        Value v = FieldType.OG_AFTER.evaluate(e);
        assertNull(v);
    }

    @Test
    public void testEvaluate_OG_AFTER_GCEvent_Contains() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, new BeforeAfterMax(10, 7, 15, Unit.K), null, null, false);
        Value v = FieldType.OG_AFTER.evaluate(e);
        assertNotNull(v);
        assertEquals(7L * 1024, v.getValue());
        assertEquals(FieldType.OG_AFTER, v.getType());
    }

    @Test
    public void testEvaluate_PG_CAPACITY_null() throws Exception
    {
        assertNull(FieldType.PG_CAPACITY.evaluate(null));
    }

    @Test
    public void testEvaluate_PG_CAPACITY_GCEvent_DoesNotContain() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, null, null, null, false);
        Value v = FieldType.PG_CAPACITY.evaluate(e);
        assertNull(v);
    }

    @Test
    public void testEvaluate_PG_CAPACITY_GCEvent_Contains() throws Exception
    {
        GCEvent e = new FullCollection(new Timestamp(1012L), 1L, null, null, new BeforeAfterMax(11, 13, 17, Unit.M), null, false);
        Value v = FieldType.PG_CAPACITY.evaluate(e);
        assertNotNull(v);
        assertEquals(17L * 1024 * 1024, v.getValue());
        assertEquals(FieldType.PG_CAPACITY, v.getType());
    }

    // Package protected -------------------------------------------------------------------------------------------------------------------

    // Protected ---------------------------------------------------------------------------------------------------------------------------

    // Private -----------------------------------------------------------------------------------------------------------------------------

    // Inner classes -----------------------------------------------------------------------------------------------------------------------
}


text:
// Your project must contain an AppConfig.h file with your project-specific settings in it,
// and your header search path must make it accessible to the module's files.
#include "AppConfig.h"

#include "../utility/juce_CheckSettingMacros.h"

// (these functions are in their own file because of problems including windows.h
// at the same time as the Digi headers)

#if JucePlugin_Build_RTAS

#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY // (workaround for a VC build problem)

#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#undef STRICT
#define STRICT
#include <intrin.h>
#include <windows.h>

#pragma pack (push, 8)
#include "../utility/juce_IncludeModuleHeaders.h"
#pragma pack (pop)

//==============================================================================
void JUCE_CALLTYPE attachSubWindow (void* hostWindow,
                                    int& titleW, int& titleH,
                                    Component* comp)
{
    RECT clientRect;
    GetClientRect ((HWND) hostWindow, &clientRect);

    titleW = clientRect.right - clientRect.left;
    titleH = jmax (0, (int) (clientRect.bottom - clientRect.top) - comp->getHeight());
    comp->setTopLeftPosition (0, titleH);

    comp->addToDesktop (0);

    HWND plugWnd = (HWND) comp->getWindowHandle();
    SetParent (plugWnd, (HWND) hostWindow);

    DWORD val = GetWindowLong (plugWnd, GWL_STYLE);
    val = (val & ~WS_POPUP) | WS_CHILD;
    SetWindowLong (plugWnd, GWL_STYLE, val);

    val = GetWindowLong ((HWND) hostWindow, GWL_STYLE);
    SetWindowLong ((HWND) hostWindow, GWL_STYLE, val | WS_CLIPCHILDREN);
}

void JUCE_CALLTYPE resizeHostWindow (void* hostWindow,
                                     int& titleW, int& titleH,
                                     Component* comp)
{
    RECT clientRect, windowRect;
    GetClientRect ((HWND) hostWindow, &clientRect);
    GetWindowRect ((HWND) hostWindow, &windowRect);
    const int borderW = (windowRect.right - windowRect.left) - (clientRect.right - clientRect.left);
    const int borderH = (windowRect.bottom - windowRect.top) - (clientRect.bottom - clientRect.top);

    SetWindowPos ((HWND) hostWindow, 0, 0, 0,
                  borderW + jmax (titleW, comp->getWidth()),
                  borderH + comp->getHeight() + titleH,
                  SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
}

#if ! JucePlugin_EditorRequiresKeyboardFocus

namespace
{
    HWND findMDIParentOf (HWND w)
    {
        const int frameThickness = GetSystemMetrics (SM_CYFIXEDFRAME);

        while (w != 0)
        {
            HWND parent = GetParent (w);

            if (parent == 0)
                break;

            TCHAR windowType [32] = { 0 };
            GetClassName (parent, windowType, 31);

            if (String (windowType).equalsIgnoreCase ("MDIClient"))
            {
                w = parent;
                break;
            }

            RECT windowPos, parentPos;
            GetWindowRect (w, &windowPos);
            GetWindowRect (parent, &parentPos);

            int dw = (parentPos.right - parentPos.left) - (windowPos.right - windowPos.left);
            int dh = (parentPos.bottom - parentPos.top) - (windowPos.bottom - windowPos.top);

            if (dw > 100 || dh > 100)
                break;

            w = parent;

            if (dw == 2 * frameThickness)
                break;
        }

        return w;
    }
}

void JUCE_CALLTYPE passFocusToHostWindow (void* hostWindow)
{
    SetFocus (findMDIParentOf ((HWND) hostWindow));
}

#endif
#endif


text:
namespace base {
class TaskRunner;
}  // namespace base

namespace session_manager {
class SessionManager;
}  // namespace session_manager

namespace ash {

class NetworkStateHandler;
class NetworkTypePattern;

namespace tether {

// Concrete HostScanScheduler implementation. One of three events begin a scan
// attempt:
//   (1) NetworkStateHandler requests a Tether network scan.
//   (2) The device loses its Internet connection.
//   (3) The scan is explicitly requested via ScheduleScan().
class HostScanSchedulerImpl : public HostScanScheduler,
                              public NetworkStateHandlerObserver,
                              public HostScanner::Observer,
                              public session_manager::SessionManagerObserver {
 public:
  HostScanSchedulerImpl(NetworkStateHandler* network_state_handler,
                        HostScanner* host_scanner,
                        session_manager::SessionManager* session_manager);

  HostScanSchedulerImpl(const HostScanSchedulerImpl&) = delete;
  HostScanSchedulerImpl& operator=(const HostScanSchedulerImpl&) = delete;

  ~HostScanSchedulerImpl() override;

  // HostScanScheduler:
  void AttemptScanIfOffline() override;

 protected:
  // NetworkStateHandlerObserver:
  void DefaultNetworkChanged(const NetworkState* network) override;
  void ScanRequested(const NetworkTypePattern& type) override;

  // HostScanner::Observer:
  void ScanFinished() override;

  // session_manager::SessionManagerObserver:
  void OnSessionStateChanged() override;

 private:
  friend class HostScanSchedulerImplTest;

  void AttemptScan();
  bool IsTetherNetworkConnectingOrConnected();
  bool IsOnlineOrHasActiveTetherConnection(const NetworkState* default_network);
  void LogHostScanBatchMetric();

  void SetTestDoubles(
      std::unique_ptr<base::OneShotTimer> test_host_scan_batch_timer,
      base::Clock* test_clock,
      scoped_refptr<base::TaskRunner> test_task_runner);

  NetworkStateHandler* network_state_handler_;
  HostScanner* host_scanner_;
  session_manager::SessionManager* session_manager_;

  std::unique_ptr<base::OneShotTimer> host_scan_batch_timer_;
  base::Clock* clock_;
  scoped_refptr<base::TaskRunner> task_runner_;

  base::Time last_scan_batch_start_timestamp_;
  base::Time last_scan_end_timestamp_;
  bool is_screen_locked_;

  base::WeakPtrFactory<HostScanSchedulerImpl> weak_ptr_factory_{this};
};

}  // namespace tether

}  // namespace ash

#endif  // ASH_COMPONENTS_TETHER_HOST_SCAN_SCHEDULER_IMPL_H_


text:
using Cognito.Stripe.Helpers;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cognito.Stripe.Classes
{
	public class Refund : Transaction
	{
		public override string Object { get { return "refund"; } }

		public Charge Charge { get; set; }

		public RefundReason Reason { get; set; }
		[JsonProperty("receipt_number")]
		public string ReceiptNumber { get; set; }
		public string Description { get; set; }
	}

	public enum RefundReason
	{
		unknown,
		duplicate,
		fraudulent,
		requested_by_customer
	}
}


text:
void register_UserLookupTableProxy_class();

#endif//UserLookupTableProxy_hpp__pyplusplus_wrapper


text:
<?php

declare(strict_types=1);

namespace Arcanedev\Localization\Tests\Entities;

use Arcanedev\Localization\Entities\Locale;
use Arcanedev\Localization\Tests\TestCase;
use Illuminate\Support\Arr;

/**
 * Class     LocaleTest
 *
 * @author   ARCANEDEV <arcanedev.maroc@gmail.com>
 */
class LocaleTest extends TestCase
{
    /* -----------------------------------------------------------------
     |  Properties
     | -----------------------------------------------------------------
     */

    /** @var \Arcanedev\Localization\Entities\Locale */
    private $locale;

    /* -----------------------------------------------------------------
     |  Main Methods
     | -----------------------------------------------------------------
     */

    public function tearDown(): void
    {
        unset($this->locale);

        parent::tearDown();
    }

    /* -----------------------------------------------------------------
     |  Test Methods
     | -----------------------------------------------------------------
     */

    /** @test */
    public function it_can_be_instantiated(): void
    {
        $this->locale = $this->makeLocale('en');

        static::assertInstanceOf(Locale::class, $this->locale);

        static::assertSame('en',      $this->locale->key());
        static::assertSame('English', $this->locale->name());
        static::assertSame('Latin',   $this->locale->script());
        static::assertSame('ltr',     $this->locale->direction());
        static::assertSame('English', $this->locale->native());
        static::assertSame('en_GB',   $this->locale->regional());

        static::assertTrue($this->locale->isDefault());
    }

    /** @test */
    public function it_must_lower_direction_case(): void
    {
        $key          = 'en';
        $data         = $this->getLocale($key);
        $data['dir']  = 'LTR';
        $this->locale = new Locale($key, $data);

        static::assertSame(strtolower($data['dir']), $this->locale->direction());
    }

    /** @test */
    public function it_can_get_direction_if_empty(): void
    {
        $key          = 'en';
        $data         = $this->getLocale($key);
        $data['dir']  = '';
        $this->locale = new Locale($key, $data);

        static::assertSame('ltr', $this->locale->direction());
    }

    /** @test */
    public function it_can_convert_entity_to_array(): void
    {
        $this->locale = $this->makeLocale('en');

        static::assertIsArray($this->locale->toArray());
    }

    /** @test */
    public function it_can_convert_entity_to_json(): void
    {
        $this->locale = $this->makeLocale('en');

        static::assertJson($this->locale->toJson());
        static::assertJson(json_encode($this->locale, JSON_PRETTY_PRINT));
    }

    /* -----------------------------------------------------------------
     |  Other Methods
     | -----------------------------------------------------------------
     */

    /**
     * Make a locale.
     *
     * @param  string  $key
     *
     * @return \Arcanedev\Localization\Entities\Locale
     */
    private function makeLocale($key): Locale
    {
        return Locale::make($key, $this->getLocale($key));
    }

    /**
     * Get locale data.
     *
     * @param  string  $key
     *
     * @return array
     */
    private function getLocale($key): array
    {
        return Arr::get([
            'ar' => [
                'name'     => 'Arabic',
                'script'   => 'Arab',
                'dir'      => 'rtl',
                'native'   => 'العربية',
                'regional' => 'ar_AE',
            ],
            'en' => [
                'name'     => 'English',
                'script'   => 'Latin',
                'dir'      => 'ltr',
                'native'   => 'English',
                'regional' => 'en_GB',
            ],
            'fr' => [
                'name'     => 'French',
                'script'   => 'Latin',
                'dir'      => 'ltr',
                'native'   => 'Français',
                'regional' => 'fr_FR',
            ],
        ], $key);
    }
}


text:
/** @file */	// Doxygen marker

#import "CC3Foundation.h"

#pragma mark CC3Backgrounder

/**
 * CC3Backgrounder performs activity on a background thread by submitting tasks to
 * a Grand Central Dispatch (GCD) queue. In order to ensure that the GL engine is
 * presented activity in an defined order, CC3Backgrounder is a singleton.
 *
 * This core behaviour can be nulified by setting the shouldRunOnRequestingThread property
 * to YES, which forces tasks submitted to this backgrounder to be run on the same thread
 * from which the tasks are queued. This behaviour can be useful when loading OpenGL objects
 * that need to be subsequently deleted. It is important that OpenGL objects are deleted
 * from the same thread on which they are loaded.
 */
@interface CC3Backgrounder : NSObject {
	dispatch_queue_t _taskQueue;
	long _queuePriority;
	BOOL _shouldRunTasksOnRequestingThread : 1;
}

/**
 * Specifies the priority of the GCD global dispatch queue to which background tasks are dispatched.
 *
 * Setting this property will affect any subsequent tasks submitted to the runBlock: method.
 *
 * The value of this property must be one of the following GCD constants:
 *	- DISPATCH_QUEUE_PRIORITY_HIGH
 *	- DISPATCH_QUEUE_PRIORITY_DEFAULT
 *	- DISPATCH_QUEUE_PRIORITY_LOW
 *	- DISPATCH_QUEUE_PRIORITY_BACKGROUND (available starting with iOS 5)
 *
 * The initial value of this property is DISPATCH_QUEUE_PRIORITY_BACKGROUND when running
 * under iOS 5 or above, or DISPATCH_QUEUE_PRIORITY_LOW otherwise.
 */
@property(nonatomic, assign) long queuePriority;

#pragma mark Backgrounding tasks

/**
 * If the value of the shouldRunOnRequestingThread property is NO (the default), the specified
 * block of code is dispatched to the global GCD queue identified by the value of the queuePriority
 * property, and the current thread continues without waiting for the dispatched code to complete.
 *
 * If the value of the shouldRunOnRequestingThread property is YES, the specified block of code
 * is run immediately on the current thread, and further thread activity waits until the specified
 * block has completed.
 */
-(void) runBlock: (void (^)(void))block;

/**
 * Waits the specified number of seconds, then executes the specified block of code
 * either on a background thread, or the current thread, depending on the value of
 * the shouldRunOnRequestingThread property.

 * If the value of the shouldRunOnRequestingThread property is NO (the default), the specified
 * block of code is dispatched to the global GCD queue identified by the value of the queuePriority
 * property. If the value of the shouldRunOnRequestingThread property is YES, the specified block
 * of code is run on the current thread.
 */
-(void) runBlock: (void (^)(void))block after: (NSTimeInterval) seconds;

/**
 * Indicates that tasks should be run on the same thread as the invocator of the task requests.
 *
 * The initial value of this property is NO, indicating that tasks will be dispatched to a
 * background thread for running. Set this property to YES to force tasks to run on the same
 * thread as the request is made.
 */
@property(nonatomic, assign) BOOL shouldRunTasksOnRequestingThread;

#pragma mark Allocation and initialization

/** Returns the singleton backgrounder instance. */
+(CC3Backgrounder*) sharedBackgrounder;

@end


text:
using SynNet.Steps.Parameters;

namespace BranchSwitcher.Steps.SqlServer
{
	public class CreateSqlServerDbStepParameter : StepParameter
	{
		public string DatabaseName { get; set; }

		public string Username { get; set; }

		public string AdminUserName { get; set; }

		public string AdminPassword { get; set; }

		public string Schema { get; set; }

		public string InstanceName { get; set; }
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@color/actionbar_color"
    android:theme="@style/ActionBarStyle"
    app:contentInsetLeft="@dimen/toolbar_left_padding"
    app:contentInsetStart="@dimen/toolbar_left_padding"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    app:titleTextAppearance="@style/ToolbarTitle" />


text:
package org.apache.hadoop.hbase.util;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;

/**
 * Not thread safe!
 */
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class ByteBufferOutputStream extends OutputStream {

  protected ByteBuffer buf;

  public ByteBufferOutputStream(int capacity) {
    this(capacity, false);
  }

  public ByteBufferOutputStream(int capacity, boolean useDirectByteBuffer) {
    if (useDirectByteBuffer) {
      buf = ByteBuffer.allocateDirect(capacity);
    } else {
      buf = ByteBuffer.allocate(capacity);
    }
  }

  public int size() {
    return buf.position();
  }

  /**
   * This flips the underlying BB so be sure to use it _last_!
   * @return ByteBuffer
   */
  public ByteBuffer getByteBuffer() {
    buf.flip();
    return buf;
  }

  private void checkSizeAndGrow(int extra) {
    if ( (buf.position() + extra) > buf.limit()) {
      // size calculation is complex, because we could overflow negative,
      // and/or not allocate enough space. this fixes that.
      int newSize = (int)Math.min((((long)buf.capacity()) * 2),
          (long)(Integer.MAX_VALUE));
      newSize = Math.max(newSize, buf.position() + extra);

      ByteBuffer newBuf = ByteBuffer.allocate(newSize);
      buf.flip();
      newBuf.put(buf);
      buf = newBuf;
    }
  }

  // OutputStream
  @Override
  public void write(int b) throws IOException {
    checkSizeAndGrow(Bytes.SIZEOF_BYTE);

    buf.put((byte)b);
  }

 /**
  * Writes the complete contents of this byte buffer output stream to
  * the specified output stream argument.
  *
  * @param      out   the output stream to which to write the data.
  * @exception  IOException  if an I/O error occurs.
  */
  public synchronized void writeTo(OutputStream out) throws IOException {
    WritableByteChannel channel = Channels.newChannel(out);
    ByteBuffer bb = buf.duplicate();
    bb.flip();
    channel.write(bb);
  }

  @Override
  public void write(byte[] b) throws IOException {
    checkSizeAndGrow(b.length);

    buf.put(b);
  }

  @Override
  public void write(byte[] b, int off, int len) throws IOException {
    checkSizeAndGrow(len);

    buf.put(b, off, len);
  }

  @Override
  public void flush() throws IOException {
    // noop
  }

  @Override
  public void close() throws IOException {
    // noop again. heh
  }

  public byte[] toByteArray(int offset, int length) {
    ByteBuffer bb = buf.duplicate();
    bb.flip();

    byte[] chunk = new byte[length];

    bb.position(offset);
    bb.get(chunk, 0, length);
    return chunk;
  }
}


text:
EMAIL_GROUPS = {
  business: [ENV.fetch("EMAIL_GROUP_BUSINESS", "publisher-alerts-business@digital.cabinet-office.gov.uk")],
  citizen: [ENV.fetch("EMAIL_GROUP_CITIZEN", "publisher-alerts-citizen@digital.cabinet-office.gov.uk")],
  force_publish_alerts: [ENV.fetch("EMAIL_GROUP_FORCE_PUBLISH_ALERTS", "mainstream-force-publishing-alerts@digital.cabinet-office.gov.uk")],
}.freeze


text:
class CallOnOtherInstance1 {
  private boolean duplicate;
  private Something something;
  private CallOnOtherInstance1 original;

    public Something getSomething() {
        CallOnOtherInstance1 other = this;
        while (true) {
            if (other.something == null) {
                if (other.isDuplicate()) {
                    final CallOnOtherInstance1 recursion = other.getOriginal();
                    other = recursion;
                    continue;
                } else {
                    other.something = new Something();
                }
            }
            return other.something;
        }
    }

  private CallOnOtherInstance1 getOriginal() {
    return original;
  }
  private boolean isDuplicate() {
    return duplicate;
  }

  public static class Something {}
}


text:
/* This file was automatically generated.  Do not edit! */
void shineOnMe();
void delay(int noops);
void kitt();
void toggleLeds(char leds,char direction);
void incrementLeds(char direction,char *currentLed);
void toggleRGB(char rgb);
void ledsWriteRGB(unsigned char rgb);
void setLeds(unsigned char ledMask);
void initLeds();


text:
package ioio.lib.impl;

import ioio.lib.api.TwiMaster;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.impl.FlowControlledPacketSender.Packet;
import ioio.lib.impl.FlowControlledPacketSender.Sender;
import ioio.lib.impl.IncomingState.DataModuleListener;
import ioio.lib.impl.ResourceManager.Resource;
import ioio.lib.spi.Log;

import java.io.IOException;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

class TwiMasterImpl extends AbstractResource implements TwiMaster,
		DataModuleListener, Sender {
	class TwiResult extends ResourceLifeCycle implements Result {
		private boolean ready_ = false;
		private boolean success_;
		private final byte[] data_;

		public TwiResult(byte[] data) {
			data_ = data;
		}

		public synchronized void ready(boolean success) {
			ready_ = true;
			success_ = success;
			notifyAll();
		}

		public byte[] getData() {
			return data_;
		}

		@Override
		public synchronized boolean waitReady() throws ConnectionLostException,
				InterruptedException {
			checkState();
			while (!ready_) {
				safeWait();
			}
			return success_;
		}
	}

	class OutgoingPacket implements Packet {
		int writeSize_;
		byte[] writeData_;
		boolean tenBitAddr_;
		int addr_;
		int readSize_;

		@Override
		public int getSize() {
			return writeSize_ + 4;
		}

	}

	private final Queue<TwiResult> pendingRequests_ = new ConcurrentLinkedQueue<TwiMasterImpl.TwiResult>();
	private final FlowControlledPacketSender outgoing_ = new FlowControlledPacketSender(
			this);
	private final Resource twi_;
	private final Resource[] pins_;

	TwiMasterImpl(IOIOImpl ioio, Resource twi, Resource[] pins) throws ConnectionLostException {
		super(ioio);
		twi_ = twi;
		pins_ = pins;
	}

	@Override
	synchronized public void disconnected() {
		outgoing_.kill();
		for (TwiResult result : pendingRequests_) {
			result.disconnected();
		}
		super.disconnected();
	}

	@Override
	public boolean writeRead(int address, boolean tenBitAddr, byte[] writeData,
			int writeSize, byte[] readData, int readSize)
			throws ConnectionLostException, InterruptedException {
		Result result = writeReadAsync(address, tenBitAddr, writeData,
				writeSize, readData, readSize);
		return result.waitReady();
	}

	@Override
	public Result writeReadAsync(int address, boolean tenBitAddr,
			byte[] writeData, int writeSize, byte[] readData, int readSize)
			throws ConnectionLostException {
		checkState();
		TwiResult result = new TwiResult(readData);

		OutgoingPacket p = new OutgoingPacket();
		p.writeSize_ = writeSize;
		p.writeData_ = writeData;
		p.tenBitAddr_ = tenBitAddr;
		p.readSize_ = readSize;
		p.addr_ = address;

		synchronized (this) {
			pendingRequests_.add(result);
			try {
				outgoing_.write(p);
			} catch (IOException e) {
				Log.e("SpiMasterImpl", "Exception caught", e);
			}
		}
		return result;
	}

	@Override
	public void dataReceived(byte[] data, int size) {
		TwiResult result = pendingRequests_.remove();
		synchronized (result) {
			final boolean success = size != 0xFF;
			if (success && size > 0) {
				System.arraycopy(data, 0, result.getData(), 0, size);
			}
			result.ready(success);
		}
	}

	@Override
	public void reportAdditionalBuffer(int bytesRemaining) {
		outgoing_.readyToSend(bytesRemaining);
	}

	@Override
	synchronized public void close() {
		checkClose();
		outgoing_.close();
		for (TwiResult result : pendingRequests_) {
			result.close();
		}
		try {
			ioio_.protocol_.i2cClose(twi_.id);
			ioio_.resourceManager_.free(twi_, pins_);
		} catch (IOException e) {
		}
		super.close();
	}

	@Override
	public void send(Packet packet) {
		OutgoingPacket p = (OutgoingPacket) packet;
		try {
			ioio_.protocol_.i2cWriteRead(twi_.id, p.tenBitAddr_, p.addr_,
					p.writeSize_, p.readSize_, p.writeData_);
		} catch (IOException e) {
			Log.e("TwiImpl", "Caught exception", e);
		}
	}
}


text:
NS_ASSUME_NONNULL_BEGIN

@interface NSString (Number)

@end

NS_ASSUME_NONNULL_END


text:
/** Helios Development Group LLC, 2013 */
package com.heliosapm.shorthand.util.unsafe.collections;

/**
 *
Title: UnsafeArrayBuilder

 *
Description: A builder class to handle the construction parameters for instances of {@link UnsafeLongArray}

 *
Company: Helios Development Group LLC

 * @author Whitehead (nwhitehead AT heliosdev DOT org)
 *
org.helios.apmrouter.collections.UnsafeArrayBuilder

 */

public class UnsafeArrayBuilder {

	/** Indicates the array will be maintained in sorted order. Default is false. */
	private boolean sorted = false;
	/** Indicates the capacity of the array will be fixed. Default is false. */
	private boolean fixed = false;
	/** The initial capacity of the array. Default is 128. */
	private int initialCapacity = UnsafeArray.DEFAULT_CAPACITY;
	/** The maximum capacity of the array. Default is {@value Integer#MAX_VALUE}. */
	private int maxCapacity = Integer.MAX_VALUE;
	/** The minimum capacity of the array. Default is same as {@link UnsafeArrayBuilder#initialCapacity}. */
	private int minCapacity = 1;
	/** The number of slots that will be allocated when the array needs to be extended. 128 */
	private int allocationIncrement = UnsafeArray.DEFAULT_ALLOC_INCR;
	/** The number of excess slots that are emptied by rollLefts before the array capacity is shrunk. 128 */
	private int clearedSlotsFree = UnsafeArray.DEFAULT_ALLOC_INCR;

	/**
	 * Returns a new UnsafeArrayBuilder
	 * @return a new UnsafeArrayBuilder
	 */
	public static UnsafeArrayBuilder newBuilder() {
		return new UnsafeArrayBuilder();
	}

	/**
	 * Builds and returns an UnsafeLongArray
	 * @return a new UnsafeLongArray
	 */
	public UnsafeLongArray buildLongArray() {
		return UnsafeLongArray.build(this);
	}

	/**
	 * Builds and returns an UnsafeLongArray, initializing it with the values from the passed object
	 * @param data The values to initialize the array with
	 * @return a new UnsafeLongArray
	 */
	public UnsafeLongArray buildLongArray(Object data) {
		return UnsafeLongArray.build(this, data);
	}

	/**
	 * Private Ctor. Use {@link UnsafeArrayBuilder#newBuilder()}.
	 */
	private UnsafeArrayBuilder(){}

	/**
	 * Returns true if sorted, false otherwise
	 * @return true if sorted, false otherwise
	 */
	public boolean sorted() {
		return sorted;
	}

	/**
	 * Sets if the built array will be sorted or not
	 * @param sorted true for a sorted array, false for unsorted
	 * @return this builder
	 */
	public UnsafeArrayBuilder sorted(boolean sorted) {
		this.sorted = sorted;
		return this;
	}

	/**
	 * Returns true if fixed capacity, false otherwise
	 * @return true if fixed capacity, false otherwise
	 */
	public boolean fixed() {
		return fixed;
	}

	/**
	 * Sets if the built array will be fixed capacity or not
	 * @param fixed true for fixed capacity, false for extendable
	 * @return this builder
	 */
	public UnsafeArrayBuilder fixed(boolean fixed) {
		this.fixed = fixed;
		return this;
	}

	/**
	 * Returns the initial capacity of the array
	 * @return the initial capacity of the array
	 */
	public int initialCapacity() {
		return initialCapacity;
	}

	/**
	 * Sets the initial capacity of the array
	 * @param initialCapacity the initial capacity of the array
	 * @return this builder
	 */
	public UnsafeArrayBuilder initialCapacity(int initialCapacity) {
		this.initialCapacity = initialCapacity;
		return this;
	}

	/**
	 * Returns the max capacity of the array
	 * @return the initial capacity of the array
	 */
	public int maxCapacity() {
		return maxCapacity;
	}

	/**
	 * Sets the max capacity of the array
	 * @param maxCapacity the max capacity of the array
	 * @return this builder
	 */
	public UnsafeArrayBuilder maxCapacity(int maxCapacity) {
		this.maxCapacity = maxCapacity;
		return this;
	}

	/**
	 * Returns the min capacity of the array
	 * @return the min capacity of the array
	 */
	public int minCapacity() {
		return minCapacity;
	}

	/**
	 * Sets the min capacity of the array
	 * @param minCapacity the min capacity of the array
	 * @return this builder
	 */
	public UnsafeArrayBuilder minCapacity(int minCapacity) {
		this.minCapacity = minCapacity;
		return this;
	}

	/**
	 * Returns the allocation increment
	 * @return the allocation increment
	 */
	public int allocationIncrement() {
		return allocationIncrement;
	}

	/**
	 * Sets the allocation increment
	 * @param allocationIncrement the allocation increment
	 * @return this builder
	 */
	public UnsafeArrayBuilder allocationIncrement(int allocationIncrement) {
		this.allocationIncrement = allocationIncrement;
		return this;
	}

	/**
	 * Returns the number of cleared slots that will trigger a shrink if not fixed capacity
	 * @return the number of cleared slots that will trigger a shrink
	 */
	public int clearedSlotsFree() {
		return clearedSlotsFree;
	}

	/**
	 * Sets the number of cleared slots that will trigger a shrink if not fixed capacity
	 * @param clearedSlotsFree the number of cleared slots that will trigger a shrink
	 * @return this builder
	 */
	public UnsafeArrayBuilder clearedSlotsFree(int clearedSlotsFree) {
		this.clearedSlotsFree = clearedSlotsFree;
		return this;
	}

}


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('funding', '0013_auto_20190711_0927'),
        ('funding', '0014_auto_20190716_1636'),
    ]

    operations = [
    ]


text:
"""Module containing basic data provider tests.
"""

from soc.modules.seeder.logic.providers.provider import FixedValueProvider
from soc.modules.seeder.logic.providers.provider import MissingParameterError
import unittest

__authors__ = [
  '"Felix Kerekes" <sttwister@gmail.com>',
  ]

class FixedValueProviderTest(unittest.TestCase):
  """Test class for FixedValueProvider.
  """

  def setUp(self):
    self.provider = FixedValueProvider()

  def tearDown(self):
    pass

  def testMissingParameter(self):
    """Tests getValue() when no parameter values are supplied.
    """
    self.assertRaises(MissingParameterError, self.provider.getValue)

  def testGetValue(self):
    """Tests getValue().
    """
    value = "asdf"
    self.provider.param_values = {"value": value}
    self.assertEquals(self.provider.getValue(), value)

    value = 37
    self.provider.param_values = {"value": value}
    self.assertEquals(self.provider.getValue(), value)

if __name__ == "__main__":
  #import sys;sys.argv = ['', 'Test.testName']
  unittest.main()


text:
package org.apache.oodt.cas.product.jaxrs.exceptions;

import javax.ws.rs.WebApplicationException;

/**
 * This type of exception returns an HTTP 'not found' response (status code 404) with an additional
 * message.
 *
 * @author rlaidlaw
 * @version $Revision$
 */
public class NotFoundException extends WebApplicationException {

  /** Auto-generated ID for serialization. */
  private static final long serialVersionUID = -3835077083758525919L;

  /**
   * Constructor that adds a message to the 'not found' (status code 404) HTTP response.
   *
   * @param message the message to add to the response
   */
  public NotFoundException(String message) {
    super(message);
  }
}


text:
//
//  RCDPokeRemindController.m
//  SealTalk
//
//  Created by 张改红 on 2019/8/2.
//  Copyright © 2019 RongCloud. All rights reserved.
//

#import "RCDPokeRemindController.h"
#import "RCDPokeManager.h"
#import <Masonry/Masonry.h>
#import "RCDUserInfoManager.h"
#import <SDWebImage/SDWebImage.h>
#import "RCDGroupManager.h"
#import "RCDPokeMessage.h"
#import <AVFoundation/AVFoundation.h>
#import "RCDChatViewController.h"
#import "RCDUtilities.h"
@interface RCDPokeRemindController ()
@property (nonatomic, strong) UIImageView *headerView;
@property (nonatomic, strong) UILabel *userNameLabel;
@property (nonatomic, strong) UILabel *groupNameLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) UIButton *ignoreButton;
@property (nonatomic, strong) UILabel *ignoreLabel;
@property (nonatomic, strong) UIButton *joinChatButton;
@property (nonatomic, strong) UILabel *joinChatlabel;

@property (nonatomic, strong) NSTimer *shakeTimer; //震动定时器
@property (nonatomic, strong) AVAudioPlayer *player;
@property (nonatomic, assign) NSInteger timeLimit;
@end

@implementation RCDPokeRemindController
#pragma mark - life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [HEXCOLOR(0x000000) colorWithAlphaComponent:0.9];
    [self setDataInfo];
    [self setupSubviews];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(appWillTerminate)
                                                 name:UIApplicationWillTerminateNotification
                                               object:nil];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self beginShakeAndSound];
    [RCDPokeManager sharedInstance].isShowPokeVC = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [RCDPokeManager sharedInstance].isShowPokeVC = NO;
}

#pragma mark - helper
- (void)appWillTerminate {
    [self stopShakeAndSound];
}

- (void)didClickIgnoreButton {
    [self dismiss];
}

- (void)didClickJoinChatButton {
    [self dismiss];
    UIViewController *rootVC = [self getCurrentVC];
    RCDChatViewController *chatVC = [[RCDChatViewController alloc] init];
    chatVC.targetId = self.message.targetId;
    chatVC.conversationType = self.message.conversationType;
    if ([rootVC isKindOfClass:[UINavigationController class]]) {
        if ([rootVC.presentedViewController isKindOfClass:[UINavigationController class]]) {
            [(UINavigationController *)rootVC.presentedViewController pushViewController:chatVC animated:YES];
        } else {
            [(UINavigationController *)rootVC pushViewController:chatVC animated:YES];
        }
    } else {
        UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:rootVC];
        navi.modalPresentationStyle = UIModalPresentationFullScreen;
        [rootVC presentViewController:navi animated:YES completion:nil];
    }
}

- (void)dismiss {
    [self stopShakeAndSound];
    [self.view removeFromSuperview];
}

// 开始震动和播放音乐
- (void)beginShakeAndSound {
    self.shakeTimer =
        [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(shakePhone) userInfo:nil repeats:YES];
    [[NSRunLoop currentRunLoop] addTimer:self.shakeTimer forMode:NSDefaultRunLoopMode];

    NSError *error;
    NSString *path = [[NSBundle mainBundle] pathForResource:@"poke" ofType:@".mp3"];
    if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
        return;
    }
    SystemSoundID soundID = 0;
    CFURLRef urlRef = (__bridge CFURLRef)([NSURL fileURLWithPath:path]);
    AudioServicesCreateSystemSoundID(urlRef, &soundID);

    self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];
    if (!self.player) {
        NSLog(@"Error: %@", [error localizedDescription]);
        return;
    }
    [self.player setNumberOfLoops:1000000];
    [self.player prepareToPlay];
    [self.player play];
}

/**
 停止震动和音乐
 */
- (void)stopShakeAndSound {
    [_player stop];
    //停止前手动出发震动一下
    [self shakePhone];
    [_shakeTimer invalidate];
}

- (void)shakePhone {
    self.timeLimit -= 1;
    if (self.timeLimit == 0) {
        [self dismiss];
    }
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}

- (void)setDataInfo {
    if (self.message.conversationType == ConversationType_GROUP) {
        __weak typeof(self) weakSelf = self;
        [RCDUtilities getGroupUserDisplayInfo:self.message.senderUserId
                                      groupId:self.message.targetId
                                       result:^(RCUserInfo *user) {
                                           weakSelf.userNameLabel.text = [RCKitUtility getDisplayName:user];
                                           [weakSelf.headerView
                                               sd_setImageWithURL:[NSURL URLWithString:user.portraitUri]
                                                 placeholderImage:[UIImage imageNamed:@"contact"]];
                                       }];
    } else {
        __weak typeof(self) weakSelf = self;
        [RCDUtilities getUserDisplayInfo:self.message.senderUserId
                                complete:^(RCUserInfo *user) {
                                    weakSelf.userNameLabel.text = [RCKitUtility getDisplayName:user];
                                    [weakSelf.headerView sd_setImageWithURL:[NSURL URLWithString:user.portraitUri]
                                                           placeholderImage:[UIImage imageNamed:@"contact"]];
                                }];
    }

    if (self.message.conversationType == ConversationType_GROUP) {
        RCDGroupInfo *group = [RCDGroupManager getGroupInfo:self.message.targetId];
        if (!group) {
            [RCDGroupManager getGroupInfoFromServer:self.message.targetId
                                           complete:^(RCDGroupInfo *groupInfo) {
                                               dispatch_async(dispatch_get_main_queue(), ^{
                                                   if (groupInfo) {
                                                       self.groupNameLabel.text = groupInfo.groupName;
                                                   }
                                               });
                                           }];
        } else {
            self.groupNameLabel.text = group.groupName;
        }
    }
    RCDPokeMessage *pokeMsg = (RCDPokeMessage *)self.message.content;
    self.contentLabel.text = pokeMsg.content;
    self.timeLimit = 60;
}

//获取当前屏幕显示的viewcontroller
- (UIViewController *)getCurrentVC {
    UIViewController *result = nil;
    UIWindow *window = [[UIApplication sharedApplication] keyWindow];
    if (window.windowLevel != UIWindowLevelNormal) {
        NSArray *windows = [[UIApplication sharedApplication] windows];
        for (UIWindow *tmpWin in windows) {
            if (tmpWin.windowLevel == UIWindowLevelNormal) {
                window = tmpWin;
                break;
            }
        }
    }
    UIView *frontView = [[window subviews] objectAtIndex:0];
    id nextResponder = [frontView nextResponder];
    if ([nextResponder isKindOfClass:[UIViewController class]]) {
        result = nextResponder;
    } else {
        result = window.rootViewController;
    }
    return result;
}

- (void)setupSubviews {
    [self.view addSubview:self.headerView];
    [self.view addSubview:self.userNameLabel];
    UIView *contentBgView = [[UIView alloc] init];
    contentBgView.backgroundColor = HEXCOLOR(0x555555);
    contentBgView.layer.cornerRadius = 2.f;
    contentBgView.layer.masksToBounds = YES;
    [self.view addSubview:contentBgView];
    [self.view addSubview:self.contentLabel];
    [self.view addSubview:self.ignoreButton];
    [self.view addSubview:self.ignoreLabel];
    [self.view addSubview:self.joinChatButton];
    [self.view addSubview:self.joinChatlabel];

    [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0, *)) {
            make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop).offset(83);
        } else {
            make.top.equalTo(self.view).offset(83);
        }
        make.centerX.equalTo(self.view);
        make.height.width.offset(130);
    }];
    [self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headerView.mas_bottom).offset(10);
        make.centerX.equalTo(self.view);
        make.height.offset(28);
    }];
    if (self.message.conversationType == ConversationType_GROUP) {
        [self.view addSubview:self.groupNameLabel];
        [self.groupNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.userNameLabel.mas_bottom).offset(5);
            make.centerX.equalTo(self.view);
            make.height.offset(28);
        }];
    }
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.userNameLabel.mas_bottom).offset(48);
        make.centerX.equalTo(self.view);
        make.left.greaterThanOrEqualTo(self.view).offset(25);
    }];
    [contentBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.centerX.equalTo(self.contentLabel);
        make.centerX.equalTo(self.view);
        make.height.equalTo(self.contentLabel).offset(20);
        make.width.equalTo(self.contentLabel).offset(30);
    }];
    [self.ignoreButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.ignoreLabel.mas_top).offset(-10);
        make.centerX.equalTo(self.ignoreLabel);
        make.height.width.offset(60);
    }];
    [self.ignoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0, *)) {
            make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-32);
        } else {
            make.bottom.equalTo(self.view).offset(-32);
        }
        make.centerX.equalTo(self.view).multipliedBy(0.5);
        make.height.offset(21);
    }];
    [self.joinChatButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.ignoreButton);
        make.centerX.equalTo(self.view).multipliedBy(1.5);
        make.height.width.offset(60);
    }];
    [self.joinChatlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.ignoreLabel);
        make.centerX.equalTo(self.view).multipliedBy(1.5);
        make.height.offset(21);
    }];
}

#pragma mark - getter
- (UIImageView *)headerView {
    if (!_headerView) {
        _headerView = [[UIImageView alloc] init];
        _headerView.layer.masksToBounds = YES;
        _headerView.contentMode = UIViewContentModeScaleAspectFill;
        if (RCKitConfigCenter.ui.globalConversationAvatarStyle == RC_USER_AVATAR_CYCLE &&
            RCKitConfigCenter.ui.globalMessageAvatarStyle == RC_USER_AVATAR_CYCLE) {
            _headerView.layer.cornerRadius = 65.f;
        } else {
            _headerView.layer.cornerRadius = 6.f;
        }
    }
    return _headerView;
}

- (UILabel *)userNameLabel {
    if (!_userNameLabel) {
        _userNameLabel = [[UILabel alloc] init];
        _userNameLabel.font = [UIFont systemFontOfSize:20];
        _userNameLabel.textColor = HEXCOLOR(0xffffff);
        _userNameLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _userNameLabel;
}

- (UILabel *)groupNameLabel {
    if (!_groupNameLabel) {
        _groupNameLabel = [[UILabel alloc] init];
        _groupNameLabel.font = [UIFont systemFontOfSize:20];
        _groupNameLabel.textColor = HEXCOLOR(0xffffff);
        _groupNameLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _groupNameLabel;
}

- (UILabel *)contentLabel {
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = [UIFont systemFontOfSize:15];
        _contentLabel.textColor = HEXCOLOR(0xffffff);
        _contentLabel.textAlignment = NSTextAlignmentCenter;
        _contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}

- (UIButton *)ignoreButton {
    if (!_ignoreButton) {
        _ignoreButton = [[UIButton alloc] init];
        [_ignoreButton setImage:[UIImage imageNamed:@"poke_ignore"] forState:(UIControlStateNormal)];
        [_ignoreButton addTarget:self
                          action:@selector(didClickIgnoreButton)
                forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _ignoreButton;
}

- (UILabel *)ignoreLabel {
    if (!_ignoreLabel) {
        _ignoreLabel = [[UILabel alloc] init];
        _ignoreLabel.font = [UIFont systemFontOfSize:15];
        _ignoreLabel.textColor = HEXCOLOR(0xffffff);
        _ignoreLabel.textAlignment = NSTextAlignmentCenter;
        _ignoreLabel.text = RCDLocalizedString(@"Ignore");
    }
    return _ignoreLabel;
}

- (UIButton *)joinChatButton {
    if (!_joinChatButton) {
        _joinChatButton = [[UIButton alloc] init];
        [_joinChatButton setImage:[UIImage imageNamed:@"poke_join_chat"] forState:(UIControlStateNormal)];
        [_joinChatButton addTarget:self
                            action:@selector(didClickJoinChatButton)
                  forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _joinChatButton;
}

- (UILabel *)joinChatlabel {
    if (!_joinChatlabel) {
        _joinChatlabel = [[UILabel alloc] init];
        _joinChatlabel.font = [UIFont systemFontOfSize:15];
        _joinChatlabel.textColor = HEXCOLOR(0xffffff);
        _joinChatlabel.textAlignment = NSTextAlignmentCenter;
        _joinChatlabel.text = RCDLocalizedString(@"JoinChat");
    }
    return _joinChatlabel;
}
@end


text:
namespace mini_installer {

namespace {

// Returns true if GoogleUpdateIsMachine=1 is present in the environment.
bool GetGoogleUpdateIsMachineEnvVar() {
  const DWORD kBufferSize = 2;
  StackString<kBufferSize> value;
  DWORD length = ::GetEnvironmentVariableW(L"GoogleUpdateIsMachine",
                                           value.get(), kBufferSize);
  return length == 1 && *value.get() == L'1';
}

}  // namespace

Configuration::Configuration() : args_(NULL) {
  Clear();
}

Configuration::~Configuration() {
  Clear();
}

bool Configuration::Initialize(HMODULE module) {
  Clear();
  ReadResources(module);
  return ParseCommandLine(::GetCommandLine());
}

const wchar_t* Configuration::program() const {
  return args_ == NULL || argument_count_ < 1 ? NULL : args_[0];
}

void Configuration::Clear() {
  if (args_ != NULL) {
    ::LocalFree(args_);
    args_ = NULL;
  }
  chrome_app_guid_ = google_update::kAppGuid;
  command_line_ = NULL;
  operation_ = INSTALL_PRODUCT;
  argument_count_ = 0;
  is_system_level_ = false;
  is_side_by_side_ = false;
  is_updating_multi_chrome_ = false;
  has_invalid_switch_ = false;
  previous_version_ = NULL;
}

// |command_line| is shared with this instance in the sense that this
// instance may refer to it at will throughout its lifetime, yet it will
// not release it.
bool Configuration::ParseCommandLine(const wchar_t* command_line) {
  command_line_ = command_line;
  args_ = ::CommandLineToArgvW(command_line_, &argument_count_);
  if (!args_)
    return false;

  for (int i = 1; i < argument_count_; ++i) {
    if (0 == ::lstrcmpi(args_[i], L"--system-level")) {
      is_system_level_ = true;
#if defined(GOOGLE_CHROME_BUILD)
    } else if (0 == ::lstrcmpi(args_[i], L"--chrome-sxs")) {
      is_side_by_side_ = true;
      chrome_app_guid_ = google_update::kSxSAppGuid;
#endif
    } else if (0 == ::lstrcmpi(args_[i], L"--cleanup")) {
      operation_ = CLEANUP;
    } else if (0 == ::lstrcmpi(args_[i], L"--chrome-frame")) {
      has_invalid_switch_ = true;
    }
  }

  if (!is_system_level_)
    is_system_level_ = GetGoogleUpdateIsMachineEnvVar();

  is_updating_multi_chrome_ = IsUpdatingMultiChrome();

  return true;
}

void Configuration::ReadResources(HMODULE module) {
  HRSRC resource_info_block =
      FindResource(module, MAKEINTRESOURCE(ID_PREVIOUS_VERSION), RT_RCDATA);
  if (!resource_info_block)
    return;

  HGLOBAL data_handle = LoadResource(module, resource_info_block);
  if (!data_handle)
    return;

  // The data is a Unicode string, so it must be a multiple of two bytes.
  DWORD version_size = SizeofResource(module, resource_info_block);
  if (!version_size || (version_size & 0x01) != 0)
    return;

  void* version_data = LockResource(data_handle);
  if (!version_data)
    return;

  const wchar_t* version_string = reinterpret_cast<wchar_t*>(version_data);
  size_t version_len = version_size / sizeof(wchar_t);

  // The string must be terminated.
  if (version_string[version_len - 1])
    return;

  previous_version_ = version_string;
}

bool Configuration::IsUpdatingMultiChrome() const {
#if defined(GOOGLE_CHROME_BUILD)
  // SxS/canary does not support multi-install.
  if (is_side_by_side_)
    return false;

  // Is Chrome already installed as multi-install?
  const HKEY root = is_system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
  StackString<128> value;
  RegKey key;
  return (OpenClientsKey(root, google_update::kAppGuid, KEY_QUERY_VALUE,
                         &key) == ERROR_SUCCESS &&
          key.ReadSZValue(kPvRegistryValue, value.get(), value.capacity()) ==
              ERROR_SUCCESS &&
          value.length() != 0 &&
          OpenClientStateKey(root, google_update::kAppGuid, KEY_QUERY_VALUE,
                             &key) == ERROR_SUCCESS &&
          key.ReadSZValue(kUninstallArgumentsRegistryValue, value.get(),
                          value.capacity()) == ERROR_SUCCESS &&
          value.findi(L"--multi-install") != nullptr);
#else
  return false;
#endif
}

}  // namespace mini_installer


text:
package org.gedcomx.util.date;

import junit.framework.TestCase;

/**
 * Class for testing the GedcomX FormalDate utility class.
 * User: Randy Wilson
 * Date: 8/20/13
 * Time: 2:28 PM
 */
public class FormalDateTest extends TestCase {
  /*
   * Simple date:
   *   (+|-)YYYY[-MM[-DD[Thh[:mm[:ss[(+\-)hh[:mm]|Z]]]]]]
   *
   * Duration:
   *   P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]
   *
   * Closed date Range:
   *   [simpleDate]/[simpleDate|Duration]
   * Open-ended date range:
   *   [simpleDate]/
   *   /[simpleDate]
   * Recurring date
   *   R[repetitions]/simpleDate/(simpleDate|Duration)
   * Approximate date or date range
   *   A(simpleDate)
   *   A(dateRange)
   *
   * => ([A](simpleDate|dateRange) | R[repetitions]/simpleDate/(simpleDate|Duration))
   * => [A]simpleDate
   *    [A]simpleDate/[simpleDate|Duration]
   *    [A]/simpleDate
   *    R[repetitions]/simpleDate/(simpleDate|Duration)
   */

  public void testFormalDate() {
    // Simple date
    checkFormalDate("+1820", false, 1820, false, null, null, null);
    checkFormalDate("A+1820", true, 1820, false, null, null, null);
    failFormalDate("1820"); // no "+"
    failFormalDate("+1820--12"); // no month

    // Ranges
    checkFormalDate("A+1820/", true, 1820, true, null, null, null);
    checkFormalDate("A+1820/+1830", true, 1820, true, 1830, null, null);
    checkFormalDate("A/+1830", true, null, true, 1830, null, null);
    checkFormalDate("/+1830", false, null, true, 1830, null, null);

    // Duration
    checkFormalDate("+1820/P0061Y", false, 1820, true, null, 61, null);
    checkFormalDate("A+1820/P0061Y", true, 1820, true, null, 61, null);
    failFormalDate("/P0061Y"); // no start date
    failFormalDate("A+1820/P61Y"); // need to 0-pad duration

    // Repetition
    checkFormalDate("R/+1820/+1821", false, 1820, true, 1821, null, 0);
    checkFormalDate("R42/+1820/+1821", false, 1820, true, 1821, null, 42);
    checkFormalDate("R42/+1820/P0001Y", false, 1820, true, null, 1, 42);
    checkFormalDate("R/+1820/P0061Y", false, 1820, true, null, 61, 0);
    failFormalDate("AR/+1820/P0061Y"); // can't have approximate recurring date
    failFormalDate("RA/+1820/P0061Y"); // can't have approximate recurring date
  }

  private void failFormalDate(String formalDateString) {
    try {
      new FormalDate(formalDateString);
      fail("Should have failed to parse formal date string: " + formalDateString);
    }
    catch (IllegalArgumentException e) {
      // ok
    }
  }
  private FormalDate checkFormalDate(String formalDateString, boolean isApproximate, Integer startYear, boolean isRange, Integer endYear, Integer durationYears, Integer repetitions) {
    FormalDate formalDate = new FormalDate(formalDateString);
    assertEquals(isApproximate, formalDate.isApproximate());
    if (startYear == null) {
      assertNull(formalDate.getStart());
    }
    else {
      checkSimpleDate(formalDate.getStart(), startYear);
    }
    assertEquals(isRange, formalDate.isRange());
    if (endYear == null) {
      assertNull(formalDate.getEnd());
    }
    else {
      checkSimpleDate(formalDate.getEnd(), endYear);
    }
    if (durationYears == null) {
      assertNull(formalDate.getDuration());
    }
    else {
      assertEquals(durationYears, formalDate.getDuration().getYear());
    }
    if (repetitions == null) {
      assertFalse(formalDate.isRecurring());
    }
    else {
      assertTrue(formalDate.isRecurring());
      if (repetitions == 0) {
        assertNull(formalDate.getNumRepetitions());
      }
      else {
        assertEquals(repetitions, formalDate.getNumRepetitions());
      }
    }
    assertEquals(formalDateString, formalDate.toString());
    assertTrue(formalDate.isValid());
    return formalDate;
  }

  public void testSimpleDate() {
    FormalDate formalDate = roundTrip("+1830-04-06");
    checkSimpleDate(formalDate.getStart(), 1830, 4, 6, null, null, null, false, null, null);

    formalDate = new FormalDate("A+1820-12-31T23:59:01Z");
    assertTrue(formalDate.isApproximate());
    checkSimpleDate(formalDate.getStart(), 1820,12, 31, 23, 59, 1, true, null, null);
  }

  private void checkSimpleDate(SimpleDate simpleDate, int year) {
    checkSimpleDate(simpleDate, year, null, null, null, null, null, false, null, null);
  }

  private void checkSimpleDate(SimpleDate simpleDate, int year, Integer month, Integer day, Integer hour, Integer minute, Integer second, boolean isUTC, Integer tzHour, Integer tzMinute) {
    checkInt(year, simpleDate.getYear());
    checkInt(month, simpleDate.getMonth());
    checkInt(day, simpleDate.getDay());
    checkInt(hour, simpleDate.getHour());
    checkInt(minute, simpleDate.getMinute());
    checkInt(second, simpleDate.getSecond());
    checkInt(tzHour, simpleDate.getTimeZoneHours());
    checkInt(tzMinute, simpleDate.getTimeZoneMinutes());
    assertEquals(isUTC, simpleDate.isUTC());
    if (isUTC) {
      assertNull(simpleDate.getTimeZoneHours());
      assertNull(simpleDate.getTimeZoneMinutes());
    }
  }

  private void checkInt(Integer a, Integer b) {
    if (a == null) {
      assertNull(b);
    }
    else {
      assertNotNull(b);
      assertEquals(a.intValue(), b.intValue());
    }
  }

  private FormalDate roundTrip(String formalDateString) {
    FormalDate formalDate = new FormalDate(formalDateString);
    assertEquals(formalDateString, formalDate.toString());
    return formalDate;
  }

}


text:
var spawnPty = require('pty.js').spawn;

module.exports = setup;
setup.consumes = ["smith"];

function setup(config, imports, register) {
  var terminals = [];

  var command = config.command;
  var args = config.args || [];
  var options = config.options || {};

  imports.smith.on("setup", function (api) {
    api.spawn = spawn;
    api.write = write;
    api.end = end;
    api.resize = resize;
    api.life = life;
  });

  function life(callback) {}

  function spawn(callback) {
    var remote = this.remoteApi;
    var term = spawnPty(command, args, options);
    var fd = term.fd;
    console.log("Term created ", fd);
    remote.life(function (err) {
      term.kill();
    });
    terminals[fd] = term;
    term.on('data', function(chunk) {
      remote.onData(fd, chunk);
    });
    term.on('exit', function(code) {
      console.log("Term exited ", fd, code);
      delete terminals[fd];
      remote.onExit(fd, code);
    });
    callback(null, fd);
  }

  function write(fd, chunk) {
    var terminal = terminals[fd];
    if (!terminal) return;
    terminal.write(chunk);
  }

  function end(fd, chunk) {
    var terminal = terminals[fd];
    if (!terminal) return;
    terminal.end();
  }

  function resize(fd, width, height) {
    var terminal = terminals[fd];
    if (!terminal) return;
    terminal.resize(width, height);
  }

  register();
}


text:
@interface ALShopDetailViewController ()<UITableViewDataSource,UITableViewDelegate,ALShopDetailDelegate>

@property (nonatomic ,assign) NSInteger productNum;
@property (nonatomic ,assign) NSInteger commentNum;
@property (nonatomic ,weak) UITableView *tableView;
@property (nonatomic ,weak) ALShopDetailHeader *headerView;
@property (nonatomic ,strong) ALShopModel *shopModel;
@end

@implementation ALShopDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    _productNum = kproductNum;
    _commentNum = kcommentNum;

    self.titleLabel.text = @"商家详情";

    [self addSubviews];
    self.automaticallyAdjustsScrollViewInsets = NO;
//    self.tabBarController.tabBar.hidden = YES;
    [self loadData];
}

-(void)addSubviews{
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight + kNavBarHeight, kScreenWidth, kScreenHeight - kStatusBarHeight - kNavBarHeight) style:UITableViewStyleGrouped];

    tableView.delegate = self;
    tableView.dataSource = self;

    self.tableView = tableView;
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self.view addSubview:tableView];
    [self.view bringSubviewToFront:self.navBar];
}

-(void)loadData{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"shop_info" ofType:@"plist"];

    NSError *err = nil;

    NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:filePath];
    ALShopModel *shopModel = [[ALShopModel alloc] initWithDictionary:dict error:&err];
    self.shopModel = shopModel;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - UITableViewDataSource
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 4;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (section == 0)
        return 1;
    else if (section == 1)
        return self.productNum + 1;
    else if (section == 2)
        return self.commentNum + 1;
    else if (section == 2)
        return 1;
    else
        return 0;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        ALShopIntroCell * cell = [tableView dequeueReusableCellWithIdentifier:@"ALShopIntroCell"];
        if (cell == nil) {
            cell = [[NSBundle mainBundle]loadNibNamed:@"ALShopIntroCell" owner:nil options:nil][0];
        }
        cell.introLabel.text = self.shopModel.intro;
//        [cell.introLabel sizeToFit];
        CGRect rect = [cell.introLabel.text boundingRectWithSize:CGSizeMake(cell.introLabel.frame.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:nil context:nil];
        cell.introLabel.bounds = rect;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if(indexPath.section == 1){
        if (indexPath.row == self.productNum) {
            UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"moreCell"];
//            UIButton *moreBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 44)];
            UILabel *label = [[UILabel alloc] initWithFrame:cell.bounds];
            label.text = @"加载更多";
            label.font = [UIFont systemFontOfSize:17];
            label.textAlignment = NSTextAlignmentCenter;
            label.textColor = [UIColor colorWithRed:57/255. green:173/255. blue:246/255. alpha:1];
            [cell addSubview:label];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            return cell;
        }

        ALGoodsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ALGoodsCell"];
        if (cell == nil) {
            cell = [[NSBundle mainBundle] loadNibNamed:@"ALGoodsCell" owner:nil options:nil][0];
        }
        cell.nameLabel.text = [_shopModel.goods[indexPath.row] title];
        cell.priceLabel.text = [_shopModel.goods[indexPath.row] price];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"xx"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"xx"];
    }
    return cell;
}

#pragma mark - UITableViewDelegate

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 1) {

        if (indexPath.row == self.productNum) {
            [self getMoreProductCells];
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:2];
//            [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];

            [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
        }
    }

    if (indexPath.section == 2) {
        if (indexPath.row == self.productNum) {
            [self getMoreCommentCells];
        }
    }

}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (section == 0)
        return 250 * kScale;
    else if (section == 1)
        return 50;
    return 0;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    if (section == 0) {
        ALShopDetailHeader *headerView = [[NSBundle mainBundle]loadNibNamed:@"ALShopDetailHeader" owner:nil options:nil][0];
        headerView.delegate = self;
        headerView.shopModel = self.shopModel;
        self.headerView = headerView;
        return headerView;
    }else if(section == 1) {
        ALShopSectionHeader *headerView = [[ALShopSectionHeader alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)];
        headerView.imageView.image = [UIImage imageNamed:@"goodsHeader"];
        return headerView;
    }
    return nil;
}

-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0)
        return 50;
    else if (indexPath.section == 1)
        return 50;
    else
        return 0;
}

#pragma mark - ALShopDetailDelegate

-(void)presentVc:(UIViewController *)vc{
    [self presentViewController:vc animated:YES completion:^{

    }];
}

#pragma mark - Button Actions
-(void)getMoreProductCells{
    if (self.shopModel.goods.count - self.productNum > 1) {

        self.productNum += 2;
        [self.tableView reloadData];

    }else if(self.shopModel.goods.count - self.productNum == 1){
        self.productNum += 1;
        [self.tableView reloadData];
    }else{
        UIAlertView *alertView = [[UIAlertView alloc]
                                  initWithTitle:@"没有更多了"
                                  message:@"=。= ! ! ~"
                                  delegate:nil
                                  cancelButtonTitle:@"OK"
                                  otherButtonTitles: nil];

        [alertView show];
    }
}

-(void)getMoreCommentCells{
    NSLog(@"more comment cells");
}
@end


text:
'use strict';

const Hapi = require('hapi');

const server = new Hapi.Server();
server.connection({ host: '127.0.0.1', port: 8000 });

// Add Crumb plugin

server.register({ register: require('../'), options: { restful: true } }, (err) => {

    if (err) {
        throw err;
    }
});

server.route([

    // a "crumb" cookie should be set with any request
    // for cross-origin requests, set CORS "credentials" to true
    // a route returning the crumb can be created like this

    {
        method: 'GET',
        path: '/generate',
        handler: function (request, reply) {

            return reply({ crumb: server.plugins.crumb.generate(request, reply) });
        }
    },

    // request header "X-CSRF-Token" with crumb value must be set in request for this route

    {
        method: 'PUT',
        path: '/crumbed',
        handler: function (request, reply) {

            return reply('Crumb route');
        }
    }
]);

server.start(() => {

    console.log('Example restful server running at:', server.info.uri);
});


text:
button,[type="submit"],[type="button"]{appearance:none;background:none}
th{font-weight:normal}
body{font:.9em $defaultFontFamily;color:$primaryColor;background:#9c9c9c}
header{color:$headerFont;background-color:#0251b7;background-image:linear-gradient(top,#1a75cf 4.7%,#0251b7)}
.header{background:#000;color:#fff}
.footer{background:#f00;color:#fff}


text:
//
// Revit IFC Import library: this library works with Autodesk(R) Revit(R) to import IFC files.
// Copyright (C) 2015  Autodesk, Inc.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//

using Autodesk.Revit.DB;
using Autodesk.Revit.DB.IFC;
using Revit.IFC.Common.Utility;
using Revit.IFC.Common.Enums;

namespace Revit.IFC.Import.Data
{
    /// <summary>
    /// Class that represents IFCSurface entity
    /// </summary>
    public abstract class IFCSurface : IFCRepresentationItem
    {
        protected IFCSurface()
        {
        }

        override protected void Process(IFCAnyHandle ifcCurve)
        {
            base.Process(ifcCurve);
        }

        /// <summary>
        /// Get the local surface transform at a given point on the surface.
        /// </summary>
        /// <param name="pointOnSurface">The point.</param>
        /// <returns>The transform.</returns>
        public virtual Transform GetTransformAtPoint(XYZ pointOnSurface)
        {
            return null;
        }

        /// <summary>
        /// Create an IFCSurface object from a handle of type IfcSurface.
        /// </summary>
        /// <param name="ifcSurface">The IFC handle.</param>
        /// <returns>The IFCSurface object.</returns>
        public static IFCSurface ProcessIFCSurface(IFCAnyHandle ifcSurface)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcSurface))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcSurface);
                return null;
            }

            IFCEntity surface;
            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcSurface.StepId, out surface))
                return (surface as IFCSurface);

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcSurface, IFCEntityType.IfcElementarySurface))
                return IFCElementarySurface.ProcessIFCElementarySurface(ifcSurface);
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcSurface, IFCEntityType.IfcSweptSurface))
                return IFCSweptSurface.ProcessIFCSweptSurface(ifcSurface);

            Importer.TheLog.LogUnhandledSubTypeError(ifcSurface, IFCEntityType.IfcSurface, true);
            return null;
        }

        /// <summary>
        /// Returns the surface which defines the internal shape of the face
        /// </summary>
        /// <param name="lcs">The local coordinate system for the surface.  Can be null.</param>
        /// <returns>The surface which defines the internal shape of the face</returns>
        public virtual Surface GetSurface(Transform lcs)
        {
            return null;
        }
    }
}