text:
// Copyright © 2017 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// 	http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace chocolatey.infrastructure.app.configuration
{
    using System;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Text;
    using domain;
    using logging;
    using platforms;

    /// <summary>
    ///   The chocolatey configuration.
    /// </summary>
    [Serializable]
    public class ChocolateyConfiguration
    {
        public ChocolateyConfiguration()
        {
            RegularOutput = true;
            PromptForConfirmation = true;
            SourceType = SourceType.normal;
            Information = new InformationCommandConfiguration();
            Features = new FeaturesConfiguration();
            NewCommand = new NewCommandConfiguration();
            ListCommand = new ListCommandConfiguration();
            UpgradeCommand = new UpgradeCommandConfiguration();
            SourceCommand = new SourcesCommandConfiguration();
            MachineSources = new List<MachineSourceConfiguration>();
            FeatureCommand = new FeatureCommandConfiguration();
            ConfigCommand = new ConfigCommandConfiguration();
            ApiKeyCommand = new ApiKeyCommandConfiguration();
            PackCommand = new PackCommandConfiguration();
            PushCommand = new PushCommandConfiguration();
            PinCommand = new PinCommandConfiguration();
            OutdatedCommand = new OutdatedCommandConfiguration();
            Proxy = new ProxyConfiguration();
#if DEBUG
            AllowUnofficialBuild = true;
#endif
        }

        // overrides
        public override string ToString()
        {
            var properties = new StringBuilder();

            this.Log().Debug(ChocolateyLoggers.Important, @"
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.");
            output_tostring(properties, GetType().GetProperties(), this, "");
            return properties.ToString();

        }

        private void output_tostring(StringBuilder propertyValues, IEnumerable<PropertyInfo> properties, object obj, string prepend)
        {
            foreach (var propertyInfo in properties.or_empty_list_if_null())
            {
                // skip sensitive data info
                if (propertyInfo.Name.contains("password") || propertyInfo.Name.contains("sensitive") || propertyInfo.Name == "Key" || propertyInfo.Name == "ConfigValue" || propertyInfo.Name == "MachineSources")
                {
                    continue;
                }

                var objectValue = propertyInfo.GetValue(obj, null);
                if (propertyInfo.PropertyType.is_built_in_system_type())
                {
                    if (!string.IsNullOrWhiteSpace(objectValue.to_string()))
                    {
                        var output = "{0}{1}='{2}'|".format_with(
                            string.IsNullOrWhiteSpace(prepend) ? "" : prepend + ".",
                            propertyInfo.Name,
                            objectValue.to_string());

                        append_output(propertyValues, output);
                    }
                }
                else if (propertyInfo.PropertyType.is_collections_type())
                {
                    var list = objectValue as IDictionary<string, string>;
                    foreach (var item in list.or_empty_list_if_null())
                    {
                        var output = "{0}{1}.{2}='{3}'|".format_with(
                            string.IsNullOrWhiteSpace(prepend) ? "" : prepend + ".",
                            propertyInfo.Name,
                            item.Key,
                            item.Value);

                        append_output(propertyValues, output);
                    }
                }
                else
                {
                    output_tostring(propertyValues, propertyInfo.PropertyType.GetProperties(), objectValue, propertyInfo.Name);
                }
            }
        }

        private const int MAX_CONSOLE_LINE_LENGTH = 72;
        private int _currentLineLength = 0;

        private void append_output(StringBuilder propertyValues, string append)
        {
            _currentLineLength += append.Length;

            propertyValues.AppendFormat("{0}{1}{2}",
                   _currentLineLength < MAX_CONSOLE_LINE_LENGTH ? string.Empty : Environment.NewLine,
                   append,
                   append.Length < MAX_CONSOLE_LINE_LENGTH ? string.Empty : Environment.NewLine);

            if (_currentLineLength > MAX_CONSOLE_LINE_LENGTH)
            {
                _currentLineLength = append.Length;
            }
        }

        /// <summary>
        ///   Gets or sets the name of the command.
        ///   This is the command that choco runs.
        /// </summary>
        /// <value>
        ///   The name of the command.
        /// </value>
        public string CommandName { get; set; }

        // configuration set variables
        public string CacheLocation { get; set; }
        public bool ContainsLegacyPackageInstalls { get; set; }
        public int CommandExecutionTimeoutSeconds { get; set; }
        public int WebRequestTimeoutSeconds { get; set; }

        /// <summary>
        ///   One or more source locations set by configuration or by command line. Separated by semi-colon
        /// </summary>
        public string Sources { get; set; }
        public SourceType SourceType { get; set; }

        // top level commands

        public bool Debug { get; set; }
        public bool Verbose { get; set; }
        public bool Trace { get; set; }
        public bool Force { get; set; }
        public bool Noop { get; set; }
        public bool HelpRequested { get; set; }
        /// <summary>
        ///   Gets or sets a value indicating whether parsing was successful (everything parsed) or not.
        /// </summary>
        public bool UnsuccessfulParsing { get; set; }

        // TODO: Should look into using mutually exclusive output levels - Debug, Info (Regular), Error (Quiet)
        // Verbose and Important are not part of the levels at all
        /// <summary>
        /// Gets or sets a value indicating whether output should be limited.
        /// This supports the --limit-output parameter.
        /// </summary>
        /// <value><c>true</c> for regular output; <c>false</c> for limited output.</value>
        public bool RegularOutput { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether console logging should be supressed.
        /// This is for use by API calls which surface results in alternate forms.
        /// </summary>
        /// <value><c>true</c> for no output; <c>false</c> for regular or limited output.</value>
        /// <remarks>This has only been implemented for NuGet List</remarks>
        public bool QuietOutput { get; set; }
        public bool PromptForConfirmation { get; set; }
        public bool AcceptLicense { get; set; }
        public bool AllowUnofficialBuild { get; set; }
        public string AdditionalLogFileLocation { get; set; }

        /// <summary>
        ///   Usually related to unparsed arguments.
        /// </summary>
        public string Input { get; set; }

        // command level options
        public string Version { get; set; }
        public bool AllVersions { get; set; }
        public bool SkipPackageInstallProvider { get; set; }
        public string OutputDirectory { get; set; }

        // install/update
        /// <summary>
        ///   Gets or sets the package names. Space separated
        /// </summary>
        /// <value>
        ///   Space separated package names.
        /// </value>
        public string PackageNames { get; set; }

        public bool Prerelease { get; set; }
        public bool ForceX86 { get; set; }
        public string InstallArguments { get; set; }
        public bool OverrideArguments { get; set; }
        public bool NotSilent { get; set; }
        public string PackageParameters { get; set; }
        public bool ApplyPackageParametersToDependencies { get; set; }
        public bool ApplyInstallArgumentsToDependencies { get; set; }
        public bool IgnoreDependencies { get; set; }
        public bool AllowMultipleVersions { get; set; }
        public bool AllowDowngrade { get; set; }
        public bool ForceDependencies { get; set; }
        public string DownloadChecksum { get; set; }
        public string DownloadChecksum64 { get; set; }
        public string DownloadChecksumType { get; set; }
        public string DownloadChecksumType64 { get; set; }

        /// <summary>
        ///   Configuration values provided by choco.
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public InformationCommandConfiguration Information { get;  set; }

        /// <summary>
        ///   Configuration related to features and whether they are enabled.
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public FeaturesConfiguration Features { get;  set; }

        /// <summary>
        ///   Configuration related specifically to List command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public ListCommandConfiguration ListCommand { get;  set; }

        /// <summary>
        ///   Configuration related specifically to Upgrade command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public UpgradeCommandConfiguration UpgradeCommand { get;  set; }

        /// <summary>
        ///   Configuration related specifically to New command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public NewCommandConfiguration NewCommand { get;  set; }

        /// <summary>
        ///   Configuration related specifically to Source command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public SourcesCommandConfiguration SourceCommand { get;  set; }

        /// <summary>
        ///   Default Machine Sources Configuration
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public IList<MachineSourceConfiguration> MachineSources { get; set; }

        /// <summary>
        /// Configuration related specifically to the Feature command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public FeatureCommandConfiguration FeatureCommand { get; set; }

        /// <summary>
        /// Configuration related to the configuration file.
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public ConfigCommandConfiguration ConfigCommand { get; set; }

        /// <summary>
        ///   Configuration related specifically to ApiKey command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public ApiKeyCommandConfiguration ApiKeyCommand { get;  set; }

        /// <summary>
        ///   Configuration related specifically to the Pack command.
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public PackCommandConfiguration PackCommand { get; set; }

        /// <summary>
        ///   Configuration related specifically to Push command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public PushCommandConfiguration PushCommand { get;  set; }

        /// <summary>
        /// Configuration related specifically to Pin command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public PinCommandConfiguration PinCommand { get; set; }

        /// <summary>
        /// Configuration related specifically to Outdated command
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public OutdatedCommandConfiguration OutdatedCommand { get; set; }

        /// <summary>
        /// Configuration related specifically to proxies.
        /// </summary>
        /// <remarks>
        ///   On .NET 4.0, get error CS0200 when private set - see http://stackoverflow.com/a/23809226/18475
        /// </remarks>
        public ProxyConfiguration Proxy { get; set; }
    }

    [Serializable]
    public sealed class InformationCommandConfiguration
    {
        // application set variables
        public PlatformType PlatformType { get; set; }
        public Version PlatformVersion { get; set; }
        public string PlatformName { get; set; }
        public string ChocolateyVersion { get; set; }
        public string ChocolateyProductVersion { get; set; }
        public string FullName { get; set; }
        public bool Is64BitOperatingSystem { get; set; }
        public bool Is64BitProcess { get; set; }
        public bool IsInteractive { get; set; }
        public string UserName { get; set; }
        public string UserDomainName { get; set; }
        public bool IsUserAdministrator { get; set; }
        public bool IsUserSystemAccount { get; set; }
        public bool IsUserRemoteDesktop { get; set; }
        public bool IsUserRemote { get; set; }
        public bool IsProcessElevated { get; set; }
        public bool IsLicensedVersion { get; set; }
        public string LicenseType { get; set; }
    }

    [Serializable]
    public sealed class FeaturesConfiguration
    {
        public bool AutoUninstaller { get; set; }
        public bool ChecksumFiles { get; set; }
        public bool AllowEmptyChecksums { get; set; }
        public bool AllowEmptyChecksumsSecure { get; set; }
        public bool FailOnAutoUninstaller { get; set; }
        public bool FailOnStandardError { get; set; }
        public bool UsePowerShellHost { get; set; }
        public bool LogEnvironmentValues { get; set; }
        public bool VirusCheck { get; set; }
        public bool FailOnInvalidOrMissingLicense { get; set; }
        public bool IgnoreInvalidOptionsSwitches { get; set; }
        public bool UsePackageExitCodes { get; set; }
        public bool UseFipsCompliantChecksums { get; set; }
        public bool ShowNonElevatedWarnings { get; set; }
        public bool ShowDownloadProgress { get; set; }
        public bool StopOnFirstPackageFailure { get; set; }
        public bool UseRememberedArgumentsForUpgrades { get; set; }
        public bool IgnoreUnfoundPackagesOnUpgradeOutdated { get; set; }
        public bool RemovePackageInformationOnUninstall { get; set; }

        //todo remove in 0.11.0
        public bool ScriptsCheckLastExitCode { get; set; }
    }

    //todo: retrofit other command configs this way

    [Serializable]
    public sealed class ListCommandConfiguration
    {
        public ListCommandConfiguration()
        {
            PageSize = 25;
        }

        // list
        public bool LocalOnly { get; set; }
        public bool IdOnly { get; set; }
        public bool IncludeRegistryPrograms { get; set; }
        public int? Page { get; set; }
        public int PageSize { get; set; }
        public bool Exact { get; set; }
        public bool ByIdOnly { get; set; }
        public bool ByTagOnly { get; set; }
        public bool IdStartsWith { get; set; }
        public bool OrderByPopularity { get; set; }
        public bool ApprovedOnly { get; set; }
        public bool DownloadCacheAvailable { get; set; }
        public bool NotBroken { get; set; }
        public bool IncludeVersionOverrides { get; set; }
    }

    [Serializable]
    public sealed class UpgradeCommandConfiguration
    {
        public bool FailOnUnfound { get; set; }
        public bool FailOnNotInstalled { get; set; }
        public bool NotifyOnlyAvailableUpgrades { get; set; }
        public string PackageNamesToSkip { get; set; }
        public bool ExcludePrerelease { get; set; }
    }

    [Serializable]
    public sealed class NewCommandConfiguration
    {
        public NewCommandConfiguration()
        {
            TemplateProperties = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
        }

        public string TemplateName { get; set; }
        public string Name { get; set; }
        public bool AutomaticPackage { get; set; }
        public IDictionary<string, string> TemplateProperties { get; private set; }
        public bool UseOriginalTemplate { get; set; }
    }

    [Serializable]
    public sealed class SourcesCommandConfiguration
    {
        public string Name { get; set; }
        public SourceCommandType Command { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public int Priority { get; set; }
        public string Certificate { get; set; }
        public string CertificatePassword { get; set; }
        public bool BypassProxy { get; set; }
        public bool AllowSelfService { get; set; }
        public bool VisibleToAdminsOnly { get; set; }
    }

    [Serializable]
    public sealed class MachineSourceConfiguration
    {
        public string Name { get; set; }
        public string Key { get; set; }
        public string Username { get; set; }
        public string EncryptedPassword { get; set; }
        public int Priority { get; set; }
        public string Certificate { get; set; }
        public string EncryptedCertificatePassword { get; set; }
        public bool BypassProxy { get; set; }
        public bool AllowSelfService { get; set; }
        public bool VisibleToAdminsOnly { get; set; }
    }

    [Serializable]
    public sealed class FeatureCommandConfiguration
    {
        public string Name { get; set; }
        public FeatureCommandType Command { get; set; }
    }

    [Serializable]
    public sealed class ConfigCommandConfiguration
    {
        public string Name { get; set; }
        public string ConfigValue { get; set; }
        public ConfigCommandType Command { get; set; }
    }

    [Serializable]
    public sealed class PinCommandConfiguration
    {
        public string Name { get; set; }
        public PinCommandType Command { get; set; }
    }

    [Serializable]
    public sealed class OutdatedCommandConfiguration
    {
        public bool IgnorePinned { get; set; }
    }

    [Serializable]
    public sealed class ApiKeyCommandConfiguration
    {
        public string Key { get; set; }
    }

    [Serializable]
    public sealed class PackCommandConfiguration
    {
        public PackCommandConfiguration()
        {
            Properties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
        }

        public IDictionary<string, string> Properties { get; private set; }
    }

    [Serializable]
    public sealed class PushCommandConfiguration
    {
        public string Key { get; set; }
        //DisableBuffering?
    }

    [Serializable]
    public sealed class ProxyConfiguration
    {
        public string Location { get; set; }
        public string User { get; set; }
        public string EncryptedPassword { get; set; }
        public string BypassList { get; set; }
        public bool BypassOnLocal { get; set; }
    }
}


text:
package kikaha.urouting.unit;

import kikaha.core.cdi.ApplicationRunner;
import lombok.SneakyThrows;
import org.junit.Ignore;
import org.junit.Test;

/**
 * A test to run Undertow server.
 */
@Ignore
public class UndertowTest {

	@Test
	@SneakyThrows
	public void runUndertow() {
		ApplicationRunner.main( null );
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.grumoon.androidultrapulltorefreshdemo.ui;

import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
import android.widget.Toast;

import com.grumoon.androidultrapulltorefreshdemo.R;

import in.srain.cube.views.ptr.PtrClassicFrameLayout;
import in.srain.cube.views.ptr.PtrDefaultHandler;
import in.srain.cube.views.ptr.PtrFrameLayout;
import in.srain.cube.views.ptr.PtrHandler;

/**
 * A simple {@link Fragment} subclass.
 */
public class ContentWebViewFragment extends Fragment {

    private static final String[] URLS = new String[]{
            "https://github.com/grumoon",
            "https://github.com/android-cn/android-open-project-analysis",
            "https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh",
    };

    //下拉次数
    private int ptrTimes;

    private PtrClassicFrameLayout ptr;

    private WebView wvMain;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_content_web_view, container, false);
        initView(v);
        return v;
    }

    private void initView(View v) {

        wvMain = (WebView) v.findViewById(R.id.wv_main);
        wvMain.setWebViewClient(new WebViewClient() {
            @Override
            public void onPageFinished(WebView view, String url) {

                super.onPageFinished(view, url);
                ptr.refreshComplete();
            }

            @Override
            public void onReceivedError(WebView view, int errorCode,
                                        String description, String failingUrl) {

                super.onReceivedError(view, errorCode, description, failingUrl);
                ptr.refreshComplete();
                Toast.makeText(getActivity(), "页面打开失败,请稍候再试", Toast.LENGTH_SHORT)
                        .show();
            }
        });

        ptr = (PtrClassicFrameLayout) v.findViewById(R.id.ptr_main);

        ptr.setPtrHandler(new PtrHandler() {
            @Override
            public boolean checkCanDoRefresh(PtrFrameLayout ptrFrameLayout, View view, View view2) {
                return wvMain.getScrollY() == 0;
            }

            @Override
            public void onRefreshBegin(PtrFrameLayout ptrFrameLayout) {

                wvMain.loadUrl(URLS[ptrTimes % URLS.length]);
                ptrTimes++;
            }
        });

        ptr.postDelayed(new Runnable() {
            @Override
            public void run() {
                ptr.autoRefresh();
            }
        }, 100);
    }

}


text:
class CSimpleSimTimer
{
public:
	CSimpleSimTimer()
	 : m_next( -1 )
	{
	}

	void Force()
	{
		m_next = -1;
	}

	bool Expired() const
	{
		return ( gpGlobals->curtime - m_next > -ST_EPS );
	}

	float Delay( float delayTime )
	{
		return (m_next += delayTime);
	}

	float GetNext() const
	{
		return m_next;
	}

	void Set( float interval )
	{
		m_next = gpGlobals->curtime + interval;
	}

	void Set( float minInterval, float maxInterval )
	{
		if ( maxInterval > 0.0 )
			m_next = gpGlobals->curtime + random->RandomFloat( minInterval, maxInterval );
		else
			m_next = gpGlobals->curtime + minInterval;
	}

	float GetRemaining() const
	{
		float result = m_next - gpGlobals->curtime;
		if (result < 0 )
			return 0;
		return result;
	}

	DECLARE_SIMPLE_DATADESC();

protected:
	float m_next;
};

//-----------------------------------------------------------------------------

class CSimTimer : public CSimpleSimTimer
{
public:
	CSimTimer( float interval = 0.0, bool startExpired = true )
	{
		Set( interval, startExpired );
	}

	void Set( float interval, bool startExpired = true )
	{
		m_interval = interval;
		m_next = (startExpired) ? -1.0 : gpGlobals->curtime + m_interval;
	}

	void Reset( float interval = -1.0 )
	{
		if ( interval == -1.0 )
		{
			m_next = gpGlobals->curtime + m_interval;
		}
		else
		{
			m_next = gpGlobals->curtime + interval;
		}
	}

	float GetInterval() const
	{
		return m_interval;
	}

	DECLARE_SIMPLE_DATADESC();

private:
	float m_interval;
};

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

class CRandSimTimer : public CSimpleSimTimer
{
public:
	CRandSimTimer( float minInterval = 0.0, float maxInterval = 0.0, bool startExpired = true )
	{
		Set( minInterval, maxInterval, startExpired );
	}

	void Set( float minInterval, float maxInterval = 0.0, bool startExpired = true )
	{
		m_minInterval = minInterval;
		m_maxInterval = maxInterval;

		if (startExpired)
		{
			m_next = -1;
		}
		else
		{
			if ( m_maxInterval == 0 )
				m_next = gpGlobals->curtime + m_minInterval;
			else
				m_next = gpGlobals->curtime + random->RandomFloat( m_minInterval, m_maxInterval );
		}
	}

	void Reset()
	{
		if ( m_maxInterval == 0 )
			m_next = gpGlobals->curtime + m_minInterval;
		else
			m_next = gpGlobals->curtime + random->RandomFloat( m_minInterval, m_maxInterval );
	}

	float GetMinInterval() const
	{
		return m_minInterval;
	}

	float GetMaxInterval() const
	{
		return m_maxInterval;
	}

	DECLARE_SIMPLE_DATADESC();

private:
	float m_minInterval;
	float m_maxInterval;
};

//-----------------------------------------------------------------------------

class CStopwatchBase  : public CSimpleSimTimer
{
public:
	CStopwatchBase()
	{
		m_fIsRunning = false;
	}

	bool IsRunning() const
	{
		return m_fIsRunning;
	}

	void Stop()
	{
		m_fIsRunning = false;
	}

	bool Expired() const
	{
		return ( m_fIsRunning && CSimpleSimTimer::Expired() );
	}

	DECLARE_SIMPLE_DATADESC();

protected:
	bool m_fIsRunning;

};

//-------------------------------------

class CStopwatch : public CStopwatchBase
{
public:
	CStopwatch ( float interval = 0.0 )
	{
		Set( interval );
	}

	void Set( float interval )
	{
		m_interval = interval;
	}

	void Start( float intervalOverride )
	{
		m_fIsRunning = true;
		m_next = gpGlobals->curtime + intervalOverride;
	}

	void Start()
	{
		Start( m_interval );
	}

	float GetInterval() const
	{
		return m_interval;
	}

	DECLARE_SIMPLE_DATADESC();

private:
	float m_interval;
};

//-------------------------------------

class CRandStopwatch : public CStopwatchBase
{
public:
	CRandStopwatch( float minInterval = 0.0, float maxInterval = 0.0 )
	{
		Set( minInterval, maxInterval );
	}

	void Set( float minInterval, float maxInterval = 0.0 )
	{
		m_minInterval = minInterval;
		m_maxInterval = maxInterval;
	}

	void Start( float minOverride, float maxOverride = 0.0 )
	{
		m_fIsRunning = true;
		if ( maxOverride == 0 )
			m_next = gpGlobals->curtime + minOverride;
		else
			m_next = gpGlobals->curtime + random->RandomFloat( minOverride, maxOverride );
	}

	void Start()
	{
		Start( m_minInterval, m_maxInterval );
	}

	float GetInterval() const
	{
		return m_minInterval;
	}

	float GetMinInterval() const
	{
		return m_minInterval;
	}

	float GetMaxInterval() const
	{
		return m_maxInterval;
	}

	DECLARE_SIMPLE_DATADESC();

private:
	float m_minInterval;
	float m_maxInterval;
};

//-----------------------------------------------------------------------------

class CThinkOnceSemaphore
{
public:
	CThinkOnceSemaphore()
	 :	m_lastTime( -1 )
	{
	}

	bool EnterThink()
	{
		if ( m_lastTime == gpGlobals->curtime )
			return false;
		m_lastTime = gpGlobals->curtime;
		return true;
	}

	bool DidThink() const
	{
		return ( gpGlobals->curtime == m_lastTime );

	}

	void SetDidThink()
	{
		m_lastTime = gpGlobals->curtime;
	}

private:
	float m_lastTime;
};

//-----------------------------------------------------------------------------

#endif // SIMTIMER_H


text:
package com.gwtcraft.server;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

import javax.cache.Cache;
import javax.cache.CacheException;
import javax.cache.CacheFactory;
import javax.cache.CacheManager;

import com.google.appengine.api.memcache.stdimpl.GCacheFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.gwtcraft.client.GwtCraftException;
import com.gwtcraft.client.model.ArmoryCharacter;
import com.gwtcraft.client.model.Item;
import com.gwtcraft.client.model.ItemDetail;
import com.gwtcraft.client.service.ArmoryService;

@SuppressWarnings( { "serial", "unchecked" })
public class ArmoryServiceImpl extends RemoteServiceServlet implements
		ArmoryService {

	public static Cache cache30min;
	public static Cache cache24hours;

	static {
		Map props30min = new HashMap();
		props30min.put(GCacheFactory.EXPIRATION_DELTA, 60 * 30);

		try {
			CacheFactory cacheFactory = CacheManager.getInstance()
					.getCacheFactory();
			cache30min = cacheFactory.createCache(props30min);
		} catch (CacheException e) {
			throw new RuntimeException("Unable to create cache", e);
		}

		Map props24hours = new HashMap();
		props24hours.put(GCacheFactory.EXPIRATION_DELTA, 60 * 60 * 24);

		try {
			CacheFactory cacheFactory = CacheManager.getInstance()
					.getCacheFactory();
			cache24hours = cacheFactory.createCache(props24hours);
		} catch (CacheException e) {
			throw new RuntimeException("Unable to create cache", e);
		}
	}

	public List<ArmoryCharacter> search(String regionCode, String searchTerm) {
		try {
			String cacheKey = CacheKeyService
					.key(regionCode + "_" + searchTerm);
			List<ArmoryCharacter> characters = (List<ArmoryCharacter>) cache30min
					.get(cacheKey);

			if (characters == null) {
				String url = "http://" + regionCode
						+ ".wowarmory.com/search.xml?searchQuery="
						+ URLEncoder.encode(searchTerm, "UTF-8");

				characters = new ArmoryParser().parseCharacterSearch(UrlService
						.open(url));

				Calendar cal = Calendar.getInstance(Locale.UK);
				cal.set(Calendar.HOUR_OF_DAY, 0);
				cal.set(Calendar.MINUTE, 0);
				cal.set(Calendar.SECOND, 0);
				cal.set(Calendar.MILLISECOND, 0);
				cal.add(Calendar.DAY_OF_YEAR, -60);
				Date sixtyDaysAgo = cal.getTime();

				Set<ArmoryCharacter> toRemove = new HashSet<ArmoryCharacter>();

				for (ArmoryCharacter character : characters) {
					if (character.getLastLogin().before(sixtyDaysAgo)) {
						toRemove.add(character);
					} else if (character.getLevel() < 70) {
						toRemove.add(character);
					}
				}

				characters.removeAll(toRemove);

				Collections.sort(characters, new SearchRankComparator());

				cache30min.put(cacheKey, characters);
			}

			return characters;
		} catch (IOException e) {
			throw new GwtCraftException(e);
		}
	}

	@Override
	public List<Item> loadItemsFor(String regionCode, String name, String realm) {
		try {
			String cacheKey = CacheKeyService.key(regionCode + "_" + name + "_"
					+ realm);
			List<Item> items = (List<Item>) cache30min.get(cacheKey);

			if (items == null) {
				String url = String.format("http://" + regionCode
						+ ".wowarmory.com/character-sheet.xml?r=%s&n=%s",
						URLEncoder.encode(realm, "UTF-8"), URLEncoder.encode(
								name, "UTF-8"));

				items = new ArmoryParser().parseItems(UrlService.open(url));
				cache30min.put(cacheKey, items);
			}

			return items;
		} catch (IOException e) {
			throw new GwtCraftException(e);
		}
	}

	@Override
	public ItemDetail loadItem(String regionCode, Integer id) {
		String cacheKey = CacheKeyService.key("item_" + id);
		ItemDetail item = (ItemDetail) cache24hours.get(cacheKey);

		if (item == null) {
			String url = "http://" + regionCode
					+ ".wowarmory.com/item-tooltip.xml?i=" + id;
			item = new ArmoryParser().parseItem(UrlService.open(url));
			cache24hours.put(cacheKey, item);
		}

		return item;
	}

	private static class SearchRankComparator implements
			Comparator<ArmoryCharacter> {
		@Override
		public int compare(ArmoryCharacter o1, ArmoryCharacter o2) {

			// these should be sorted reverse
			return o1.getSearchRank().compareTo(o2.getSearchRank()) * -1;
		}
	}

	@Override
	public List<Integer> loadUpgradesFor(String regionCode, String playerName,
			String playerRealm, Integer itemId) {
		String url = null;

		try {
			url = String
					.format("http://" + regionCode + ".wowarmory.com/search.xml?searchType=items&pr=%s&pn=%s&pi=%s",
							URLEncoder.encode(playerRealm, "UTF-8"), URLEncoder
									.encode(playerName, "UTF-8"), String
									.valueOf(itemId));
		} catch (IOException ioe) {
			throw new GwtCraftException(ioe);
		}

		String key = CacheKeyService.key(url);

		List<Integer> items = (List<Integer>) cache30min.get(key);

		if (items == null) {

			items = new ArmoryParser().parseUpgrades(UrlService.open(url));
			cache30min.put(key, items);

		}
		return items;
	}
}


text:
.class final Ljava/util/HashMap$EntryIterator;
.super Ljava/util/HashMap$HashIterator;
.source "HashMap.java"

# interfaces
.implements Ljava/util/Iterator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Ljava/util/HashMap;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x12
    name = "EntryIterator"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/util/HashMap",
        "<TK;TV;>.HashIterator;",
        "Ljava/util/Iterator",
        "<",
        "Ljava/util/Map$Entry",
        "<TK;TV;>;>;"
    }
.end annotation

# instance fields
.field final synthetic this$0:Ljava/util/HashMap;

# direct methods
.method private constructor <init>(Ljava/util/HashMap;)V
    .locals 0

    .prologue
    .line 822
    .local p0, "this":Ljava/util/HashMap$EntryIterator;, "Ljava/util/HashMap<TK;TV;>.EntryIterator;"
    iput-object p1, p0, Ljava/util/HashMap$EntryIterator;->this$0:Ljava/util/HashMap;

    invoke-direct {p0, p1}, Ljava/util/HashMap$HashIterator;-><init>(Ljava/util/HashMap;)V

    return-void
.end method

.method synthetic constructor <init>(Ljava/util/HashMap;Ljava/util/HashMap$1;)V
    .locals 0
    .param p1, "x0"    # Ljava/util/HashMap;
    .param p2, "x1"    # Ljava/util/HashMap$1;

    .prologue
    .line 822
    .local p0, "this":Ljava/util/HashMap$EntryIterator;, "Ljava/util/HashMap<TK;TV;>.EntryIterator;"
    invoke-direct {p0, p1}, Ljava/util/HashMap$EntryIterator;-><init>(Ljava/util/HashMap;)V

    return-void
.end method

# virtual methods
.method public bridge synthetic next()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 822
    .local p0, "this":Ljava/util/HashMap$EntryIterator;, "Ljava/util/HashMap<TK;TV;>.EntryIterator;"
    invoke-virtual {p0}, Ljava/util/HashMap$EntryIterator;->next()Ljava/util/Map$Entry;

    move-result-object v0

    return-object v0
.end method

.method public next()Ljava/util/Map$Entry;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map$Entry",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 824
    .local p0, "this":Ljava/util/HashMap$EntryIterator;, "Ljava/util/HashMap<TK;TV;>.EntryIterator;"
    invoke-virtual {p0}, Ljava/util/HashMap$EntryIterator;->nextEntry()Ljava/util/HashMap$HashMapEntry;

    move-result-object v0

    return-object v0
.end method


text:
{-|
Module: Rooks
Description: solution for the Attack Rooks problem

Provides a solution for the Attack Rooks problem (N-Pawn/Rook problem).
-}
module Rooks
    ( Piece(..)
    , Board
    , highestRooks
    ) where

import Data.Matrix
import qualified Data.Vector as Vec

-- | Define a Piece on the board
data Piece = Pawn -- ^ A blocking Pawn
           | Rook -- ^ A placed Rook
           | Empty -- ^ An empty slot
            deriving (Show, Eq)

-- | Defines a Board (synonym to Matrix Piece)
type Board = Matrix Piece

-- | Solves the problem for a given board
highestRooks :: Board -> Int
highestRooks b = rookCount b + highestRooks' b

highestRooks' :: Board -> Int
highestRooks' = (+1) . vecmax . Vec.map highestRooks' . derivedStates
    where vecmax v | Vec.null v = (-1)
                   | otherwise  = Vec.maximum v

rookCount :: Board -> Int
rookCount = Vec.length . Vec.filter (== Rook) . getMatrixAsVector

derivedStates :: Board -> Vec.Vector Board
derivedStates b = Vec.map (placeRook b) . Vec.filter (canPutRook b) $ positions b

positions :: Board -> Vec.Vector (Int, Int)
positions b = Vec.map (\(x,y) -> (x+1, y+1)) $ Vec.generate (n*n)
                (\i -> (i `mod` n, i `div` n))
                where n = nrows b

placeRook :: Board -> (Int, Int) -> Board
placeRook b p = setElem Rook p b

canPutRook :: Board -> (Int, Int) -> Bool
canPutRook b (row, col) = canPutRookInLine (getCol col b) row
                       && canPutRookInLine (getRow row b) col

canPutRookInLine :: Vec.Vector Piece -> Int -> Bool
canPutRookInLine line pos = (Vec.foldr (step pos)
                                       MayPut
                                       (Vec.zip (Vec.generate 3 (+1))  line)
                            ) `elem` [Ok, Put]

data FoldState = MayPut | CannotPut | Put | Ok | Invalid deriving (Eq)

step :: Int -> (Int, Piece) -> FoldState -> FoldState
step pos (i, Pawn) MayPut = if pos == i then Invalid else MayPut
step pos (i, Rook) MayPut = CannotPut
step pos (i, Empty) MayPut = if pos == i then Put else MayPut
step pos (i, Pawn) CannotPut = MayPut
step pos (i, Empty) CannotPut = if pos == i then Invalid else CannotPut
step pos (i, Pawn) Put = Ok
step pos (i, Rook) Put = Invalid
step pos (i, Empty) Put = Put
step pos (i, p) Ok = Ok
step pos (i, p) Invalid = Invalid
step _ _ _ = Invalid -- impossible, but we're making the function total anyway


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class ProfileRemovedEvent extends ProfileEvent
{
}


text:
package configs.syntax

import configs.ConfigMemorySize
import configs.testutil.instance.config._
import configs.testutil.instance.math._
import scalaprops.Property.{forAll, forAllG}
import scalaprops.{Gen, Properties, Property, Scalaprops}
import scalaz.syntax.std.boolean._

object RichConfigMemorySizeTest extends Scalaprops {

  private def forAllWith[A](gen: Gen[A])(f: (ConfigMemorySize, A) => Boolean): Property =
    forAllG(Gen[ConfigMemorySize], gen)(f)

  val + =
    forAll { (a: ConfigMemorySize, b: ConfigMemorySize) =>
      a + b == ConfigMemorySize(a.value + b.value)
    }

  val - =
    forAll { (a: ConfigMemorySize, b: ConfigMemorySize) =>
      (a.value >= b.value) --> {
        a - b == ConfigMemorySize(a.value - b.value)
      }
    }

  val `*` = {
    Properties.properties("by")(
      "non-neg value" -> forAllWith(nonNegativeBigInt) { (m, n) =>
        m * n == ConfigMemorySize(m.value * n)
      },
      "negative value" -> forAllWith(negativeBigInt) { (m, n) =>
        if (m == ConfigMemorySize.Zero)
          m * n == ConfigMemorySize.Zero
        else try {
          m * n
          sys.error(s"$m * $n")
        } catch {
          case e: IllegalArgumentException => e.getMessage.contains((m.value * n).toString)
        }
      })
  }

  val `/` = Properties.properties("by")(
    "positive value" -> forAllWith(positiveBigInt) { (m, n) =>
      m / n == ConfigMemorySize(m.value / n)
    },
    "negative value" -> forAllWith(negativeBigInt) { (m, n) =>
      if (m == ConfigMemorySize.Zero)
        m / n == ConfigMemorySize.Zero
      else try {
        m / n
        sys.error(s"$m / $n")
      } catch {
        case e: IllegalArgumentException => e.getMessage.contains(n.toString)
      }
    },
    "zero" -> forAll { a: ConfigMemorySize =>
      try {
        a / 0
        sys.error(s"$a / 0")
      } catch {
        case _: ArithmeticException => true
      }
    })

  val `<<` =
    forAllWith(Gen[Int]) { (m, n) =>
      (try {
        m.value << n
        false
      } catch {
        case _: ArithmeticException =>
          try {
            m << n
            sys.error(s"$m << $n")
          } catch {
            case _: ArithmeticException => true
          }
      }) ||
        (m << n) == ConfigMemorySize(m.value << n)
    }

  val `>>` =
    forAllWith(Gen[Int]) { (m, n) =>
      (try {
        m.value >> n
        false
      } catch {
        case _: ArithmeticException =>
          try {
            m >> n
            sys.error(s"$m >> $n")
          } catch {
            case _: ArithmeticException => true
          }
      }) ||
        (m >> n) == ConfigMemorySize(m.value >> n)
    }

}


text:
{{<govuk_template}}

{{$head}}
  {{>includes/elements_head}}
  {{>includes/elements_scripts}}
{{/head}}

{{$propositionHeader}}
  {{>includes/propositional_navigation3}}
{{/propositionHeader}}

{{$headerClass}}with-proposition{{/headerClass}}

{{$content}}

  <form action="hypocheck" method="get" class="form inline">

          Have you been seen within the last 12 months for your diabetic care?

            <input id="q6-a1" type="radio" name="q6-answer" value="Y" onclick="answer(this)">Yes

            <input id="q6-a2" type="radio" name="q6-answer" value="N" onclick="answer(this)">No

      <input id="continue" type="button" class="button" value="Continue" onclick="decision(this,'{{flow}}','{{conditions}}')" disabled="true"/>

Back

  </form>

{{/content}}

{{$bodyEnd}}
{{/bodyEnd}}

{{/govuk_template}}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
	<!-- 修改项目名称 -->
	<appender name="infoLog" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="Encoding" value="UTF-8" />
		<param name="File" value="/logs/lixavier-console-rest/info.log"/>
		<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p]-[%t]-[%l] %m%n" />
		</layout>
		<!--过滤器设置输出的级别 -->
		<filter class="org.apache.log4j.varia.LevelRangeFilter">
			<param name="levelMin" value="info" />
			<param name="levelMax" value="info" />
			<param name="AcceptOnMatch" value="true" />
		</filter>
	</appender>
	<appender name="warnLog" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="Encoding" value="UTF-8" />
		<param name="File" value="/logs/lixavier-console-rest/warn.log"/>
		<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p]-[%t]-[%l] %m%n" />
		</layout>
		<!--过滤器设置输出的级别 -->
		<filter class="org.apache.log4j.varia.LevelRangeFilter">
			<param name="levelMin" value="warn" />
			<param name="levelMax" value="warn" />
			<param name="AcceptOnMatch" value="true" />
		</filter>
	</appender>
	<appender name="errorLog" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="Encoding" value="UTF-8" />
		<param name="File" value="/logs/lixavier-console-rest/error.log"/>
		<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p]-[%t]-[%l] %m%n" />
		</layout>
		<!--过滤器设置输出的级别 -->
		<filter class="org.apache.log4j.varia.LevelRangeFilter">
			<param name="levelMin" value="error" />
			<param name="levelMax" value="error" />
			<param name="AcceptOnMatch" value="true" />
		</filter>
	</appender>
	<!--<appender class="org.apache.log4j.ConsoleAppender" name="stdout">-->
        <!--<layout class="org.apache.log4j.PatternLayout">-->
            <!--<param value="%d{yyyy-MM-dd HH:mm:ss} [%p]-[%t]-[%l] %m%n" name="ConversionPattern"/>-->
        <!--</layout>-->
    <!--</appender>-->
	<root>
		<!--<appender-ref ref="stdout"/>-->
		<appender-ref ref="infoLog" />
		<appender-ref ref="warnLog" />
		<appender-ref ref="errorLog" />
	</root>
