text:
 #pragma once
#include "Serialize.h"

class Serialize__PROCESS_MEMORY_COUNTERS : public Serialize_StructBase<_PROCESS_MEMORY_COUNTERS,Serialize__PROCESS_MEMORY_COUNTERS>
{
	public:
	typedef _PROCESS_MEMORY_COUNTERS _MyObjectType;

	Serialize_BaseObject<DWORD> cb;
	Serialize_BaseObject<DWORD> PageFaultCount;
	Serialize_BaseObject<SIZE_T> PeakWorkingSetSize;
	Serialize_BaseObject<SIZE_T> WorkingSetSize;
	Serialize_BaseObject<SIZE_T> QuotaPeakPagedPoolUsage;
	Serialize_BaseObject<SIZE_T> QuotaPagedPoolUsage;
	Serialize_BaseObject<SIZE_T> QuotaPeakNonPagedPoolUsage;
	Serialize_BaseObject<SIZE_T> QuotaNonPagedPoolUsage;
	Serialize_BaseObject<SIZE_T> PagefileUsage;
	Serialize_BaseObject<SIZE_T> PeakPagefileUsage;

 	Serialize__PROCESS_MEMORY_COUNTERS(){};
	~Serialize__PROCESS_MEMORY_COUNTERS(){};
 	_Myt& operator=(_PROCESS_MEMORY_COUNTERS & _X)
	{
		SetData(_X);
		return *this;
	}
 	void GetData()
	{
		m_Val.cb=cb;
		m_Val.PageFaultCount=PageFaultCount;
		m_Val.PeakWorkingSetSize=PeakWorkingSetSize;
		m_Val.WorkingSetSize=WorkingSetSize;
		m_Val.QuotaPeakPagedPoolUsage=QuotaPeakPagedPoolUsage;
		m_Val.QuotaPagedPoolUsage=QuotaPagedPoolUsage;
		m_Val.QuotaPeakNonPagedPoolUsage=QuotaPeakNonPagedPoolUsage;
		m_Val.QuotaNonPagedPoolUsage=QuotaNonPagedPoolUsage;
		m_Val.PagefileUsage=PagefileUsage;
		m_Val.PeakPagefileUsage=PeakPagefileUsage;
	}
 	BOOL Construct(StorageObjectInterface * pOutObject)
	{
		cb.init(this,_T("cb"),0,pOutObject);
		PageFaultCount.init(this,_T("PageFaultCount"),0,pOutObject);
		PeakWorkingSetSize.init(this,_T("PeakWorkingSetSize"),0,pOutObject);
		WorkingSetSize.init(this,_T("WorkingSetSize"),0,pOutObject);
		QuotaPeakPagedPoolUsage.init(this,_T("QuotaPeakPagedPoolUsage"),0,pOutObject);
		QuotaPagedPoolUsage.init(this,_T("QuotaPagedPoolUsage"),0,pOutObject);
		QuotaPeakNonPagedPoolUsage.init(this,_T("QuotaPeakNonPagedPoolUsage"),0,pOutObject);
		QuotaNonPagedPoolUsage.init(this,_T("QuotaNonPagedPoolUsage"),0,pOutObject);
		PagefileUsage.init(this,_T("PagefileUsage"),0,pOutObject);
		PeakPagefileUsage.init(this,_T("PeakPagefileUsage"),0,pOutObject);
		return TRUE;
	}
 	void SetData(_PROCESS_MEMORY_COUNTERS & _X)
	{
		cb=_X.cb;
		PageFaultCount=_X.PageFaultCount;
		PeakWorkingSetSize=_X.PeakWorkingSetSize;
		WorkingSetSize=_X.WorkingSetSize;
		QuotaPeakPagedPoolUsage=_X.QuotaPeakPagedPoolUsage;
		QuotaPagedPoolUsage=_X.QuotaPagedPoolUsage;
		QuotaPeakNonPagedPoolUsage=_X.QuotaPeakNonPagedPoolUsage;
		QuotaNonPagedPoolUsage=_X.QuotaNonPagedPoolUsage;
		PagefileUsage=_X.PagefileUsage;
		PeakPagefileUsage=_X.PeakPagefileUsage;
	}
 	BOOL LoadGetCurSerializeObject(FieldAddr & CurFieldAddr, SerializeLoadSaveInterface * * RetObj)
	{
		*RetObj=0;
		if(tstring(CurFieldAddr.pFieldName)==tstring(_T("cb")))
		{
			*RetObj=&cb;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("PageFaultCount")))
		{
			*RetObj=&PageFaultCount;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("PeakWorkingSetSize")))
		{
			*RetObj=&PeakWorkingSetSize;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("WorkingSetSize")))
		{
			*RetObj=&WorkingSetSize;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("QuotaPeakPagedPoolUsage")))
		{
			*RetObj=&QuotaPeakPagedPoolUsage;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("QuotaPagedPoolUsage")))
		{
			*RetObj=&QuotaPagedPoolUsage;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("QuotaPeakNonPagedPoolUsage")))
		{
			*RetObj=&QuotaPeakNonPagedPoolUsage;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("QuotaNonPagedPoolUsage")))
		{
			*RetObj=&QuotaNonPagedPoolUsage;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("PagefileUsage")))
		{
			*RetObj=&PagefileUsage;
		} else if(tstring(CurFieldAddr.pFieldName)==tstring(_T("PeakPagefileUsage")))
		{
			*RetObj=&PeakPagefileUsage;
		}
		if(*RetObj) return TRUE;
		return FALSE;
	}
 	BOOL Save(StorageObjectInterface * pStorageObject)
	{
		pStorageObject->PushNodeCtlBegin(_T("_PROCESS_MEMORY_COUNTERS"),this);

		cb.Save(pStorageObject);
		PageFaultCount.Save(pStorageObject);
		PeakWorkingSetSize.Save(pStorageObject);
		WorkingSetSize.Save(pStorageObject);
		QuotaPeakPagedPoolUsage.Save(pStorageObject);
		QuotaPagedPoolUsage.Save(pStorageObject);
		QuotaPeakNonPagedPoolUsage.Save(pStorageObject);
		QuotaNonPagedPoolUsage.Save(pStorageObject);
		PagefileUsage.Save(pStorageObject);
		PeakPagefileUsage.Save(pStorageObject);

		pStorageObject->PushNodeCtlEnd(_T("_PROCESS_MEMORY_COUNTERS"),this);
		return TRUE;
	}
 	BOOL GetObjectMap(IN OUT vector<SerializeObjectInterface *> & ObjectInterfaceMap)
	{

		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&cb);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&PageFaultCount);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&PeakWorkingSetSize);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&WorkingSetSize);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&QuotaPeakPagedPoolUsage);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&QuotaPagedPoolUsage);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&QuotaPeakNonPagedPoolUsage);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&QuotaNonPagedPoolUsage);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&PagefileUsage);
		ObjectInterfaceMap.push_back((SerializeObjectInterface *)&PeakPagefileUsage);
		return TRUE;
	}

};


