text:
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using pbXNet;

namespace SafeNotebooks
{
	public class Item : Observable
	{
		public NotebooksManager NotebooksManager { get; set; }

		ISearchableStorage<string> _Storage;
		public ISearchableStorage<string> Storage
		{
			get => _Storage ?? Parent?.Storage;
			set => _Storage = value;
		}

		public Item Parent { get; private set; }

		public static T New<T>(NotebooksManager notebooksManager, Item parent) where T : Item, new()
		{
			T item = new T()
			{
				NotebooksManager = notebooksManager,
				Parent = parent,
			};

			item.BatchBegin();
			try
			{
				item.InternalNew();
			}
			finally
			{
				item.BatchEnd();
			}

			return item;
		}

		public static async Task<T> OpenAsync<T>(NotebooksManager notebooksManager, Item parent, ISearchableStorage<string> storage, string idInStorage, bool tryToUnlock) where T : Item, new()
		{
			T item = new T()
			{
				NotebooksManager = notebooksManager,
				Storage = storage,
				Parent = parent,
			};

			if (!await item.InternalOpenAsync(idInStorage, tryToUnlock))
				return null;

			return item;
		}

		[System.Serializable]
		class NotEncryptedData
		{
			public string Id;
			public DateTime CreatedOn;
			public DateTime ModifiedOn;
			public string Color = "#00ffffff";
			public string Nick;
			public SecretLifeTime CKeyLifeTime;
			public string IV;
		}

		NotEncryptedData nedata;

		public string Id
		{
			get => nedata?.Id;
			private set => nedata.Id = value;
		}

		public virtual string IdForStorage => Id;

		public DateTime CreatedOn => nedata.CreatedOn;

		public DateTime ModifiedOn => nedata.ModifiedOn;

		public bool Modified { get; protected set; }

		string _modifiedOnForLists;
		public virtual string ModifiedOnForLists
		{
			get => ModifiedOn.ToLocalTime().ToString();
			set => SetValueForLists(ref _modifiedOnForLists, value);
		}

		public string Color
		{
			get => nedata.Color;
			set => SetValue(ref nedata.Color, value);
		}

		public string Nick
		{
			get => nedata?.Nick;
			set {
				SetValue(ref nedata.Nick, value);
				if (!DataIsAvailable)
					NameForLists = value;
			}
		}

		public SecretLifeTime ThisCKeyLifeTime
		{
			get => nedata.CKeyLifeTime;
			// TODO: changing ThisCKeyLifeTime needs additional action like for example: decrypt this and all children, invalidate keys, etc. -> should be rethought more thoroughly
			set => SetValue(ref nedata.CKeyLifeTime, value);
		}

		IByteBuffer IV
		{
			get => nedata.IV == null ? Parent?.IV : SecureBuffer.NewFromHexString(nedata.IV);
			set => SetValue(ref nedata.IV, new SecureBuffer(value, true).ToHexString());
		}

		public bool ThisIsSecured => ThisCKeyLifeTime != SecretLifeTime.Undefined;

		public SecretLifeTime CKeyLifeTime => (ThisIsSecured || Parent == null) ? ThisCKeyLifeTime : Parent.CKeyLifeTime;

		public bool IsSecured => (ThisIsSecured || Parent == null) ? ThisIsSecured : Parent.IsSecured;

		[System.Serializable]
		class Data
		{
			public string Name;
			public string Detail;
		}

		Data data;

		public bool DataIsAvailable => data != null;

		public string Name
		{
			get => data.Name;
			set {
				SetValue(ref data.Name, value);
				NameForLists = value;
			}
		}

		string _nameForLists;
		public virtual string NameForLists
		{
			get => DataIsAvailable ? Name : Nick;
			set => SetValueForLists(ref _nameForLists, value);
		}

		public string Detail
		{
			get => data.Detail;
			set {
				SetValue(ref data.Detail, value);
				DetailForLists = value;
			}
		}

		string _detailForLists;
		public virtual string DetailForLists
		{
			get => DataIsAvailable && !string.IsNullOrEmpty(Detail) ? Detail : " ";
			set => SetValueForLists(ref _detailForLists, value);
		}

		string _lockedImageForListsName;
		public virtual string LockedImageForListsName
		{
			get => !DataIsAvailable ? NotebooksManager.UI.LockedImageForListsName : "";
			set => SetValueForLists(ref _lockedImageForListsName, value);
		}

		double _lockedImageForListsWidth;
		public virtual double LockedImageForListsWidth
		{
			get => !DataIsAvailable ? NotebooksManager.UI.LockedImageForListsWidth : 0;
			set => SetValueForLists(ref _lockedImageForListsWidth, value);
		}

		bool _selectModeEnabled;
		public virtual bool SelectModeEnabled
		{
			get => _selectModeEnabled;
			set {
				_selectModeEnabled = value;
				SelectedUnselectedImageForListsName = _selectModeEnabled ? "e" : "d";
				SelectedUnselectedImageForListsWidth = _selectModeEnabled ? 1 : 0;
			}
		}

		bool _isSelected;
		public bool IsSelected
		{
			get => _isSelected;
			set {
				_isSelected = value;
				SelectedUnselectedImageForListsName = _isSelected ? "s" : "u";
				SelectedUnselectedImageForListsWidth = _isSelected ? 2 : 3;
			}
		}

		string _selectedUnselectedImageForListsName;
		public virtual string SelectedUnselectedImageForListsName
		{
			get {
				if (SelectModeEnabled)
					return IsSelected ? NotebooksManager.UI.SelectedImageForListsName : NotebooksManager.UI.UnselectedImageForListsName;
				else
					return "";
			}
			set => SetValueForLists(ref _selectedUnselectedImageForListsName, value);
		}

		double _selectedUnselectedImageForListsWidth;
		public virtual double SelectedUnselectedImageForListsWidth
		{
			get {
				if (SelectModeEnabled)
					return NotebooksManager.UI.SelectedUnselectedImageForListsWidth;
				else
					return 0;
			}
			set => SetValueForLists(ref _selectedUnselectedImageForListsWidth, value);
		}

		protected void SetValueForLists<T>(ref T storage, T value, [CallerMemberName]string name = null)
		{
			if (Equals(storage, value))
				return;

			storage = value;
			base.OnPropertyChanged(name);
		}

		protected void SetValue<T>(ref T storage, T value, bool touchWithParent = true, [CallerMemberName]string name = null)
		{
			if (Equals(storage, value))
				return;

			storage = value;
			Touch(touchWithParent);

			base.OnPropertyChanged(name);
		}

		public virtual void Touch(bool withParent = true)
		{
			nedata.ModifiedOn = DateTime.UtcNow;
			Modified = true;

			if (withParent)
				TouchParent();
			if (!BatchInProgress)
				NotebooksManager.OnItemModifiedOnChanged(this);

			ModifiedOnForLists = ModifiedOnForLists + nedata.ModifiedOn.ToLocalTime().ToString();
		}

		protected virtual void TouchParent()
		{
			if (Parent != null)
				Parent.Touch();
		}

		#region Serialization

