text:
@implementation BowserAppDelegate

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
    return YES;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSError* theError = nil;
    BOOL result = YES;

    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

    // Change UserAgent to include Bowser as well as "not Chrome"
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    NSDictionary *defaults = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:kUserAgent, version, nil]
                                                         forKey:@"UserAgent"];
    [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];

    AVAudioSession* myAudioSession = [AVAudioSession sharedInstance];

    result = [myAudioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&theError];
    if (!result) {
        NSLog(@"setCategory failed");
    }

    result = [myAudioSession setActive:YES error:&theError];
    if (!result) {
        NSLog(@"setActive failed");
    }

    // Override point for customization after application launch.
    return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    if ([[url scheme] isEqualToString:@"bowser"]) {
        self.launchURL = [[url absoluteString] stringByReplacingOccurrencesOfString:@"bowser://" withString:@"http://"];
    }
    else if ([[url scheme] isEqualToString:@"bowsers"]) {
        self.launchURL = [[url absoluteString] stringByReplacingOccurrencesOfString:@"bowsers://" withString:@"https://"];
    }

    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

    if ([self.window.rootViewController isKindOfClass:[BowserViewController class]] &&
        [self.window.rootViewController respondsToSelector:@selector(saveFiles)])
    {
        [(BowserViewController*) self.window.rootViewController saveFiles];
    }
    [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end


text:
#import "AWSModel.h"

@class NSArray;

@interface AWSS3GetBucketTaggingOutput : AWSModel {
	NSArray* _tagSet;
}
@property(retain, nonatomic) NSArray* tagSet;
+ (id)JSONKeyPathsByPropertyKey;
+ (id)tagSetJSONTransformer;
- (void).cxx_destruct;
@end

redpajama_set_name: RedPajamaGithub


text:
namespace SharpDoc.Model
{
    /// <summary>
    /// An overridable member.
    /// </summary>
    public interface IOverridable : INMemberReference
    {

        /// <summary>
        /// Gets a value indicating whether this instance is virtual.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is virtual; otherwise, <c>false</c>.
        /// </value>
        bool IsVirtual { get; set; }

        /// <summary>
        /// Gets a value indicating whether this instance has overrides.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance has overrides; otherwise, <c>false</c>.
        /// </value>
        bool HasOverrides { get; }

        /// <summary>
        /// Gets or sets the overrides.
        /// </summary>
        /// <value>The overrides.</value>
        INMemberReference Overrides { get; set; }

        /// <summary>
        /// Gets a value indicating whether this instance has implements.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance has implements; otherwise, <c>false</c>.
        /// </value>
        bool HasImplements { get; }

        /// <summary>
        /// Gets or sets the implements.
        /// </summary>
        /// <value>The implements.</value>
        INMemberReference Implements { get; set; }
    }
}


text:
__all__ = ['nexpose']
from nexpose.nexpose import Nexpose, NexposeException


text:
package org.opentosca.toscana.core.csar;

import java.io.File;
import java.util.Objects;

import org.opentosca.toscana.core.parse.InvalidCsarException;
import org.opentosca.toscana.core.transformation.logging.Log;

import org.slf4j.Logger;

/**
 Responsible for detecting the path of an entrypoint (i.e., service template) of a csar.
 */
public class EntrypointDetector {

    private final Logger logger;
    private final Log log;

    EntrypointDetector(Log log) {
        this.log = Objects.requireNonNull(log);
        this.logger = log.getLogger(getClass());
    }

    /**
     Note: Entry points are currently only top level .yaml files.
     An entry point specified in the tosca metadata file is currently ignored

     @param csarRoot the file denoting the csar root dir
     @return the entry point yaml file of given csar
     @throws InvalidCsarException if no or more than one top level yaml file was found in given csar
     */
    File findEntryPoint(File csarRoot) throws InvalidCsarException {
        File[] entryPoints = csarRoot.listFiles((file, s) -> s.matches(".*\\.ya?ml$"));
        if (entryPoints == null) {
            logger.error(String.format("Given directory '%s' does not exist", csarRoot));
            throw new InvalidCsarException(log);
        }
        if (entryPoints.length == 1) {
            File entryPoint = entryPoints[0].getAbsoluteFile();
            logger.debug("Detected entry point of CSAR is '{}'", entryPoint.getName());
            return entryPoint;
        } else if (entryPoints.length > 1) {
            logger.warn("Parsing failed: more than one top level yaml file encountered in given csar");
            throw new InvalidCsarException(log);
        } else {
            logger.error("Parsing failed: no top level yaml file encountered in given csar");
            throw new InvalidCsarException(log);
        }
    }
}


text:
package config

import (
	"bytes"
	"fmt"
	"time"

	"github.com/pkg/errors"
	"github.com/spf13/viper"
)

// Client used to access the configurations.
type Client struct {
	Content string
	viper   *viper.Viper
}

// Set the value of a key.
func (c *Client) Set(key string, value interface{}) { c.viper.Set(key, value) }

// IsSet check if a given configuration exists.
func (c *Client) IsSet(key string) bool { return c.viper.IsSet(key) }

// GetString get the value as a string from a given configuration.
func (c *Client) GetString(key string) string { return c.viper.GetString(key) }

// GetStringSlice get the value as a []string from a given configuration.
func (c *Client) GetStringSlice(key string) []string { return c.viper.GetStringSlice(key) }

// GetInt get the value as a int from a given configuration.
func (c *Client) GetInt(key string) int { return c.viper.GetInt(key) }

// GetBool get the value as a bool from a given configuration.
func (c *Client) GetBool(key string) bool { return c.viper.GetBool(key) }

// GetDuration get the value as a time.Duration from a given configuration.
func (c *Client) GetDuration(key string) (time.Duration, error) {
	value := c.GetString(key)
	if value == "" {
		return 0, nil
	}

	duration, err := time.ParseDuration(value)
	if err != nil {
		return 0, errors.Wrap(err, fmt.Sprintf("error during parse '%s' to time.Duration", key))
	}
	return duration, nil
}

// Init the client instance.
func (c *Client) Init() error {
	c.viper = viper.New()
	c.viper.SetConfigType("toml")

	if err := c.viper.ReadConfig(bytes.NewBufferString(c.Content)); err != nil {
		return errors.Wrap(err, "error during config parse")
	}
	return nil
}


text:
Reports assignment to, or modification of static fields from within an instance method.

Although legal, such assignments are tricky to do
  safely and are often a result of marking fields static inadvertently.

Example:

  class Counter {
    private static int count = 0;

    void increment() {
      // Warning: updating a static field
      // from an instance method
      count++;
    }
  }


text:
#include "stromx/runtime/test/ServerTest.h"

#include <cppunit/TestAssert.h>

#include <boost/archive/text_iarchive.hpp>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/thread.hpp>

#include "stromx/runtime/DataContainer.h"
#include "stromx/runtime/Primitive.h"
#include <stromx/runtime/impl/SerializationHeader.h>
#include "stromx/runtime/impl/Server.h"

CPPUNIT_TEST_SUITE_REGISTRATION (stromx::runtime::ServerTest);

namespace stromx
{
    namespace runtime
    {
        namespace
        {
            using namespace boost::asio;

            void connectToServer(io_service & ioService, ip::tcp::socket & socket)
            {
                ip::tcp::resolver resolver(ioService);
                ip::tcp::resolver::query query("localhost", "49152");
                ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);

                boost::asio::connect(socket, endpoint_iterator);
            }

            unsigned int sizeFromBuffer(const char* data)
            {
                std::istringstream is(std::string(data, impl::SerializationHeader::NUM_SIZE_DIGITS));
                unsigned int size;
                is >> std::hex >> size;
                return size;
            }

            const impl::SerializationHeader receive(ip::tcp::socket& socket, std::string & text, std::string & file)
            {
                boost::array<char, impl::SerializationHeader::NUM_SIZE_DIGITS> headerSizeBuffer, textSizeBuffer, fileSizeBuffer;

                std::vector<mutable_buffer> sizeBuffers;
                sizeBuffers.push_back(buffer(headerSizeBuffer));
                sizeBuffers.push_back(buffer(textSizeBuffer));
                sizeBuffers.push_back(buffer(fileSizeBuffer));

                read(socket, sizeBuffers);

                unsigned int headerSize = sizeFromBuffer(headerSizeBuffer.data());
                unsigned int textSize = sizeFromBuffer(textSizeBuffer.data());
                unsigned int fileSize = sizeFromBuffer(fileSizeBuffer.data());

                std::vector<char> headerData(headerSize);
                std::vector<char> textData(textSize);
                std::vector<char> fileData(fileSize);

                std::vector<mutable_buffer> dataBuffers;
                dataBuffers.push_back(buffer(headerData));
                dataBuffers.push_back(buffer(textData));
                dataBuffers.push_back(buffer(fileData));

                read(socket, dataBuffers);

                text = std::string(textData.data(), textData.size());
                file = std::string(fileData.data(), fileData.size());

                impl::SerializationHeader header;
                std::istringstream headerStream(std::string(headerData.data(), headerData.size()));
                boost::archive::text_iarchive headerArchive(headerStream);
                headerArchive >> header;

                return header;
            }

            const impl::SerializationHeader uintHeader()
            {
                impl::SerializationHeader header;

                header.serverVersion = Version(0, 1, 0);
                header.package = "runtime";
                header.type = "UInt32";
                header.version = Version(0, 1, 0);

                return header;
            }
        }

        void ServerTest::setUp()
        {
            m_server = new impl::Server(49152);

            // wait a bit to increase the chance that the requested socket is available
            boost::this_thread::sleep_for(boost::chrono::seconds(1));
        }

        void ServerTest::tearDown()
        {
            if (m_server)
            {
                m_server->stop();
                m_server->join();
            }
            delete m_server;
        }

        void ServerTest::testConstructor()
        {
            CPPUNIT_ASSERT_EQUAL((unsigned int)(0), m_server->numConnections());
        }

        void ServerTest::testConnectFails()
        {
            using namespace boost::asio;

            io_service ioService;
            ip::tcp::socket socket(ioService);

            ip::tcp::resolver resolver(ioService);
            ip::tcp::resolver::query query("localhost", "50000");
            ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);

            CPPUNIT_ASSERT_THROW(boost::asio::connect(socket, endpoint_iterator), boost::system::system_error);
            CPPUNIT_ASSERT_EQUAL((unsigned int)(0), m_server->numConnections());
        }

        void ServerTest::testConnect()
        {
            using namespace boost::asio;

            io_service ioService;
            ip::tcp::socket socket(ioService);

            ip::tcp::resolver resolver(ioService);
            ip::tcp::resolver::query query("localhost", "49152");
            ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);

            CPPUNIT_ASSERT_NO_THROW(boost::asio::connect(socket, endpoint_iterator));

            m_server->waitForNumConnections(1);
            CPPUNIT_ASSERT_EQUAL((unsigned int)(1), m_server->numConnections());
        }

        void ServerTest::testConstructorFails()
        {
            CPPUNIT_ASSERT_THROW(impl::Server(49152), boost::system::system_error);
        }

        void ServerTest::testReceive()
        {
            using namespace boost::asio;

            io_service ioService;
            ip::tcp::socket socket(ioService);
            connectToServer(ioService, socket);

            DataContainer data(new UInt32(2));
            m_server->send(data);

            std::string text;
            std::string file;
            impl::SerializationHeader header = receive(socket, text, file);

            CPPUNIT_ASSERT_EQUAL(uintHeader(), header);
            CPPUNIT_ASSERT_EQUAL(std::string("2"), text);
            CPPUNIT_ASSERT_EQUAL(std::string(), file);
        }

        void ServerTest::testReceiveMultipleData()
        {
            using namespace boost::asio;

            io_service ioService;
            ip::tcp::socket socket(ioService);
            connectToServer(ioService, socket);

            DataContainer data2(new UInt32(2));
            DataContainer data10(new UInt32(10));

            m_server->send(data2);
            m_server->send(data10);

            std::string text;
            std::string file;
            impl::SerializationHeader header;

            header = receive(socket, text, file);
            CPPUNIT_ASSERT_EQUAL(uintHeader(), header);
            CPPUNIT_ASSERT_EQUAL(std::string("2"), text);
            CPPUNIT_ASSERT_EQUAL(std::string(), file);

            header = receive(socket, text, file);
            CPPUNIT_ASSERT_EQUAL(uintHeader(), header);
            CPPUNIT_ASSERT_EQUAL(std::string("10"), text);
            CPPUNIT_ASSERT_EQUAL(std::string(), file);
        }
    }
}