text:
import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';

// Import the base templates
import '../../ui/layouts/unauthenticated_layout.js';
import '../../ui/layouts/authenticated_layout.js';

// Import the utility pages
import '../../ui/pages/auth/auth.js';
import '../../ui/pages/loading/loading.js';
import '../../ui/pages/not_found/not_found.js';

// Import the app pages
import '../../ui/pages/home/home.js';
import '../../ui/pages/authorize/oauth2_authorize.js';

// Import test pages
import '../../ui/components/email_graph/email_graph.js';

// Set the layout root element
BlazeLayout.setRoot('body');

// Routes
FlowRouter.route('/', {
  name: 'Home',
  action() {
    BlazeLayout.render('AuthenticatedLayout', { main: 'Home' });
  }
});

FlowRouter.route('/dimension/:dimensionId', {
  name: 'Dimension',
  action() {
    BlazeLayout.render('AuthenticatedLayout', { main: 'Home' });
  }
});

FlowRouter.route('/email-graph', {
  name: 'Email Graph',
  action() {
    BlazeLayout.render('AuthenticatedLayout', { main: 'EmailGraph' });
  }
});

FlowRouter.route('/authorize', {
  name: 'OAuth2 Authorize',
  action() {
    BlazeLayout.render('AuthenticatedLayout', { main: 'Oauth2Authorize' });
  }
});

// Handle bad routes
FlowRouter.notFound = {
  action() {
    BlazeLayout.render('UnauthenticatedLayout', { main: 'NotFound' });
  },
};

redpajama_set_name: RedPajamaGithub


text:
@echo.
@echo Setting up environment for using MinGW with GCC from %~dp0.
@set PATH=%~dp0bin;%PATH%


text:
import { Injectable } from '@angular/core';
import { Observer, Observable } from 'rxjs';
import { JwtHelper } from 'angular2-jwt';

export interface ProfileJWT {
  id: number;
  name: string;
  location: number;
  store: string;
  exp: number;
  iat: number;
  permissions: UserPermissions;
}

export interface RoleInfo {
  id: number;
  tag: string;
  description: string;
  updated_at: string;
  created_at: string;
}

export interface ComponentInfo {
  id: number;
  tag: string;
  description: string;
  updated_at: string;
  created_at: string;
}

export interface OperationInfo {
  id: number;
  tag: string;
  description: string;
  updated_at: string;
  created_at: string;
}

export interface PermissionInfo {
  id: number;
  role_id: number;
  component_id: number;
  operation_id: number;
  rank: number;
  updated_at: string;
  created_at: string;
}

export interface UserPermissions {
  components: ComponentPermissionList;
  component_tag?: any;
  operation_tag?: any;
  role_tag?: any;
}

export interface ComponentPermissionList {
  [index: string]: ComponentPermissions;
}

export interface ComponentPermissions {
  operations: Array<number>;
  role_id: number;
  component_tag?: string;
  role_tag?: string;
}

export interface OperationPermissions {
  [index: string]: number; // index is gadget_id
}

@Injectable()
export class ConfigApp {
  static _permissionObserver: Observer<UserPermissions>;
  static _permissionObservable = new Observable((observer: Observer<UserPermissions>) => {
   ConfigApp._permissionObserver = observer; // Assign to static RolePermissions._permissionObserver
  }).share();

  // Modified in gulpfile.js task 'configs'
  private _madameService = 'http://localhost:3080/';
  private _madameSocket = 'localhost:3080';

  private _isLoggedIn = false;
  private _profile: ProfileJWT;

  private _curHistoryLength = 0;
  private _historyHandicap = 1;

  public jwt: JwtHelper;
  private _token: string;

  constructor(_jwt: JwtHelper) {
    this.jwt = _jwt;
  }

  madameService(): string { return this._madameService; }
  madameSocket(): string { return this._madameSocket; }

  get isLoggedIn(): boolean {
    return this._isLoggedIn;
  }

  get profile(): ProfileJWT {
    return this._profile;
  }
  set profile(value: ProfileJWT) {
    this._profile = value;
    // ConfigApp._permissionObserver.next(this._profile.permissions);
  }

  get permissions(): UserPermissions {
    return this.profile.permissions;
  }