		protected virtual string SerializeNotEncryptedData()
		{
			return NotebooksManager.Serializer.Serialize(nedata, "ned");
		}

		protected virtual void DeserializeNotEncryptedData(string d)
		{
			nedata = NotebooksManager.Serializer.Deserialize<NotEncryptedData>(d, "ned");
		}

		protected virtual string Serialize()
		{
			return NotebooksManager.Serializer.Serialize(data, "d");
		}

		protected virtual void Deserialize(string d)
		{
			data = NotebooksManager.Serializer.Deserialize<Data>(d, "d");
		}

		#endregion

		//

		protected virtual void InternalNew()
		{
			nedata = new NotEncryptedData();
			data = new Data();

			Id = pbXNet.Tools.CreateGuid();

			Touch();
			nedata.CreatedOn = ModifiedOn;
		}

		const string NotEncyptedDataEndMarker = "72d26030-0d4d-4625-b6e8-785de17db815";

		public async Task<bool> OpenAsync(bool tryToUnlock)
		{
			return await TryExecute(InternalOpenAsync(IdForStorage, tryToUnlock));
		}

		protected virtual async Task<bool> InternalOpenAsync(string idInStorage, bool tryToUnlock)
		{
			string d = null;
			try
			{
				d = await Storage?.GetACopyAsync(idInStorage);
			}
			catch (StorageThingNotFoundException) { }
			if (string.IsNullOrEmpty(d))
			{
				// No data for the item in storage probably means that this object was just created (it is new).
				// If the item has a name then we treat this as a correct situation.
				return !string.IsNullOrEmpty(Name);
			}

			d = Obfuscator.DeObfuscate(d);

			int nedEnd = d.IndexOf(NotEncyptedDataEndMarker, StringComparison.Ordinal);
			string ned = d.Substring(0, nedEnd);
			DeserializeNotEncryptedData(ned);

			if (tryToUnlock || !IsSecured || (!ThisIsSecured && Parent != null && Parent.DataIsAvailable))
			{
				d = d.Substring(nedEnd + NotEncyptedDataEndMarker.Length);
				d = await DecryptAsync(d);
				Deserialize(d);

				NameForLists = Name;
				DetailForLists = Detail;
				LockedImageForListsName = "u";
			}
			else
			{
				LockedImageForListsName = "l";
			}

			NotebooksManager.OnItemOpened(this);
			return true;
		}

		public async Task<bool> LoadAsync(bool tryToUnlockChildren)
		{
			return await TryExecute(InternalLoadAsync(tryToUnlockChildren));
		}

		protected virtual async Task<bool> InternalLoadAsync(bool tryToUnlockChildren)
		{
			if (!DataIsAvailable)
			{
				if (!await InternalOpenAsync(IdForStorage, true))
					return false;
			}
			NotebooksManager.OnItemLoaded(this);
			return true;
		}

		public async Task<bool> SaveAsync(bool force = false)
		{
			if ((!Modified && !force) || BatchInProgress)
				return true;

			return await TryExecute(InternalSaveAsync(force));
		}

		protected virtual async Task<bool> InternalSaveAsync(bool force = false)
		{
			Log.D($"for {GetType().FullName}: {Id}", this);

			try
			{
				DateTime modifiedOn = await Storage?.GetModifiedOnAsync(IdForStorage);
				if (modifiedOn > nedata.ModifiedOn)
				{
					throw new Exception($"SafeNotebooks: Item: InternalSaveAsync: {GetType().FullName}: {Id}: modified date in storage is newer than modified date in memory!");
					// TODO: obsluzyc problem gdy dane zapisane sa nowsze niz te, ktore chcemy zapisac
				}
			}
			catch (StorageThingNotFoundException) { }

			string ned = SerializeNotEncryptedData();
			string d = await EncryptAsync(Serialize());

			d = ned + NotEncyptedDataEndMarker + d;
			d = Obfuscator.Obfuscate(d);

			await Storage?.StoreAsync(IdForStorage, d, nedata.ModifiedOn);

			Modified = false;

			NotebooksManager.OnItemSaved(this);
			return true;
		}

		public virtual async Task<bool> SaveAllAsync(bool force = false)
		{
			return await SaveAsync(force);
		}

		//

		public virtual async Task EditAsync()
		{
			// TODO: should ask for a password is locked
			await NotebooksManager.UI.EditItemAsync(this);
		}

		public virtual async Task MoveAsync()
		{
			await App.Current.MainPage.DisplayAlert("Move", $"{GetType().Name}: {NameForLists}", null, Localized.T("Cancel"));
		}

		public virtual async Task DeleteAsync()
		{
			// TODO: should ask for a password is locked
			await App.Current.MainPage.DisplayAlert("Delete", $"{GetType().Name}: {NameForLists}", null, Localized.T("Cancel"));
		}

		#region Security Tools

		Item ItemForCKey => (ThisIsSecured || Parent == null) ? this : Parent?.ItemForCKey;

		string IdForCKey => ItemForCKey?.Id;

		public virtual async Task InitializePasswordAsync(IPassword passwd)
		{
			// If user decided to secure this item with a password...
			if (ThisIsSecured && passwd != null && passwd.Length > 0)
			{
				// ...create ckey (in repository) for future use.
				await CreateCKeyAsync(passwd);
			}
		}

		public virtual async Task CreateCKeyAsync(IPassword passwd)
		{
			if (passwd == null)
			{
				passwd = await NotebooksManager.UI?.GetPasswordAsync(ItemForCKey, IV == null);
				if (passwd == null)
					throw new NotebooksException(NotebooksException.ErrorCode.PasswordNotGiven);
			}

			if (IV == null)
				IV = NotebooksManager.SecretsManager.GenerateIV();

			NotebooksManager.SecretsManager.CreateCKey(IdForCKey, CKeyLifeTime, passwd);
		}

		public virtual async Task PrepareCKeyAsync()
		{
			if (!NotebooksManager.SecretsManager.CKeyExists(IdForCKey))
				await CreateCKeyAsync(null);
		}

		protected virtual async Task<string> EncryptAsync(string d)
		{
			if (IsSecured)
			{
				await PrepareCKeyAsync();
				return NotebooksManager.SecretsManager.Encrypt(d, IdForCKey, IV);
			}

			return d;
		}

		protected virtual async Task<string> DecryptAsync(string d)
		{
			if (IsSecured)
			{
				await PrepareCKeyAsync();
				try
				{
					d = NotebooksManager.SecretsManager.Decrypt(d, IdForCKey, IV);
				}
				catch (Exception)
				{
					// Most likely, a bad password has been entered.
					// To be safe delete ckey from repository in order to give a chance to ask again.
					NotebooksManager.SecretsManager.DeleteCKey(IdForCKey);
					throw new NotebooksException(NotebooksException.ErrorCode.BadPassword);
				}
			}

			return d;
		}

		#endregion

		#region Tools

		volatile int _batchCounter = 0;
		readonly Object _batchCounterLock = new Object();

		public virtual bool BatchInProgress => _batchCounter > 0;