text:
class Status

# La partie n'est pas valide ou n'existe pas
sanspartie = 0

# un organisateur a crée la partie, et est en attente d'un joueur
attente_organisateur = 1

# Un candidat se présente à l'organisateur
presentation_candidat = 2

# Un candidat est en attente de la décision de l'organisateur
attente_candidat = 3

# En jeu
en_jeu = 4

# Égalité
egalite = 5

# L'organisateur gagne la partie
organisateur_gagnant = 6

# L'adversaire gagne la partie
adversaire_gagnant = 7

end


text:
package com.loftcat.ui.adapter;

import java.util.ArrayList;

import com.loftcat.R;
import com.loftcat.utils.log.LogCenter;
import com.loftcat.weibo.vo.UserVO;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class AtFriendslistAdapter extends BaseAdapter {
	private Context context;
	private ArrayList<UserVO> userVOs;

	public AtFriendslistAdapter(Context context, ArrayList<UserVO> userVOs) {
		this.userVOs = userVOs;
		this.context = context;
		Log.d("RESULT", userVOs.size() + "size");
	}

	public void reSetData(ArrayList<UserVO> userVOs) {
		this.userVOs = userVOs;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return userVOs.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		if (arg1 == null) {
			arg1 = ((Activity) context).getLayoutInflater().inflate(
					R.layout.frienditem_2, null);
		}
		TextView msg = (TextView) arg1.findViewById(R.id.frienditem_msg);
		msg.setText(userVOs.get(arg0).getName());
		return arg1;
	}

}


text:
NETPBM_COMMAND="jpegtopnm"
IMAGE="./img/skater.jpg"
PPM_IMAGE="./img/skater.ppm"
PGM_STENCIL="./stencils/box.pgm"
OUTPUT="./img/OUTPUT.ppm"
FINAL_IMAGE="./img/OUTPUT.jpg"
ITERATIONS=20
THREADS=8

echo
echo Running NetPBM Original to PPM conversion: $NETPBM_COMMAND $IMAGE
# echo "$NETPBM_COMMAND $IMAGE | pnmtopnm -plain > $PPM_IMAGE"
echo "$NETPBM_COMMAND $IMAGE | pnmtoplainpnm > $PPM_IMAGE"
# $NETPBM_COMMAND $IMAGE | pnmtopnm -plain > $PPM_IMAGE
$NETPBM_COMMAND $IMAGE | pnmtoplainpnm > $PPM_IMAGE
echo Finished converting image to PPM

echo
echo Applying image filter to PPM...
echo Source:  $PPM_IMAGE
echo Stencil: $PGM_STENCIL
echo Output:  $OUTPUT
echo Threads: $THREADS

echo
./filter_image -t $THREADS $PPM_IMAGE $PGM_STENCIL $OUTPUT $ITERATIONS
echo Filtered PPM written to $OUTPUT

echo
echo Running NetPBM PPM to Original conversion:
echo "$NETPBM_COMMAND $OUTPUT > $FINAL_IMAGE"
pnmtojpeg $OUTPUT > $FINAL_IMAGE


text:
package com.kotcrab.vis.ui.widget;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.utils.FocusListener;
import com.badlogic.gdx.utils.Array;
import com.kotcrab.vis.ui.util.InputValidator;
import com.kotcrab.vis.ui.util.Validators;

/**
 * Text field that input can be validated by custom input validators.
 * @author Kotcrab
 * @see InputValidator
 * @see Validators
 */
public class VisValidatableTextField extends VisTextField {
	private Array<InputValidator> validators = new Array<InputValidator>();
	private boolean validationEnabled = true;

	private LastValidFocusListener restoreFocusListener;
	private boolean restoreLastValid = false;
	private String lastValid;

	public VisValidatableTextField () {
		super();
		init();
	}

	public VisValidatableTextField (String text) {
		super(text);
		init();
	}

	public VisValidatableTextField (String text, String styleName) {
		super(text, styleName);
		init();
	}

	public VisValidatableTextField (String text, VisTextFieldStyle style) {
		super(text, style);
		init();
	}

	public VisValidatableTextField (InputValidator validator) {
		super();
		addValidator(validator);
		init();
	}

	public VisValidatableTextField (InputValidator... validators) {
		super();
		for (InputValidator validator : validators)
			addValidator(validator);

		init();
	}

	public VisValidatableTextField (boolean restoreLastValid, InputValidator validator) {
		super();
		addValidator(validator);
		init();
		setRestoreLastValid(restoreLastValid);
	}

	public VisValidatableTextField (boolean restoreLastValid, InputValidator... validators) {
		super();
		for (InputValidator validator : validators)
			addValidator(validator);

		init();
		setRestoreLastValid(restoreLastValid);
	}

	private void init () {
		setProgrammaticChangeEvents(true);
		setIgnoreEqualsTextChange(false);
	}

	@Override
	void beforeChangeEventFired () {
		validateInput();
	}

	@Override
	public void setText (String str) {
		super.setText(str);
		validateInput();
	}

	public void validateInput () {
		if (validationEnabled) {
			for (InputValidator validator : validators) {
				if (validator.validateInput(getText()) == false) {
					setInputValid(false);
					return;
				}
			}
		}

		// validation not enabled or validators does not returned false (input was valid)
		setInputValid(true);
	}

	public void addValidator (InputValidator validator) {
		validators.add(validator);
		validateInput();
	}

	public Array<InputValidator> getValidators () {
		return validators;
	}

	public boolean isValidationEnabled () {
		return validationEnabled;
	}

	/**
	 * Enables or disables validation, after changing this setting validateInput() is called, if validationEnabled == false then
	 * field is marked as valid otherwise standard validation is performed
	 * @param validationEnabled enable or disable validation
	 */
	public void setValidationEnabled (boolean validationEnabled) {
		this.validationEnabled = validationEnabled;
		validateInput();
	}

	public boolean isRestoreLastValid () {
		return restoreLastValid;
	}

	/**
	 * If true this field will automatically restore last valid text if it loses keyboard focus during text edition.
	 * This can't be called while field is selected, doing so will result in IllegalStateException. Default is false.
	 */
	public void setRestoreLastValid (boolean restoreLastValid) {
		if (hasSelection)
			throw new IllegalStateException("Last valid text restore can't be changed while filed has selection");

		this.restoreLastValid = restoreLastValid;

		if (restoreLastValid) {
			if (restoreFocusListener == null) restoreFocusListener = new LastValidFocusListener();
			addListener(restoreFocusListener);
		} else {
			removeListener(restoreFocusListener);
		}
	}

	public void restoreLastValidText () {
		if (restoreLastValid == false)
			throw new IllegalStateException("Restore last valid is not enabled, see #setRestoreLastValid(boolean)");

		//use super.setText to skip input validation and do not fire programmatic change event
		VisValidatableTextField.super.setText(lastValid);
		setInputValid(true);
	}

	private class LastValidFocusListener extends FocusListener {
		@Override
		public void keyboardFocusChanged (FocusEvent event, Actor actor, boolean focused) {
			if (focused && restoreLastValid) {
				lastValid = getText();
			}

			if (focused == false && isInputValid() == false && restoreLastValid) {
				restoreLastValidText();
			}
		}
	}
}


text:
/*-------------------------------------------------------------------------*/
/**
   @file    dict.h
   @author  N. Devillard
   @date    Apr 2011
   @brief   Dictionary object

   This file implements a basic string/string associative array that
   grows when needed to store all inserted key/value pairs. The implementation
   is very closely based on the Python dictionary, without the associated
   Pythonisms and with specification on string/string.
*/
/*--------------------------------------------------------------------------*/
#ifndef _DICT_H_
#define _DICT_H_

/*---------------------------------------------------------------------------
                                Includes
 ---------------------------------------------------------------------------*/

#include <stdlib.h>
#include <stdio.h>

/*---------------------------------------------------------------------------
                            Additional types
 ---------------------------------------------------------------------------*/

/** Keypair: holds a key/value pair. Key must be a hashable C string */
typedef struct _keypair_ {
    char    * key ;
    char    * val ;
    unsigned  hash ;
} keypair ;

/** Dict is the only type needed for clients of the dict object */
typedef struct _dict_ {
    unsigned  fill ;
    unsigned  used ;
    unsigned  size ;
    keypair * table ;
} dict ;

/*-------------------------------------------------------------------------*/
/**
  @brief    Allocate a new dictionary object
  @return   Newly allocated dict, to be freed with dict_free()

  Constructor for the dict object.
 */
/*--------------------------------------------------------------------------*/
dict * dict_new(void);

/*-------------------------------------------------------------------------*/
/**
  @brief    Deallocate a dictionary object
  @param    d   dict to deallocate
  @return   void

  This function will deallocate a dictionary and all data it holds.
 */
/*--------------------------------------------------------------------------*/
void   dict_free(dict * d);

/*-------------------------------------------------------------------------*/
/**
  @brief    Add an item to a dictionary
  @param    d       dict to add to
  @param    key     Key for the element to be inserted
  @param    val     Value to associate to the key
  @return   0 if Ok, something else in case of error

  Insert an element into a dictionary. If an element already exists with
  the same key, it is overwritten and the previous associated data are freed.
 */
/*--------------------------------------------------------------------------*/
int    dict_add(dict * d, char * key, char * val);