  set token(value: string) {
    this._token = value;

    if (value && !this.jwt.isTokenExpired(value)) {
      this.profile = <ProfileJWT>this.jwt.decodeToken(value);
//      console.log(this.profile);
      this._isLoggedIn = true;
    } else { this._isLoggedIn = false; }
  }

//  setPermissions(permissions: UserPermissions): void {
//    this._profile.permissions = permissions;
//
//  }

//  getPermissions(): UserPermissions { return this._profile.permissions; }

  isPopupWindow(window: Window) {
    if (window.opener) {
      return true; // Popup Window
    } else if (window.top !== window.self) {
      return true; // IFramed
    }
    return false;
  }
  setStateParams() {
    if (window.history.length < this._curHistoryLength) {
      this._historyHandicap += this._curHistoryLength - window.history.length + 1;
    } else if (window.history.length === this._curHistoryLength) {
      this._historyHandicap += 1;
    }
    this._curHistoryLength = window.history.length;
  }
  getStateParams() {
    let state: any = {};
    state.id = this._curHistoryLength + this._historyHandicap;
    return state;
  }

  // Proxy functions to RolePermissions
  canCreate(component_id: number, self_id?: number[], perms?: UserPermissions): boolean {
    if ((self_id.length && self_id.indexOf(this._profile.id) > -1) &&
        this.hasPermission(component_id, 7, perms)) { return true; }
    return this.hasPermission(component_id, 2, perms);
  }

  canRead(component_id: number, self_id?: number[], perms?: UserPermissions): boolean {
    if ((self_id.length && self_id.indexOf(this._profile.id) > -1) &&
        this.hasPermission(component_id, 8, perms)) { return true; }
    return this.hasPermission(component_id, 3, perms);
  }

  canUpdate(component_id: number, self_id?: number[], perms?: UserPermissions): boolean {
    if ((self_id.length && self_id.indexOf(this._profile.id) > -1) &&
        this.hasPermission(component_id, 9, perms)) { return true; }
    return this.hasPermission(component_id, 4, perms);
  }

  canDelete(component_id: number, self_id?: number[], perms?: UserPermissions): boolean {
    if ((self_id.length && self_id.indexOf(this._profile.id)  > -1) &&
        this.hasPermission(component_id, 10, perms)) { return true; }
    return this.hasPermission(component_id, 5, perms);
  }

  hasPermission(component_id: number, operation_id: number, perms?: UserPermissions): boolean {
    if (perms === void 0) { perms = this.permissions; }

    try {
      if (perms.components[component_id].operations.indexOf(0) !== -1) { return false; }
      if (perms.components[component_id].operations.indexOf(1) !== -1) { return true; }
      if (perms.components[component_id].operations.indexOf(operation_id) !== -1) { return true; }
    } catch (e) { }

  return false;
  }

  popup(u, w, h) {
    this.popupWindow(u, w, h);
  }

  popupWindow(u, w, h) {
    const popupwindow = window.open(u, '',
        'top=10,left=10,height=' + h + ',width=' + w +
        ',toolbar=0,location=0,directories=0,resizable=1,status=0,menubar=0,scrollbars=1');
    popupwindow.focus();
  }

  popupTab(u) {
    window.open(u, '_blank');
  }
}


text:
using CountlySDK.CountlyCommon.Helpers;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Windows.Storage;

namespace CountlySDK.Helpers
{
    internal class Storage : StorageBase
    {
        //==============SINGLETON============
        //fourth version from:
        //http://csharpindepth.com/Articles/General/Singleton.aspx
        private static readonly Storage instance = new Storage();
        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static Storage() { }
        internal Storage() { }
        public static Storage Instance { get { return instance; } }
        //-------------SINGLETON-----------------

        /// <summary>
        /// Countly folder
        /// </summary>
        private const string folder = "countly";

        private Dictionary<string, bool> filesInUse = new Dictionary<string, bool>();

        public ApplicationDataContainer Settings
        {
            get
            {
                return Windows.Storage.ApplicationData.Current.LocalSettings;
            }
        }

        public TValue GetValue<TValue>(string key, TValue defaultvalue)
        {
            TValue value;

            // If the key exists, retrieve the value.
            if (Settings.Values.ContainsKey(key))
            {
                value = (TValue)Settings.Values[key];
            }
            // Otherwise, use the default value.
            else
            {
                value = defaultvalue;
            }

            return value;
        }

        public bool SetValue(string key, object value)
        {
            bool valueChanged = false;

            if (Settings.Values.ContainsKey(key))
            {
                if (Settings.Values[key] != value)
                {
                    Settings.Values[key] = value;
                    valueChanged = true;
                }
            }
            else
            {
                Settings.Values.Add(key, value);
                valueChanged = true;
            }

            return valueChanged;
        }

        public void RemoveValue(string key)
        {
            if (Settings.Values.ContainsKey(key))
            {
                Settings.Values.Remove(key);
            }
        }

        public override async Task<bool> SaveToFile<T>(string filename, object objForSave)
        {
            Debug.Assert(filename != null, "Provided filename can't be null");
            Debug.Assert(objForSave != null, "Provided object can't be null");

            if (filesInUse.ContainsKey(filename))
            {
                return false;
            }

            filesInUse[filename] = true;

            bool success = true;

            try
            {
                var sessionSerializer = new DataContractSerializer(typeof(T));
                MemoryStream sessionData = new MemoryStream();
                sessionSerializer.WriteObject(sessionData, objForSave);
                sessionData.Seek(0, SeekOrigin.Begin);

                await SaveStream(sessionData, filename);
            }
            catch
            {
                success = false;
            }
            finally
            {
                filesInUse.Remove(filename);
            }

            return success;
        }