		public virtual void BatchBegin()
		{
			lock (_batchCounterLock)
			{
				_batchCounter++;
				if (Parent != null)
					Parent.BatchBegin();
			}
		}

		public virtual void BatchEnd()
		{
			lock (_batchCounterLock)
			{
				Debug.Assert(_batchCounter > 0);
				_batchCounter--;

				if (Parent != null)
					Parent.BatchEnd();

				if (Modified && _batchCounter == 0)
					NotebooksManager.OnItemModifiedOnChanged(this);
			}
		}

		protected async Task<bool> TryExecute(Task<bool> t, [CallerMemberName]string callerName = null)
		{
			BatchBegin();
			try
			{
				return await t;
			}
			catch (NotebooksException nex)
			{
				await NotebooksManager.UI?.DisplayError(nex, this, callerName);
				return false;
			}
			catch (Exception ex)
			{
				Log.E(ex.ToString(), this);
				await NotebooksManager.UI?.DisplayError(ex, this, callerName);
				return false;
			}
			finally
			{
				BatchEnd();
			}
		}

		#endregion
	}
}


text:
Ext.Loader.setConfig({
	enabled: true
});

Ext.Loader.setPath('Ext.ux', gBaseUX.concat('/statusbar'));

Ext.require('Ext.ux.StatusBar');

Ext.onReady(function() {
	Ext.QuickTips.init();

	var txtTgl = Ext.create('Ext.toolbar.TextItem', {
		text: Ext.Date.format(new Date(), 'l, d F Y')
	});

	var txtJam = Ext.create('Ext.toolbar.TextItem', {
		text: Ext.Date.format(new Date(), 'H:i')
	});

	function buatMenu() {

		Ext.Date.dayNames = [
			'Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'
		];

		Ext.Date.monthNames = [
			'Januari','Februari','Maret','April','Mei','Juni',
			'Juli','Agustus','September','Oktober','Nopember','Desember'
		];

		var datatree =  Ext.create('Ext.data.TreeStore', {
           autoLoad: true,
			proxy: {
				actionMethods: {
					read: 'POST'
				},
				reader: {
					type: 'json'
				},
				type: 'ajax',
				url: 'mainmenu/ambil_nodes'
			},
			root: {
				expanded: true
			}
        });

		var tabPanel = Ext.create('Ext.tab.Panel', {
			activeItem: 0,
			bodyStyle: 'background-color: '.concat(gBasePanel),
			border: false,
			defaults: {
				autoScroll: true
			},
			deferredRender: true,
			enableTabScroll: true,
			id: 'isipanel',
			margins: '2 5 5 0',
			layout: 'fit',
			layoutOnTabChange: true,
			plain: false,
			region: 'center',
			resizeTabs: true,
			xtype: 'tabpanel',
			items: []/*,
			tabBar: {
				items:[{
					xtype: 'tbfill'
					}, cmdButton
				]
			}*/
		});

		var xTxt = '';
		if (Ext.Date.format(new Date(), 'Y') === '2015') {
			xTxt = 'Copyright © '+ Ext.Date.format(new Date(), 'Y') +' ~ AMG - IT Developer';
		}
		else {
			xTxt = 'Copyright © 2016 - '+ Ext.Date.format(new Date(), 'Y') +' ~ AMG - IT Developer';
		}

		var tbPanel = Ext.create('Ext.form.Panel', {
			id: 'contentPanel',
			layout: 'border',
			region: 'center',
			items: [
				tabPanel
			],
			bbar: Ext.create('Ext.ux.StatusBar', {
				id: 'win-statusbar',
				defaultText: xTxt,
				items: ['-',
					Ext.create('Ext.toolbar.TextItem', {
						text: vUser.toUpperCase()
					}), '-',
					Ext.create('Ext.toolbar.TextItem', {
						text: vLevel.toUpperCase()
					}), '-',
					Ext.create('Ext.toolbar.TextItem', {
						text: vIP.toUpperCase()
					}), '-',
					txtTgl, '-', txtJam
				]
			})/*,
			tbar: ['->',{
				iconCls: 'icon-logout',
				text: 'Logout',
				handler: fnLogout
			},{xtype: 'tbspacer'}]*/
		});

		var treePanel = Ext.create('Ext.tree.Panel', {
			autoScroll: true,
			border: false,
			collapsible: true,
			height: '100%',
			hideHeaders: true,
			id: 'astermenu',
			margins: '2 0 5 5',
			maxSize: 250,
			minSize: 150,
			region: 'west',
			rootVisible: false,
			scroll: true,
			split: true,
			store: datatree,
			title: 'Main Menu',
			width: 250,
			tbar: [{
				iconCls: 'icon-delete',
				text: 'Expand All',
				handler: function() {
					treePanel.expandAll();
				}
			},{
				iconCls: 'icon-add',
				text: 'Collapse All',
				handler: function() {
					treePanel.collapseAll();
				}
			},{
				iconCls: 'icon-logout',
				text: 'Logout',
				handler: fnLogout
			}],
			listeners: {
				itemclick: function(view, record, item, index, evt, eOpts) {
					// get the click tree node's text and ID attribute values.
					var nodeText = record.get('text');
					var tabId = record.get('id');
					var id_arr = tabId.split('|');
					var tableaf = record.get('leaf');
					// var tablet = record.get('href');

					if (tableaf === false) {
						// Ext.Msg.alert('Tree Folder Clicked', 'You clicked on tree folder "' + nodeText + '"');
						return;
					}

					// get a reference to the target Tab Panel.
					var tabPanel = Ext.ComponentQuery.query('viewport tabpanel')[0];

					// does the tab already exist?  Note the use of the '#' symbol to indicate
					// your looking for an object with the specified itemId.
					var tab = tabPanel.child('#' + id_arr[1]);

					// if tab not already present, create it and add to tab panel.
					if (tab === null && id_arr[1].trim() !== '') {
						tab = Ext.create('Ext.Component', {
							autoEl: {
								src: id_arr[1],
								tag: 'iframe'
							},
							closable: true,
							height: '100%',
							itemId: id_arr[1].trim(),
							renderto: 'tabPanel',
							title: nodeText.trim(),
							xtype: 'component'
						});
						tabPanel.add(tab);
						tabPanel.doLayout();
					}
					tabPanel.setActiveTab(tab);
				}
			},
			viewConfig: {
				getRowClass: function() {
					// return 'rowwrap';
				},
				stripeRows: true
			}
		});

		function fnLogout() {
			Ext.Ajax.request({
				method: 'POST',
				url: 'login/logout',
				success: function() {
					window.location.href = 'login';
				}
			});
		}

		Ext.TaskManager.start({
			interval: 1000,
			run: function() {
				Ext.fly(txtTgl.getEl()).update(Ext.Date.format(new Date(), 'l, d F Y'));
				Ext.fly(txtJam.getEl()).update(Ext.Date.format(new Date(), 'H:i'));
			}
		});

		Ext.create('Ext.container.Viewport', {
			layout: 'border',
			renderTo: Ext.getBody(),
			title: 'HRD - AMG Group',
			items: [{
				height: 2, //warna biru tua di atas menu
				id: 'header',
				region: 'north',
				xtype: 'box'
			},
				treePanel, tbPanel
			]
		});
	}

	Ext.Ajax.request({
		method: 'POST',
		url: 'mainmenu/ambildefa',
		success: function(response) {
			var xText = Ext.decode(response.responseText);

			if (xText.sukses === true) {
				vUser = xText.user;
				vLevel = xText.level;
				vIP = xText.ip_address;
				vServer = xText.nmserver;

				buatMenu();
			}
		},
		failure: function(response) {
			var xText = Ext.decode(response.responseText);
			Ext.MessageBox.show({
				buttons: Ext.MessageBox.OK,
				closable: false,
				icon: Ext.MessageBox.INFO,
				message: 'Tampil nilai default Gagal, Koneksi Gagal!!',
				title: 'HRD'
			});
		}
	});

	Ext.get('loading').destroy();
});