/*-------------------------------------------------------------------------*/
/**
  @brief    Get an item from a dictionary
  @param    d       dict to get item from
  @param    key     Key to look for
  @param    defval  Value to return if key is not found in dict
  @return   Element found, or defval

  Get the value associated to a given key in a dict. If the key is not found,
  defval is returned.
 */
/*--------------------------------------------------------------------------*/
char * dict_get(dict * d, char * key, char * defval);

/*-------------------------------------------------------------------------*/
/**
  @brief    Delete an item in a dictionary
  @param    d       dict where item is to be deleted
  @param    key     Key to look for
  @return   0 if Ok, something else in case of error

  Delete an item in a dictionary. Will return 0 if item was correctly
  deleted and -1 if the item could not be found or an error occurred.
 */
/*--------------------------------------------------------------------------*/
int dict_del(dict * d, char * key);

/*-------------------------------------------------------------------------*/
/**
  @brief    Enumerate a dictionary
  @param    d       dict to browse
  @param    rank    Rank to start the next (linear) search
  @param    key     Enumerated key (modified)
  @param    val     Enumerated value (modified)
  @return   int rank of the next item to enumerate, or -1 if end reached

  Enumerate a dictionary by returning all the key/value pairs it contains.
  Start the iteration by providing rank=0 and two pointers that will be
  modified to references inside the dict.
  The returned value is the immediate successor to the one being returned,
  or -1 if the end of dict was reached.
  Do not free or modify the returned key/val pointers.

  See dict_dump() for usage example.
 */
/*--------------------------------------------------------------------------*/
int dict_enumerate(dict * d, int rank, char ** key, char ** val);

/*-------------------------------------------------------------------------*/
/**
  @brief    Dump dict contents to an opened file pointer
  @param    d       dict to dump
  @param    out     File to output data to
  @return   void

  Dump the contents of a dictionary to an opened file pointer.
  It is Ok to pass 'stdout' or 'stderr' as file pointers.

  This function is mostly meant for debugging purposes.
 */
/*--------------------------------------------------------------------------*/
void   dict_dump(dict * d, FILE * out);

#endif


text:
package com.srotya.sidewinder.core.storage;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.function.Consumer;

import com.srotya.sidewinder.core.predicates.Predicate;
import com.srotya.sidewinder.core.storage.compression.FilteredValueException;
import com.srotya.sidewinder.core.storage.compression.Reader;
import com.srotya.sidewinder.core.storage.compression.ValueWriter;
import com.srotya.sidewinder.core.storage.compression.Writer;

public interface Field {

	public void addDataPoint(Measurement measurement, long value) throws IOException;

	public void loadBucketMap(Measurement measurement, List<BufferObject> bufferEntries) throws IOException;

	public FieldReaderIterator queryReader(Predicate predicate, Lock readLock) throws IOException;

	public int getWriterCount();

	public LinkedByteString getFieldId();

	public List<? extends Writer> getWriters();

	public List<Writer> compact(Measurement measurement, Lock writeLock,
			@SuppressWarnings("unchecked") Consumer<List<? extends Writer>>... functions) throws IOException;

	/**
	 * Get {@link Reader} with time and value filter predicates pushed-down to it.
	 *
	 * @param valuePredicate
	 * @return point in time instance of reader
	 * @throws IOException
	 */
	public static Reader getReader(ValueWriter writer, Predicate valuePredicate) throws IOException {
		Reader reader = writer.getReader();
		reader.setPredicate(valuePredicate);
		return reader;
	}

	public static void readerToPoints(List<Long> points, Reader reader) throws IOException {
		while (true) {
			try {
				try {
					long point = reader.read();
					points.add(point);
				} catch (FilteredValueException e) {
				}
			} catch (IOException e) {
				if (e instanceof RejectException) {
				} else {
					// getLo.log(Level.SEVERE, "Non rejectexception while reading datapoints", e);
				}
				break;
			}
		}
		if (reader.getCounter() != reader.getCount() || points.size() < reader.getCounter()) {
			// logger.finest(() -> "SDP:" + points.size() + "/" + reader.getCounter() + "/"
			// + reader.getCount());
		}
	}

}


text:
package org.apache.camel.management;

import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;

import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.management.event.ExchangeCompletedEvent;
import org.apache.camel.management.event.ExchangeCreatedEvent;
import org.apache.camel.management.event.ExchangeFailureHandledEvent;
import org.apache.camel.management.event.ExchangeRedeliveryEvent;
import org.apache.camel.management.event.ExchangeSendingEvent;
import org.apache.camel.management.event.ExchangeSentEvent;
import org.apache.camel.support.EventNotifierSupport;

/**
 * @version
 */
public class EventNotifierRedeliveryEventsTest extends ContextTestSupport {

    private static List<EventObject> events = new ArrayList<EventObject>();

    @Override
    public void setUp() throws Exception {
        events.clear();
        super.setUp();
    }

    @Override
    public boolean isUseRouteBuilder() {
        return false;
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        DefaultCamelContext context = new DefaultCamelContext(createRegistry());
        context.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {
            public void notify(EventObject event) throws Exception {
                events.add(event);
            }

            public boolean isEnabled(EventObject event) {
                return true;
            }

            @Override
            protected void doStart() throws Exception {
                setIgnoreCamelContextEvents(true);
                setIgnoreRouteEvents(true);
                setIgnoreServiceEvents(true);
            }

            @Override
            protected void doStop() throws Exception {
            }
        });
        return context;
    }

    public void testExchangeRedeliverySync() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                errorHandler(deadLetterChannel("mock:dead").maximumRedeliveries(4).redeliveryDelay(0));

                from("direct:start").throwException(new IllegalArgumentException("Damn"));
            }
        });
        context.start();

        getMockEndpoint("mock:dead").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
        assertTrue(oneExchangeDone.matchesMockWaitTime());

        assertEquals(11, events.size());

        assertIsInstanceOf(ExchangeSendingEvent.class, events.get(0));
        assertIsInstanceOf(ExchangeCreatedEvent.class, events.get(1));
        ExchangeRedeliveryEvent e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(2));
        assertEquals(1, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(3));
        assertEquals(2, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(4));
        assertEquals(3, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(5));
        assertEquals(4, e.getAttempt());
        assertIsInstanceOf(ExchangeSendingEvent.class, events.get(6));
        assertIsInstanceOf(ExchangeSentEvent.class, events.get(7));
        assertIsInstanceOf(ExchangeFailureHandledEvent.class, events.get(8));
        assertIsInstanceOf(ExchangeCompletedEvent.class, events.get(9));
        assertIsInstanceOf(ExchangeSentEvent.class, events.get(10));
    }

    public void testExchangeRedeliveryAsync() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                errorHandler(deadLetterChannel("mock:dead").maximumRedeliveries(4).asyncDelayedRedelivery().redeliveryDelay(10));

                from("direct:start").throwException(new IllegalArgumentException("Damn"));
            }
        });
        context.start();

        getMockEndpoint("mock:dead").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
        assertTrue(oneExchangeDone.matchesMockWaitTime());

        assertEquals(11, events.size());

        assertIsInstanceOf(ExchangeSendingEvent.class, events.get(0));
        assertIsInstanceOf(ExchangeCreatedEvent.class, events.get(1));
        ExchangeRedeliveryEvent e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(2));
        assertEquals(1, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(3));
        assertEquals(2, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(4));
        assertEquals(3, e.getAttempt());
        e = assertIsInstanceOf(ExchangeRedeliveryEvent.class, events.get(5));
        assertEquals(4, e.getAttempt());

        // since its async the ordering of the rest can be different depending per OS and timing
    }

}


text:
package com.github.jinahya.sql;

import com.github.jinahya.lang.FieldEnum;
import com.github.jinahya.lang.FieldEnumHelper;
import java.sql.DatabaseMetaData;

/**
 *
 * @author Jin Kwon <onacit at gmail.com>
 */
public enum DatabaseMetaDataDeferrability
    implements FieldEnum<DatabaseMetaDataDeferrability, Integer> {

    /**
     * A constant for {@link DatabaseMetaData#importedKeyInitiallyDeferred}.
     */
    importedKeyInitiallyDeferred(
    DatabaseMetaData.importedKeyInitiallyDeferred), // 5
    /**
     * A constant for {@link DatabaseMetaData#importedKeyInitiallyImmediate}.
     */
    importedKeyInitiallyImmediate(
    DatabaseMetaData.importedKeyInitiallyImmediate), // 6
    /**
     * A constant for {@link DatabaseMetaData#importedKeyNotDeferrable}.
     */
    importedKeyNotDeferrable(DatabaseMetaData.importedKeyNotDeferrable); // 7

    public static DatabaseMetaDataDeferrability fromFieldValue(
        final int fieldValue) {

        return FieldEnumHelper.fromFieldValue(
            DatabaseMetaDataDeferrability.class, Integer.valueOf(fieldValue));
    }

    public static Integer[] fieldValues() {

        return FieldEnumHelper.fieldValues(DatabaseMetaDataDeferrability.class,
                                           Integer.class);
    }

    private DatabaseMetaDataDeferrability(final int fieldValue) {

        this.fieldValue = fieldValue;
    }

    @Override
    public Integer getFieldValue() {

        return fieldValue;
    }

    /**
     * field value.
     */
    private final int fieldValue;

}


text:
var o = new Object();
Date instanceof o; // TypeError


text:
// ----------------------------------------------------------------------------
// Copyright 2007-2013, GeoTelematic Solutions, Inc.
// All rights reserved
// ----------------------------------------------------------------------------
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Change History:
//  2008/08/08  Martin D. Flynn
//     -Initial release
//  2008/08/15  Martin D. Flynn
//     -Added coordinate transformation
// ----------------------------------------------------------------------------
package org.opengts.util;

import java.util.*;

import org.opengts.util.*;

/**
*** A pixel point in 3D space
**/

