text:
        #ifndef AXIS2_SELLREQUEST_EX_H
        #define AXIS2_SELLREQUEST_EX_H

        /**
        * axis2_sellRequest_ex.h
        *
        * This file was auto-generated from WSDL
        * by the Apache Axis2 version: #axisVersion# #today#
        */

        #include <stdio.h>
        #include <axiom.h>
        #include <axutil_utils.h>
        #include <axiom_soap.h>
        #include <axis2_client.h>

        #ifdef __cplusplus
        extern "C"
        {
        #endif

        #define AXIS2_DEFAULT_DIGIT_LIMIT 64
        /**
        *  axis2_sellRequest_ex class class
        */
        typedef struct axis2_sellRequest_ex axis2_sellRequest_ex_t;

        AXIS2_EXTERN axis2_sellRequest_ex_t* AXIS2_CALL
        axis2_sellRequest_ex_create(
            const axutil_env_t *env );

        axis2_status_t AXIS2_CALL
        axis2_sellRequest_ex_free (
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env);

        axutil_qname_t* AXIS2_CALL
        axis2_sellRequest_ex_get_qname (
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env);

        axiom_node_t* AXIS2_CALL
        axis2_sellRequest_ex_serialize(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env,
            axiom_node_t* sellRequest_ex_om_node, int has_parent);

        axis2_status_t AXIS2_CALL
        axis2_sellRequest_ex_deserialize(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env, axiom_node_t* parent);

        /**
         * getter for userid.
         */
        axis2_char_t* AXIS2_CALL
        axis2_sellRequest_ex_get_userid(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env);

        /**
         * setter for userid
         */
        axis2_status_t AXIS2_CALL
        axis2_sellRequest_ex_set_userid(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env,
            axis2_char_t*  param_userid);

        /**
         * getter for symbol.
         */
        axis2_char_t* AXIS2_CALL
        axis2_sellRequest_ex_get_symbol(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env);

        /**
         * setter for symbol
         */
        axis2_status_t AXIS2_CALL
        axis2_sellRequest_ex_set_symbol(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env,
            axis2_char_t*  param_symbol);

        /**
         * getter for qty.
         */
        int AXIS2_CALL
        axis2_sellRequest_ex_get_qty(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env);

        /**
         * setter for qty
         */
        axis2_status_t AXIS2_CALL
        axis2_sellRequest_ex_set_qty(
            axis2_sellRequest_ex_t* sellRequest_ex,
            const axutil_env_t *env,
            int  param_qty);

     #ifdef __cplusplus
     }
     #endif

     #endif /* AXIS2_SELLREQUEST_EX_H */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Loon.Core.Graphics.Opengl;
using Microsoft.Xna.Framework;
using Loon.Core;
using Loon.Core.Graphics;

namespace Loon.Core.Graphics.Opengl
{
    public class ScreenUtils
    {
        public static LImage ToScreenCaptureTexturePixmap()
        {
            Texture2D screen = ToScreenCaptureTexture2D();
            return screen == null ? null : LImage.CreateImage(screen);
        }

        public static LTexture ToScreenCaptureTexture()
        {
            Texture2D screen = ToScreenCaptureTexture2D();
            return screen == null ? null : LImage.CreateImage(screen).GetTexture();
        }

        public static Texture2D ToScreenCaptureTexture2D()
        {
            if (LSystem.screenActivity != null)
            {
                RenderTarget2D render = new RenderTarget2D(GL.device, GL.device.PresentationParameters.BackBufferWidth, GL.device.PresentationParameters.BackBufferHeight, false, GL.device.PresentationParameters.BackBufferFormat, GL.device.PresentationParameters.DepthStencilFormat);

                GL.device.SetRenderTarget(render);

                LSystem.screenActivity.RequestRender();

                GL.device.SetRenderTarget(null);

                return render;
            }
            else
            {
                return null;
            }
        }

    }

}

redpajama_set_name: RedPajamaGithub


text: CREATE USER [dnn] WITHOUT LOGIN;


text:
namespace Grace.DependencyInjection.Attributes.Interfaces
{
	/// <summary>
	/// Attributes that implement will be called at discovery time to provide an EnrichWithDelegate
	/// </summary>
	public interface IEnrichWithAttribute
	{
		//EnrichWithDelegate ProvideDelegate(Type attributedType);
	}
}


text:
Input::
//// [/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
declare const console: { log(msg: any): void; };

//// [/src/a.ts]
const a: number = "hello"

//// [/src/tsconfig.json]
{"compilerOptions":{"noEmit":true}}

Output::
/lib/tsc --b /src/tsconfig.json -v
[12:00:08 AM] Projects in this build:
    * src/tsconfig.json