redpajama_set_name: RedPajamaGithub


text:
package com.gansuer.leetcode.tree;

import com.gansuer.leetcode.tree.Solution108;
import com.gansuer.leetcode.tree.Solution173;
import com.gansuer.leetcode.tree.TreeNode;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * Created by Frank on 11/22/15.
 */
public class BSTIteratorTest {

    private Solution108 solution108;
    private Solution173.BSTIterator bstIterator;
    private Solution173.BSTIteratorV1 bstIteratorV1;

    @Before
    public void setUp() throws Exception {
        solution108 = new Solution108();
    }

    @Test
    public void testHasNext() throws Exception {
        int[] input = {2, 3, 4, 5, 6, 7, 8, 9, 10, 34, 56};

        TreeNode root = solution108.sortedArrayToBST(input);
        bstIterator = new Solution173.BSTIterator(root);
        int index = 0;
        while (bstIterator.hasNext()) {
            Assert.assertEquals(input[index++], bstIterator.next());
        }
    }

    @Test
    public void testNext() throws Exception {
        int[] input = {2, 3, 4, 5, 6, 7, 8, 9, 10, 34, 56};

        TreeNode root = solution108.sortedArrayToBST(input);
        bstIteratorV1 = new Solution173.BSTIteratorV1(root);
        int index = 0;
        while (bstIteratorV1.hasNext()) {
            Assert.assertEquals(input[index++], bstIteratorV1.next());
        }
    }
}


text:
// Copyright (c) Microsoft Corporation, Inc. All rights reserved.
// Licensed under the MIT License, Version 2.0. See License.txt in the project root for license information.

using System.Threading.Tasks;

namespace Microsoft.AspNet.Identity
{
    /// <summary>
    ///     Stores a user's email
    /// </summary>
    /// <typeparam name="TUser"></typeparam>
    public interface IUserEmailStore<TUser> : IUserEmailStore<TUser, string> where TUser : class, IUser<string>
    {
    }

    /// <summary>
    ///     Stores a user's email
    /// </summary>
    /// <typeparam name="TUser"></typeparam>
    /// <typeparam name="TKey"></typeparam>
    public interface IUserEmailStore<TUser, in TKey> : IUserStore<TUser, TKey> where TUser : class, IUser<TKey>
    {
        /// <summary>
        ///     Set the user email
        /// </summary>
        /// <param name="user"></param>
        /// <param name="email"></param>
        /// <returns></returns>
        Task SetEmailAsync(TUser user, string email);

        /// <summary>
        ///     Get the user email
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<string> GetEmailAsync(TUser user);

        /// <summary>
        ///     Returns true if the user email is confirmed
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> GetEmailConfirmedAsync(TUser user);

        /// <summary>
        ///     Sets whether the user email is confirmed
        /// </summary>
        /// <param name="user"></param>
        /// <param name="confirmed"></param>
        /// <returns></returns>
        Task SetEmailConfirmedAsync(TUser user, bool confirmed);

        /// <summary>
        ///     Returns the user associated with this email
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        Task<TUser> FindByEmailAsync(string email);
    }
}


text:
require "thor" unless defined?(Thor)

