text:
<?php

namespace Konani\VideoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Doctrine\ORM\NoResultException;
use Symfony\Component\HttpFoundation\JsonResponse;

use Symfony\Component\HttpFoundation\Request;

use Google_Service_YouTube;

/**
 * Class handles requests from map and returns formatted responses
 *
 * Class VideoAPIController
 * @package Konani\VideoBundle\Controller
 */
class VideoAPIController extends Controller
{
    public function listVideosByCoordsAction($min_lat,$max_lat,$min_lng,$max_lng)
    {
        try {
            $videosInMap = $this->getDoctrine()
                ->getRepository('KonaniVideoBundle:Video')
                ->findVideosByCoordinates($min_lat, $max_lat, $min_lng, $max_lng);
        } catch (NoResultException $e) {
            throw $this->createNotFoundException(
                'No videos found in given coordinates'
            );
        }
        $response = new JsonResponse();
        $response->setData($this->get('json_helper')->createMarkers($videosInMap));
        return $response;
    }

    /**
     * Returns information about specific video to map's infowindow
     *
     * @param $id
     * @return JsonResponse
     * @throws \Exception
     */
    public function videoByIdAction($id)
    {
        $my_client = $this->get('google_client');
        $client = $my_client->getGoogleClient();
        $youtube = new Google_Service_YouTube($client);
        try {
            $video = $this->getDoctrine()
                ->getRepository('KonaniVideoBundle:Video')
                ->findOneBy([
                        'id' => $id
                    ]);
            $searchResponse = $youtube->videos->listVideos('snippet', [
                    'id' => $video->getYoutubeId(),
                ]);
        } catch (NoResultException $e) {
            throw $this->createNotFoundException(
                'No video found for id '.$id
            );
        }
        $response = new JsonResponse();
        $response->setData($this->videoArrayFromResponseAction($id, $searchResponse['items'][0]['snippet']));
        return $response;
    }

    /**
     * Returns name and address of the closest google place to the specified coordinates
     *
     * @param $lat
     * @param $lng
     * @return JsonResponse
     * @throws \Exception
     */
    public function nearbyPlaceAction($lat,$lng)
    {
        $nearby_place = $this->get('google_client')->getNearbyPlace($lat,$lng);
        $response = new JsonResponse();
        $response->setData($nearby_place);
        return $response;
    }

    /**
     * Forms an cleaner array of a video data
     *
     * @param $id
     * @param $searchResponse
     * @return array
     */
    private function videoArrayFromResponseAction($id,$searchResponse)
    {
        $videoArray = [
            'id' => $id,
            'title' => $searchResponse['title'],
            'description' => $searchResponse['description'],
            'youtube_id' => $searchResponse['id'],
            'thumbnail' => [
                'url' => $searchResponse['thumbnails']['default']['url'],
                'width' => $searchResponse['thumbnails']['default']['width'],
                'height' => $searchResponse['thumbnails']['default']['height'],
            ]
        ];
        return $videoArray;
    }
}


text:
<Alloy>
	<Collection src="trailsModel" />
	<Collection src="hotspotModel" />
	<Collection src="infospot_trailsModel"/>
	<Collection src="infospotCoordinatesModel"/>
	<Collection src="letterModel" />
	<Model src="letterModel" />
	<Model src="hotspotModel" />

	<Window id="hotspotWindow">
		<View class="container" onClose="destroyModel">
			<ScrollView class="headView" scrollType="vertical">
				<TableView id="hotspotTable" onClick="showHotspotDetailView">
					<TableViewRow class="row"></TableViewRow>
				</TableView>
			</ScrollView>
		</View>
	</Window>
</Alloy>

redpajama_set_name: RedPajamaGithub


text:
package nom.bdezonia.zorbage.algorithm;

import nom.bdezonia.zorbage.algebra.Algebra;
import nom.bdezonia.zorbage.algebra.SetComplex;
import nom.bdezonia.zorbage.datasource.IndexedDataSource;
import nom.bdezonia.zorbage.procedure.Procedure2;

/**
 *
 * @author Barry DeZonia
 *
 */
public class SetIValues {

	// do not instantiate

	private SetIValues() { }

	/**
	 * Set the values of an output list using the I values from a list of Complex, Quaternion,
	 * or Octonion numbers.
	 *
	 * @param algU
	 * @param algW
	 * @param input
	 * @param output
	 */
	public static <T extends Algebra<T,U>,
					U,
					V extends Algebra<V,W>,
					W extends SetComplex<U>>
		void compute(T algU, V algW, IndexedDataSource<U> input, IndexedDataSource<W> output)
	{
		Procedure2<U, W> xform = new Procedure2<U, W>() {

			@Override
			public void call(U a, W b) {
				b.setI(a);
			}
		};

		Transform2.compute(algU, algW, xform, input, output);
	}
}


text:
<?php
	include_once('init.php');
    include_once($BASE_PATH.'database/encomendas.php');

    header('Content-Type: application/json');

    $encomenda = array("id" => $_GET['id'], "title" => "encomenda espectacular");
    echo json_encode($encomenda);
?>


text:
from __future__ import print_function

# the name of the project
name = 'jupyter_docker_kernel'

#-----------------------------------------------------------------------------
# Minimal Python version sanity check
#-----------------------------------------------------------------------------

import sys

v = sys.version_info
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
    error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
    print(error, file=sys.stderr)
    sys.exit(1)

PY3 = (sys.version_info[0] >= 3)

#-----------------------------------------------------------------------------
# get on with it
#-----------------------------------------------------------------------------

import os
from glob import glob

from distutils.core import setup

pjoin = os.path.join
here = os.path.abspath(os.path.dirname(__file__))
pkg_root = pjoin(here, name)

packages = []
for d, _, _ in os.walk(pjoin(here, name)):
    if os.path.exists(pjoin(d, '__init__.py')):
        packages.append(d[len(here)+1:].replace(os.path.sep, '.'))

version_ns = {}
with open(pjoin(here, name, '_version.py')) as f:
    exec(f.read(), {}, version_ns)

setup_args = dict(
    name            = name,
    version         = version_ns['__version__'],
    scripts         = glob(pjoin('scripts', '*')),
    packages        = packages,
    description     = "Jupyter docker kernel library",
    author          = 'Marius van Niekerk',
    author_email    = 'marius.v.niekerk@gmail.com',
    url             = 'http://jupyter.org',
    license         = 'BSD',
    platforms       = "Linux, Mac OS X, Windows",
    keywords        = ['Interactive', 'Interpreter', 'Shell', 'Web'],
    classifiers     = [
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
    ],
)

if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv):
    import setuptools

setuptools_args = {}
install_requires = setuptools_args['install_requires'] = [
    'jupyter_client',
]

extras_require = setuptools_args['extras_require'] = {
    'test': 'ipykernel',
}

if 'setuptools' in sys.modules:
    setup_args.update(setuptools_args)
    # setup_args['entry_points'] = {
    #     'console_scripts': [
    #         'jupyter-kernelspec = jupyter_client.kernelspecapp:KernelSpecApp.launch_instance',
    #     ]
    # }
    setup_args.pop('scripts', None)

if __name__ == '__main__':
    setup(**setup_args)


text:
package org.jusecase.transaction.simple.jdbc;

import org.jusecase.transaction.TransactionError;
import org.jusecase.transaction.Transaction;
import org.jusecase.transaction.simple.TransactionManager;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class DataSourceTransaction implements Transaction {
    private final TransactionManager transactionManager;
    private final ConnectionProxy connectionProxy;
    private final boolean initialAutoCommitEnabled;

    public DataSourceTransaction(DataSource dataSource, TransactionManager transactionManager) {
        this.transactionManager = transactionManager;
        try {
            connectionProxy = new ConnectionProxy(dataSource.getConnection());
            initialAutoCommitEnabled = connectionProxy.getAutoCommit();
            connectionProxy.setAutoCommit(false);
        } catch (SQLException e) {
            closeConnectionQuietly();
            throw new TransactionError("Failed to create transaction.", e);
        }
    }

    @Override
    public void rollback() {
        try {
            connectionProxy.rollback();
        } catch (SQLException e) {
            throw new TransactionError("Failed to rollback transaction.", e);
        } finally {
            closeTransaction();
        }
    }

    @Override
    public void commit() {
        try {
            connectionProxy.commit();
            closeTransaction();
        } catch (SQLException e) {
            throw new TransactionError("Failed to commit transaction.", e);
        }
    }

    private void closeTransaction() {
        transactionManager.setCurrent(null);
        closeConnectionQuietly();
    }

    private void closeConnectionQuietly() {
        if (connectionProxy != null) {
            try {
                Connection connection = connectionProxy.getConnection();
                try {
                    connection.setAutoCommit(initialAutoCommitEnabled);
                } finally {
                    connection.close();
                }
            } catch (SQLException e) {
                // Connection is closed quietly.
            }
        }
    }

    public Connection getConnection() {
        return connectionProxy;
    }
}


text:
<?php