public class PixelPoint
    implements Cloneable
{

    // ------------------------------------------------------------------------

    /**
    *** A private function performing the 'square' of the argument
    *** @param X  The argument to 'square'
    *** @return The square of X (ie. 'X' raised to the 2nd power)
    **/
    private static double SQ(double X) { return X * X; }

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------

    private double dX = 0.0;
    private double dY = 0.0;
    private double dZ = 0.0;    // not fully used

    /**
    *** Constructor
    **/
    public PixelPoint()
    {
        this(0.0, 0.0, 0.0);
    }

    /**
    *** Constructor
    *** @param x  X coordinate
    *** @param y  Y coordinate
    **/
    public PixelPoint(int x, int y)
    {
        this(x, y, 0);
    }

    /**
    *** Constructor
    *** @param x  X coordinate
    *** @param y  Y coordinate
    *** @param z  Z coordinate
    **/
    public PixelPoint(int x, int y, int z)
    {
        this.setX(x);
        this.setY(y);
        this.setZ(z);
    }

    /**
    *** Constructor
    *** @param x  X coordinate
    *** @param y  Y coordinate
    **/
    public PixelPoint(double x, double y)
    {
        this(x, y, 0.0);
    }

    /**
    *** Constructor
    *** @param x  X coordinate
    *** @param y  Y coordinate
    *** @param z  Z coordinate
    **/
    public PixelPoint(double x, double y, double z)
    {
        this.setX(x);
        this.setY(y);
        this.setZ(z);
    }

    /**
    *** Copy Constructor
    *** @param pp  The PixelPoint to copy
    **/
    public PixelPoint(PixelPoint pp)
    {
        this.setX((pp != null)? pp.getX() : 0.0);
        this.setY((pp != null)? pp.getY() : 0.0);
        this.setZ((pp != null)? pp.getZ() : 0.0);
    }

    // ------------------------------------------------------------------------

    /**
    *** Returns a copy of this PixelPoint
    *** @return A copy of this PixelPoint object
    **/
    public Object clone()
    {
        return new PixelPoint(this);
    }

    // ------------------------------------------------------------------------

    /**
    *** Sets the X coordinate value
    *** @param x  The X coordinate value
    **/
    public void setX(int x)
    {
        this.dX = (double)x;
    }

    /**
    *** Sets the X coordinate value
    *** @param x  The X coordinate value
    **/
    public void setX(double x)
    {
        this.dX = x;
    }

    /**
    *** Gets the X coordinate value
    *** @return The X coordinate value
    **/
    public double getX()
    {
        return this.dX;
    }

    /**
    *** Gets the X coordinate value as an integer
    *** @return The X coordinate integer value
    **/
    public int getIntX()
    {
        return (int)Math.round(this.dX);
    }

    // ------------------------------------------------------------------------

    /**
    *** Sets the Y coordinate value
    *** @param y  The Y coordinate value
    **/
    public void setY(int y)
    {
        this.dY = (double)y;
    }

    /**
    *** Sets the Y coordinate value
    *** @param y  The Y coordinate value
    **/
    public void setY(double y)
    {
        this.dY = y;
    }

    /**
    *** Gets the Y coordinate value
    *** @return The Y coordinate value
    **/
    public double getY()
    {
        return this.dY;
    }

    /**
    *** Gets the Y coordinate value as an integer
    *** @return The Y coordinate integer value
    **/
    public int getIntY()
    {
        return (int)Math.round(this.dY);
    }

    // ------------------------------------------------------------------------

    /**
    *** Sets the Z coordinate value
    *** @param z  The Z coordinate value
    **/
    public void setZ(int z)
    {
        this.dZ = (double)z;
    }

    /**
    *** Sets the Z coordinate value
    *** @param z  The Z coordinate value
    **/
    public void setZ(double z)
    {
        this.dZ = z;
    }

    /**
    *** Gets the Z coordinate value
    *** @return The Z coordinate value
    **/
    public double getZ()
    {
        return this.dZ;
    }

    /**
    *** Gets the Z coordinate value as an integer
    *** @return The Z coordinate integer value
    **/
    public int getIntZ()
    {
        return (int)Math.round(this.dZ);
    }

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------

    /**
    *** Returns the distance from this PixelPoint to the specified PixelPoint.
    *** @param pp  The other PixelPoint
    *** @return The distance to the other PixelPoint
    **/
    public double distanceToPixel(PixelPoint pp)
    {
        double deltaX = this.getX() - pp.getX();
        double deltaY = this.getY() - pp.getY();
        double deltaZ = this.getZ() - pp.getZ();
        return Math.sqrt(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ));
    }

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    // xn = a11*xm + a12*ym + a13*zm + a14
    // yn = a21*xm + a22*ym + a23*zm + a24
    // zn = a31*xm + a32*ym + a33*zm + a34

    /**
    *** Transforms this PixelPoint frame to world/parent 2D coordinates.
    *** @param thetaDeg  The degrees rotations in the world/parent coordinate frame.
    *** @return The new PixelPoint in world/parent 2D coordinates
    **/
    public PixelPoint toWorldCoordinates(double thetaDeg)
    {
        //  |  cos sin 0 |
        //  | -sin cos 0 |
        //  |   0   0  1 |
        double X        = this.getX();
        double Y        = this.getY();
        double thetaRad = thetaDeg * (Math.PI / 180.0);
        double cosTheta = Math.cos(thetaRad);
        double sinTheta = Math.sin(thetaRad);
        double newX     = (X *  cosTheta) + (Y * sinTheta);
        double newY     = (X * -sinTheta) + (Y * cosTheta);
        return new PixelPoint(newX, newY, this.getZ());
    }

    /**
    *** Transforms this PixelPoint frame (in world/parent coordinates) to a new coordinate
    *** frame rotated by the specified number of degrees.
    *** @param thetaDeg  The degrees rotations in the world/parent coordinate frame.
    *** @return The new PixelPoint in world/parent coordinates
    **/
    public PixelPoint fromWorldCoordinates(double thetaDeg)
    {
        return this.toWorldCoordinates(-thetaDeg);
    }

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------

    /**
    *** Format double value
    *** @param v  The double value
    *** @param d  The number of decimal places
    **/
    private static String _format(double v, int d)
    {
        if (d < 0) {
            return String.valueOf(v);
        } else
        if (d == 0) {
            return String.valueOf((int)Math.round(v));
        } else {
            String fmt = "0." + StringTools.replicateString("0",d);
            return StringTools.format(v,fmt);
        }
    }

    /**
    *** Returns a string representation of this PixelPoint
    *** @param dec  The number of decimal places
    *** @return The string representation of this PixelPoint
    **/
    public String toString(int dec)
    {
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        sb.append(_format(this.getX(),dec));
        sb.append(",");
        sb.append(_format(this.getY(),dec));
        sb.append("]");
        return sb.toString();
    }

    /**
    *** Returns a string representation of this PixelPoint
    *** @return The string representation of this PixelPoint
    **/
    public String toString()
    {
        return this.toString(-1);
    }

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------

    /**
    *** Main entry point for testing/debugging
    *** @param argv Comand-line arguments
    **/
    public static void main(String argv[])
    {
        RTConfig.setCommandLineArgs(argv);

        double X = RTConfig.getDouble("X",0.0);
        double Y = RTConfig.getDouble("Y",0.0);
        double T = RTConfig.getDouble("T",0.0);
        PixelPoint pp = new PixelPoint(X,Y);

        Print.sysPrintln(pp.toWorldCoordinates(T).toString(1));
    }

    // ------------------------------------------------------------------------

}


text:
package org.intellij.lang.regexp;

import com.intellij.psi.tree.IElementType;
import com.intellij.lang.Language;

public class RegExpElementType extends IElementType {
    RegExpElementType(String s) {
        super(s, Language.findInstance(RegExpLanguage.class));
    }
}


text:
.v-button:focus {
	background-image: url(img/left-focus.png); /** sprite-ref: buttons */
	outline: none;
	}

.v-button:focus .v-button-wrap {
	background-image: url(img/right-focus.png); /** sprite-ref: buttons; sprite-alignment: right */
	outline: none;
	}

.v-button:active,
.v-button.v-pressed {
	background-image: url(img/left-pressed.png); /** sprite-ref: buttons */
	outline: none;
	}

.v-button:active .v-button-wrap,
.v-button.v-pressed .v-button-wrap {
	background-image: url(img/right-pressed.png); /** sprite-ref: buttons; sprite-alignment: right */
	outline: none;
	}

.v-button,
.v-disabled.v-button {
	height: 26px;
	padding: 0 0 0 6px;
	background-color: transparent;
	background-repeat: no-repeat;
	background-image: url(img/left.png); /** sprite-ref: buttons */
	border: none;
	cursor: default;
	}

.v-button-wrap,
.v-disabled.v-button .v-button-wrap {
	display: block;
	height: 22px;
	padding: 4px 15px 0 9px;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: right top;
	background-image: url(img/right.png);  /** sprite-ref: buttons; sprite-alignment: right */
	}

.v-button-caption {
	color: #222;
	text-shadow: #fff 0 1px 0;
	font-weight: bold;
	font-size: 11px;
	line-height: 16px;
	}

/**************************
 * Black style
 **************************/
.black .v-button:focus {
	background-image: url(img/black/left-focus.png); /** sprite-ref: black-buttons */
	}

.black .v-button:focus .v-button-wrap {
	background-image: url(img/black/right-focus.png); /** sprite-ref: black-buttons; sprite-alignment: right */
	}

.black .v-button:active,
.black .v-button.v-pressed {
	background-image: url(img/black/left-pressed.png); /** sprite-ref: black-buttons */
	}

.black .v-button:active .v-button-wrap,
.black .v-button.v-pressed .v-button-wrap {
	background-image: url(img/black/right-pressed.png); /** sprite-ref: black-buttons; sprite-alignment: right */
	}

.black .v-button,
.black .v-disabled.v-button {
	background-image: url(img/black/left.png); /** sprite-ref: black-buttons */
	}

.black .v-button-wrap,
.black .v-disabled.v-button .v-button-wrap {
	background-image: url(img/black/right.png); /** sprite-ref: black-buttons; sprite-alignment: right */
	}

.black .v-button-caption {
	color: #c9ccce;
	text-shadow: #121314 0 -1px 0;
	}


text:
using MoM.Module.Interfaces;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MoM.CMS.Models
{
    [Table("NavigationMenu", Schema = "Core")]
    public partial class NavigationMenu : IDataEntity
    {
        public int NavigationMenuId { get; set; }
        [StringLength(100)]
        public string Name { get; set; }
        [StringLength(100)]
        public string DisplayName { get; set; }
        [StringLength(100)]
        public string IconClass { get; set; }

        public List<NavigationMenuItem> NavigationMenuItems { get; set; }
    }
}


text:
package io.quarkus.maven.dependency;

import java.nio.file.Path;

import io.quarkus.bootstrap.workspace.ArtifactSources;
import io.quarkus.bootstrap.workspace.WorkspaceModule;
import io.quarkus.paths.EmptyPathTree;
import io.quarkus.paths.MultiRootPathTree;
import io.quarkus.paths.PathCollection;
import io.quarkus.paths.PathTree;

public interface ResolvedDependency extends Dependency {

    PathCollection getResolvedPaths();

    default boolean isResolved() {
        final PathCollection paths = getResolvedPaths();
        return paths != null && !paths.isEmpty();
    }

    default WorkspaceModule getWorkspaceModule() {
        return null;
    }

    default ArtifactSources getSources() {
        final WorkspaceModule module = getWorkspaceModule();
        return module == null ? null : module.getSources(getClassifier());
    }

    default PathTree getContentTree() {
        final WorkspaceModule module = getWorkspaceModule();
        final PathTree workspaceTree = module == null ? EmptyPathTree.getInstance() : module.getContentTree(getClassifier());
        if (!workspaceTree.isEmpty()) {
            return workspaceTree;
        }
        final PathCollection paths = getResolvedPaths();
        if (paths == null || paths.isEmpty()) {
            return EmptyPathTree.getInstance();
        }
        if (paths.isSinglePath()) {
            final Path p = paths.getSinglePath();
            return isJar() ? PathTree.ofDirectoryOrArchive(p) : PathTree.ofDirectoryOrFile(p);
        }
        final PathTree[] trees = new PathTree[paths.size()];
        int i = 0;
        for (Path p : paths) {
            trees[i++] = PathTree.ofDirectoryOrArchive(p);
        }
        return new MultiRootPathTree(trees);
    }
}


