text:
var watchID;
var accelerometerOptions = { frequency: 2000 };  // Update every 2 seconds
accelerometerOptions.frequency = 3000; //changed my mind - now 3 seconds

//when the page is created...
$(document).on("pagecreate", "#page1", function () {

	//setup listener for the toggle switch
	$("#flipswitch").on("change", function() {

		if( $(this).val() == "on" ) startSensor();
		else if ( $(this).val() == "off" ) stopSensor();

	});

	//setup listener for the slider
	$("#slider").on("slidestop", function() {

		//the value from the slider is text - it needs to be turned into an integer
		var freq = parseInt($(this).val());

		updateFreq(freq);

	});

});

function startSensor() {
	watchID = navigator.accelerometer.watchAcceleration( accelerometerSuccess, accelerometerError, accelerometerOptions);
}

function stopSensor() {
	navigator.accelerometer.clearWatch(watchID);

	$('#sensorX').val("");
	$('#sensorY').val("");
	$('#sensorZ').val("");
	$('#timestamp').val("");
}

function accelerometerSuccess(acceleration) {

	$('#sensorX').val(acceleration.x);
	$('#sensorY').val(acceleration.y);
	$('#sensorZ').val(acceleration.z);
	$('#timestamp').val(acceleration.timestamp);

}

function accelerometerError() {
   alert('Error');
}

function updateFreq(elephant) {

	accelerometerOptions.frequency = elephant;

    stopSensor();
    startSensor();

	//do something to update freq. here.
}


text:
#import "ContactsDataSource.h"
#import "ContactTableViewCell.h"

@class ContactsTableViewController;
@class AnalyticsScreenTracker;

/**
 `ContactsTableViewController` delegate.
 */
@protocol ContactsTableViewControllerDelegate <NSObject>

/**
 Tells the delegate that the user selected a contact.

 @param contactsTableViewController the `ContactsTableViewController` instance.
 @param contact the selected contact.
 */
- (void)contactsTableViewController:(ContactsTableViewController *)contactsTableViewController didSelectContact:(MXKContact*)contact;

@end

/**
 'ContactsTableViewController' instance is used to display/filter a list of contacts.
 See 'ContactsTableViewController-inherited' object for example of use.
 */
@interface ContactsTableViewController : MXKViewController <UITableViewDelegate, MXKDataSourceDelegate>
{
@protected
    ContactsDataSource *contactsDataSource;
}

/**
 Returns the `UINib` object initialized for a `ContactsTableViewController`.

 @return The initialized `UINib` object or `nil` if there were errors during initialization
 or the nib file could not be located.
 */
+ (UINib *)nib;

/**
 Creates and returns a new `ContactsTableViewController` object.

 @discussion This is the designated initializer for programmatic instantiation.
 @return An initialized `ContactsTableViewController` object if successful, `nil` otherwise.
 */
+ (instancetype)contactsTableViewController;

/**
 The contacts table view.
 */
@property (weak, nonatomic) IBOutlet UITableView *contactsTableView;

/**
 When true, the footer that allows the user to enable local contacts sync will
 never be shown. When false, the footer will shown when the user hasn't enabled
 contact sync.
 */
@property (nonatomic) BOOL disableFindYourContactsFooter;

/**
 Indicates when there's an active search. This is used to determine when the contacts
 access footer should be hidden in order to list the results from the server.
 */
@property (nonatomic) BOOL contactsAreFilteredWithSearch;

/**
 If YES, the table view will scroll at the top on the next data source refresh.
 It comes back to NO after each refresh.
 */
@property (nonatomic) BOOL shouldScrollToTopOnRefresh;

/**
 Callback used to take into account the change of the user interface theme.
 */
- (void)userInterfaceThemeDidChange;

/**
 Refresh the cell selection in the table.

 This must be done accordingly to the currently selected contact in the master tabbar of the application.

 @param forceVisible if YES and if the corresponding cell is not visible, scroll the table view to make it visible.
 */
- (void)refreshCurrentSelectedCell:(BOOL)forceVisible;

/**
 Display the contacts described in the provided data source.

 The provided data source will replace the current data source if any. The caller
 should dispose properly this data source if it is not used anymore.

 @param listDataSource the data source providing the contacts list.
 */
- (void)displayList:(ContactsDataSource*)listDataSource;

/**
 Refresh the contacts table display.
 */
- (void)refreshContactsTable;

/**
 The delegate for the view controller.
 */
@property (nonatomic, weak) id<ContactsTableViewControllerDelegate> contactsTableViewControllerDelegate;

/**
 The screen timer used for analytics if they've been enabled. The default value is nil.
 */
@property (nonatomic) AnalyticsScreenTracker *screenTracker;

@end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="?actionBarSize"
    android:layout_alignParentTop="true"
    android:background="@color/colorPrimary"
    android:minHeight="?actionBarSize"
    android:paddingBottom="0dp"
    android:contentInsetEnd="16dp"
    android:contentInsetRight="16dp"
    app:titleTextColor="#FFFFFF"
    android:elevation="0dp"
    />


text:
package com.thoughtworks.go.server.messaging;