/**
 * Transaction
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 *
 * @package    betyolo
 * @subpackage model
 * @author     Nguyen Anh Tuan
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class Transaction extends BaseTransaction
{
  #type
  const DEPOSIT  = 1;
  const WITHDRAW = 2;

  #status
  const PENDING   = 1;
  const COMPLETED = 2;
  const FAILED    = 3;
  static $statuses = array(
    self::PENDING   => 'PENDING',
    self::COMPLETED => 'COMPLETED',
    self::FAILED    => 'FAILED',
  );

  static public $amounts = array(
    10000 => 10000,
    20000 => 20000,
    50000 => 50000,
    100000 => 100000,
    200000 => 200000,
    300000 => 300000,
    400000 => 400000,
    500000 => 500000,
  );

  public function deposit($hcoin = 0)
  {
    if ($this->getStatus() != self::PENDING || $hcoin <= 0 ) {
      return false;
    }

    $user_profile = Doctrine_Core::getTable('sfGuardUser')->find($this->getUserId())->getProfile();

    if (!$user_profile->getHcoin()) {
      $user_profile->setsfGuardUserId($this->getUserId());
      $user_profile->setHcoin($hcoin);
    } else {
      $user_profile->setHcoin($user_profile->getHcoin() + $hcoin);
    }
    $user_profile->save();

    $this->setStatus(self::COMPLETED);
    $this->save();

    return true;
  }

  public function cancelTransaction()
  {
    $this->setStatus(self::FAILED);
    $this->save();
  }

  public function withdraw($hcoin = 0)
  {
    $user_profile = Doctrine_Core::getTable('sfGuardUser')->find($this->getUserId())->getProfile();
    if(!$user_profile) {
      return false;
    }
    $user_hcoin = $user_profile->getHcoin();
    if ($this->getStatus() != self::PENDING || $hcoin <= 0  || $hcoin > $user_hcoin) {
      return false;
    }

    $user_profile->setHcoin($user_hcoin - $hcoin);
    $user_profile->save();

    $this->setStatus(self::COMPLETED);
    $this->save();

    return true;
  }
}


text:
testData.conversation = {
  id: 1,
  slug: 'test-conversation',
  title: 'Test Conversation',
  starter: 'Test Starter',
  created_at: '2012-03-19T06:50:54-04:00',
  summary: '
The conversation summary.
',
  author: {
    id: 1,
    name: 'John Doe',
    slug: 'john-doe',
    location: '/users/john-doe',
    avatar: 'http://s3.amazonaws.com/com.theciviccommons.int/avatars/default/avatar_70.gif'
  },
  number_of_top_level_contributions: 10,
  number_of_contributions: 30
}


text:
//
//  AppDelegate.m
//  PhotoWheel
//
//  Created by Kirby Turner on 8/7/11.
//  Copyright (c) 2011 White Peak Software Inc. All rights reserved.
//

#import "AppDelegate.h"
#import <HockeySDK/HockeySDK.h>
#import "SVProgressHUD.h"
#import "WPSAlertView.h"

#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

@interface AppDelegate () <BITHockeyManagerDelegate, BITUpdateManagerDelegate, BITCrashManagerDelegate, MFMailComposeViewControllerDelegate>
@property (nonatomic, strong) NSMutableArray *iCloudNotificationQueue;
@property (nonatomic, assign, readwrite, getter=isPersistentStoreReady) BOOL persistentStoreReady;
@end

@implementation AppDelegate

@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   [[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:HOCKEYKIT_BETA_APPKEY liveIdentifier:HOCKEYKIT_LIVE_APPKEY delegate:self];
   [[BITHockeyManager sharedHockeyManager] startManager];

   [self.window makeKeyAndVisible];
   return YES;
}

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

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

   NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
   [nc removeObserver:self name:NSManagedObjectContextDidSaveNotification object:nil];
}

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

}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
   /*
    Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    */
   NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
   [nc addObserver:self selector:@selector(managedObjectContextDidSave:) name:NSManagedObjectContextDidSaveNotification object:nil];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
   // Saves changes in the application's managed object context before the application terminates.
   [self saveContext];
}

- (void)saveContext
{
   NSError *error = nil;
   NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
   if (managedObjectContext != nil)
   {
      if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error])
      {
         // Force assertion to report the error.
         ZAssert(NO, @"Unresolved error %@\n%@", [error localizedDescription], [error userInfo]);
      }
   }
}

- (void)managedObjectContextDidSave:(NSNotification *)notification
{
   NSManagedObjectContext *context = [self managedObjectContext];
   [context performSelectorOnMainThread:@selector(mergeChangesFromContextDidSaveNotification:) withObject:notification waitUntilDone:YES];
}

#pragma mark - Core Data stack

/**
 Returns the managed object context for the application.
 If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
 */
- (NSManagedObjectContext *)managedObjectContext
{
   if (_managedObjectContext != nil) {
      return _managedObjectContext;
   }

   NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
   if (coordinator != nil) {
      _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
      [_managedObjectContext setPersistentStoreCoordinator:coordinator];
      [_managedObjectContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy];
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mergeChangesFromCloud:) name:NSPersistentStoreDidImportUbiquitousContentChangesNotification object:coordinator];
   }
   return _managedObjectContext;
}

/**
 Returns the managed object model for the application.
 If the model doesn't already exist, it is created from the application's model.
 */
- (NSManagedObjectModel *)managedObjectModel
{
   if (_managedObjectModel != nil) {
      return _managedObjectModel;
   }
   NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"PhotoWheel" withExtension:@"momd"];
   _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
   return _managedObjectModel;
}

/**
 Returns the persistent store coordinator for the application.
 If the coordinator doesn't already exist, it is created and the application's store added to it.
 */
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
   if (_persistentStoreCoordinator != nil)
   {
      return _persistentStoreCoordinator;
   }

   [self setPersistentStoreReady:NO];
   [SVProgressHUD showWithStatus:@"Syncing with iCloud" maskType:SVProgressHUDMaskTypeClear];

   NSError *error = nil;
   NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"PhotoWheel.sqlite"];
   NSManagedObjectModel *model = [self managedObjectModel];
   BOOL success = [self progressivelyMigrateURL:storeURL ofType:NSSQLiteStoreType toModel:model error:&error];
   if (!success) {
      // TODO: Alert the user.
      DLog(@"Migration error: %@", [error localizedDescription]);
   }

   _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];

   dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      // Build a URL to use as NSPersistentStoreUbiquitousContentURLKey
      NSURL *cloudURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];

      NSDictionary *options = nil;

      if (cloudURL != nil) {
         NSString* coreDataCloudContent = [[cloudURL path] stringByAppendingPathComponent:@"photowheel"];
         cloudURL = [NSURL fileURLWithPath:coreDataCloudContent];

         options = @{
         NSPersistentStoreUbiquitousContentNameKey : @"com.whitepeaksoftware.photowheel",
         NSPersistentStoreUbiquitousContentURLKey : cloudURL,
         NSMigratePersistentStoresAutomaticallyOption : @YES,
         NSInferMappingModelAutomaticallyOption: @YES,
         };
      }

      NSError *error = nil;
      [_persistentStoreCoordinator lock];
      NSPersistentStore *newStore = [_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error];
      if (!newStore)
      {
         ZAssert(NO, @"Unresolved error %@\n%@", [error localizedDescription], [error userInfo]);
      }
      [_persistentStoreCoordinator unlock];
      [self setPersistentStoreReady:(newStore != nil)];

      dispatch_async(dispatch_get_main_queue(), ^{
         if (newStore) {
            DLog(@"Asynchronously added persistent store!");
            [[NSNotificationCenter defaultCenter] postNotificationName:kRefetchAllDataNotification object:self userInfo:nil];
         } else {
            [self alertUserAboutError:error];
         }
         [SVProgressHUD dismiss];
      });
   });

   return _persistentStoreCoordinator;
}

#pragma mark - Progressive Migration -

- (BOOL)progressivelyMigrateURL:(NSURL*)sourceStoreURL ofType:(NSString*)type toModel:(NSManagedObjectModel*)finalModel error:(NSError**)error
{
   NSDictionary *sourceMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:type URL:sourceStoreURL error:error];
   if (!sourceMetadata) {
      return NO;
   }

   if ([finalModel isConfiguration:nil compatibleWithStoreMetadata:sourceMetadata]) {
      *error = nil;
      return YES;
   }

   //Find the source model
   NSManagedObjectModel *sourceModel = [NSManagedObjectModel mergedModelFromBundles:nil forStoreMetadata:sourceMetadata];
   ZAssert(sourceModel != nil, @"Failed to find source model\n%@", sourceMetadata);

   //Find all of the mom and momd files in the Resources directory
   NSMutableArray *modelPaths = [NSMutableArray array];
   NSArray *momdArray = [[NSBundle mainBundle] pathsForResourcesOfType:@"momd" inDirectory:nil];
   for (NSString *momdPath in momdArray) {
      NSString *resourceSubpath = [momdPath lastPathComponent];
      NSArray *array = [[NSBundle mainBundle] pathsForResourcesOfType:@"mom" inDirectory:resourceSubpath];
      [modelPaths addObjectsFromArray:array];
   }
   NSArray* otherModels = [[NSBundle mainBundle] pathsForResourcesOfType:@"mom" inDirectory:nil];
   [modelPaths addObjectsFromArray:otherModels];
   if (!modelPaths || ![modelPaths count]) {
      //Throw an error if there are no models
      NSDictionary *dict = @{NSLocalizedDescriptionKey:@"No models found in bundle."};
      *error = [NSError errorWithDomain:@"PhotoWheel" code:8001 userInfo:dict];
      return NO;
   }

   //See if we can find a matching destination model
   NSMappingModel *mappingModel = nil;
   NSManagedObjectModel *targetModel = nil;
   NSString *modelPath = nil;
   for (modelPath in modelPaths) {
      targetModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:[NSURL fileURLWithPath:modelPath]];
      mappingModel = [NSMappingModel mappingModelFromBundles:nil forSourceModel:sourceModel destinationModel:targetModel];
      //If we found a mapping model then proceed
      if (mappingModel) {
         break;
      }
   }
   //We have tested every model, if nil here we failed
   if (!mappingModel) {
      NSDictionary *dict = @{NSLocalizedDescriptionKey:@"No models found in bundle."};
      *error = [NSError errorWithDomain:@"PhotoWheel" code:8001 userInfo:dict];
      return NO;
   }
   //We have a mapping model and a destination model.  Time to migrate
   NSMigrationManager *manager = [[NSMigrationManager alloc] initWithSourceModel:sourceModel destinationModel:targetModel];
   NSString *modelName = [[modelPath lastPathComponent] stringByDeletingPathExtension];
   NSString *storeExtension = [[sourceStoreURL path] pathExtension];
   NSString *storePath = [[sourceStoreURL path] stringByDeletingPathExtension];
   //Build a path to write the new store
   storePath = [NSString stringWithFormat:@"%@.%@.%@", storePath, modelName, storeExtension];
   NSURL *destinationStoreURL = [NSURL fileURLWithPath:storePath];
   if (![manager migrateStoreFromURL:sourceStoreURL
                                type:type
                             options:nil
                    withMappingModel:mappingModel
                    toDestinationURL:destinationStoreURL
                     destinationType:type
                  destinationOptions:nil
                               error:error]) {
      return NO;
   }
   //Migration was successful, move the files around to preserve the source
   NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
   guid = [guid stringByAppendingPathExtension:modelName];
   guid = [guid stringByAppendingPathExtension:storeExtension];
   NSString *appSupportPath = [storePath stringByDeletingLastPathComponent];
   NSString *backupPath = [appSupportPath stringByAppendingPathComponent:guid];

   NSFileManager *fileManager = [NSFileManager defaultManager];
   if (![fileManager moveItemAtPath:[sourceStoreURL path] toPath:backupPath error:error]) {
      //Failed to copy the file
      return NO;
   }
   //Move the destination to the source path
   if (![fileManager moveItemAtPath:storePath toPath:[sourceStoreURL path] error:error]) {
      //Try to back out the source move first, no point in checking it for errors
      [fileManager moveItemAtPath:backupPath toPath:[sourceStoreURL path] error:nil];
      return NO;
   }
   //We may not be at the "current" model yet, so recurse
   return [self progressivelyMigrateURL:sourceStoreURL ofType:type toModel:finalModel error:error];
}

