text:
//// Copyright (c) Microsoft Corporation. All rights reserved

(function () {

    var d = Windows.Foundation.Diagnostics;

    /// <summary>
    /// Demonstrate usage of LoggingChannel and LoggingActivity.
    /// </summary>
    var LoggingChannelScenario = WinJS.Class.define(
        function () {
        },
        {
            /// <summary>
            /// Construct a LoggingChannel with the Windows 8.1 constructor, then
            /// use the LoggingChannel for the scenario.
            /// </summary>
            logWithWin81Constructor: function () {
                /*
                You can collect the events generated by this method with xperf or another
                ETL controller tool. To collect these events in an ETL file:

                xperf -start MySession -f MyFile.etl -on 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a
                (run the sample and click the "Windows 8.1 behavior" button)
                xperf -stop MySession

                After collecting the ETL file, you can decode the trace using xperf, wpa,
                or tracerpt. For example, to decode MyFile.etl with tracerpt:

                tracerpt MyFile.etl
                (generates dumpfile.xml)

                Note that decoding TraceLogging events requires Windows 10. Earlier versions
                of Windows can only reliably decode the simple (manifest-based) events.
                */

                /*
                If a LoggingChannel is created using the 1-parameter constructor, it
                will use Windows 8.1 semantics:

                - The channel's ETW Id is always "4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a".
                - The channel's ETW Name is is always
                  "Microsoft-Windows-Diagnostics-LoggingChannel".
                - A LoggingChannelName field containing the Channel Name is automatically
                  added to each event.
                - Simple events will be written using manifested-event encoding.

                Note that complex events can be written even when using Windows 8.1 mode.
                Complex events always use TraceLogging encoding.

                The 1-parameter constructor is marked as obsolete to ensure that
                developers are aware of the changes in semantics. The Windows 10 semantics
                are useful because they enable use of the ETW Provider Id for event
                filtering.
                */

                /*
                If a LoggingChannel is used as a local or member variable, it should
                be closed (disposed) when no longer needed.
                */

                {
                    // The 1-parameter constructor creates a channel with Windows 8.1 semantics.
                    var channel = new d.LoggingChannel("SampleProvider");

                    // The Id for a Windows 8.1-mode channel is always the same.
                    // channel.Id == 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a

                    this.demonstrateLogging(channel);
                    channel.close();
                }
            },

            /// <summary>
            /// Construct a LoggingChannel with the Windows 10 constructor, then
            /// use the LoggingChannel for the scenario. Also show the use cases
            /// for the two Windows 10 constructors.
            /// </summary>
            logWithWin10Constructor: function () {
                /*
                You can collect the events generated by this method with xperf or another
                ETL controller tool. To collect these events in an ETL file:

                xperf -start MySession -f MyFile.etl -on eff1e128-4903-5093-096a-bdc29b38456f
                (run the sample and click the "Windows 10 behavior" button)
                xperf -stop MySession

                After collecting the ETL file, you can decode the trace using xperf, wpa,
                or tracerpt. For example, to decode MyFile.etl with tracerpt:

                tracerpt MyFile.etl
                (generates dumpfile.xml)

                Note that decoding TraceLogging events requires Windows 10. Earlier versions
                of Windows can only reliably decode the simple (manifest-based) events.
                */

                /*
                If a LoggingChannel is created using the 2-parameter or 3-parameter
                constructors, it will use Windows 10 semantics:

                - The channel's ETW Provider Id can be controlled by the developer.
                - The channel's ETW Name is the same as the Channel Name.
                - The LoggingChannelName field is not automatically added to each event.
                - All events will be written using TraceLogging encoding.

                The 1-parameter constructor is marked as obsolete to ensure that
                developers are aware of the changes in semantics. The Windows 10 semantics
                are useful because they enable use of the ETW Provider Id for event
                filtering.

                The 2-parameter constructor accepts a channel name and channel options.
                If the options parameter is null, default options are used. At present,
                the only available option is the channel's group GUID. When using the
                2-parameter constructor, the channel's ETW Id is determined by hashing
                the channel name. (The hashing algorithm is the same as the one used by
                the .NET EventSource class.)

                The 3-parameter constructor accepts channel name, channel options, and
                the ETW Id. This constructor should be used when you need your channel
                to use a specific ETW Id and cannot use the default hashed channel name
                as your ETW Id.
                */

                /*
                If a LoggingChannel is used as a local or member variable, it should
                be closed (disposed) when no longer needed.
                */

                {
                    // The 2-parameter constructor creates a channel with Windows 10 semantics.
                    var channel = new d.LoggingChannel(
                        "SampleProvider",
                        null); // null means use default options.

                    // The Id is generated by hashing the string "SampleProvider".
                    // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f

                    this.demonstrateLogging(channel);

                    channel.close();
                }

                /*
                Demonstrate other (less-common) constructor scenarios:
                */

                {
                    // This creates a channel with Windows 10 semantics and declared
                    // membership in a provider group.
                    var channel = new d.LoggingChannel(
                        "SampleProvider",
                        new d.LoggingChannelOptions("2e0582f3-d1b6-516a-9de3-9fd79ef952f8")); // Join a provider group

                    // The Id is generated by hashing the string "SampleProvider".
                    // channel.Id == eff1e128-4903-5093-096a-bdc29b38456f
                }

                {
                    // This creates a channel with Windows 10 semantics and a specific
                    // provider Id.
                    var channel = new d.LoggingChannel(
                        "SampleProvider",
                        null,
                        "2e0582f3-d1b6-516a-9de3-9fd79ef952f8");
                    // channel.Id == 2e0582f3-d1b6-516a-9de3-9fd79ef952f8
                }
            },

            /// <summary>
            /// This method demonstrates the LoggingChannel and LoggingActivity APIs.
            /// </summary>
            /// <param name="channel">
            /// The channel to use for the demonstration. This channel may have been
            /// constructed using a Windows 8.1 constructor or a Windows 10 constructor.
            /// The same APIs are supported in both cases, but the ETL events will be
            /// formatted a bit differently depending on how the channel was constructed.
            /// </param>
            demonstrateLogging: function (channel) {
                // Whenever any ETW session changes the way it is listening to this
                // channel, the LoggingEnable event is fired. For example, this might
                // be called when a session begins listening, changes the level at
                // which it is listening, or stops listening.
                channel.addEventListener("loggingenabled", this.onLoggingEnabled);

                // Log simple string events
                channel.logMessage("Simple message"); // default level is Verbose
                channel.logMessage("Simple error", d.LoggingLevel.error);

                // Log simple string + integer events.
                channel.logValuePair("Simple message", 123); // default level is Verbose
                channel.logValuePair("Simple error", 456, d.LoggingLevel.error);

                // The channel.Name property returns the name that was used when the
                // channel was constructed. When running in Windows 10 mode, the name
                // is already set as the provider name, so no LoggingChannelName is
                // automatically added to the event.
                channel.logMessage(channel.name);

                // The channel.Id property is new to Windows 10.
                channel.logMessage(channel.id.toString());

                // If you want to avoid the overhead of collecting data when nobody is
                // listening to your channel, check the Enabled property before logging.
                if (channel.enabled)
                {
                    channel.logMessage(this.collectExpensiveData());
                }

                // The IsEnabled() method is exactly the same as the Enabled property,
                // except that it is a new Windows 10 API.
                if (channel.isEnabled())
                {
                    channel.logMessage(this.collectExpensiveData());
                }

                // If you want to only collect data if somebody is listening at a specific
                // level, you need to check both Enabled and Level. Note that the value of
                // the Level is unspecified when Enabled is false.
                if (channel.enabled && channel.level <= d.LoggingLevel.warning)
                {
                    channel.logMessage(this.collectExpensiveData(), d.LoggingLevel.warning);
                }

                // The IsEnabled(LoggingLevel) method is a bit nicer than checking both
                // Enabled and Level, but it is only available on Windows 10 or later.
                if (channel.isEnabled(d.LoggingLevel.warning))
                {
                    channel.logMessage(this.collectExpensiveData(), d.LoggingLevel.warning);
                }

                // You can also use IsEnabled to check for keywords.
                if (channel.isEnabled(d.LoggingLevel.information, 0x10))
                {
                    channel.logMessage(this.collectExpensiveData(), d.LoggingLevel.information);
                }

                // Use LoggingFields with the LogEvent method to write complex events.
                var fields = new d.LoggingFields();
                fields.addDouble("pi", 3.14159);
                channel.logEvent(
                    "ComplexEvent",
                    fields,
                    d.LoggingLevel.verbose,
                    new d.LoggingOptions(0x10)); // Keywords = 0x10

                // You can add any number of name-value pairs to a fields object, though
                // you may encounter ETW limitations if you add too many. For example,
                // ETW is limited to a maximum event size of 64KB, and the current
                // TraceLogging decoder can handle no more than 128 fields.

                // Performance optimization: You can reuse a LoggingFields object to
                // avoid unnecessary allocations. Don't forget to call Clear()
                // between uses, and don't try to share a LoggingFields object between
                // threads.
                fields.clear();
                fields.addDateTime("Date", new Date());
                channel.logEvent("Now", fields);

                fields.clear();

                // You can add a formatting hint to affect the way a value is decoded.
                // Not all combinations are useful, and the hint may be ignored.
                // For example, you can encode an MBCS string by writing a byte array
                // with a String hint.
                fields.addUInt8Array(
                    "AnsiString",
                    [ 65, 66, 67, 49, 50, 51 ], // "ABC123"
                    d.LoggingFieldFormat.string);

                // You can add "tag" bits to a field. These are user-defined bits that
                // can be used to communicate with an event processing tool. For example,
                // you might define a tag bit to indicate that a field contains private
                // data that should not be displayed on-screen.
                fields.addString("Password", "12345", d.LoggingFieldFormat.default, 0x10);

                // You can add a "structure" to an event. A structure is a name for a
                // group of fields. Structures can nest. Call BeginStruct to add a level
                // of nesting, and call EndStruct after the last field of the structure.
                fields.beginStruct("Nested");
                    fields.addInt16("Nested-1", 1);
                    fields.addInt16("Nested-2", 2);
                    fields.beginStruct("Nested-Nested");
                        fields.addInt16("Nested-Nested-3", 3);
                    fields.endStruct();
                    fields.addInt16("Nested-4", 4);
                fields.endStruct();

                // Advanced scenarios: you can use a LoggingOptions object to control
                // detailed event settings such as keywords, opcodes, and activity Ids.
                // These have their normal ETW semantics. You can also set event tags,
                // which are bit values that can be used to communicate with the event
                // processor.
                var options = new d.LoggingOptions();
                options.keywords = 0x123;
                options.tags = 0x10;
                channel.logEvent(
                    "VeryComplexEvent",
                    fields,
                    d.LoggingLevel.information,
                    options);

                // Windows 10 introduces the ILoggingTarget interface. LoggingChannel
                // implements this interface. This interface allows components to accept
                // a logger as an parameter.
                this.doSomething(channel);

                /*
                If a LoggingActivity is created using a LoggingActivity constructor,
                it will use Windows 8.1 semantics:

                - If an activity is destroyed (garbage-collected) without being closed
                  and the associated LoggingChannel is still open, the activity will
                  write a default Stop event.
                - The default Stop event (written by the destructor or by the Close()
                  method) is encoded as a "simple" event.

                The 8.1 semantics are deprecated because the automatic generation of
                a Stop event at garbage-collection can be misleading. The Stop event
                is intended to mark the a precise point at which an activity is
                completed, while the garbage-collection of an abandoned activity is
                inherently imprecise and unpredictable.

                If a LoggingActivity is created using a StartActivity method, it will
                use Windows 10 semantics:

                - If an activity is destroyed (garbage-collected) without being closed,
                  there will be no Stop event for the activity.
                - The default Stop event (written by the Close() method) is encoded as
                  a TraceLogging event with name "ActivityClosed".
                */

                {
                    // This activity is created with Windows 8.1 semantics.
                    var a1 = new d.LoggingActivity("Activity1", channel);

                    // The activity Start event is written by the LoggingActivity constructor.
                    // You would do your activity's work here.
                    // The activity Stop event is written when the activity is closed (disposed).

                    // The Windows 10 LoggingActivity adds new methods for writing events
                    // that are marked as associated with the activity.
                    a1.logEvent("Activity event");

                    // LoggingActivity also implements the ILoggingTarget interface, so you can
                    // use either a channel or an activity as a logging target.
                    this.doSomething(a1);

                    {
                        // The Windows 10 LoggingActivity adds new methods for creating nested activities.
                        // Note that nested activities are always created with Windows 10 semantics,
                        // even when nested under an activity that is using Windows 8.1 semantics.
                        var a2 = a1.startActivity("Activity2");

                        // Nested task occurs here.

                        // The Windows 10 LoggingActivity allows you to customize the Stop event.
                        a2.stopActivity("Activity 2 stop");
                    }

                    // Because a1 is using Windows 8.1 semantics, if we did not call close(),
                    // it would attempt to write a Stop event when it is garbage collected.
                    // Writing Stop events during garbage collection is not useful, so be sure
                    // to properly stop, close, or dispose activities.
                    a1.close();
                }

                {
                    // The Windows 10 StartActivity method creates a new activity, optionally with
                    // specified fields and characteristics.
                    // This activity is created with Windows 10 semantics.
                    var a3 = channel.startActivity("Activity3");

                    // Because a3 is using Windows 10 semantics, if we did not call close(),
                    // there would be no Stop event (not even when the activity is garbage
                    // collected). To get a Stop event, be sure to stop, close, or dispose the
                    // activity.
                    a3.close();
                }
            },

            collectExpensiveData: function () {
                return "ExpensiveData";
            },

            doSomething: function (logger) {
                logger.logEvent("Did something");
            },

            onLoggingEnabled: function (sender, args) {
                // Here, you could note a change in the level or keywords.
            }
        },
        {
            // LoggingChannelScenario static members
        });

    WinJS.Class.mix(LoggingChannelScenario, WinJS.Utilities.eventMixin);

    // Export public methods & controls
    WinJS.Namespace.define("LoggingChannelScenario", {
        LoggingChannelScenario: LoggingChannelScenario
    });
})();


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Bulls And Cows</title>