import com.thoughtworks.go.config.BasicCruiseConfig;
import com.thoughtworks.go.config.CruiseConfig;
import com.thoughtworks.go.config.GoSmtpMailSender;
import com.thoughtworks.go.config.MailHost;
import com.thoughtworks.go.helper.GoConfigMother;
import com.thoughtworks.go.server.service.GoConfigService;
import com.thoughtworks.go.util.ClassMockery;
import org.jmock.Expectations;
import org.jmock.integration.junit4.JMock;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(JMock.class)
public class EmailNotificationListenerTest {
    public ClassMockery context;
    public GoConfigService goConfigService;
    public EmailNotificationListener.GoMailSenderFactory goMailSenderFactory;
    public EmailNotificationListener emailNotificationListener;

    @Before
    public void setUp() throws Exception {
        context = new ClassMockery();
        goConfigService = context.mock(GoConfigService.class);
        goMailSenderFactory = context.mock(EmailNotificationListener.GoMailSenderFactory.class);
        emailNotificationListener = new EmailNotificationListener(goConfigService, goMailSenderFactory);
    }

    @Test
    public void shouldNotCreateMailSenderIfMailHostIsNotConfigured() {
        context.checking(new Expectations() {
            {
                allowing(goConfigService).currentCruiseConfig();
                will(returnValue(new BasicCruiseConfig()));
            }
        });
        emailNotificationListener.onMessage(null);
    }

    @Test
    public void shouldCreateMailSenderIfMailHostIsConfigured() {
        final MailHost mailHost = new MailHost("hostName", 1234, "user", "pass", true, true, "from", "admin@local.com");
        final CruiseConfig config = GoConfigMother.cruiseConfigWithMailHost(mailHost);
        context.checking(new Expectations() {
            {
                allowing(goConfigService).currentCruiseConfig();
                will(returnValue(config));
                one(goMailSenderFactory).createSender();
                will(returnValue(GoSmtpMailSender.createSender(mailHost)));
            }
        });
        emailNotificationListener.onMessage(new SendEmailMessage("subject", "body", "to"));
    }

}


text:
layout: default
title: Meyer Safety
description: Meyer Brothers Building Company has been building in Kansas City for 30 years. We speacilize in tilt-up construction for retail, industrial, institutinal, office buildings, and all other commercial needs. Give us a call at 816-246-4800 to find out more information on how we can build your next facility.
keywords: Meyer, Brothers, Meyer Brothers, Myer, Meyr, Construction, Building, Tilt, Up, Tiltup, Tilt-up, tilt-up, Brother, Framing
---

   safety by controlled environment

   The construction business is now and in many ways, has always been dangerous. At Meyer Brothers Building Company, we believe that it is possible to control, if not eliminate most accidents.

   By controlling our actions and attitudes we can have a serious effect on the security of individual jobs and the well-being of all employees. People are our most valuable asset. We intend to guard lives with more energy than we devote to guarding our reputation, our property and profitability.

   It is the policy of Meyer Brothers Building Company that the safety of our employees is considered a vital aspect of our operations.

   Their safety must be considered first when planning for construction. Management intends to provide the leadership and funds necessary to eliminate unsafe practices and conditions at our construction sites.

   Meyer Brothers Building Company intends to formulate a specific safety program tailored to each jobsite. This program will include enforcement procedures for our own employees as well as enforcement for the subcontractors. We are committed to the safety and welfare of all employees on this jobsite.

   S.T.E.P. Award Recipient on the platinum level

   The last two years Meyer Brothers Building Co. has been recognized by Associated Builders and Contractors for our superior level of commitment to safety with the highest level S.T.E.P Award. This award commends our development and adherence to a top quality safety program for 2007.


text:
@implementation Dummy {
@private
    int foo;
}

- (void)bar {
    ++foo;
}

- (id)foo:(int)x bar:(id)obj {
    foo += x;
    return [NSString stringWithFormat:@"%@", obj];
}

- (id)foo:(int)x foo:(int)y {
    foo = x + y;
    return [NSString stringWithFormat:@"%i", foo];
}

- (NSString*)all:(unsigned char)chr kinds:(id)obj of:(BOOL)yesNo different:(id*)objPtr types:(long long)longLong {
    return [NSString stringWithFormat:@"%c %@ %i %@ %i", chr, obj, yesNo, *objPtr, longLong];
}

- (void)to:o m:a n:y ar:g u:m e:n t:s {
    // This methos is not allowed to be wrapped (more than 6 arguments)
}

- (struct someStruct)takesStruct:(struct someStruct)s {
    return s;
}

@end

@implementation NWMethodWrapperTests {
    int a;
}

- (void)testNoArgumentsNoReturnValue {
    Dummy* d = [[Dummy alloc] init];

    a = 0;
    NWMethodWrapper* wrapper = [NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(bar) before:^id(id sender, ...) {
        STAssertTrue(a == 0, @"expected: a == 0");
        ++a;
        return nil;
    } after:^id(id sender, ...) {
        STAssertTrue(a == 1, @"expected: a == 1");
        ++a;
        return nil;
    }];

    [d bar];
    STAssertTrue(a == 2, @"expected: a == 2");

    [wrapper setWrapped:NO];

    [d bar];
    STAssertTrue(a == 2, @"expected: a == 2");

    [d release];
}