#pragma mark - Report iCloud Error

- (void)alertUserAboutError:(NSError *)error
{
   NSString *message = [NSString stringWithFormat:@"Uh oh. Something failed with iCloud syncing. Please email this error to me, Kirby Turner. ('%@')", [error localizedDescription]];
   WPSAlertView *alert = [[WPSAlertView alloc] initWithTitle:@"Sync Error" message:message completion:^(WPSAlertView *alertView, NSInteger buttonIndex) {

      if (buttonIndex == 1) {

         NSString *messageBody = [NSString stringWithFormat:@"Something failed with iCloud syncing. Here's the error:\n\n\n%i %@\n\n%@\n\n%@\n\n%@", [error code], [error domain],[error localizedDescription], [error userInfo], [error localizedFailureReason]];

         MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
         [mailer setMailComposeDelegate:self];
         [mailer setSubject:@"PhotoWheel sync error"];
         [mailer setMessageBody:messageBody isHTML:NO];
         [mailer setToRecipients:@[@"support@whitepeaksoftware.com"]];

         [[[self window] rootViewController] presentViewController:mailer animated:YES completion:nil];
      }

   } cancelButtonTitle:@"Cancel" otherButtonTitles:@"Send Email", nil];

   [alert show];
}

- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
   if (result == MFMailComposeResultSent) {
      WPSAlertView *alert = [[WPSAlertView alloc] initWithTitle:@"Thanks" message:@"Thank you for your help." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
      [alert show];
   }
   [[[self window] rootViewController] dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - iCloud Sync

- (void)mergeChangesFromCloud:(NSNotification *)notification
{
   [self queueMergeCloudNotification:notification];
   if ([self isPersistentStoreReady]) {
      [self processMergeCloudNotifications];
   }
}

- (void)queueMergeCloudNotification:(NSNotification *)notification
{
   DLog(@"Queuing iCloud merge notification.");
   if (![self iCloudNotificationQueue]) {
      NSMutableArray *newQueue = [NSMutableArray array];
      [self setICloudNotificationQueue:newQueue];
   }
   [[self iCloudNotificationQueue] addObject:notification];
}

- (void)processMergeCloudNotifications
{
   DLog(@"Processing %i notifications.", [[self iCloudNotificationQueue] count]);
   NSManagedObjectContext* moc = [self managedObjectContext];
   [moc performBlock:^{
      [[self iCloudNotificationQueue] enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
         [moc mergeChangesFromContextDidSaveNotification:obj];
      }];
      [moc processPendingChanges];
      [[self iCloudNotificationQueue] removeAllObjects];

      dispatch_async(dispatch_get_main_queue(), ^{
         NSNotification *refreshNotificaiton = [NSNotification notificationWithName:kRefetchAllDataNotification object:self userInfo:nil];
         [[NSNotificationCenter defaultCenter] postNotification:refreshNotificaiton];
      });
   }];
}

#pragma mark - Application's Documents directory

/**
 Returns the URL to the application's Documents directory.
 */
- (NSURL *)applicationDocumentsDirectory
{
   return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

#pragma mark - BITUpdateManagerDelegate
- (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager
{
#ifndef CONFIGURATION_AppStore
   if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)])
      return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
#endif
   return nil;
}

@end


text:
from urwid import SolidFill

def parse_tag_from_node(node):
    return SolidFill()


text:
#ifndef INCLUDE_SCHIFRA_SEQUENTIAL_ROOT_GENERATOR_POLYNOMIAL_CREATOR_HPP
#define INCLUDE_SCHIFRA_SEQUENTIAL_ROOT_GENERATOR_POLYNOMIAL_CREATOR_HPP

#include <cstddef>

#include "schifra_galois_field.hpp"
#include "schifra_galois_field_element.hpp"
#include "schifra_galois_field_polynomial.hpp"

namespace schifra
{

   class sequential_root_generator_polynomial_creator
   {
   public:

      sequential_root_generator_polynomial_creator(const galois::field& field,
                                                   const std::size_t initial_index,
                                                   const std::size_t num_elements,
                                                   galois::field_polynomial& generator_polynomial)
      {
         if (
              (initial_index                 >= field.size()) ||
             ((initial_index + num_elements) >  field.size())
             )
         {
            return;
         }

         galois::field_element ALPHA(field,2);
         galois::field_polynomial X  = galois::generate_X(field);
         generator_polynomial = galois::field_element(field, 1);
         for (std::size_t i = initial_index; i < (initial_index + num_elements); ++i)
         {
            generator_polynomial *= (X + (ALPHA ^ static_cast<galois::field_symbol>(i)));
         }
      }
   };

} // namespace schifra

#endif


text:
<?php

namespace luya\news\models;

use luya\news\admin\Module;

/**
 * News Category Model
 *
 * @author Basil Suter <basil@nadar.io>
 */
class Cat extends \luya\admin\ngrest\base\NgRestModel
{
    public $i18n = ['title'];

    public function init()
    {
        parent::init();
        $this->on(self::EVENT_BEFORE_DELETE, [$this, 'eventBeforeDelete']);
    }

    public function eventBeforeDelete($event)
    {
        if (count($this->articles) > 0) {
            $this->addError('id', Module::t('cat_delete_error'));
            $event->isValid = false;
        }
    }

    public static function tableName()
    {
        return 'news_cat';
    }

    public function scenarios()
    {
        return [
            'restcreate' => ['title'],
            'restupdate' => ['title'],
        ];
    }

    public function rules()
    {
        return [
            [['title'], 'required'],
        ];
    }

    /**
     *
     * {@inheritDoc}
     * @see \yii\base\Model::attributeLabels()
     */
    public function attributeLabels()
    {
        return [
            'title' => Module::t('cat_title'),
        ];
    }

    public function ngRestAttributeTypes()
    {
        return [
            'title' => 'text',
        ];
    }

    public static function ngRestApiEndpoint()
    {
        return 'api-news-cat';
    }

    public function ngRestConfig($config)
    {
        $this->ngRestConfigDefine($config, 'list', ['title']);

        $config->create->copyFrom('list', ['id']);
        $config->update->copyFrom('list', ['id']);

        $config->delete = true;

        return $config;
    }

    /**
     * Get articles for this category.
     */
    public function getArticles()
    {
        return $this->hasMany(Article::className(), ['cat_id' => 'id']);
    }
}


text:
export const PlatformSelect = {
  props: ['platform'],
  template: `

      All

      iOS

      Android

  `,
  methods: {
    getLocation() {
      return location.pathname;
    }
  }
};