[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist

[12:00:10 AM] Building project '/src/tsconfig.json'...

src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'.

1 const a: number = "hello"
        ~

Found 1 error.

exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
Program root files: ["/src/a.ts"]
Program options: {"noEmit":true,"configFilePath":"/src/tsconfig.json"}
Program structureReused: Not
Program files::
/lib/lib.d.ts
/src/a.ts

Semantic diagnostics in builder refreshed for::
/lib/lib.d.ts
/src/a.ts

Shape signatures in builder refreshed for::
/lib/lib.d.ts (used version)
/src/a.ts (used version)

Change:: no-change-run
Input::

Output::
/lib/tsc --b /src/tsconfig.json -v
[12:00:11 AM] Projects in this build:
    * src/tsconfig.json

[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist

[12:00:13 AM] Building project '/src/tsconfig.json'...

src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'.

1 const a: number = "hello"
        ~

Found 1 error.

exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
Program root files: ["/src/a.ts"]
Program options: {"noEmit":true,"configFilePath":"/src/tsconfig.json"}
Program structureReused: Not
Program files::
/lib/lib.d.ts
/src/a.ts

Semantic diagnostics in builder refreshed for::
/lib/lib.d.ts
/src/a.ts

Shape signatures in builder refreshed for::
/lib/lib.d.ts (used version)
/src/a.ts (used version)

Change:: Fix error
Input::
//// [/src/a.ts]
const a = "hello"

Output::
/lib/tsc --b /src/tsconfig.json -v
[12:00:15 AM] Projects in this build:
    * src/tsconfig.json

[12:00:16 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist

[12:00:17 AM] Building project '/src/tsconfig.json'...

exitCode:: ExitStatus.Success
Program root files: ["/src/a.ts"]
Program options: {"noEmit":true,"configFilePath":"/src/tsconfig.json"}
Program structureReused: Not
Program files::
/lib/lib.d.ts
/src/a.ts

Semantic diagnostics in builder refreshed for::
/lib/lib.d.ts
/src/a.ts

Shape signatures in builder refreshed for::
/lib/lib.d.ts (used version)
/src/a.ts (used version)

Change:: no-change-run
Input::

Output::
/lib/tsc --b /src/tsconfig.json -v
[12:00:18 AM] Projects in this build:
    * src/tsconfig.json

[12:00:19 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist

[12:00:20 AM] Building project '/src/tsconfig.json'...

exitCode:: ExitStatus.Success
Program root files: ["/src/a.ts"]
Program options: {"noEmit":true,"configFilePath":"/src/tsconfig.json"}
Program structureReused: Not
Program files::
/lib/lib.d.ts
/src/a.ts

Semantic diagnostics in builder refreshed for::
/lib/lib.d.ts
/src/a.ts

Shape signatures in builder refreshed for::
/lib/lib.d.ts (used version)
/src/a.ts (used version)


text:
package com.leocardz.example;

import android.widget.TextView;

import com.leocardz.aelv.library.AelvListViewHolder;

public class ListViewHolder extends AelvListViewHolder {
    private TextView textView;

    public ListViewHolder(TextView textView) {
        super();
        this.textView = textView;
    }

    public TextView getTextView() {
        return textView;
    }

    public void setTextView(TextView textView) {
        this.textView = textView;
    }
}


text:
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you performed to verify your changes. Provide instructions so we can reproduce. Please provide details on how you tested supported versions of iOS and Xcode. Please make sure you have tested on all device size classes and orientations. Please also list any relevant details for your test configuration

- [ ] Test iOS 14
- [ ] Test iOS 13
- [ ] Test iOS 12
- [ ] Test iOS 11
- [ ] Test iOS 10
- [ ] Test iOS 9

**Test Configuration**
- Xcode Versions: [e.g. 12.x, 11.x, 10.x, 9.x]
- Simulators: [e.g. iPad Pro (14.x), iPhone SE (12.x)]
- Physical Hardware: [e.g. iPad Pro (14.x), iPhone SE (12.x)]

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] My code does not break backwards compatibility with earlier versions of PulleyLib
- [ ] My code is fully functional with all supported device sizes and orientations
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have checked that my code does not break the behavior of the Sample/Demo app
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have tested and can prove my fix is effective or that my feature works


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// 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.

package build.buildfarm.common.grpc;

import build.bazel.remote.execution.v2.RequestMetadata;
import com.google.common.annotations.VisibleForTesting;
import io.grpc.ClientInterceptor;
import io.grpc.Context;
import io.grpc.Contexts;
import io.grpc.Metadata;
import io.grpc.ServerCall;
import io.grpc.ServerCall.Listener;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import io.grpc.protobuf.ProtoUtils;
import io.grpc.stub.MetadataUtils;
import javax.annotation.Nullable;

/** Utility functions to handle Metadata for remote Grpc calls. */
public class TracingMetadataUtils {
  private TracingMetadataUtils() {}

  private static final Context.Key<RequestMetadata> CONTEXT_KEY =
      Context.key("remote-grpc-metadata");

  @VisibleForTesting
  public static final Metadata.Key<RequestMetadata> METADATA_KEY =
      ProtoUtils.keyForProto(RequestMetadata.getDefaultInstance());

  /** Fetches a {@link RequestMetadata} defined on the current context, or the default instance. */
  public static RequestMetadata fromCurrentContext() {
    RequestMetadata metadata = CONTEXT_KEY.get();
    if (metadata == null) {
      metadata = RequestMetadata.getDefaultInstance();
    }
    return metadata;
  }

  /**
   * Extracts a {@link RequestMetadata} from a {@link Metadata} and returns it if it exists. If it
   * does not exist, returns {@code null}.
   */
  public static @Nullable RequestMetadata requestMetadataFromHeaders(Metadata headers) {
    return headers.get(METADATA_KEY);
  }

  public static ClientInterceptor attachMetadataInterceptor(RequestMetadata metadata) {
    Metadata headers = new Metadata();
    headers.put(METADATA_KEY, metadata);
    return MetadataUtils.newAttachHeadersInterceptor(headers);
  }

  /** GRPC interceptor to add logging metadata to the GRPC context. */
  public static class ServerHeadersInterceptor implements ServerInterceptor {
    @Override
    public <ReqT, RespT> Listener<ReqT> interceptCall(
        ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {
      RequestMetadata meta = requestMetadataFromHeaders(headers);
      if (meta == null) {
        meta = RequestMetadata.getDefaultInstance();
      }
      Context ctx = Context.current().withValue(CONTEXT_KEY, meta);
      return Contexts.interceptCall(ctx, call, headers, next);
    }
  }
}


text:
//
//  TLEnumerate.h
//  TLChat
//
//  Created by 李伯坤 on 16/1/23.
//  Copyright © 2016年 李伯坤. All rights reserved.
//

#ifndef TLEnumerate_h
#define TLEnumerate_h

#import <Foundation/Foundation.h>

/**
 *  会话提示类型
 */
typedef NS_ENUM(NSInteger, TLClueType) {
    TLClueTypeNone,
    TLClueTypePoint,
    TLClueTypePointWithNumber,
};

/**
 *  会话类型
 */
typedef NS_ENUM(NSInteger, TLConversationType) {
    TLConversationTypePersonal,     // 个人
    TLConversationTypeGroup,        // 群聊
    TLConversationTypePublic,       // 公众号
    TLConversationTypeServerGroup,  // 服务组(订阅号、企业号)
};

typedef NS_ENUM(NSInteger, TLMessageRemindType) {
    TLMessageRemindTypeNormal,    // 正常接受
    TLMessageRemindTypeClosed,    // 不提示
    TLMessageRemindTypeNotLook,   // 不看
    TLMessageRemindTypeUnlike,    // 不喜欢
};

/**
 *  消息类型
 */
typedef NS_ENUM(NSInteger, TLMessageType) {
    TLMessageTypeUnknown,
    TLMessageTypeText,          // 文字
    TLMessageTypeImage,         // 图片
    TLMessageTypeExpression,    // 表情
    TLMessageTypeVoice,         // 语音
    TLMessageTypeVideo,         // 视频
    TLMessageTypeURL,           // 链接
    TLMessageTypePosition,      // 位置
    TLMessageTypeBusinessCard,  // 名片
    TLMessageTypeSystem,        // 系统
    TLMessageTypeOther,
};

typedef NS_ENUM(NSUInteger, TLMoreKeyboardItemType) {
    TLMoreKeyboardItemTypeImage,
    TLMoreKeyboardItemTypeCamera,
    TLMoreKeyboardItemTypeVideo,
    TLMoreKeyboardItemTypeVideoCall,
    TLMoreKeyboardItemTypeWallet,
    TLMoreKeyboardItemTypeTransfer,
    TLMoreKeyboardItemTypePosition,
    TLMoreKeyboardItemTypeFavorite,
    TLMoreKeyboardItemTypeBusinessCard,
    TLMoreKeyboardItemTypeVoice,
    TLMoreKeyboardItemTypeCards,
};

typedef NS_ENUM(NSUInteger, TLScannerType) {
    TLScannerTypeQR = 1,        // 扫一扫 - 二维码
    TLScannerTypeCover,         // 扫一扫 - 封面
    TLScannerTypeStreet,        // 扫一扫 - 街景
    TLScannerTypeTranslate,     // 扫一扫 - 翻译
};

typedef NS_ENUM(NSInteger, TLAddMneuType) {
    TLAddMneuTypeFriends = 0,
    TLAddMneuTypeAddFriend,
    TLAddMneuTypeScan,
    TLAddMneuTypeGroupChat,
};

#endif /* TLEnumerate_h */


text:
import os

from flask import Flask
from flask_login import LoginManager
from flask_restless import APIManager
from flask_sqlalchemy import SQLAlchemy

# Set the database path
DATABASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'database/test.db')
if os.path.exists(DATABASE):
    os.unlink(DATABASE)

# Create the Flask application and the Flask-SQLAlchemy object.
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///%s' % DATABASE
db = SQLAlchemy(app)
app.config['SECRET_KEY'] = os.urandom(24)

# Create the Flask-Restless API manager.
manager = APIManager(app, flask_sqlalchemy_db=db)

# Create Flask-Login login manager
login_manager = LoginManager()
login_manager.init_app(app)


text:
package org.jfleet.metadata;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Target(FIELD)
@Retention(RUNTIME)
public @interface JFleetTemporal {

    JFleetTemporalType value();

}


text:
class AddTimeZoneToMembers < ActiveRecord::Migration
  def change
    add_column :diabetic_toolbox_members, :time_zone, :string, null: false, default: 'UTC'
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="gold">#CC9900</color>
    <color name="red">#CC0000</color>
    <color name="silverRed">#C88</color>
</resources>


text:
package co.runrightfast.vertx.core.application;

import co.runrightfast.vertx.core.RunRightFastVerticle;
import co.runrightfast.vertx.core.VertxService;
import co.runrightfast.vertx.core.application.jmx.ApplicationMXBean;
import co.runrightfast.vertx.core.application.jmx.impl.ApplicationMXBeanImpl;
import co.runrightfast.vertx.core.components.ApplicationInfo;
import co.runrightfast.vertx.core.components.DaggerApplicationInfo;
import co.runrightfast.vertx.core.components.RunRightFastVertxApplication;
import static co.runrightfast.vertx.core.eventbus.EventBusAddress.runrightfastEventBusAddress;
import co.runrightfast.vertx.core.modules.RunRightFastApplicationModule;
import co.runrightfast.vertx.core.modules.VertxServiceModule;
import co.runrightfast.core.utils.ConfigUtils;
import static co.runrightfast.core.utils.ConfigUtils.CONFIG_NAMESPACE;
import static co.runrightfast.core.utils.ConfigUtils.configPath;
import co.runrightfast.core.utils.JmxUtils;
import co.runrightfast.core.utils.ServiceUtils;
import co.runrightfast.vertx.core.verticles.verticleManager.RunRightFastVerticleDeployment;
import com.google.common.util.concurrent.AbstractIdleService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Service;
import com.typesafe.config.Config;
import java.util.function.Supplier;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.SEVERE;
import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import lombok.extern.java.Log;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * The design pattern for an application is:
 *
 *

 *
Create an application main class which provides a method to create an {@link RunRightFastVertxApplication} instance
 *
The application main method delegates to {@link RunRightFastVertxApplicationLauncher#run(java.util.function.Supplier, java.lang.String...)}
 *

 *
 *

 *
 * public final class MyApp  {
 *     public static void main(final String[] args){
 *         System.exit(RunRightFastVertxApplicationLauncher.run(MyApp::runRightFastVertxApplication, args));
 *     }
 *
 *     private static RunRightFastVertxApplication runRightFastVertxApplication(){
 *         ...
 *     }
 * }
 *

 *
 * @author alfio
 */
@Log
@Builder
public final class RunRightFastVertxApplicationLauncher extends AbstractIdleService {

    public static interface EventBusAddresses {

        static final String APP_INSTANCE_STARTED = runrightfastEventBusAddress("application-instance", "started");
        static final String APP_INSTANCE_STOPPED = runrightfastEventBusAddress("application-instance", "stopped");
    }

    private static final String CLASS_NAME = RunRightFastVertxApplicationLauncher.class.getName();

    @Getter
    @NonNull
    private final RunRightFastVertxApplication app;

    private final Service.Listener vertxServiceShutdownListener = new Service.Listener() {

        @Override
        public void failed(final Service.State from, Throwable failure) {
            log.logp(SEVERE, CLASS_NAME, "vertxServiceShutdownListener", "failed", failure);
            ServiceUtils.stopAsync(RunRightFastVertxApplicationLauncher.this);
        }

        @Override
        public void terminated(final Service.State from) {
            log.logp(INFO, CLASS_NAME, "vertxServiceShutdownListener", "terminated");
            ServiceUtils.stopAsync(RunRightFastVertxApplicationLauncher.this);
        }

    };

    /**
     * Runs an application on the caller's thread. The calling thread will block, waiting for the application to terminate.
     *
     * @param app supplies an RunRightFastVertxApplication instance. The recommended approach is to supply a Dagger2 component which extends the
     * RunRightFastVertxApplication interface, which includes the following modules:
     *
     *

     *
{@link RunRightFastApplicationModule}
     *
{@link VertxServiceModule}
     *

     *
     * plus your modules that provide the application's {@link RunRightFastVerticle} instances and their corresponding {@link RunRightFastVerticleDeployment}
     * definitions.
     *
     * @param args
     * @return exit code, where
     *

     *
0 = application terminated normally
     *
1 = application aborted with an exception
     *
2 = invalid command line usage
     *

     */
    public static int run(@NonNull final Supplier<RunRightFastVertxApplication> app, final String... args) {
        final int returnCode = processCommandLine(args);
        if (returnCode != -1) {
            return returnCode;
        }

        try {
            runApp(app);
            return 0;
        } catch (final Throwable e) {
            log.logp(SEVERE, CLASS_NAME, "run", "unexpected exception", e);
            return 1;
        }
    }

    private static int processCommandLine(final String... args) {
        if (ArrayUtils.isNotEmpty(args)) {
            final Options options = cliOptions();
            try {
                final CommandLineParser parser = new DefaultParser();
                final CommandLine cmd = parser.parse(options, args);

                if (cmd.hasOption('v')) {
                    printVersion();
                    return 0;
                }

                if (cmd.hasOption('h')) {
                    printHelp(options);
                    return 0;
                }

                if (cmd.hasOption('c')) {
                    printConfig();
                    return 0;
                }
            } catch (final ParseException e) {
                System.out.println(e.getMessage());
                final HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("ant", options);
                return 2;
            } catch (final Throwable e) {
                log.logp(SEVERE, CLASS_NAME, "run", "unexpected exception", e);
                return 1;
            }
        }

        return -1;
    }

    private static void printConfig() {
        final ApplicationInfo appInfo = DaggerApplicationInfo.create();
        final Config config = appInfo.runRightFastApplication().getConfig();
        System.out.println(ConfigUtils.renderConfigAsJson(config, true));
    }

    private static void printVersion() {
        final ApplicationInfo appInfo = DaggerApplicationInfo.create();
        final ApplicationId appId = appInfo.runRightFastApplication().getApplicationId();
        System.out.println(appId.toJson());
    }

    private static void printHelp(final Options options) {
        final ApplicationInfo appInfo = DaggerApplicationInfo.create();
        final ApplicationId appId = appInfo.runRightFastApplication().getApplicationId();

        String header = ConfigUtils.getString(appInfo.runRightFastApplication().getConfig(), configPath(CONFIG_NAMESPACE, "app", "cli", "help", "header")).orElse(StringUtils.EMPTY);
        String footer = ConfigUtils.getString(appInfo.runRightFastApplication().getConfig(), configPath(CONFIG_NAMESPACE, "app", "cli", "help", "footer")).orElse(StringUtils.EMPTY);

        final HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp(appId.getName(), header, options, footer, true);
    }

    private static void runApp(final Supplier<RunRightFastVertxApplication> app) {
        final RunRightFastVertxApplicationLauncher service = RunRightFastVertxApplicationLauncher.builder().app(app.get()).build();
        log.logp(INFO, CLASS_NAME, "runApp", "starting");
        service.startAsync();
        service.awaitRunning();
        log.logp(INFO, CLASS_NAME, "runApp", "running");
        service.awaitTerminated();
        log.logp(INFO, CLASS_NAME, "runApp", "terminated");
    }

    private static Options cliOptions() {
        final Options options = new Options()
                .addOptionGroup(new OptionGroup()
                        .addOption(Option.builder("v").longOpt("version").desc("Show the application version").build())
                        .addOption(Option.builder("h").longOpt("help").desc("Print usage").build())
                        .addOption(Option.builder("c").longOpt("config").desc("Show the application configuration as JSON").build())
                );
        return options;
    }

    @Override
    protected String serviceName() {
        return getClass().getSimpleName();
    }

    @Override
    protected void startUp() throws Exception {
        final VertxService vertxService = app.vertxService();
        vertxService.awaitRunning();
        vertxService.addListener(vertxServiceShutdownListener, MoreExecutors.directExecutor());
        registerShutdownHook();
        registerApplicationMBean();
        // In order for Dagger to create the service, it must be used first
        app.healthChecksService();
        logConfig();
    }

    @Override
    protected void shutDown() throws Exception {
        final VertxService vertxService = app.vertxService();
        ServiceUtils.stop(vertxService);
        unregisterApplicationMBean();
    }

    private void registerShutdownHook() {
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                try {
                    log.logp(INFO, CLASS_NAME, "shutdownHook", "invoked");
                    ServiceUtils.stop(RunRightFastVertxApplicationLauncher.this);
                    log.logp(INFO, CLASS_NAME, "shutdownHook", "complete");
                } catch (final Throwable ex) {
                    log.logp(SEVERE, CLASS_NAME, "shutdownHook", "exception", ex);
                }
            }
        });
    }

    private void registerApplicationMBean() {
        JmxUtils.registerApplicationMBean(
                app.runRightFastApplication().getJmxDefaultDomain(),
                new ApplicationMXBeanImpl(this),
                ApplicationMXBean.class
        );
    }

    private void unregisterApplicationMBean() {
        JmxUtils.unregisterApplicationMBean(app.runRightFastApplication().getJmxDefaultDomain(), ApplicationMXBean.class);
    }

    private void logConfig() {
        final Config config = app.runRightFastApplication().getConfig();
        if (ConfigUtils.getBoolean(config, ConfigUtils.configPath(CONFIG_NAMESPACE, "logConfigOnStartup")).orElse(Boolean.TRUE)) {
            log.logp(INFO, CLASS_NAME, "logConfig", ConfigUtils.renderConfig(config));
        }
    }
}


text:
package gov.va.escreening.domain;

import gov.va.escreening.entity.SurveySection;

import java.io.Serializable;
import java.util.Date;

public class SurveySectionDto implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer surveySectionId;
    private String name;
    private Integer displayOrder;
    private Date dateCreated;

    public SurveySectionDto() {}

    public SurveySectionDto(SurveySection section) {
    	setSurveySectionId(section.getSurveySectionId());
    	setName(section.getName());
    	setDisplayOrder(section.getDisplayOrder());
    	setDateCreated(section.getDateCreated());
    }

	public Integer getSurveySectionId() {
		return surveySectionId;
	}
	public void setSurveySectionId(Integer surveySectionId) {
		this.surveySectionId = surveySectionId;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public Integer getDisplayOrder() {
		return displayOrder;
	}
	public void setDisplayOrder(Integer displayOrder) {
		this.displayOrder = displayOrder;
	}

	public Date getDateCreated() {
		return dateCreated;
	}
	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}
}