Bulls And Cows

    Your guess:
    <input type="text" id="user-number">
    <button id="submit-button">Check</button>
    Result:
    <input type="text" id="guess-result" readonly="readonly">
    <button id="scores">Show High Scores</button>

redpajama_set_name: RedPajamaGithub


text:
package org.apache.ignite.ml.tree;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.UUID;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.ignite.ml.IgniteModel;
import org.apache.ignite.ml.inference.json.JSONModel;
import org.apache.ignite.ml.inference.json.JSONModelMixIn;
import org.apache.ignite.ml.inference.json.JSONWritable;
import org.apache.ignite.ml.inference.json.JacksonHelper;
import org.apache.ignite.ml.math.primitives.vector.Vector;

/**
 * Base class for decision tree models.
 */
public class DecisionTreeModel implements IgniteModel<Vector, Double>, JSONWritable {
    /** Root node. */
    private DecisionTreeNode rootNode;

    /**
     * Creates the model.
     *
     * @param rootNode Root node of the tree.
     */
    public DecisionTreeModel(DecisionTreeNode rootNode) {
        this.rootNode = rootNode;
    }

    /** */
    private DecisionTreeModel() {

    }

    /** Returns the root node. */
    public DecisionTreeNode getRootNode() {
        return rootNode;
    }

    /** {@inheritDoc} */
    @Override public Double predict(Vector features) {
        return rootNode.predict(features);
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return toString(false);
    }

    /** {@inheritDoc} */
    @Override public String toString(boolean pretty) {
        return DecisionTreeTrainer.printTree(rootNode, pretty);
    }