text:
/*
 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SOL_SYS_INTTYPES_H
#define _SOL_SYS_INTTYPES_H

#include <inttypes.h>

#define _INT64_TYPE

#endif


text:
export class Track {
  constructor(
    public artist:string,
    public name:string,
    public playCount:number
  ) { }
}


text:
const addr16_t BASE_ADDR = 0x0100;

StackManager::StackManager(Core& core, MemoryController& memory)
    : m_core(core),
      m_memory(memory)
{
}

void StackManager::push(const data8_t& data)
{
    m_memory.set(BASE_ADDR + m_core.getSP(), data);
    m_core.decrementSP();
}

data8_t StackManager::pop()
{
    m_core.incrementSP();
    return *m_memory.get(BASE_ADDR + m_core.getSP());
}


text:
var Package = require('dgeni').Package;
var basePackage = require('../docs-package');

module.exports = new Package('angular-v2-public-docs', [basePackage])

.config(function(readTypeScriptModules) {
  readTypeScriptModules.sourceFiles = [
    'angular2/metadata.ts',
    'angular2/change_detection.ts',
    'angular2/core.ts',
    'angular2/di.ts',
    'angular2/directives.ts',
    'angular2/http.ts',
    'angular2/forms.ts',
    'angular2/router.ts',
    'angular2/test.ts',
    'angular2/pipes.ts'
  ];
  readTypeScriptModules.hidePrivateMembers = true;
})

.config(function(getLinkInfo) {
  getLinkInfo.useFirstAmbiguousLink = false;
})

// Configure file writing
.config(function(writeFilesProcessor) {
  writeFilesProcessor.outputFolder  = 'dist/public_docs';
});


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.10.10 at 02:39:29 PM KST
//

package org.oliot.model.epcis;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 *

 * Java class for ServiceTransaction complex type.
 *
 *

 * The following schema fragment specifies the expected content contained within
 * this class.
 *
 *

 * <complexType name="ServiceTransaction">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <attribute name="TypeOfServiceTransaction" type="{http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader}TypeOfServiceTransaction" />
 *       <attribute name="IsNonRepudiationRequired" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="IsAuthenticationRequired" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="IsNonRepudiationOfReceiptRequired" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="IsIntegrityCheckRequired" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="IsApplicationErrorResponseRequested" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="TimeToAcknowledgeReceipt" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="TimeToAcknowledgeAcceptance" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="TimeToPerform" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="Recurrence" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ServiceTransaction", namespace = "http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader")
public class ServiceTransaction {

	@XmlAttribute(name = "TypeOfServiceTransaction")
	protected TypeOfServiceTransaction typeOfServiceTransaction;
	@XmlAttribute(name = "IsNonRepudiationRequired")
	protected String isNonRepudiationRequired;
	@XmlAttribute(name = "IsAuthenticationRequired")
	protected String isAuthenticationRequired;
	@XmlAttribute(name = "IsNonRepudiationOfReceiptRequired")
	protected String isNonRepudiationOfReceiptRequired;
	@XmlAttribute(name = "IsIntegrityCheckRequired")
	protected String isIntegrityCheckRequired;
	@XmlAttribute(name = "IsApplicationErrorResponseRequested")
	protected String isApplicationErrorResponseRequested;
	@XmlAttribute(name = "TimeToAcknowledgeReceipt")
	protected String timeToAcknowledgeReceipt;
	@XmlAttribute(name = "TimeToAcknowledgeAcceptance")
	protected String timeToAcknowledgeAcceptance;
	@XmlAttribute(name = "TimeToPerform")
	protected String timeToPerform;
	@XmlAttribute(name = "Recurrence")
	protected String recurrence;

	/**
	 * Gets the value of the typeOfServiceTransaction property.
	 *
	 * @return possible object is {@link TypeOfServiceTransaction }
	 *
	 */
	public TypeOfServiceTransaction getTypeOfServiceTransaction() {
		return typeOfServiceTransaction;
	}

	/**
	 * Sets the value of the typeOfServiceTransaction property.
	 *
	 * @param value
	 *            allowed object is {@link TypeOfServiceTransaction }
	 *
	 */
	public void setTypeOfServiceTransaction(TypeOfServiceTransaction value) {
		this.typeOfServiceTransaction = value;
	}

	/**
	 * Gets the value of the isNonRepudiationRequired property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getIsNonRepudiationRequired() {
		return isNonRepudiationRequired;
	}

	/**
	 * Sets the value of the isNonRepudiationRequired property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setIsNonRepudiationRequired(String value) {
		this.isNonRepudiationRequired = value;
	}

	/**
	 * Gets the value of the isAuthenticationRequired property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getIsAuthenticationRequired() {
		return isAuthenticationRequired;
	}

	/**
	 * Sets the value of the isAuthenticationRequired property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setIsAuthenticationRequired(String value) {
		this.isAuthenticationRequired = value;
	}

	/**
	 * Gets the value of the isNonRepudiationOfReceiptRequired property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getIsNonRepudiationOfReceiptRequired() {
		return isNonRepudiationOfReceiptRequired;
	}

	/**
	 * Sets the value of the isNonRepudiationOfReceiptRequired property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setIsNonRepudiationOfReceiptRequired(String value) {
		this.isNonRepudiationOfReceiptRequired = value;
	}

	/**
	 * Gets the value of the isIntegrityCheckRequired property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getIsIntegrityCheckRequired() {
		return isIntegrityCheckRequired;
	}

	/**
	 * Sets the value of the isIntegrityCheckRequired property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setIsIntegrityCheckRequired(String value) {
		this.isIntegrityCheckRequired = value;
	}

	/**
	 * Gets the value of the isApplicationErrorResponseRequested property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getIsApplicationErrorResponseRequested() {
		return isApplicationErrorResponseRequested;
	}

	/**
	 * Sets the value of the isApplicationErrorResponseRequested property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setIsApplicationErrorResponseRequested(String value) {
		this.isApplicationErrorResponseRequested = value;
	}

	/**
	 * Gets the value of the timeToAcknowledgeReceipt property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getTimeToAcknowledgeReceipt() {
		return timeToAcknowledgeReceipt;
	}

	/**
	 * Sets the value of the timeToAcknowledgeReceipt property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setTimeToAcknowledgeReceipt(String value) {
		this.timeToAcknowledgeReceipt = value;
	}

	/**
	 * Gets the value of the timeToAcknowledgeAcceptance property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getTimeToAcknowledgeAcceptance() {
		return timeToAcknowledgeAcceptance;
	}

	/**
	 * Sets the value of the timeToAcknowledgeAcceptance property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setTimeToAcknowledgeAcceptance(String value) {
		this.timeToAcknowledgeAcceptance = value;
	}

	/**
	 * Gets the value of the timeToPerform property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getTimeToPerform() {
		return timeToPerform;
	}

	/**
	 * Sets the value of the timeToPerform property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setTimeToPerform(String value) {
		this.timeToPerform = value;
	}

	/**
	 * Gets the value of the recurrence property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getRecurrence() {
		return recurrence;
	}

	/**
	 * Sets the value of the recurrence property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setRecurrence(String value) {
		this.recurrence = value;
	}

}


text:
(function () {
    'use strict';

    angular.module('app.ui').component('wDataHeader', {
        bindings: {
            signable: '<',
            voteObject: '<'
        },
        templateUrl: 'modules/ui/directives/transactionInfo/types/data/data-header.html'
    });
})();


text:
int main(int argc, char **argv)
{
    // AR.Drone class
    ARDrone ardrone;

    // Initialize
    if (!ardrone.open()) {
        printf("Failed to initialize.\n");
        return -1;
    }

    // Kalman filter
    CvKalman *kalman = cvCreateKalman(4, 2);

    // Setup
    cvSetIdentity(kalman->measurement_matrix, cvRealScalar(1.0));
    cvSetIdentity(kalman->process_noise_cov, cvRealScalar(1e-5));
    cvSetIdentity(kalman->measurement_noise_cov, cvRealScalar(0.1));
    cvSetIdentity(kalman->error_cov_post, cvRealScalar(1.0));

    // Linear system
    kalman->DynamMatr[0]  = 1.0; kalman->DynamMatr[1]  = 0.0; kalman->DynamMatr[2]  = 1.0; kalman->DynamMatr[3]  = 0.0;
    kalman->DynamMatr[4]  = 0.0; kalman->DynamMatr[5]  = 1.0; kalman->DynamMatr[6]  = 0.0; kalman->DynamMatr[7]  = 1.0;
    kalman->DynamMatr[8]  = 0.0; kalman->DynamMatr[9]  = 0.0; kalman->DynamMatr[10] = 1.0; kalman->DynamMatr[11] = 0.0;
    kalman->DynamMatr[12] = 0.0; kalman->DynamMatr[13] = 0.0; kalman->DynamMatr[14] = 0.0; kalman->DynamMatr[15] = 1.0;

    // Thresholds
    int minH = 0, maxH = 255;
    int minS = 0, maxS = 255;
    int minV = 0, maxV = 255;

    // Create a window
    cvNamedWindow("binalized");
    cvCreateTrackbar("H max", "binalized", &maxH, 255);
    cvCreateTrackbar("H min", "binalized", &minH, 255);
    cvCreateTrackbar("S max", "binalized", &maxS, 255);
    cvCreateTrackbar("S min", "binalized", &minS, 255);
    cvCreateTrackbar("V max", "binalized", &maxV, 255);
    cvCreateTrackbar("V min", "binalized", &minV, 255);
    cvResizeWindow("binalized", 0, 0);

    // Main loop
    while (1) {
        // Key input
        int key = cvWaitKey(1);
        if (key == 0x1b) break;

        // Update
        if (!ardrone.update()) break;

        // Get an image
        IplImage *image = ardrone.getImage();

        // HSV image
        IplImage *hsv = cvCloneImage(image);
        cvCvtColor(image, hsv, CV_RGB2HSV_FULL);

        // Binalized image
        IplImage *binalized = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 1);

        // Binalize
        CvScalar lower = cvScalar(minH, minS, minV);
        CvScalar upper = cvScalar(maxH, maxS, maxV);
        cvInRangeS(image, lower, upper, binalized);

        // Show result
        cvShowImage("binalized", binalized);

        // De-noising
        cvMorphologyEx(binalized, binalized, NULL, NULL, CV_MOP_CLOSE);

        // Detect contours
        CvSeq *contour = NULL, *maxContour = NULL;
        CvMemStorage *contourStorage = cvCreateMemStorage();
        cvFindContours(binalized, contourStorage, &contour, sizeof(CvContour), CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);

        // Find largest contour
        double max_area = 0.0;
        while (contour) {
            double area = fabs(cvContourArea(contour));
            if ( area > max_area) {
                maxContour = contour;
                max_area = area;
            }
            contour = contour->h_next;
        }

        // Object detected
        if (maxContour) {
            // Draw a contour
            cvZero(binalized);
            cvDrawContours(binalized, maxContour, cvScalarAll(255), cvScalarAll(255), 0, CV_FILLED);

            // Calculate the moments
            CvMoments moments;
            cvMoments(binalized, &moments, 1);
            int my = (int)(moments.m01/moments.m00);
            int mx = (int)(moments.m10/moments.m00);

            // Measurements
            float m[] = {mx, my};
            CvMat measurement = cvMat(2, 1, CV_32FC1, m);

            // Correct phase
            const CvMat *correction = cvKalmanCorrect(kalman, &measurement);
        }

        // Prediction phase
        const CvMat *prediction = cvKalmanPredict(kalman);

        // Display the image
        cvCircle(image, cvPointFrom32f(cvPoint2D32f(prediction->data.fl[0], prediction->data.fl[1])), 10, CV_RGB(0,255,0));
        cvShowImage("camera", image);

        // Release the memories
        cvReleaseImage(&hsv);
        cvReleaseImage(&binalized);
        cvReleaseMemStorage(&contourStorage);
    }

    // Release the kalman filter
    cvReleaseKalman(&kalman);

    // See you
    ardrone.close();

    return 0;
}


text:
package com.vaadin.tests.components.grid.basicfeatures.client;

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

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

import org.junit.Test;

import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
import com.vaadin.tests.widgetset.client.grid.GridBasicClientFeaturesWidget;

public class GridClientColumnPropertiesTest extends GridBasicClientFeaturesTest {

    @Test
    public void initialColumnWidths() {
        openTestURL();

        for (int col = 0; col < GridBasicClientFeaturesWidget.COLUMNS; col++) {
            int width = getGridElement().getCell(0, col).getSize().getWidth();
            if (col <= 6) {
                // Growing column widths
                int expectedWidth = 50 + col * 25;
                assertEquals("column " + col + " has incorrect width",
                        expectedWidth, width);
            }
        }
    }

    @Test
    public void testChangingColumnWidth() {
        openTestURL();

        selectMenuPath("Component", "Columns", "Column 0", "Width", "50px");
        int width = getGridElement().getCell(0, 0).getSize().getWidth();
        assertEquals(50, width);

        selectMenuPath("Component", "Columns", "Column 0", "Width", "200px");
        width = getGridElement().getCell(0, 0).getSize().getWidth();
        assertEquals(200, width);

        selectMenuPath("Component", "Columns", "Column 0", "Width", "auto");
        int autoWidth = getGridElement().getCell(0, 0).getSize().getWidth();
        assertLessThan("Automatic sizing should've shrunk the column",
                autoWidth, width);
    }

    @Test
    public void testFrozenColumns() {
        openTestURL();

        assertFalse(cellIsFrozen(0, 0));
        assertFalse(cellIsFrozen(0, 1));

        selectMenuPath("Component", "State", "Frozen column count", "1 columns");

        assertTrue(cellIsFrozen(1, 0));
        assertFalse(cellIsFrozen(1, 1));

        selectMenuPath("Component", "State", "Selection mode", "multi");

        assertTrue(cellIsFrozen(1, 1));
        assertFalse(cellIsFrozen(1, 2));

        selectMenuPath("Component", "State", "Frozen column count", "0 columns");

        assertTrue(cellIsFrozen(1, 0));
        assertFalse(cellIsFrozen(1, 1));

        selectMenuPath("Component", "State", "Frozen column count",
                "-1 columns");

        assertFalse(cellIsFrozen(1, 0));
    }

    @Test
    public void testFrozenColumns_columnsReordered_frozenColumnsKept() {
        openTestURL();

        selectMenuPath("Component", "State", "Frozen column count", "2 columns");

        assertTrue(cellIsFrozen(1, 0));
        assertTrue(cellIsFrozen(1, 1));
        assertFalse(cellIsFrozen(1, 2));

        selectMenuPath("Component", "State", "Reverse grid columns");

        assertTrue(cellIsFrozen(1, 0));
        assertTrue(cellIsFrozen(1, 1));
        assertFalse(cellIsFrozen(1, 2));
    }

    @Test
    public void testBrokenRenderer() {
        setDebug(true);
        openTestURL();

        GridElement gridElement = getGridElement();

        // Scroll first row out of view
        gridElement.getRow(50);

        // Enable broken renderer for the first row
        selectMenuPath("Component", "Columns", "Column 0", "Broken renderer");

        // Shouldn't have an error notification yet
        assertFalse("Notification was present",
                isElementPresent(NotificationElement.class));

        // Scroll broken row into view and enjoy the chaos
        gridElement.getRow(0);

        assertTrue("Notification was not present",
                isElementPresent(NotificationElement.class));

        assertFalse("Text in broken cell should have old value",
                "(0, 0)".equals(gridElement.getCell(0, 0).getText()));

        assertEquals("Neighbour cell should be updated", "(0, 1)", gridElement
                .getCell(0, 1).getText());

        assertEquals("Neighbour cell should be updated", "(1, 0)", gridElement
                .getCell(1, 0).getText());
    }

    @Test
    public void testColumnWidths_onColumnReorder_columnWidthsKeptTheSame() {
        // given
        openTestURL();
        GridElement gridElement = getGridElement();
        List<GridCellElement> headerCells = gridElement.getHeaderCells(0);

        final List<Integer> columnWidths = new ArrayList<Integer>();
        for (GridCellElement cell : headerCells) {
            columnWidths.add(cell.getSize().getWidth());
        }

        // when
        selectMenuPath("Component", "State", "Reverse grid columns");

        // then
        gridElement = getGridElement();
        headerCells = gridElement.getHeaderCells(0);
        final int size = headerCells.size();
        for (int i = 0; i < size; i++) {
            // Avoid issues with inaccuracies regarding subpixels.
            assertEquals(
                    "Column widths don't match after reset, index after flip "
                            + i, columnWidths.get(i),
                    headerCells.get(size - 1 - i).getSize().getWidth(), 1.0d);
        }

    }

    private boolean cellIsFrozen(int row, int col) {
        return getGridElement().getCell(row, col).isFrozen();
    }
}


text:
from __future__ import print_function, division
from builtins import range
import gym
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from gym import wrappers
from datetime import datetime
from sklearn.pipeline import FeatureUnion
from sklearn.preprocessing import StandardScaler
from sklearn.kernel_approximation import RBFSampler

class SGDRegressor:
	def __init__(self, D):
		self.w = np.random.randn(D) / np.sqrt(D)
		self.lr = 10e-2

	def partial_fit(self, X, Y):
		self.w += self.lr*(Y - X.dot(self.w)).dot(X)

	def predict(self, X):
		return X.dot(self.w)

class FeatureTransformer:
	def __init__(self, env):
		observation_examples = np.random.random((20000, 4))*2 - 1
		scaler = StandardScaler()
		scaler.fit(observation_examples)
		scaler
		# RBF kernels
		featurizer = FeatureUnion([
			("rbf1", RBFSampler(gamma=1.0, n_components=1000)),
			("rbf2", RBFSampler(gamma=0.5, n_components=1000)),
			("rbf3", RBFSampler(gamma=0.1, n_components=1000)),
			("rbf4", RBFSampler(gamma=0.05, n_components=1000)),
			("rbf5", RBFSampler(gamma=0.01, n_components=1000)),
			("rbf6", RBFSampler(gamma=0.005, n_components=1000)),
			])
		feature_examples = featurizer.fit_transform(scaler.transform(observation_examples))

		self.dimensions = feature_examples.shape[1]
		self.scaler = scaler
		self.featurizer = featurizer

	def transform(self, observations):
		scaled = self.scaler.transform(observations)
		return self.featurizer.transform(scaled)

class Model:
	def __init__(self, env, feature_transformer):
		self.env = env
		self.models = []
		self.feature_transformer = feature_transformer
		for _ in range(env.action_space.n):
			model = SGDRegressor(feature_transformer.dimensions)
			self.models.append(model)

	def predict(self, s):
		X = self.feature_transformer.transform(np.atleast_2d(s))
		return np.array([m.predict(X)[0] for m in self.models])

	def update(self, s, a, G):
		X = self.feature_transformer.transform(np.atleast_2d(s))
		self.models[a].partial_fit(X, [G])

	def sample_action(self, s, eps):
		if np.random.random() < eps:
			return self.env.action_space.sample()
		else:
			return np.argmax(self.predict(s))

def play_one(env, model, eps, gamma):
	observation = env.reset()
	done = False
	totalreward = 0
	iters = 0
	while not done and iters < 2000:
		action = model.sample_action(observation, eps)
		prev_observation = observation
		observation, reward, done, info = env.step(action)

		if done:
			reward = -200

		# update model
		next = model.predict(observation)
		assert(len(next.shape) == 1)
		G = reward + gamma*np.max(next)
		model.update(prev_observation, action, G)

		if reward == 1:
			totalreward += reward
		iters += 1
	return totalreward

def plot_running_avg(totalrewards):
	N = len(totalrewards)
	running_avg = np.empty(N)
	for t in range(N):
		running_avg[t] = totalrewards[max(0, t-100):(t+1)].mean()
	plt.plot(running_avg)
	plt.title("Running Average")
	plt.show()

def main():
	env = gym.make('CartPole-v0')
	ft = FeatureTransformer(env)
	model = Model(env, ft)
	gamma = 0.99

	if 'monitor' in sys.argv:
		filename = os.path.basename(__file__).split('.')[0]
		monitor_dir = './' + filename + '_' + str(datetime.now())
		env = wrappers.Monitor(env, monitor_dir)

	N = 500
	totalrewards = np.empty(N)
	costs = np.empty(N)
	for n in range(N):
		eps = 1.0/np.sqrt(n+1)
		totalreward = play_one(env, model, eps, gamma)
		totalrewards[n] = totalreward
		if n % 100 == 0:
			print("episode:", n, "total reward:", totalreward, "eps:", eps, "avg reward (last 100):", totalrewards[max(0, n-100):(n+1)].mean())

	print("avg reward for last 100 episodes:", totalrewards[-100:].mean())
	print("total steps:", totalrewards.sum())

	plt.plot(totalrewards)
	plt.title("Rewards")
	plt.show()

	plot_running_avg(totalrewards)

if __name__ == '__main__':
	main()

# # cart-pendulum parameters
# cart_m = 1.0 # cart mass
# bob1_m = 0.8 # bob mass
# bob1_l = 3.0 # link length
# bob1_theta = 0.4 # initial angle
# cart_fric = 0.5 # cart friction coefficient
# bob1_fric = 0.5 # pendulum friction coefficient
# dt = 0.01 # update interval

# # target signal parameters
# bob1_omega = 1.0
# bob1_phi = 0.0
# bob1_amp = 1.0

# # initialise Q
# num_s = 51
# num_a = 3
# init_s = 0
# init_a = 0
# init_r = 0
# epsilon = 0.2
# lr = 0.1
# gamma = 0.9

# # create a cart pendulum system
# system = CartPendulum(cart_m, bob1_m, bob1_l, bob1_theta, cart_fric, bob1_fric, dt)

# # create a target signal along the x-axis
# target_signal = TargetSignal(bob1_omega, bob1_phi, bob1_amp, dt)


text:
package androidx.media3.exoplayer.ima;

import static com.google.common.truth.Truth.assertThat;

import androidx.media3.common.AdPlaybackState;
import androidx.media3.common.C;
import androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.AdsLoader.State;
import androidx.media3.exoplayer.source.ads.ServerSideAdInsertionUtil;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.common.collect.ImmutableMap;
import org.junit.Test;
import org.junit.runner.RunWith;

/** Unit tests for {@link ImaServerSideAdInsertionMediaSource}. */
@RunWith(AndroidJUnit4.class)
public class ImaServerSideAdInsertionMediaSourceTest {