</log4j:configuration>


text:
newparam(:name) do
  include EasyType

  isnamevar

  to_translate_to_resource do | raw_resource|
    sid = raw_resource.column_data('SID')
    service_name = raw_resource.column_data('NAME')
    "#{sid}/#{service_name}"
	end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/layoutTrainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/RelativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <RatingBar
            android:id="@+id/rbMark"
            style="?android:attr/ratingBarStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_gravity="start"
            android:isIndicator="true"
            android:max="3"
            android:numStars="3"
            android:rating="2"
            android:stepSize="1" />

        <TextView
            android:id="@+id/textProgress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_gravity="end"
            android:text="1/1" />

    </RelativeLayout>

    <LinearLayout
        android:id="@+id/ltChallenge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="@color/challenge_bg"
        android:orientation="vertical"
        android:padding="5dp" >

        <TextView
            android:id="@+id/textTrans"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@color/trainer_bg"
            android:gravity="center"
            android:padding="3dp"
            android:text="challenge"
            android:textColor="@color/trainer_fg"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/textWord"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@color/trainer_bg"
            android:ems="10"
            android:gravity="center"
            android:padding="3dp"
            android:text="guess"
            android:textColor="@color/trainer_fg"
            android:textSize="28sp" />

    </LinearLayout>

    <RelativeLayout
        android:id="@+id/rltIcons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp" >

        <ImageView
            android:id="@+id/imgHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:src="@drawable/ic_action_help"
            tools:ignore="ContentDescription" />

        <ImageView
            android:id="@+id/imgNext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:src="@drawable/ic_action_forward_dark" />

        <ImageView
            android:id="@+id/imgLife2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:src="@drawable/ic_action_favorite" />

        <ImageView
            android:id="@+id/imgLife1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@id/imgLife2"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:layout_toStartOf="@id/imgLife2"
            android:layout_toLeftOf="@id/imgLife2"
            android:src="@drawable/ic_action_favorite" />

        <ImageView
            android:id="@+id/imgLife3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@id/imgLife2"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:layout_toEndOf="@id/imgLife2"
            android:layout_toRightOf="@id/imgLife2"
            android:src="@drawable/ic_action_favorite" />
    </RelativeLayout>

    <android.support.v7.widget.GridLayout
        android:id="@+id/gridKeyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:columnCount="11"
        app:rowCount="4" >

        <Button
            android:id="@+id/btnEnter"
            style="?android:attr/buttonStyle"
            app:layout_column="9"
            app:layout_columnSpan="2"
            app:layout_row="2"
            app:layout_gravity="center"
            app:layout_columnWeight="1"
            app:layout_rowWeight="1"
            android:minHeight="42dp"
            android:minWidth="50dp"
            android:text="OK"/>

    </android.support.v7.widget.GridLayout>