        /// <summary>
        /// Saves stream into file
        /// </summary>
        /// <param name="stream">stream to save</param>
        /// <param name="file">filename</param>
        private async Task SaveStream(Stream stream, string file)
        {
            try
            {
                string temp = Guid.NewGuid().ToString();

                StorageFolder storageFolder = await GetFolder(folder);

                StorageFile tempFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(temp, CreationCollisionOption.ReplaceExisting);

                using (Stream fileStream = await tempFile.OpenStreamForWriteAsync())
                {
                    await stream.CopyToAsync(fileStream);
                    await fileStream.FlushAsync();
                    fileStream.Dispose();
                }

                string backup = file + ".backup";

                StorageFile backupFile = await GetFile(backup);

                await tempFile.CopyAndReplaceAsync(backupFile);

                StorageFile storageFile = await GetFile(file);

                await tempFile.CopyAndReplaceAsync(storageFile);

                await DeleteFile(temp);
            }
            catch
            { }
        }

        public override async Task<T> LoadFromFile<T>(string filename)
        {
            Debug.Assert(filename != null, "Provided filename can't be null");

            T t = null;

            try
            {
                Stream stream = await LoadStream(filename);

                if (stream != null)
                {
                    using (StreamReader reader = new StreamReader(stream))
                    {
                        var sessionSerializer = new DataContractSerializer(typeof(T));
                        T obj = (T)sessionSerializer.ReadObject(reader.BaseStream);

                        t = obj;
                    }
                }
            }
            catch
            { }

            if (t != null)
            {
                return t;
            }
            else if (!filename.EndsWith(".backup"))
            {
                return await LoadFromFile<T>(filename + ".backup");
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// Loads stream from file
        /// </summary>
        /// <param name="path">filename</param>
        /// <returns>stream</returns>
        private async Task<Stream> LoadStream(string path)
        {
            try
            {
                bool isFileExists = await FileExists(path);

                if (!isFileExists) return null;

                StorageFolder storageFolder = await GetFolder(folder);

                StorageFile storageFile = await storageFolder.CreateFileAsync(path, CreationCollisionOption.OpenIfExists);

                if (storageFile == null)
                {
                    throw new Exception();
                }

                using (StreamReader reader = new StreamReader(await storageFolder.OpenStreamForReadAsync(path)))
                {
                    MemoryStream memoryStream = new MemoryStream();

                    reader.BaseStream.CopyTo(memoryStream);

                    memoryStream.Position = 0;

                    return memoryStream;
                }
            }
            catch
            {
                return null;
            }
        }

        /// <summary>
        /// Checks whether there is a file in storage
        /// </summary>
        /// <param name="path">filename</param>
        /// <returns>true if file exists, false otherwise</returns>
        private async Task<bool> FileExists(string path)
        {
            StorageFolder storageFolder = await GetFolder(folder);

            IReadOnlyList<StorageFile> files = await storageFolder.GetFilesAsync();

            foreach (StorageFile file in files)
            {
                if (file.Name == path)
                {
                    return true;
                }
            }

            return false;
        }

        /// <summary>
        /// Get StorageFile object from specified path
        /// </summary>
        /// <param name="path">file path</param>
        /// <returns>StorageFile object</returns>
        private async Task<StorageFile> GetFile(string path)
        {
            StorageFolder storageFolder = await GetFolder(folder);

            StorageFile storageFile = await storageFolder.CreateFileAsync(path, CreationCollisionOption.OpenIfExists);

            return storageFile;
        }

        /// <summary>
        /// Delete file
        /// </summary>
        /// <param name="path">Filename to delete</param>
        public override async Task DeleteFile(string path)
        {
            StorageFolder storageFolder = await GetFolder(folder);

            StorageFile sessionFile = await storageFolder.CreateFileAsync(path, CreationCollisionOption.OpenIfExists);

            if (sessionFile != null)
            {
                await sessionFile.DeleteAsync();
            }
        }

        /// <summary>
        /// Checks whether there is a folder in storage
        /// </summary>
        /// <param name="folder">folder name</param>
        /// <returns>true if folder exists, false otherwise</returns>
        private async Task<bool> FolderExists(string folder)
        {
            IReadOnlyList<StorageFolder> folders = await ApplicationData.Current.LocalFolder.GetFoldersAsync();

            foreach (StorageFolder folder_ in folders)
            {
                if (folder_.Name == folder)
                {
                    return true;
                }
            }

            return false;
        }

        /// <summary>
        /// Get StorageFolder object from specified path
        /// </summary>
        /// <param name="folder">folder path</param>
        /// <returns>StorageFolder object</returns>
        private async Task<StorageFolder> GetFolder(string folder)
        {
            StorageFolder storageFolder;

            if (!await FolderExists(folder))
            {
                await CreateFolder(folder);
            }

            storageFolder = await ApplicationData.Current.LocalFolder.GetFolderAsync(folder);

            return storageFolder;
        }

        /// <summary>
        /// Creates folder with specified name
        /// </summary>
        /// <param name="folder">folder name</param>
        private async Task CreateFolder(string folder)
        {
            try
            {
                bool isFolderExists = await FolderExists(folder);

                if (!isFolderExists)
                {
                    await ApplicationData.Current.LocalFolder.CreateFolderAsync(folder);
                }
            }
            catch
            { }
        }

        internal override Task<string> GetFolderPath(string folderName)
        {
            throw new NotImplementedException();
        }
    }
}


text:
'use strict';

describe('Directive: hsMenuLink', function () {

  // load the directive's module
  beforeEach(module('hatshopApp'));

  var element,
    scope;

  beforeEach(inject(function ($rootScope) {
    scope = $rootScope.$new();
  }));

  it('should make hidden element visible', inject(function ($compile) {
    element = angular.element('<hs-menu-link></hs-menu-link>');
    element = $compile(element)(scope);
    expect(element.text()).toBe('this is the hsMenuLink directive');
  }));
});


text:
package org.springframework.cloud.dataflow.rest.client;

import java.util.List;
import java.util.Map;

import org.springframework.cloud.dataflow.rest.resource.ScheduleInfoResource;
import org.springframework.cloud.dataflow.rest.util.DeploymentPropertiesUtils;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.PagedResources;
import org.springframework.hateoas.ResourceSupport;
import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

/**
 * Implementation for
 * {@link org.springframework.cloud.dataflow.rest.client.SchedulerOperations}.
 *
 * @author Glenn Renfro
 */
public class SchedulerTemplate implements SchedulerOperations {