  @Test
  public void adsLoaderStateToBundle_marshallAndUnmarshalling_resultIsEqual() {
    AdPlaybackState firstAdPlaybackState =
        ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(
            new AdPlaybackState("adsId1"),
            /* fromPositionUs= */ 0,
            /* contentResumeOffsetUs= */ 10,
            /* adDurationsUs...= */ 5_000_000,
            10_000_000,
            20_000_000);
    AdPlaybackState secondAdPlaybackState =
        ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(
                new AdPlaybackState("adsId2"),
                /* fromPositionUs= */ 0,
                /* contentResumeOffsetUs= */ 10,
                /* adDurationsUs...= */ 10_000_000)
            .withPlayedAd(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0);
    AdPlaybackState thirdAdPlaybackState =
        ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(
            new AdPlaybackState("adsId3"),
            /* fromPositionUs= */ C.TIME_END_OF_SOURCE,
            /* contentResumeOffsetUs= */ 10,
            /* adDurationsUs...= */ 10_000_000);
    thirdAdPlaybackState =
        ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(
                thirdAdPlaybackState,
                /* fromPositionUs= */ 0,
                /* contentResumeOffsetUs= */ 10,
                /* adDurationsUs...= */ 10_000_000)
            .withRemovedAdGroupCount(1);
    State state =
        new State(
            ImmutableMap.<String, AdPlaybackState>builder()
                .put("adsId1", firstAdPlaybackState)
                .put("adsId2", secondAdPlaybackState)
                .put("adsId3", thirdAdPlaybackState)
                .buildOrThrow());

    assertThat(State.CREATOR.fromBundle(state.toBundle())).isEqualTo(state);
  }
}