module Omnibus
  class Generator < Thor::Group
    include Thor::Actions

    namespace :new

    argument :name,
      banner: "NAME",
      desc: "The name of the Omnibus project",
      type: :string,
      required: true

    class_option :path,
      banner: "PATH",
      aliases: "-p",
      desc: "The path to create the Omnibus project",
      type: :string,
      default: "."

    class_option :appx_assets,
      desc: "Generate Windows APPX assets",
      type: :boolean,
      default: false

    class_option :bff_assets,
      desc: "Generate AIX bff assets",
      type: :boolean,
      default: false

    class_option :deb_assets,
      desc: "Generate Debian deb assets",
      type: :boolean,
      default: false

    class_option :dmg_assets,
      desc: "Generate Mac OS X dmg assets",
      type: :boolean,
      default: false

    class_option :msi_assets,
      desc: "Generate Windows MSI assets",
      type: :boolean,
      default: false

    class_option :pkg_assets,
      desc: "Generate Mac OS X pkg assets",
      type: :boolean,
      default: false

    class_option :rpm_assets,
      desc: "Generate RHEL/CentOS rpm assets",
      type: :boolean,
      default: false

    class << self
      # Set the source root for Thor
      def source_root
        File.expand_path("generator_files", __dir__)
      end
    end

    def create_project_files
      template("Gemfile.erb", "#{target}/Gemfile", template_options)
      template("gitignore.erb", "#{target}/.gitignore", template_options)
      template("README.md.erb", "#{target}/README.md", template_options)
      template("omnibus.rb.erb", "#{target}/omnibus.rb", template_options)
    end

    def create_project_definition
      template("config/projects/project.rb.erb", "#{target}/config/projects/#{name}.rb", template_options)
    end

    def create_example_software_definitions
      template("config/software/zlib.rb.erb", "#{target}/config/software/#{name}-zlib.rb", template_options)
      template("config/software/preparation.rb.erb", "#{target}/config/software/preparation.rb", template_options)
    end

    def create_kitchen_files
      template(".kitchen.local.yml.erb", "#{target}/.kitchen.local.yml", template_options)
      template(".kitchen.yml.erb", "#{target}/.kitchen.yml", template_options)
      template("Berksfile.erb", "#{target}/Berksfile", template_options)
    end

    def create_package_scripts
      %w{preinst prerm postinst postrm}.each do |package_script|
        script_path = "#{target}/package-scripts/#{name}/#{package_script}"
        template("package_scripts/#{package_script}.erb", script_path, template_options)

        # Ensure the package script is executable
        chmod(script_path, 0755)
      end
    end

    def create_appx_assets
      return unless options[:appx_assets]

      copy_file(resource_path("appx/AppxManifest.xml.erb"), "#{target}/resources/#{name}/appx/AppxManifest.xml.erb")
      copy_file(resource_path("appx/assets/clear.png"), "#{target}/resources/#{name}/appx/assets/clear.png")
    end

    def create_bff_assets
      return unless options[:bff_assets]

      copy_file(resource_path("bff/gen.template.erb"), "#{target}/resources/#{name}/bff/gen.template.erb")
    end

    def create_deb_assets
      return unless options[:deb_assets]

      copy_file(resource_path("deb/conffiles.erb"), "#{target}/resources/#{name}/deb/conffiles.erb")
      copy_file(resource_path("deb/control.erb"), "#{target}/resources/#{name}/deb/control.erb")
      copy_file(resource_path("deb/md5sums.erb"), "#{target}/resources/#{name}/deb/md5sums.erb")
    end

    def create_dmg_assets
      return unless options[:dmg_assets]

      copy_file(resource_path("dmg/background.png"), "#{target}/resources/#{name}/dmg/background.png")
      copy_file(resource_path("dmg/icon.png"), "#{target}/resources/#{name}/dmg/icon.png")
    end

    def create_msi_assets
      return unless options[:msi_assets]

      copy_file(resource_path("msi/localization-en-us.wxl.erb"), "#{target}/resources/#{name}/msi/localization-en-us.wxl.erb")
      copy_file(resource_path("msi/parameters.wxi.erb"), "#{target}/resources/#{name}/msi/parameters.wxi.erb")
      copy_file(resource_path("msi/source.wxs.erb"), "#{target}/resources/#{name}/msi/source.wxs.erb")

      copy_file(resource_path("msi/assets/LICENSE.rtf"), "#{target}/resources/#{name}/msi/assets/LICENSE.rtf")
      copy_file(resource_path("msi/assets/banner_background.bmp"), "#{target}/resources/#{name}/msi/assets/banner_background.bmp")
      copy_file(resource_path("msi/assets/dialog_background.bmp"), "#{target}/resources/#{name}/msi/assets/dialog_background.bmp")
      copy_file(resource_path("msi/assets/project.ico"), "#{target}/resources/#{name}/msi/assets/project.ico")
      copy_file(resource_path("msi/assets/project_16x16.ico"), "#{target}/resources/#{name}/msi/assets/project_16x16.ico")
      copy_file(resource_path("msi/assets/project_32x32.ico"), "#{target}/resources/#{name}/msi/assets/project_32x32.ico")
    end

    def create_pkg_assets
      return unless options[:pkg_assets]

      copy_file(resource_path("pkg/background.png"), "#{target}/resources/#{name}/pkg/background.png")
      copy_file(resource_path("pkg/license.html.erb"), "#{target}/resources/#{name}/pkg/license.html.erb")
      copy_file(resource_path("pkg/welcome.html.erb"), "#{target}/resources/#{name}/pkg/welcome.html.erb")
      copy_file(resource_path("pkg/distribution.xml.erb"), "#{target}/resources/#{name}/pkg/distribution.xml.erb")
    end

    def create_rpm_assets
      return unless options[:rpm_assets]

      copy_file(resource_path("rpm/rpmmacros.erb"), "#{target}/resources/#{name}/rpm/rpmmacros.erb")
      copy_file(resource_path("rpm/signing.erb"), "#{target}/resources/#{name}/rpm/signing.erb")
      copy_file(resource_path("rpm/spec.erb"), "#{target}/resources/#{name}/rpm/spec.erb")
    end

    private

    #
    # The target path to create the Omnibus project.
    #
    # @return [String]
    #
    def target
      @target ||= File.join(File.expand_path(@options[:path]), "omnibus-#{name}")
    end

    #
    # The list of options to pass to the template generators.
    #
    # @return [Hash]
    #
    def template_options
      @template_options ||= { name: name }
    end

    #
    # The path to a vendored resource within Omnibus.
    #
    # @param [String, Array<String>] args
    #   the sub-path to get
    #
    # @return [String]
    #
    def resource_path(*args)
      Omnibus.source_root.join("resources", *args).to_s
    end
  end
end


text:
package cn.itcast_02;

public class Dog extends Animal {

	@Override
	public void eat() {
		System.out.println("狗吃肉");
	}

}


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os, sys
sys.path.append(os.getcwd())

import time

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import sklearn.datasets
import tensorflow as tf
import cv2

import tflib as lib
import tflib.ops.linear
import tflib.ops.conv2d
import tflib.ops.batchnorm
import tflib.ops.deconv2d
import tflib.save_images
import tflib.mnist
import tflib.plot

MODE = 'wgan-gp' # dcgan, wgan, or wgan-gp
DIM = 64 # Model dimensionality
BATCH_SIZE = 50 # Batch size
CRITIC_ITERS = 5 # For WGAN and WGAN-GP, number of critic iters per gen iter
LAMBDA = 10 # Gradient penalty lambda hyperparameter
ITERS = 200000 # How many generator iterations to train for

C = 3
H = 64
W = 512
OUTPUT_DIM = C*W*H
NOISE_DIM = 256
SAMPLE_NUM = 16

FEATHER_H = 4
FEATHER_W = 32

SAVE_NUM = 99
PIC_DIR = 'iris512'
DATA_DIR = '/home/lihaiqing/database/Thousand_and_Lamp_train_r'
save_dir = '/home/lihaiqing/syn-icb/checkpoint512'

lib.print_model_settings(locals().copy())