</LinearLayout>


text:
package main

import (
	"flag"
	"fmt"
	"kf-operator/pkg/release/commandtools"
	"kf-operator/pkg/release/filetools"
	"kf-operator/pkg/release/stringtools"
	"log"
	"os"
	"path/filepath"
	"regexp"
	"strings"
)

const (
	// gcsHTTP - HTTP endpoint for Google Cloud Storage
	gcsHTTP = "https://storage.googleapis.com"
	// tarTmpFile - Temporary tarball file name
	tarTmpFile = "vendor.tar.gz"
	// gcrPathRegExp - GCR Path Extended Regular Expression
	gcrPathRegExp = `((us|eu|asia).)?gcr.io/[^/]*`
)

// INTERNAL_BIN - Internal images with vendored source tarball
var internalBinList = [...]string{"manager"}

func getEnvironmentVariable(variable string, mandatory bool) string {
	value := os.Getenv(variable)
	if value == "" && mandatory {
		log.Fatalf("%q environment variable is empty", variable)
	}
	return value
}

func generateImageLinks(images []string, linkPathTemplate string, originPath string) {
	for _, image := range images {
		filetools.CreateFileLinks(
			fmt.Sprintf(originPath, tarTmpFile),
			fmt.Sprintf(linkPathTemplate, image))
	}
}