- (void)testIntAndIdArgumentsAndIdReturnValue {
    Dummy* d = [[Dummy alloc] init];

    a = 0;
    NWMethodWrapper* wrapper = [NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(foo:bar:) before:(ImpBlock)^void(id _self, int x, id obj) {
        STAssertTrue(a == 0, @"expected: a == 0");
        a = x + 1;
    } after:(ImpBlock)^void(id _self, int x, id obj) {
        STAssertTrue(a == 11, @"expected: a == 1");
        ++a;
    }];

    NSString* hello1 = @"hello";
    NSLog(@"hello1 lives at %p", hello1);

    id returnVal = [d foo:10 bar:hello1];
    STAssertTrue([returnVal isEqual:hello1], @"expected: returnVal ==  %@", hello1);
    STAssertTrue(a == 12, @"expected: a == 12");

    [wrapper setWrapped:NO];

    NSString* hello2 = @"hellowww";
    NSLog(@"hello2 lives at %p", hello2);

    id returnVal2 = [d foo:10 bar:hello2];
    STAssertTrue([returnVal2 isEqual:hello2], @"expected: returnVal == %@", hello2);
    STAssertTrue(a == 12, @"expected: a == 12");

    wrapper = nil;
    [d release];
    d = nil;
}

- (void)test2IntArgumentsAndIdReturnValue {
    Dummy* d = [[Dummy alloc] init];

    a = 0;
    NWMethodWrapper* wrapper = [NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(foo:foo:) before:(ImpBlock)^void(id _self, int x, int y) {
        STAssertTrue(a == 0, @"expected: a == 0");
        a = x + y;
    } after:(ImpBlock)^void(id _self, int x, int y) {
        STAssertTrue(a == x + y, @"expected: a == x + y");
        ++a;
    }];

    id returnVal = [d foo:10 foo:0x55];
    NSLog(@"%@", returnVal);
    STAssertTrue(a == 10 + 0x55 + 1, @"expected: a == 10 + 0x55 + 1");
    STAssertTrue([returnVal isEqualToString:@"95"], @"expected: '95'");

    wrapper = nil;
    [d release];
}

- (void)testDifferentTypes {
    Dummy* d = [[Dummy alloc] init];

    [NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(all:kinds:of:different:types:) before:(ImpBlock)^void(id sender, unsigned char all, id kinds, BOOL of, id* different, long long types) {
        STAssertTrue(all == 0xFF, @"expected: all == 0xFF");
        STAssertTrue([kinds isEqual:@"hello"], @"expected: kinds == 'hello'");
        STAssertTrue(of == YES, @"expected: of == YES");
        STAssertTrue(*different == kinds, @"expected: *different == kinds");
        STAssertTrue(types == LONG_MAX, @"expected: types == LONG_MAX");
    } after:(ImpBlock)^void(id sender, unsigned char all, id kinds, BOOL of, id* different, long long types) {
        STAssertTrue(all == 0xFF, @"expected: all == 0xFF");
        STAssertTrue([kinds isEqual:@"hello"], @"expected: kinds == 'hello'");
        STAssertTrue(of == YES, @"expected: of == YES");
        STAssertTrue(*different == kinds, @"expected: *different == kinds");
        STAssertTrue(types == LONG_MAX, @"expected: types == LONG_MAX");
    }];

    NSString* hello = @"hello";
    [d all:0xFF kinds:hello of:YES different:&hello types:LONG_MAX];

    [d release];
}

- (void)testStructType {
    STAssertThrows([NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(takesStruct:) before:(ImpBlock)^void(id sender, struct someStruct s) {
        //        STAssertTrue(s.x[0] == LONG_MAX, @"s.x[0] == LONG_MAX");
        //        STAssertTrue(s.x[1] == LONG_MIN, @"s.x[1] == LONG_MIN");
        //        STAssertTrue(s.x[2] == LONG_MAX, @"s.x[2] == LONG_MAX");
//        STAssertTrue(s.x[3] == LONG_MIN, @"s.x[3] == LONG_MIN");
    } after:NULL], @"expected to throw exception, because structs are not supported.");

}

- (void)testTooManyArgs {
    STAssertThrows([NWMethodWrapper wrap:[Dummy class] instanceMethodForSelector:@selector(to:m:n:ar:u:e:t:) before:NULL after:NULL], @"This should throw a 'too many arguments' exception");
}

@end


text:
<?php

namespace orm\admin\search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use orm\admin\RoleRest;

/**
 * SearchRoleRest represents the model behind the search form about `orm\admin\RoleRest`.
 */
class SearchRoleRest extends RoleRest
{
	/**
	 * Disable behaviors for search model
	 *
     * @inheritdoc
     */
	public function behaviors()
    {
        return [];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'integer'],
            [['name', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     * @param array $with // relation names to fetch
     *
     * @return ActiveDataProvider
     */
    public function search($params, $with = null)
    {
        $query = RoleRest::find();
        if (!empty($with)) $query->with($with);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'description', $this->description]);

        return $dataProvider;
    }
}