text:
import Value from './Value';

export default class Decimal extends Value {}


text:
package leader.app;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.session.data.redis.RedisOperationsSessionRepository;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@SpringBootApplication(scanBasePackages = "leader.**")
@EnableRedisHttpSession
public class AppTest extends SpringBootServletInitializer {
	@Value("${spring.session.timeout}")
	private Integer maxInactiveIntervalInSeconds;

	@Bean
	public RedisOperationsSessionRepository sessionRepository(RedisConnectionFactory factory) {
		RedisOperationsSessionRepository sessionRepository = new RedisOperationsSessionRepository(factory);
		//设置默认超时时间
		System.out.println("set session timeout "+maxInactiveIntervalInSeconds);
		sessionRepository.setDefaultMaxInactiveInterval(maxInactiveIntervalInSeconds);
		return sessionRepository;
	}

	public static void main(String[] args) {
		ConfigurableApplicationContext ctx = SpringApplication.run(AppTest.class, args);
	}
}


text:
Frcho\PdfBundle\Converter\CssPathToUrl
===============

Convert the relative CSS links to full url paths for all our CSS files in
an HTML file.

* Class name: CssPathToUrl
* Namespace: Frcho\PdfBundle\Converter
* Parent class: [Frcho\PdfBundle\Converter\CssConverter](Frcho-PdfBundle-Converter-CssConverter.md)

Properties
----------

### $url

```
protected string $url
```

The url we'll use to point to our CSS files.

* Visibility: **protected**

Methods
-------

### convertToString

```
\Frcho\PdfBundle\Converter\$html Frcho\PdfBundle\Converter\CssPathToUrl::convertToString(string $html)
```

Convert the link tags in the specified string so that the relative
paths are replaces with a proper url implementation.

* Visibility: **public**

#### Arguments

* $html **string**

### replaceCssPaths

```
array Frcho\PdfBundle\Converter\CssPathToUrl::replaceCssPaths(array $links)
```

Replace a given set of links with the proper url if it is an external
css file.

* Visibility: **public**

#### Arguments

* $links **array**

### replaceExternalCss

```
string Frcho\PdfBundle\Converter\CssPathToUrl::replaceExternalCss(string $html, array $stylesheets)
```

From a set of external stylesheets, retrieve the data and replace the
matching CSS tag with the contents.

* Visibility: **public**

#### Arguments

* $html **string**
* $stylesheets **array**

### setUrl

```
\Frcho\PdfBundle\Converter\CssPathToUrl Frcho\PdfBundle\Converter\CssPathToUrl::setUrl(string $url)
```

Set the URL we'll use to point our CSS files to.

* Visibility: **public**

#### Arguments

* $url **string**

### getUrl

```
string Frcho\PdfBundle\Converter\CssPathToUrl::getUrl()
```

Retrieve the URL we're using to point our CSS files to.

* Visibility: **public**

### extractExternalStylesheets

```
array Frcho\PdfBundle\Converter\CssConverter::extractExternalStylesheets(string $html)
```

Extract the external stylesheets from the specified HTML if the option is
enabled.

If the stylesheet is not in the form of a url, prepend our
basePath.

* Visibility: **public**
* This method is defined by [Frcho\PdfBundle\Converter\CssConverter](Frcho-PdfBundle-Converter-CssConverter.md)

#### Arguments

* $html **string**

### getExternalStylesheetRegex

```
string Frcho\PdfBundle\Converter\CssConverter::getExternalStylesheetRegex()
```

The regex that we'll use to extract external stylesheets.

* Visibility: **protected**
* This method is defined by [Frcho\PdfBundle\Converter\CssConverter](Frcho-PdfBundle-Converter-CssConverter.md)

### isExternalStylesheet

```
boolean Frcho\PdfBundle\Converter\CssConverter::isExternalStylesheet(string $url)
```

Check if the given string is a string for a local stylesheet or an
external stylesheet.

* Visibility: **protected**
* This method is defined by [Frcho\PdfBundle\Converter\CssConverter](Frcho-PdfBundle-Converter-CssConverter.md)

#### Arguments

* $url **string**


text:
@(decisionform: Form[DecisionForm],
  paperIndexEvaluations: Id[Paper] => Option[(Paper, Int, List[Evaluation.Evaluation])],
  navbar: Html
)(implicit flash: Flash)

@import FileServing.linkToFile
@import Decision._
@import helper.FieldConstructors.empty
@import java.text.DecimalFormat

@main("Decision", navbar) {
  @helper.form(routes.Chairing.doDecision) {

          Id
          Title
          Reviews
          Score
          Decision

        @decisionform.get.decisions.zipWithIndex.map { case (decision, index) =>
          @paperIndexEvaluations(decision.paperId).map { case (paper, paperIndex, evaluations) =>

 { class="danger" }
                case Temporary_rejected => { class="warning" }
                case Undecided => {}
                case Temporary_accepted => { class="warning" }
                case Accepted => { class="success" }
              }
            >
              @{ paperIndex + 1 }
              @paper.title
              @if(evaluations.isEmpty) {-} else {@evaluations.size}

                  @{ evaluations match {
                    case Nil => "-"
                    case xs =>
                      new DecimalFormat("#.##").format(
                        xs.map(_.id).sum.toDouble / (evaluations.size.toDouble)
                      ) + " / " + (Evaluation.maxId - 1)
                  }}

                @select(
                  decisionform(s"decisions[$index].value.value"),
                  Decision.values.toSeq.map { b => b.toString -> b.toString.replace("_", " ")})

                <input type="text" name="decisions[@index].paperId.value" value="@decision.paperId.value">

          }
        }

@button("Save")

  }
}


text:
//
//  HomeNetWorkManager.h
//  乐趣做
//
//  Created by 王新伟 on 2017/5/8.
//  Copyright © 2017年 王新伟. All rights reserved.
//

#import "NetWorkManager.h"

@interface HomeNetWorkManager : NetWorkManager

+(instancetype)shareManager;

/**获取首页分类数据*/
-(NSURLSessionDataTask *)getHomeCategoryDataWithSuccess:(void (^)(id respons))success faile:(void (^)(NSURLSessionDataTask * task,NSError * error))faile;

/**根据首页的分类数据请求*/
-(NSURLSessionDataTask *)getCategorysListWithCategoryid:(NSString *)categoryid success:(void (^)(id respons))success faile:(void (^)(NSURLSessionDataTask * task,NSError * error))faile;
@end


text:
// Copyright (c) 2016-2020 Alexander Ong
// See LICENSE in project root for license information.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ErrorMessage : DisplayMenu {
    public string errorMessage = "No error";
    public Text errorText;

    protected override void OnEnable()
    {
        base.OnEnable();
        errorText.text = errorMessage;
    }
}


text:
using System.ComponentModel;
using System.Threading.Tasks;

namespace Treehopper.Libraries.Sensors
{
    /// <summary>
    ///     Represents any sensor or input that must be polled to retrieve an update
    /// </summary>
    public interface IPollable : INotifyPropertyChanged
    {
        /// <summary>
        /// Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically
        /// (defaults to `true`).
        /// </summary>
        /// <remarks>
        /// By default, whenever you access one of the properties of this sensor, a new reading will be fetched. If this property
        /// is set to false, you must manually call the UpdateAsync() method to retrieve a new sensor reading.
        ///
        /// This functionality enables more efficient sensor updates, since it allows you to intelligently control when data is gathered.
        ///
        /// </remarks>
        bool AutoUpdateWhenPropertyRead { get; set; }

        /// <summary>
        /// Requests a reading from the sensor and updates its data properties with the gathered values.
        /// </summary>
        /// <returns>An awaitable Task</returns>
        /// <remarks>
        /// Note that when #AutoUpdateWhenPropertyRead is `true` (which it is, by default), this method is implicitly
        /// called when any sensor data property is read from --- there's no need to call this method unless you set
        /// AutoUpdateWhenPropertyRead to `false`.
        ///
        /// Unless otherwise noted, this method updates all sensor data simultaneously, which can often lead to more efficient
        /// bus usage (as well as reducing USB chattiness).
        /// </remarks>
        Task UpdateAsync();
    }
}