func exportEnvironmentVariables(gcrPath, localAddonYaml, addonYaml string) {
	// Resolve the config.
	os.Setenv("KO_DOCKER_REPO", strings.TrimSuffix(gcrPath, "/"))

	// Export the LOCAL_ADDON_YAML so that other script, such as upgrade-test's build script, can use it to locate the local yaml.
	// https://source.corp.google.com/cloud-run-on-gke/test/prow/upgrade-testing/build-infra/build.sh;l=54-56;rcl=c7f16fd03f9666422724cbbbc0522986ce70fa37
	os.Setenv("LOCAL_ADDON_YAML", localAddonYaml)

	os.Setenv("ADDON_YAML", addonYaml)
}

func verifyYamlFilesContent(localCrpYaml string, crpTemplatedRepoString string, localCrpNonTemplatedYaml string) {
	log.Printf("============= Verifying Yaml content =============")
	// Check to confirm the produced templated yaml has at least 1 image key line (and cache result in variable)
	localCrpYamlLines := stringtools.ReadLines(localCrpYaml)
	localCrpYamlValidLines := make([]string, 0)
	imageRe := regexp.MustCompilePOSIX("[Ii]mage: ")
	for index, line := range localCrpYamlLines {
		if imageRe.MatchString(line) {
			localCrpYamlValidLines = append(localCrpYamlValidLines, fmt.Sprint(index)+":"+line)
		}
	}

	if len(localCrpYamlValidLines) == 0 {
		log.Fatalf("Found zero image keys in %q. Failing...", localCrpYaml)
	}

	for _, line := range localCrpYamlValidLines {
		if !strings.Contains(line, crpTemplatedRepoString) {
			log.Fatalf("Expected all images to be templated in %q, but some still exist:\n%s",
				localCrpYaml, line)
		}
	}

	localCrpNonTemplatedYamlLines := stringtools.ReadLines(localCrpNonTemplatedYaml)
	gcrPathRegExpRe := regexp.MustCompilePOSIX(gcrPathRegExp)
	for _, line := range localCrpNonTemplatedYamlLines {
		if gcrPathRegExpRe.MatchString(line) || imageRe.MatchString(line) {
			log.Fatalf("Expected no images in non templated yaml, but some exist:\n%v",
				localCrpNonTemplatedYamlLines)
		}
	}
}