text:
require 'signed_request'

describe SignedRequest do
  before(:each) do
    @test_key = 'mykey'
  end

  describe "sign" do
    it "should sign the params and path and return the correct signed key as base64" do
      params = {
        "tokenID" => "N1CHGCG13NNB4JMVJN1Q1JXIKBQDO4DQ595NRSCTILAU47P7GA7JVQMMJNXRUJFM",
        "callerReference" => "44441234567fdsa44",
        "expiry" => "10/2014",
        "status" => "SC"
      }

      result = SignedRequest.sign(params, @test_key, :path => '/v1/api/mypath')
      result.should == "oT/QGLKMPAX3sI3hvFLAK5yyGE8="
    end

    it "should sign the request and return the correct signed key as base64" do
      params = {
        "tokenID" => "N1CHGCG13NNB4JMVJN1Q1JXIKBQDO4DQ595NRSCTILAU47P7GA7JVQMMJNXRUJFM",
        "callerReference" => "44441234567fdsa44",
        "expiry" => "10/2014",
        "status" => "SC"
      }

      result = SignedRequest.sign(params, @test_key)
      result.should == "uoOmSftU4gnUMK6Q1ylyGnr5hEw="
    end

    it "should handle params with hashes as values deterministically" do
      params = {
        :user => {
          :username => 'dbalatero',
          :password => 'password',
          :password_confirmation => 'password',
          :token => 'z883481299kxkldksjkfdsalfdasfdas'
        }
      }

      sig = SignedRequest.sign(params, @test_key)
      20.times do
        SignedRequest.sign(params.dup, @test_key).should == sig
      end
    end
  end

  describe "validate" do
    it "should decode params with hashes as values correctly" do
      params = {
        :user => {
          :username => 'dbalatero',
          :password => 'password',
          :password_confirmation => 'password',
          :token => 'z883481299kxkldksjkfdsalfdasfdas'
        },
        :test => 'ok'
      }

      sig = SignedRequest.sign(params, @test_key)
      params['signature'] = sig

      result = SignedRequest.validate(params, @test_key)
      result.should be_true
    end

    it "should return true given a correct request" do
      good_params = {
        "tokenID" => "N1CHGCG13NNB4JMVJN1Q1JXIKBQDO4DQ595NRSCTILAU47P7GA7JVQMMJNXRUJFM",
        "callerReference" => "44441234567fdsa44",
        "action" => "amazon_return",
        "signature" => "uoOmSftU4gnUMK6Q1ylyGnr5hEw=",
        "controller" => "checkout",
        "expiry" => "10/2014",
        "status" => "SC"
      }

      SignedRequest.validate(good_params, @test_key).should be_true
    end

    it "should return false if there is no signature given" do
      good_params_without_signature = {
        "tokenID" => "N1CHGCG13NNB4JMVJN1Q1JXIKBQDO4DQ595NRSCTILAU47P7GA7JVQMMJNXRUJFM",
        "callerReference" => "44441234567fdsa44",
        "action" => "amazon_return",
        "controller" => "checkout",
        "expiry" => "10/2014",
        "status" => "SC"
      }

      SignedRequest.validate(good_params_without_signature, @test_key).should be_false
    end

    it "should return false if there is a bad signature given" do
      result = SignedRequest.validate({'signature' => 'bad', 'param1' => 'ok'}, @test_key)
      result.should be_false
    end

    describe "validating with different key names" do
      before(:each) do
        @params = { :dude => 12345 }
        @signature = SignedRequest.sign(@params, 'awesome')
      end

      it "should work with a string key" do
        result = SignedRequest.validate(@params.merge('signature' => @signature), 'awesome')
        result.should be_true
      end

      it "should work with a symbol key" do
        result = SignedRequest.validate(@params.merge(:signature => @signature), 'awesome')
        result.should be_true
      end
    end
  end
end


text:
/**
 * @module ol/layer/Image
 */
import BaseImageLayer from './BaseImage.js';
import CanvasImageLayerRenderer from '../renderer/canvas/ImageLayer.js';

/**
 * @classdesc
 * Server-rendered images that are available for arbitrary extents and
 * resolutions.
 * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}
 * property on the layer object; for example, setting `title: 'My Title'` in the
 * options means that `title` is observable, and has get/set accessors.
 *
 * @template {import("../source/Image.js").default} ImageSourceType
 * @extends {BaseImageLayer<ImageSourceType, CanvasImageLayerRenderer>}
 * @api
 */
class ImageLayer extends BaseImageLayer {
  /**
   * @param {import("./BaseImage.js").Options<ImageSourceType>} [opt_options] Layer options.
   */
  constructor(opt_options) {
    super(opt_options);
  }

  createRenderer() {
    return new CanvasImageLayerRenderer(this);
  }

  /**
   * Get data for a pixel location.  A four element RGBA array will be returned.  For requests outside the
   * layer extent, `null` will be returned.  Data for an image can only be retrieved if the
   * source's `crossOrigin` property is set.
   *
   * ```js
   * // display layer data on every pointer move
   * map.on('pointermove', (event) => {
   *   console.log(layer.getData(event.pixel));
   * });
   * ```
   * @param {import("../pixel").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
   * @api
   */
  getData(pixel) {
    return super.getData(pixel);
  }
}

export default ImageLayer;


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mobet.Domain.Entities
{
    public abstract class AggregateRoot : Entity
    {
        [Timestamp]
        public virtual byte[] Version { get; set; }
    }

    public abstract class AggregateRoot<TPrimaryKey> : Entity<TPrimaryKey>
    {
        [Timestamp]
        public virtual byte[] Version { get; set; }
    }
}


text:
package com.riversoft.weixin.mp.media;

import com.riversoft.weixin.common.WxClient;
import com.riversoft.weixin.common.exception.WxRuntimeException;
import com.riversoft.weixin.common.media.Media;
import com.riversoft.weixin.common.media.MediaType;
import com.riversoft.weixin.common.util.JsonMapper;
import com.riversoft.weixin.mp.MpWxClientFactory;
import com.riversoft.weixin.mp.base.AppSetting;
import com.riversoft.weixin.mp.base.WxEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.InputStream;
import java.util.Map;

/**
 * 临时素材管理
 * 1、对于临时素材,每个素材(media_id)会在开发者上传或粉丝发送到微信服务器3天后自动删除(
 * 所以用户发送给开发者的素材,若开发者需要,应尽快下载到本地),以节省服务器资源。
 * 2、media_id是可复用的。
 * 3、素材的格式大小等要求与公众平台官网一致。
 * 具体是,图片大小不超过2M,支持bmp/png/jpeg/jpg/gif格式,
 * 语音大小不超过5M,长度不超过60秒,支持mp3/wma/wav/amr格式
 * <p/>
 * Created by exizhai on 11/12/2015.
 */
public class Medias {

    private static Logger logger = LoggerFactory.getLogger(Medias.class);

    private WxClient wxClient;

    public static Medias defaultMedias() {
        return with(AppSetting.defaultSettings());
    }

    public static Medias with(AppSetting appSetting) {
        Medias medias = new Medias();
        medias.setWxClient(MpWxClientFactory.getInstance().with(appSetting));
        return medias;
    }

    public void setWxClient(WxClient wxClient) {
        this.wxClient = wxClient;
    }

    /**
     * 上传临时图片,语音,视频和缩略图
     *
     * @param type        临时素材类型:只能是 图片,语音,视频和缩略图
     * @param inputStream 临时素材流
     * @param fileName    临时素材文件名
     * @return 返回临时素材meta信息
     */
    public Media upload(MediaType type, InputStream inputStream, String fileName) {
        if (type == MediaType.file || type == MediaType.mpnews) {
            throw new WxRuntimeException(999, "unsupported media type: " + type.name());
        }
        String url = WxEndpoint.get("url.media.upload");
        String response = wxClient.post(String.format(url, type.name()), inputStream, fileName);
        logger.debug("upload media response: {}", response);

        Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);
        if (result.containsKey("media_id")) {
            return JsonMapper.defaultMapper().fromJson(response, Media.class);
        } else {
            logger.warn("media upload failed: {}", response);
            throw new WxRuntimeException(999, response);
        }
    }

    /**
     * 下载图片,语音和缩略图,不支持视频文件的下载
     *
     * @param mediaId media id
     * @return 文件
     */
    public File download(String mediaId) {
        return wxClient.download(String.format(WxEndpoint.get("url.media.get"), mediaId));
    }

    /**
     * 下载高清语音素材,格式为speex,16K采样率
     *
     * @param mediaId media id
     * @return 文件
     */
    public File downloadHDVoice(String mediaId) {
        return wxClient.download(String.format(WxEndpoint.get("url.media.get.jssdk"), mediaId));
    }

}