text:
package io.github.lxgaming.equity.packets;

import io.github.lxgaming.equity.entries.ProxyMessage;

public class CPacketEncryptionResponse extends AbstractPacket {

    @Override
    public void read(ProxyMessage proxyMessage) {
    }
}


text:
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { FormsModule } from '@angular/forms'

import { PaginationModule } from 'ngx-bootstrap/pagination'
import { AlertModule } from 'ngx-bootstrap/alert'

import { UiDataGridComponent } from './data-grid.component'

import { HeaderComponent } from './header/header.component'
import { ItemButtonsComponent } from './item-buttons/item-buttons.component'
import { PagerComponent } from './pager/pager.component'
import { RowsComponent } from './rows/rows.component'

@NgModule({
  imports: [CommonModule, FormsModule, AlertModule.forRoot(), PaginationModule.forRoot()],
  declarations: [UiDataGridComponent, HeaderComponent, ItemButtonsComponent, RowsComponent, PagerComponent],
  providers: [],
  exports: [UiDataGridComponent],
})
export class UiDataGridModule {}


text:
@implementation UIView (HIScreenShot)

- (UIImage *) screenshot
{
    return [self capture];
}

- (UIImage *) screenshotOneLayer
{
    NSMutableArray * temp = [NSMutableArray new];

    for ( UIView * subview in self.subviews ) {
        if ( NO == subview.hidden ) {
            subview.hidden = YES;

            [temp addObject:subview];
        }
    }

    UIImage * image = [self capture];

    for ( UIView * subview in temp ) {
        subview.hidden = NO;
    }

    return image;
}

- (UIImage *)capture
{
    CGSize screenSize = [UIScreen mainScreen].bounds.size;
    CGRect captureBounds = CGRectZero;
    captureBounds.size = self.bounds.size;

    if ( captureBounds.size.width > screenSize.width ) {
        captureBounds.size.width = screenSize.width;
    }

    if ( captureBounds.size.height > screenSize.height ) {
        captureBounds.size.height = screenSize.height;
    }

    return [self capture:captureBounds];
}

- (UIImage *)capture:(CGRect)frame
{
    UIImage * result = nil;

    UIGraphicsBeginImageContextWithOptions( frame.size, NO, 1.0 );

    CGContextRef context = UIGraphicsGetCurrentContext();

    if ( context ) {
        CGContextTranslateCTM( context, -frame.origin.x, -frame.origin.y );
        [self.layer renderInContext:context];

        result = UIGraphicsGetImageFromCurrentImageContext();
    }

    UIGraphicsEndImageContext();

    return result;
}

@end


text:
@implementation UIView(DataBinding)

+ (void)load{
    Method overridedMethod = class_getInstanceMethod([UIView class], @selector(overridedSetValue:forKey:));
    Method originalMehtod = class_getInstanceMethod([UIView class], @selector(setValue:forKey:));
    method_exchangeImplementations(overridedMethod, originalMehtod);
}

- (void)overridedSetValue:(id)value forKey:(NSString *)key{

    //覆盖UIView原本的set事件,拦截BindMethod和BindType

    if (value && [value isKindOfClass:[NSString class]] &&[value hasPrefix:BIND_PATH]) {
        //绑定方法
        NSString *field = [value stringByReplacingOccurrencesOfString:BIND_PATH withString:@""];
        NSString *method = key;
        [[DataBindingUtil dataBindingUtil] addBindingField:field bindingMethod:method forView:self];

    }else if([key isEqualToString:BIND_TYPE]){
        //设置绑定类型
        [[DataBindingUtil dataBindingUtil] addModelType:value forView:self];

    }else if([key isEqualToString:BIND_ID]){
        //设置绑定id
        [[DataBindingUtil dataBindingUtil] addModelIdentifier:value forView:self];

    }else {
        [self overridedSetValue:value forKey:key];
    }

}

@end


text:
using System;
using System.Windows.Forms;

namespace SGLibrary.Extend.ControlEx
{
    public static class ExNumericUpDown
    {
        public static Boolean TrySetValue(NumericUpDown control, Decimal value)
        {
            if (value >= control.Minimum && value <= control.Maximum)
            {
                control.Value = value;
                return true;
            }
            return false;
        }
    }
}


text:
import timeutil

class TestResult(object):
    """Contains speed test result"""

    def __init__(self, download, upload, ping, utc_time):
        self.__download = download
        self.__upload = upload
        self.__ping = ping
        self.__measurement_utc_time = utc_time
        self.__weather_data = None

    def set_weather_data(self, weather_data):
        """Returns utc time of the measurement"""
        self.__weather_data = weather_data

    @property
    def get_default(self):
        """Returns default test result instance"""
        return TestResult(2, 3, 4, timeutil.utc_now())

    @property
    def get_weather_data(self):
        """Returns weather data at the measurement time"""
        return self.__weather_data

    @property
    def get_time_stamp(self):
        """Returns utc time of the measurement"""
        return self.__measurement_utc_time

    @property
    def get_download_speed(self):
        """Returns download speed of network speed test"""
        return self.__download

    @property
    def get_upload_speed(self):
        """Returns upload speed of network speed test"""
        return self.__upload

    @property
    def get_ping_speed(self):
        """Returns ping speed of network speed test"""
        return self.__ping

    def to_json(self):
        """
            Returns: json object, representing SpeedTestResult data
        """
        data = {}
        data["upload"] = str(self.get_upload_speed)
        data["download"] = str(self.get_download_speed)
        data["ping"] = str(self.get_ping_speed)
        data["utcEpoch"] = timeutil.utc_now_epoch()
        if self.get_weather_data:
            data["weather"] = self.get_weather_data
        return data


text:
var express = require("express");
var app = express();
var fs = require("fs");
var url=require('url');
var dirName = "NomadConnection";

app.use("/css", express.static(__dirname + '/' + dirName + '/css'));
app.use("/js", express.static(__dirname + '/' + dirName + '/js'));
app.use("/fonts", express.static(__dirname + '/' + dirName + '/fonts'));
app.use("/img", express.static(__dirname + '/' + dirName + '/img'));
app.use("/assets", express.static(__dirname + '/' + dirName + '/assets'));

app.use("/useScript", express.static(__dirname + '/' + dirName + '/useScript'));
app.use("/reactJS", express.static(__dirname + '/' + dirName + '/useScript/reactJS'));

app.listen(1004, function() {
	console.log("Searver Stat.");
});

app.get("/", function(req,res) {

	fs.readFile(dirName + "/index.html", "utf-8", function(error, data) {
		if(error) {
			console.log(error);
		} else {
			res.writeHead(200, {"Content-Type":"text/html"});
			res.end(data);
		}
	});
});

app.get("/jPutTest", function(req, res) {
    res.sendFile(__dirname + "/" + dirName + "/jputTest.html");
});

app.get("/commentList", function(req, res) {
    res.sendFile(__dirname + "/" + dirName + "/commentList.html");
});

app.get("/drop", function(req, res) {
    res.sendFile(__dirname + "/" + dirName + "/drop.html");
});

app.get("/counselorMgt", function(req, res) {
    res.sendFile(__dirname + "/" + dirName + "/counselorMgt.html");
});


text:
<?php

/**
 * Remove trailing whitespaces.
 */
final class WhitespaceLinter extends ArcanistLinter {

  const TRAILING_SPACE_FOUND = 1;

  public function getInfoName() {
    return 'lint-whitespace';
  }

  public function getInfoDescription() {
    return pht('Remove trailing whitespaces.');
  }

  public function getLinterName() {
    return 'WHITESPACE';
  }

  public function getLinterConfigurationName() {
    return 'lint-whitespace';
  }

  public function getLintSeverityMap() {
    return array(
      self::TRAILING_SPACE_FOUND => ArcanistLintSeverity::SEVERITY_AUTOFIX,
    );
  }

  public function getLintNameMap() {
    return array(
        self::TRAILING_SPACE_FOUND => pht('Found trailing whitespace(s).'),
    );
  }

  public function lintPath($path) {
    $abspath = Filesystem::resolvePath($path, $this->getProjectRoot());
    $fileContent = Filesystem::readFile($abspath);

    if (preg_match_all('/.*[\t ]+$/m', $fileContent, $matches,
      PREG_OFFSET_CAPTURE)) {
      foreach ($matches[0] as $match) {
        list($fullLine, $offset) = $match;

        $this->raiseLintAtOffset(
          $offset,
          self::TRAILING_SPACE_FOUND,
          pht('Found trailing whitespace(s).'),
          $fullLine,
          rtrim($fullLine));
      }
    }
  }
}


text:
package com.ctrip.xpipe.redis.checker.healthcheck.actions.redisstats.tps;

import com.ctrip.xpipe.redis.checker.healthcheck.ActionContext;
import com.ctrip.xpipe.redis.checker.healthcheck.HealthCheckAction;
import com.ctrip.xpipe.redis.checker.healthcheck.HealthCheckActionListener;

public interface TpsCheckListener extends HealthCheckActionListener<TpsActionContext, HealthCheckAction> {

    @Override
    default boolean worksfor(ActionContext t) {
        return t instanceof TpsActionContext;
    }

}


text:
<dom-module id="respond-content">
	<template>
  		<content></content>
	</template>
</dom-module>

<script>
  Polymer({
	  	is: "respond-content",

	  	// element attributes
	  	properties: {
	  		url: { type: String },
	  		contentid: { type: String },
	  		cssclass: { type: String }
		},

		// attached
		attached: function() {

			var url = this.url.replace('/', '.');
			var context = this;

			// xhr
			var xhr = new XMLHttpRequest();
			xhr.open('GET', encodeURI('templates/page/' + url + '.html'));

			xhr.onload = function() {
			    if (xhr.status === 200) {

			    	var data = xhr.responseText;

			        // replace imagesURL with url
					data = respond.site.replaceAll(data, '{{site.ImagesUrl}}', respond.site.settings.ImagesUrl);
					data = respond.site.replaceAll(data, '{{site.ImagesURL}}', respond.site.settings.ImagesUrl);

					// place returned HTML into a node
					var div = document.createElement('div');

					if(this.contentid != '' && this.contentid != undefined){
						div.setAttribute('id', this.contentid);
					}

					if(this.cssclass != '' && this.cssclass != undefined){
						div.setAttribute('class', this.cssclass);
					}

					div.innerHTML = data;

					// apply to light dom
					Polymer.dom(context).appendChild(div);
					Polymer.dom.flush()

			    }
			    else {
			        console.log('[respond.error] respond-content component: failed post, xhr.status='+xhr.status);
			    }
			};
			xhr.send();

		}

	});
</script>


text:
"""
Table Bubble Plot (Github Punch Card)
-------------------------------------
This example shows github contributions by the day of week and hour of the day.
"""
# category: distributions
import altair as alt
from vega_datasets import data