text:
package main

import (
	"fmt"
	"log"
	"os"
	"os/signal"
	"syscall"

	"time"

	fglog "github.com/forestgiant/log"
	"github.com/forestgiant/portutil"
	"github.com/forestgiant/stela"
	"github.com/forestgiant/stela/api"
	"golang.org/x/net/context"
)

func main() {
	// Setup FG Logging
	logger := fglog.Logger{}.With("time", fglog.DefaultTimestamp, "caller", fglog.DefaultCaller, "service", "stela: membership example")

	// Create unique port for member
	port, err := portutil.GetUnique("tcp")
	if err != nil {
		log.Fatal(err)
	}

	// Create an insecure stela client
	ctx, cancelFunc := context.WithCancel(context.Background())
	stelaClient, err := api.NewClient(ctx, stela.DefaultStelaAddress, nil) // The default is localhost
	if err != nil {
		logger.Error("failed to create stela client:", "error", err.Error())
		os.Exit(1)
	}
	defer stelaClient.Close()
	serviceName := "members.test.fg"

	// Subscribe to that serviceName to be notified if anyone else registers a service
	subscribeCtx, cancelSubscribe := context.WithCancel(context.Background())
	defer cancelSubscribe()
	stelaClient.Subscribe(subscribeCtx, serviceName, func(s *stela.Service) {
		switch s.Action {
		case stela.RegisterAction:
			fmt.Printf("New member registered: %s:%d. With message: %v \n", s.IPv4, s.Port, stela.DecodeValue(s.Value))
		case stela.DeregisterAction:
			fmt.Printf("New member deregistered: %s:%d. With message: %v \n", s.IPv4, s.Port, stela.DecodeValue(s.Value))
		}

		// Print total members
		discoverCtx, cancelDiscover := context.WithTimeout(context.Background(), 500*time.Millisecond)
		defer cancelDiscover()
		services, err := stelaClient.Discover(discoverCtx, serviceName)
		if err != nil {
			logger.Error("failed to discover with stela:", "error", err.Error())
		}
		fmt.Println("Total members:", len(services))
	})

	// Now register with stela
	// Create a service
	memberService := &stela.Service{
		Name:  serviceName,
		Port:  int32(port),
		Value: stela.EncodeValue("Hello World."),
	}

	registerCtx, cancelRegister := context.WithTimeout(context.Background(), 500*time.Millisecond)
	defer cancelRegister()
	if err := stelaClient.Register(registerCtx, memberService); err != nil {
		logger.Error("failed to register with stela:", "error", err.Error())
		os.Exit(1)
	}

	// Print start message
	startMessage := fmt.Sprintf("Starting member on port: %d", port)
	fmt.Println(startMessage)

	// Listen for shutdown signal
	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
	go func() {
		select {
		case <-sigs:
			cancelFunc()
		}
	}()

	// Select will block until a signal comes in
	select {
	case <-ctx.Done():
		stelaClient.Close()
		fmt.Println("Closing member")
		return
	}
}


text:
<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">

<document>

    <title>Downloading Batik</title>
    <authors>
      <person name="Thomas DeWeese" email="deweese@apache.org"/>
    </authors>

    <s1 title="Downloading Batik">

        Use the links below to download the distributions of Batik
        from one of our mirrors.  It is good practice to verify the integrity of
        the distribution files, especially if you are using one of our
        mirror sites.  In order to do this you must use the signatures
        from our main
        distribution directory .

         Batik is only distributed as a zip archive.

        If you do not see the file you need in the links below, please
        see the master
        distribution directory or, preferably, its mirror.

    </s1>
    <s1 title="Mirror">

        You are currently using [preferred].  If you encounter
        a problem with this mirror, please select another mirror.  If
        all mirrors are failing, there are backup mirrors (at
        the end of the mirrors list) that should be available.

      <form action="[location]" method="get" id="SelectMirror">
        Other mirrors:
	<select name="Preferred">
          [if-any http][for http]
          <option value="[http]">[http]</option>
          [end][end][if-any ftp][for ftp]
          <option value="[ftp]">[ftp]</option>
          [end][end][if-any backup][for backup]
          <option value="[backup]">[backup] (backup)</option>
          [end][end]
        </select>
        <input type="submit" value="Change"/>
      </form>
    </s1>
    <s1 name="Current Release of Batik">

        Currently, Apache Batik 1.5 is the best available version, see
        the release notes.

Binary Release:
          batik-1.5.zip
          [
          PGP
          ][
          MD5
          ]

Source Release:
          batik-1.5.zip
          [
          PGP
          ][
          MD5
          ]

Documentation:
          batik-1.5.zip
          [
          PGP
          ][
          MD5
          ]

    </s1>
    <s1 title="Old Batik Releases">

        Older releases of Batik can be found
        here.
        We highly recommend to not use those releases but upgrade to
        Batik's latest
        release.

    </s1>
    <s1 title="Verify Releases">

        It is essential that you verify the integrity of the
        downloaded files using the PGP or MD5 signatures.

        The PGP signatures can be verified using PGP or GPG.  First
        download the KEYS as well
        as the asc signature file for the particular
        distribution.  Make sure you get these files from the main distribution
        directory , rather than from a mirror. Then verify the
        signatures using

          % pgpk -a KEYS

          % pgpv batik-1.5.zip.asc

        or

          % pgp -ka KEYS

          % pgp batik-1.5.zip.asc

        or

          % gpg --import KEYS

          % gpg --verify batik-1.5.zip.asc

        Alternatively, you can verify the MD5 signature on the files.
        A unix program called md5 or md5sum
        is included in many unix distributions.  It is also available
        as part of GNU
        Textutils .  Windows users can get binary md5 programs
        from here , here
        , or here .

        The PGP signature can provide a much higher level of assurance.

    </s1>

</document>


text:
id: 5900f3fe1000cf542c50ff11
title: 'Problema 146: Investigação de um padrão em números primos'
challengeType: 5
forumTopicId: 301775
dashedName: problem-146-investigating-a-prime-pattern
---

# --description--

O menor número inteiro positivo $n$ para o qual os números $n^2 + 1$, $n^2 + 3$, $n^2 + 7$, $n^2 + 9$, $n^2 + 13$, e $n^2 + 27$ são 10 números primos consecutivos. A soma de todos esses números inteiros $n$ abaixo de um milhão é 1242490.

Qual é a soma de todos esses números inteiros $n$ abaixo dos 150 milhões?

# --hints--

`primePattern()` deve retornar `676333270`.

```js
assert.strictEqual(primePattern(), 676333270);
```

# --seed--

## --seed-contents--

```js
function primePattern() {

  return true;
}

primePattern();
```

# --solutions--

```js
// solution required
```


text:
namespace
{
class CCoinsViewTest : public CCoinsView
{
    uint256 hashBestBlock_;
    std::map<uint256, CCoins> map_;

public:
    bool GetCoins(const uint256& txid, CCoins& coins) const
    {
        std::map<uint256, CCoins>::const_iterator it = map_.find(txid);
        if (it == map_.end()) {
            return false;
        }
        coins = it->second;
        if (coins.IsPruned() && InsecureRandBool() == 0) {
            // Randomly return false in case of an empty entry.
            return false;
        }
        return true;
    }

    bool HaveCoins(const uint256& txid) const
    {
        CCoins coins;
        return GetCoins(txid, coins);
    }

    uint256 GetBestBlock() const { return hashBestBlock_; }

    bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock)
    {
        for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {
            map_[it->first] = it->second.coins;
            if (it->second.coins.IsPruned() && InsecureRandRange(3) == 0) {
                // Randomly delete empty entries on write.
                map_.erase(it->first);
            }
            mapCoins.erase(it++);
        }
        mapCoins.clear();
        hashBestBlock_ = hashBlock;
        return true;
    }

    bool GetStats(CCoinsStats& stats) const { return false; }
};
}

BOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup)

static const unsigned int NUM_SIMULATION_ITERATIONS = 40000;

// This is a large randomized insert/remove simulation test on a variable-size
// stack of caches on top of CCoinsViewTest.
//
// It will randomly create/update/delete CCoins entries to a tip of caches, with
// txids picked from a limited list of random 256-bit hashes. Occasionally, a
// new tip is added to the stack of caches, or the tip is flushed and removed.
//
// During the process, booleans are kept to make sure that the randomized
// operation hits all branches.
BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
{
    // Various coverage trackers.
    bool removed_all_caches = false;
    bool reached_4_caches = false;
    bool added_an_entry = false;
    bool removed_an_entry = false;
    bool updated_an_entry = false;
    bool found_an_entry = false;
    bool missed_an_entry = false;

    // A simple map to track what we expect the cache stack to represent.
    std::map<uint256, CCoins> result;

    // The cache stack.
    CCoinsViewTest base; // A CCoinsViewTest at the bottom.
    std::vector<CCoinsViewCache*> stack; // A stack of CCoinsViewCaches on top.
    stack.push_back(new CCoinsViewCache(&base)); // Start with one cache.

    // Use a limited set of random transaction ids, so we do test overwriting entries.
    std::vector<uint256> txids;
    txids.resize(NUM_SIMULATION_ITERATIONS / 8);
    for (unsigned int i = 0; i < txids.size(); i++) {
        txids[i] = InsecureRand256();
    }

    for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {
        // Do a random modification.
        {
            uint256 txid = txids[InsecureRandRange(txids.size())]; // txid we're going to modify in this iteration.
            CCoins& coins = result[txid];
            CCoinsModifier entry = stack.back()->ModifyCoins(txid);
            BOOST_CHECK(coins == *entry);
            if (InsecureRandRange(5) == 0 || coins.IsPruned()) {
                if (coins.IsPruned()) {
                    added_an_entry = true;
                } else {
                    updated_an_entry = true;
                }
                coins.nVersion = InsecureRand32();
                coins.vout.resize(1);
                coins.vout[0].nValue = InsecureRand32();
                *entry = coins;
            } else {
                coins.Clear();
                entry->Clear();
                removed_an_entry = true;
            }
        }

        // Once every 1000 iterations and at the end, verify the full cache.
        if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {
            for (std::map<uint256, CCoins>::iterator it = result.begin(); it != result.end(); it++) {
                const CCoins* coins = stack.back()->AccessCoins(it->first);
                if (coins) {
                    BOOST_CHECK(*coins == it->second);
                    found_an_entry = true;
                } else {
                    BOOST_CHECK(it->second.IsPruned());
                    missed_an_entry = true;
                }
            }
        }

        if (InsecureRandRange(100) == 0) {
            // Every 100 iterations, change the cache stack.
            if (stack.size() > 0 && InsecureRandBool() == 0) {
                stack.back()->Flush();
                delete stack.back();
                stack.pop_back();
            }
            if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {
                CCoinsView* tip = &base;
                if (stack.size() > 0) {
                    tip = stack.back();
                } else {
                    removed_all_caches = true;
                }
                stack.push_back(new CCoinsViewCache(tip));
                if (stack.size() == 4) {
                    reached_4_caches = true;
                }
            }
        }
    }

    // Clean up the stack.
    while (stack.size() > 0) {
        delete stack.back();
        stack.pop_back();
    }

    // Verify coverage.
    BOOST_CHECK(removed_all_caches);
    BOOST_CHECK(reached_4_caches);
    BOOST_CHECK(added_an_entry);
    BOOST_CHECK(removed_an_entry);
    BOOST_CHECK(updated_an_entry);
    BOOST_CHECK(found_an_entry);
    BOOST_CHECK(missed_an_entry);
}