	/* default */ public static final String SCHEDULES_RELATION = "tasks/schedules";

	private static final String SCHEDULES_INSTANCE_RELATION = SCHEDULES_RELATION + "/instances";

	private final RestTemplate restTemplate;

	private final Link schedulesLink;

	private final Link schedulesInstanceLink;

	SchedulerTemplate(RestTemplate restTemplate, ResourceSupport resources) {
		Assert.notNull(resources, "URI Resources must not be be null");
		Assert.notNull(resources.getLink(SCHEDULES_RELATION), "Schedules relation is required");
		Assert.notNull(resources.getLink(SCHEDULES_INSTANCE_RELATION), "Schedules instance relation is required");
		Assert.notNull(restTemplate, "RestTemplate must not be null");

		this.restTemplate = restTemplate;
		this.schedulesLink = resources.getLink(SCHEDULES_RELATION);
		this.schedulesInstanceLink = resources.getLink(SCHEDULES_INSTANCE_RELATION);

	}

	@Override
	public void schedule(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs) {
		MultiValueMap<String, Object> values = new LinkedMultiValueMap<>();
		values.add("scheduleName", scheduleName);
		values.add("properties", DeploymentPropertiesUtils.format(taskProperties));
		values.add("taskDefinitionName", taskDefinitionName);
		values.add("arguments", commandLineArgs);
		restTemplate.postForObject(schedulesLink.getHref(), values, Long.class);
	}

	@Override
	public void unschedule(String scheduleName) {
		restTemplate.delete(schedulesLink.getHref() + "/" + scheduleName);
	}

	@Override
	public PagedResources<ScheduleInfoResource> list(String taskDefinitionName) {
		return restTemplate.getForObject(schedulesInstanceLink.expand(taskDefinitionName).getHref(),
				ScheduleInfoResource.Page.class);
	}

	@Override
	public PagedResources<ScheduleInfoResource> list() {
		return restTemplate.getForObject(schedulesLink.getHref(), ScheduleInfoResource.Page.class);
	}

	@Override
	public ScheduleInfoResource getSchedule(String scheduleName) {
		return restTemplate.getForObject(schedulesLink.getHref() + "/" + scheduleName,
				ScheduleInfoResource.class);
	}
}


text:
/**
 * This package contains a {@link org.infinispan.loaders.CacheStore} implementation based on
 * persisting to JDBM.
 */
package org.infinispan.loaders.jdbm;


text:
namespace au.IO.Web.API.MythTV.Types {
	/// <summary>
	/// Factory for building clients for MythTV APIs.
	/// </summary>
	public interface IApiFactory {
		/// <summary>
		/// Build a DVR API object using the specified connection settings.
		/// </summary>
		/// <param name="useHttps">Whether to use HTTPS (false means HTTP)</param>
		/// <param name="host">MythTV Web API hostname or IP address</param>
		/// <param name="port">MythTV Web API port number</param>
		/// <returns>DVR API object</returns>
		IDvrApi BuildDvrApi(bool useHttps, string host, ushort port);