source = data.github.url

alt.Chart(source).mark_circle().encode(
    x='hours(time):O',
    y='day(time):O',
    size='sum(count):Q'
)


text:
/**
 * Utility functions
 */

"use strict";
var _ = require("lodash");
var chalk = require("chalk");
var rx = require("rx");
var figures = require("figures");

/**
 * Module exports
 */

var utils = module.exports;

/**
 * Run a function asynchronously or synchronously
 * @param   {Function} func  Function to run
 * @param   {Function} cb    Callback function passed the `func` returned value
 * @...rest {Mixed}    rest  Arguments to pass to `func`
 * @return  {Null}
 */

utils.runAsync = function( func, cb ) {
  var async = false;
  var isValid = func.apply({
    async: function() {
      async = true;
      return _.once(cb);
    }
  }, Array.prototype.slice.call(arguments, 2) );

  if ( !async ) {
    cb(isValid);
  }
};

/**
 * Create an oversable returning the result of a function runned in sync or async mode.
 * @param  {Function} func Function to run
 * @return {rx.Observable} Observable emitting when value is known
 */

utils.createObservableFromAsync = function( func ) {
  return rx.Observable.defer(function() {
    return rx.Observable.create(function( obs ) {
      utils.runAsync( func, function( value ) {
        obs.onNext( value );
        obs.onCompleted();
      });
    });
  });
};

/**
 * Resolve a question property value if it is passed as a function.
 * This method will overwrite the property on the question object with the received value.
 * @param  {Object} question - Question object
 * @param  {String} prop     - Property to fetch name
 * @param  {Object} answers  - Answers object
 * @...rest {Mixed} rest     - Arguments to pass to `func`
 * @return {rx.Obsersable}   - Observable emitting once value is known
 */

utils.fetchAsyncQuestionProperty = function( question, prop, answers ) {
  if ( !_.isFunction(question[prop]) ) return rx.Observable.return(question);

  return utils.createObservableFromAsync(function() {
    var done = this.async();
    utils.runAsync( question[prop], function( value ) {
      question[prop] = value;
      done( question );
    }, answers );
  });
};

/**
 * Get the pointer char
 * @return {String}   the pointer char
 */

utils.getPointer = function() {
  return figures.pointer;
};

/**
 * Get the checkbox
 * @param  {Boolean} checked - add a X or not to the checkbox
 * @param  {String}  after   - Text to append after the check char
 * @return {String}          - Composited checkbox string
 */

utils.getCheckbox = function( checked, after ) {
  var checked = checked ? chalk.green( figures.radioOn ) : figures.radioOff;
  return checked + " " + ( after || "" );
};

/**
 * Helper for writing message in Prompt
 * @param {Prompt} prompt  - The Prompt object that extends tty
 * @param {String} message - The message to be output
 */
utils.writeMessage = function ( prompt, message ) {
  var msgLines = message.split(/\n/);
  prompt.height = msgLines.length;

  // Write message to screen and setPrompt to control backspace
  prompt.rl.setPrompt( _.last(msgLines) );

  if ( process.stdout.rows === 0 && process.stdout.columns === 0 ) {
    /* When it's a tty through serial port there's no terminal info and the render will malfunction,
       so we need enforce the cursor to locate to the leftmost position for rendering. */
    prompt.left( message.length + prompt.rl.line.length );
  }
  prompt.write( message );
};


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>Zend Framework Extras API Documentation » \ZendX_JQuery_View_Helper_JQuery</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">

Zend Framework Extras API Documentation

                                    API Documentation

Packages

 Default

 ZendX

 ZendX_Application

 ZendX_Console

 ZendX_Db

 ZendX_JQuery

                                    Reports

 Errors
                38

 Markers

 Deprecated elements
                4

Back to top

                            Javascript is disabled; several features are only available
                            if Javascript is enabled.

<button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button>

<button class="btn details" title="Show descriptions and method names"></button><button class="btn simple" title="Show only method names"></button>

 Methods

Proxy to container methods
__call()

Initialize helper
__construct()

Disable noConflict Mode of jQuery if this was previously enabled.
disableNoConflictMode()

Enable the jQuery internal noConflict Mode to work with
other Javascript libraries. Will setup jQuery in the variable
$j instead of $ to overcome conflicts.
enableNoConflictMode()

Return current jQuery handler based on noConflict mode settings.
getJQueryHandler()

Return current status of the jQuery no Conflict Mode
getNoConflictMode()

Return jQuery View Helper class, to execute jQuery library related functions.
jQuery()

Set view object
setView()

 Properties

$view

» Private

$noConflictMode

\

\ZendX_JQuery_View_Helper_JQuery

jQuery Helper. Functions as a stack for code and loads all jQuery dependencies.

uses

package
ZendX_JQuery

subpackage
View

copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)

license
New BSD License

 Methods

Proxy to container methods

__call(string $method, array $args) : mixed

Parameters

$method

string

$args

array

Exceptions

\Zend_View_Exception
For invalid method calls

Returns

mixed

Initialize helper

__construct()

Retrieve container from registry or create new container and store in
registry.

Disable noConflict Mode of jQuery if this was previously enabled.

disableNoConflictMode() : void

Static

Enable the jQuery internal noConflict Mode to work with
other Javascript libraries. Will setup jQuery in the variable
$j instead of $ to overcome conflicts.

enableNoConflictMode()

Static

link
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Return current jQuery handler based on noConflict mode settings.

getJQueryHandler() : String

Static

Returns

String

Return current status of the jQuery no Conflict Mode

getNoConflictMode() : Boolean

Static

Returns

Boolean

Return jQuery View Helper class, to execute jQuery library related functions.

jQuery() : \ZendX_JQuery_View_Helper_JQuery_Container

Returns

\ZendX_JQuery_View_Helper_JQuery_Container

Set view object

setView(\Zend_View_Interface $view) : void

Parameters

$view

\Zend_View_Interface

 Properties

$view

$view : \Zend_View_Interface

Default

jQuery no Conflict Mode

$noConflictMode

Default

false

Static

see

staticvar
Boolean Status of noConflict Mode

            Template is built using Twitter Bootstrap 2 and icons provided by Glyphicons.

            Documentation is powered by phpDocumentor 2.8.5 and

            generated on 2016-09-08T10:35:38-05:00.


text:
      {{utils.back_link('Back', 'resource_list')}}
      {{title}}

  <form id="upload" class="form-horizontal" method="POST" action="{{upload_url}}" enctype='multipart/form-data'>
    <fieldset>

          <input class="file" name="file[]" data-get-upload-url="{{get_upload_url}}" type="file" multiple="multiple">

            Choose Files
            <input type="text" class="form-control">

              <button class="btn btn-default" type="button">Browse</button>

    </fieldset>
  </form>

    drop files here

Example preview!

Hola amigo

# endblock


text:
__author__ = "Stacy Smith"
__credits__ = "Jeremy Schulman, Nitin Kumar"

import unittest
from nose.plugins.attrib import attr
from mock import patch, MagicMock
import os

from jnpr.junos import Device

from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession

@attr('unit')
class TestFileList(unittest.TestCase):

    @patch('ncclient.manager.connect')
    def setUp(self, mock_connect):
        mock_connect.side_effect = self._mock_manager_setup
        self.dev = Device(host='1.1.1.1', user='rick', password='password123',
                          gather_facts=False)
        self.dev.open()

    @patch('jnpr.junos.Device.execute')
    def test_home_fact(self, mock_execute):
        mock_execute.side_effect = self._mock_manager_file_list
        self.assertEqual(self.dev.facts['HOME'],'/var/home/user')

    @patch('jnpr.junos.Device.execute')
    def test_home_fact_multi_dir(self, mock_execute):
        mock_execute.side_effect = self._mock_manager_file_list2
        self.assertEqual(self.dev.facts['HOME'],'/var/home/user')

    def _read_file(self, fname):
        from ncclient.xml_ import NCElement

        fpath = os.path.join(os.path.dirname(__file__),
                             'rpc-reply', fname)
        foo = open(fpath).read()

        rpc_reply = NCElement(foo,
                              self.dev._conn._device_handler
                              .transform_reply())._NCElement__doc[0]
        return rpc_reply

    def _mock_manager_setup(self, *args, **kwargs):
        if kwargs:
            device_params = kwargs['device_params']
            device_handler = make_device_handler(device_params)
            session = SSHSession(device_handler)
            return Manager(session, device_handler)

    def _mock_manager_file_list(self, *args, **kwargs):
        if args:
            return self._read_file('file_list_' + args[0].tag +
                                   '.xml')

    def _mock_manager_file_list2(self, *args, **kwargs):
        if args:
            return self._read_file('file_list2_' + args[0].tag +
                                   '.xml')


text:
use super::super::{HasSteeringBehavior, SteeringAcceleration, SteeringAccelerationCalculator,
                   SteeringBehavior};
use alga::general::Real;
use alga::general::AbstractModule;

use std::cell::RefMut;
use std::cell::RefCell;
use std::rc::Rc;
/// This behavior is the oposite of Seek behavior. It produces linear steering acceleration
/// to go away from target
#[builder(pattern = "immutable")]
#[derive(Builder)]
pub struct Flee<T>
where
    T: Real,
{
    /// Common behavior attributes
    pub behavior: RefCell<SteeringBehavior<T>>,
}

impl<T: Real> HasSteeringBehavior<T> for Flee<T> {
    fn get_steering_behavior(&mut self) -> RefMut<SteeringBehavior<T>> {
        self.behavior.borrow_mut()
    }
}

