text:
require 'spec_helper'

module Ayatsuri
	class Driver
		describe QueryMethods do
			let(:model) { Object.new.extend(described_class) }

			before do
				model.stub(:query).with(*query_args) { result }
			end

			let(:result) { "query result" }

			let(:window_title) { 'window title' }
			let(:control_id) { 'control id' }

			describe "#get_active_window_handle" do
				subject { model.get_active_window_handle }

				let(:query_args) { [:WinGetHandle, ["[active]"]] }

				it { should == result }
			end

			describe "#get_active_window_title" do
				subject { model.get_active_window_title }

				let(:query_args) { [:WinGetTitle, ["[active]"]] }

				it { should == result }
			end

			describe "#get_window_text" do
				subject { model.get_window_text window_title }

				let(:query_args) { [:WinGetText, [window_title]] }

				it { should == result }
			end

			describe "#window_exist?" do
				subject { model.window_exist? window_title }

				let(:query_args) { [:WinExists, [window_title]] }

				context "when exist" do
					let(:result) { 1 }
					it { should be_true }
				end

				context "when NOT exist" do
					let(:result) { 0 }
					it { should be_false }
				end
			end

			describe "#get_control_text" do
				subject { model.get_control_text window_title, control_id }

				let(:query_args) { [:ControlGetText, [window_title, "", control_id]] }

				it { should == result }
			end

			describe "#control_enabled?" do
				subject { model.control_enabled? window_title, control_id }

				let(:query_args) { [:ControlCommand, [window_title, "", control_id, "IsEnabled", ""]] }

				context "when enabled" do
					let(:result) { 1 }
					it { should be_true }
				end

				context "when disabled" do
					let(:result) { 0 }
					it { should be_false }
				end
			end
		end
	end
end


text:
package main

import (
	"github.com/flynn/flynn/host/types"
	"github.com/flynn/flynn/host/volume"
	"github.com/flynn/flynn/pkg/cluster"
	c "github.com/flynn/go-check"
)

type VolumeSuite struct {
	Helper
}

var _ = c.ConcurrentSuite(&VolumeSuite{})

func (s *VolumeSuite) TestVolumeTransmitAPI(t *c.C) {
	x := s.bootCluster(t, 1)
	defer x.Destroy()
	s.doVolumeTransmitAPI(t, x, x.Host.Host, x.Host.Host)
}

func (s *VolumeSuite) TestInterhostVolumeTransmitAPI(t *c.C) {
	x := s.bootCluster(t, 3)
	defer x.Destroy()
	var host1, host2 *cluster.Host
	for _, h := range x.Hosts {
		if host1 == nil {
			host1 = h.Host
		} else if host2 == nil {
			host2 = h.Host
		} else {
			break
		}
	}

	s.doVolumeTransmitAPI(t, x, host1, host2)
}

func (s *VolumeSuite) doVolumeTransmitAPI(t *c.C, x *Cluster, h0, h1 *cluster.Host) {
	// create a volume!
	vol := &volume.Info{}
	t.Assert(h0.CreateVolume("default", vol), c.IsNil)
	defer func() {
		t.Assert(h0.DestroyVolume(vol.ID), c.IsNil)
	}()
	// create a job and use it to add data to the volume
	ish, err := s.makeIshApp(t, &IshApp{cluster: x, host: h0, extraConfig: host.ContainerConfig{
		Volumes: []host.VolumeBinding{{
			Target:    "/vol",
			VolumeID:  vol.ID,
			Writeable: true,
		}},
	}})
	t.Assert(err, c.IsNil)
	defer ish.Cleanup()
	resp, err := ish.run("echo 'testcontent' > /vol/alpha ; echo $?")
	t.Assert(err, c.IsNil)
	t.Assert(resp, c.Equals, "0\n")

	// take a snapshot
	snapInfo, err := h0.CreateSnapshot(vol.ID)
	t.Assert(err, c.IsNil)
	defer func() {
		t.Assert(h0.DestroyVolume(snapInfo.ID), c.IsNil)
	}()
	// make a volume on another host to yank the snapshot content into
	vol2 := &volume.Info{}
	t.Assert(h1.CreateVolume("default", vol2), c.IsNil)
	defer func() {
		t.Assert(h1.DestroyVolume(vol2.ID), c.IsNil)
	}()
	// transfer the snapshot to the new volume on the other host
	snapInfo2, err := h1.PullSnapshot(vol2.ID, h0.ID(), snapInfo.ID)
	t.Assert(err, c.IsNil)
	defer func() {
		t.Assert(h1.DestroyVolume(snapInfo2.ID), c.IsNil)
	}()

	// start a job on the other host that mounts and inspects the transmitted volume
	ish, err = s.makeIshApp(t, &IshApp{cluster: x, host: h1, extraConfig: host.ContainerConfig{
		Volumes: []host.VolumeBinding{{
			Target:    "/vol",
			VolumeID:  vol2.ID,
			Writeable: false,
		}},
	}})
	t.Assert(err, c.IsNil)
	defer ish.Cleanup()
	// read data back from the volume
	resp, err = ish.run("cat /vol/alpha")
	t.Assert(err, c.IsNil)
	t.Assert(resp, c.Equals, "testcontent\n")
}

redpajama_set_name: RedPajamaGithub


text:
<template name="timelineLinkOptions">
  <div class="text-left">
    <button id="js-myTimeline" class="btn btn-primary  btn-md ">My Timeline</button>
    <button id="js-globalTimeline" class="btn btn-primary btn-md" >Global Timeline</button>
  </div>
</template>


text:
<?php return array(
    'permissions' => 'Permessi',
    'all' => 'Tutti i permessi',
    'id' => 'ID permessi',
    'value' => 'Valore',
    'new' => 'Nuovi permessi',
    'description' => 'Descrizione',
    'messages' => array(
        'exists' => 'Un permesso con questo valore è già esistente.',
        'not-found' => 'Spiacente, il permesso non esiste.',
        'update-success' => 'Il permesso è stato aggiornato con successo.',
        'update-fail' => 'Non è stato possibile aggiornare il permesso, si prega di riprovare.',
        'remove-success' => 'Il permesso è stato eliminato con successo.',
    ),
    'titles' => array(
        'list' => 'Elenco permessi',
        'new' => 'Nuovo permesso',
    ),
);