text:
function setChartWidth(){
  $('.resizable-chart').each(function(){
    $(this).width($(this).parent().width());
  })
}


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-cli-cordova-shims'
};


text:
package chuckcoughlin.sb.assistant.common;

import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;

import chuckcoughlin.sb.assistant.R;

/**
 * ColorUtils is a class with one method, used to color the ViewHolders in
 * the RecyclerView. I put in a separate class in an attempt to keep the
 * code organized.
 *
 * We aren't going to go into detail about how this method works, but feel
 * free to explore!
 */
public class ColorUtils {

    /**
     * This method returns the appropriate shade of green to form the gradient
     * seen in the list, based off of the order in which the
     * {@link com.example.android.recyclerview.GreenAdapter.NumberViewHolder}
     * instance was created.
     *
     * This method is used to show how ViewHolders are recycled in a RecyclerView.
     * At first, the colors will form a nice, consistent gradient. As the
     * RecyclerView is scrolled, the
     * {@link com.example.android.recyclerview.GreenAdapter.NumberViewHolder}'s will be
     * recycled and the list will no longer appear as a consistent gradient.
     *
     * @param context     Context for getting colors
     * @param instanceNum Order in which the calling ViewHolder was created
     *
     * @return A shade of green based off of when the calling ViewHolder
     * was created.
     */
    public static int getViewHolderBackgroundColorFromInstance(Context context, int instanceNum) {
        switch (instanceNum) {
            case 0:
                return ContextCompat.getColor(context, R.color.material50Green);
            case 1:
                return ContextCompat.getColor(context, R.color.material100Green);
            case 2:
                return ContextCompat.getColor(context, R.color.material150Green);
            case 3:
                return ContextCompat.getColor(context, R.color.material200Green);
            case 4:
                return ContextCompat.getColor(context, R.color.material250Green);
            case 5:
                return ContextCompat.getColor(context, R.color.material300Green);
            case 6:
                return ContextCompat.getColor(context, R.color.material350Green);
            case 7:
                return ContextCompat.getColor(context, R.color.material400Green);
            case 8:
                return ContextCompat.getColor(context, R.color.material450Green);
            case 9:
                return ContextCompat.getColor(context, R.color.material500Green);
            case 10:
                return ContextCompat.getColor(context, R.color.material550Green);
            case 11:
                return ContextCompat.getColor(context, R.color.material600Green);
            case 12:
                return ContextCompat.getColor(context, R.color.material650Green);
            case 13:
                return ContextCompat.getColor(context, R.color.material700Green);
            case 14:
                return ContextCompat.getColor(context, R.color.material750Green);
            case 15:
                return ContextCompat.getColor(context, R.color.material800Green);
            case 16:
                return ContextCompat.getColor(context, R.color.material850Green);
            case 17:
                return ContextCompat.getColor(context, R.color.material900Green);

            default:
                return Color.WHITE;
        }
    }
}


text:
/*************************************************************************/
/*  managed_callable.cpp                                                 */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "managed_callable.h"

#include "csharp_script.h"
#include "mono_gd/gd_mono_marshal.h"
#include "mono_gd/gd_mono_utils.h"

#ifdef GD_MONO_HOT_RELOAD
SelfList<ManagedCallable>::List ManagedCallable::instances;
Map<ManagedCallable *, Array> ManagedCallable::instances_pending_reload;
Mutex ManagedCallable::instances_mutex;
#endif

bool ManagedCallable::compare_equal(const CallableCustom *p_a, const CallableCustom *p_b) {
	const ManagedCallable *a = static_cast<const ManagedCallable *>(p_a);
	const ManagedCallable *b = static_cast<const ManagedCallable *>(p_b);

	MonoDelegate *delegate_a = (MonoDelegate *)a->delegate_handle.get_target();
	MonoDelegate *delegate_b = (MonoDelegate *)b->delegate_handle.get_target();

	if (!delegate_a || !delegate_b) {
		if (!delegate_a && !delegate_b) {
			return true;
		}
		return false;
	}

	// Call Delegate's 'Equals'
	return GDMonoUtils::mono_delegate_equal(delegate_a, delegate_b);
}

bool ManagedCallable::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) {
	if (compare_equal(p_a, p_b)) {
		return false;
	}
	return p_a < p_b;
}

uint32_t ManagedCallable::hash() const {
	// hmm
	uint32_t hash = delegate_invoke->get_name().hash();
	return hash_djb2_one_64(delegate_handle.handle, hash);
}

String ManagedCallable::get_as_text() const {
	return "Delegate::Invoke";
}

CallableCustom::CompareEqualFunc ManagedCallable::get_compare_equal_func() const {
	return compare_equal_func_ptr;
}

CallableCustom::CompareLessFunc ManagedCallable::get_compare_less_func() const {
	return compare_less_func_ptr;
}

ObjectID ManagedCallable::get_object() const {
	// TODO: If the delegate target extends Godot.Object, use that instead!
	return CSharpLanguage::get_singleton()->get_managed_callable_middleman()->get_instance_id();
}

void ManagedCallable::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const {
	r_call_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; // Can't find anything better
	r_return_value = Variant();

#ifdef GD_MONO_HOT_RELOAD
	// Lost during hot-reload
	ERR_FAIL_NULL(delegate_invoke);
	ERR_FAIL_COND(delegate_handle.is_released());
#endif

	ERR_FAIL_COND(delegate_invoke->get_parameters_count() < p_argcount);

	MonoObject *delegate = delegate_handle.get_target();

	MonoException *exc = nullptr;
	MonoObject *ret = delegate_invoke->invoke(delegate, p_arguments, &exc);

	if (exc) {
		GDMonoUtils::set_pending_exception(exc);
	} else {
		r_return_value = GDMonoMarshal::mono_object_to_variant(ret);
		r_call_error.error = Callable::CallError::CALL_OK;
	}
}

void ManagedCallable::set_delegate(MonoDelegate *p_delegate) {
	delegate_handle = MonoGCHandleData::new_strong_handle((MonoObject *)p_delegate);
	MonoMethod *delegate_invoke_raw = mono_get_delegate_invoke(mono_object_get_class((MonoObject *)p_delegate));
	const StringName &delegate_invoke_name = CSharpLanguage::get_singleton()->get_string_names().delegate_invoke_method_name;
	delegate_invoke = memnew(GDMonoMethod(delegate_invoke_name, delegate_invoke_raw)); // TODO: Use pooling for this GDMonoMethod instances
}

ManagedCallable::ManagedCallable(MonoDelegate *p_delegate) {
#ifdef DEBUG_ENABLED
	CRASH_COND(p_delegate == nullptr);
#endif

	set_delegate(p_delegate);

#ifdef GD_MONO_HOT_RELOAD
	{
		MutexLock lock(instances_mutex);
		instances.add(&self_instance);
	}
#endif
}

ManagedCallable::~ManagedCallable() {
#ifdef GD_MONO_HOT_RELOAD
	{
		MutexLock lock(instances_mutex);
		instances.remove(&self_instance);
		instances_pending_reload.erase(this);
	}
#endif

	delegate_handle.release();
}


text:
package com.codeborne.selenide.conditions;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebElement;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

final class HiddenTest {
  private final Hidden condition = new Hidden();
  private final WebElement element = mock(WebElement.class);

  @Test
  void negate() {
    assertThat(condition.missingElementSatisfiesCondition()).isTrue();
    assertThat(condition.negate().missingElementSatisfiesCondition()).isFalse();
  }

  @Test
  void name() {
    assertThat(condition.getName()).isEqualTo("hidden");
    assertThat(condition.negate().getName()).isEqualTo("not hidden");
  }

  @Test
  void satisfied_if_element_is_not_visible() {
    when(element.isDisplayed()).thenReturn(false);
    assertThat(condition.apply(null, element)).isTrue();
  }

  @Test
  void not_satisfied_if_element_is_visible() {
    when(element.isDisplayed()).thenReturn(true);
    assertThat(condition.apply(null, element)).isFalse();
  }
}