func generateReleases(development bool, gcrPath, gcsPath, version string) {
	// Location of the config folder where the yaml files are located in the repository
	configPath := "config"
	tag := fmt.Sprintf("v%s", version)
	// Location of relevant files. The names are purely for humans to simplify development.
	localProdAddonYaml := filetools.CreateTempFile("serverless-*.yaml")

	// Upload the add-on manifest.
	remoteName := func(name string) string {
		return fmt.Sprintf("%s/cloudrun/%s-%s.yaml", gcsPath, name, version)
	}
	prodAddonYaml := remoteName("serverless-operator")

	// Export environment variables for outer scope scripts
	// TODO: This should be removed in favor of arguments and returned values
	exportEnvironmentVariables(gcrPath, localProdAddonYaml, prodAddonYaml)

	koResolver := commandtools.NewKoResolver()

	if development {
		// Meant for development/test installation.
		// Use GCR staging path for Istio images, this is to ensure when the Istio
		// images are under embargo, we can still apply the yaml.
		log.Printf("============= Processing Development/Test Yaml =============")
		koResolver.Resolve(
			configPath,
			tag,
			localProdAddonYaml,
			version)

		log.Printf("============= Uploading Yaml files =============")
		commandtools.RunGsCpUtil(
			localProdAddonYaml,
			"gs://"+prodAddonYaml)

		log.Printf("All yaml files generated and uploaded successfully")
	} else {
		//// PROD YAML
		// Meant for production. Uses production GCR path [gke.gcr.io], with
		// addonmanager label
		log.Printf("============= Processing Prod Yaml =============")

		operatorYamlDirectory := filetools.CreateTempDirectory("")
		filetools.Copy(filepath.Join(configPath, "*.yaml"), operatorYamlDirectory)
		// Remove CRDs as they are installed separately from the hub controller.
		filetools.RemoveAll(filepath.Join(operatorYamlDirectory, "200-cloudrun-crd.yaml"))
		filetools.RemoveAll(filepath.Join(operatorYamlDirectory, "200-kfsystem-crd.yaml"))
		// Remove CR as it is installed by the user to the cluster.
		filetools.RemoveAll(filepath.Join(operatorYamlDirectory, "999-cloud-run-cr.yaml"))

		koResolver.Resolve(
			operatorYamlDirectory,
			tag,
			localProdAddonYaml,
			version)

		log.Printf("Uploading to %s", prodAddonYaml)
		commandtools.RunGsCpUtil(
			localProdAddonYaml,
			"gs://"+prodAddonYaml)
	}
}

func cleanUpResources() {
	// Clean up internal images symlinks
	for _, bin := range internalBinList {
		filetools.RemoveAll(fmt.Sprintf("cmd/%s/kodata/vendor.tar.gz", bin))
	}

	// Clean up tarball, to avoid checking in the tarball
	filetools.RemoveAll(tarTmpFile)
}

func main() {
	o := options{}
	o.addFlags()
	flag.Parse()
	if err := o.mustProcessFlags(); err != nil {
		log.Fatal(err)
	}

	// Make sure we're not in the GOPATH as that causes ko and go to have some serious caching issues.
	filetools.MakeTempModuleOutsideGoPath("./")

	// Create tar file for vendored source, needed for license compliance
	filetools.CreateTarballFile(tarTmpFile, "vendor/")

	// Add symlink for internal images with vendored source tarball
	generateImageLinks(
		internalBinList[:],
		"cmd/%s/kodata/vendor.tar.gz",
		"../../../%s",
	)

	// Generate releases
	generateReleases(o.development, o.gcrPath, o.gcsPath, o.version)

	// Clean up
	cleanUpResources()
}


text:
angular.module('angularify.semantic', ['angularify.semantic.accordion',
	                                   'angularify.semantic.checkbox',
	                                   'angularify.semantic.dimmer',
	                                   'angularify.semantic.dropdown',
	                                   'angularify.semantic.modal',
	                                   'angularify.semantic.popup',
	                                   'angularify.semantic.rating',
	                                   'angularify.semantic.sidebar',
	                                   'angularify.semantic.wizard']);

'use strict';

angular.module('angularify.semantic.accordion', [])

.controller('AccordionController', ['$scope', function($scope){
    $scope.accordions = [];

    this.add_accordion = function(scope) {
        $scope.accordions.push(scope);

        var _this = this;
        scope.$on('$destroy', function (event) {
            _this.remove_accordion(scope);
        });

        return $scope.accordions;
    }

    this.closeAll = function(scope) {
        var i = 0;
        var isCloseAll = false;

        var index = $scope.accordions.indexOf(scope);

        for (i in $scope.accordions){
            if ($scope.accordions[i].close)
                isCloseAll = true;
        }

        if (isCloseAll == true){
            for (i in $scope.accordions){
                if (i !== index) {
                    $scope.accordions[i].active = false;
                }
            }

            return true;
        }

        return false;

    }

    this.remove_accordion = function(scope) {
      var index = $scope.accordions.indexOf(scope);
      if ( index !== -1 ) {
        $scope.accordions.splice(index, 1);
      }
    }

    this.is_close_all = function() {
        var i = 0;

        for (i in $scope.accordions){
            if ($scope.accordions[i].close == 'true')
                return true;
        }
        return false;
    }
}])