text:
describe('Angular storage integration', function(){

  var localStorage,
      $localStorage,
      testKey1,
      testKey2,
      testValue1,
      testValue2,
      testObject,
      serializedTestObject;

  beforeEach(function(){
    angular.mock.module('angular-storage');

    inject(function(_$window_, _$localStorage_) {
      localStorage = _$window_.localStorage;
      localStorage.clear();

      $localStorage = _$localStorage_;
    });

    testKey1 = 'key1';
    testValue1 = 'value1';
    testKey2 = 'key2';
    testValue2 = 'value2';
    testObject = {key: 'value'};
    serializedTestObject = JSON.stringify(testObject);
  });

  describe('Putting primitive values into localStorage', function(){
    it('should store values as strings', function(){
      var inputs = [1, true, 'foo'],
          outputs = ['1', 'true', 'foo'],
          i = 0,
          j = 0;

      inputs.forEach(function(value){
        $localStorage.put('key' + i++, value);
      });

      outputs.forEach(function(value){
        expect(localStorage.getItem('key' + j++)).toBe(value);
      });
    });
  });

  describe('Putting objects into localStorage', function(){
    it('should store serialized object', function(){
      $localStorage.putObject(testKey1, testObject);

      expect(localStorage.length).toBe(1);
      expect(localStorage.getItem(testKey1)).toBe(serializedTestObject);
    });
  });

  describe('Getting primitive values from localStorage', function(){
    it('should return value associated with provided key', function(){
      localStorage.setItem(testKey1, testValue1);

      expect($localStorage.get(testKey1)).toBe(testValue1);
    });
  });

  describe('Getting objects from localStorage', function(){
    it('should return deserialized object associated with provided key', function(){
      localStorage.setItem(testKey1, JSON.stringify(testObject));

      expect($localStorage.getObject(testKey1)).toEqual(testObject);
    });
  });

  describe('Removing data from localStorage', function(){
    it('should remove provided key and associated value', function(){
      localStorage.setItem(testKey1, testValue1);
      localStorage.setItem('foo', 'bar');

      expect(localStorage.length).toBe(2);

      $localStorage.remove(testKey1);

      expect(localStorage.getItem(testKey1)).toBe(null);
      expect(localStorage.getItem('foo')).toBe('bar');
    });
  });

  describe('Clearing all data from localStorage', function(){
    it('should remove all keys and their associated values', function(){
      localStorage.setItem(testKey1, testValue1);
      localStorage.setItem(testKey2, testValue2);

      expect(localStorage.length).toBe(2);

      $localStorage.clear();

      expect(localStorage.length).toBe(0);
    });
  });

  describe('Getting a key from localStorage', function(){
    it('should return the key at provided index', function(){
      localStorage.setItem(testKey1, testValue1);
      expect($localStorage.key(0)).toBe(testKey1);
    });

    it('should return null if there is no key at provided index', function(){
      expect($localStorage.key(0)).toBe(null);
    });
  });

  describe('Getting keys from localStorage', function(){
    it('should return an array of keys', function(){
      localStorage.setItem(testKey1, testValue1);
      localStorage.setItem(testKey2, testValue2);

      var keys = $localStorage.keys();

      [testKey1, testKey2].forEach(function(value){
        expect(keys.indexOf(value)).not.toBe(-1);
      });
    });
  });

  describe('Getting the number of items in localStorage', function(){
    it('should return a number', function(){
      localStorage.setItem(testKey1, testValue1);
      localStorage.setItem(testKey2, testValue2);

      expect($localStorage.length()).toBe(2);
    });
  });

});


text:
<?php
namespace Hx\IocContainer;

/**
 * Rule interface class for Ioc container
 * Rule is apply in top-to-bottom fahsion
 * If no matching sub-rule found, general rule in Ioc container will choose instead
 * @author chingchetsiang
 *
 */
interface RuleInterface {

	/**
	 * Get targeted class name
	 */
	public function getClassName();

	/**
	 * Get class name use to instantiate targeted class
	 */
	public function getInstanceClassName();

	/**
	 * Get closure to generate object instance
	 */
	public function getClosure();

	/**
	 * Check whether object stantiation is overrriden by closure
	 */
	public function isCodeOverride();

	/**
	 * Get service state
	 * @return boolean
	 */
	public function isService();

	/**
	 * Get primitive arguments
	 */
	public function getPrimitiveArgs();

	/**
	 * Get children rules
	 * @return	array	array of \Hx\IocContainer\RuleInterface
	 */
	public function getSubRules();

	/**
	 * Get service instance
	 * non service will throw exception
	 */
	public function getServiceInstance();

	/**
	 * Set service instance
	 * only rule is service type and haven't assign is allowable
	 * @param unknown $object
	 */
	public function setServiceInstance($object);
}
?>


text:
package com.wavesplatform.it.sync

import com.typesafe.config.{Config, ConfigFactory}
import com.wavesplatform.api.http.ApiError.{CustomValidationError, InvalidIds}
import com.wavesplatform.block.Block
import com.wavesplatform.common.utils.Base58
import com.wavesplatform.crypto.Blake2b256
import com.wavesplatform.features.BlockchainFeatures
import com.wavesplatform.it.BaseFreeSpec
import com.wavesplatform.it.api.SyncHttpApi.*
import com.wavesplatform.it.sync.activation.ActivationStatusRequest
import org.scalatest.*

import scala.concurrent.duration.*

class MerkleRootTestSuite extends BaseFreeSpec with ActivationStatusRequest with OptionValues {
  import MerkleRootTestSuite.*

  override protected def nodeConfigs: Seq[Config] = Configs