impl<T: Real> SteeringAccelerationCalculator<T> for Flee<T> {
    fn calculate_real_steering(
        &self,
        steering_acceleration: Rc<RefCell<SteeringAcceleration<T>>>,
    ) -> Rc<RefCell<SteeringAcceleration<T>>> {
        let behavior = self.behavior.borrow();
        steering_acceleration.borrow_mut().linear = (*behavior.owner.borrow().get_position() -
                                                         *behavior.target.borrow().get_position())
            .normalize()
            .multiply_by(match self.behavior.borrow().limiter {
                Some(ref l) => (*l).borrow().get_max_linear_acceleration(),
                None => T::one(),
            });

        steering_acceleration.borrow_mut().angular = T::zero();
        steering_acceleration
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.U370.html">

Redirecting to type.U370.html...


text:
namespace {

static const char kContextualSearchObjectName[] = "contextualSearch";
static const char kSetCaptionMethodName[] = "setCaption";

}  // namespace

namespace contextual_search {

gin::WrapperInfo ContextualSearchWrapper::kWrapperInfo = {
    gin::kEmbedderNativeGin};

// static
void ContextualSearchWrapper::Install(content::RenderFrame* render_frame) {
  // NOTE: Installing new v8 functions that can access Chrome native code
  // requires a security review!  We did an exhaustive search for a better
  // way to implement a communication channel between the page and Chrome,
  // but found nothing better.
  // TODO(donnd): use a better communication channel once that becomes
  // available, e.g. navigator.connect API. See crbug.com/541683.
  // TODO(donnd): refactor some of this boilerplate into a reusable
  // method.  This was cribbed from MemoryBenchmarkingExtension.
  v8::Isolate* isolate = blink::mainThreadIsolate();
  v8::HandleScope handle_scope(isolate);
  v8::Local<v8::Context> context =
      render_frame->GetWebFrame()->mainWorldScriptContext();
  if (context.IsEmpty())
    return;

  v8::Context::Scope context_scope(context);
  gin::Handle<ContextualSearchWrapper> wrapper =
      gin::CreateHandle(isolate, new ContextualSearchWrapper(render_frame));
  if (wrapper.IsEmpty())
    return;

  v8::Local<v8::Object> chrome =
      content::GetOrCreateChromeObject(isolate, context->Global());
  chrome->Set(gin::StringToV8(isolate, kContextualSearchObjectName),
              wrapper.ToV8());
}

ContextualSearchWrapper::ContextualSearchWrapper(
    content::RenderFrame* render_frame)
    : RenderFrameObserver(render_frame) {}

ContextualSearchWrapper::~ContextualSearchWrapper() {}

gin::ObjectTemplateBuilder ContextualSearchWrapper::GetObjectTemplateBuilder(
    v8::Isolate* isolate) {
  return gin::Wrappable<ContextualSearchWrapper>::GetObjectTemplateBuilder(
             isolate)
      .SetMethod(kSetCaptionMethodName, &ContextualSearchWrapper::SetCaption);
}

bool ContextualSearchWrapper::EnsureServiceConnected() {
  if (render_frame() && (!contextual_search_js_api_service_ ||
      !contextual_search_js_api_service_.is_bound())) {
    render_frame()->GetRemoteInterfaces()->GetInterface(
        &contextual_search_js_api_service_);
    return true;
  } else {
    return false;
  }
}

void ContextualSearchWrapper::OnDestruct() {}

void ContextualSearchWrapper::SetCaption(const std::string& caption,
                                         bool does_answer) {
  if (EnsureServiceConnected()) {
    contextual_search_js_api_service_->HandleSetCaption(caption, does_answer);
  }
}

}  // namespace contextual_search


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour {

    public float speed = 0.04f;
    public float jumpSpeed = 15f;
    public float timeToJumpAgain = 0.2f;
    public float slidingOnWallDrag = 5f;
    public bool logEnabled = false;
    public LevelController level;

    // If direction is grater or equal than 0 the player will move to right
    // otherwise the player moves left.
    private int direction = 1;
    private float timePassed = 0f;
    private bool grounded = true;
    private bool wallCollision = false;

    private Rigidbody rb;
    private Animator animator;

    void Start () {
		rb = GetComponent<Rigidbody>();
        animator = GetComponent<Animator>(); ;
    }

    private void Update() {
        timePassed += Time.deltaTime;
        changeDragIfNeeded();

        if (Input.GetButton("Jump")) {
            jump();
        }
    }

	void FixedUpdate () {
        animator.SetBool("Run", grounded && !wallCollision);
        move();
    }

    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Goal"))
        {
            level.win();
        }
        if (other.CompareTag("Trap"))
        {
            level.lose();
        }
    }

    // ----------------
    // Public Functions
    // ----------------

    // This function is called by GroundCollisionCheck when the player touches the floor.
    public void onGroundCollisionEnter() {
        Log("Player on ground collision enter");
        grounded = true;
    }

    // This function is called by GroundCollisionCheck when the player is not touching the floor.
    public void onGroundCollisionExit() {
        Log("Player on ground collision exit");
        grounded = false;
    }

    // This functions is called by WallCollisionCheck when the player touches a wall.
    public void onWallCollisionEnter() {
        Log("Player on wall collision enter");
        wallCollision = true;
    }

    // This function is called by WallCollisionCheck when the player move off from a wall.
    public void onWallCollisionExit() {
        Log("Player on wall collision exit");
        wallCollision = false;
    }

    // ----------------
    // Private Functions
    // ----------------

    private void changeDirection() {
        Log("Changing movement direction");
        if (direction == 0) {
            direction = 1;
        }
        direction *= -1;
    }

    private void move() {
        if (direction < 0) {
            transform.position += Vector3.left * speed * Time.deltaTime;
            transform.rotation = Quaternion.Euler(new Vector3(0, 180, 0));
        } else {
            transform.position += Vector3.right * speed * Time.deltaTime;
            transform.rotation = Quaternion.Euler(new Vector3(0, 0, 0));
        }
    }

    private void jump() {
        // Jump on wall
        if (!grounded && wallCollision && timePassed >= timeToJumpAgain) {
            Log("Jump on wall");
            timePassed = 0;
            changeDirection();
            rb.velocity = new Vector3(rb.velocity.x, jumpSpeed, rb.velocity.z);
            animator.SetTrigger("Jump");
        }

        // Normal jump
        if (grounded) {
            Log("Normal jump");
            timePassed = 0;
            grounded = false;
            rb.velocity = new Vector3(rb.velocity.x, jumpSpeed, rb.velocity.z);
            animator.SetTrigger("Jump");
        }
    }

    private void Log(string message) {
        if (logEnabled) {
            Debug.Log(message);
        }
    }

    private void changeDragIfNeeded() {
        // This code simulates sliding down a wall
        // when the player falls touching a wall
        if (wallCollision && rb.velocity.y < 0) {
            Log("Sliding down a wall");
            rb.drag = slidingOnWallDrag;
            animator.SetBool("Grab", true);
        } else {
            rb.drag = 0;
            animator.SetBool("Grab", false);
        }
    }

}


text:
<TITLE>Review for Lost World: Jurassic Park, The (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Lost World: Jurassic Park, The (1997)

reviewed by
Ben Hoffman

                      THE LOST WORLD: JURASSIC PARK
                       A film review by Ben Hoffman
                        Copyright 1997 Ben Hoffman

Anyone who has seen the original JURASSIC PARK will surely want to see
the sequel.  As with the first, it is filled with dinosaurs, both big
and little, more menacing than I recall in the one that preceded this.
For this reason, it is incumbent upon me to suggest that parents of
children under 9-years-old and those of sensitive 10-year-olds take
their offspring to other movies.    It is a bit frightening to see a
couple of tyrannosaurs  engaged in pulling apart a human they have
captured, or to see hundreds of little dinosaurs about the size of
small geese, poke out the eyes of humans, chew at their lips and
cheeks.   It is a kind of THE BIRDS except with dinosaurs.

Then, too, the photography. like much of the story, is dark.  Hardly
any daylight, sunlight, penetrates the huge trees and brush of the
dense forest.   This, when it is in the whole movie, is in itself
depressing.  Nevertheless, the special effects are, as expected,
spectacular though not more so than in the original.  For one thing,
the dinosaurs do not come across as shocking, surprising, as when
first seen in JURASSIC PARK.  There really is nothing here to compare
with our first view in the 1993 version of the dinosaur lifting its
head above the trees in a graceful movement that astonished and
delighted us.    While it is true that THE LOST WORLD utilizes new
computer technology to make the animals move more gracefully, the
improvement was not noticeable.   The original Jurassic Park was
spectacularly wonderful with  Live Action Dinosaurs' Stan Winston in
charge both then and now.

As for the story:  You will recall that John Hammond had discovered
that embedded in amber were bits of DNA.  He was able to utilize the
DNA to grow full- sized prehistoric animals.  It was his dream to have
an amusement park on an island off Costa Rica where visitors could
come to view the dinosaurs and other beasts.  The park was going to be
foolproof safe. Dr. Ian Malcolm, a brilliant mathematician, said there
was no such thing as 100% safe.  As predicted, disaster struck and
everyone fled the island and all the prehistoric animals died . . . or
so everyone thought.

Four years have elapsed since John Hammond's dream came to a disastrous
end. Just when it was believed that the dinosaurs and other prehistoric
animals had all died, it now appears that there were some survivors
living on the nearby island of Isla Sorna where they were free of human
interference   Having learned his lesson that one must not tamper with
nature, Hammond (in this version played by Richard Attenborough) wants
sightseers kept away and the island policed so the prehistoric animals
can live in  peaceful surroundings. To this end, he talks
mathematician Ian  Malcolm (Jeff Goldblum) into overseeing that his
wishes come true.  Things do not quite work out that way.

Others hired by Hammond for chronicling of the island's inhabitants are
paleontologist  Sarah Harding (Julianne Moore),  maker of video
documentaries (Vince Vaughn) and a field equipment specialist (Richard
Schiff) to enable the three to carry on their mission.

The film's villain is Hammond's money-hungry nephew, Peter Ludlow
(Arliiss Howard), who takes control of the company and sets out to
breed the creatures, bring them to the island and set it up as another
Park. Ludlow hires an adventurer, Roland Tembo (Pete Postlethwaite) to
be in charge on the island.

Also in the cast is young Kelly, (Vanessa Lee Chester) who stowed away
on the ship going to the island where deadly dinosaurs roam.   Little
did Kelly know what she was going to experience.

Music composed by John Williams.

If you loved JURASSIC PARK, as almost everyone apparently did, and you
want more of the same, THE LOST WORLD  will again turn you on.

Based on  Michael Crichton's novel, THE LOST WORLD.

Directed by Steven Spielberg.

2.5 Bytes

4 Bytes = Superb
3 Bytes = Too good to miss
2 Bytes = Average
1 Byte  = Save your money

Ben Hoffman

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
const CGFloat kStatusBarAnimationDuration = .3f;
const CGFloat kStatusBarAnimationDelay = .5f;

static MSStatusBarWindow *__sharedStatusBarWindow;

@interface MSStatusBarWindow()
@property (nonatomic, retain) NSMutableArray *array;
@property (nonatomic, assign) BOOL isAnimating;
@property (nonatomic, retain) UIView<MSStatusBarUpdating> *statusBar0;
@property (nonatomic, retain) UIView<MSStatusBarUpdating> *statusBar1;
@end

@implementation MSStatusBarWindow
@synthesize array = _array;
@synthesize isAnimating = _isAnimating;
@synthesize statusBar0 = _statusBar0;
@synthesize statusBar1 = _statusBar1;

+ (MSStatusBarWindow *)sharedManager
{
    @synchronized(self) {
        if (__sharedStatusBarWindow == nil) {
            __sharedStatusBarWindow = [[MSStatusBarWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];
        }
    }

    return __sharedStatusBarWindow;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];

    if (self) {
        self.clipsToBounds = YES;
        self.windowLevel = UIWindowLevelStatusBar + 1.0f;
        self.frame = [UIApplication sharedApplication].statusBarFrame;
        self.array = [NSMutableArray array];
        self.isAutoHidden = YES;
        _isSwaped = NO;
    }
    return self;
}

+ (void)showStatusBarWithModel:(id<MSStatusBarModel>)data
{
    [self hiddenStatusBarAnimated:NO];
    [[MSStatusBarWindow sharedManager].array addObject:data];
    [[MSStatusBarWindow sharedManager] showStartStatusBar];
}

+ (void)showStatusBarWithData:(id<MSStatusBarModel>)data
                  autoDismiss:(BOOL)autoDismiss
{
    [self hiddenStatusBarAnimated:NO];
    [[MSStatusBarWindow sharedManager].array addObject:data];
    [[MSStatusBarWindow sharedManager] showStartStatusBar];
}

+ (void)showStatusBarWithArray:(NSArray *)array
{
    [self hiddenStatusBarAnimated:NO];
    [[MSStatusBarWindow sharedManager].array addObjectsFromArray:array];
    [[MSStatusBarWindow sharedManager] showStartStatusBar];
}

+ (void)hiddenStatusBarAnimated:(BOOL)animated
{
    if (animated) {
        [MSStatusBarWindow sharedManager].alpha = 1.f;
        [UIView animateWithDuration:kStatusBarAnimationDuration animations:^{
            [MSStatusBarWindow sharedManager].alpha = 0.f;
        } completion:^(BOOL finished) {
            if (finished) {
                [MSStatusBarWindow sharedManager].hidden = YES;
                [[MSStatusBarWindow sharedManager].array removeAllObjects];
                for (UIView *view in [MSStatusBarWindow sharedManager].subviews) {
                    [view removeFromSuperview];
                }
                [MSStatusBarWindow sharedManager].statusBar0 = nil;
                [MSStatusBarWindow sharedManager].statusBar1 = nil;
                [MSStatusBarWindow sharedManager].isAnimating = NO;
            }
        }];
    }
    else{
        [MSStatusBarWindow sharedManager].hidden = YES;
        [[MSStatusBarWindow sharedManager].array removeAllObjects];
        for (UIView *view in [MSStatusBarWindow sharedManager].subviews) {
            [view removeFromSuperview];
        }
        [MSStatusBarWindow sharedManager].statusBar0 = nil;
        [MSStatusBarWindow sharedManager].statusBar1 = nil;
        [MSStatusBarWindow sharedManager].isAnimating = NO;
    }
}

- (UIView<MSStatusBarUpdating> *)currentStatusBar
{
    return _isSwaped ? _statusBar1 : _statusBar0;
}

- (UIView<MSStatusBarUpdating> *)nextStatusBar
{
    return _isSwaped ? _statusBar0 : _statusBar1;
}

- (BOOL)hasNext
{
    if ([[MSStatusBarWindow sharedManager].array count] > 0) {
        return YES;
    }

    return NO;
}

- (void)showStartStatusBar
{
    if (![self hasNext] || _isAnimating) {
        return;
    }

    [MSStatusBarWindow sharedManager].hidden = NO;
    [MSStatusBarWindow sharedManager].alpha = 1.f;

    if ([[MSStatusBarWindow sharedManager].array count] > 0) {
        id<MSStatusBarModel> data = [[MSStatusBarWindow sharedManager].array objectAtIndex:0];
        UIView<MSStatusBarUpdating> *view = [data statusBarWithData:data];
        if (_isSwaped) {
            _statusBar1 = view;
        }
        else {
            _statusBar0 = view;
        }
        [view updateStatusBar:data];
        [self addSubview:view];
    }

    if ([[MSStatusBarWindow sharedManager].array count] > 1) {
        id<MSStatusBarModel> data = [[MSStatusBarWindow sharedManager].array objectAtIndex:1];
        UIView<MSStatusBarUpdating> *view = [data statusBarWithData:data];
        if (_isSwaped) {
            _statusBar0 = view;
        }
        else {
            _statusBar1 = view;
        }
        [view updateStatusBar:data];
        [self addSubview:view];
    }

    if ([[MSStatusBarWindow sharedManager].array count] == 1) {
        [self playSingleAnimation];
    }
    else {
        [self playMultiStartAnimation];
    }
}

- (void)showNextStatusBar
{
    if (![self hasNext] || _isAnimating) {
        return;
    }

    [MSStatusBarWindow sharedManager].hidden = NO;
    [MSStatusBarWindow sharedManager].alpha = 1.f;

    if ([[MSStatusBarWindow sharedManager].array count] > 1) {
        id<MSStatusBarModel> data = [[MSStatusBarWindow sharedManager].array objectAtIndex:1];
        UIView<MSStatusBarUpdating> *view = [data statusBarWithData:data];
        if (_statusBar0 == nil) {
            _statusBar0 = view;
        }
        else if (_statusBar1 == nil){
            _statusBar1 = view;
        }
        [view updateStatusBar:data];
        [self addSubview:view];
    }

    if ([[MSStatusBarWindow sharedManager].array count] == 1) {
        [self playMultiEndAnimation];
    }
    else {
        [self playMultiNextAnimation];
    }
}

- (void)playSingleAnimation
{
    if (_isAnimating) {
        return;
    }

    _isAnimating = YES;

    UIView *currentView = _statusBar0 ? _statusBar0 : _statusBar1;

    currentView.frame = [self currentStatusBarDesFrame];

    currentView.alpha = 0.f;
    [UIView animateWithDuration:kStatusBarAnimationDuration animations:^{
        currentView.alpha = 1.f;
        currentView.frame = [self currentStatusBarDesFrame];

    } completion:^(BOOL finished) {
        if (finished) {
            if (self.isAutoHidden) {
                currentView.alpha = 1.f;
                [UIView animateWithDuration:kStatusBarAnimationDuration
                                      delay:kStatusBarAnimationDelay
                                    options:UIViewAnimationOptionCurveEaseInOut
                                 animations:^{
                    currentView.alpha = 0.f;
                } completion:^(BOOL finished) {
                    if (finished) {
                        // 出列
                        [[MSStatusBarWindow sharedManager].array removeAllObjects];
                        [currentView removeFromSuperview];
                        _statusBar0 = nil;
                        _statusBar1 = nil;

                        _isAnimating = NO;
                    }
                }];
            }
        }
    }];
}

- (void)playMultiStartAnimation
{
    UIView *currentView = [self currentStatusBar];
    UIView *nextView = [self nextStatusBar];

    currentView.frame = [self currentStatusBarOriginFrame];
    nextView.frame = [self nextStatusBarOriginFrame];
    [UIView animateWithDuration:kStatusBarAnimationDuration
                     animations:^{
        currentView.frame = [self currentStatusBarDesFrame];
        nextView.frame = [self nextStatusBarDesFrame];

    } completion:^(BOOL finished) {
        if (finished) {
            [UIView animateWithDuration:kStatusBarAnimationDuration
                                  delay:kStatusBarAnimationDelay
                                options:UIViewAnimationOptionCurveEaseInOut
                             animations:^{
                                 currentView.frame = [self dismissStatusBarDesFrame];
                                 nextView.frame = [self currentStatusBarDesFrame];

                             } completion:^(BOOL finished) {
                                 if (finished) {
                                     // 出列
                                     if([[MSStatusBarWindow sharedManager].array count] > 0) {
                                         [[MSStatusBarWindow sharedManager].array removeObjectAtIndex:0];
                                     }

                                     if (_statusBar0.frame.origin.y == [self dismissStatusBarDesFrame].origin.y) {
                                         [_statusBar0 removeFromSuperview];
                                         _statusBar0 = nil;
                                     }
                                     else if (_statusBar1.frame.origin.y == [self dismissStatusBarDesFrame].origin.y) {
                                         [_statusBar1 removeFromSuperview];
                                         _statusBar1 = nil;
                                     }

                                     _isSwaped = !_isSwaped;
                                     _isAnimating = NO;

                                     if ([self hasNext]) {
                                         [self showNextStatusBar];
                                     }
                                 }
                             }];
        }
    }];
}

- (void)playMultiNextAnimation
{
    UIView *currentView = [self currentStatusBar];
    UIView *nextView = [self nextStatusBar];

    currentView.frame = [self currentStatusBarDesFrame];
    nextView.frame = [self currentStatusBarOriginFrame];
    [UIView animateWithDuration:kStatusBarAnimationDuration
                          delay:kStatusBarAnimationDelay
                        options:UIViewAnimationOptionCurveEaseInOut
                     animations:^{
                         currentView.frame = [self dismissStatusBarDesFrame];
                         nextView.frame = [self currentStatusBarDesFrame];

                     } completion:^(BOOL finished) {
                         if (finished) {
                             // 出列
                             if([[MSStatusBarWindow sharedManager].array count] > 0) {
                                 [[MSStatusBarWindow sharedManager].array removeObjectAtIndex:0];
                             }

                             if (_statusBar0.frame.origin.y == [self dismissStatusBarDesFrame].origin.y) {
                                 [_statusBar0 removeFromSuperview];
                                 _statusBar0 = nil;
                             }
                             else if (_statusBar1.frame.origin.y == [self dismissStatusBarDesFrame].origin.y) {
                                 [_statusBar1 removeFromSuperview];
                                 _statusBar1 = nil;
                             }

                             _isSwaped = !_isSwaped;
                             _isAnimating = NO;

                             if ([self hasNext]) {
                                 [self showNextStatusBar];
                             }
                         }
                     }];
}

- (void)playMultiEndAnimation
{
    UIView *currentView = _statusBar0 ? _statusBar0 : _statusBar1;

    currentView.frame = [self currentStatusBarDesFrame];

    [UIView animateWithDuration:kStatusBarAnimationDuration
                     animations:^{
        currentView.frame = [self currentStatusBarDesFrame];

    } completion:^(BOOL finished) {
        if (finished) {
            if (!self.isAutoHidden && [[MSStatusBarWindow sharedManager].array count] == 1) {
                // 不是自动隐藏 且只有自己一个
                // 那就一直显示着
            }
            else{
                currentView.alpha = 1.f;
                [UIView animateWithDuration:kStatusBarAnimationDuration
                                      delay:kStatusBarAnimationDelay
                                    options:UIViewAnimationOptionCurveEaseInOut
                                 animations:^{

                    currentView.alpha = 0.f;

                } completion:^(BOOL finished) {
                    if (finished) {
                        // 出列
                        if([[MSStatusBarWindow sharedManager].array count] > 0) {
                            [[MSStatusBarWindow sharedManager].array removeObjectAtIndex:0];
                        }

                        [currentView removeFromSuperview];
                        if (_statusBar0) {
                            _statusBar0 = nil;
                        }
                        if (_statusBar1) {
                            _statusBar1 = nil;
                        }

                        _isAnimating = NO;

                        // 虽然是播放最后的动画, 如果在动画期间又添加新的model, 则继续播放
                        if ([self hasNext]) {
                            [self showNextStatusBar];
                        }
                    }
                }];
            }
        }
    }];
}

# pragma mark - frames

- (CGRect)currentStatusBarOriginFrame
{
    return CGRectMake(0, self.frame.size.height, self.frame.size.width, self.frame.size.height);
}

- (CGRect)nextStatusBarOriginFrame
{
    return CGRectMake(0, self.frame.size.height * 2, self.frame.size.width, self.frame.size.height);
}

- (CGRect)currentStatusBarDesFrame
{
    return CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}

- (CGRect)nextStatusBarDesFrame
{
    return CGRectMake(0, self.frame.size.height, self.frame.size.width, self.frame.size.height);
}

- (CGRect)dismissStatusBarDesFrame
{
    return CGRectMake(0, -self.frame.size.height, self.frame.size.width, self.frame.size.height);
}

@end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">

    <title>Dummy Experiment</title>

    <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/>

                <input type="text" id="initial_input"></input>
                <input type="file" id="initial_file"></input>

Main block

                <input type="text" id="command_input" value="Sample command"><button class="btn btn-primary" id="main_button">Send this message (or type 'exit' to exit)</button>

Experiment server response to command:

Experiment server response to file:


text:
***************************
Metropolis Random Walk MCMC
***************************

.. currentmodule:: pints

.. autoclass:: MetropolisRandomWalkMCMC


text:
<?php

declare(strict_types=1);

namespace AltThree\Login;

use AltThree\Login\Exceptions\InvalidStateException;
use AltThree\Login\Exceptions\IsBlacklistedException;
use AltThree\Login\Exceptions\NoAccessTokenException;
use AltThree\Login\Exceptions\NotWhitelistedException;
use AltThree\Login\Models\Config;
use AltThree\Login\Models\Token;
use AltThree\Login\Providers\ProviderInterface;
use Exception;
use GuzzleHttp\ClientInterface;
use Illuminate\Contracts\Session\Session;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Str;

/**
 * This is the login client class.
 *
 * @author Graham Campbell <graham@alt-three.com>
 */
class LoginClient
{
    /**
     * The underlying provider.
     *
     * @var \AltThree\Login\Providers\ProviderInterface
     */
    protected $provider;

    /**
     * The provider config.
     *
     * @var \AltThree\Login\Models\Config
     */
    protected $config;

    /**
     * The guzzle http client.
     *
     * @var \GuzzleHttp\ClientInterface
     */
    protected $client;

    /**
     * Create a new login client instance.
     *
     * @param \AltThree\Login\Providers\ProviderInterface $provider
     * @param \AltThree\Login\Models\Config               $config
     * @param \GuzzleHttp\ClientInterface                 $client
     *
     * @return void
     */
    public function __construct(ProviderInterface $provider, Config $config, ClientInterface $client)
    {
        $this->provider = $provider;
        $this->config = $config;
        $this->client = $client;
    }

    /**
     * Redirect the user of the application to the provider's authentication screen.
     *
     * @param \Illuminate\Contracts\Session\Session $session
     * @param string[]|null                         $scopes
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function redirect(Session $session, array $scopes = null)
    {
        $state = Str::random(40);

        $session->put('state', $state);

        return new RedirectResponse($this->buildAuthUrlFromBase($this->provider->getRedirectUrl(), $state, $scopes));
    }

    /**
     * Get the authentication url for the provider.
     *
     * @param string        $url
     * @param string        $state
     * @param string[]|null $scopes
     *
     * @return string
     */
    protected function buildAuthUrlFromBase(string $url, string $state, array $scopes = null)
    {
        $query = [
            'client_id'     => $this->config->clientId,
            'redirect_uri'  => $this->config->redirectUrl,
            'response_type' => 'code',
            'state'         => $state,
        ];

        if ($scopes !== null) {
            $query['scope'] = implode(',', $scopes);
        }

        return $url.'?'.http_build_query($query, '', '&');
    }

    /**
     * Get the authenticated user's details.
     *
     * @param \Illuminate\Contracts\Session\Session $session
     * @param string                                $state
     * @param string                                $code
     *
     * @throws \AltThree\Login\Exceptions\CannotAccessEmailsException
     * @throws \AltThree\Login\Exceptions\InvalidEmailException
     * @throws \AltThree\Login\Exceptions\InvalidStateException
     * @throws \AltThree\Login\Exceptions\IsBlacklistedException
     * @throws \AltThree\Login\Exceptions\NoAccessTokenException
     * @throws \AltThree\Login\Exceptions\NoEmailException
     * @throws \AltThree\Login\Exceptions\NotWhitelistedException
     *
     * @return \AltThree\Login\Models\User
     */
    public function user(Session $session, string $state, string $code)
    {
        $sessionState = (string) $session->pull('state');

        // checking the session state is a sanity check to ensure we don't end
        // up matching the empty string against the empty string due to expiry
        if (strlen($sessionState) !== 40 || !hash_equals($sessionState, $state)) {
            throw new InvalidStateException('We could not verify the request was genuine.');
        }

        // get the user model from the underlying provider
        return $this->getUserByToken($this->getToken($code));
    }

    /**
     * Get a new token, given an authorization code.
     *
     * @param string $code
     *
     * @throws \AltThree\Login\Exceptions\NoAccessTokenException
     *
     * @return \AltThree\Login\Models\Token
     */
    public function getToken(string $code)
    {
        return $this->requestToken([
            'code'         => $code,
            'grant_type'   => 'authorization_code',
            'redirect_uri' => $this->config->redirectUrl,
        ]);
    }

    /**
     * Get a new token, given a refresh token.
     *
     * @param string $refresh
     *
     * @throws \AltThree\Login\Exceptions\NoAccessTokenException
     *
     * @return \AltThree\Login\Models\Token
     */
    public function refreshToken(string $refresh)
    {
        return $this->requestToken([
            'grant_type'    => 'refresh_token',
            'refresh_token' => $refresh,
        ]);
    }

    /**
     * Request the token for the given params.
     *
     * @param array $params
     *
     * @throws \AltThree\Login\Exceptions\NoAccessTokenException
     *
     * @return \AltThree\Login\Models\Token
     */
    protected function requestToken(array $params)
    {
        $client = [
            'client_id'     => $this->config->clientId,
            'client_secret' => $this->config->clientSecret,
        ];

        try {
            $response = $this->client->post($this->provider->getTokenUrl(), [
                'headers'     => ['Accept' => 'application/json'],
                'form_params' => array_merge($client, $params),
            ]);
        } catch (Exception $e) {
            throw new NoAccessTokenException('We were unable to retrieve your access token.', $e->getCode(), $e);
        }

        $data = (array) json_decode((string) $response->getBody(), true);

        // ensure that a bearer access token was returned
        if (!isset($data['access_token']) || !isset($data['token_type']) || $data['token_type'] !== 'bearer') {
            throw new NoAccessTokenException('No access token was provided.');
        }

        return new Token($data['access_token'], $data['refresh_token'] ?? null, $data['expires_in'] ?? null);
    }

    /**
     * Get the raw user for the given access token.
     *
     * @param \AltThree\Login\Models\Token $token
     *
     * @throws \AltThree\Login\Exceptions\CannotAccessEmailsException
     * @throws \AltThree\Login\Exceptions\InvalidEmailException
     * @throws \AltThree\Login\Exceptions\IsBlacklistedException
     * @throws \AltThree\Login\Exceptions\NoEmailException
     * @throws \AltThree\Login\Exceptions\NotWhitelistedException
     *
     * @return \AltThree\Login\Models\User
     */
    protected function getUserByToken(Token $token)
    {
        return $this->provider->getUserByToken($this->client, $token, function (int $id) {
            if ($this->config->allowed && !in_array($id, $this->config->allowed)) {
                throw new NotWhitelistedException("The user {$id} is not whitelisted.");
            }

            if (in_array($id, $this->config->blocked)) {
                throw new IsBlacklistedException("The user {$id} is blacklisted.");
            }
        });
    }
}


text:
require 'test/unit'
$-w = true
require 'kgio'

class TestCrossThreadClose < Test::Unit::TestCase

  def test_cross_thread_close
    host = ENV["TEST_HOST"] || '127.0.0.1'
    srv = Kgio::TCPServer.new(host, 0)
    thr = Thread.new do
      begin
        srv.kgio_accept
      rescue => e
        e
      end
    end
    sleep(0.1) until thr.stop?
    srv.close
    unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
           RUBY_VERSION == "1.9.3"
      thr.run rescue nil
    end
    thr.join
    assert_kind_of IOError, thr.value
  end
end if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"


text:
@implementation UIView (SZVisuals)

- (void)sz_cornerRadius:(CGFloat)radius strokeSize:(CGFloat)size color:(UIColor *)color {
    self.layer.cornerRadius = radius;
    self.layer.borderColor = color.CGColor;
    self.layer.borderWidth = size;
    self.layer.masksToBounds = YES;
}

- (void)sz_setRoundedCorners:(UIRectCorner)corners radius:(CGFloat)radius {
    CGRect rect = self.bounds;

    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect
                                                   byRoundingCorners:corners
                                                         cornerRadii:CGSizeMake(radius, radius)];

    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.frame = rect;
    maskLayer.path = maskPath.CGPath;

    self.layer.mask = maskLayer;
}

- (void)sz_shadowWithColor:(UIColor *)color
                    offset:(CGSize)offset
                   opacity:(CGFloat)opacity
                    radius:(CGFloat)radius {
    self.clipsToBounds = NO;
    self.layer.shadowColor = color.CGColor;
    self.layer.shadowOffset = offset;
    self.layer.shadowOpacity = opacity;
    self.layer.shadowRadius = radius;
}

- (void)sz_removeFromSuperviewWithFadeDuration:(NSTimeInterval)duration {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(removeFromSuperview)];
    self.alpha = 0.0;
    [UIView commitAnimations];
}