.directive('accordion', function () {
    return {
        restrict: 'E',
        replace: true,
        transclude: true,
        controller: 'AccordionController',
        scope: {
            'close': '@'
        },
        template: "

",
        link: function(scope, element, attrs, AccordionController) {

            if(typeof attrs.styled  !== 'undefined') {
                element.addClass('styled');
            }

            AccordionController.add_accordion(scope);
        }
    }
})

.directive('accordionGroup', function() {
    return {
        restrict: 'E',
        replace: true,
        transclude: true,
        scope : {
            title:  '@',
            open: '@'
        },
        require:'^accordion',
        template: "
\

 \
                      \
                     {{ title }} \

 \

 \

 \

",

        link: function(scope, element, attrs, AccordionController) {

            // set up active
            scope.active = attrs.open === 'true';

            // Add the accordion to the controller
            AccordionController.add_accordion(scope);

            // Click handler
            scope.click_on_accordion_tab = function(){

                // class all first of all
                AccordionController.closeAll(scope);

                // Swap the active state
                scope.active = !scope.active;

                // Add animation to the accordion group content
                element.children().last().slideToggle();
            };
        }
    };
});
'use strict';

angular.module('angularify.semantic.checkbox', [])
.directive('checkbox', function() {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    scope: {
      checked: '&?',
      disabled: '&?',
      ngModel: '=ngModel'
    },
    controller: function() {
      var vm = this;

      // TODO: assert this is usefull ?
      // if(angular.isUndefined(vm.ngModel)) { vm.ngModel = !!vm.ngModel; }

      if(angular.isFunction(vm.checked)) { vm.ngModel = !!vm.checked(); }

      vm.toggle = function() {
        if(angular.isFunction(vm.disabled) && vm.disabled()) return;
        vm.ngModel = !vm.ngModel;
      }
    },
    controllerAs: 'vm',
    bindToController: true,
    require: 'ngModel',
    template: '
' +
      '<input type="checkbox" ng-model="vm.ngModel" ng-disabled="vm.disabled()"/>' +
      '' +
      '
',
    link: function() { }
  };
});

'use strict';

angular.module('angularify.semantic.dimmer', [])

.directive("pageDimmer", function () {
    return {
        restrict: 'E',
        replace: true,
        transclude: true,
        scope : {
            show : "=?",
            model: '=ngModel'
        },
        template: "
" +
                    "
" +
                      "

" +
                    "
" +
                  "
",
        link : function(scope, element, attrs, ngModel) {

            if (scope.show == true) {
                scope.dimmer_class = 'ui page active dimmer';
            }
            else {
                scope.show = false;
                scope.dimmer_class = 'ui page disable dimmer';
            }

            //
            // Click on dimmer handler
            //
            scope.click_on_dimmer = function(){
                scope.model = false;
                scope.dimmer_class = 'ui page dimmer';
            }

            //
            // Watch for the ng-model changing
            //
            scope.$watch('model', function(val){
                if (val == false || val == undefined)
                    return;
                else
                    scope.dimmer_class = 'ui page active dimmer';
            });
        }
    };
});

'use strict';

angular.module('angularify.semantic.dropdown', [])
  .controller('DropDownController', ['$scope',
    function($scope) {
      $scope.options = [];

      this.add_option = function(title, value){
        $scope.options.push({'title': title, 'value': value});
        if (value == $scope.model){
          this.update_title(value)
        };
      };

      this.remove_option = function(title, value){
        for (var index in $scope.options)
          if ($scope.options[index].value == value &&
            $scope.options[index].title == title){

            $scope.options.splice(index, 1);
            // Remove only one item
            break;
          };
      };

      this.update_model = function (title, value) {
        if ($scope.model !== value)
          $scope.model = value;
      };

      this.update_title = function (value) {
        var changed = false;

        for (var index in $scope.options)
          if ($scope.options[index].value == value){
            $scope.title = $scope.options[index].title;
            changed = true;
          }

        if (changed){
          $scope.text_class = 'text';
        } else{
          $scope.title = $scope.original_title;
          $scope.text_class = 'default text';
        }
      };

    }
  ])

.directive('dropdown', function() {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    controller: 'DropDownController',
    scope: {
      title: '@',
      open: '@',
      model: '=ngModel'
    },
    template: '
' +
      '
{{ title }}
' +
      '' +
      '
' +
      '
' +
      '
',
    link: function(scope, element, attrs, DropDownController) {
      scope.dropdown_class = 'ui selection dropdown';
      scope.menu_class = 'menu transition hidden';
      scope.text_class = 'default text';
      scope.original_title = scope.title;

      if (scope.open === 'true') {
        scope.is_open = true;
        scope.dropdown_class = scope.dropdown_class + ' active visible';
        scope.menu_class = scope.menu_class + ' visible';
      } else {
        scope.is_open = false;
      }

      /*
       * Watch for ng-model changing
       */
      scope.element = element;
      scope.$watch('model', function (value) {
        // update title or reset the original title if its empty
        DropDownController.update_title(value);
      });

      /*
       * Click handler
       */
      element.bind('click', function() {
        if (scope.is_open === false) {
          scope.$apply(function() {
            scope.dropdown_class = 'ui selection dropdown active visible';
            scope.menu_class = 'menu transition visible';
          });
        } else {
          scope.$apply(function() {
            scope.dropdown_class = 'ui selection dropdown';
            scope.menu_class = 'menu transition hidden';
          });
        }
        scope.is_open = !scope.is_open;
      });
    }
  };
})

.directive('dropdownGroup', function() {
  return {
    restrict: 'AE',
    replace: true,
    transclude: true,
    require: '^dropdown',
    scope: {
      title: '=title',
      value: '=value'
    },
    template: '
{{ item_title }}
',
    link: function(scope, element, attrs, DropDownController) {

      // Check if title= was set... if not take the contents of the dropdown-group tag
      // title= is for dynamic variables from something like ng-repeat {{variable}}
      if (scope.title === undefined) {
        scope.item_title = attrs.title || element.children()[0].innerHTML;
      } else {
        scope.item_title = scope.title;
      }
      if (scope.value === undefined) {
        scope.item_value = attrs.value || scope.item_title;
      } else {
        scope.item_value = scope.value;
      }

      // Keep this option
      DropDownController.add_option(scope.item_title, scope.item_value);

      //
      // Menu item click handler
      //
      element.bind('click', function() {
        DropDownController.update_model(scope.item_title, scope.item_value);
      });

      scope.$on('$destroy', function(){
        DropDownController.remove_option(scope.item_title, scope.item_value);
      });

    }
  };
});
'use strict';

angular.module('angularify.semantic.modal', [])

.directive('modal', function () {
    return {
        restrict: 'E',
        replace: true,
        transclude: true,
        require: 'ngModel',
        template: '

',
        link: function (scope, element, attrs, ngModel) {
          element.modal({
            onHide: function () {
              ngModel.$setViewValue(false);
            }
          });
          scope.$watch(function () {
            return ngModel.$modelValue;
          }, function (modelValue){
            element.modal(modelValue ? 'show' : 'hide');
          });
        }
    }
});

'use strict';

angular.module('angularify.semantic.popup', [])

.directive('popup', function ($document) {
    return {
        restrict: "A",
        scope : {
            popup : "@"
        },
        link: function(scope, element, attrs) {
            var class_name = '';
            // convert to json
            var popup_meta_data = eval('(' + scope.popup + ')');

            var title = popup_meta_data['title'];
            if (title == undefined)
                title = '';

            var content = popup_meta_data['content'];
            if (content == undefined)
                content = '';

            var position = popup_meta_data['position'];
            if (position == undefined)
                position = 'top';

            var size = popup_meta_data['size'];
            if (size == undefined)
                size = 'small';

            if (position == 'left') {
                class_name = 'ui popup left center transition visible ' + size;
            } else if (position == 'right') {
                class_name = 'ui popup right center transition visible ' + size;
            } else if (position == 'bottom') {
                class_name = 'ui popup bottom center transition visible ' + size;
            } else {
                class_name = 'ui popup top center transition visible ' + size;
            }

            //
            // Get element X/Y of left corner
            //
            function getPos(ele){
                    var x = 0;
                    var y = 0;
                    while(true){
                        x += ele.offsetLeft;
                        y += ele.offsetTop;
                        if(ele.offsetParent === null)
                            break;
                        ele = ele.offsetParent;
                    }
                    return [x, y];
            }

            var current_element_position_top_left = getPos(element[0]);
            var current_element_height = element[0].offsetHeight;
            var current_element_width  = element[0].offsetWidth;

            //
            // Remove element by class name
            //
            NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
                for(var i = 0, len = this.length; i < len; i++) {
                    if(this[i] && this[i].parentElement) {
                        this[i].parentElement.removeChild(this[i]);
                    }
                }
            }

            //
            // Handle mouse over
            //
            element.bind('mouseenter', function(){
                var html = '

' + title +'

' + content + '

';

                angular.element(element[0]).append(html);

                var popupHeight = document.getElementById('my-popup').clientHeight;
                var popupWidth  = document.getElementById('my-popup').clientWidth;

                if (position == 'left') {
                    document.getElementById('my-popup').style.top = current_element_position_top_left[1] + (current_element_height / 2) - (popupHeight / 2) + 'px';
                    document.getElementById('my-popup').style.right = 'auto';
                    document.getElementById('my-popup').style.left = current_element_position_top_left[0] - popupWidth - 10 + 'px';
                    document.getElementById('my-popup').style.bottom = 'auto';
                    document.getElementById('my-popup').style.display = 'inline-block';
                } else if (position == 'right') {
                    document.getElementById('my-popup').style.top = current_element_position_top_left[1] + (current_element_height /  2) - (popupHeight / 2) + 'px';
                    document.getElementById('my-popup').style.right = 'auto';
                    document.getElementById('my-popup').style.left = current_element_position_top_left[0] + current_element_width + 'px';
                    document.getElementById('my-popup').style.bottom = 'auto';
                    document.getElementById('my-popup').style.display = 'inline-block';
                } else if (position == 'bottom') {
                    document.getElementById('my-popup').style.top = current_element_position_top_left[1] + current_element_height + 'px';
                    document.getElementById('my-popup').style.left = current_element_position_top_left[0] + (current_element_width / 2) - (popupWidth / 2) + 15 + 'px';
                    document.getElementById('my-popup').style.right = 'auto';
                    document.getElementById('my-popup').style.bottom = 'auto';
                    document.getElementById('my-popup').style.display = 'inline-block';
                } else {
                    document.getElementById('my-popup').style.top = current_element_position_top_left[1] - popupHeight - 10 + 'px';
                    document.getElementById('my-popup').style.left = current_element_position_top_left[0] + (current_element_width / 2) - (popupWidth / 2) + 18 + 'px';
                    document.getElementById('my-popup').style.right = 'auto';
                    document.getElementById('my-popup').style.bottom = 'auto';
                    document.getElementById('my-popup').style.display = 'inline-block';
                }
            });

            //
            // Handle mouse leave
            //
            element.bind('mouseleave', function(){
                document.getElementsByClassName("ui popup bottom center transition visible").remove();
                if (document.getElementById('my-popup') !== null)
                    document.getElementById('my-popup').remove();
            });
        }
    }
});
'use strict';