BOOST_AUTO_TEST_CASE(ccoins_serialization)
{
    // Good example
    CDataStream ss1(ParseHex("0108835800816115944e077fe7c803cfa57f29b36bf87c1d35b4934b"), SER_DISK, CLIENT_VERSION);
    CCoins cc1;
    ss1 >> cc1;
    BOOST_CHECK_EQUAL(cc1.nVersion, 1);
    BOOST_CHECK_EQUAL(cc1.fCoinBase, false);
    BOOST_CHECK_EQUAL(cc1.nHeight, 870987);
    BOOST_CHECK_EQUAL(cc1.vout.size(), 2);
    BOOST_CHECK_EQUAL(cc1.IsAvailable(0), false);
    BOOST_CHECK_EQUAL(cc1.IsAvailable(1), true);
    BOOST_CHECK_EQUAL(cc1.vout[1].nValue, 60000000000ULL);
    BOOST_CHECK_EQUAL(HexStr(cc1.vout[1].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("816115944e077fe7c803cfa57f29b36bf87c1d35"))))));

    // Good example
    CDataStream ss2(ParseHex("0111044086ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4eebbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa482d21f"), SER_DISK, CLIENT_VERSION);
    CCoins cc2;
    ss2 >> cc2;
    BOOST_CHECK_EQUAL(cc2.nVersion, 1);
    BOOST_CHECK_EQUAL(cc2.fCoinBase, true);
    BOOST_CHECK_EQUAL(cc2.nHeight, 59807);
    BOOST_CHECK_EQUAL(cc2.vout.size(), 17);
    for (int i = 0; i < 17; i++) {
        BOOST_CHECK_EQUAL(cc2.IsAvailable(i), i == 4 || i == 16);
    }
    BOOST_CHECK_EQUAL(cc2.vout[4].nValue, 234925952);
    BOOST_CHECK_EQUAL(HexStr(cc2.vout[4].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("61b01caab50f1b8e9c50a5057eb43c2d9563a4ee"))))));
    BOOST_CHECK_EQUAL(cc2.vout[16].nValue, 110397);
    BOOST_CHECK_EQUAL(HexStr(cc2.vout[16].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("8c988f1a4a4de2161e0f50aac7f17e7f9555caa4"))))));

    // Smallest possible example
    CDataStream ssx(SER_DISK, CLIENT_VERSION);
    BOOST_CHECK_EQUAL(HexStr(ssx.begin(), ssx.end()), "");

    CDataStream ss3(ParseHex("0004000600"), SER_DISK, CLIENT_VERSION);
    CCoins cc3;
    ss3 >> cc3;
    BOOST_CHECK_EQUAL(cc3.nVersion, 0);
    BOOST_CHECK_EQUAL(cc3.fCoinBase, false);
    BOOST_CHECK_EQUAL(cc3.nHeight, 0);
    BOOST_CHECK_EQUAL(cc3.vout.size(), 1);
    BOOST_CHECK_EQUAL(cc3.IsAvailable(0), true);
    BOOST_CHECK_EQUAL(cc3.vout[0].nValue, 0);
    BOOST_CHECK_EQUAL(cc3.vout[0].scriptPubKey.size(), 0);

    // scriptPubKey that ends beyond the end of the stream
    CDataStream ss4(ParseHex("0004000800"), SER_DISK, CLIENT_VERSION);
    try {
        CCoins cc4;
        ss4 >> cc4;
        BOOST_CHECK_MESSAGE(false, "We should have thrown");
    } catch (const std::ios_base::failure& e) {
    }

    // Very large scriptPubKey (3*10^9 bytes) past the end of the stream
    CDataStream tmp(SER_DISK, CLIENT_VERSION);
    uint64_t x = 3000000000ULL;
    tmp << VARINT(x);
    BOOST_CHECK_EQUAL(HexStr(tmp.begin(), tmp.end()), "8a95c0bb00");
    CDataStream ss5(ParseHex("0002008a95c0bb0000"), SER_DISK, CLIENT_VERSION);
    try {
        CCoins cc5;
        ss5 >> cc5;
        BOOST_CHECK_MESSAGE(false, "We should have thrown");
    } catch (const std::ios_base::failure& e) {
    }
}

BOOST_AUTO_TEST_SUITE_END()


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
G. Bentham, Pl. hartw. 342. 1857

#### Original name
null

### Remarks
null


text:
package org.bitcoinj.script;

import java.util.HashMap;
import java.util.Map;

public enum ScriptError {

    SCRIPT_ERR_OK("OK"),
    SCRIPT_ERR_UNKNOWN_ERROR("UNKNOWN_ERROR"),
    SCRIPT_ERR_EVAL_FALSE("EVAL_FALSE"),
    SCRIPT_ERR_OP_RETURN("OP_RETURN"),

    /* Max sizes */
    SCRIPT_ERR_SCRIPT_SIZE("SCRIPT_SIZE"),
    SCRIPT_ERR_PUSH_SIZE("PUSH_SIZE"),
    SCRIPT_ERR_OP_COUNT("OP_COUNT"),
    SCRIPT_ERR_STACK_SIZE("STACK_SIZE"),
    SCRIPT_ERR_SIG_COUNT("SIG_COUNT"),
    SCRIPT_ERR_PUBKEY_COUNT("PUBKEY_COUNT"),

    /* Failed verify operations */
    SCRIPT_ERR_VERIFY("VERIFY"),
    SCRIPT_ERR_EQUALVERIFY("EQUALVERIFY"),
    SCRIPT_ERR_CHECKMULTISIGVERIFY("CHECKMULTISIGVERIFY"),
    SCRIPT_ERR_CHECKSIGVERIFY("CHECKSIGVERIFY"),
    SCRIPT_ERR_NUMEQUALVERIFY("NUMEQUALVERIFY"),

    /* Logical/Format/Canonical errors */
    SCRIPT_ERR_BAD_OPCODE("BAD_OPCODE"),
    SCRIPT_ERR_DISABLED_OPCODE("DISABLED_OPCODE"),
    SCRIPT_ERR_INVALID_STACK_OPERATION("INVALID_STACK_OPERATION"),
    SCRIPT_ERR_INVALID_ALTSTACK_OPERATION("INVALID_ALTSTACK_OPERATION"),
    SCRIPT_ERR_UNBALANCED_CONDITIONAL("UNBALANCED_CONDITIONAL"),

    /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
    SCRIPT_ERR_NEGATIVE_LOCKTIME("NEGATIVE_LOCKTIME"),
    SCRIPT_ERR_UNSATISFIED_LOCKTIME("UNSATISFIED_LOCKTIME"),

    /* Malleability */
    SCRIPT_ERR_SIG_HASHTYPE("SIG_HASHTYPE"),
    SCRIPT_ERR_SIG_DER("SIG_DER"),
    SCRIPT_ERR_MINIMALDATA("MINIMALDATA"),
    SCRIPT_ERR_SIG_PUSHONLY("SIG_PUSHONLY"),
    SCRIPT_ERR_SIG_HIGH_S("SIG_HIGH_S"),
    SCRIPT_ERR_SIG_NULLDUMMY("SIG_NULLDUMMY"),
    SCRIPT_ERR_PUBKEYTYPE("PUBKEYTYPE"),
    SCRIPT_ERR_CLEANSTACK("CLEANSTACK"),
    SCRIPT_ERR_MINIMALIF("MINIMALIF"),
    SCRIPT_ERR_SIG_NULLFAIL("NULLFAIL"),

    /* softfork safeness */
    SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS("DISCOURAGE_UPGRADABLE_NOPS"),
    SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM("DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"),

    SCRIPT_ERR_ERROR_COUNT("ERROR_COUNT");

    private final String mnemonic;
    private static final Map<String, ScriptError> mnemonicToScriptErrorMap;

    private ScriptError(String name) {
        this.mnemonic = name;
    }

    static {
        mnemonicToScriptErrorMap = new HashMap<>();
        for (ScriptError err : ScriptError.values()) {
            mnemonicToScriptErrorMap.put(err.getMnemonic(), err);
        }
    }

    public String getMnemonic() {
        return mnemonic;
    }

    public static ScriptError fromMnemonic(String name) {
        ScriptError err = mnemonicToScriptErrorMap.get(name);
        if (err == null)
            throw new IllegalArgumentException(name + " is not a valid name");
        return err;
    }
}


text:
package org.apache.parquet.hadoop;

import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import org.apache.parquet.ParquetReadOptions;
import org.apache.parquet.Preconditions;
import org.apache.parquet.compression.CompressionCodecFactory;
import org.apache.parquet.filter.UnboundRecordFilter;
import org.apache.parquet.filter2.compat.FilterCompat;
import org.apache.parquet.filter2.compat.FilterCompat.Filter;
import org.apache.parquet.hadoop.api.ReadSupport;
import org.apache.parquet.hadoop.util.HadoopInputFile;
import org.apache.parquet.HadoopReadOptions;
import org.apache.parquet.hadoop.util.HiddenFileFilter;
import org.apache.parquet.io.InputFile;

/**
 * Read records from a Parquet file.
 * TODO: too many constructors (https://issues.apache.org/jira/browse/PARQUET-39)
 */
public class ParquetReader<T> implements Closeable {

  private final ReadSupport<T> readSupport;
  private final Iterator<InputFile> filesIterator;
  private final ParquetReadOptions options;

  private InternalParquetRecordReader<T> reader;

  /**
   * @param file the file to read
   * @param readSupport to materialize records
   * @throws IOException if there is an error while reading
   * @deprecated use {@link #builder(ReadSupport, Path)}
   */
  @Deprecated
  public ParquetReader(Path file, ReadSupport<T> readSupport) throws IOException {
    this(new Configuration(), file, readSupport, FilterCompat.NOOP);
  }

  /**
   * @param conf the configuration
   * @param file the file to read
   * @param readSupport to materialize records
   * @throws IOException if there is an error while reading
   * @deprecated use {@link #builder(ReadSupport, Path)}
   */
  @Deprecated
  public ParquetReader(Configuration conf, Path file, ReadSupport<T> readSupport) throws IOException {
    this(conf, file, readSupport, FilterCompat.NOOP);
  }