		/// <summary>
		/// Build a Content API object using the specified connection settings.
		/// </summary>
		/// <param name="useHttps">Whether to use HTTPS (false means HTTP)</param>
		/// <param name="host">MythTV Web API hostname or IP address</param>
		/// <param name="port">MythTV Web API port number</param>
		/// <returns>Content API object</returns>
		IContentApi BuildContentApi(bool useHttps, string host, ushort port);
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PocoPoker
{
    public struct Card
    {
        private Rank rank;
        private Suit suit;

        public Card(Rank rank, Suit suit)
        {
            this.rank = rank;
            this.suit = suit;
        }

        public Rank Rank
        {
            get
            {
                return this.rank;
            }
        }

        public Suit Suit
        {
            get
            {
                return this.suit;
            }
        }

    }

}


text:
tldr-k9s()
{
  echo "- Show active keyboard mnemonics and help: '?' "
  echo "- Show all available resource alias: 'ctrl-a' "
  echo "- To bail out of K9s: ':q, ctrl-c' "
  echo "- View a Kubernetes resource using singular/plural or short-name: ':po⏎' accepts singular, plural, short-name or alias ie pod or pods"
  echo "- View a Kubernetes resource in a given namespace: ':alias namespace⏎' "
  echo "- Filter out a resource view given a filter: '/filter⏎' Regex2 supported ie fred|blee to filter resources named fred or blee"
  echo "- Inverse regex filer: '/! filter⏎' Keep everything that doesn't match. Not implemented for logs."
  echo "- Filter resource view by labels: '/-l label-selector⏎' "
  echo "- Fuzzy find a resource given a filter: '/-f filter⏎' "
  echo "- Bails out of view/command/filter mode: '<esc>' "
  echo "- Key mapping to describe, view, edit, view logs,…: 'd,v, e, l,…' "
  echo "- To view and switch to another Kubernetes context: ':ctx⏎' "
  echo "- To view and switch to another Kubernetes context: ':ctx context-name⏎' "
  echo "- To view and switch to another Kubernetes namespace: ':ns⏎' "
  echo "- To view all saved resources: ':screendump or sd⏎' "
  echo "- To delete a resource (TAB and ENTER to confirm): 'ctrl-d' "
  echo "- To kill a resource (no confirmation dialog!): 'ctrl-k' "
  echo "- Launch pulses view: ':pulses or pu⏎' "
  echo "- Launch XRay view: ':xray RESOURCE [NAMESPACE]⏎' RESOURCE can be one of po, svc, dp, rs, sts, ds, NAMESPACE is optional"
  echo "- Launch Popeye view: ':popeye or pop⏎' See https://popeyecli.io"
}


text:
using namespace std;
using namespace gcp::util;
using namespace gcp::program;

KeyTabEntry Program::keywords[] = {
    { "port",    "4358",      "i", "Server port to listen on"},
    {END_OF_KEYWORDS}
};

void Program::initializeUsage() {}

int Program::main()
{
    SimpleTestServer server(false,
                            Program::getIntegerParameter("port"));

    try {
        server.run();
    } catch (Exception& err) {
        COUT("Caught an exception: " << err.what());
        return 1;
    } catch (...) {
        COUT("Caught an exception");
        return 1;
    }

    return 0;
}


text:
/*******************************************************************************
  ETH Peripheral Library Template Implementation

  File Name:
    eth_FCSErrorCount_Default.h

  Summary:
    ETH PLIB Template Implementation

  Description:
    This header file contains template implementations
    For Feature : FCSErrorCount
    and its Variant : Default
    For following APIs :
        PLIB_ETH_FCSErrorCountClear
        PLIB_ETH_FCSErrorCountGet
        PLIB_ETH_ExistsFCSErrorCount

*******************************************************************************/

//DOM-IGNORE-BEGIN
/*******************************************************************************
Copyright (c) 2012 released Microchip Technology Inc.  All rights reserved.

Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).

You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.

SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*******************************************************************************/

//DOM-IGNORE-END

#ifndef _ETH_FCSERRORCOUNT_DEFAULT_H
#define _ETH_FCSERRORCOUNT_DEFAULT_H
#include "eth_registers.h"

//******************************************************************************
/* Function :  ETH_FCSErrorCountClear_Default

  Summary:
    Implements Default variant of PLIB_ETH_FCSErrorCountClear
	This function performs atomic register access.

  Description:
    This template implements the Default variant of the PLIB_ETH_FCSErrorCountClear function.
*/

PLIB_TEMPLATE void ETH_FCSErrorCountClear_Default( ETH_MODULE_ID index )
{
	volatile eth_registers_t * eth = ((eth_registers_t *)(index));
	eth->ETHFCSERR.FCSERRCNT = 0x0000;
}

//******************************************************************************
/* Function :  ETH_FCSErrorCountGet_Default

  Summary:
    Implements Default variant of PLIB_ETH_FCSErrorCountGet
	This function performs atomic register access.

  Description:
    This template implements the Default variant of the PLIB_ETH_FCSErrorCountGet function.
*/

PLIB_TEMPLATE uint16_t ETH_FCSErrorCountGet_Default( ETH_MODULE_ID index )
{
    volatile eth_registers_t * eth = ((eth_registers_t *)(index));
    return (uint16_t)eth->ETHFCSERR.FCSERRCNT;
}

//******************************************************************************
/* Function :  ETH_ExistsFCSErrorCount_Default

  Summary:
    Implements Default variant of PLIB_ETH_ExistsFCSErrorCount

  Description:
    This template implements the Default variant of the PLIB_ETH_ExistsFCSErrorCount function.
*/

#define PLIB_ETH_ExistsFCSErrorCount PLIB_ETH_ExistsFCSErrorCount
PLIB_TEMPLATE bool ETH_ExistsFCSErrorCount_Default( ETH_MODULE_ID index )
{
    return true;
}

#endif /*_ETH_FCSERRORCOUNT_DEFAULT_H*/

/******************************************************************************
 End of File
*/


text:
describe("L.DistortableImage.Edit", function() {
	var map,
		overlay;

	beforeEach(function(done) {
		map = new L.Map(L.DomUtil.create('div', '', document.body)).setView([41.7896,-87.5996], 15);

		overlay = new L.DistortableImageOverlay('/examples/example.jpg', {
			corners: [
				new L.LatLng(41.7934, -87.6052),
				new L.LatLng(41.7934, -87.5852),
				new L.LatLng(41.7834, -87.5852),
				new L.LatLng(41.7834, -87.6052)
			]
		}).addTo(map);

		/* Forces the image to load before any tests are run. */
		L.DomEvent.on(overlay._image, 'load', function() { done (); });
	});

	it("Should be initialized along with each instance of L.DistortableImageOverlay.", function() {
		expect(overlay.editing).to.be.an.instanceOf(L.DistortableImage.Edit);
	});

	it("Should keep handles on the map in sync with the corners of the image.", function() {
		var corners = overlay._corners;

		overlay.editing.enable();

		overlay._updateCorner(0, new L.LatLng(41.7934, -87.6252));
		overlay.fire('update');

		/* Warp handles are currently on the map; they should have been updated. */
		overlay.editing._distortHandles.eachLayer(function(handle) {
			expect(handle.getLatLng()).to.be.closeToLatLng(corners[handle._corner]);
		});

		overlay.editing._toggleRotateDistort();

		/* After we toggle modes, the rotateHandles are on the map and should be synced. */
		overlay.editing._rotateHandles.eachLayer(function(handle) {
			expect(handle.getLatLng()).to.be.closeToLatLng(corners[handle._corner]);
		});
	});

	it.skip("Should keep image in sync with the map while dragging.", function() {
		var corners = overlay._corners,
			dragging;

		overlay.editing.enable();

		dragging = overlay.editing.dragging;

		/* _reset is not called by #onAdd, for some reason... */
		overlay._reset();

		/* Simulate a sequence of drag events. */
		dragging._onDown({ touches: [{ clientX: 0, clientY: 0 }], target: overlay._image });
		dragging._onMove({ touches: [{ clientX: 20, clientY: 30 }], target: overlay._image });
		dragging._onUp();

		map.setView([41.7896,-87.6996]);
	});
});


text:
#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATIONS_H_
#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATIONS_H_

#if !defined(__OBJC__)
#error "This header only supports Objective-C++."
#endif  // !defined(__OBJC__)

#include <utility>
#include <vector>

#import "Firestore/Source/Model/FSTFieldValue.h"

#include "Firestore/core/include/firebase/firestore/timestamp.h"
#include "Firestore/core/src/firebase/firestore/model/field_value.h"
#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"

namespace firebase {
namespace firestore {
namespace model {

// TODO(zxu123): We might want to refactor transform_operations.h into several
// files when the number of different types of operations grows gigantically.
// For now, put the interface and the only operation here.

/** Represents a transform within a TransformMutation. */
class TransformOperation {
 public:
  /** All the different kinds to TransformOperation. */
  enum class Type {
    ServerTimestamp,
    ArrayUnion,
    ArrayRemove,
    Increment,
    Test,  // Purely for test purpose.
  };