def iris_generator(data_set, batch_size):
    all_data = []
    for i in range(len(data_set)):
        data = cv2.imread(data_set[i])
        if C == 1:
            data = cv2.cvtColor( data, cv2.COLOR_RGB2GRAY )
        data = cv2.resize(data, (W, H))
        data = (data.astype('float32'))/255
        data = data.reshape([1, -1])
        all_data.append(data)
    images = np.concatenate(all_data, axis=0)

    def get_epoch():
        np.random.shuffle(images)
        # rng_state = np.random.get_state()
        # np.random.shuffle(images)
        # np.random.set_state(rng_state)
        # np.random.shuffle(labels)

        for i in xrange(len(images) // batch_size):
            yield images[i*batch_size:(i+1)*batch_size], np.random.normal(size=(batch_size, NOISE_DIM)).astype('float32')
    return get_epoch

def load(batch_size):

    test_set = []
    train_set = []
    for fdir, cdirs, _ in os.walk(DATA_DIR):
        for cdir in cdirs:
            if cdir.endswith('L') | cdir.endswith('R'):
                for fdir_2, _, files in os.walk(os.path.join(fdir, cdir)):
                    files = [os.path.join(fdir_2, item) for index, item in enumerate(files) if item.endswith('jpg') ]
                    N = len(files)
                    for i in range(2):
                        test_id = np.random.randint(0, N)
                        test_set.append(files[test_id])
                        del files[test_id]
                        N -= 1
                    for i in range(len(files)):
                        train_set.append(files[i])

    return iris_generator(train_set + test_set, batch_size)

def save_model(sess, saver, model_dir, step, model_name):
    print('Saving...')
    start_time = time.time()
    checkpoint_path = os.path.join(model_dir, model_name)
    saver.save(sess, checkpoint_path, global_step=step, write_meta_graph=False)
    metagraph_filename = os.path.join(model_dir, '%s.meta' % model_name)
    if not os.path.exists(metagraph_filename):
        saver.export_meta_graph(metagraph_filename)
    save_time = time.time() - start_time
    print('model saved in %.2f seconds' % save_time)

def LeakyReLU(x, alpha=0.2):
    return tf.maximum(alpha*x, x)

def ReLULayer(name, n_in, n_out, inputs):
    output = lib.ops.linear.Linear(
        name+'.Linear',
        n_in,
        n_out,
        inputs,
        initialization='he'
    )
    return tf.nn.relu(output)

def LeakyReLULayer(name, n_in, n_out, inputs):
    output = lib.ops.linear.Linear(
        name+'.Linear',
        n_in,
        n_out,
        inputs,
        initialization='he'
    )
    return LeakyReLU(output)

def Generator(inputs):
    # NHWC

    output = lib.ops.linear.Linear('Generator.Input', NOISE_DIM, FEATHER_H*FEATHER_W*8*DIM, inputs)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Generator.BN1', [0], output)
    output = tf.nn.relu(output)
    # NHWC
    output = tf.reshape(output, [-1, FEATHER_H, FEATHER_W, 8*DIM])

    output = lib.ops.deconv2d.Deconv2D('Generator.2', 8*DIM, 4*DIM, 5, output)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Generator.BN2', [0,1,2], output)
    output = tf.nn.relu(output)

    output = lib.ops.deconv2d.Deconv2D('Generator.3', 4*DIM, 2*DIM, 5, output)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Generator.BN3', [0,1,2], output)
    output = tf.nn.relu(output)

    output = lib.ops.deconv2d.Deconv2D('Generator.4', 2*DIM, DIM, 5, output)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Generator.BN4', [0,1,2], output)
    output = tf.nn.relu(output)

    output = lib.ops.deconv2d.Deconv2D('Generator.5', DIM, C, 5, output)
    output = tf.nn.sigmoid(output)

    return tf.reshape(output, [-1, OUTPUT_DIM])

def Discriminator(inputs):
    # NHWC
    output = tf.reshape(inputs, [-1, H, W, C])

    output = lib.ops.conv2d.Conv2D('Discriminator.1',C, DIM, 5, output, stride=2)
    output = LeakyReLU(output)

    output = lib.ops.conv2d.Conv2D('Discriminator.2', DIM, 2*DIM, 5, output, stride=2)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Discriminator.BN2', [0,1,2], output)
    output = LeakyReLU(output)

    output = lib.ops.conv2d.Conv2D('Discriminator.3', 2*DIM, 4*DIM, 5, output, stride=2)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Discriminator.BN3', [0,1,2], output)
    output = LeakyReLU(output)

    output = lib.ops.conv2d.Conv2D('Discriminator.4', 4*DIM, 8*DIM, 5, output, stride=2)
    if MODE == 'wgan':
        output = lib.ops.batchnorm.Batchnorm('Discriminator.BN4', [0,1,2], output)
    output = LeakyReLU(output)

    # caution!
    output = tf.reshape(output, [-1, FEATHER_H*FEATHER_W*8*DIM])
    output = lib.ops.linear.Linear('Discriminator.Output', FEATHER_H*FEATHER_W*8*DIM, 1, output)

    return tf.reshape(output, [-1])

noise = tf.Variable(tf.random_normal([BATCH_SIZE, NOISE_DIM], dtype='float32'), name="gan_generator_inputs", dtype='float32')

real_data = tf.placeholder(tf.float32, shape=[BATCH_SIZE, OUTPUT_DIM])
fake_data = Generator(noise)
fake_data_output = tf.reshape(fake_data, [-1, H, W, C])
if C==1:
    fake_data_output = tf.image.grayscale_to_rgb(fake_data_output)
fake_data_output = tf.identity(fake_data_output, 'fake_data')

disc_real = Discriminator(real_data)
disc_fake = Discriminator(fake_data)

gen_params = lib.params_with_name('Generator')
disc_params = lib.params_with_name('Discriminator')

if MODE == 'wgan':
    gen_cost = -tf.reduce_mean(disc_fake)
    disc_cost = tf.reduce_mean(disc_fake) - tf.reduce_mean(disc_real)

    gen_train_op = tf.train.RMSPropOptimizer(
        learning_rate=5e-5
    ).minimize(gen_cost, var_list=gen_params)
    disc_train_op = tf.train.RMSPropOptimizer(
        learning_rate=5e-5
    ).minimize(disc_cost, var_list=disc_params)

    clip_ops = []
    for var in lib.params_with_name('Discriminator'):
        clip_bounds = [-.01, .01]
        clip_ops.append(
            tf.assign(
                var,
                tf.clip_by_value(var, clip_bounds[0], clip_bounds[1])
            )
        )
    clip_disc_weights = tf.group(*clip_ops)

elif MODE == 'wgan-gp':
    gen_cost = -tf.reduce_mean(disc_fake)
    disc_cost = tf.reduce_mean(disc_fake) - tf.reduce_mean(disc_real)

    alpha = tf.random_uniform(
        shape=[BATCH_SIZE,1],
        minval=0.,
        maxval=1.
    )
    differences = fake_data - real_data
    interpolates = real_data + (alpha*differences)
    gradients = tf.gradients(Discriminator(interpolates), [interpolates])[0]
    slopes = tf.sqrt(tf.reduce_sum(tf.square(gradients), reduction_indices=[1]))
    gradient_penalty = tf.reduce_mean((slopes-1.)**2)
    disc_cost += LAMBDA*gradient_penalty

    gen_train_op = tf.train.AdamOptimizer(
        learning_rate=1e-4,
        beta1=0.5,
        beta2=0.9
    ).minimize(gen_cost, var_list=gen_params)
    disc_train_op = tf.train.AdamOptimizer(
        learning_rate=1e-4,
        beta1=0.5,
        beta2=0.9
    ).minimize(disc_cost, var_list=disc_params)

    clip_disc_weights = None

elif MODE == 'dcgan':
    gen_cost = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(
        disc_fake,
        tf.ones_like(disc_fake)
    ))

    disc_cost =  tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(
        disc_fake,
        tf.zeros_like(disc_fake)
    ))
    disc_cost += tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(
        disc_real,
        tf.ones_like(disc_real)
    ))
    disc_cost /= 2.

    gen_train_op = tf.train.AdamOptimizer(
        learning_rate=2e-4,
        beta1=0.5
    ).minimize(gen_cost, var_list=gen_params)
    disc_train_op = tf.train.AdamOptimizer(
        learning_rate=2e-4,
        beta1=0.5
    ).minimize(disc_cost, var_list=disc_params)

    clip_disc_weights = None

# For saving samples
fixed_noise = tf.constant(np.random.normal(size=(SAMPLE_NUM, NOISE_DIM)).astype('float32'))
fixed_noise_samples = Generator(fixed_noise)
def generate_image(frame, true_dist, pic_dir):
    samples = session.run(fixed_noise_samples)
    lib.save_images.save_images(
        samples.reshape((SAMPLE_NUM, H, W, C)),
        os.path.join(pic_dir,'samples_{}.png'.format(frame))
    )

# Dataset iterator
train_gen = load(BATCH_SIZE)

def inf_train_gen():
    while True:
        for images, random_noise in train_gen():
            yield images, random_noise