    /** {@inheritDoc} */
    @Override public void toJSON(Path path) {
        ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        mapper.addMixIn(DecisionTreeModel.class, JSONModelMixIn.class);

        ObjectWriter writer = mapper
            .writerFor(DecisionTreeModel.class)
            .withAttribute("formatVersion", JSONModel.JSON_MODEL_FORMAT_VERSION)
            .withAttribute("timestamp", System.currentTimeMillis())
            .withAttribute("uid", "dt_" + UUID.randomUUID().toString())
            .withAttribute("modelClass", DecisionTreeModel.class.getSimpleName());

        try {
            File file = new File(path.toAbsolutePath().toString());
            writer.writeValue(file, this);
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

    /** Loads DecisionTreeModel from JSON file. */
    public static DecisionTreeModel fromJSON(Path path) {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

        DecisionTreeModel mdl;
        try {
            JacksonHelper.readAndValidateBasicJsonModelProperties(path, mapper, DecisionTreeModel.class.getSimpleName());
            mdl = mapper.readValue(new File(path.toAbsolutePath().toString()), DecisionTreeModel.class);
            return mdl;
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}


text:
@interface JCHUShowColorView ()

@end

@implementation JCHUShowColorView

- (void)awakeFromNib
{
    [super awakeFromNib];

    if (!self.tap) {
        self.tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
        self.tap.numberOfTapsRequired = 1;
        self.tap.numberOfTouchesRequired = 1;
        [self addGestureRecognizer:self.tap];
    }
}

- (void)tapAction:(UITapGestureRecognizer *)sender {

    // 找到window
    [JCHUColorDataHelper windowShowColor:self.backgroundColor];

}

@end


text:
package org.wso2.carbon.uuf.renderablecreator.hbs.impl.js;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.wso2.carbon.uuf.api.Placeholder;
import org.wso2.carbon.uuf.api.config.Configuration;
import org.wso2.carbon.uuf.core.API;
import org.wso2.carbon.uuf.core.Lookup;
import org.wso2.carbon.uuf.core.RequestLookup;
import org.wso2.carbon.uuf.spi.HttpRequest;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

/**
 * Test class for testing javascript functions used by the script engine in UUF.
 *
 * @since 1.0.0
 */
public class JsFunctionsTest {

    @DataProvider
    public Object[][] sendToClientJS() throws URISyntaxException, IOException {
        return new Object[][]{
                {"input1", String.join("\n", Files.
                        readAllLines(Paths.get(this.getClass().getResource("/input1.js").toURI()))),
                        String.join("\n", Files.
                                readAllLines(Paths.get(this.getClass().getResource("/output1.html").toURI())))},
                {"input2", String.join("\n", Files.
                        readAllLines(Paths.get(this.getClass().getResource("/input2.js").toURI()))),
                        String.join("\n", Files.
                                readAllLines(Paths.get(this.getClass().getResource("/output2.html").toURI())))},
        };
    }

    @Test(dataProvider = "sendToClientJS")
    public void testSendToClient(String varName, String inputJS, String outputJS) {
        API api = createAPI();
        JsFunctionsImpl jsFunctions = new JsFunctionsImpl(api, createLookup(), createRequestLookup());
        jsFunctions.getSendToClientFunction().call(varName, inputJS);
        Assert.assertEquals(api.getRequestLookup().getPlaceholderContent(Placeholder.js).get(), outputJS);
    }

    @Test(dataProvider = "sendToClientJS")
    public void testSendToClientWithJs(String varName, String inputJS, String outputJS) {
        API api = createAPI();
        JsFunctionsImpl jsFunctions = new JsFunctionsImpl(api, createLookup(), createRequestLookup());
        jsFunctions.getSendToClientFunction().call(varName, inputJS, "js");
        Assert.assertEquals(api.getRequestLookup().getPlaceholderContent(Placeholder.js).get(), outputJS);
    }

    @Test(dataProvider = "sendToClientJS")
    public void testSendToClientWithHeadJs(String varName, String inputJS, String outputJS) {
        API api = createAPI();
        JsFunctionsImpl jsFunctions = new JsFunctionsImpl(api, createLookup(), createRequestLookup());
        jsFunctions.getSendToClientFunction().call(varName, inputJS, "headJs");
        Assert.assertEquals(api.getRequestLookup().getPlaceholderContent(Placeholder.headJs).get(), outputJS);
    }

    private static API createAPI() {
        API api = mock(API.class);
        when(api.getRequestLookup()).thenReturn(new RequestLookup("/contextPath", mock(HttpRequest.class), null));
        return api;
    }

    private static Lookup createLookup() {
        Configuration configuration = mock(Configuration.class);
        when(configuration.other()).thenReturn(Collections.emptyMap());
        Lookup lookup = mock(Lookup.class);
        when(lookup.getConfiguration()).thenReturn(configuration);
        return lookup;
    }

    private static RequestLookup createRequestLookup() {
        HttpRequest request = mock(HttpRequest.class);
        when(request.getQueryParams()).thenReturn(Collections.emptyMap());
        return spy(new RequestLookup("/contextPath", request, null));
    }
}


text:
/** calculation module
 *
 *  Provides calculation controller and calculation services (calculus, formulas).
 */
(function() {
  'use sctrict';

  var app = angular.module('calculationModule', ['dataManagerModule', 'plotterModule', 'ui.router']);

  app.value('CALCULATION_MODULE_TEMPLATES_PATH', '/angularjs/app/partials/calculationModule/');

// DEPRECATED
/*
  app.config(function($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise("/finding-extrema");
    $stateProvider
 //     .when('/finding-extrema', {
 //       templateUrl: '/angularjs/app/partials/calculationModule/finding-extrema-page.html',
 //       controller: 'CalculationFlowCtrl'
      .state('finding-extrema', {
        templateUrl: '/angularjs/app/partials/calculationModule/finding-extrema-page.html',
        controller: 'CalculationFlowCtrl'
      })
      .state('finding-extrema.step1', {
        url: '/step1',
        templateUrl: '/angularjs/app/partials/calculationModule/step-1-adjust-raw-experimental-data.html',
        controller: 'Step1AdjustRawExperimentalDataCtrl'
      });
  });
*/

})();


text:
package com.zx.sms.handler.api;

import io.netty.channel.ChannelDuplexHandler;

import com.zx.sms.connect.manager.EndpointEntity;

public abstract class AbstractBusinessHandler extends ChannelDuplexHandler implements BusinessHandlerInterface, Cloneable {

	private EndpointEntity entity;

	public void setEndpointEntity(EndpointEntity entity) {
		this.entity = entity;
	}

	public EndpointEntity getEndpointEntity() {
		return entity;
	}

	public abstract String name();

	public AbstractBusinessHandler clone() throws CloneNotSupportedException {
		return (AbstractBusinessHandler) super.clone();
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "https://www.springframework.org/dtd/spring-beans-2.0.dtd">

<!--
	Tests for throws advice.
	$Id: throwsAdvice.xml,v 1.6 2006/08/20 19:08:40 jhoeller Exp $
-->

<beans>

	<!-- Simple target -->
	<bean id="target" class="org.springframework.aop.framework.Echo"/>

	<bean id="nopInterceptor" class="org.springframework.aop.testfixture.interceptor.NopInterceptor"/>

	<bean id="countingBeforeAdvice" class="org.springframework.aop.testfixture.advice.CountingBeforeAdvice" />

	<bean id="throwsAdvice" class="org.springframework.aop.testfixture.advice.MyThrowsHandler"/>

	<bean id="throwsAdvised" class="org.springframework.aop.framework.ProxyFactoryBean">
			<property name="interceptorNames">
				<value>countingBeforeAdvice,nopInterceptor,throwsAdvice,target</value>
			</property>
	</bean>

</beans>


text:
package dmk.lang;

import java.io.File;
import java.io.IOException;
import java.io.FileWriter;

/**
 *
 * @author Денис
 */
public class Lang {
    public static String DEFAULT_MESSAGE = "LANGUAGE FILE FOR IMCURRJVM\r\nMADE BY ACTIS\r\n";
    static File langFile;
    public static String langFileID;
    static boolean fileExists;
    public static boolean FileChecker() {
        String langPath = new File("").getAbsolutePath();
        langFileID = langPath.concat("\\lang.txt");
        langFile = new File(langFileID);
        fileExists = langFile.exists();
        return fileExists;
    }

    public static void LangFileCreate() {
        try (FileWriter fileWriter = new FileWriter(langFile)) {
            fileWriter.write(DEFAULT_MESSAGE + "#begin#\r\n" + "Choose file\r\n" + "Input\r\n" + "Output\r\n" + "Clear\r\n" + "Credits\r\n" + "Exit\r\n" + "Settings\r\n" + "Input your text here!\r\n" + "Output text will be here!\r\n" + "Text input\r\n" + "Text output\r\n" + "Menu\r\n" + "Language settings\r\n" + "Save\r\n" + "#end#");
        } catch (IOException ex) {

        }
    }
}


text:
typedef void(^TWRDownloadRemainingTimeBlock)(NSUInteger seconds);
typedef void(^TWRDownloadProgressBlock)(CGFloat progress);
typedef void(^TWRDownloadCompletionBlock)(BOOL completed);

@interface TWRDownloadObject : NSObject

@property (copy, nonatomic) TWRDownloadProgressBlock progressBlock;
@property (copy, nonatomic) TWRDownloadCompletionBlock completionBlock;
@property (copy, nonatomic) TWRDownloadRemainingTimeBlock remainingTimeBlock;

@property (strong, nonatomic) NSURLSessionDownloadTask *downloadTask;
@property (copy, nonatomic) NSString *fileName;
@property (copy, nonatomic) NSString *friendlyName;
@property (copy, nonatomic) NSString *directoryName;
@property (copy, nonatomic) NSDate *startDate;

- (instancetype)initWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask
                       progressBlock:(TWRDownloadProgressBlock)progressBlock
                       remainingTime:(TWRDownloadRemainingTimeBlock)remainingTimeBlock
                     completionBlock:(TWRDownloadCompletionBlock)completionBlock;

@end


text:
@implementation CJRefreshHeader
{
    BOOL _hasLayoutedForManuallyRefreshing;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.textForNormalState = @"下拉可以加载最新数据";
        self.stateIndicatorViewNormalTransformAngle = 0;
        self.stateIndicatorViewWillRefreshStateTransformAngle = M_PI;
        [self setRefreshState:CJRefreshBaseViewStateNormal];
    }
    return self;
}

- (CGFloat)yOfCenterPoint
{
    //    if (self.isManuallyRefreshing && self.isEffectedByNavigationController && CJRefreshBaseViewMethodIOS7) {
    //        return - (self.sd_height * 0.5 + self.originalEdgeInsets.top - SDKNavigationBarHeight);
    //    }
    return - (self.sd_height * 0.5);
}

- (void)didMoveToSuperview
{
    [super didMoveToSuperview];
    self.scrollViewEdgeInsets = UIEdgeInsetsMake(self.frame.size.height, 0, 0, 0);
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    self.center = CGPointMake(self.scrollView.sd_width * 0.5, [self yOfCenterPoint]);

    // 手动刷新
    if (self.isManuallyRefreshing && !_hasLayoutedForManuallyRefreshing && self.scrollView.contentInset.top > 0) {
        self.activityIndicatorView.hidden = NO;

        // 模拟下拉操作
        CGPoint temp = self.scrollView.contentOffset;
        temp.y -= self.sd_height * 2;
        self.scrollView.contentOffset = temp; // 触发准备刷新
        temp.y += self.sd_height;
        self.scrollView.contentOffset = temp; // 触发刷新

        _hasLayoutedForManuallyRefreshing = YES;
    } else {
        self.activityIndicatorView.hidden = !self.isManuallyRefreshing;
    }
}

- (void)autoRefreshWhenViewDidAppear
{
    self.isManuallyRefreshing = YES;
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
    if (![keyPath isEqualToString:CJRefreshBaseViewObservingkeyPath] || self.refreshState == CJRefreshBaseViewStateRefreshing) return;

    CGFloat y = [change[@"new"] CGPointValue].y;
    CGFloat criticalY = -self.sd_height - self.scrollView.contentInset.top;

    // 只有在 y<=0 以及 scrollview的高度不为0 时才判断
    if ((y > 0) || (self.scrollView.bounds.size.height == 0)) return;

    // 触发CJRefreshBaseViewStateRefreshing状态
    if (y <= criticalY && (self.refreshState == CJRefreshBaseViewStateWillRefresh) && !self.scrollView.isDragging) {
        [self setRefreshState:CJRefreshBaseViewStateRefreshing];
        return;
    }

    // 触发CJRefreshBaseViewStateWillRefresh状态
    if (y < criticalY && (CJRefreshBaseViewStateNormal == self.refreshState)) {
        [self setRefreshState:CJRefreshBaseViewStateWillRefresh];
        return;
    }

    if (y > criticalY && self.scrollView.isDragging && (CJRefreshBaseViewStateNormal != self.refreshState)) {
        [self setRefreshState:CJRefreshBaseViewStateNormal];
    }
}

@end


text:
using System.Threading.Tasks;
using CodeMash.Interfaces.Client;
using Isidos.CodeMash.ServiceContracts.Api;

namespace CodeMash.Interfaces.Project
{
    public interface IProjectService : IClientService
    {
        GetProjectResponse GetProject(GetProjectRequest request);

        Task<GetProjectResponse> GetProjectAsync(GetProjectRequest request);
    }
}


text:
namespace Kafka.Client.Api
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;
    using System.Text;

    using Kafka.Client.Common;
    using Kafka.Client.Common.Imported;
    using Kafka.Client.Consumers;
    using Kafka.Client.Extensions;

    internal class PartitionFetchInfo
    {
        public long Offset { get; private set; }

        public int FetchSize { get; private set; }

        public PartitionFetchInfo(long offset, int fetchSize)
        {
            this.Offset = offset;
            this.FetchSize = fetchSize;
        }

        protected bool Equals(PartitionFetchInfo other)
        {
            return this.Offset == other.Offset && this.FetchSize == other.FetchSize;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            return this.Equals((PartitionFetchInfo)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (this.Offset.GetHashCode() * 397) ^ this.FetchSize;
            }
        }

        public override string ToString()
        {
            return string.Format("PartitionFetchInfo(Offset: {0}, FetchSize: {1})", this.Offset, this.FetchSize);
        }
    }

    internal class FetchRequest : RequestOrResponse
    {
        public const short CurrentVersion = 0;

        public const int DefaultMaxWait = 0;

        public const int DefaultMinBytes = 0;

        public const int DefaultCorrelationId = 0;

        public static FetchRequest ReadFrom(ByteBuffer buffer)
        {
            var versionId = buffer.GetShort();
            var correlationId = buffer.GetInt();
            var clientId = ApiUtils.ReadShortString(buffer);
            var replicaId = buffer.GetInt();
            var maxWait = buffer.GetInt();
            var minBytes = buffer.GetInt();
            var topicCount = buffer.GetInt();
            var pairs = Enumerable.Range(1, topicCount).SelectMany(_ =>
                {
                    var topic = ApiUtils.ReadShortString(buffer);
                    var partitionCount = buffer.GetInt();
                    return Enumerable.Range(1, partitionCount).Select(__ =>
                        {
                            var partitionId = buffer.GetInt();
                            var offset = buffer.GetLong();
                            var fetchSize = buffer.GetInt();
                            return Tuple.Create(
                                new TopicAndPartition(topic, partitionId), new PartitionFetchInfo(offset, fetchSize));
                        });
                });
            return new FetchRequest(versionId, correlationId, clientId, replicaId, maxWait, minBytes, pairs.ToDictionary(x => x.Item1, x => x.Item2));
        }

        public short VersionId { get; private set; }

        public string ClientId { get; private set; }

        public int ReplicaId { get; private set; }

        public int MaxWait { get; private set; }

        public int MinBytes { get; private set; }

        public IDictionary<TopicAndPartition, PartitionFetchInfo> RequestInfo { get; private set; }

        /// <summary>
        /// Partitions the request info into a map of maps (one for each topic).
        /// </summary>
        private readonly Lazy<IDictionary<string, IDictionary<TopicAndPartition, PartitionFetchInfo>>>
            requestInfoGroupedByTopic;

        internal FetchRequest(short versionId = CurrentVersion, int correlationId = DefaultCorrelationId, string clientId = ConsumerConfig.DefaultClientId, int replicaId = Request.OrdinaryConsumerId, int maxWait = DefaultMaxWait, int minBytes = DefaultMinBytes, IDictionary<TopicAndPartition, PartitionFetchInfo> requestInfo = null)
            : base(RequestKeys.FetchKey, correlationId)
        {
            this.VersionId = versionId;
            this.ClientId = clientId;
            this.ReplicaId = replicaId;
            this.MaxWait = maxWait;
            this.MinBytes = minBytes;
            this.RequestInfo = requestInfo;

            this.requestInfoGroupedByTopic = new Lazy<IDictionary<string, IDictionary<TopicAndPartition, PartitionFetchInfo>>>(
                () => this.RequestInfo.GroupByScala(kvp => kvp.Key.Topic));
        }

        /// <summary>
        /// Public constructor for the clients
        /// </summary>
        /// <param name="correlationId"></param>
        /// <param name="clientId"></param>
        /// <param name="maxWait"></param>
        /// <param name="minBytes"></param>
        /// <param name="requestInfo"></param>
        public FetchRequest(int correlationId, string clientId, int maxWait, int minBytes, IDictionary<TopicAndPartition, PartitionFetchInfo> requestInfo)
            : this(CurrentVersion, correlationId, clientId, Request.OrdinaryConsumerId, maxWait, minBytes, requestInfo)
        {
        }

        public override void WriteTo(ByteBuffer buffer)
        {
            buffer.PutShort(this.VersionId);
            buffer.PutInt(this.CorrelationId);
            ApiUtils.WriteShortString(buffer, this.ClientId);
            buffer.PutInt(this.ReplicaId);
            buffer.PutInt(this.MaxWait);
            buffer.PutInt(this.MinBytes);
            buffer.PutInt(this.requestInfoGroupedByTopic.Value.Count); // topic count
            foreach (var kvp in this.requestInfoGroupedByTopic.Value)
            {
                var topic = kvp.Key;
                var partitionFetchInfos = kvp.Value;
                ApiUtils.WriteShortString(buffer, topic);
                buffer.PutInt(partitionFetchInfos.Count); // partition count
                foreach (var pfi in partitionFetchInfos)
                {
                    buffer.PutInt(pfi.Key.Partiton);
                    buffer.PutLong(pfi.Value.Offset);
                    buffer.PutInt(pfi.Value.FetchSize);
                }
            }
        }

        public override int SizeInBytes
        {
            [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1407:ArithmeticExpressionsMustDeclarePrecedence", Justification = "Reviewed. Suppression is OK here.")]
            get
            {
                return 2 + /* versionId */
                4 + /* correlationId */
                ApiUtils.ShortStringLength(this.ClientId) +
                4 + /* replicaId */
                4 + /* maxWait */
                4 + /* minBytes */
                4 + /* topic count */
                this.requestInfoGroupedByTopic.Value.Aggregate(
                    0,
                    (foldedTopics, currTopic) =>
                    {
                        var topic = currTopic.Key;
                        var partitionFetchInfos = currTopic.Value;
                        return foldedTopics +
                            ApiUtils.ShortStringLength(topic) +
                            4 + /* partition count */ +partitionFetchInfos.Count * (4 + /* partition id */
                            8 + /* offset */
                            4 /* fetch size */);
                    });
            }
        }

        public bool IsFromFailover
        {
            get
            {
                return Request.IsReplicaIdFromFollower(this.ReplicaId);
            }
        }

        public bool FromOrdinaryConsumer
        {
            get
            {
                return this.ReplicaId == Request.OrdinaryConsumerId;
            }
        }

        public bool IsFromLowLevelConsumer
        {
            get
            {
                return this.ReplicaId == Request.DebuggingConsumerId;
            }
        }

        public int NumPartitions
        {
            get
            {
                return this.RequestInfo.Count;
            }
        }

        public override string ToString()
        {
            return this.Describe(true);
        }

        public override string Describe(bool details)
        {
            var fetchRequest = new StringBuilder();
            fetchRequest.Append("Name: " + this.GetType().Name);
            fetchRequest.Append("; Version: " + this.VersionId);
            fetchRequest.Append("; CorrelationId: " + this.CorrelationId);
            fetchRequest.Append("; ClientId: " + this.ClientId);
            fetchRequest.Append("; ReplicaId: " + this.ReplicaId);
            fetchRequest.Append("; MaxWait: " + this.MaxWait + " ms");
            fetchRequest.Append("; MinBytes: " + this.MinBytes + " bytes");
            if (details)
            {
                fetchRequest.Append("; RequestInfo: " + this.RequestInfo.DictionaryToString());
            }

            return fetchRequest.ToString();
        }

        protected bool Equals(FetchRequest other)
        {
            return this.VersionId == other.VersionId && string.Equals(this.ClientId, other.ClientId)
                   && this.ReplicaId == other.ReplicaId && this.CorrelationId == other.CorrelationId
                   && this.MaxWait == other.MaxWait && this.MinBytes == other.MinBytes
                   && this.RequestInfo.DictionaryEqual(other.RequestInfo);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            return Equals((FetchRequest)obj);
        }

        public override int GetHashCode()
        {
            throw new NotSupportedException();
        }
    }

    internal class FetchRequestBuilder
    {
        private readonly AtomicInteger correlationId = new AtomicInteger(0);

        private readonly short versionId = FetchRequest.CurrentVersion;

        private string clientId = ConsumerConfig.DefaultClientId;

        private int replicaId = Request.OrdinaryConsumerId;

        private int maxWait = FetchRequest.DefaultMaxWait;

        private int minBytes = FetchRequest.DefaultMinBytes;

        private Dictionary<TopicAndPartition, PartitionFetchInfo> requestMap = new Dictionary<TopicAndPartition, PartitionFetchInfo>();

        public FetchRequestBuilder AddFetch(string topic, int partition, long offset, int fetchSize)
        {
            this.requestMap[new TopicAndPartition(topic, partition)] = new PartitionFetchInfo(offset, fetchSize);
            return this;
        }

        public FetchRequestBuilder ClientId(string clientId)
        {
            this.clientId = clientId;
            return this;
        }

        internal FetchRequestBuilder ReplicaId(int replicaId)
        {
            this.replicaId = replicaId;
            return this;
        }

        internal FetchRequestBuilder MaxWait(int maxWait)
        {
            this.maxWait = maxWait;
            return this;
        }

        internal FetchRequestBuilder MinBytes(int minBytes)
        {
            this.minBytes = minBytes;
            return this;
        }

        public FetchRequest Build()
        {
            var fetchRequest = new FetchRequest(
                this.versionId,
                this.correlationId.GetAndIncrement(),
                this.clientId,
                this.replicaId,
                this.maxWait,
                this.minBytes,
                new Dictionary<TopicAndPartition, PartitionFetchInfo>(this.requestMap));

            this.requestMap.Clear();
            return fetchRequest;
        }
    }
}


text:
/*
Navicat MySQL Data Transfer

Source Server         : 127.0.0.1
Source Server Version : 50624
Source Host           : 127.0.0.1:3306
Source Database       : archive

Target Server Type    : MYSQL
Target Server Version : 50624
File Encoding         : 65001

Date: 2017-05-21 15:38:22
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for t_archive
-- ----------------------------
DROP TABLE IF EXISTS `t_archive`;
CREATE TABLE `t_archive` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `idx` varchar(50) DEFAULT NULL,
  `manager` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `pages` varchar(255) DEFAULT NULL,
  `number` varchar(100) DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `operateman` varchar(255) NOT NULL,
  `operatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `boxid` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '0' COMMENT '0:在库,1:借出',
  `borrowid` int(11) DEFAULT '0',
  `lastborrowtime` datetime DEFAULT NULL COMMENT '最近借阅时间或者归还时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2200 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_borrow
-- ----------------------------
DROP TABLE IF EXISTS `t_borrow`;
CREATE TABLE `t_borrow` (
  `borrowid` bigint(20) NOT NULL AUTO_INCREMENT,
  `archiveid` int(20) DEFAULT NULL COMMENT '档案id',
  `borrowerid` int(11) DEFAULT NULL COMMENT '借阅人id',
  `status` int(11) DEFAULT '0' COMMENT '0:在库1:借出',
  `createtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `operatorid` int(11) DEFAULT NULL COMMENT '经办人id',
  `operatorname` varchar(255) DEFAULT NULL COMMENT '经办人',
  `remark` varchar(256) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`borrowid`)
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_borrower
-- ----------------------------
DROP TABLE IF EXISTS `t_borrower`;
CREATE TABLE `t_borrower` (
  `borrowerid` int(20) NOT NULL AUTO_INCREMENT,
  `idcard` varchar(20) DEFAULT NULL COMMENT '身份证',
  `no` varchar(255) DEFAULT NULL COMMENT '员工编号',
  `name` varchar(100) NOT NULL COMMENT '姓名',
  `department` varchar(100) DEFAULT NULL COMMENT '部门',
  `phone` varchar(100) DEFAULT NULL COMMENT '手机',
  `address` varchar(256) DEFAULT NULL COMMENT '地址',
  `sex` varchar(10) DEFAULT '男' COMMENT '性别',
  `post` varchar(50) DEFAULT NULL COMMENT '职位',
  `remark` varchar(256) DEFAULT NULL,
  `createtime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`borrowerid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_boxlabel
-- ----------------------------
DROP TABLE IF EXISTS `t_boxlabel`;
CREATE TABLE `t_boxlabel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `rfid` varchar(100) NOT NULL,
  `number` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_floorlabel
-- ----------------------------
DROP TABLE IF EXISTS `t_floorlabel`;
CREATE TABLE `t_floorlabel` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `rfid` varchar(255) NOT NULL,
  `number` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_inventory
-- ----------------------------
DROP TABLE IF EXISTS `t_inventory`;
CREATE TABLE `t_inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `operateid` int(11) NOT NULL,
  `operatename` varchar(50) NOT NULL,
  `operatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_inventorydetail
-- ----------------------------
DROP TABLE IF EXISTS `t_inventorydetail`;
CREATE TABLE `t_inventorydetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mid` int(11) NOT NULL,
  `floorrfid` varchar(100) NOT NULL,
  `boxrfid` varchar(100) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `borrowstatus` varchar(50) DEFAULT NULL,
  `borrowdate` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_position
-- ----------------------------
DROP TABLE IF EXISTS `t_position`;
CREATE TABLE `t_position` (
  `boxrfid` varchar(50) NOT NULL,
  `floorrfid` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `userid` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(45) NOT NULL,
  `password` varchar(45) NOT NULL,
  `realname` varchar(45) DEFAULT NULL,
  `sex` varchar(45) DEFAULT '男',
  `phone` varchar(45) DEFAULT NULL,
  `age` int(2) DEFAULT '30',
  `roletype` varchar(45) DEFAULT NULL,
  `createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createman` varchar(45) NOT NULL,
  `modifytime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifyman` varchar(45) NOT NULL,
  `enable` smallint(2) NOT NULL DEFAULT '1',
  `address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
-- View structure for v_archive
-- ----------------------------
DROP VIEW IF EXISTS `v_archive`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER  VIEW `v_archive` AS select a.id , a.idx , a.manager , a.number ,a.pages, a.title , a.boxid,a.operateman,a.operatetime,a.remark, a.status , (case a.status when 0 then '在库' when 1 then '借出' else '未知֪' end) as statusname,
 b.name as boxname , b.rfid as boxrfid , b.number as boxnumber , d.name as floorname , c.floorrfid  , CONCAT_WS(',', d.name , b.name) as position
from t_archive a left JOIN t_boxlabel b on a.boxid = b.id
 left JOIN t_position c on b.rfid = c.boxrfid
left JOIN t_floorlabel d on c.floorrfid = d.rfid ; ;

-- ----------------------------
-- View structure for v_borrow
-- ----------------------------
DROP VIEW IF EXISTS `v_borrow`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER  VIEW `v_borrow` AS select a.id , a.title,a.number, a.manager , a.idx , a.pages, a.status, (case a.status when 0 then '在库' when 1 then '借出' else '未知֪' end) as statusname,
b.id as boxid , b.name as boxname , b.number as boxnumber,b.rfid as boxrfid ,
CONCAT_WS(',', d.name , b.name) as position ,
d.number as floornumber , d.name as floorname,d.rfid as floorrfid,
e.createtime , e.operatorname ,
f.borrowerid , f.name as borrowername,f.idcard , f.department
from t_archive a
left join t_boxlabel b
on a.boxid= b.id
left join t_position c
on b.rfid=c.boxrfid
left join t_floorlabel d
on c.floorrfid= d.rfid
left join t_borrow e
on a.borrowid=e.borrowid
left join t_borrower f
on e.borrowerid = f.borrowerid ; ;

-- ----------------------------
-- View structure for v_box
-- ----------------------------
DROP VIEW IF EXISTS `v_box`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER  VIEW `v_box` AS select a.id , a.name,a.number , a.rfid , b.floorrfid , c.name as floorname from t_boxlabel a LEFT JOIN t_position b on a.rfid= b.boxrfid LEFT JOIN t_floorlabel c on b.floorrfid= c.rfid ;


text:
<?php
require_once('./header.php');
require_once('./db.php');

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

  if (isset($_POST['email']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {

    $existing_customer = get_customer($_POST['email']);

    if ($existing_customer && crypt($_POST['password'], $existing_customer['password']) == $existing_customer['password']) {
      $stripe_customer = \Stripe\Customer::retrieve($existing_customer['stripe_id']);
      $card = $stripe_customer->sources->retrieve($stripe_customer->default_source);

      require_once('./payment_form.php');
    }
    else {
      echo "Your email address or password is incorrect.";
      require_once('./login_form.php');
    }
  }
  else {
    echo "Please enter a valid email address.";
    require_once('./login_form.php');
  }

}


text:
namespace DragonSpark.Activation
{
	public class ParameterConstructor<T> : ParameterConstructor<object, T> {}
}


text:
package oci

import (
	"encoding/json"
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"sync"
	"time"

	"github.com/containernetworking/cni/pkg/ns"
	"github.com/docker/docker/pkg/signal"
	specs "github.com/opencontainers/runtime-spec/specs-go"
	"k8s.io/apimachinery/pkg/fields"
	pb "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
)

const (
	defaultStopSignal = "TERM"
)

// Container represents a runtime container.
type Container struct {
	id          string
	name        string
	logPath     string
	labels      fields.Set
	annotations fields.Set
	image       *pb.ImageSpec
	sandbox     string
	netns       ns.NetNS
	terminal    bool
	stdin       bool
	stdinOnce   bool
	privileged  bool
	trusted     bool
	state       *ContainerState
	metadata    *pb.ContainerMetadata
	opLock      sync.Mutex
	// this is the /var/run/storage/... directory, erased on reboot
	bundlePath string
	// this is the /var/lib/storage/... directory
	dir        string
	stopSignal string
}

// ContainerState represents the status of a container.
type ContainerState struct {
	specs.State
	Created   time.Time `json:"created"`
	Started   time.Time `json:"started,omitempty"`
	Finished  time.Time `json:"finished,omitempty"`
	ExitCode  int32     `json:"exitCode,omitempty"`
	OOMKilled bool      `json:"oomKilled,omitempty"`
	Error     string    `json:"error,omitempty"`
}

// NewContainer creates a container object.
func NewContainer(id string, name string, bundlePath string, logPath string, netns ns.NetNS, labels map[string]string, annotations map[string]string, image *pb.ImageSpec, metadata *pb.ContainerMetadata, sandbox string, terminal bool, stdin bool, stdinOnce bool, privileged bool, trusted bool, dir string, created time.Time, stopSignal string) (*Container, error) {
	state := &ContainerState{}
	state.Created = created
	c := &Container{
		id:          id,
		name:        name,
		bundlePath:  bundlePath,
		logPath:     logPath,
		labels:      labels,
		sandbox:     sandbox,
		netns:       netns,
		terminal:    terminal,
		stdin:       stdin,
		stdinOnce:   stdinOnce,
		privileged:  privileged,
		trusted:     trusted,
		metadata:    metadata,
		annotations: annotations,
		image:       image,
		dir:         dir,
		state:       state,
		stopSignal:  stopSignal,
	}
	return c, nil
}

// GetStopSignal returns the container's own stop signal configured from the
// image configuration or the default one.
func (c *Container) GetStopSignal() string {
	if c.stopSignal == "" {
		return defaultStopSignal
	}
	cleanSignal := strings.TrimPrefix(strings.ToUpper(c.stopSignal), "SIG")
	_, ok := signal.SignalMap[cleanSignal]
	if !ok {
		return defaultStopSignal
	}
	return cleanSignal
}

// FromDisk restores container's state from disk
func (c *Container) FromDisk() error {
	jsonSource, err := os.Open(c.StatePath())
	if err != nil {
		return err
	}
	defer jsonSource.Close()

	dec := json.NewDecoder(jsonSource)
	return dec.Decode(c.state)
}

// StatePath returns the containers state.json path
func (c *Container) StatePath() string {
	return filepath.Join(c.dir, "state.json")
}

// CreatedAt returns the container creation time
func (c *Container) CreatedAt() time.Time {
	return c.state.Created
}

// Name returns the name of the container.
func (c *Container) Name() string {
	return c.name
}

// ID returns the id of the container.
func (c *Container) ID() string {
	return c.id
}

// BundlePath returns the bundlePath of the container.
func (c *Container) BundlePath() string {
	return c.bundlePath
}

// LogPath returns the log path of the container.
func (c *Container) LogPath() string {
	return c.logPath
}

// Labels returns the labels of the container.
func (c *Container) Labels() map[string]string {
	return c.labels
}

// Annotations returns the annotations of the container.
func (c *Container) Annotations() map[string]string {
	return c.annotations
}

// Image returns the image of the container.
func (c *Container) Image() *pb.ImageSpec {
	return c.image
}

// Sandbox returns the sandbox name of the container.
func (c *Container) Sandbox() string {
	return c.sandbox
}

// NetNsPath returns the path to the network namespace of the container.
func (c *Container) NetNsPath() (string, error) {
	if c.state == nil {
		return "", fmt.Errorf("container state is not populated")
	}

	if c.netns == nil {
		return fmt.Sprintf("/proc/%d/ns/net", c.state.Pid), nil
	}

	return c.netns.Path(), nil
}

// Metadata returns the metadata of the container.
func (c *Container) Metadata() *pb.ContainerMetadata {
	return c.metadata
}


text:
package mariculture.fishery.fish;

import static mariculture.core.lib.MCLib.dropletFlux;
import static mariculture.core.lib.MCLib.dropletGold;
import static mariculture.core.lib.MCLib.dropletRegen;
import mariculture.api.core.Environment.Salinity;
import mariculture.api.fishery.RodType;
import mariculture.api.fishery.fish.FishSpecies;
import mariculture.core.util.Fluids;
import net.minecraft.block.Block;

public class FishGoldMetal extends FishSpecies {
    @Override
    public int getTemperatureBase() {
        return 20;
    }

    @Override
    public int getTemperatureTolerance() {
        return 20;
    }

    @Override
    public Salinity getSalinityBase() {
        return Salinity.FRESH;
    }

    @Override
    public int getSalinityTolerance() {
        return 2;
    }

    @Override
    public boolean isDominant() {
        return false;
    }

    @Override
    public int getLifeSpan() {
        return 3;
    }

    @Override
    public int getFertility() {
        return 300;
    }

    @Override
    public int getBaseProductivity() {
        return 0;
    }

    @Override
    public Block getWater2() {
        return Fluids.getFluidBlock("custard");
    }

    @Override
    public double getFishOilVolume() {
        return 0.0D;
    }

    @Override
    public int getFoodStat() {
        return -1;
    }

    @Override
    public int getFishMealSize() {
        return 0;
    }

    @Override
    public void addFishProducts() {
        addProduct(dropletGold, 15D);
        addProduct(dropletFlux, 10D);
        addProduct(dropletRegen, 5D);
    }

    @Override
    public RodType getRodNeeded() {
        return RodType.FLUX;
    }
}


text:
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using System;

namespace ArcGISRuntimeXamarin.Samples.AddPointSceneLayer
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Add a point scene layer",
        category: "Layers",
        description: "View a point scene layer from a scene service.",
        instructions: "Pan around the scene and zoom in. Notice how many thousands of additional features appear at each successive zoom scale.",
        tags: new[] { "3D", "layers", "point scene layer" })]
    public class AddPointSceneLayer : Activity
    {
        // Hold references to the UI controls.
        private SceneView _mySceneView;

        // URL for the service with the point scene layer.
        private const string PointSceneServiceUri = "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Airports_PointSceneLayer/SceneServer/layers/0";

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "Add a point scene layer";

            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Create the scene.
            _mySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);

            // Create the layer.
            ArcGISSceneLayer pointSceneLayer = new ArcGISSceneLayer(new Uri(PointSceneServiceUri));

            // Show the layer in the scene.
            _mySceneView.Scene.OperationalLayers.Add(pointSceneLayer);
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};

            // Add the map view to the layout.
            _mySceneView = new SceneView(this);
            layout.AddView(_mySceneView);

            // Show the layout in the app.
            SetContentView(layout);
        }

        protected override void OnDestroy()
        {
            base.OnDestroy();

            // Remove the sceneview
            (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
            _mySceneView.Dispose();
            _mySceneView = null;
        }
    }
}


text:
function KBase (map) { // Call initializeMapWithRoot() to initialize a KBase which uses the map object

  'use strict';
  var pendingAjaxCalls = 0;

  // Escape html characters inside  tags
  function escapeHTMLintoCodeTags (text) {
    var codeRegEx = /(<\s*code[^>]*>)([\s\S]*?)(<\s*\/\s*code>)/gi;
    text = text.replace (codeRegEx, function (completeSubStr, group1, group2, group3) {
      return group1 + group2.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"') + group3;
    });
    return text;
  }

  function setDocumentHtml (document, htmlText) {
    $('#document').queue(function () { // (*)

      // Escape html characters inside  tags
      htmlText = escapeHTMLintoCodeTags (htmlText);

      $('#document').html (htmlText);

      hljs.initHighlighting.called = false; // Hack to have the syntax highlighter redo all the work
      hljs.initHighlighting (); // Start the syntax highlighter on this document (
 blocks)

      // Enqueue the animation for the div's height to fit the entire content. This is necessary since scrollHeight
      // could not be calculated before. Now it's a valid value for the new document
      var newHeight = $('#document')[0].scrollHeight;
      $('#document').animate({
        height: newHeight,
        opacity: 1
      }, 500);
      $.data($('#document')[0], "scrollHeight", newHeight); // Store this value, might be used later
                                                            // if the same document is asked again
      $(this).dequeue(); // Continue with the next queued animation (the (*) just queued)
    });
  }

  function performPOSTDocumentRequest (document, callback) { // Load via ajax a requested document
    pendingAjaxCalls++;
    $.ajax({ // Ask for the parents of a node in the database
      type: "POST",
      url : "/documents/getDocument",
      data: JSON.stringify({document: document}),
      contentType: 'application/json',
      success : function(response) {
        callback (response);
        pendingAjaxCalls--;
      },
      error: function(xhr, ajaxOptions, thrownError) {
        $.error ("Ajax call error: (" + xhr.status + ") " + thrownError);
        pendingAjaxCalls--;
      }
    });
  }

  function performPOSTQueryOnKbase (nodeId, uri, callback, callbackIfNoResults) {
    pendingAjaxCalls++;
    $.ajax({ // Ask for a query on a node in the database
      type: "POST",
      url : uri,
      data: JSON.stringify({id: nodeId}),
      contentType: 'application/json',
      success : function(response) {
        if (response.length === 0 && typeof callbackIfNoResults != 'undefined')
          callbackIfNoResults ();
        else {
          $.each (response, function () {
            callback (this.id, this.document, this.text);
          });
        }
        pendingAjaxCalls--;
      },
      error: function(xhr, ajaxOptions, thrownError) {
        $.error ("Ajax call error: (" + xhr.status + ") " + thrownError);
        pendingAjaxCalls--;
      }
    });
  }

  // Load all the parents and children of a node and add them to the map
  function loadNodeParentsAndChildren (node) {
    // Get all this node's parents and children through an ajax query
    performPOSTQueryOnKbase (node.id, "/nodes/getParentNodes", function (id, document, text) {
      var parentNode = node.addChildNode (id, document, text);
      parentNode.callback = nodeClicked;
      parentNode.$element.addClass ('parent');
    });
    performPOSTQueryOnKbase (node.id, "/nodes/getChildrenNodes", function (id, document, text) {
      node.addChildNode (id, document, text).callback = nodeClicked;
    });
  }

  // Load a node's document if it isn't already loaded
  function loadNodeDocument (node) {
    // If there's any href (not already loaded), load the document asked
    if (node.href != undefined && $.data($('#document')[0], "currentDocument") != node.href) {
      performPOSTDocumentRequest (node.href, function (data) {
        setDocumentHtml (node.href, data);
      });
    } else if (node.href != undefined) { // Document is already loaded but perhaps the div is still collapsed, make sure it's visible
      // We can NOT get here if there's no document (node.href == undefined) so in that case no animation would be played
      $('#document').animate({
        height: $.data($('#document')[0], "scrollHeight"), // Scroll to its latest stored scrollHeight
        opacity: 1
      }, 500);
    }

    // Whatever the document asked (even undefined), store it into an HTML5 data attribute
    // and if there's something to show, make sure the document is shown with an animation
    if (node.href != undefined) {
      $.data($('#document')[0], "currentDocument", node.href);
    } else
      $.data($('#document')[0], "currentDocument", null);
  }

  function nodeClicked (node) { // Click handler for nodes

    $('#quicksearchBar').val(''); // Clear quicksearch query

    if (pendingAjaxCalls > 0)
      return; // If ajax calls are slow, we can't proceed (we might add duplicate nodes due to
              // dangling references and asynchronous callbacks)

    // Only case we don't hide the current document is when we already have the requested one
    if ($.data($('#document')[0], "currentDocument") != node.href) {
      $('#document').animate({
        height:  0,
        opacity: 0
      }, 500);
    }
    $.data($('#searchBox')[0], "ignoreBoundariesAndScrollToStart", true); // Restore any searchBox scroll to 0
    $("html, body").animate({ scrollTop: 0 }, 500);  // And also the page scrollbars

    // Make this the new root node
    node.markAsSelected ();
    node.$element.removeClass ('parent');

    // Remove all the map nodes which aren't this one
    $.each (map.getNodes(), function () {
      if (this != node)
        this.deleteNode ();
    });

    loadNodeParentsAndChildren (node);

    loadNodeDocument (node);
  }

  this.loadNewRootNode = function (id) { // Load a completely new root node and all its associated data

    if (pendingAjaxCalls > 0)
      return; // If ajax calls are slow, we can't proceed (we might add duplicate nodes due to
              // dangling references and asynchronous callbacks)

    // Get the requested node information
    performPOSTQueryOnKbase (id, "/nodes/getNodeData", function (id, document, text) {
      // Create this node as the root
      var rootNode = map.createRootNode (id, document, text);
      // Add every other related node
      loadNodeParentsAndChildren (rootNode);
      // Finally load the new document
      loadNodeDocument (rootNode);
    }, function () {
      $.error ("Error: no node with this id exists in the kbase: " + id);
      return;
    });

  }

  this.initializeMapWithRoot = function (map, rootId) { // First-time initialize the map with the kbase root or a given root node

    if (typeof rootId == "undefined") {
      // KBase root node requested
      pendingAjaxCalls++;
      $.ajax({ // Ask for the root node in the database
        type: "POST",
        url : "/nodes/getRootNode",
        success : function(response) {
          if(response.length != 1) {
            $.error ("Expected one root node for kbase, got length of "+response.length);
            return;
          }
          var rootObj = response[0]; // {document, id, text}
          // Create the root node
          var rootNode = map.createRootNode (rootObj.id, rootObj.document, rootObj.text);
          rootNode.callback = nodeClicked;
          pendingAjaxCalls--;

          // Create the child nodes directly attached to the root
          pendingAjaxCalls++;
          $.ajax({
            type: "POST",
            url : "/nodes/getChildrenNodes",
            contentType: 'application/json',
            data: JSON.stringify({id: rootNode.id}),
            success : function(response) {
              $.each (response, function () {
                var newNode = rootNode.addChildNode(this.id, this.document, this.text);
                newNode.callback = nodeClicked;
              });
              pendingAjaxCalls--;
            },
            error: function(xhr, ajaxOptions, thrownError) {
              $.error ("Ajax call error: (" + xhr.status + ") " + thrownError);
              pendingAjaxCalls--;
            }
          });
        },
        error: function(xhr, ajaxOptions, thrownError) {
          $.error ("Ajax call error: (" + xhr.status + ") " + thrownError);
          pendingAjaxCalls--;
        }
      });
    } else {
      // Specific root node requested
      this.loadNewRootNode (rootId);
    }
  }

  return this;
} // KBase()


text:
#include "libcl/clp.h"

#include <ctype.h>
#include <errno.h>

static const cl_facility cl_builtin_levels[] = {
    {"ultra", CL_LEVEL_ULTRA},

    {"verbose", CL_LEVEL_VERBOSE},
    {"spew", CL_LEVEL_VERBOSE},

    {"debug", CL_LEVEL_DEBUG},

    {"detail", CL_LEVEL_DETAIL},

    {"info", CL_LEVEL_INFO},

    {"fail", CL_LEVEL_FAIL},

    {"overview", CL_LEVEL_OVERVIEW},

    {"operator-error", CL_LEVEL_OPERATOR_ERROR},
    {"operator", CL_LEVEL_OPERATOR_ERROR},

    {"error", CL_LEVEL_ERROR},

    {"fatal", CL_LEVEL_FATAL},

    {0, 0, 0} /* Sentinel */
};

/**
 * @brief Local utility: Look up a facility name, given its bit.
 *
 *  This also works for non-bit facilities (i.e. our builtin
 *  list of levels).
 *
 * @param facs 	List of facilities to match against.
 * @param lev	A single element of a loglevel (i.e., a single
 *		bit for the facilities, or the general linear level
 *		for the builtin facilities.)
 *
 * @return 	NULL if the level wasn't found anywhere,
 *		otherwise the name of the facility or loglevel,
 *		as a '\\0'-terminated string.
 */
static char const* cl_facility_to_string(cl_facility const* facs,
                                         cl_loglevel lev) {
  for (; facs != NULL; facs = facs->fac_reference) {
    for (; facs->fac_name != NULL; facs++)
      if (facs->fac_loglevel == lev) return facs->fac_name;

    if (facs->fac_reference == NULL) break;

    for (; facs[1].fac_reference != NULL; facs++) {
      char const* name;
      name = cl_facility_to_string(facs->fac_reference, lev);
      if (name != NULL) return name;
    }
  }
  return NULL;
}

/**
 * @brief Convert a loglevel to a string.
 *
 *  This isn't very fast, so rewrite this if you want to do
 *  it for e.g. every single log message.
 *
 * @param lev 	Loglevel value, composed of a linear builtin level
 *		(fatal, error, ..., debug, spew) and of zero or
 *		more facility bits.
 * @param facs 	List of facilities that describe what the
 *		facility bits are.
 * @param buf	Buffer to use while formatting the result.
 * @param size	# of bytes pointed to by buf.
 *
 * @return 	A pointer to a '\\0'-terminated representation
 *		of the loglevel setting.
 */
char const* cl_loglevel_to_string(cl_loglevel lev, cl_facility const* facs,
                                  char* buf, size_t size) {
  cl_loglevel bit, unaccounted = 0;
  char* e;
  char* w;
  char const* name;
  size_t n;

  w = buf;
  e = buf + size;

  if (lev == ~(cl_loglevel)0) return "everything";

  name = cl_facility_to_string(cl_builtin_levels, lev & 0xF);
  if (name != NULL) {
    n = strlen(name);
    if (size < n + 6) return name;

    memcpy(buf, name, n);
    w = buf + n;
  }

  for (bit = (1ul << 31); bit > 0xF; bit >>= 1) {
    if (!(lev & bit)) continue;

    /* find the facility corresponding to this bit */
    if ((name = cl_facility_to_string(facs, bit)) == NULL) {
      unaccounted |= bit;
      continue;
    }

    n = strlen(name);
    if (e - w < 2 + n + 6) /* "x, ..." */
    {
      if (e - w < 6) /* , ... */
      {
        if (e - w < 3) return "<loglevel:...>";

        *w++ = '.';
        *w++ = '.';
        *w = '\0';

        return buf;
      }
      if (w > buf)
        memcpy(w, ", ...", 6);
      else
        memcpy(w, "...", 4);
      return buf;
    }
    if (w != buf) {
      *w++ = ' ';
    }
    memcpy(w, name, n);
    w += n;
  }
  *w = '\0';

  if (unaccounted && e - w >= 4) {
    if (w != buf) {
      *w++ = ' ';
      *w++ = '+';
    }
    snprintf(w, e - w, "%lx", (unsigned long)unaccounted);
  }
  return buf;
}

/**
 * @brief Convert a loglevel configuration to a string.
 *
 * @param lev 	Loglevel configuration value
 * @param facs 	List of facilities that describe what the
 *		facility bits are.
 * @param buf	Buffer to use while formatting the result.
 * @param size	# of bytes pointed to by buf.
 *
 * @return 	A pointer to a '\\0'-terminated representation
 *		of the loglevel setting.
 */
char const* cl_loglevel_configuration_to_string(
    cl_loglevel_configuration const* clc, cl_facility const* facs, char* buf,
    size_t size) {
  char abuf[1024], bbuf[1024];
  char const *a, *b;

  if (clc->clc_full == clc->clc_trigger)
    return cl_loglevel_to_string(clc->clc_full, facs, buf, size);

  a = cl_loglevel_to_string(clc->clc_trigger, facs, abuf, sizeof abuf);
  b = cl_loglevel_to_string(clc->clc_full, facs, bbuf, sizeof bbuf);

  if (a == NULL || b == NULL) return NULL;

  snprintf(buf, size, "%s[%s]", a, b);
  return buf;
}

/**
 * @brief Look up a facility, given its name.
 *
 * @param s 	Beginning of the facility name
 * @param e	End of the facility name
 * @param facs  sentinel-terminated list of facilities
 */
static int cl_facility_from_string(char const* s, char const* e,
                                   cl_facility const* facs, cl_loglevel* out) {
  if (s == NULL || s >= e) return EINVAL;

  for (; facs != NULL; facs = facs->fac_reference) {
    for (; facs->fac_name != NULL; facs++) {
      char const* n = facs->fac_name;
      char const* p = s;

      for (p = s, n = facs->fac_name; p < e; p++, n++) {
        if (!isascii(*p)) return EINVAL;
        if (tolower(*p) != tolower(*n)) break;
      }
      if (p == e && *n == '\0') {
        *out = facs->fac_loglevel;
        return 0;
      }
    }

    if (facs->fac_reference == NULL) break;

    for (; facs[1].fac_reference != NULL; facs++) {
      int err = cl_facility_from_string(s, e, facs->fac_reference, out);
      if (err != ENOENT) return err;
    }
  }
  return ENOENT;
}

/**
 * @brief Scan facilities out of a multi-facility loglevel
 *
 *  Parentheses, commas, and white space in the loglevel are ignored.
 *  Everything else must be either a buitlin level or a facility
 *  listed in the facs parameter.
 *
 * @param s 	beginning of the string to scan
 * @param e	end of the string to scan
 * @param facs  sentinel-terminated list of facilities
 * @param out	assign parsed loglevel to here.
 *
 * @return 	0 on success, otherwise ENOENT if one of the
 *		strings used in s...e didn't name a loglevel.
 */
int cl_loglevel_from_string(char const* s, char const* e,
                            cl_facility const* facs, cl_loglevel* out) {
  cl_loglevel lev;

  *out = 0;

  if (s == NULL || s >= e) return 0;
  while (s < e) {
    int err;
    char const *level_s, *level_e;

    /* Skip past (), and space. */
    while (s < e && (isascii(*s) &&
                     (isspace(*s) || *s == '(' || *s == ')' || *s == ',')))
      s++;
    if (s >= e) return 0;

    level_s = s;

    /* Skip past non-punctuation */
    while (s < e && (!isascii(*s) ||
                     (!isspace(*s) && *s != '(' && *s != ')' && *s != ',')))
      s++;
    if (s == level_s) return ENOENT;
    level_e = s;

    /* Look up a matching facility in the caller-supplied list.
     */
    err = cl_facility_from_string(level_s, level_e, facs, &lev);

    /* If that fails, look it up in our builtin level list.
     */
    if (err == 0 ||
        cl_facility_from_string(level_s, level_e, cl_builtin_levels, &lev) == 0)
      *out |= lev;
    else
      return err;
  }
  return 0;
}

/**
 * @brief Scan a loglevel with optional diary.
 *
 *  Parentheses, commas, and white space in the loglevel are ignored.
 *  Everything else must be either a buitlin level or a facility
 *  listed in the facs parameter.
 *
 * @param s 	beginning of the string to scan
 * @param e	end of the string to scan
 * @param facs  sentinel-terminated list of facilities
 * @param out	assign parsed loglevel to here.
 *
 * @return 	0 on success, otherwise ENOENT if one of the
 *		strings used in s...e didn't name a loglevel.
 */
int cl_loglevel_configuration_from_string(char const* s, char const* e,
                                          cl_facility const* facs,
                                          cl_loglevel_configuration* clc) {
  int err;
  char const* obr;

  /*  The diary syntax is  triggerlevel "[" diarylevel "]"
   *
   *  The two loglevels must be inclusive of one another; the
   *  higher one triggers a flush of the ringbuffer containing
   *  stream of the lower one.
   */
  if (e == s || e[-1] != ']' || (obr = memchr(s, '[', e - s)) == NULL) {
    /*  Just the normal syntax.  Loglevel and diarylevel
     *  are the same, and no diary is actually kept.  Everything
     *  is logged straight away.
     */
    err = cl_loglevel_from_string(s, e, facs, &clc->clc_full);
    if (err != 0) return err;
    clc->clc_trigger = clc->clc_full;
    return 0;
  }

  err = cl_loglevel_from_string(s, obr, facs, &clc->clc_trigger);
  if (err != 0) return err;

  err = cl_loglevel_from_string(obr + 1, e - 1, facs, &clc->clc_full);
  if (err != 0) return err;

  /* The stricter loglevel sits on the diary,
   * the weaker is on the log as a whole.
   *
   *  CL_IS_LOGGED(A, B) is true if A is weaker than
   *  or equal to B.
   */
  if (CL_IS_LOGGED(clc->clc_trigger, clc->clc_full)) {
    cl_loglevel lv;

    /*  Switch them.  The log level is the weaker of the two.
     */
    lv = clc->clc_full;
    clc->clc_full = clc->clc_trigger;
    clc->clc_trigger = lv;
  }
  return 0;
}

/**
 * @brief Get the current loglevel.
 *
 * @param cl 	log handle whose level we're curious about.
 * @return 	the loglevel currently set for the handle.
 */
void(cl_get_loglevel_configuration)(cl_handle* cl,
                                    cl_loglevel_configuration* clc) {
  clc->clc_full = cl_get_loglevel_full(cl);
  clc->clc_trigger = cl_get_loglevel_trigger(cl);
}

/**
 * @brief Get the current loglevel.
 *
 * @param cl 	log handle whose level we're curious about.
 * @return 	the loglevel currently set for the handle.
 */
cl_loglevel(cl_get_loglevel_full)(cl_handle* cl) {
  return cl_get_loglevel_full(cl);
}

/**
 * @brief Get the current loglevel.
 *
 * @param cl 	log handle whose level we're curious about.
 * @return 	the loglevel currently set for the handle.
 */
cl_loglevel(cl_get_loglevel_trigger)(cl_handle* cl) {
  return cl_get_loglevel_trigger(cl);
}

/**
 * @brief Set the current loglevel.
 *
 * @param cl 	log handle whose level we're setting.
 * @param lev	loglevel to set
 */
void(cl_set_loglevel_full)(cl_handle* cl, cl_loglevel lev) {
  cl_set_loglevel_full(cl, lev);
}

/**
 * @brief Set the current trigger level.
 *
 * @param cl 	log handle whose level we're setting.
 * @param lev	loglevel to set
 */
void(cl_set_loglevel_trigger)(cl_handle* cl, cl_loglevel lev) {
  cl_set_loglevel_trigger(cl, lev);
}

/**
 * @brief Set the current loglevel from a configuration.
 *
 * @param cl 	log handle whose level we're setting.
 * @param lev	loglevel to set
 */
void cl_set_loglevel_configuration(cl_handle* cl,
                                   cl_loglevel_configuration const* clc) {
  /*  If the loglevels change, truncate the diary.
   */
  if (clc->clc_full == cl_get_loglevel_full(cl) &&
      clc->clc_trigger == cl_get_loglevel_trigger(cl))
    return;

  if (cl->cl_diary != NULL) cl_diary_truncate(cl->cl_diary);

  cl_set_loglevel_trigger(cl, clc->clc_trigger);
  cl_set_loglevel_full(cl, clc->clc_full);
}

void cl_loglevel_configuration_max(cl_loglevel_configuration const* a,
                                   cl_loglevel_configuration const* b,
                                   cl_loglevel_configuration* out) {
  out->clc_trigger = cl_loglevel_max(a->clc_trigger, b->clc_trigger);
  out->clc_full = cl_loglevel_max(a->clc_full, b->clc_full);
}


text:
package org.apache.ignite.internal.processors.query.calcite.exec;

import java.util.Collections;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 *
 */
public class ClosableIteratorsHolderTest extends GridCommonAbstractTest {
    /** */
    private static final int GENERATED = 10000;

    /** */
    private Set<Iterator<?>> iterators;

    /** */
    private ClosableIteratorsHolder holder;

    /** */
    @Before
    public void setup() throws Exception {
        iterators = Collections.newSetFromMap(new ConcurrentHashMap<>());
        holder = new ClosableIteratorsHolder(log());
        holder.init();
    }

    /** */
    @After
    public void tearDown() throws Exception {
        holder.tearDown();

        holder = null;
        iterators = null;
    }

    /** */
    @Test
    public void iterator() throws Exception {
        for (int i = 0; i < GENERATED; i++)
            holder.iterator(newIterator());

        System.gc();

        GridTestUtils.waitForCondition(() -> iterators.size() < GENERATED, 10_000);

        assertTrue(iterators.size() < GENERATED);
    }

    /** */
    private Iterator<?> newIterator() {
        final ClosableIterator iterator = new ClosableIterator();
        iterators.add(iterator);
        return iterator;
    }

    /** */
    private class ClosableIterator implements Iterator<Object>, AutoCloseable {
        /** */
        public final byte[] data;

        /** */
        private ClosableIterator() {
            data = new byte[4096];
        }

        /** {@inheritDoc} */
        @Override public boolean hasNext() {
            return false;
        }

        /** {@inheritDoc} */
        @Override public Object next() {
            throw new NoSuchElementException();
        }

        /** {@inheritDoc} */
        @Override public void close() throws Exception {
            Optional.ofNullable(iterators)
                .ifPresent(set -> set.remove(this));
        }
    }
}


text:
{{getCommitter()}} / {{getName()}}

			Documentation:

				<input class="form-control" [(ngModel)]="project.documentation"
					placeholder="documentation" />

					<button (click)="editDocumentation=false" class="btn btn-default">Cancel</button>
					<button (click)="save()" class="btn btn-primary">Save</button>

			Documentation:

{{getDocumentation()}}

				<button (click)="editDocumentation=true" class="btn btn-default">Edit</button>

			Updated:

{{getLastUpdated()}}

		Branches:

			<select class="col-sm-10" [(ngModel)]="selectedBranch"
				(ngModelChange)="onChange($event)">
				<option *ngFor="let b of branches" [ngValue]="b">{{b.name}}</option>
			</select>

Handling of Branches

				<input class="form-control" [(ngModel)]="newBranchName"
					placeholder="new branch name" />
				<button (click)="cloneBranch()" class="btn btn-primary">Clone
					Branch</button>

Committing a new Model

				Model File:

					<input class="form-control" type="file"
						(change)="fileChange($event)" placeholder="Upload file"
						accept=".xml,.json">

			Model Type:

				<select class="col-sm-10" [(ngModel)]="selectedModel.parserName"
					(ngModelChange)="onChange($event)">
					<option vakue="archimate3">archimate3</option>
				</select>

				Comment:

					<input class="form-control" [(ngModel)]="selectedModel.comment"
						placeholder="commit message" />

				Status:

The file has been
					uploaded but the file has not been processed by the repository.
					Please check the status in a bit again. Sorry for the delay.

The file has been
					uploaded but the file has not been processed by the repository.
					Please check the status in a bit again. Sorry for the delay.

The upload is still
					running. Until now {{status.noNodes}} nodes, {{status.noRelations}}
					relations and {{status.noViews}} views have been uploaded.

					Unfortunately the upload has failed because of the following
					reason:
 {{status.message}}
 After {{status.noNodes}}
					nodes, {{status.noRelations}} relations and {{status.noViews}}
					views had been uploaded.

					The processing has been completed and {{status.noNodes}} nodes,
					{{status.noRelations}} relations and {{status.noViews}} views have
					been uploaded.
 Please retrieve the annotated model file.

					<button (click)="updateStatus()" class="btn btn-primary">Refresh</button>

					<button (click)="retrieveModel()" class="btn btn-primary">Retrieve</button>

					<button (click)="saveModel()" class="btn btn-primary">Commit</button>

Retrieve a Model

					<button (click)="retrieveModel()" class="btn btn-primary">Retrieve</button>

compare two versions of a model either from different
			branches or of the current branch and the uploaded file

show 15 latest actions on that branch


text:
const runtime = require('atomable-runtime');

/** imports */

/**
 * handler() handles aws lambda events
 */
module.exports.handler = runtime.handle;


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="fcv.tomazini.automacaoresidencial"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:icon="@drawable/ic_launcher"
        android:allowBackup="false"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="fcv.tomazini.automacaoresidencial.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
{% extends "admin/base.html" %}

{% block title %}Sitevar List{% endblock %}

{% block content %}

All {{ sitevars|length }} Sitevars

Sitevars are used to hold properties that are needed across the site, but shouldn't be stored in physical files or hardcoded.

Create Sitevar

        Key
        Description
        Last Updated

    {% for sitevar in sitevars %}

        {{ sitevar.key.id() }}
        {{ sitevar.description }}
        {{ sitevar.updated }}

    {% endfor %}

{% endblock %}


text:
В ECMAScript 2015 введен тип `symbol` (символ) — примитивный тип данных, такой же, как `number` и `string`.

Значения типа `symbol` создаются с помощью вызова конструктора `Symbol`.

```ts
let sym1 = Symbol();

let sym2 = Symbol("key"); // Необязательный строковый ключ
```

Символы неизменяемы и уникальны.

```ts
let sym2 = Symbol("key");
let sym3 = Symbol("key");

sym2 === sym3; // false, символы уникальны
```

Подобно строкам, символы можно использовать как ключи для свойств объекта.

```ts
let sym = Symbol();

let obj = {
    [sym]: "value"
};

console.log(obj[sym]); // "value"
```

Символы можно использовать вместе с вычисляемыми свойствами, чтобы объявлять свойства объектов и члены классов:

```ts
const getClassNameSymbol = Symbol();

class C {
    [getClassNameSymbol](){
       return "C";
    }
}

let c = new C();
let className = c[getClassNameSymbol](); // "C"
```

# Заранее определенные символы

Кроме символов, определяемых пользователем, существуют заранее определенные встроенные символы.
Встроенные символы нужны для отражения внутреннего поведения языка.

Список заранее определенных символов:

## `Symbol.hasInstance`

Метод, который определяет, распознает ли объект конструктора переданный объект как экземпляр этого конструктора. Вызывается оператором `instanceof`.

## `Symbol.isConcatSpreadable`

Логическое значение, означающее, должен ли объект раскладываться на элементы массива при использовании с `Array.prototype.concat`.

## `Symbol.iterator`

Метод, который возвращает итератор по умолчанию для объекта. Вызывается конструкцией `for-of`.

## `Symbol.match`

Метод для регулярных выражений, который сопоставляет регулярное выражение со строкой. Вызывается методом `String.prototype.match`.

## `Symbol.replace`

Метод для регулярных выражений, который заменяет совпавшие подстроки в строке. Вызывается методом `String.prototype.replace`.

## `Symbol.search`

Метод для регулярных выражений, который возвращает позицию в строке, где находится совпадение с регулярным выражением. Вызывается методом `String.prototype.search`.

## `Symbol.species`

Свойство, содержащее функцию, которая служит в качестве конструктора для унаследованных объектов.

## `Symbol.split`

Метод для регулярных выражений, который разбивает строку по позициям совпадений с регулярным выражением.
Вызывается методом `String.prototype.split`.

## `Symbol.toPrimitive`

Метод, который превращает объект в соответствующее примитивное значение.
Вызывается абстрактной операцией `ToPrimitive`.

## `Symbol.toStringTag`

Строковое значение, которое используется для создания строкового значения по умолчанию, описывающего объект.
Вызывается встроенным методом `Object.prototype.toString`.

## `Symbol.unscopables`

Объект, имена собственных свойств которого — это имена свойств, привязки к которым не включаются в окружение, создаваемое конструкцией `with` для соответствующих объектов.

[Источник](http://typescript-lang.ru/docs/Symbols.html)


text:
@interface HSFAdditionalInformationViewController_iPhone : UIViewController

@end


text:
PivDiRe (Pivot Dimensionality Reduction)
=======

Dimensionality reduction that allows you to assign weights for the importance of each point

Idea
----

In order to plot high dimensional spaces it's necessary to transform them down to 2D (or maybe 3D with super cool displays). When perform this dimensionality reduction on normal, real word data, that process usually causes a loss of information since there usually is no compact 2D representation of points from a high dimensional space.
Standard methods like PCA or [tSNE](http://homepage.tudelft.nl/19j49/t-SNE.html) treat every point as equally important.
The provided python function allows you to specify a number of _pivot points_ that constitute some kind of landmark in your space. Preserving the distance from those pivot points to any other point is then regarded as more important than any normal point-to-point distance.

Example Scenario
----------------

You retrieve the nearest neighbors for 3 different query points from a set of vectors. You would like to plot each query point and all the retrieved results in the same image.
For most examples that I have encountered, standard methods will give you quite poor results. Most of the time you will either see a very regular pattern or the results being clustered very closely to their cluster centers (queries) with a lot of space between those clusters.
Since Query-to-point distancas are weighed more than normal point-to-point distances in the proposed method, the results are forced to leave their local cluster to preserve the distances to all the queries.

You can see an example in the iPython notebook that I provided.

Details
-------
Details on the method will follow soon.