  virtual ~TransformOperation() {
  }

  /** Returns the actual type. */
  virtual Type type() const = 0;

  /**
   * Computes the local transform result against the provided `previousValue`,
   * optionally using the provided localWriteTime.
   */
  virtual FSTFieldValue* ApplyToLocalView(
      FSTFieldValue* previousValue, FIRTimestamp* localWriteTime) const = 0;

  /**
   * Computes a final transform result after the transform has been acknowledged
   * by the server, potentially using the server-provided transformResult.
   */
  virtual FSTFieldValue* ApplyToRemoteDocument(
      FSTFieldValue* previousValue, FSTFieldValue* transformResult) const = 0;

  /** Returns whether this field transform is idempotent. */
  virtual bool idempotent() const = 0;

  /** Returns whether the two are equal. */
  virtual bool operator==(const TransformOperation& other) const = 0;

  /** Returns whether the two are not equal. */
  bool operator!=(const TransformOperation& other) const {
    return !operator==(other);
  }

  // For Objective-C++ hash; to be removed after migration.
  // Do NOT use in C++ code.
  virtual NSUInteger Hash() const = 0;
};

/** Transforms a value into a server-generated timestamp. */
class ServerTimestampTransform : public TransformOperation {
 public:
  Type type() const override {
    return Type::ServerTimestamp;
  }

  FSTFieldValue* ApplyToLocalView(FSTFieldValue* previousValue,
                                  FIRTimestamp* localWriteTime) const override {
    return [FSTServerTimestampValue
        serverTimestampValueWithLocalWriteTime:localWriteTime
                                 previousValue:previousValue];
  }

  FSTFieldValue* ApplyToRemoteDocument(
      FSTFieldValue* /* previousValue */,
      FSTFieldValue* transformResult) const override {
    return transformResult;
  }

  bool idempotent() const override {
    return true;
  }

  bool operator==(const TransformOperation& other) const override {
    // All ServerTimestampTransform objects are equal.
    return other.type() == Type::ServerTimestamp;
  }

  static const ServerTimestampTransform& Get() {
    static ServerTimestampTransform shared_instance;
    return shared_instance;
  }

  // For Objective-C++ hash; to be removed after migration.
  // Do NOT use in C++ code.
  NSUInteger Hash() const override {
    // arbitrary number, the same as used in ObjC implementation, since all
    // instances are equal.
    return 37;
  }

 private:
  ServerTimestampTransform() {
  }
};

/**
 * Transforms an array via a union or remove operation (for convenience, we use
 * this class for both Type::ArrayUnion and Type::ArrayRemove).
 */
class ArrayTransform : public TransformOperation {
 public:
  ArrayTransform(Type type, std::vector<FSTFieldValue*> elements)
      : type_(type), elements_(std::move(elements)) {
  }

  Type type() const override {
    return type_;
  }

  FSTFieldValue* ApplyToLocalView(
      FSTFieldValue* previousValue,
      FIRTimestamp* /* localWriteTime */) const override {
    return Apply(previousValue);
  }

  FSTFieldValue* ApplyToRemoteDocument(
      FSTFieldValue* previousValue,
      FSTFieldValue* /* transformResult */) const override {
    // The server just sends null as the transform result for array operations,
    // so we have to calculate a result the same as we do for local
    // applications.
    return Apply(previousValue);
  }

  const std::vector<FSTFieldValue*>& elements() const {
    return elements_;
  }

  bool idempotent() const override {
    return true;
  }

  bool operator==(const TransformOperation& other) const override {
    if (other.type() != type()) {
      return false;
    }
    auto array_transform = static_cast<const ArrayTransform&>(other);
    if (array_transform.elements_.size() != elements_.size()) {
      return false;
    }
    for (size_t i = 0; i < elements_.size(); i++) {
      if (![array_transform.elements_[i] isEqual:elements_[i]]) {
        return false;
      }
    }
    return true;
  }

  // For Objective-C++ hash; to be removed after migration.
  // Do NOT use in C++ code.
  NSUInteger Hash() const override {
    NSUInteger result = 37;
    result = 31 * result + (type() == Type::ArrayUnion ? 1231 : 1237);
    for (FSTFieldValue* element : elements_) {
      result = 31 * result + [element hash];
    }
    return result;
  }