- (void)sz_addSubview:(UIView *)subview withTransition:(UIViewAnimationTransition)transition duration:(NSTimeInterval)duration {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationTransition:transition forView:self cache:YES];
    [self addSubview:subview];
    [UIView commitAnimations];
}

- (void)sz_removeFromSuperviewWithTransition:(UIViewAnimationTransition)transition duration:(NSTimeInterval)duration {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationTransition:transition forView:self.superview cache:YES];
    [self removeFromSuperview];
    [UIView commitAnimations];
}

- (void)sz_rotateByAngle:(CGFloat)angle
                duration:(NSTimeInterval)duration
             autoreverse:(BOOL)autoreverse
             repeatCount:(CGFloat)repeatCount
          timingFunction:(CAMediaTimingFunction *)timingFunction {
    CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    rotation.toValue = [NSNumber numberWithFloat:degToRad(angle)];
    rotation.duration = duration;
    rotation.repeatCount = repeatCount;
    rotation.autoreverses = autoreverse;
    rotation.removedOnCompletion = NO;
    rotation.fillMode = kCAFillModeBoth;
    rotation.timingFunction = timingFunction != nil ? timingFunction :[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.layer addAnimation:rotation forKey:@"rotationAnimation"];
}

- (void)sz_moveToPoint:(CGPoint)newPoint
              duration:(NSTimeInterval)duration
           autoreverse:(BOOL)autoreverse
           repeatCount:(CGFloat)repeatCount
        timingFunction:(CAMediaTimingFunction *)timingFunction {
    CABasicAnimation *move = [CABasicAnimation animationWithKeyPath:@"position"];
    move.toValue = [NSValue valueWithCGPoint:newPoint];
    move.duration = duration;
    move.removedOnCompletion = NO;
    move.repeatCount = repeatCount;
    move.autoreverses = autoreverse;
    move.fillMode = kCAFillModeBoth;
    move.timingFunction = timingFunction != nil ? timingFunction :[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.layer addAnimation:move forKey:@"positionAnimation"];
}

@end