  "not able to get merkle proof before activation" in {
    miner.waitForHeight(ActivationHeight - 1)
    val txId = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None).id
    assertApiError(
      miner.getMerkleProof(txId),
      CustomValidationError(s"transactions do not exist or block version < ${Block.ProtoBlockVersion}")
    )
    assertApiError(
      miner.getMerkleProofPost(txId),
      CustomValidationError(s"transactions do not exist or block version < ${Block.ProtoBlockVersion}")
    )
  }

  "able to get merkle proof after activation" in {
    miner.waitForHeight(ActivationHeight, 2.minutes)
    val txId1 = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None, waitForTx = true).id
    val txId2 = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None, waitForTx = true).id
    val txId3 = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None, waitForTx = true).id
    miner.getMerkleProof(txId1, txId2, txId3).map(resp => resp.id) should contain theSameElementsAs Seq(txId1, txId2, txId3)
    miner.getMerkleProofPost(txId1, txId2, txId3).map(resp => resp.id) should contain theSameElementsAs Seq(txId1, txId2, txId3)
    miner.getMerkleProof(txId1, txId2, txId3).map(resp => resp.transactionIndex) should contain theSameElementsAs Seq(0, 1, 2)
    miner.getMerkleProofPost(txId1, txId2, txId3).map(resp => resp.transactionIndex) should contain theSameElementsAs Seq(0, 1, 2)
    miner.getMerkleProof(txId3).map(resp => resp.merkleProof.head).head shouldBe Base58.encode(Blake2b256.hash(Array(0.toByte)))
    miner.getMerkleProofPost(txId3).map(resp => resp.merkleProof.head).head shouldBe Base58.encode(Blake2b256.hash(Array(0.toByte)))
    assert(Base58.tryDecode(miner.getMerkleProof(txId1).head.merkleProof.head).isSuccess)
    assert(Base58.tryDecode(miner.getMerkleProofPost(txId1).head.merkleProof.head).isSuccess)
  }

  "error raised if transaction id is not valid" in {
    assertApiError(
      miner.getMerkleProof("FCymvrY43ddiKKTkznawWasoMbWd1LWyX8DUrwAAbcUA"),
      CustomValidationError(s"transactions do not exist or block version < ${Block.ProtoBlockVersion}")
    )
    assertApiError(
      miner.getMerkleProofPost("FCymvrY43ddiKKTkznawWasoMbWd1LWyX8DUrwAAbcUA"),
      CustomValidationError(s"transactions do not exist or block version < ${Block.ProtoBlockVersion}")
    )

    val invalidId = "FCym43ddiKKT000kznawWasoMbWd1LWyX8DUrwAAbcUA" // id is invalid because base58 cannot contain "0"
    assertApiError(
      miner.getMerkleProof(invalidId),
      InvalidIds(Seq(invalidId))
    )
    assertApiError(
      miner.getMerkleProofPost(invalidId),
      InvalidIds(Seq(invalidId))
    )
  }

  "merkle proof api returns only existent txs when existent and inexistent ids passed" in {
    val txId1        = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None, waitForTx = true).id
    val txId2        = miner.broadcastTransfer(miner.keyPair, miner.address, transferAmount, minFee, None, None, waitForTx = true).id
    val inexistentTx = "FCym43ddiKKT3d4kznawWasoMbWd1LWyX8DUrwAAbcUA"
    miner.getMerkleProof(txId1, txId2, inexistentTx).map(resp => resp.id) should contain theSameElementsAs Seq(txId1, txId2)
    miner.getMerkleProofPost(txId1, txId2, inexistentTx).map(resp => resp.id) should contain theSameElementsAs Seq(txId1, txId2)
  }

  "merkle proof api can handle transactionsRoot changes caused by miner settings" in {

    /** In this case we check that when some of generated microblocks connected to one keyblock transfers to next keyblock due to miner setting
      * "min-micro-block-age" it causes transactionsRoot and merkleProof recalculation
      */
    val currentHeight = nodes.waitForHeightArise()

    var txIds                  = Seq[String]()
    var merkleProofGetBefore   = Seq(Seq(""))
    var merkleProofPostBefore  = Seq(Seq(""))
    var transactionsRootBefore = ""

    while (miner.height == currentHeight) {
      val newTxId                   = miner.transfer(miner.keyPair, miner.address, 1, waitForTx = true).id
      val newTxIds                  = txIds :+ newTxId
      val newMerkleProofGetBefore   = miner.getMerkleProof(newTxIds*).map(_.merkleProof)
      val newMerkleProofPostBefore  = miner.getMerkleProofPost(newTxIds*).map(_.merkleProof)
      val newTransactionsRootBefore = miner.blockAt(currentHeight).transactionsRoot.get
      if (miner.height == currentHeight) {
        txIds = newTxIds
        merkleProofGetBefore = newMerkleProofGetBefore
        merkleProofPostBefore = newMerkleProofPostBefore
        transactionsRootBefore = newTransactionsRootBefore
      }
    }
    miner.height shouldBe currentHeight + 1
    miner.getMerkleProof(txIds*).map(_.merkleProof) should not be merkleProofGetBefore
    miner.getMerkleProofPost(txIds*).map(_.merkleProof) should not be merkleProofPostBefore
    miner.blockAt(currentHeight).transactionsRoot.get should not be transactionsRootBefore
  }
}

object MerkleRootTestSuite {

  import com.wavesplatform.it.NodeConfigs.Default

  val MicroblockActivationHeight = 0
  val FairPosActivationHeight    = 0
  val ActivationHeight           = 3