def inf_noise_gen():
    while True:
        yield np.random.normal(size=(BATCH_SIZE, NOISE_DIM)).astype('float32')

saver = tf.train.Saver(max_to_keep=5)

# Train loop
gpu_options = tf.GPUOptions(allow_growth = True)
session = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
with session.as_default():

    session.run(tf.global_variables_initializer())

    gen = inf_train_gen()
    gen_noise = inf_noise_gen()

    for iteration in xrange(ITERS):
        start_time = time.time()

        if iteration > 0:
            _noise = gen_noise.next()
            _ = session.run(gen_train_op, feed_dict={noise: _noise})

        if MODE == 'dcgan':
            disc_iters = 1
        else:
            disc_iters = CRITIC_ITERS

        for i in xrange(disc_iters):
            _data, _noise = gen.next()

            _disc_cost, _ = session.run(
                [disc_cost, disc_train_op],
                feed_dict={real_data: _data, noise: _noise}
            )
            if clip_disc_weights is not None:
                _ = session.run(clip_disc_weights)

        lib.plot.plot('train disc cost', _disc_cost)
        lib.plot.plot('time', time.time() - start_time)

        # Calculate dev loss and generate samples every 100 iters
        if iteration % 100 == SAVE_NUM:
            # dev_disc_costs = []
            # for images in dev_gen():
            #     _dev_disc_cost = session.run(
            #         disc_cost,
            #         feed_dict={real_data: images}
            #     )
            #     dev_disc_costs.append(_dev_disc_cost)
            # lib.plot.plot('dev disc cost', np.mean(dev_disc_costs))

            generate_image(iteration, _data, PIC_DIR)
            save_model(session, saver, save_dir, iteration, 'gan')

        # Write logs every 100 iters
        if (iteration < 5) or (iteration % 100 == 99):
            lib.plot.flush()

        lib.plot.tick()


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
    <title>kiwiirc</title>


text:
← [back to Commands](../README.md)

# `cf-mgmt update-org-quotas`

`update-org-quotas` command will:
- update org quotas specified in orgConfig.yml

## Command Usage

```
Usage:
  cf-mgmt [OPTIONS] update-org-quotas [update-org-quotas-OPTIONS]

Help Options:
  -h, --help               Show this help message

[update-org-quotas command options]
  --config-dir=    Name of the config directory (default: config) [$CONFIG_DIR]
  --system-domain= system domain [$SYSTEM_DOMAIN]
  --user-id=       user id that has privileges to create/update/delete users, orgs and spaces [$USER_ID]
  --password=      password for user account [optional if client secret is provided] [$PASSWORD]
  --client-secret= secret for user account that has sufficient privileges to create/update/delete users,
                   orgs and spaces] [$CLIENT_SECRET]
  --peek           Preview entities to change without modifying. [$PEEK]
```


text:
package org.praisenter.ui.slide.animation;

import org.praisenter.data.slide.animation.AnimationDirection;

import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.Node;
import javafx.util.Duration;

public final class PushTransition extends CustomTransition {
	private final ObjectProperty<Duration> duration;
	private final ObjectProperty<AnimationDirection> direction;
	private final DoubleProperty width;
	private final DoubleProperty height;

	public PushTransition() {
		this.duration = new SimpleObjectProperty<Duration>();
		this.direction = new SimpleObjectProperty<AnimationDirection>();
		this.width = new SimpleDoubleProperty();
		this.height = new SimpleDoubleProperty();

		this.duration.addListener((obs, ov, nv) -> {
			this.setCycleDuration(nv);
		});
	}

	@Override
	protected void interpolate(double frac) {
		Node node = this.node.get();
		if (node == null) return;

		AnimationDirection direction = this.direction.get();
		if (direction == null) return;

		double width = this.width.get();
		double height = this.height.get();

		switch (direction) {
			case UP:
				node.setTranslateY(getUpPosition(height, frac));
				break;
			case DOWN:
				node.setTranslateY(getDownPosition(height, frac));
				break;
			case RIGHT:
				node.setTranslateX(getRightPosition(width, frac));
				break;
			case LEFT:
				node.setTranslateX(getLeftPosition(width, frac));
				break;
			default:
				break;
		}
	}

	@Override
	public void stop() {
		super.stop();
		Node node = this.node.get();
		if (node == null) return;
		node.setTranslateX(0);
		node.setTranslateY(0);
	}

	private double getUpPosition(double height, double frac) {
		if (this.isInTransition()) {
			return height * (1.0 - frac);
		} else {
			return -height * frac;
		}
	}

	private double getDownPosition(double height, double frac) {
		if (this.isInTransition()) {
			return -height * (1.0 - frac);
		} else {
			return height * frac;
		}
	}

	private double getRightPosition(double width, double frac) {
		if (this.isInTransition()) {
			return -width * (1.0 - frac);
		} else {
			return width * frac;
		}
	}

	private double getLeftPosition(double width, double frac) {
		if (this.isInTransition()) {
			return width * (1.0 - frac);
		} else {
			return -width * frac;
		}
	}

	public Duration getDuration() {
		return this.duration.get();
	}

	public void setDuration(Duration duration) {
		this.duration.set(duration);
	}

	public ObjectProperty<Duration> durationProperty() {
		return this.duration;
	}

	public AnimationDirection getDirection() {
		return this.direction.get();
	}

	public void setDirection(AnimationDirection direction) {
		this.direction.set(direction);
	}

	public ObjectProperty<AnimationDirection> directionProperty() {
		return this.direction;
	}

	public double getWidth() {
		return this.width.get();
	}

	public void setWidth(double width) {
		this.width.set(width);
	}

	public DoubleProperty widthProperty() {
		return this.width;
	}

	public double getHeight() {
		return this.height.get();
	}

	public void setHeight(double height) {
		this.height.set(height);
	}

	public DoubleProperty heightProperty() {
		return this.height;
	}
}


text:
package pv.animate;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

import pv.style.Easing;

public class Tween extends Transition {

	private Object _target;
	private Map<String,Interpolator<?>> _interp
		= new HashMap<String,Interpolator<?>>();

	public Tween(double duration, Object target) {
		super._duration = duration;
		_target = target;
	}

	public Tween set(String name, Object end) {
		return set(name, get(_target, name), end);
	}

	public Tween set(String name, Object start, Object end) {
		Interpolator<?> i = Interpolator.Factory.get(start, end);
		_interp.put(name, i);
		return this;
	}

	public void remove(String name) {
		_interp.remove(name);
	}

	public long step(double dt, double dd, Easing e) {
		float f = (float)(dt/dd);
		if (f <= 0) {
			f = 0;
		} else if (f >= 1) {
			f = 1;
		} else {
			Easing ease = _ease==null ? e : _ease;
			if (ease != null)
				f = ease.ease(f);
		}

		for (Map.Entry<String,Interpolator<?>> k : _interp.entrySet()) {
			set(_target, k.getKey(), k.getValue().step(f));
		}
		return (dt > dd) ? -1 : _pause;
	}