text:
Adds [ActiveResource](https://github.com/rails/activeresource) compatible endpoints to Rails models.

### Motivation:
Say you're working in a [Service Oriented Architecture](http://en.wikipedia.org/wiki/Service-oriented_architecture), and you need easy access to a few central models in another app.
#### [ActiveResource](https://github.com/rails/activeresource) to the Rescue!
```
# In Your App
# Setup the Resource
class User < ActiveResource::Base
  self.site = "http://account-management-service.com/ares"
end

# Find
tyler = User.find(1)

# Create
tyler = User.new(:first => 'Tyler')
tyler.new?  # => true
tyler.save  # => true
tyler.new?  # => false
tyler.id    # => 2

# Update
tyler = User.find(1)
tyler.first # => 'Tyler'
tyler.first = 'Tyson'
tyler.save  # => true

# Delete
tyler = User.find(1)
tyler.destroy  # => true
tyler.exists?  # => false
User.delete(2)  # => true
User.exists?(2) # => false
```

#### But...
ActiveResource falls flat unless the other app implemented the required REST interface.  ActiveResource compatibility means:
* tons of boilerplate code
* creating controllers for each model
* the risk of regressions as development continues on these controllers

#### Solution
``ActiveResource::Server`` dynamically adds RESTful, namespaced endpoints for your Rails' models.
Simply add the gem to an application, and for only 3 easy payments of $29.95 it is ready for ActiveResource integration.
New models are included automatically.  WOW!!!

## Installation

Add this line to your application's Gemfile:

    gem 'activeresource-server'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install activeresource-server

## Usage

### Security
I **HIGHLY** recommend restricting access to this service (otherwise consider publishing your MySQL credentials).
That said, authentication is mostly outside the scope of this gem.  I have included a small HTTP Basic Auth option, but you may want to use Devise/Sorcery/Authlogic/etc.

### Configuration
**namespace**(default:'activeresource'): the base of the path (domain.com/:namespace/:resource/:id)
**skip_models**(default:false): An array of models to skip when serving up resources
**http_auth**(default:false): An ['username', 'password'] array. Off by default.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

<hr />


text:
import unittest.mock as mock
from datetime import datetime, timezone
from unittest import TestCase

from minio import Minio
from minio.api import _DEFAULT_USER_AGENT

from .minio_mocks import MockConnection, MockResponse

class ListBucketsTest(TestCase):
    @mock.patch('urllib3.PoolManager')
    def test_empty_list_buckets_works(self, mock_connection):
        mock_data = ('<ListAllMyBucketsResult '
                     'xmlns="http://s3.amazonaws.com/doc/2006-03-01/">'
                     '<Buckets></Buckets><Owner><ID>minio</ID><DisplayName>'
                     'minio</DisplayName></Owner></ListAllMyBucketsResult>')
        mock_server = MockConnection()
        mock_connection.return_value = mock_server
        mock_server.mock_add_request(
            MockResponse('GET', 'https://localhost:9000/',
                         {'User-Agent': _DEFAULT_USER_AGENT},
                         200, content=mock_data.encode())
        )
        client = Minio('localhost:9000')
        buckets = client.list_buckets()
        count = 0
        for bucket in buckets:
            count += 1
        self.assertEqual(0, count)

    @mock.patch('urllib3.PoolManager')
    def test_list_buckets_works(self, mock_connection):
        mock_data = ('<ListAllMyBucketsResult '
                     'xmlns="http://s3.amazonaws.com/doc/2006-03-01/">'
                     '<Buckets><Bucket><Name>hello</Name>'
                     '<CreationDate>2015-06-22T23:07:43.240Z</CreationDate>'
                     '</Bucket><Bucket><Name>world</Name>'
                     '<CreationDate>2015-06-22T23:07:56.766Z</CreationDate>'
                     '</Bucket></Buckets><Owner><ID>minio</ID>'
                     '<DisplayName>minio</DisplayName></Owner>'
                     '</ListAllMyBucketsResult>')
        mock_server = MockConnection()
        mock_connection.return_value = mock_server
        mock_server.mock_add_request(
            MockResponse('GET', 'https://localhost:9000/',
                         {'User-Agent': _DEFAULT_USER_AGENT},
                         200, content=mock_data.encode())
        )
        client = Minio('localhost:9000')
        buckets = client.list_buckets()
        buckets_list = []
        count = 0
        for bucket in buckets:
            count += 1
            buckets_list.append(bucket)
        self.assertEqual(2, count)
        self.assertEqual('hello', buckets_list[0].name)
        self.assertEqual(
            datetime(2015, 6, 22, 23, 7, 43, 240000, timezone.utc),
            buckets_list[0].creation_date,
        )
        self.assertEqual('world', buckets_list[1].name)
        self.assertEqual(
            datetime(2015, 6, 22, 23, 7, 56, 766000, timezone.utc),
            buckets_list[1].creation_date,
        )


text:
<?php

namespace Accounting\SuppliersProductsBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AccountingSuppliersProductsBundle extends Bundle
{
}


text:
package com.juanjo.mvp.models;

import org.parceler.Parcel;

/**
 * Created by juanjo on 14/2/15.
 */
@Parcel
public class ImageDto {

    String url;
    String title;

    public ImageDto() {
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}


text:
""" For each NTEE code, output statustics such as
- average budget
- average age
- network statistics (hub, authority, clustering coeff)

FIXME: add financial stats
"""

from collections import defaultdict

import numpy as np

from givinggraph.models import DBSession, Nonprofit, Nonprofit_Twitter_Attributes

def sector_stats(ntee):
    """
    Return a dict containing average values for various graph metrics for
    nonprofits with this NTEE code.
    """
    results = DBSession.query(Nonprofit).filter(Nonprofit.ntee_code.like(ntee + '%')).all()
    stats = defaultdict(lambda: [])
    for result in [r for r in results if r.twitter_name]:
        nta = DBSession.query(Nonprofit_Twitter_Attributes).filter(Nonprofit_Twitter_Attributes.id == result.twitter_name).first()
        if nta:
            stats['clustering_coefficient'].append(float(nta.clustering_coefficient))
            stats['hub'].append(float(nta.hub))
            stats['authority'].append(float(nta.authority))
    return dict((k, np.mean(v)) for k, v in stats.iteritems())


text:
module Entities::AddressApi
  class Address < ::Entities::GeoJson
    attr_accessor :longitude, :latitude

    def disclosure_attributes
      full_address = "#{@street_address.titleize}
#{@city.try(&:titleize)} #{@state}, #{@census_zip}"

      [
        "Address",
        "<address>#{full_address}</address>",
        'Tax Delinquent Years',
        tax_delinquent_years
      ].flatten
    end

    def properties
      {
        'color' => '#ffffff'
      }
    end

    def geometry
      {
        'type' => 'Point',
        'coordinates' => [longitude.to_f, latitude.to_f]
      }
    end

    def mappable?
      geometry['coordinates'].present?
    end

    def tax_delinquent?
      consecutive_years > 0
    end

    def consecutive_years
      consecutive_years = 0
      possible_years = Array(2014..2018).reverse

      possible_years.each do |year|
        if self.instance_variable_get("@county_delinquent_tax_#{year}").to_f > 0
          consecutive_years += 1
        else
          break
        end
      end

      consecutive_years
    end

    def latitude
      @latitude
    end

    def longitude
      @longitude
    end

    def address
      @street_address
    end

    private

    def tax_delinquent_years
      years = []
      possible_years = Array(2014..2018).reverse

      possible_years.each do |year|
        if self.instance_variable_get("@county_delinquent_tax_#{year}").to_f > 0
          years << ["Tax Delinquent in #{year}"]
        else
          break
        end
      end

      years
    end
  end
end


text:
'use strict'

angular.module('yamaApp').factory('News',function(Restangular){
	return Restangular.service('news');
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:ate="http://www.bigtester.org/schema/ate"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                           http://www.springframework.org/schema/aop
                           http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
                           http://www.bigtester.org/schema/ate
                           http://www.bigtester.org/schema/ate/ate-2.0.xsd">

	<!-- this registers beans annotated with @Aspect -->
	<aop:aspectj-autoproxy/>

	<import resource="classpath:META-INF/logger-reporter.xml" />
	<import resource="classpath:META-INF/page_base_bean.xml" />

	<ate:regularPage id="publicLoginDashBoard"
		dataFile="dentistSmokeTest/pageObjects/publicLoginDashBoard.data.xml"/>

<!-- 	<ate:pagePropertyCorrectnessAsserter -->
<!-- 		id="publicLoginDashBoardPropertyAsserter" resultPage="publicLoginDashBoard" stepERValue="loginDashboardVID"/> -->

	<ate:pageElementExistenceAsserter id="publicLoginDashBoardElementExistenceAsserter" resultPage="publicLoginDashBoard" stepERValue="loginDashboardVID" />

<!-- 	<ate:stepExpectedResultValue id="publicLoginDashBoardValidationValue" dataValueID="loginDashboardVID"   /> -->
<!-- appontment operations -->
	<ate:elementActionDef id="clickAppointmentTab" elementFind="appointmentTabEF" elementAction="appointmentClickEA"/>
	<ate:elementFindByXpath id="appointmentTabEF" findByValue="//a[@href='#tab_1']" />
	<ate:clickAction id="appointmentClickEA"  />

	<ate:elementActionDef id="clickFirstCancelButton" elementFind="firstCancelButtonEF" elementAction="firstCancelClickEA"/>
	<ate:elementFindByXpath id="firstCancelButtonEF" findByValue="//a[@ng-if='!isDone(appointment.data.start)']" />
	<ate:clickAction id="firstCancelClickEA"  />

	<ate:elementActionDef id="clickCancelValidateButton" elementFind="cancelValidateButtonEF" elementAction="cancelValidateButtonClickEA"/>
	<ate:elementFindByXpath id="cancelValidateButtonEF" findByValue="//button[@ng-click='cancelApt()']" />
	<ate:clickAction id="cancelValidateButtonClickEA"  />

	<ate:elementActionDef id="cursorMoveToFirstCancelButton" elementFind="firstCancelButtonEF" elementAction="mouseMoveToCancelEA"/>
	<ate:mouseMoveToAction id="mouseMoveToCancelEA"  />

	<ate:elementActionDef id="clickFirstReviewButtonWE" elementFind="firstReviewButtonEF" elementAction="clickFirstReviewButtonClickEA"/>
	<ate:elementFindByXpath id="firstReviewButtonEF" findByValue="//a[@ng-if='isDone(appointment.data.start)']" />
	<ate:clickAction id="clickFirstReviewButtonClickEA"  />

	<ate:elementActionDef id="cursorMoveToFirstReviewButtonWE" elementFind="firstReviewButtonEF" elementAction="mouseMoveToReviewButtonEA"/>
	<ate:mouseMoveToAction id="mouseMoveToReviewButtonEA"  />

	<ate:elementActionDef id="filloutReviewCommentsWE" elementFind="reviewCommentsTextareaEF" elementAction="typeInReviewCommentsEA"/>
	<ate:elementFindByXpath id="reviewCommentsTextareaEF" findByValue="//textarea[@ng-model='appointment.data.comment.body']" />
	<ate:sendKeysAction id="typeInReviewCommentsEA" dataValue="reviewCommentsText" />

	<ate:runTimeDataHolder id="reviewCommentsText" dataType="Text" dataValue="test review comments" dataHolderType="ManualAssigned"/>

	<ate:elementActionDef id="submitReviewCommentsWE" elementFind="submitCommentsTextareaEF" elementAction="submitReviewCommentsEA"/>
	<ate:elementFindByXpath id="submitCommentsTextareaEF" findByValue="//button[@ng-click='submit()']" />
	<ate:clickAction id="submitReviewCommentsEA" />

<!-- LogoutLInk myWebElement definition -->
	<ate:elementActionDef id="logoutPatientWE" elementFind="logoutPatientEF" elementAction="logoutPatientEA"/>
	<ate:elementFindByXpath id="logoutPatientEF" findByValue="//a[@href='/logoutPatient']" />
	<ate:clickAction id="logoutPatientEA"  />

</beans>


text:
You can use Cloud Trace Service \(CTS\) to record SMN-related operations, including request content, source IP addresses, request senders, and when a request was sent.

CTS can record operations performed on the management console, operations performed by calling APIs, and operations triggered within the cloud system.


text:
use std::num;
use std::error;
use std::fmt;

#[derive(Debug, PartialEq)]
pub enum LexerError {
  UnexpectedCharacter(String),
  InvalidKeyword(String),
  ParseInt(num::ParseIntError),
}

impl fmt::Display for LexerError {
  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    match *self {
      LexerError::UnexpectedCharacter(ref s) => write!(f, "{}", s),
      LexerError::InvalidKeyword(ref s) => write!(f, "{}", s),
      LexerError::ParseInt(ref err) => write!(f, "Parse error: {}", err),
    }
  }
}

impl error::Error for LexerError {
  fn description(&self) -> &str {
    match *self {
      LexerError::UnexpectedCharacter(ref s) => s,
      LexerError::InvalidKeyword(ref s) => s,
      LexerError::ParseInt(ref err) => err.description(),
    }
  }

  fn cause(&self) -> Option<&error::Error> {
    match *self {
      LexerError::UnexpectedCharacter(_) => None,
      LexerError::InvalidKeyword(_) => None,
      LexerError::ParseInt(ref err) => Some(err),
    }
  }
}

impl From<num::ParseIntError> for LexerError {
  fn from(err: num::ParseIntError) -> LexerError {
    LexerError::ParseInt(err)
  }
}


text:
import {Component, NgModule} from '@angular/core';

@Component({
  selector: 'my-app',
  template: '<div (@mySelector.start)="false" (@mySelector.done)="false" [@mySelector]="0"></div>'
})
export class MyApp {
}

@NgModule({declarations: [MyApp]})
export class MyModule {
}


text:
import LockByID from '@authentication/lock-by-id';
import SessionID from '../types/SessionID';
import SessionStore, {Session} from './SessionStore';
import HashLRU from './HashLRU';

const DEFAULT_SIZE = process.env.BICYCLE_SESSION_STORE_SIZE
  ? parseInt(process.env.BICYCLE_SESSION_STORE_SIZE, 10)
  : 100;

class MemorySessionStore implements SessionStore {
  private readonly _cache: HashLRU<SessionID, Session>;
  private readonly _lock = new LockByID();
  constructor(size: number = DEFAULT_SIZE) {
    this._cache = new HashLRU(size);
  }
  tx<T>(
    id: SessionID,
    fn: (session: Session | null) => Promise<{session: Session; result: T}>,
  ): Promise<T> {
    return this._lock.withLock(SessionID.extract(id), async () => {
      const {session, result} = await fn(this._cache.get(id) || null);
      this._cache.set(id, session);
      return result;
    });
  }
  getSessionCount() {
    return this._cache.getSize();
  }
  getMaxSessionCount() {
    return this._cache.getMaxSize() * 2;
  }
}

export default MemorySessionStore;


text:
#ifndef _IO_PARALLEL_H
#define _IO_PARALLEL_H

#include <PICoo.h>

/*
 * This is the base class for all parallel IO (i.e., digital IO pins) devices
 * including the built-in IO pins of the PIC32 chip.
 */

namespace IO {

    enum { OUTPUT, INPUT };
    enum { LOW, HIGH };
    enum { OFF, PULLUP, PULLDOWN };

    class Parallel {
        public:
            virtual void write(uint16_t pin, uint8_t state) = 0;
            virtual uint8_t read(uint16_t pin) = 0;
            virtual void setMode(uint16_t pin, uint8_t mode, uint8_t data = IO::OFF) = 0;
    };
}

#endif


text:
<?php

add_filter( 'mce_buttons_2', 'fb_mce_editor_buttons' );

function fb_mce_editor_buttons( $buttons ) {

    array_unshift( $buttons, 'styleselect' );
    return $buttons;
}

?>


text:
#include <aws/license-manager/model/CheckInLicenseResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::LicenseManager::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

CheckInLicenseResult::CheckInLicenseResult()
{
}

CheckInLicenseResult::CheckInLicenseResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

CheckInLicenseResult& CheckInLicenseResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  AWS_UNREFERENCED_PARAM(result);

  return *this;
}


text:
/** @file */
/*****************************************************************************/
/*                                                                           */
/* file: Quat.h                                                              */
/*                                                                           */
/*****************************************************************************/

#pragma once

/*****************************************************************************/
/* Includes:                                                                 */
/*****************************************************************************/
#include "MathEnum.h"
#include "Matrix.h"

/*************************************************************************
*
* This class contains functions and data structure for a 4-dimensional
* Quaternions.  The quaternions are internally stored interms of the
* imaginary components (qx,qy,qz) and the real components (qw).
*
* In the Math library, quaternions can be thought of as "rotational"
* matrices, everything that you can represent with rotational matrices
* you can use with quaternions.  Such as quaternion concatenation,
* inverses, transpose, normalize, multiplying with matrices, and with
* vectors.
*
*
**************************************************************************/

class Quat final : public Align16 {
public:

	Quat();
	Quat( const Quat &q0 );
	Quat( const __m128 &m0 );
	Quat( const float f0, const float f1, const float f2, const float f3 );
	Quat( const Vect &v, const float f0 );
	Quat( const Matrix &m0 );
	Quat( RotType in, const float f0 );
	Quat( RotAxisAngleType, const Vect &v, const float f0 );
	Quat( Rot3AxisType, const float f0, const float f1, const float f2 );
	Quat( RotOrientType in, const Vect &v0, const Vect &v1 );
	Quat( MatrixSpecialType in );
	~Quat();

	inline float operator[]( const x_enum )const { return this->qx; }
	inline float operator[]( const y_enum )const { return this->qy; }
	inline float operator[]( const z_enum )const { return this->qz; }
	inline float operator[]( const w_enum )const { return this->qw; }
	inline float& operator[](const x_enum) { return this->qx; }
	inline float& operator[](const y_enum) { return this->qy; }
	inline float& operator[](const z_enum) { return this->qz; }
	inline float& operator[](const w_enum) { return this->qw; }

	void set( const float f0, const float f1, const float f2, const float f3 );
	void set( const Vect &v, const float f );
	void set( const Matrix &m );
	void set( const __m128 &xm );
	void set(const Quat &q);
	void set( RotType in, const float f );
	void set( RotAxisAngleType, const Vect &v, const float f0 );
	void set( Rot3AxisType, const float f0, const float f1, const float f2 );
	void set( RotOrientType in, const Vect &v0, const Vect &v1 );
	void set( MatrixSpecialType in );

	void setVect( const Vect &v0 );
	void getVect( Vect &v0 ) const;

	// binary
	void operator=(const Quat &q);
	Quat operator+(const Quat &q)const;
	Quat operator+(const float f0)const;
	void operator+=(const Quat &q);
	void operator+=(const float f0);
	friend Quat operator+(const float f0, const Quat &t);
	Quat operator-(const Quat &q)const;
	Quat operator-(const float f0)const;
	void operator-=(const Quat &q);
	void operator-=(const float f0);
	friend Quat operator-(const float f0, const Quat &q);
	Quat operator*(const Quat &q)const;
	Quat operator*(const float f)const;
	void operator*=(const Quat &q);
	void operator*=(const float f0);
	void operator*=(const Matrix &m);
	friend Quat operator*(const float f0, const Quat &q);
	Quat operator/(const Quat &q)const;
	Quat operator/(const float f0)const;
	void operator/=(const Quat &q);
	void operator/=(const float f0);
	friend Quat operator/(const float f0, const Quat &q);

	// unary
	Quat operator-()const;
	Quat operator+()const;

	Quat multByElement( const Quat &q ) const;
	Quat getConj()const;
	Quat getT() const;
	Quat norm();
	Quat getNorm()const;
	Quat getInv()const;

	void conj();
	void T();
	void inv();
	void Lqvqc( const Vect &vIn, Vect &vOut ) const;
	void Lqcvq( const Vect &vIn, Vect &vOut ) const;
	void getAxis( Vect &v ) const;

	float mag()const;
	float magSquared()const;
	float invMag()const;
	float dot( const Quat &q )const;
	float getAngle()const;

	bool isEqual( const Quat &q, const float precision ) const;
	bool isNegEqual( const Quat &q, const float precision ) const;
	bool isEquivalent( const Quat &q, const float precision ) const;
	bool isConjugateEqual( const Quat &q, const float precision ) const;
	bool isIdentity( const float precision ) const;
	bool isNormalized( const float precision ) const;
	bool isZero( const float precision ) const;

private:
	friend Matrix;
	// Level 4 complains nameless struct/union ...
#pragma warning( disable : 4201)

	// anonymous union
	union {
		__m128	m;

		// anonymous struct
		struct {
			float qx;
			float qy;
			float qz;
			float qw;
		};
	};
};

/**** END of Quat.h ********************************************************/


text:
/* See LICENSE for licensing information */

/**
 * @file destroy_cell_queue_st.h
 * @brief Destroy-cell queue structures
 **/

#ifndef DESTROY_CELL_QUEUE_ST_H
#define DESTROY_CELL_QUEUE_ST_H

#include "core/or/cell_queue_st.h"

/** A single queued destroy cell. */
struct destroy_cell_t {
  TOR_SIMPLEQ_ENTRY(destroy_cell_t) next;
  circid_t circid;
  uint32_t inserted_timestamp; /**< Time (in timestamp units) when this cell
                                * was inserted */
  uint8_t reason;
};

/** A queue of destroy cells on a channel. */
struct destroy_cell_queue_t {
  /** Linked list of packed_cell_t */
  TOR_SIMPLEQ_HEAD(dcell_simpleq_t, destroy_cell_t) head;
  int n; /**< The number of cells in the queue. */
};

#endif /* !defined(DESTROY_CELL_QUEUE_ST_H) */


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

<title>MemoryType (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<meta name="keywords" content="java.lang.management.MemoryType class">
<meta name="keywords" content="values()">
<meta name="keywords" content="valueOf()">
<meta name="keywords" content="toString()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method

java.lang.management

Enum MemoryType

java.lang.Object

java.lang.Enum<MemoryType>

java.lang.management.MemoryType

All Implemented Interfaces:

Serializable, Comparable<MemoryType>

public enum MemoryType
extends Enum<MemoryType>

Types of memory pools.

Since:

1.5

Enum Constant Summary

Enum Constants

Enum Constant and Description

HEAP

Heap memory type.

NON_HEAP

Non-heap memory type.

Method Summary

Methods

Modifier and Type
Method and Description

String
toString()

Returns the string representation of this <tt>MemoryType</tt>.

static MemoryType
valueOf(String name)

Returns the enum constant of this type with the specified name.

static MemoryType[]
values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

HEAP

public static final MemoryType HEAP

Heap memory type.

 The Java virtual machine has a heap
 that is the runtime data area from which
 memory for all class instances and arrays are allocated.

NON_HEAP

public static final MemoryType NON_HEAP

Non-heap memory type.

 The Java virtual machine manages memory other than the heap
 (referred as non-heap memory).  The non-heap memory includes
 the method area and memory required for the internal
 processing or optimization for the Java virtual machine.
 It stores per-class structures such as a runtime
 constant pool, field and method data, and the code for
 methods and constructors.

Method Detail

values

public static MemoryType[] values()

Returns an array containing the constants of this enum type, in
the order they are declared.  This method may be used to iterate
over the constants as follows:

for (MemoryType c : MemoryType.values())
    System.out.println(c);

Returns:

an array containing the constants of this enum type, in the order they are declared

valueOf

public static MemoryType valueOf(String name)

Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type.  (Extraneous whitespace characters are
not permitted.)

Parameters:

name - the name of the enum constant to be returned.

Returns:

the enum constant with the specified name

Throws:

IllegalArgumentException - if this enum type has no constant with the specified name

NullPointerException - if the argument is null

toString

public String toString()

Returns the string representation of this <tt>MemoryType</tt>.

Overrides:

toString in class Enum<MemoryType>

Returns:

the string representation of this <tt>MemoryType</tt>.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
/**
 * Sorting benchmark for comparing performance of sorting in various conditions.
 *
 * This benchmark was added to benchmark benefits of leveraging binary indices
 * to sort results -after- filtering had occurred.
 *
 * Typically, only the first indexed operation is able to use indices.
 *
 * This benchmark will assume we are filtering at least 1 document and attempting
 * to perform a simplesort.
 *
 * Since we are working with a filtered resultset, in order to leverage the
 * sorting index we have applied on a separate property we will employ
 * a devised set intersection algorithm to reduce the (full) sort property binary index
 * by the actual documents in our resultset.
 *
 * The mechanism we are using to optimally intersect arrays involves creating an
 * 'inclusion' (hash) object for document indices in our resultset and then
 * filtering (array scan) the sort property binary index, testing for each element's
 * inclusion in our inclusion object.
 *
 * Initial testing seems to indicate that our new algorithm is typically more efficient
 * than our previous simplesort() as long you were not able to filter more than 10% of
 * total collection documents.  It's performance seems be directly correlated with
 * your filtering ineffectiveness.  That means that the performance of the new simplesort
 * over the old simplesort algorithm is greater when you were only able to filter 20%
 * of total documents than if you were able to filter 80%).
 *
 * Since the roughly "10% or more" filtering rule seems to apply no matter how
 * large dataset is, we have created another simplesort implementation which
 * calculates ratio of current resultset documents to total documents and
 * invokes either the old 'sort' codepath or the new index intersect algorithm.
 */

var loki = require('../src/lokijs.js');

// Total document count to seed database with
var DOCUMENT_COUNT = 60000;
// Variations of values to apply to our filter property, as well as queries.
// A value of 10 means we will generate and query values from 0-9 (10% hits)
// Entering values of 10 or below should (on average) use our new intersect alg.
var QUERY_INDEX_RANGE = 5;

// Sorting index range of 10000 just means (out of 40k docs), there will be roughly 4 docs for every unique 'b' sort value
// I don't expect tweaking this param will yield significant differences but to be safe we can try best/worst (high/low) cases.
var SORTING_INDEX_RANGE = 4000;

var P1_ITER = 100;
var P2_ITER = 200;
var P3_ITER = 200;
var P4_ITER = 200;

var db, coll;

function createDatabase(isIndexed) {
  var idx, a, b;

  db = new loki('sorting-bench.db');

  // we will always apply index to our filter column.
  // our variation will be whether the sort column is also indexed.
  if (isIndexed) {
    coll = db.addCollection('profile', { indices: ['a', 'b'] });
  }
  else {
    coll = db.addCollection('profile', { indices: ['a'] });
  }

  for(idx=0;idx<DOCUMENT_COUNT;idx++) {
    a = Math.floor(Math.random() * QUERY_INDEX_RANGE);
    b = Math.floor(Math.random() * SORTING_INDEX_RANGE);
    coll.insert({ "a": a, "b": b });
  }
}

// unindexed, unfiltered
function profile1() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P1_ITER;
  var idx, results;

  createDatabase(false);

  for(idx=0; idx<P1_ITER; idx++) {
    start = process.hrtime();

    results = coll.chain().simplesort("b").data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' unfiltered, 'b' unindexed : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

function sortfun(obj1, obj2) {
  if (obj1.b === obj2.b) return 0;
  if (obj1.b > obj2.b) return 1;
  if (obj1.b < obj2.b) return -1;
}

// unindexed, unfiltered, minimal sort function (pre-jitted)
function profile1a() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P1_ITER;
  var idx, results;

  createDatabase(false);

  for(idx=0; idx<P1_ITER; idx++) {
    start = process.hrtime();

    results = coll.chain().sort(sortfun).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' unfiltered, 'b' unindexed (minimal sort function) : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

function profile2() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P3_ITER;
  var idx, compare, results;

  createDatabase(true);

  for(idx=0; idx<loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().simplesort("b").data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' unfiltered, 'b' indexed : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

// filtered, unindexed
function profile3() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P2_ITER;
  var idx, compare, results;

  createDatabase(false);

  for(idx=0; idx<loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).simplesort("b").data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' unindexed : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

// filtered, unindexed, minimal sort function (pre-jitted)
function profile3a() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P2_ITER;
  var idx, compare, results;

  createDatabase(false);

  for(idx=0; idx<loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).sort(sortfun).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' unindexed (minimal sort function) : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

// filtered, unindexed useJavascriptSorting (runtime jit)
function profile3b() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P2_ITER;
  var idx, compare, results;

  createDatabase(false);

  for(idx=0; idx<loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    // if we had enabled an index but wanted to force js sorting we would also pass 'disableIndexItercept:true'
    results = coll.chain().find({a:compare}).simplesort('b', { useJavascriptSorting: true }).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' unindexed (useJavascriptSorting) : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

function profile4() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P4_ITER;
  var idx, compare, results;

  createDatabase(true);

  for(idx=0; idx < loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).simplesort("b", { disableIndexIntersect: true }).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' indexed (old simplesort) : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

function profile5() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P4_ITER;
  var idx, compare, results;

  createDatabase(true);

  for(idx=0; idx < loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).simplesort("b", { forceIndexIntersect: true}).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' indexed (x-sect): " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

// using 'smart?' simplesort which attempts to determine whether
// array intersect or array sort would be more efficient.
// by default the fallback is to loki sorting (same order as indexes)
function profile6() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P4_ITER;
  var idx, compare, results;

  createDatabase(true);

  for(idx=0; idx < loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).simplesort("b").data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' indexed (smart): " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

// using 'smart' simplesort with fallback to 'useJavascriptSorting' if filtering
function profile7() {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;
  var loopIterations = P4_ITER;
  var idx, compare, results;

  createDatabase(true);

  for(idx=0; idx < loopIterations; idx++) {
    compare = Math.floor(Math.random() * QUERY_INDEX_RANGE);

    start = process.hrtime();

    results = coll.chain().find({a:compare}).simplesort("b", { useJavascriptSorting: true }).data();

    end = process.hrtime(start);
    totalTimes.push(end);
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("'a' filtered, 'b' indexed (smart w/js fallback): " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
}

console.log("loki sorting benchmark diagnostic");
console.log("---------------------------------");
console.log("DOCUMENT_COUNT      : " + DOCUMENT_COUNT);
console.log("QUERY_INDEX_RANGE   : " + QUERY_INDEX_RANGE);
console.log("SORTING_INDEX_RANGE : " + SORTING_INDEX_RANGE);
console.log("");
console.log("average expected resultset size to be sorted: " + DOCUMENT_COUNT/QUERY_INDEX_RANGE);
console.log("expected filtering ratio : " + Math.floor(100-(1/QUERY_INDEX_RANGE)*100) + "%");
console.log("");
console.log("Running query+sorting benchmarks, please wait...");
console.log("");

profile1();
profile1a();
profile2();
profile3();
profile3a();
profile3b();
profile4();
profile5();
profile6();
profile7();


text:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
	<info organisation="fbspark"
		module="fbspark_2.10"
		revision="1.0"
		status="integration"
		publication="20160303144816"
	>
		<description>
		fbSpark
		</description>
	</info>
	<configurations>
		<conf name="compile" visibility="public" description=""/>
		<conf name="runtime" visibility="public" description="" extends="compile"/>
		<conf name="test" visibility="public" description="" extends="runtime"/>
		<conf name="provided" visibility="public" description=""/>
		<conf name="optional" visibility="public" description=""/>
		<conf name="compile-internal" visibility="private" description="" extends="compile,optional,provided"/>
		<conf name="runtime-internal" visibility="private" description="" extends="runtime,optional"/>
		<conf name="test-internal" visibility="private" description="" extends="test,optional,provided"/>
		<conf name="plugin" visibility="private" description=""/>
		<conf name="sources" visibility="public" description=""/>
		<conf name="docs" visibility="public" description=""/>
		<conf name="pom" visibility="public" description=""/>
		<conf name="scala-tool" visibility="private" description=""/>
	</configurations>
	<publications>
		<artifact name="fbspark_2.10" type="pom" ext="pom" conf="pom"/>
		<artifact name="fbspark_2.10" type="jar" ext="jar" conf="compile"/>
		<artifact name="fbspark_2.10" type="src" ext="jar" conf="sources" e:classifier="sources"/>
		<artifact name="fbspark_2.10" type="doc" ext="jar" conf="docs" e:classifier="javadoc"/>
	</publications>
	<dependencies>
		<dependency org="org.scala-lang" name="scala-compiler" rev="2.10.5" conf="scala-tool->default,optional(default)"/>
		<dependency org="org.scala-lang" name="scala-library" rev="2.10.5" conf="scala-tool->default,optional(default);compile->default(compile)"/>
		<dependency org="org.apache.spark" name="spark-core_2.10" rev="1.6.0" conf="provided->default(compile)"/>
		<dependency org="org.apache.spark" name="spark-mllib_2.10" rev="1.6.0" conf="provided->default(compile)"/>
		<dependency org="org.apache.spark" name="spark-sql_2.10" rev="1.6.0" conf="provided->default(compile)"/>
		<dependency org="joda-time" name="joda-time" rev="2.9.2" conf="compile->default(compile)"/>
	</dependencies>
</ivy-module>


text:
var expect = require('chai').expect;
var bunyanDaily = require('../lib/bunyan-daily.js');
var del = require('del');
var moment = require('moment');
var fs = require('fs');

var logDir = 'tmp-logs';
describe('bunyan-daily', function () {
  before(function () {
    del.sync(logDir);
  });

  it('init', function (done) {
    bunyanDaily.init({
      daily: {
        dir: logDir
      },
    });

    var log = bunyanDaily.logger('test');
    log.info('daily');
    var count = 0;
    var t = setInterval(function() {
      log.debug(count++);
      if (count === 6) {
        bunyanDaily.clear();
        clearInterval(t);
        done();
      }
    }, 5000);
    expect(fs.existsSync(logDir + '/' + moment().format('YYYY-MM-DD') + '.log')).to.be.ok;
  });
});


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.synapse.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.synapse.models.Reason;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The result returned from a check name availability request. */
@Fluent
public final class CheckNameResultInner {
    /*
     * Specifies a Boolean value that indicates if the name is available.
     */
    @JsonProperty(value = "nameAvailable")
    private Boolean nameAvailable;

    /*
     * The name that was checked.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Message indicating an unavailable name due to a conflict, or a
     * description of the naming rules that are violated.
     */
    @JsonProperty(value = "message")
    private String message;

    /*
     * Message providing the reason why the given name is invalid.
     */
    @JsonProperty(value = "reason")
    private Reason reason;

    /**
     * Get the nameAvailable property: Specifies a Boolean value that indicates if the name is available.
     *
     * @return the nameAvailable value.
     */
    public Boolean nameAvailable() {
        return this.nameAvailable;
    }

    /**
     * Set the nameAvailable property: Specifies a Boolean value that indicates if the name is available.
     *
     * @param nameAvailable the nameAvailable value to set.
     * @return the CheckNameResultInner object itself.
     */
    public CheckNameResultInner withNameAvailable(Boolean nameAvailable) {
        this.nameAvailable = nameAvailable;
        return this;
    }

    /**
     * Get the name property: The name that was checked.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name that was checked.
     *
     * @param name the name value to set.
     * @return the CheckNameResultInner object itself.
     */
    public CheckNameResultInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the message property: Message indicating an unavailable name due to a conflict, or a description of the
     * naming rules that are violated.
     *
     * @return the message value.
     */
    public String message() {
        return this.message;
    }

    /**
     * Set the message property: Message indicating an unavailable name due to a conflict, or a description of the
     * naming rules that are violated.
     *
     * @param message the message value to set.
     * @return the CheckNameResultInner object itself.
     */
    public CheckNameResultInner withMessage(String message) {
        this.message = message;
        return this;
    }

    /**
     * Get the reason property: Message providing the reason why the given name is invalid.
     *
     * @return the reason value.
     */
    public Reason reason() {
        return this.reason;
    }

    /**
     * Set the reason property: Message providing the reason why the given name is invalid.
     *
     * @param reason the reason value to set.
     * @return the CheckNameResultInner object itself.
     */
    public CheckNameResultInner withReason(Reason reason) {
        this.reason = reason;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
function timepicker (field_id) {
	var field_obj = document.getElementById(field_id);
	var selection_position = 0;

	if (!field_obj.value) field_obj.value = "00:00:00";

	function get_allowed_values (position) {
		switch (position) {
			case 0:
				return [0,23];
			case 3:
				return [0,59];
			case 6:
				return [0,59];
		}
	}

	function set_selection(position) {
		if (window.event) {
			var oRange = field_obj.createTextRange();
			oRange.moveStart("character", position);
			oRange.moveEnd("character", (position + 2) - field_obj.value.length);
			oRange.select();
		} else {
			field_obj.selectionStart = position;
			field_obj.selectionEnd = position+2;
		}
		field_obj.focus();
	}

	function get_selected_number () {
		var str_num = field_obj.value.substring(selection_position, selection_position+2);
		inta = parseInt(str_num, 10);
		return inta;
	}

	function set_selected_number (int_number) {
		var str_num = int_number + '';
		if (str_num.length == 1) str_num = "0" + str_num;
		var str1 = field_obj.value.substring(0, selection_position);
		var str2 = field_obj.value.substring(selection_position + 2);
		field_obj.value = str1 + str_num + str2;
	}

	field_obj.onfocus = function () {
							set_selection(0);
						}

	field_obj.onkeydown = function (evt){
								if (window.event) {
									keyCode = window.event.keyCode;
								} else {
									keyCode = evt.keyCode;
								}
								if (keyCode == 9) {
									return true;
								}
								if (keyCode == 37) {	// left
									if (selection_position == 0) {
										selection_position = 6;
									} else {
										selection_position -= 3;
									}
								} else if (keyCode == 39) {	/// right
									if (selection_position == 6) {
										selection_position = 0;
									} else {
										selection_position += 3;
									}
								} else if (keyCode == 38) {		// up
									range = get_allowed_values(selection_position);
									var sel_num = get_selected_number();
									if (sel_num-1 < range[0]) {
										set_selected_number(range[1]);
									} else {
										set_selected_number(sel_num-1);
									}
								} else if (keyCode == 40) {		// down
									range = get_allowed_values(selection_position);
									var sel_num = get_selected_number();
									if (sel_num+1 > range[1]) {
										set_selected_number(range[0]);
									} else {
										set_selected_number(sel_num+1);
									}
								}
								set_selection(selection_position);
								return false;

							}

}


text:
@interface DXTpyrcneEntity : _DXTpyrcneEntity {}
// Custom logic goes here.
@end


text:
require 'base64'
require 'openssl'

# Helper methods used in this code
module GoogleStaticMapHelpers #:nodoc: all
  # Returns a hash of instance variables for the passed in Object, where the
  # key is the instance variable name ("@instance_variable"), and the value is
  # the current instance variable value.  This is safe for Ruby 1.8 and 1.9.
  # Pass an optional array of instance variable name strings
  # (["instance_variable_1", "instance_variable_2"]) to not include in the
  # result.  Example result:
  # {"variable_1" => 123, "variable_2" => "2 value"}
  # All inputs and outputs do NOT have the @ in the instance variable name
  # options -
  #   :cgi_escape_values - set this to true to return all values as
  #   CGI escaped strings
  def self.safe_instance_variables(object, ivs_to_exclude=[], options={})
    ivs = {}
    object.instance_variables.each do |i|
      # Don't include the @
      iv_name = i.to_s[1..-1]
      unless ivs_to_exclude.include?(iv_name)
        val = object.instance_variable_get(i)
        unless val.nil?
          val = CGI.escape(val.to_s) if options.has_key?(:cgi_escape_values)
          ivs[iv_name] = val unless val.nil?
        end
      end
    end
    ivs
  end

  # signing code is grabbed from https://github.com/alexreisner/geocoder
  def self.sign(path, key)
    raw_private_key = self.url_safe_base64_decode(key)
    digest = OpenSSL::Digest.new('sha1')
    raw_signature = OpenSSL::HMAC.digest(digest, raw_private_key, path)
    self.url_safe_base64_encode(raw_signature)
  end

  def self.url_safe_base64_decode(base64_string)
    Base64.decode64(base64_string.tr('-_', '+/'))
  end

  def self.url_safe_base64_encode(raw)
    Base64.encode64(raw).tr('+/', '-_').strip
  end

end


text:
using namespace triagens;
using namespace std;

ShellImplementation* ShellImplFactory::buildShell (string const & history,
                                                   Completer* completer) {

#ifdef _WIN32
  //under windows the readline is not compilable
  return new LinenoiseShell(history, completer);
#elif defined TRI_HAVE_LINENOISE
  return new LinenoiseShell(history, completer);
#elif defined TRI_HAVE_READLINE
  return new ReadlineShell(history, completer);
#else
  // last resort!
  return new DummyShell(history, completer);
#endif

}

// -----------------------------------------------------------------------------
// --SECTION--                                                       END-OF-FILE
// -----------------------------------------------------------------------------

// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// End:


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls mycol. 10: 440 (1912)

#### Original name
Ravenelia escharoides Syd. & P. Syd.

### Remarks
null


text:
from setuptools import setup, find_packages

version = __import__('mailchimp2').__version__

setup(
    name = 'django-mailchimp2',
    version = version,
    description = 'Mail Chimp integration with Django, using Mailchimp API 2.0',
    author = 'Audra Johnson et al.',
    url = 'http://github.com/akjohnson/django-mailchimp2',
    packages = find_packages(),
    zip_safe=False,
    package_data={
        'mailchimp': [
        ],
    },
)


text:
/**
 * This package contains a collection of convenience
 * {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
 * serializing between CQL types and Java enums.
 */
package com.datastax.driver.extras.codecs.enums;