  val Config: Config = ConfigFactory.parseString(
    s"""
       |waves {
       |   blockchain.custom {
       |      functionality {
       |        pre-activated-features {
       |          ${BlockchainFeatures.NG.id} = $MicroblockActivationHeight,
       |          ${BlockchainFeatures.FairPoS.id} = $FairPosActivationHeight,
       |          ${BlockchainFeatures.BlockV5.id} = $ActivationHeight
       |        }
       |        generation-balance-depth-from-50-to-1000-after-height = 1000
       |      }
       |   }
       |   miner {
       |      quorum = 0
       |      min-micro-block-age = 10s
       |      minimal-block-generation-offset = 30s
       |   }
       |}""".stripMargin
  )

  val Configs: Seq[Config] = Default.map(Config.withFallback(_)).take(1)
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Compt. -Rend. Congrès Soc. sav. Paris 255 (1909)

#### Original name
Verticillium byssinum Pat.

### Remarks
null


text:
Originally published: 2009-09-19 06:11:33
Last updated: 2009-09-22 11:36:30
Author: poops mcgee

This is a simplified version of tornado's WSGI server implemented in python 3.

Example usage:

    import web
    import wsgiref.simple_server

    class MainHandler(web.RequestHandler):
        def get(self):
            self.write("Hello, world")