angular
  .module('angularify.semantic.sidebar', [])
  .directive('sidebar', sidebar)
  .directive('sidebarLink', sidebarLink)
  .directive('sidebarItem', sidebarItem)
  .directive('sidebarItemGroup', sidebarItemGroup);

function sidebar() {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    template: '

',
    scope: {
      buttonClass: '@'
    },
    link: function (scope, element, attrs) {
      element.sidebar('attach events', scope.buttonClass, 'show');
    }
  };
}

function sidebarItemGroup() {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    template: '
' +
                '
{{ title }}
' +
                '

' +
              '
',
    scope: {
      title: '@'
    }
  };
}

function sidebarItem() {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    template: '

'
  };
}

function sidebarLink() {
  return {
    restrict: 'E',
    replace: true,
    template: '' +
                '' +
                '{{ title }}' +
              '',
    scope: {
      title: '@',
      icon: '@',
      href: '@'
    }
  };
}
'use strict';

angular.module('angularify.semantic.rating', [])

.directive('rating', function(){
    return {
        restrict: "E",
        replace: true,
        transclude: true,
        scope: {
            id: "@",
            size: "@",
            type: "@",
            model : '=ngModel'
        },
        template: '
' +
                     '' +
                     '' +
                     '' +
                     '' +
                     '' +
                   '
',
        link: function(scope, element, attrs){
            if (scope.model == undefined)
                scope.model = 0;

            if (scope.model < 1 && scope.model > 5)
                scope.model = 0;

            // is rating already checked
            var checked = false;

            //
            // Set up icon type
            //
            if (scope.type == undefined)
                scope.type = 'star';

            //
            // Set up size
            //
            if (scope.size == undefined)
                scope.div_class = 'ui rating ' + scope.type;
            else if (scope.size == 'small')
                scope.div_class = 'ui small ' + scope.type + ' rating';
            else if (scope.size == 'large')
                scope.div_class = 'ui large ' + scope.type + ' rating';
            else if (scope.size == 'huge')
                scope.div_class = 'ui huge ' + scope.type + ' rating';

            //
            // set up icon class
            //
            scope.icon_class = 'icon';

            //
            // Handle mouse enter
            //
            scope.mouse_enter = function(icon_index){
                if (checked == true)
                    return;

                var i = 1;
                for (i; i <= icon_index; i++){
                    document.getElementById(scope.id + i).className = 'icon active';
                }

                return;
            };

            //
            // Handle mouse leave
            //
            scope.mouse_leave = function(icon_index){
                if (checked == true)
                    return;

                var i = 1;
                for (i; i <= 5; i++){
                    document.getElementById(scope.id + i).className = 'icon';
                }

                return;
            };

            //
            // Handle click
            //
            scope.click = function(icon_index, mode){
                var i = 1;
                for (i; i <= icon_index; i++){
                    document.getElementById(scope.id + i).className = 'icon active';
                }

                if (icon_index !== 0)
                    checked = true;

                return;
            };

            //
            // Watch for model
            //
            scope.$watch('model', function(val){
                scope.click(val);
            });
        }
    };
});

/* globals _:false */
'use strict';
angular.module('angularify.semantic.wizard', [])

.controller('WizardController', ['$scope',
    function($scope) {
        $scope.steps = [];
        $scope.currentStep = null;
        $scope.stepsLength = '';

        $scope.$watch('currentStep', function (step) {
            if (!step) return;
            var stepTitle = $scope.selectedStep.title;
            if ($scope.selectedStep && stepTitle !== $scope.currentStep) {
                $scope.goTo($scope.steps.filter(function (step) {
                    return step.title ==- $scope.currentStep;
                })[0]);
            }
        });

        $scope.$watch('[editMode, steps.length]', function () {
            var editMode = $scope.editMode;
            if (editMode === undefined || editMode === null) return;

            if (editMode) {
                $scope.steps.forEach(function (step) {
                    step.completed = true;
                });
            }
        }, true);

        this.addStep = function (step) {
            $scope.steps.push(step);
            if ($scope.steps.length === 1) {
                $scope.goTo($scope.steps[0]);
            }
        };

        $scope.goTo = function (step) {
            unselectAll();
            $scope.selectedStep = step;

            if ($scope.currentStep !== undefined) {
                $scope.currentStep = step.title;
            }

            step.selected = true;
            $scope.$emit('wizard:stepChanged', {
                step: step,
                index: $scope.steps.indexOf(step)
            });
        };

        function unselectAll() {
            $scope.steps.forEach(function (step) {
                step.selected = false;
            });
            $scope.selectedStep = null;
        }

        this.next = function () {
            var index = $scope.steps.indexOf($scope.selectedStep);
            $scope.selectedStep.completed = true;
            if (index === $scope.steps.length - 1) {
                this.finish();
            } else {
                $scope.goTo($scope.steps[index + 1]);
            }
        };

        this.goTo = function (step) {
            var stepTo;

            if (angular.isNumber(step)) {
                stepTo = $scope.steps[step];
            } else {
                stepTo = $scope.steps.filter(function (step) {
                    return step.title === step;
                })[0];
            }
            $scope.goTo(stepTo);
        };

        this.finish = function() {
            if ($scope.onFinish) {
                $scope.selectedStep.completed = true;
                $scope.onFinish();
            }
        };

        this.cancel = this.previous = function() {
            var index = $scope.steps.indexOf($scope.selectedStep);
            if (index === 0) {
                throw new Error('Cant go back. Its already in step 0');
            } else {
                $scope.goTo($scope.steps[index - 1]);
            }
        };

        $scope.getStatus = function (step) {
          var statusClass = [];

          if (step.selected)
            statusClass.push('active');
          if (!step.selected && !step.completed)
            statusClass.push('disabled');
          if (step.completed)
            statusClass.push('completed');

          return statusClass;
        };
    }
])
    .directive('wizard', function() {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            scope: {
                fullwidth: "@",
                currentStep: '=?',
                onFinish: '&',
                editMode: '=',
                name: '@'
            },
            controller: 'WizardController',
            template: '
' +
                        '
' +
                          '
' +
                            '{{step.title}}' +
                          '
' +
                        '
' +
                        '

' +
                        '

' +
                      '
',
            link: function(scope, element, attrs, WizardController) {
                if (scope.fullwidth === 'true') {
                    var widthmatrix = {
                        0: '',
                        1: 'one',
                        2: 'two',
                        3: 'three',
                        4: 'four',
                        5: 'five',
                        6: 'six',
                        7: 'seven',
                        8: 'eight',
                        9: 'nine',
                        10: 'ten'
                    };
                    scope.stepsLength = widthmatrix[scope.steps.length];
                }

            }
        };
    })
    .directive('wizardPane', function() {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            require: '^wizard',
            controller: 'WizardController',
            scope: {
                title: '@'
            },
            template: '

',
            link: function(scope, element, attrs, WizardController) {
                WizardController.addStep(scope);
            }
        };
    });

function wizardButtonDirective(action) {
    angular.module('angularify.semantic.wizard')
        .directive(action, function () {
            return {
                restrict: 'A',
                replace: false,
                require: '^wizard',
                link: function ($scope, $element, $attrs, wizard) {
                    $scope.noMargin = { margin: 0 };
                    $element.on('click', function (e) {
                        e.preventDefault();
                        $scope.$apply(function () {
                            $scope.$eval($attrs[action]);
                            wizard[action.replace('wz', '').toLowerCase()]();
                        });
                    });
                }
            };
        });
}

wizardButtonDirective('wzNext');
wizardButtonDirective('wzPrevious');
wizardButtonDirective('wzFinish');
wizardButtonDirective('wzCancel');


text:
'use strict';

//Purchases service used for communicating with the purchases REST endpoints
angular.module('companies').factory('CompanyPurchases', ['$resource',
  function ($resource) {
    return $resource('api/company-purchases/:compurId', {
      companyId: '@_id'
    }, {
      update: {
        method: 'PUT'
      }
    });
  }
]);


text:
  Saint-Gervais-de-Vic est
       un village
       géographiquement positionné dans le département de Sarthe en Pays de la Loire. Elle comptait 387 habitants en 2008.

Si vous pensez emmenager à Saint-Gervais-de-Vic, vous pourrez aisément trouver une maison à acheter.

Le parc d'habitations, à Saint-Gervais-de-Vic, était réparti en 2011 en un appartements et 198 maisons soit
 un marché plutôt équilibré.

À proximité de Saint-Gervais-de-Vic sont positionnées géographiquement les communes de
La Chapelle-Huon à 3 km, 525 habitants,
Cellé à 6 km, 258 habitants,
Montaillé située à 6 km, 541 habitants,
Sainte-Cérotte à 3 km, 323 habitants,
Savigny-sur-Braye située à 5 km, 2 196 habitants,
Saint-Calais à 3 km, 3 589 habitants,
 entre autres. De plus, Saint-Gervais-de-Vic est située à seulement 27 km de Vendôme.

La ville offre quelques  équipements sportifs, elle dispose, entre autres, de un terrain de sport et une boucle de randonnée.


text:
using System;
using System.Threading;

public class Test {

	static int csum = 0;

	public static void test_callback (object state) {
		int workerThreads;
		int completionPortThreads;
		ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
		Console.WriteLine("test_casllback:" + state + "ATH: " + workerThreads);
		Thread.Sleep (10);

		Interlocked.Increment (ref csum);
	}