text:
.. [b1] *Power ISA™*, Version 2.06 Revision B, July 23, 2010. It is
   available from power.org (http://power.org)

.. [IEEE1275] *Boot (Initialization Configuration) Firmware: Core Requirements
   and Practices*, 1994, This is the core standard (also known as IEEE
   1275) that defines the devicetree concept adopted by the |spec| and
   |epapr|. It is available from Global Engineering (http://global.ihs.com/).

.. [b3] *PowerPC Processor Binding to IEEE 1275-1994 Standard for Boot
   (Initialization, Configuration) Firmware*, Version 2.1, Open Firmware
   Working Group,
   (http://playground.sun.com/1275/bindings/ppc/release/ppc-2_1.html),
   1996, This document specifies the PowerPC processor specific binding
   to the base standard.

.. [b4] *booting-without-of.txt*, Ben Herrenschmidt, Becky Bruce, et
   al., From the Linux kernel source tree (http://www.kernel.org/),
   Describes the devicetree as used by the Linux kernel.

.. [b5] *Device Trees Everywhere*, David Gibson and Ben Herrenschmidt
   (http://ozlabs.org/~dgibson/home/papers/dtc-paper.pdf), An overview
   of the concept of the devicetree and devicetree compiler.

.. [b6] *PCI Bus Binding to: IEEE Std 1275-1994 Standard for Boot
   (Initialization Configuration) Firmware*, Revision 2.1, Open Firmware
   Working Group, 1998
   (http://playground.sun.com/1275/bindings/pci/pci2_1.pdf)

.. [b7] *Open Firmware Recommended Practice: Interrupt Mapping*, Version
   0.9, Open Firmware Working Group, 1996
   (http://playground.sun.com/1275/practice/imap/imap0_9d.pdf)

.. [b8] *Open Firmware Recommended Practice: Device Support Extensions*,
   Version 1.0, Open Firmware Working Group, 1997,
   (http://playground.sun.com/1275/practice/devicex/dse1_0a.html) This
   document describes the binding for various device types such as
   network, RTC, keyboard, sound, etc.

.. [b9] *Open Firmware Recommended Practice: Universal Serial Bus
   Binding to IEEE 1275*, Version 1, Open Firmware Working Group, 1998
   (http://playground.sun.com/1275/bindings/usb/usb-1_0.ps)

.. [CHRP] *PowerPC Microprocessor Common Hardware Reference Platform
   (CHRP) Binding*, Version 1.8, Open Firmware Working Group, 1998
   (http://playground.sun.com/1275/bindings/chrp/chrp1_8a.ps). This
   document specifies the properties for Open PIC-compatible interrupt
   controllers.

.. [b11] *CHRP ISA Interrupt Controller Device Binding*, Unapproved
   Draft version 1.1, Open Firmware Working Group, Aug 19, 1996
   (http://playground.sun.com/1275/bindings/devices/postscript/isa-pic-1_1d.ps)

.. [b12] *The Open Programmable Interrupt Controller (PIC) Register
   Interface Specification*, Revision 1.2, Advanced Micro Devices and
   Cyrix Corporation, October 1995

.. [b13] *PCI Local Bus Specification*, Revision 2.2, PCI Special
   Interest Group

.. [b14] *PCI Express Base Specification*, Revision 1.0a, PCI Special
   Interest Group

.. [b15] *PCI-Express Binding to OF*, P1275 Openboot Working Group
   Proposal, 18 August 2004

.. [PAPR] *Power.org Standard for Power Architecture Platform
   Requirements*, power.org

.. [b17] *System V Application Binary Interface, Edition 4.1*, Published
   by The Santa Cruz Operation, Inc., 1997

.. [b18] *The Open Programmable Interrupt Controller (PIC) Register
   Interface Specification Revision 1.2*, AMD and Cyrix, October 1995

.. [b19] *RFC 2119, Key words for use in RFCs to Indicate Requirement
   Levels*, http://www.ietf.org/rfc/rfc2119.txt

.. [b20] *64-bit PowerPC ELF Application Binary Interface Supplement
   1.9*, Ian Lance Taylor, 2004

.. [EPAPR] *Power.org Standard for Embedded Power Architecture
   Platform Requirements*, power.org, 2011,
   https://www.power.org/documentation/power-org-standard-for-embedded-power-architecture-platform-requirements-epapr-v1-1-2/

.. [ARMv8] *ARM DDI 0487 ARM(c) Architecture Reference Manual,
   ARMv8 for ARMv8-A architecture profile*, ARM,
   http://infocenter.arm.com/help/topic/com.arm.doc.ddi0487a.h/index.html


text:
package org.itadaki.bobbin.peer;

import org.itadaki.bobbin.torrentdb.ViewSignature;

/**
 * A PeerHandler's view of the peer set management services provided by a PeerCoordinator
 */
public interface PeerServices {

	/**
	 * Acquires the reentrant peer context lock. All peer and peer set management (including that in
	 * {@link PeerHandler}, the addition of new peers discovered by the tracker client, and the
	 * periodic asynchronous torrent wide peer management) synchronises on this lock; while it is
	 * held, the peer set and its attributes will not change.
	 *
	 *
This method may block for an unspecified period of time waiting for the lock. Once
	 * acquired, processing inside the lock should be kept to the shortest time possible, as all
	 * network I/O will be suspended while the lock is held.
	 *
	 *
Thread safety: This method is thread safe
	 */
	public void lock();

	/**
	 * Releases the peer context lock
	 *
	 *
Thread safety: This method is thread safe
	 */
	public void unlock();

	/**
	 * Deregisters a peer that has disconnected. The peer's available pieces will be subtracted
	 * from the available piece map; if the peer was unchoked then the choking algorithm will be
	 * invoked.
	 *
	 *
Thread safety: This method must be called with the peer context lock held
	 *
	 * @param peer The peer to deregister
	 */
	public void peerDisconnected (ManageablePeer peer);

	/**
	 * Adjust the choked and unchoked peers
	 *
	 *
Thread safety: This method must be called with the peer context lock held
	 * @param opportunistic If {@code false}, the peer is presently interested and unchoked, and a
	 *        regular choking round will result. If {@code true}, the peer is presently interested
	 *        and choked, and may be opportunistically unchoked if there are few peers
	 */
	public void adjustChoking (boolean opportunistic);

	/**
	 * Handle a view signature, updating the piece database and request manager, and propagating to
	 * other peers as appropriate
	 *
	 *
Thread safety: This method must be called with the peer context lock held
	 *
	 * @param viewSignature The view signature
	 * @return {@code true} if the signature verified correctly, otherwise {@code false}
	 */
	public boolean handleViewSignature (ViewSignature viewSignature);

}


text:
<?php

// plugins
$pluginConfigs = Pimcore_ExtensionManager::getPluginConfigs();
foreach ($pluginConfigs as $config) {
    Pimcore_ExtensionManager::enable("plugin", $config["plugin"]["pluginName"]);
}


text:
<?php
/*
Template Name: Schedule Template
*/
?>
<?php get_template_part('templates/page', 'header'); ?>

Presentations
3rd Floor, Junior Ballroom

12:30PM-1:20pm

Kathy	Hester Vegan Cookbook Author/Blogger

Instant Pot: Perfect for Vegan Kitchens

Kathy Hester is passionate about making healthy eating easy and delicious. You can find her recipes on HealthySlowCooking.com and PlantBasedInstantPot.com, and on her private Facebook group, Vegan Recipes: Cooking with Kathy Hester. Her recipes are so full of flavor even the meat eaters in your family will love them too. She is the author of the bestselling cookbooks, The Revised Vegan Slow Cooker and The Ultimate Vegan Cookbook for Your Instant Pot.

1:45PM-2:35PM

Berto	Calkins Fitness Professional

Presentation: Optimal on Plants

Berto Calkins is an NASM Certified Personal Trainer and NASM Certified Fitness Nutrition Specialist who has been active in fitness for 14 years. He currently has a workout program out called "Pyramids and also offer custom meal plans to online clients. He also holds a B.A in Communications (Advertising/ Public Relations) from the City College of New York.

Berto showcases content that promotes mental & physical wellness, as well as comfort foods that encourage non-vegans to become interested in the lifestyle. His mission is to make people aware of controllable influences on their lives, so that they can make decisions that better themselves and the world. Berto also serves on the board of directors at Woodstock Farm Sanctuary.

3:15PM-4:05PM

Toni Okamoto Author of Plant-Based on a Budget

Eating Plant-Based on a Budget

Toni Okamoto is the founder of Plant-Based on a Budget, the popular website and meal plan that shows you how to save dough by eating veggies. She's also author of the forthcoming book, Plant-Based on a Budget, The Super Easy Vegan Slow Cooker Cookbook, and the co-host of The Plant-Powered People Podcast. She's a regular presence on the FOX affiliate in Sacramento, where she teaches viewers how to break their meat habit without breaking their budget, and was featured in the popular documentary What the Health.

Meeting Room E, 3rd Floor

1:15AM-2:05PM

Maya Gottfried Author

Navigating Your Love Life as a Vegan/Vegetarian

Maya Gottfried is the author of Vegan Love: Dating and Partnering for the Cruelty-Free Gal (Skyhorse), and books for children including Our Farm: By the Animals of Farm Sanctuary (Knopf). Her articles have been published in outlets including VegNews, KrisCarr.com, ForksOverKnives.com, Lilith Magazine, and People online.

2:15PM-3:05PM

Isa	Leshko Artist & Author

Allowed to Grow Old: What I Learned Creating Portraits of Animals at Farm Sanctuaries

Isa Leshko is an artist and writer who focuses on themes of animal rights and aging. Her images of elderly farm animals are much admired and have been published in the Atlantic, Boston Globe, the Guardian, Harper's, the New York Times, and elsewhere. Her first book, Allowed to Grow Old: Portraits of Elderly Rescued Farm Animals, was recently released by the University of Chicago Press. The book includes essays by activist Gene Baur, NY Times bestselling author Sy Montgomery, and curator Anne Wilkes Tucker.

3:45PM-4:35PM

Nicole	Broushet Owner The Vegan Nest

"Victor and Nicole Broushet: In 2014, husband and wife team, Victor and Nicole Broushet, founded The Vegan Nest. "The Nest," as it is affectionately called, is a culinary-nutrition-education and health advocacy organization committed to educating, empowering, and strengthening communities. In 2017, they established The Vegan Nest Café, an organic, farm-to-table, plant-based café based in downtown Worcester.

Performances & Activities
Showcase Corner (main floor)

11:30AM-12:00PM

2:45PM-3:35PM

Grey Musician

Plant Based Drippin

Grey is one of the hottest emerging artists at the intersection between activism, urban style & hip hop. A growing Atlanta institution in his own right, Grey became one of the most talked about acts of 2016 after his Vegan Thanksgiving freestyle & music video took the internet by storm. Notching a total of 30+ million views, he was catapulted from local stardom to the global stage. Even PETA and Whole Foods supported his release, proving the cross-marketability of Grey and his message.

His music and clothing line, Plant Based Drippin, is creating a new energy in the Vegan community. A lyricist, activist, and social entrepreneur, Grey is nothing short of refreshing. With a clear, understandable, and sophisticated flow, Grey is an artist to watch in 2019. He, like vegan cooking, just might surprise you

1:45PM-2:30PM

4:00PM-4:45PM

All-Levels Yoga

Hosted by Yoga at the Ashram

Develop your inner calm, strength, and physical well-being during this participatory yoga demonstration for all experience levels. Yoga at the Ashram is a non-profit organization founded in Millis, MA in 1970.

Kids' Stuff!

11AM-5PM

Activities and fun times all day

Kids' Area in Exhibit Hall

Hosted by Main Idea

12:15PM-12:45PM

Children's Book Reading

Kids' Area in Exhibit Hall

Read by Casey Taft, the co-founder Vegan Publishers

12:45PM-1:30PM

Kid's Yoga Fun! with Sach Anand

Showcase Corner

Hosted by Yoga at the Ashram