    if __name__ == "__main__":
        application = web.WSGIApplication([
            (r"/", MainHandler),
        ])
        server = wsgiref.simple_server.make_server('', 8888, application)
        server.serve_forever()


text:
package org.osanchezhuerta.employees.hr.ws.web.domain.xsd;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the org.osanchezhuerta.employees.hr.ws.web.domain.xsd package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _SalaryVOFromDate_QNAME = new QName("http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/", "fromDate");
    private final static QName _SalaryVOToDate_QNAME = new QName("http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/", "toDate");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.osanchezhuerta.employees.hr.ws.web.domain.xsd
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link GovernanceHeaderRequest }
     *
     */
    public GovernanceHeaderRequest createGovernanceHeaderRequest() {
        return new GovernanceHeaderRequest();
    }

    /**
     * Create an instance of {@link GovernanceHeaderResponse }
     *
     */
    public GovernanceHeaderResponse createGovernanceHeaderResponse() {
        return new GovernanceHeaderResponse();
    }

    /**
     * Create an instance of {@link ConsultarSalariesPorRango }
     *
     */
    public ConsultarSalariesPorRango createConsultarSalariesPorRango() {
        return new ConsultarSalariesPorRango();
    }

    /**
     * Create an instance of {@link TitleVO }
     *
     */
    public TitleVO createTitleVO() {
        return new TitleVO();
    }

    /**
     * Create an instance of {@link SalaryVO }
     *
     */
    public SalaryVO createSalaryVO() {
        return new SalaryVO();
    }

    /**
     * Create an instance of {@link Header }
     *
     */
    public Header createHeader() {
        return new Header();
    }

    /**
     * Create an instance of {@link HeaderResponse }
     *
     */
    public HeaderResponse createHeaderResponse() {
        return new HeaderResponse();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/", name = "fromDate", scope = SalaryVO.class)
    public JAXBElement<XMLGregorianCalendar> createSalaryVOFromDate(XMLGregorianCalendar value) {
        return new JAXBElement<XMLGregorianCalendar>(_SalaryVOFromDate_QNAME, XMLGregorianCalendar.class, SalaryVO.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/", name = "toDate", scope = SalaryVO.class)
    public JAXBElement<XMLGregorianCalendar> createSalaryVOToDate(XMLGregorianCalendar value) {
        return new JAXBElement<XMLGregorianCalendar>(_SalaryVOToDate_QNAME, XMLGregorianCalendar.class, SalaryVO.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/", name = "fromDate", scope = TitleVO.class)
    public JAXBElement<XMLGregorianCalendar> createTitleVOFromDate(XMLGregorianCalendar value) {
        return new JAXBElement<XMLGregorianCalendar>(_SalaryVOFromDate_QNAME, XMLGregorianCalendar.class, TitleVO.class, value);
    }

}


text:
using namespace std;
namespace bfs = boost::filesystem;

string usageString()
{
  ostringstream oss;
  oss << "Usage: dataset_viewer DATASET_DIR [OUTPUT_DIR]" << endl;
  oss << "         If supplied, OUTPUT_DIR will be filled with labeled images." << endl;
  return oss.str();
}

int main(int argc, char** argv)
{
  if(argc != 2 && argc != 3) {
    cout << usageString() << endl;
    return 1;
  }

  string root = argv[1];
  if(!bfs::exists(root + "/annotations.txt") ||
     !bfs::is_directory(root + "/images"))
  {
    cout << root << " does not appear to have a labeled image dataset." << endl;
    return 1;
  }

  string output_dir;
  if(argc == 3) {
    output_dir = argv[2];
    if(bfs::exists(output_dir)) {
      cout << "Output directory " << output_dir << " already exists.  Aborting." << endl;
      return 1;
    }
    cout << "Saving labeled images to " << output_dir << endl;
    bfs::create_directory(output_dir);
  }

  ImageLabelManager dataset(root);

  bool pause = false;
  int i = 0;
  while(true) {
    if(i >= dataset.size())
      break;

    cout << dataset.getFilenameForImage(i) << endl;
    IplImage* img = dataset.getLabeledImage(i);
    cvShowImage("Labeled", img);
    char key = cvWaitKey(10);

    if(argc == 3)
      cvSaveImage((output_dir + "/" + dataset.getFilenameForImage(i)).c_str(), img);
    cvReleaseImage(&img);

    int increment = 1;
    if(pause)
      increment = 0;

    switch(key) {
    case 'q':
      exit(0);
      break;
    case 'P':
      if(argc != 3) // No pause mode if we're dumping out to disk.
        pause = !pause;
      break;
    case '0':
      if(pause)
        increment = 10;
      break;
    case ')':
      if(pause)
        increment = -10;
      break;
    case '1':
      if(pause)
        increment = 1;
      break;
    case '!':
      if(pause)
        increment = -1;
      break;
    default:
      break;
    }

    i += increment;
    i = max(i, 0);
  }

  return 0;
}


text:
import {registerPending, registerSuccess, registerError} from '../actions/register';

export default function registerHandler(app, store, action) {
    store.dispatch(registerPending());
    const registerDetails = action.payload;
    const modelName = action.meta.modelName;
    return app.models[modelName].create(registerDetails, (err, res) => {
        if (!err) {
            store.dispatch(registerSuccess(res));
        } else {
            store.dispatch(registerError(err));
        }
    });
}


text:
var domTest = require("domtest");

// overriding default globals, which are ["$", "jQuery", "_"]
domTest.defaultGlobals = ["$", "MyAwesomeObject"];

module.exports = domTest.testCase({

    html: "base.htm",
    scripts: ["js/jquery.min.js", "js/myawesome.js"],

    setUp: function(callback) {
        // optional: do some set up stuff here...
        callback();
    },

    testjQuery: function(test) {
        // it loaded jQuery from the script tag in the HTML
        var title = this.$("h1").text()
        test.equals(title, "LOL I HAZ A CAT");
        test.done();
    },

    testMyLibrary: function(test) {
        // it pulled MyAwesomeObject from the extra scripts
        var result = this.MyAwesomeObject.doIHazCat();
        test.ok(result);
        test.done();
    },

    tearDown: function(callback) {
        // optional: undo what you did in setUp
        callback();
    }

});


text:
var moment = require('./moment.min.js'),
	filesize = require('./filesize-mod.js'),
	pureEngine = require('./pureengine.js');

var engineObject = pureEngine.VeeamPureEngine()

function logc(text,color)
{
		//http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
		normal = "\033[0;37m"
		prefix = normal

		if(color == "red") { prefix = "\033[1;31m" }
		else if (color == "green") { prefix = "\033[1;32m"}
		else if (color == "yellow") { prefix = "\033[1;33m"}

		console.log(prefix+text+normal)
}

function runtest(start,end,backupConfiguration) {
	var current = start.clone()
	var previous = start.clone().subtract(1,'days')
	console.log(current.format("dddd YYYY-MM-DD T HH"))

	while (current <= end) {
		//logc("\n"+current.format("YYYY-MM-DDTHHmmss"),"green")
		markers = engineObject.getGFSMarkers(backupConfiguration,previous,current)
		if (markers.touched) {
			builder = ""
			$.each(["w","m","q","y"], function(key,val) {
				if(markers[val] > 0) {
					builder += "\t"+val+markers[val+"gfs"].format("YY-MM-DDTHHmmss \t")
				} else {
					builder += "\t                "
				}
			})
			logc(previous.format("dddd YYYY-MM-DDTHHmmss \t")+"  -  !! Current :::"+current.format("dddd YYYY-MM-DDTHHmmss \t"),"green")
			logc(builder)
			console.log("\n")
			console.log("\n")
		}
		previous = current.clone()
		current = current.add(1,"days")
	}
	console.log("\n")
}

var start = moment("2012-12-15 22:00:00")
var end = moment("2016-02-15 22:00:00")

var backupConfiguration = pureEngine.VeeamBackupConfigurationObject(3,14,1000);
backupConfiguration.GFS = {"W":0,"M":4,"Q":5,"Y":5}
backupConfiguration.GFSWeeklyDay = 6

//backupConfiguration.GFSMonthlyDayOfMonth = 15
backupConfiguration.GFSMonthlyDay = 6
backupConfiguration.GFSMonthlyMonthWeek = 1

//backupConfiguration.GFSQuarterlyDayOfMonth = 31
//backupConfiguration.GFSQuarterlyMonth = 2
backupConfiguration.GFSQuarterlyDay = 6
backupConfiguration.GFSQuarterlyQuarterWeek = 1

//backupConfiguration.GFSYearlyDayOfMonth = 31
//backupConfiguration.GFSYearlyMonth = 1
backupConfiguration.GFSYearlyDay = 6
backupConfiguration.GFSYearlyDayWeek = 2

runtest(start.clone(),end.clone(),backupConfiguration)


text:
An example of the Lenses Dev Box setup with SSL and ACLs.

## Usage

Edit `docker-compose.yml` to add your developer license link to the `EULA`
_environment variable_. Like this:

    - EULA=https://dl.lenses.stream/d/?id=<YOUR-LICENSE-KEY>

Then just run _docker-compose_. After a minute or so, Lenses should be available
at <http://localhost:3030>.

    docker-compose up

For your clients, you will find some SSL keystores and truststore
under <http://localhost:3030/fdd/certs>.

## Sample Data

By default we disable the built-in data generators because, the principal
builder class can become too vocal as the generators use the PLAINTEXT listener
of the brokers. Feel free to enable it by setting `SAMPLEDATA` to `1` in the
`docker-compose.yml`.

## landoop/fast-data-dev

It should be straightforward to adjust the example for `landoop/fast-data-dev`,
just change the image name in `docker-compose.yml`.  You can also drop the
Lenses settings from there as well, though they are ignored from
_fast-data-dev_, so it ins't necessary.


text:
var AWS = require('aws-sdk');
var CfnLambda = require('cfn-lambda');

var APIG = new AWS.APIGateway({apiVersion: '2015-07-09'});

var Delete = CfnLambda.SDKAlias({
  api: APIG,
  method: 'deleteIntegration',
  keys: ['HttpMethod', 'ResourceId', 'RestApiId'],
  downcase: true,
  ignoreErrorCodes: [404]
});

var Upsert = CfnLambda.SDKAlias({
  api: APIG,
  method: 'putIntegration',
  downcase: true,
  returnPhysicalId: function(data, params) {
    return [
      params.RestApiId,
      params.ResourceId,
      params.HttpMethod
    ].join(':');
  }
});

exports.handler = CfnLambda({
  Create: Upsert,
  Update: Upsert,
  Delete: Delete,
  SchemaPath: [__dirname, 'schema.json']
});


text:
using namespace foundation;
using namespace std;

TEST_SUITE(Foundation_Image_EXRImageFileWriter)
{
    static const char* Filename = "unit tests/outputs/test_exrimagefilewriter.exr";
    static const Color4b Reference(50, 100, 150, 42);

    void generate_test_openexr_file()
    {
        Image image(2, 2, 32, 32, 4, PixelFormatFloat);
        image.clear(Reference);

        EXRImageFileWriter writer;
        writer.write(Filename, image);
    }

    Tile* load_test_openexr_file()
    {
        ProgressiveEXRImageFileReader reader;
        reader.open(Filename);
        return reader.read_tile(0, 0);
    }

    TEST_CASE(CorrectlyWriteTestImage)
    {
        generate_test_openexr_file();

        auto_ptr<Tile> tile(load_test_openexr_file());

        for (size_t i = 0; i < 4; ++i)
        {
            Color4b c;
            tile->get_pixel(i, c);
            EXPECT_EQ(Reference, c);
        }
    }
}


text:
result=$(bash ./run-module-layout.sh "$@")

curl -X POST -H "Content-Type: application/json" -d "$result" http://litt.no/api/report
echo ""


text:
Fight for control of whose face is online.

## Developer tutorial

This tutorial tells you how to build a slightly simplified version of MyFace.

1.  Install Meteor.

    ```Shell
    $ \curl -L https://install.meteor.com | /bin/sh
    ```

2.  Create a new Meteor application.

    ```Shell
    $ meteor create myface
    $ cd myface
    ```

    All shell commands from here onwards should be executed from your `myface`
    directory.

3.  Start the Meteor development server.

    ```Shell
    $ meteor
    ```

4.  Add the packages we'll be using.

    ```Shell
    $ meteor add accounts-password
    $ meteor add accounts-ui
    $ meteor add coffeescript
    ```

5.  Open a modern web browser (e.g., Google Chrome or Mozilla Firefox) and
    navigate to http://localhost:3000. You should see Meteor's _Hello World_
    application.

6.  Remove the _Hello World_ source files.

    ```Shell
    $ rm myface.*
    ```

7.  Create directories for your server-side, client-side and shared code.

    ```Shell
    $ mkdirs -p lib client/views server
    ```

8.  Create that base HTML, which includes mobile-friendly boiler-plate.

    `client/views/base.html`

    ```HTML
    <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="mobile-web-app-capable" content="yes">
      <meta name="viewport"
            content="user-scalable=no, width=device-width, initial-scale=1">
      <title>MyFace - parts of your face online</title>
    </head>

    <body>
      <p>Hello</p>
    </body>
    ```

    Whenever you save, your browser will automatically refresh and show the
    latest version of your site.

9.  Configure the accounts package so that users can create an account with a
    username (as opposed to an email address).

    `client/accounts.coffee`

    ```CoffeeScript
    Accounts.ui.config
      passwordSignupFields: 'USERNAME_ONLY'
    ```

10. Create a template to house the login buttons and the rest of the
    application.

    `client/views/router.html`

    ```HTML
    <template name="router">
      {{loginButtons}}
    </template>
    ```

11. Have Meteor render the `router` template by changing the content of the
    `body` tag.

    `client/views/base.html`

    ```HTML
    <!-- Snip -->
    <body>
      {{> router}}
    </body>
    ```


text:
class AudioDevice {
public:
  AudioDevice(AudioDeviceID devid, bool isInput);
  OSStatus SetBufferSize(UInt32 size);
  OSStatus SetSampleRate(Float64 sr);
  OSStatus ReloadStreamFormat();
  char *GetName(char *buf, UInt32 maxlen);
  UInt32 getStreamPhysicalBitDepth(bool isInput);
  AudioDeviceID mID;
  bool mIsInput;
  UInt32 mSafetyOffset;
  UInt32 mBufferSizeFrames;
  AudioStreamBasicDescription mFormat;
};

#endif