  static const std::vector<FSTFieldValue*>& Elements(
      const TransformOperation& op) {
    HARD_ASSERT(op.type() == Type::ArrayUnion ||
                op.type() == Type::ArrayRemove);
    return static_cast<const ArrayTransform&>(op).elements();
  }

 private:
  Type type_;
  std::vector<FSTFieldValue*> elements_;

  /**
   * Inspects the provided value, returning a mutable copy of the internal array
   * if it's an FSTArrayValue and an empty mutable array if it's nil or any
   * other type of FSTFieldValue.
   */
  static NSMutableArray<FSTFieldValue*>* CoercedFieldValuesArray(
      FSTFieldValue* value) {
    if ([value isMemberOfClass:[FSTArrayValue class]]) {
      return [NSMutableArray
          arrayWithArray:reinterpret_cast<FSTArrayValue*>(value).internalValue];
    } else {
      // coerce to empty array.
      return [NSMutableArray array];
    }
  }

  FSTFieldValue* Apply(FSTFieldValue* previousValue) const {
    NSMutableArray<FSTFieldValue*>* result =
        ArrayTransform::CoercedFieldValuesArray(previousValue);
    for (FSTFieldValue* element : elements_) {
      if (type_ == Type::ArrayUnion) {
        if (![result containsObject:element]) {
          [result addObject:element];
        }
      } else {
        HARD_ASSERT(type_ == Type::ArrayRemove);
        [result removeObject:element];
      }
    }
    return [[FSTArrayValue alloc] initWithValueNoCopy:result];
  }
};

/**
 * Implements the backend semantics for locally computed NUMERIC_ADD (increment)
 * transforms. Converts all field values to longs or doubles and resolves
 * overflows to LONG_MAX/LONG_MIN.
 */
class NumericIncrementTransform : public TransformOperation {
 public:
  explicit NumericIncrementTransform(FSTFieldValue* operand)
      : operand_(operand) {
    HARD_ASSERT(FieldValue::IsNumber(operand.type));
  }

  Type type() const override {
    return Type::Increment;
  }

  FSTFieldValue* ApplyToLocalView(
      FSTFieldValue* previousValue,
      FIRTimestamp* /* localWriteTime */) const override {
    // Return an integer value only if the previous value and the operand is an
    // integer.
    if (previousValue.type == FieldValue::Type::Integer &&
        operand_.type == FieldValue::Type::Integer) {
      int64_t sum =
          SafeIncrement(previousValue.integerValue, operand_.integerValue);
      return FieldValue::FromInteger(sum).Wrap();
    } else if (previousValue.type == FieldValue::Type::Integer) {
      double sum = previousValue.integerValue + OperandAsDouble();
      return FieldValue::FromDouble(sum).Wrap();
    } else if (previousValue.type == FieldValue::Type::Double) {
      double sum = previousValue.doubleValue + OperandAsDouble();
      return FieldValue::FromDouble(sum).Wrap();
    } else {
      // If the existing value is not a number, use the value of the transform
      // as the new base value.
      return operand_;
    }
  }

  FSTFieldValue* ApplyToRemoteDocument(
      FSTFieldValue*, FSTFieldValue* transformResult) const override {
    return transformResult;
  }

  FSTFieldValue* operand() const {
    return operand_;
  }

  bool idempotent() const override {
    return false;
  }

  bool operator==(const TransformOperation& other) const override {
    if (other.type() != type()) {
      return false;
    }
    auto numeric_add = static_cast<const NumericIncrementTransform&>(other);
    return [operand_ isEqual:numeric_add.operand_];
  }

  // For Objective-C++ hash; to be removed after migration.
  // Do NOT use in C++ code.
  NSUInteger Hash() const override {
    NSUInteger result = 37;
    result = 31 * result + [operand_ hash];
    return result;
  }

 private:
  FSTFieldValue* operand_;

  /**
   * Implements integer addition. Overflows are resolved to LONG_MAX/LONG_MIN.
   */
  int64_t SafeIncrement(int64_t x, int64_t y) const {
    if (x > 0 && y > LONG_MAX - x) {
      return LONG_MAX;
    }

    if (x < 0 && y < LONG_MIN - x) {
      return LONG_MIN;
    }

    return x + y;
  }

  double OperandAsDouble() const {
    if (operand_.type == FieldValue::Type::Double) {
      return operand_.doubleValue;
    } else if (operand_.type == FieldValue::Type::Integer) {
      return operand_.integerValue;
    } else {
      HARD_FAIL("Expected 'operand' to be of FSTNumerValue type, but was %s",
                NSStringFromClass([operand_ class]));
    }
  }
};

}  // namespace model
}  // namespace firestore
}  // namespace firebase

#endif  // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATIONS_H_


text:
<?php

namespace Google\Service\PeopleService;

class ListDirectoryPeopleResponse extends \Google\Collection
{
  protected $collection_key = 'people';
  /**
   * @var string
   */
  public $nextPageToken;
  /**
   * @var string
   */
  public $nextSyncToken;
  protected $peopleType = Person::class;
  protected $peopleDataType = 'array';

  /**
   * @param string
   */
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  /**
   * @return string
   */
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  /**
   * @param string
   */
  public function setNextSyncToken($nextSyncToken)
  {
    $this->nextSyncToken = $nextSyncToken;
  }
  /**
   * @return string
   */
  public function getNextSyncToken()
  {
    return $this->nextSyncToken;
  }
  /**
   * @param Person[]
   */
  public function setPeople($people)
  {
    $this->people = $people;
  }
  /**
   * @return Person[]
   */
  public function getPeople()
  {
    return $this->people;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListDirectoryPeopleResponse::class, 'Google_Service_PeopleService_ListDirectoryPeopleResponse');