  /**
   * @param file the file to read
   * @param readSupport to materialize records
   * @param unboundRecordFilter the filter to use to filter records
   * @throws IOException if there is an error while reading
   * @deprecated use {@link #builder(ReadSupport, Path)}
   */
  @Deprecated
  public ParquetReader(Path file, ReadSupport<T> readSupport, UnboundRecordFilter unboundRecordFilter) throws IOException {
    this(new Configuration(), file, readSupport, FilterCompat.get(unboundRecordFilter));
  }

  /**
   * @param conf the configuration
   * @param file the file to read
   * @param readSupport to materialize records
   * @param unboundRecordFilter the filter to use to filter records
   * @throws IOException if there is an error while reading
   * @deprecated use {@link #builder(ReadSupport, Path)}
   */
  @Deprecated
  public ParquetReader(Configuration conf, Path file, ReadSupport<T> readSupport, UnboundRecordFilter unboundRecordFilter) throws IOException {
    this(conf, file, readSupport, FilterCompat.get(unboundRecordFilter));
  }

  private ParquetReader(Configuration conf,
                        Path file,
                        ReadSupport<T> readSupport,
                        FilterCompat.Filter filter) throws IOException {
    this(Collections.singletonList((InputFile) HadoopInputFile.fromPath(file, conf)),
        HadoopReadOptions.builder(conf)
            .withRecordFilter(Objects.requireNonNull(filter, "filter cannot be null"))
            .build(),
        readSupport);
  }

  private ParquetReader(List<InputFile> files,
                        ParquetReadOptions options,
                        ReadSupport<T> readSupport) throws IOException {
    this.readSupport = readSupport;
    this.options = options;
    this.filesIterator = files.iterator();
  }

  /**
   * @return the next record or null if finished
   * @throws IOException if there is an error while reading
   */
  public T read() throws IOException {
    try {
      if (reader != null && reader.nextKeyValue()) {
        return reader.getCurrentValue();
      } else {
        initReader();
        return reader == null ? null : read();
      }
    } catch (InterruptedException e) {
      throw new IOException(e);
    }
  }

  private void initReader() throws IOException {
    if (reader != null) {
      reader.close();
      reader = null;
    }

    if (filesIterator.hasNext()) {
      InputFile file = filesIterator.next();

      ParquetFileReader fileReader = ParquetFileReader.open(file, options);

      reader = new InternalParquetRecordReader<>(readSupport, options.getRecordFilter());

      reader.initialize(fileReader, options);
    }
  }

  @Override
  public void close() throws IOException {
    if (reader != null) {
      reader.close();
    }
  }

  public static <T> Builder<T> read(InputFile file) throws IOException {
    return new Builder<>(file);
  }

  public static <T> Builder<T> builder(ReadSupport<T> readSupport, Path path) {
    return new Builder<>(readSupport, path);
  }

  public static class Builder<T> {
    private final ReadSupport<T> readSupport;
    private final InputFile file;
    private final Path path;
    private Filter filter = null;
    protected Configuration conf;
    private ParquetReadOptions.Builder optionsBuilder;

    @Deprecated
    private Builder(ReadSupport<T> readSupport, Path path) {
      this.readSupport = Objects.requireNonNull(readSupport, "readSupport cannot be null");
      this.file = null;
      this.path = Objects.requireNonNull(path, "path cannot be null");
      this.conf = new Configuration();
      this.optionsBuilder = HadoopReadOptions.builder(conf);
    }

    @Deprecated
    protected Builder(Path path) {
      this.readSupport = null;
      this.file = null;
      this.path = Objects.requireNonNull(path, "path cannot be null");
      this.conf = new Configuration();
      this.optionsBuilder = HadoopReadOptions.builder(conf);
    }

    protected Builder(InputFile file) {
      this.readSupport = null;
      this.file = Objects.requireNonNull(file, "file cannot be null");
      this.path = null;
      if (file instanceof HadoopInputFile) {
        this.conf = ((HadoopInputFile) file).getConfiguration();
      } else {
        this.conf = new Configuration();
      }
      optionsBuilder = HadoopReadOptions.builder(conf);
    }

    // when called, resets options to the defaults from conf
    public Builder<T> withConf(Configuration conf) {
      this.conf = Objects.requireNonNull(conf, "conf cannot be null");

      // previous versions didn't use the builder, so may set filter before conf. this maintains
      // compatibility for filter. other options are reset by a new conf.
      this.optionsBuilder = HadoopReadOptions.builder(conf);
      if (filter != null) {
        optionsBuilder.withRecordFilter(filter);
      }

      return this;
    }

    public Builder<T> withFilter(Filter filter) {
      this.filter = filter;
      optionsBuilder.withRecordFilter(filter);
      return this;
    }

    public Builder<T> useSignedStringMinMax(boolean useSignedStringMinMax) {
      optionsBuilder.useSignedStringMinMax(useSignedStringMinMax);
      return this;
    }

    public Builder<T> useSignedStringMinMax() {
      optionsBuilder.useSignedStringMinMax();
      return this;
    }

    public Builder<T> useStatsFilter(boolean useStatsFilter) {
      optionsBuilder.useStatsFilter(useStatsFilter);
      return this;
    }

    public Builder<T> useStatsFilter() {
      optionsBuilder.useStatsFilter();
      return this;
    }

    public Builder<T> useDictionaryFilter(boolean useDictionaryFilter) {
      optionsBuilder.useDictionaryFilter(useDictionaryFilter);
      return this;
    }

    public Builder<T> useDictionaryFilter() {
      optionsBuilder.useDictionaryFilter();
      return this;
    }

    public Builder<T> useRecordFilter(boolean useRecordFilter) {
      optionsBuilder.useRecordFilter(useRecordFilter);
      return this;
    }

    public Builder<T> useRecordFilter() {
      optionsBuilder.useRecordFilter();
      return this;
    }

    public Builder<T> useColumnIndexFilter(boolean useColumnIndexFilter) {
      optionsBuilder.useColumnIndexFilter(useColumnIndexFilter);
      return this;
    }

    public Builder<T> useColumnIndexFilter() {
      optionsBuilder.useColumnIndexFilter();
      return this;
    }

    public Builder<T> usePageChecksumVerification(boolean usePageChecksumVerification) {
      optionsBuilder.usePageChecksumVerification(usePageChecksumVerification);
      return this;
    }

    public Builder<T> useBloomFilter(boolean useBloomFilter) {
      optionsBuilder.useBloomFilter(useBloomFilter);
      return this;
    }

    public Builder<T> useBloomFilter() {
      optionsBuilder.useBloomFilter();
      return this;
    }

    public Builder<T> usePageChecksumVerification() {
      optionsBuilder.usePageChecksumVerification();
      return this;
    }

    public Builder<T> withFileRange(long start, long end) {
      optionsBuilder.withRange(start, end);
      return this;
    }

    public Builder<T> withCodecFactory(CompressionCodecFactory codecFactory) {
      optionsBuilder.withCodecFactory(codecFactory);
      return this;
    }

    public Builder<T> set(String key, String value) {
      optionsBuilder.set(key, value);
      return this;
    }

    protected ReadSupport<T> getReadSupport() {
      // if readSupport is null, the protected constructor must have been used
      Preconditions.checkArgument(readSupport != null,
          "[BUG] Classes that extend Builder should override getReadSupport()");
      return readSupport;
    }

    public ParquetReader<T> build() throws IOException {
      ParquetReadOptions options = optionsBuilder.build();

      if (path != null) {
        FileSystem fs = path.getFileSystem(conf);
        FileStatus stat = fs.getFileStatus(path);

        if (stat.isFile()) {
          return new ParquetReader<>(
              Collections.singletonList((InputFile) HadoopInputFile.fromStatus(stat, conf)),
              options,
              getReadSupport());

        } else {
          List<InputFile> files = new ArrayList<>();
          for (FileStatus fileStatus : fs.listStatus(path, HiddenFileFilter.INSTANCE)) {
            files.add(HadoopInputFile.fromStatus(fileStatus, conf));
          }
          return new ParquetReader<T>(files, options, getReadSupport());
        }

      } else {
        return new ParquetReader<>(Collections.singletonList(file), options, getReadSupport());
      }
    }
  }
}


text:
*oqpi* pronounced _occupy_ is a header only concurrency library designed to be as easy to use as possible.

oqpi helps you reach that 100% core occupancy you're aiming for.

## Example
```cpp
#define OQPI_DEFAULT
#include "oqpi.hpp"

// Define our toolkit
using oqpi_tk = oqpi::default_helpers;

int main()
{
    // This will start a scheduler with a default workers configuration
    oqpi_tk::start_default_scheduler();

    // oqpi has 3 concepts for tasks:

    // The first one is the unit task:
    const auto taskHandle = oqpi_tk::schedule_task
    (
        "UnitTask"
        , [] { std::cout << "Hello! I'm a unit task!" << std::endl; }
    );
    taskHandle.wait();

    // The second one is the sequence:
    const auto sequenceHandle = oqpi_tk::sequence_tasks<oqpi::task_type::waitable>
    (
        "Sequence"
        , oqpi_tk::make_task_item("Seq1", [] { std::cout << "Hello! ";                     })
        , oqpi_tk::make_task_item("Seq2", [] { std::cout << "I am ";                       })
        , oqpi_tk::make_task_item("Seq3", [] { std::cout << "a sequence!" << std::endl;    })
    );
    sequenceHandle.wait();

    // The third and last one is the fork (or the parallel group)
    const auto forkHandle = oqpi_tk::fork_tasks<oqpi::task_type::waitable>
    (
        "Fork"
        , oqpi_tk::make_task_item("Fork1", [] { std::cout << "Hello! ";                 })
        , oqpi_tk::make_task_item("Fork2", [] { std::cout << "I am ";                   })
        , oqpi_tk::make_task_item("Fork3", [] { std::cout << "a fork!" << std::endl;    })
    );
    forkHandle.wait();

    // Stops the workers and join the threads
    oqpi_tk::stop_scheduler();
}
```

## Documentation
_Coming soon..._


text:
_photographer **rokma** presents:_

# KRAP serie

### [Compact Skateboarding History](http://krap.junglestar.org)

>#### An off-center, time-lined view, of a recent 'beyond-sport' phenomena that went global.

![intro screen](screen.png)

![intro screen](shot2.png)

![intro screen](shot1.png)

![intro screen](shot3.png)

>It had to be learnt and cannot be taught.

## Warning:

Despite this repo being public, it doesn't mean that all these assets, nor the concept, are open-source and/or copyright free, or even that you may use any of them. Please, ask for permission first by contacting us: info@junglestar.org
All photos © 2016 [rokma](https://rokma.com). All rights reserved.
Thanks,
Junglestar team.

- - -

_powered by:_
### reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.png?branch=master)](https://travis-ci.org/hakimel/reveal.js)

A framework for easily creating beautiful presentations using HTML. [Check out the reveal.js demo](http://lab.hakim.se/reveal-js/).


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
 * This is the create oauth sessions table migration class.
 *
 * @author Luca Degasperi <packages@lucadegasperi.com>
 */
class CreateOauthSessionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('oauth_sessions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('client_id', 40);
            $table->enum('owner_type', ['client', 'user'])->default('user');
            $table->string('owner_id');
            $table->string('client_redirect_uri')->nullable();
            $table->nullableTimestamps();

            $table->index(['client_id', 'owner_type', 'owner_id']);

            $table->foreign('client_id')
                ->references('id')->on('oauth_clients')
                ->onDelete('cascade')
                ->onUpdate('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('oauth_sessions', function (Blueprint $table) {
            $table->dropForeign('oauth_sessions_client_id_foreign');
        });
        Schema::drop('oauth_sessions');
    }
}


text:
package gr.aueb.cs.nlp.main;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.stream.Stream;

import gr.aueb.cs.nlp.wordtagger.util.FileHelper;

public class SplitCSV {

	public static void main(String[] args) throws IOException{

		Files.walk(new File("C:/Users/Thomas/Desktop/inputEmbeddings").toPath()).forEach(p->{
			SplitCSV split =  new SplitCSV("C:/Users/Thomas/Desktop/inputEmbeddings", p.getFileName().toFile().getName(), "C:/Users/Thomas/Desktop/output");
			try {
				split.readStreamOfLinesUsingFilesWithTryBlock();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		});

	}

	public String folder;
	public String file;
	public String outputFolder;

	public SplitCSV(String folder, String file, String outputFolder) {
		this.folder = folder;
		this.file = file;
		this.outputFolder = outputFolder;

		try {
			Files.createDirectories(Paths.get(outputFolder));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	private void readStreamOfLinesUsingFilesWithTryBlock() throws IOException
	{
	    Path path = Paths.get(folder, file);
	    try(Stream<String> lines = Files.lines(path)){
	      lines.forEach(l->toFile(l));
	    }
	}

	public void toFile(String line){
		String[] split  = line.split(" ");
		StringBuilder strb1 =  new StringBuilder(split[0]+" ");
		StringBuilder strb2 =  new StringBuilder(split[0]+" ");
		int half = (split.length-1)/2;
		for(int i = 1 ; i <= (split.length-1)/2 ; i++){
			strb1.append(split[i]);
			strb2.append(split[half + i]);
			if(i < half){
				strb1.append(" ");
				strb2.append(" ");
			} else {
				strb1.append("\n");
				strb2.append("\n");
			}
		}
		FileHelper.toFile(outputFolder+"/"+file+"_pre"+"_"+half, strb1.toString());
		FileHelper.toFile(outputFolder+"/"+file+"_su"+"_"+half, strb2.toString());
	}

}


text:
package com.opengamma.masterdb.config;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;

import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;
import com.opengamma.master.config.ConfigMetaDataRequest;
import com.opengamma.master.config.ConfigMetaDataResult;
import com.opengamma.util.test.DbTest;
import com.opengamma.util.test.TestGroup;

/**
 * Test metaData() in DbConfigMaster
 */
@Test(groups = TestGroup.UNIT_DB)
public class QueryConfigDbConfigMasterWorkerMetaDataTest extends AbstractDbConfigMasterWorkerTest {

  private static final Logger LOGGER = LoggerFactory.getLogger(QueryConfigDbConfigMasterWorkerMetaDataTest.class);

  @Factory(dataProvider = "databases", dataProviderClass = DbTest.class)
  public QueryConfigDbConfigMasterWorkerMetaDataTest(final String databaseType, final String databaseVersion) {
    super(databaseType, databaseVersion, true);
    LOGGER.info("running testcases for {}", databaseType);
  }

  @Test
  public void test_metaData() {
    final ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    final ConfigMetaDataResult result = _cfgMaster.metaData(request);
    assertNotNull(result);
    assertEquals(2, result.getConfigTypes().size());
    assertTrue(result.getConfigTypes().contains(ExternalId.class));
    assertTrue(result.getConfigTypes().contains(ExternalIdBundle.class));
  }

  public void test_metaData_noTypes() {
    final ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    request.setConfigTypes(false);
    final ConfigMetaDataResult result = _cfgMaster.metaData(request);
    assertNotNull(result);
    assertEquals(0, result.getConfigTypes().size());
  }

}


text:
import re

from setuptools import setup, find_packages

version = re.search(
    '^__version__\s*=\s*\'(.*)\'',
    open('cucco/__init__.py').read(),
    re.M).group(1)

setup(name='cucco',
      version=version,
      description='Python library for text normalization',
      long_description=open('README.rst').read(),
      author='David Moreno-Garcia',
      author_email='david.mogar@gmail.com',
      license='MIT',
      url='https://github.com/davidmogar/cucco',
      download_url='https://github.com/davidmogar/cucco/tarball/' + version,
      keywords=['normalization', 'language', 'text', 'manipulation'],
      packages=find_packages(exclude=['tests']),
      entry_points={
          'console_scripts': [
              'cucco=cucco.cli:cli'
          ]
      },
      include_package_data=True,
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Topic :: Software Development :: Libraries',
          'Intended Audience :: Developers',
          'Intended Audience :: Education',
          'Intended Audience :: Information Technology',
          'License :: OSI Approved :: MIT License',
          'Programming Language :: Python',
          'Programming Language :: Python :: 3',
      ]
)


text:
<!-- jQuery -->
<script src="{{site.url}}/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="{{site.url}}/js/bootstrap.min.js"></script>

<!-- Plugin JavaScript -->
<script src="{{site.url}}/js/jquery.easing.min.js"></script>
<script src="{{site.url}}/js/jquery.fittext.js"></script>
<script src="{{site.url}}/js/wow.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="{{site.url}}/js/creative.js"></script>
<script src="{{site.url}}/js/top.js"></script>


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:listDivider">@android:color/transparent</item>
        <item name="android:listSelector">@android:color/transparent</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="BottomTabStyle">
        <item name="android:background">@android:color/transparent</item>
        <item name="android:button">@null</item>
        <item name="android:drawablePadding">3dp</item>
        <item name="android:gravity">center</item>
        <item name="android:paddingBottom">5dp</item>
        <item name="android:paddingTop">5dp</item>
        <item name="android:textColor">@color/txt_tab_selector</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_weight">1</item>
    </style>

    <!-- 右上角popupwindow -->
    <style name="AnimationPreview">
        <item name="android:windowEnterAnimation">@anim/fade_in</item>
        <item name="android:windowExitAnimation">@anim/fade_out</item>
    </style>
</resources>


text:
using System;
using System.Linq;
using System.Threading.Tasks;
using Windows.Storage;

namespace Template10.Samples.JumpListSample.Services
{
    public class JumpListService
    {
        public async Task AddAsync(StorageFile file, int max = 4)
        {
            var jumpList = await Windows.UI.StartScreen.JumpList.LoadCurrentAsync();
            jumpList.SystemGroupKind = Windows.UI.StartScreen.JumpListSystemGroupKind.None;
            while (jumpList.Items.Count() > max)
            {
                jumpList.Items.RemoveAt(jumpList.Items.Count() - 1);
            }
            if (!jumpList.Items.Any(x => x.Arguments == file.Path))
            {
                var item = Windows.UI.StartScreen.JumpListItem.CreateWithArguments(file.Path, file.DisplayName);
                jumpList.Items.Add(item);
            }
            await jumpList.SaveAsync();
        }
    }
}


text:
/**
 * Test source file for types
 * Type: 301 - Array expression
 *
 * Important!
 * Execute this file by calling the SpiderMonkey compiler process:
 *
 *     SpiderMonkeyProcess --file=<path-to-this-file>
 *
 * Print returned value of that function and copy/paste it in
 * file corresponding `-ast.json` file.
 *
 * Remember:
 * Tests will not use this file, but its corresponding `-ast.json` file!
 * So always be sure these two files are in sync.
 */

// An array expression
print(JSON.stringify(Reflect.parse('[]')));


text:
typedef gcry_md_hd_t gcrypt_SHA256_CTX;

inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
{
	gcry_md_open(ctx, GCRY_MD_SHA256, 0);
}

inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
{
	gcry_md_write(*ctx, data, len);
}

inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
{
	memcpy(digest, gcry_md_read(*ctx, GCRY_MD_SHA256), SHA256_DIGEST_SIZE);
}

#define platform_SHA256_CTX gcrypt_SHA256_CTX
#define platform_SHA256_Init gcrypt_SHA256_Init
#define platform_SHA256_Update gcrypt_SHA256_Update
#define platform_SHA256_Final gcrypt_SHA256_Final

#endif


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>fur taskguide Source: tasks/wiki_workers/wiki_embed_links.js</title>

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.journal.css">

			fur taskguide

					Modules

							ci/config

							ci/tasks

Source: tasks/wiki_workers/wiki_embed_links.js

/**
 * @file Embed links to wiki.
 * @memberof module:ci/tasks
 * @function wikiWorkers.wikiEmbedLinks
 * @param {object} options - Worker options.
 * @param {object} options.originalContents - Original contents.
 * @param {object} options.links - Links to embed.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */
var os = require('os'),
    util = require('util');

module.exports = function (options, callback) {
    var embedding = false;
    var newContent = (options.originalContents || '')
        .split(os.EOL)
        .map(function (line) {

            var start = !!line.match(/<!\-\-\s+START\s*embedLink\s*\-\->/);
            if (start) {
                embedding = embedding || start;
                return [
                    line,
                    "<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN grunt wiki TO UPDATE -->",
                    '',
                    options.links.map(function (link) {
                        return util.format('[%s](%s)', link.title, link.href);
                    }).join(os.EOL),
                    ''
                ].join(os.EOL)
            } else {
                if (embedding) {
                    var end = !!line.match(/<!\-\-\s+END\s*embedLink\s*\-\->/);
                    embedding = embedding && !end;
                    if (embedding) {
                        return '<!-- Line to delete -->';
                    }
                }
            }
            return line;
        })
        .filter(function (line) {
            return !(line.match('<!-- Line to delete -->'));
        })
        .join(os.EOL);
    callback(null, [
        '',
        newContent,
        ''
    ].join(os.EOL));
};

		tick-tack Copyright © 2014

		Documentation generated by JSDoc 3.2.2
		on Sun Jun 08 2014 14:49:11 GMT+0900 (JST) using the DocStrap template.


text:
/* This is a default definition of a bootstrap exception handler function.
 * It does nothing and just goes into an infinite loop. If the user
 * application supplies a handler function, this function will not be
 * referenced and thus not pulled in from the library.
 */
void
__attribute__((weak, nomips16)) _bootstrap_exception_handler (void)
{
  __asm__ volatile (" sdbbp 0");
  while (1);
}