	public static int Main () {
		int workerThreads;
		int completionPortThreads;
		int runs = 10;

		ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
		Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);

		ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
		Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);

		for (int i = 0; i < runs; i++) {
			ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST1 " + i);
			ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST2 " + i);
			ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST3 " + i);
			ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST4 " + i);
			ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST5 " + i);

			do {
				ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
				if (workerThreads == 0)
					Thread.Sleep (100);
			} while (workerThreads == 0);

			ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
			Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
		}

		while (csum < (runs * 5)) {
			Thread.Sleep (100);

		}

		Console.WriteLine ("CSUM: " + csum);

		if (csum != (runs * 5))
			return 1;

		return 0;
	}
}


text:
using System.Threading.Tasks;
using Microsoft.Owin;

namespace OpenRasta.Owin
{
    /// <summary>
    /// An application delegate.
    /// </summary>
    /// <param name="env">The environment properties.</param>
    /// <returns>An awaitable Task that signals the end of the processing.</returns>
    public delegate Task AppFunc(IOwinContext env);
}


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Phonegap Meetup Vancouver</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/main.css">
		<link rel="stylesheet" href="css/theme/night.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Command Line Interface

						Presentation by Benn Mapes / @bennmapes

Why the CLI?

 Because it's easy,

 How easy?

						 Thanks @chews

The Hard Part

							There are a few drawbacks to this simplified interface :

 - Getting away from the stardard platform IDE's (this could also be a plus!)

 - Debugging can be hard but there tools to help (ripple emulator).

 - Cutomization of resources (icons, splashscreens etc), we're working on this.

 - Using the config.xml to describe platform specific settings can be complicated.

 The more we use the cli the better it will get.

phonegap

corodva

Log any issues you find on Jira if they arn't already there

						https://issues.apache.org/jira/browse/CB

 Token Beer Slide

The Easy Part

							Using the CLI we can build and run applications with just a few lines in the terminal.

Create

phonegap

corodva

Build

phonegap

corodva

Run

phonegap

corodva

corodova-cli vs phonegap-cli

							phonegap-cli :

 - require('cordova-cli')

 - require('phonegap-build-cli')

Local

Remote

Plugins

 Easy right?

THE END

Questions?

						By Benn Mapes


text:
package org.apache.harmony.security.x509;

@com.francetelecom.rd.stubs.annotation.ClassDone(0)
public final class NameConstraints
  extends ExtensionValue{
  // Fields

  public static final org.apache.harmony.security.asn1.ASN1Sequence ASN1 = null;

  // Constructors

  public NameConstraints(GeneralSubtrees arg1, GeneralSubtrees arg2){
    super();
  }
  private NameConstraints(GeneralSubtrees arg1, GeneralSubtrees arg2, byte [] arg3){
    super();
  }
  // Methods

  public static NameConstraints decode(byte [] arg1) throws java.io.IOException{
    return (NameConstraints) null;
  }
  public byte [] getEncoded(){
    return (byte []) null;
  }
  public void dumpValue(java.lang.StringBuilder arg1, java.lang.String arg2){
  }
  public boolean isAcceptable(java.security.cert.X509Certificate arg1){
    return false;
  }
  public boolean isAcceptable(java.util.List<GeneralName> arg1){
    return false;
  }
}


text:
loadstatustext = "

";
function ajaxLoad(url,id)
{
   if (document.getElementById) {
	   var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	   }
	   if (x)
		   {
	   x.onreadystatechange = function()
			   {
				   el = document.getElementById(id);
				   el.innerHTML = loadstatustext;
		   if (x.readyState == 4 && x.status == 200)
				   {
				   el.innerHTML = x.responseText;
			   }
			   }
		   x.open("GET", url, true);
		   x.send(null);
		   }
}
function Weather(value)
{
		ajaxLoad('Weather.php?id='+value,'content_Weather');
}


text:
<?php
/**
 * Class Minify_HTML
 * @package Minify
 */
/**
 * Compress HTML
 *
 * This is a heavy regex-based removal of whitespace, unnecessary comments and
 * tokens. IE conditional comments are preserved. There are also options to have
 * STYLE and SCRIPT blocks compressed by callback functions.
 *
 * A test suite is available.
 *
 * @package Minify
 * @author Stephen Clay <steve@mrclay.org>
 */

namespace Lyanna\Foundation;

class MinifyHTML {
    /**
     * @var boolean
     */
    protected $_jsCleanComments = true;
    /**
     * "Minify" an HTML page
     *
     * @param string $html
     *
     * @param array $options
     *
     * 'cssMinifier' : (optional) callback function to process content of STYLE
     * elements.
     *
     * 'jsMinifier' : (optional) callback function to process content of SCRIPT
     * elements. Note: the type attribute is ignored.
     *
     * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
     * unset, minify will sniff for an XHTML doctype.
     *
     * @return string
     */
    public static function minify($html, $options = array()) {
        $min = new self($html, $options);
        return $min->process();
    }
    /**
     * Create a minifier object
     *
     * @param string $html
     *
     * @param array $options
     *
     * 'cssMinifier' : (optional) callback function to process content of STYLE
     * elements.
     *
     * 'jsMinifier' : (optional) callback function to process content of SCRIPT
     * elements. Note: the type attribute is ignored.
     *
     * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block
     *
     * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
     * unset, minify will sniff for an XHTML doctype.
     */
    public function __construct($html, $options = array())
    {
        $this->_html = str_replace("\r\n", "\n", trim($html));
        if (isset($options['xhtml'])) {
            $this->_isXhtml = (bool)$options['xhtml'];
        }
        if (isset($options['cssMinifier'])) {
            $this->_cssMinifier = $options['cssMinifier'];
        }
        if (isset($options['jsMinifier'])) {
            $this->_jsMinifier = $options['jsMinifier'];
        }
        if (isset($options['jsCleanComments'])) {
            $this->_jsCleanComments = (bool)$options['jsCleanComments'];
        }
    }
    /**
     * Minify the markeup given in the constructor
     *
     * @return string
     */
    public function process()
    {
        if ($this->_isXhtml === null) {
            $this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
        }

        $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
        $this->_placeholders = array();
        $this->_html = str_replace("\n","", $this->_html);
        // replace SCRIPTs (and minify) with placeholders
        $this->_html = preg_replace_callback(
            '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
            ,array($this, '_removeScriptCB')
            ,$this->_html);

        // replace STYLEs (and minify) with placeholders
        $this->_html = preg_replace_callback(
            '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i'
            ,array($this, '_removeStyleCB')
            ,$this->_html);

        // remove HTML comments (not containing IE conditional comments).
        $this->_html = preg_replace_callback(
            '/<!--([\\s\\S]*?)-->/'
            ,array($this, '_commentCB')
            ,$this->_html);

        // replace PREs with placeholders
        $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
            ,array($this, '_removePreCB')
            ,$this->_html);

        // replace TEXTAREAs with placeholders
        $this->_html = preg_replace_callback(
            '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
            ,array($this, '_removeTextareaCB')
            ,$this->_html);

        // trim each line.
        // @todo take into account attribute values that span multiple lines.
        $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html);

        // remove ws around block/undisplayed elements
        $this->_html = preg_replace('/\\s+(<\\/?(?:area|base(?:font)?|blockquote|body'
            .'|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|form'
            .'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta'
            .'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)'
            .'|ul)\\b[^>]*>)/i', '$1', $this->_html);

        // remove ws outside of all elements
        $this->_html = preg_replace(
            '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</'
            ,'>$1$2$3<'
            ,$this->_html);

        // use newlines before 1st attribute in open tags (to limit line lengths)
        $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);

        // fill placeholders
        $this->_html = str_replace(
            array_keys($this->_placeholders)
            ,array_values($this->_placeholders)
            ,$this->_html
        );
        // issue 229: multi-pass to catch scripts that didn't get replaced in textareas
        $this->_html = str_replace(
            array_keys($this->_placeholders)
            ,array_values($this->_placeholders)
            ,$this->_html
        );
        $this->_html = preg_replace('/\s+/', ' ', $this->_html);
        return $this->_html;
    }

    protected function _commentCB($m)
    {
        return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<!['))
            ? $m[0]
            : '';
    }

    protected function _reservePlace($content)
    {
        $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
        $this->_placeholders[$placeholder] = $content;
        return $placeholder;
    }
    protected $_isXhtml = null;
    protected $_replacementHash = null;
    protected $_placeholders = array();
    protected $_cssMinifier = null;
    protected $_jsMinifier = null;
    protected function _removePreCB($m)
    {
        return $this->_reservePlace("<pre{$m[1]}");
    }

    protected function _removeTextareaCB($m)
    {
        return $this->_reservePlace("<textarea{$m[1]}");
    }
    protected function _removeStyleCB($m)
    {
        $openStyle = "<style{$m[1]}";
        $css = $m[2];
        // remove HTML comments
        $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);

        // remove CDATA section markers
        $css = $this->_removeCdata($css);

        // minify
        $minifier = $this->_cssMinifier
            ? $this->_cssMinifier
            : 'trim';
        $css = call_user_func($minifier, $css);

        return $this->_reservePlace($this->_needsCdata($css)
                ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
                : "{$openStyle}{$css}</style>"
        );
    }
    protected function _removeScriptCB($m)
    {
        $openScript = "<script{$m[2]}";
        $js = $m[3];

        // whitespace surrounding? preserve at least one space
        $ws1 = ($m[1] === '') ? '' : ' ';
        $ws2 = ($m[4] === '') ? '' : ' ';
        // remove HTML comments (and ending "//" if present)
        if ($this->_jsCleanComments) {
            $js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
        }
        // remove CDATA section markers
        $js = $this->_removeCdata($js);

        // minify
        $minifier = $this->_jsMinifier
            ? $this->_jsMinifier
            : 'trim';
        $js = call_user_func($minifier, $js);

        return $this->_reservePlace($this->_needsCdata($js)
                ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
                : "{$ws1}{$openScript}{$js}</script>{$ws2}"
        );
    }
    protected function _removeCdata($str)
    {
        return (false !== strpos($str, '<![CDATA['))
            ? str_replace(array('<![CDATA[', ']]>'), '', $str)
            : $str;
    }

    protected function _needsCdata($str)
    {
        return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
    }
}


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

namespace InfrastructureAsCode.Core.Reports.o365Graph
{
    public enum ReportUsageFormatEnum : Int32
    {
        Default = 0,

        JSON = 1
    }
}