	public static Object get(Object target, String name) {
		try {
			Field f = target.getClass().getField(name);
			return f.get(target);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public static void set(Object target, String name, Object value) {
		try {
			Field f = target.getClass().getField(name);
			f.set(target, value);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}


text:
package com.athena.meerkat.controller.web.tomcat.repositories;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.athena.meerkat.controller.web.entities.DomainTomcatConfiguration;
import com.athena.meerkat.controller.web.entities.TomcatDomain;

@Repository
public interface DomainTomcatConfigurationRepository extends
		JpaRepository<DomainTomcatConfiguration, Integer> {
	DomainTomcatConfiguration findByTomcatDomain(TomcatDomain td);

	DomainTomcatConfiguration findByTomcatDomain_Id(int domainId);
}


text:
package sweetiebot

// BotInstance represents an instance of the bot using a given token that still runs off the same database as all the other instances
type BotInstance struct {
	DG          *DiscordGoSession
	SelfID      string
	SelfAvatar  string
	SelfName    string
	AppID       uint64
	AppName     string
	Token       string `json:"token"`
	MainGuildID uint64 `json:"mainguildid"`
	IsUserMode  bool   `json:"runasuser"` // True if running as a user for some godawful reason
}


text:
<?php

namespace DigitalOceanV2\Api;

use DigitalOceanV2\Entity\Action as ActionEntity;

/**
 * @author Antoine Corcy <contact@sbin.dk>
 */
class Action extends AbstractApi
{
    /**
     * @return ActionEntity[]
     */
    public function getAll()
    {
        $actions = $this->adapter->get(sprintf('%s/actions?per_page=%d', self::ENDPOINT, PHP_INT_MAX));
        $actions = json_decode($actions);

        $this->extractMeta($actions);

        return array_map(function ($action) {
            return new ActionEntity($action);
        }, $actions->actions);
    }

    /**
     * @param  integer      $id
     * @return ActionEntity
     */
    public function getById($id)
    {
        $action = $this->adapter->get(sprintf('%s/actions/%d', self::ENDPOINT, $id));
        $action = json_decode($action);

        $this->meta = null;

        return new ActionEntity($action->action);
    }
}


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>BindingTuple | UI-Router</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
	<link rel="stylesheet" href="../assets/css/typedoctheme.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					UI-Router

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-externals" checked />
							Externals
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					ng1

					BindingTuple

Interface BindingTuple

Hierarchy

						BindingTuple

Index

Properties

name

type

Properties

name: string

Defined in ng1/statebuilders/views.ts:87

type: string

Defined in ng1/statebuilders/views.ts:88

						Globals

						common

						common_<wbr>hof

						common_<wbr>predicates

						common_<wbr>strings

						core

						hooks

						justjs

						ng1

								"../common/interface"

						ng1_<wbr>directives

						ng1_<wbr>state_<wbr>events

						ng2

						ng2_<wbr>directives

						params

						path

						resolve

						state

						trace

						transition

						url

						view

						Ng1<wbr>View<wbr>Config

						Binding<wbr>Tuple

								name

								type

						Ng1<wbr>Controller

						Ng1<wbr>State<wbr>Declaration

						Ng1<wbr>View<wbr>Declaration

						$state

						$state<wbr>Params

						$state<wbr>Provider

						$transitions

						$transitions<wbr>Provider

						$url<wbr>Matcher<wbr>Factory

						$url<wbr>Matcher<wbr>Factory<wbr>Provider

						$url<wbr>Router

						$url<wbr>Router<wbr>Provider

						id

						router

						$<wbr>View<wbr>Scroll<wbr>Provider

						$ui<wbr>Router

						annotate<wbr>Controller

						get<wbr>Bindings

						get<wbr>Component<wbr>Inputs

						get<wbr>Locals

						get<wbr>State<wbr>Hook<wbr>Builder

						get<wbr>State<wbr>Provider

						get<wbr>Transitions<wbr>Provider

						get<wbr>Url<wbr>Router<wbr>Provider

						ng1<wbr>View<wbr>Config<wbr>Factory

						ng1<wbr>Views<wbr>Builder

						run<wbr>Block

						scope<wbr>Bindings

						watch<wbr>Digests

						$resolve

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
package com.zur.remoting;

/**
 * This interface must implemented by anything that wants to make a call to the server
 * @author Matt Roth
 *
 */
public interface JacksonRemotingCallListener {

	/**
	 * This method is called when the async request to the server is done
	 * @param theClass
	 * @param method
	 * @param result
	 */
	public void onRemotingCallFinished(String theClass, String method, Object result);
	public abstract Object getSystemService (String name);
	/**
	 * Must provided fully qualified url
	 * Ex. http://example.com/servlet/JacksonGateway
	 * @return
	 */
	public String urlForGateway();
}


text:
'use strict';

const _transform = require('../lib/transform');
const _merge = require('lodash/merge');
const _isArray = require('lodash/isArray');

function MapTransformer(callback, parse) {
    if( !(this instanceof MapTransformer) ) {
        return this.transform(new MapTransformer(callback, this.constructor));
    }

    this._parse = parse || require('../index');
    this._callback = callback;
    this._cache = {};
}

MapTransformer.prototype._createParse = function(key) {
    const parse = this._parse;
    const cache = this._cache;

    if (!(key in cache)) {
        cache[key] = this._callback(parse().select(key));
    }

    return cache[key];
};

MapTransformer.prototype.parse = function(source, instance, root) {
    const accumulator = _isArray(source) ? [] : {};
    return _transform(source, (result, value, key) => {
        result[key] = this._createParse(key).parse(source, instance, root);
    }, accumulator);
};

MapTransformer.prototype.reverse = function(source, instance, root) {
    const isArray = _isArray(source);
    const accumulator = isArray ? [] : {};
    return _transform(source, (result, value, key) => {
        const reverse = this._createParse(key).reverse(source[key], instance, root);
        if (isArray)
            result[key] = reverse[key];
        else
            _merge(result, reverse);
    }, accumulator);
};

module.exports = MapTransformer;


text:
"""Add final state to request status and rename Unstarted to Open

Revision ID: 297131e22e28
Revises: 18cbdd3a7fd9
Create Date: 2015-12-03 15:31:39.979333

"""

# revision identifiers, used by Alembic.
revision = '297131e22e28'
down_revision = '504f541411a5'

from alembic import op

def upgrade():
  op.execute("""ALTER TABLE requests CHANGE status status ENUM("Unstarted","In Progress","Finished","Verified","Open","Final") NOT NULL;""")
  op.execute("""UPDATE requests SET status="Open" WHERE status="Unstarted";""")
  op.execute("""ALTER TABLE requests CHANGE status status ENUM("Open","In Progress","Finished","Verified","Final") NOT NULL;""")

def downgrade():
  op.execute("""ALTER TABLE requests CHANGE status status ENUM("Open","In Progress","Finished","Verified","Final","Unstarted") NOT NULL;""")
  op.execute("""UPDATE requests SET status="Unstarted" WHERE status="Open";""")
  op.execute("""UPDATE requests SET status="Finished" WHERE status="Final";""")
  op.execute("""ALTER TABLE requests CHANGE status status ENUM("Unstarted","In Progress","Finished","Verified") NOT NULL;""")