text:
package com.rim.samples.device.gpsdemo;

import java.util.Vector;

import javax.microedition.location.Criteria;
import javax.microedition.location.Location;
import javax.microedition.location.LocationException;
import javax.microedition.location.LocationListener;
import javax.microedition.location.LocationProvider;

import net.rim.device.api.command.Command;
import net.rim.device.api.command.CommandHandler;
import net.rim.device.api.command.ReadOnlyCommandMetadata;
import net.rim.device.api.gps.GPSInfo;
import net.rim.device.api.system.PersistentObject;
import net.rim.device.api.system.PersistentStore;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.component.TextField;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.util.Persistable;
import net.rim.device.api.util.StringProvider;

/**
 * This application acts as a simple travel computer, recording route
 * coordinates, speed and altitude. Recording begins as soon as the application
 * is invoked.
 */
public class GPSDemo extends UiApplication {
    // Represents the number of updates over which altitude is calculated, in
    // seconds
    private static final int GRADE_INTERVAL = 5;

    // com.rim.samples.device.gpsdemo.GPSDemo.ID
    private static final long ID = 0x5d459971bb15ae7aL;

    // Represents period of the position query, in seconds
    private static int _interval = 1;

    private static Vector _previousPoints;
    private static float[] _altitudes;
    private static float[] _horizontalDistances;
    private static PersistentObject _store;

    // Initialize or reload the persisted WayPoints
    static {
        _store = PersistentStore.getPersistentObject(ID);

        if (_store.getContents() == null) {
            _previousPoints = new Vector();
            _store.setContents(_previousPoints);
        }

        _previousPoints = (Vector) _store.getContents();
    }

    private long _startTime;
    private float _wayHorizontalDistance;
    private float _horizontalDistance;
    private float _verticalDistance;
    private double _latitude;
    private double _longitude;
    private final EditField _status;
    private LocationProvider _locationProvider;
    private final GPSDemoScreen _screen;

    /**
     * Entry point for application
     *
     * @param args
     *            Command line arguments (not used)
     */
    public static void main(final String[] args) {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        new GPSDemo().enterEventDispatcher();
    }

    /**
     * Create a new GPSDemo object
     */
    public GPSDemo() {
        // Used by WayPoints, represents the time since the last waypoint
        _startTime = System.currentTimeMillis();

        _altitudes = new float[GRADE_INTERVAL];
        _horizontalDistances = new float[GRADE_INTERVAL];

        _screen = new GPSDemoScreen();
        _screen.setTitle("GPS Demo");

        _status = new EditField(Field.NON_FOCUSABLE);
        _screen.add(_status);

        // Attempt to start the location listening thread
        if (startLocationUpdate()) {
            _screen.setState(_locationProvider.getState());
        }

        // Render the screen
        pushScreen(_screen);
    }

    /**
     * Update the GUI with the data just received
     *
     * @param msg
     *            The message to display
     */
    private void updateLocationScreen(final String msg) {
        invokeLater(new Runnable() {
            public void run() {
                _status.setText(msg);
            }
        });
    }

    /**
     * Invokes the Location API with Standalone criteria
     *
     * @return True if the LocationProvider was successfully
     *         started, false otherwise
     */
    private boolean startLocationUpdate() {
        boolean returnValue = false;

        if (!(GPSInfo.getDefaultGPSMode() == GPSInfo.GPS_MODE_NONE)) {
            try {
                final Criteria criteria = new Criteria();
                criteria.setCostAllowed(false);

                _locationProvider = LocationProvider.getInstance(criteria);

                if (_locationProvider != null) {
                    /*
                     * Only a single listener can be associated with a provider,
                     * and unsetting it involves the same call but with null.
                     * Therefore, there is no need to cache the listener
                     * instance request an update every second.
                     */
                    _locationProvider.setLocationListener(
                            new LocationListenerImpl(), _interval, -1, -1);
                    returnValue = true;
                } else {
                    invokeLater(new Runnable() {
                        public void run() {
                            Dialog.alert("Failed to obtain a location provider, exiting...");
                            System.exit(0);
                        }
                    });
                }

            } catch (final LocationException le) {
                invokeLater(new Runnable() {
                    public void run() {
                        Dialog.alert("Failed to instantiate LocationProvider object, exiting..."
                                + le.toString());
                        System.exit(0);
                    }
                });
            }
        } else {
            invokeLater(new Runnable() {
                public void run() {
                    Dialog.alert("GPS is not supported on this device, exiting...");
                    System.exit(0);
                }
            });
        }

        return returnValue;
    }

    /**
     * Marks a WayPoint in the persistent store. Calculations are based on all
     * data collected since the previous way point, or from the start of the
     * application if no previous WayPoints exist.
     */
    private void markPoint() {
        final long current = System.currentTimeMillis();
        final WayPoint point =
                new WayPoint(_latitude, _longitude, _startTime, current,
                        _wayHorizontalDistance, _verticalDistance);

        addWayPoint(point);

        // Reset the WayPoint variables
        _startTime = current;
        _wayHorizontalDistance = 0;
        _verticalDistance = 0;
    }

    /**
     * View the various saved WayPoints
     */
    private void viewPreviousPoints() {
        final PointScreen pointScreen = new PointScreen(_previousPoints);
        pushScreen(pointScreen);
    }

    /**
     * Adds a new WayPoint and commits the set of saved waypoints to persistent
     * store.
     *
     * @param point
     *            The WayPoint to add
     */
    private synchronized static void addWayPoint(final WayPoint point) {
        _previousPoints.addElement(point);
        commit();
    }

    /**
     * Removes a WayPoint from the set of saved points and commits the modifed
     * set to persistent store
     *
     * @param point
     *            The WayPoint to remove
     */
    synchronized static void removeWayPoint(final WayPoint point) {
        _previousPoints.removeElement(point);
        commit();
    }

    /**
     * Commits the WayPoint set to persistent store
     */
    private static void commit() {
        _store.setContents(_previousPoints);
        _store.commit();
    }

    /**
     * Implementation of the LocationListener interface. Listens for updates to
     * the device location and displays the results.
     */
    private class LocationListenerImpl implements LocationListener {

        /**
         * @see javax.microedition.location.LocationListener#locationUpdated(LocationProvider,Location)
         */
        public void locationUpdated(final LocationProvider provider,
                final Location location) {
            if (location.isValid()) {
                final float heading = location.getCourse();
                _longitude = location.getQualifiedCoordinates().getLongitude();
                _latitude = location.getQualifiedCoordinates().getLatitude();
                final float altitude =
                        location.getQualifiedCoordinates().getAltitude();
                final float speed = location.getSpeed();

                // Horizontal distance for current Location
                final float horizontalDistance = speed * _interval;
                _horizontalDistance += horizontalDistance;

                // Horizontal distance for WayPoint
                _wayHorizontalDistance += horizontalDistance;

                // Distance over the current interval
                float totalDist = 0;

                // Moving average grade
                for (int i = 0; i < GRADE_INTERVAL - 1; ++i) {
                    _altitudes[i] = _altitudes[i + 1];
                    _horizontalDistances[i] = _horizontalDistances[i + 1];
                    totalDist = totalDist + _horizontalDistances[i];
                }

                _altitudes[GRADE_INTERVAL - 1] = altitude;
                _horizontalDistances[GRADE_INTERVAL - 1] = speed * _interval;
                totalDist =
                        totalDist + _horizontalDistances[GRADE_INTERVAL - 1];
                final float grade =
                        totalDist == 0.0F ? Float.NaN
                                : (_altitudes[4] - _altitudes[0]) * 100
                                        / totalDist;

                // Running total of the vertical distance gain
                final float altGain =
                        _altitudes[GRADE_INTERVAL - 1]
                                - _altitudes[GRADE_INTERVAL - 2];

                if (altGain > 0) {
                    _verticalDistance = _verticalDistance + altGain;
                }

                // Information to be displayed on the device
                final StringBuffer sb = new StringBuffer();
                sb.append("Longitude: ");
                sb.append(_longitude);
                sb.append("\n");
                sb.append("Latitude: ");
                sb.append(_latitude);
                sb.append("\n");
                sb.append("Altitude: ");
                sb.append(altitude);
                sb.append(" m");
                sb.append("\n");
                sb.append("Heading relative to true north: ");
                sb.append(heading);
                sb.append("\n");
                sb.append("Speed : ");
                sb.append(speed);
                sb.append(" m/s");
                sb.append("\n");
                sb.append("Grade : ");
                if (Float.isNaN(grade)) {
                    sb.append(" Not available");
                } else {
                    sb.append(grade + " %");
                }

                GPSDemo.this.updateLocationScreen(sb.toString());
            }
        }

        /**
         * @see javax.microedition.location.LocationListener#providerStateChanged(LocationProvider,
         *      int)
         */
        public void providerStateChanged(final LocationProvider provider,
                final int newState) {
            if (newState == LocationProvider.TEMPORARILY_UNAVAILABLE) {
                provider.reset();
            }
            _screen.setState(newState);
        }
    }

    /**
     * The main screen to display the current GPS information
     */
    private final class GPSDemoScreen extends MainScreen {
        TextField _statusTextField;

        /**
         * Create a new GPSDemoScreen object
         */
        GPSDemoScreen() {
            // Initialize UI
            _statusTextField = new TextField(Field.NON_FOCUSABLE);
            _statusTextField.setLabel("GPS Status: ");
            add(_statusTextField);
            final RichTextField instructions =
                    new RichTextField("Waiting for location update...",
                            Field.NON_FOCUSABLE);
            add(instructions);

            // Menu Item to add the current location to the list of WayPoints
            final MenuItem markWayPoint =
                    new MenuItem(new StringProvider("Mark waypoint"), 0x230010,
                            0);
            markWayPoint.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    GPSDemo.this.markPoint();
                }
            }));

            // Menu Item to view the marked WayPoints
            final MenuItem viewWayPoints =
                    new MenuItem(new StringProvider("View waypoints"),
                            0x230020, 1);
            viewWayPoints.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    GPSDemo.this.viewPreviousPoints();
                }
            }));
            addMenuItem(markWayPoint);
            addMenuItem(viewWayPoints);
        }

        /**
         * Display the state of the GPS service
         *
         * @param newState
         *            The state to display
         */
        public void setState(final int newState) {
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                /**
                 * @see java.lang.Runnable#run()
                 */
                public void run() {
                    switch (newState) {
                    case LocationProvider.AVAILABLE:
                        _statusTextField.setText("Available");
                        break;
                    case LocationProvider.OUT_OF_SERVICE:
                        _statusTextField.setText("Out of Service");
                        break;
                    case LocationProvider.TEMPORARILY_UNAVAILABLE:
                        _statusTextField.setText("Temporarily Unavailable");
                        break;
                    }
                }
            });
        }

        /**
         * @see net.rim.device.api.ui.Screen#close()
         */
        public void close() {
            if (_locationProvider != null) {
                _locationProvider.reset();
                _locationProvider.setLocationListener(null, -1, -1, -1);
            }

            super.close();
        }
    }

    /**
     * A class to represent a way point, a marker on a journey or a point of
     * interest.
     */
    static class WayPoint implements Persistable {
        long _startTime;
        long _endTime;
        double _latitude;
        double _longitude;
        float _distance;
        float _verticalDistance;

        /**
         * Creates a new WayPoint object
         *
         * @param latitude
         *            Latitude of waypoint
         * @param longitude
         *            Longitude of waypoint
         * @param startTime
         *            Time at start of update
         * @param endTime
         *            Time at end of update
         * @param distance
         *            Distance travelled
         * @param verticalDistance
         *            Vertical distance travelled
         */
        WayPoint(final double latitude, final double longitude,
                final long startTime, final long endTime, final float distance,
                final float verticalDistance) {
            _startTime = startTime;
            _endTime = endTime;
            _distance = distance;
            _verticalDistance = verticalDistance;
            _latitude = latitude;
            _longitude = longitude;
        }
    }
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>Picturepark REST API V1</title>
    <!-- needed for adaptive design -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">

    <!--
    ReDoc doesn't change outer page styles
    -->
    <style>
        body {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<redoc spec-url="https://raw.githubusercontent.com/Picturepark/Picturepark.SDK.DotNet/master/swagger/PictureparkSwagger.json"></redoc>
<script src="redoc.standalone.js"></script>
</body>
</html>

redpajama_set_name: RedPajamaGithub


text:
package org.tools.hqlbuilder.common.exceptions;

import java.io.Serializable;
import java.util.List;

public class ValidationException extends RuntimeException {
    private static final long serialVersionUID = 6238718287643857217L;

    private final List<InvalidValue> invalidValues;

    public ValidationException(String message, List<InvalidValue> invalidValues) {
        super(message);
        this.invalidValues = invalidValues;
    }

    public static class InvalidValue implements Serializable {
        private static final long serialVersionUID = -6181329358582271367L;

        public InvalidValue(Object bean, Class<?> beanClass, String message, String propertyName, String propertyPath, Object rootBean,
                Object value) {
            super();
            this.bean = bean;
            this.beanClass = beanClass;
            this.message = message;
            this.propertyName = propertyName;
            this.propertyPath = propertyPath;
            this.rootBean = rootBean;
            this.value = value;
        }

        private final String message;

        private final Object value;

        private final String propertyName;

        private final Class<?> beanClass;

        private final Object bean;

        private final Object rootBean;

        private final String propertyPath;

        public String getMessage() {
            return this.message;
        }

        public Object getValue() {
            return this.value;
        }

        public String getPropertyName() {
            return this.propertyName;
        }

        public Class<?> getBeanClass() {
            return this.beanClass;
        }

        public Object getBean() {
            return this.bean;
        }

        public Object getRootBean() {
            return this.rootBean;
        }

        public String getPropertyPath() {
            return this.propertyPath;
        }

        @Override
        public String toString() {
            return "InvalidValue [beanClass=" + this.beanClass + ", propertyName=" + this.propertyName + ", propertyPath=" + this.propertyPath
                    + ", message=" + this.message + ", value=" + this.value + ", bean=" + this.bean + ", rootBean=" + this.rootBean + "]";
        }
    }

    public List<InvalidValue> getInvalidValues() {
        return this.invalidValues;
    }

    @Override
    public String toString() {
        return "ValidationException [message=" + getMessage() + "[invalidValues=" + this.invalidValues + "]";
    }
}


text:
App.FilterController = Em.Controller.extend({
	needs: ['contacts', 'catsfilter'],
	init: function() {
		var contactCt = this.get('controllers.contacts.content');
		this.set('content', contactCt);
		console.log('the FilterController is set up, with the content equal to ' + this.content);
		this.set('filteredContent', 'content');
		this.set('cat1filterOn', true);
		this.set('cat2filterOn', false);
		this.set('filterArray', Em.A([]));
	},

	 /*
        >--------------------------------------<

        Here follows filteredContent, which is
        all the content that the controller and
        views will access. It is an array of
        objects that the controller has fetched
        according to a filter query from the model.
        Marker creation etc. should be based off
        this.

        The filter query is a series of parameters
        (mostly numerical or boolean) that are derived
        from the current state of the filterMatrix.

        All of this will be bound to update depending on
        changes in the filterMatrix, the content array,
        and various user interactions, via observers.

        >--------------------------------------<
        */
        applyFilter: function(arr) {
        	this.set('previousArr', this.get('controllers.contacts.content'));
        	console.log('previousArr now ' + this.get('previousArr'));
	        this.set('controllers.contacts.content', arr)
	        console.log('applyFilter says: contacts content now changed to ' + this.get('controllers.contacts.content'));
        },
        doFilter: function(property, value) {
        console.log('**************************doFilter called******************');
        var controller = this;
        var tmpContent = controller.get('content').filterProperty(property, value);
        return controller.set('filteredContent', tmpContent);
        console.log('filteredContent is now equal to ' + controller.filteredContent)

        },

        previousArr: null,

        chosenFilter: null,

         /*
        >--------------------------------------<

        Here follows the filterMatrix. Each item
        in the matrix is a filter. Each filter
        is an Array of a filter key and filter value.

        >--------------------------------------<
        */
        filteredContent: null,

        cat1filterOn: null,
        cat2filterOn: null,

        removeFilter: function(filter) {
        var controller = this;

        console.log('removefiltercalled with filter equal to ' + filter);
        $('#' + filter + 'filter').attr("value", '');
        var item = controller.filterArray.findProperty('filterFor', filter);
        var indexOfItem = controller.filterArray.indexOf(item);
        console.log('removefiltercalled with filter equal to ' + filter + ' and item equal to ' + item);
        controller.filterArray.splice(indexOfItem, 1);
        controller.set(filter + 'filterOn', false); //how to get each one depending on filter?
        console.log(filter + 'filterOn is now ' + controller.get(filter + 'filterOn'));
        controller.filterArrayDidChange();
        },

     /* getFilters: function(email, name, lat, lng, user_is_going, start, end, cat1, cat2, pricelower, pricehigher) {
	      var protoFilteredContent = App.Contact.filterProperty('email', email)
	      .filterProperty('name', name)
	      .filterProperty('lat', lat)
	      .filterProperty('lng', lng)
	      .filterProperty('user_is_going', user_is_going)
	      .filterProperty('start', start)
	      .filterProperty('end', end)
	      .filterProperty('cat1', cat1)
	      .filterProperty('cat2', cat2)
	      .filterProperty('pricelower', pricelower)
	      .filterProperty('pricehigher', pricehigher);
	      this.set('filteredContent', protoFilteredContent);
	      console.log('the filtered content has been generated and is waiting to be sent for application. Filtered Content = ' + this.filteredContent);
      },*/

      filterArray: null, //an array of objects (only applied filters) with filterfor and value keys corresponding selected values

      filterArrayDidChange: (function() {
      console.log('!!!!!!!!!!!!!!!!!!!filterarray changed!!!!!!!!!!!!!!!!!!!!!!!!!!!');
      var controller = this;
	var newContent = App.Contact.find();
	console.log('newContent is initialized as ' + newContent + ' and the filterArray currently contains ' + controller.filterArray + ' and the length of that filterArray is ' + controller.filterArray.length);
	if( controller.filterArray.length == 0 || controller.filterArray.length == null) {console.log('the filterArray is empty, so were just returning all contacts as the content')}
	else {
	controller.filterArray.forEach(function(item) {
		console.log('were iterating over the filterArray with the current item being ' + item);
		newContent = newContent.filterProperty(item.filterFor, item.value);
		console.log('newContent is ' + newContent + '****************************')
		});};
		controller.applyFilter(newContent);
		})

});


text:
package org.elasticsearch.ingest.attachment;

import org.elasticsearch.node.NodeModule;
import org.elasticsearch.plugins.Plugin;

import java.io.IOException;

public class IngestAttachmentPlugin extends Plugin {

    @Override
    public String name() {
        return "ingest-attachment";
    }

    @Override
    public String description() {
        return "Ingest processor that adds uses Tika to extract binary data";
    }

    public void onModule(NodeModule nodeModule) throws IOException {
        nodeModule.registerProcessor(AttachmentProcessor.TYPE,
            (templateService, registry) -> new AttachmentProcessor.Factory());
    }
}


text:
<?php

namespace app\models;

use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\GuRecent;

/**
 * GuRecentSearch represents the model behind the search form about `app\models\GuRecent`.
 */
class GuRecentSearch extends GuRecent
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'integer'],
            [['code', 'day', 'created_at', 'updated_at'], 'safe'],
            [['final_zjc'], 'number'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = GuRecent::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'day' => $this->day,
            'final_zjc' => $this->final_zjc,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'code', $this->code]);

        return $dataProvider;
    }
}


text:
if(DEFINED SOBER_SUGAR_CMAKE_)
  return()
else()
  set(SOBER_SUGAR_CMAKE_ 1)
endif()

include(sugar_files)
include(sugar_include)

sugar_include(asserts)
sugar_include(log)
sugar_include(network)
sugar_include(utils)

sugar_files(SOBER_SOURCES Exit.hpp config.hpp)


text:
from django.conf import settings

settings.configure(DEBUG=True, TEMPLATE_DEBUG=True,
    TEMPLATE_DIRS=('/home/web-apps/myapp', '/home/web-apps/base'))


text:
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
  android:duration="200"
  android:fillAfter="false"
  android:fromAlpha="1"
  android:interpolator="@android:anim/linear_interpolator"
  android:repeatCount="5"
  android:repeatMode="reverse"
  android:toAlpha="0"/>


text:
package com.jkoolcloud.tnt4j.streams.custom.interceptors.kafka.reporters.trace;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;

import java.io.IOException;
import java.text.ParseException;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.TimeUnit;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.kafka.clients.consumer.*;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.apache.kafka.common.ClusterResource;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.errors.WakeupException;
import org.apache.kafka.common.header.internals.RecordHeaders;
import org.apache.kafka.common.record.TimestampType;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;

import com.google.common.collect.Ordering;
import com.jkoolcloud.tnt4j.core.OpType;
import com.jkoolcloud.tnt4j.core.UsecTimestamp;
import com.jkoolcloud.tnt4j.streams.TestUtils;
import com.jkoolcloud.tnt4j.streams.custom.interceptors.kafka.TNTKafkaCInterceptor;
import com.jkoolcloud.tnt4j.streams.custom.interceptors.kafka.TNTKafkaPInterceptor;
import com.jkoolcloud.tnt4j.streams.fields.*;
import com.jkoolcloud.tnt4j.streams.inputs.InterceptorStream;
import com.jkoolcloud.tnt4j.streams.outputs.JKCloudActivityOutput;
import com.jkoolcloud.tnt4j.streams.parsers.ActivityJavaObjectParser;
import com.jkoolcloud.tnt4j.streams.parsers.ActivityParser;
import com.jkoolcloud.tnt4j.streams.utils.TimestampFormatter;
import com.jkoolcloud.tnt4j.streams.utils.Utils;

public class MsgTraceReporterTest {

	public static final String SEND = "Kafka_Producer_Send";
	public static final int PARTITION = 0;
	public static final String TOPIC = "TestTopic";
	public static final String KEY = "Key";
	public static final String MESSAGE = "TestMessage";
	public static final long TIMESTAMP = System.currentTimeMillis();
	public static final long OFFSET = 123;
	public static final int BATCH_INDEX = 1;
	public TestActivityInfoConsumer test;
	private Consumer<String, String> consumer;

	@Ignore
	@Test
	public void pollConfigQueue() throws Exception {
		Properties config = new Properties();
		config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
		config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getCanonicalName());
		config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getCanonicalName());
		config.put(ConsumerConfig.GROUP_ID_CONFIG, "Test");
		config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
		config.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
		config.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "30000");

		InterceptorStream<ActivityInfo> stream = buildStream();
		MsgTraceReporter reporter = getMsgTraceReporter(stream);

		for (int i = 0; i < 10; i++) {
			HashMap<String, TraceCommandDeserializer.TopicTraceCommand> traceConfig = new HashMap<>();
			reporter.pollConfigQueue(config, MsgTraceReporter.TRACE_CONFIG_TOPIC, traceConfig);
			System.out.println("Control records for " + traceConfig.size());
			TimeUnit.SECONDS.sleep(3);
		}

		reporter.shutdown();
	}

	@Ignore
	@Test
	public void connectToKafkaQueueAndGetTheMessages() {
		Properties props = new Properties();
		props.put("bootstrap.servers", "localhost:9092");
		props.put("group.id", "testGroup");
		props.put("enable.auto.commit", "true");
		props.put("auto.commit.interval.ms", "1000");
		props.put("session.timeout.ms", "30000");
		props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
		props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

		consumer = new KafkaConsumer<>(props);
		try {
			TopicPartition topicPartition = new TopicPartition(MsgTraceReporter.TRACE_CONFIG_TOPIC, 0);
			consumer.assign(Arrays.asList(topicPartition));

			while (true) {
				ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(500));
				if (records.count() > 0) {
					System.out.println("Polled " + records.count() + "messages");
				}

				for (ConsumerRecord<String, String> record : records) {
					System.out
							.printf("offset = %d, key = %s, value = %s", record.offset(), record.key(), record.value())
							.println();
				}
			}
		} catch (WakeupException exc) {
		} finally {
			consumer.close();
		}
	}

	@Test
	@Ignore("Stop messages consumer")
	public void stopConsuming() {
		if (consumer != null) {
			consumer.wakeup();
		}
	}

	@Test
	public void testKafkaProperties() throws Exception {
		Properties props = null;
		Properties kafkaProperties = Utils
				.loadPropertiesFile("../tnt4j-streams-kafka/config/intercept/interceptorsC.properties");

		props = MsgTraceReporter.extractKafkaProperties(kafkaProperties);

		for (String name : props.stringPropertyNames()) {
			System.out.println(name + "\n");
			Set<String> keys = new TreeSet<>(Ordering.usingToString());
			keys.addAll(ConsumerConfig.configNames());

			assertTrue(keys.contains(name));
		}

		System.out.println(props);
	}

	@Test
	public void testSend() throws Exception {
		InterceptorStream<ActivityInfo> stream = buildStream();
		MsgTraceReporter reporter = getMsgTraceReporter(stream);

		ProducerRecord producerRecord = getProducerRecord();

		reporter.send(mock(TNTKafkaPInterceptor.class), producerRecord, null);

		test = new TestActivityInfoConsumer() {
			@Override
			public void test(ActivityInfo ai) {
				testSendFields(producerRecord, ai);
			}
		};

		reporter.shutdown();
	}

	@Test
	public void testAck() throws Exception {
		InterceptorStream<ActivityInfo> stream = buildStream();
		MsgTraceReporter reporter = getMsgTraceReporter(stream);

		RecordMetadata recordMetadata = new RecordMetadata(getTopicPartition(), OFFSET, OFFSET, TIMESTAMP, 123L,
				KEY.length(), MESSAGE.length());
		Exception e = new Exception("AAA");
		ClusterResource clusterResource = new ClusterResource("CLUSTERID");

		reporter.acknowledge(mock(TNTKafkaPInterceptor.class), recordMetadata, e, clusterResource);

		ActivityInfo activityInfo = stream.getNextItem();

		// assertEquals(activityInfo.getFieldValue((StreamFieldType.TrackingId.name())), MsgTraceReporter
		// .calcSignature(recordMetadata.topic(), recordMetadata.partition(), recordMetadata.offset()));

		test = new TestActivityInfoConsumer() {
			@Override
			public void test(ActivityInfo activityInfo) {
				assertEquals(activityInfo.getFieldValue(StreamFieldType.Exception.name()), e.getMessage());
				assertEquals(activityInfo.getFieldValue("ClusterId"), clusterResource.clusterId()); // NON-NLS
				testRecordMetadataFields(recordMetadata, activityInfo);
			}
		};

		reporter.shutdown();
	}

	private void testSendFields(ProducerRecord producerRecord, ActivityInfo activityInfo) {
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.EVENT);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()), "Kafka_Producer_Send"); // NON-NLS

		assertEquals(activityInfo.getFieldValue("Partition"), producerRecord.partition()); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Topic"), producerRecord.topic()); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Key"), producerRecord.key()); // NON-NLS
		assertEquals(activityInfo.getFieldValue(StreamFieldType.Message.name()), producerRecord.value());
		assertEquals(activityInfo.getFieldValue(StreamFieldType.StartTime.name()), producerRecord.timestamp());
		assertEquals(activityInfo.getFieldValue(StreamFieldType.ApplName.name()), null);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.ResourceName.name()),
				"QUEUE=" + producerRecord.topic());
	}

	private ProducerRecord getProducerRecord() {
		return new ProducerRecord<String, String>(TOPIC, 0, null, "VALUE"); // NON-NLS
	}

	private InterceptorStream<ActivityInfo> buildStream() throws Exception {
		InterceptorStream<ActivityInfo> stream = new InterceptorStream<ActivityInfo>() {
			{
				setOutput(new JKCloudActivityOutput() {
					@Override
					public void logItem(ActivityInfo ai) throws Exception {
						test.test(ai);
					}
				});
				initialize();
			}
		};
		return stream;
	}

	private MsgTraceReporter getMsgTraceReporter(InterceptorStream<ActivityInfo> stream) throws Exception {
		// System.setProperty("tnt4j.config", "../config/tnt4j.properties");

		MsgTraceReporter reporter = new MsgTraceReporter(stream, new Properties(), false, "all"); // NON-NLS

		return reporter;
	}

	private void testRecordMetadataFields(RecordMetadata recordMetadata, ActivityInfo activityInfo) {
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.SEND);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()), "Kafka_Producer_Acknowledge"); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Offset"), recordMetadata.offset()); // NON-NLS
		assertEquals(activityInfo.getFieldValue(StreamFieldType.StartTime.name()), new UsecTimestamp(TIMESTAMP * 1000));
		assertEquals(activityInfo.getFieldValue("Topic"), recordMetadata.topic()); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Partition"), recordMetadata.partition()); // NON-NLS
		assertEquals(activityInfo.getFieldValue((StreamFieldType.MsgLength.name())), MESSAGE.length() + KEY.length());
		assertEquals(activityInfo.getFieldValue(StreamFieldType.ApplName.name()), null);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.ResourceName.name()), "QUEUE=" + TOPIC); // NON-NLS
	}

	private TopicPartition getTopicPartition() {
		return new TopicPartition(TOPIC, PARTITION);
	}

	@Test
	public void testCommit() throws Exception {
		InterceptorStream<ActivityInfo> stream = buildStream();
		MsgTraceReporter reporter = getMsgTraceReporter(stream);

		HashMap<TopicPartition, OffsetAndMetadata> map = new HashMap<>();
		map.put(getTopicPartition(), new OffsetAndMetadata(OFFSET));
		Map.Entry<TopicPartition, OffsetAndMetadata> me = map.entrySet().iterator().next();
		reporter.commit(mock(TNTKafkaCInterceptor.class), map, null);

		ActivityInfo activityInfo = stream.getNextItem();

		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.ACTIVITY);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()), "Kafka_Consumer_Commit"); // NON-NLS
		assertNotNull(activityInfo.getFieldValue(StreamFieldType.TrackingId.name()));

		test = new TestActivityInfoConsumer() {
			@Override
			public void test(ActivityInfo activityInfo) {
				assertNotNull(activityInfo.getFieldValue(StreamFieldType.ParentId.name()));

				assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.EVENT);
				assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()),
						"Kafka_Consumer_Commit_Entry"); // NON-NLS
				assertEquals(activityInfo.getFieldValue("Partition"), me.getKey().partition()); // NON-NLS
				assertEquals(activityInfo.getFieldValue("Topic"), me.getKey().topic()); // NON-NLS
				assertEquals(activityInfo.getFieldValue("Offset"), me.getValue().offset()); // NON-NLS
				assertEquals(activityInfo.getFieldValue("Metadata"), me.getValue().metadata()); // NON-NLS
				assertEquals(activityInfo.getFieldValue(StreamFieldType.ApplName.name()), null);
				assertEquals(activityInfo.getFieldValue(StreamFieldType.ResourceName.name()), "QUEUE=" + TOPIC);
			}
		};

		reporter.shutdown();
	}

	@Test
	public void testConsume() throws Exception {
		InterceptorStream<ActivityInfo> stream = buildStream();
		MsgTraceReporter reporter = getMsgTraceReporter(stream);

		ConsumerRecords<Object, Object> consumerRecords = getConsumerRecords();

		reporter.consume(mock(TNTKafkaCInterceptor.class), consumerRecords, null);

		ActivityInfo activityInfo = stream.getNextItem();

		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.ACTIVITY);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()), "Kafka_Consumer_Consume"); // NON-NLS
		assertNotNull(activityInfo.getFieldValue(StreamFieldType.TrackingId.name()));

		test = new TestActivityInfoConsumer() {
			@Override
			public void test(ActivityInfo activityInfo) {
				assertNotNull(activityInfo.getFieldValue(StreamFieldType.ParentId.name()));
				assertEquals(activityInfo.getFieldValue(StreamFieldType.StartTime.name()),
						TimestampFormatter.getTimestamp(new UsecTimestamp((Number) TimeUnit.MILLISECONDS
								.toMicros(consumerRecords.iterator().next().timestamp()))));
				assertEquals(activityInfo.getFieldValue(StreamFieldType.MsgLength.name()),
						KEY.length() + MESSAGE.length());
				testConsumeFields(consumerRecords, activityInfo);
			}
		};

		reporter.shutdown();
	}

	private void testConsumeFields(ConsumerRecords<Object, Object> consumerRecords, ActivityInfo activityInfo) {

		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventType.name()), OpType.RECEIVE);
		assertEquals(activityInfo.getFieldValue(StreamFieldType.EventName.name()), "Kafka_Consumer_Consume_Record"); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Topic"), consumerRecords.iterator().next().topic()); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Partition"), consumerRecords.iterator().next().partition()); // NON-NLS
		assertEquals(activityInfo.getFieldValue("Offset"), consumerRecords.iterator().next().offset()); // NON-NLS
		// assertEquals(activityInfo.getFieldValue("TimestampType"), consumerRecords.iterator().next().timestampType());
		// // NON-NLS
		assertEquals(activityInfo.getFieldValue("Key"), consumerRecords.iterator().next().key()); // NON-NLS
		assertEquals(activityInfo.getFieldValue(StreamFieldType.Message.name()),
				consumerRecords.iterator().next().value());
	}

	private ConsumerRecords<Object, Object> getConsumerRecords() {
		ConsumerRecord<Object, Object> cr = new ConsumerRecord<>(TOPIC, PARTITION, OFFSET, TIMESTAMP,
				TimestampType.CREATE_TIME, KEY.length(), MESSAGE.length(), KEY, MESSAGE, new RecordHeaders(),
				Optional.empty());
		Map<TopicPartition, List<ConsumerRecord<Object, Object>>> map = Collections.singletonMap(getTopicPartition(),
				Collections.singletonList(cr));

		return new ConsumerRecords<>(map);
	}

	@Test
	public void testParseWithJavaObjectParser() throws ParseException {
		ConsumerRecords<Object, Object> consumerRecords = getConsumerRecords();
		ActivityJavaObjectParser objectParser = new ActivityJavaObjectParser();
		ActivityField topic = new ActivityField("Topic");
		topic.addLocator(new ActivityFieldLocator(ActivityFieldLocatorType.Label, "topic"));
		objectParser.addField(topic);

		ActivityInfo ai = objectParser.parse(new TestUtils.SimpleTestStream(), consumerRecords.iterator().next());

		assertEquals(TOPIC, ai.getFieldValue("Topic"));

	}

	@Test
	public void testConsumeConfig() throws Exception {
		ConsumerRecords<Object, Object> consumerRecords = getConsumerRecords();
		ActivityParser consumerRecordParser = getActivityParser("ConsumerRecordParser");
		ConsumerRecord<Object, Object> record = consumerRecords.iterator().next();
		if (consumerRecordParser.isDataClassSupported(record)) {
			ActivityInfo activityInfo = consumerRecordParser.parse(new TestUtils.SimpleTestStream(), record);
			testConsumeFields(consumerRecords, activityInfo);

		} else {
			fail("Data Class not supported");
		}
	}

	@Test
	public void testSendConfig() throws Exception {
		ProducerRecord producerRecord = getProducerRecord();
		ActivityParser producerActivityParser = getActivityParser("ProducerRecordParser");
		if (producerActivityParser.isDataClassSupported(producerRecord)) {
			ActivityInfo activityInfo = producerActivityParser.parse(new TestUtils.SimpleTestStream(), producerRecord);
			testSendFields(producerRecord, activityInfo);
		} else {
			fail("Data Class nor supported");
		}
	}

	@Test
	public void testRecordMetadata() throws Exception {
		RecordMetadata rm = new RecordMetadata(getTopicPartition(), OFFSET, BATCH_INDEX, TIMESTAMP, KEY.length(),
				MESSAGE.length());
		ActivityParser producerActivityParser = getActivityParser("RecordMetadataParser");
		if (producerActivityParser.isDataClassSupported(rm)) {
			ActivityInfo activityInfo = producerActivityParser.parse(new TestUtils.SimpleTestStream(), rm);
			testRecordMetadataFields(rm, activityInfo);
		} else {
			fail("Data Class nor supported");
		}
	}

	@Test
	public void testOffsetMetadata() throws Exception {
		OffsetAndMetadata om = new OffsetAndMetadata(OFFSET, "");
		ActivityParser producerActivityParser = getActivityParser("OffsetAndMetadataParser");
		if (producerActivityParser.isDataClassSupported(om)) {
			ActivityInfo activityInfo = producerActivityParser.parse(new TestUtils.SimpleTestStream(), om);
			assertEquals(OFFSET, activityInfo.getFieldValue("Offset"));
			assertEquals("", activityInfo.getFieldValue("Metadata"));
		} else {
			fail("Data Class nor supported");
		}
	}

	@Test
	public void topicPartition() throws Exception {
		TopicPartition tp = new TopicPartition(TOPIC, 0);
		ActivityParser producerActivityParser = getActivityParser("TopicPartitionParser");
		if (producerActivityParser.isDataClassSupported(tp)) {
			ActivityInfo activityInfo = producerActivityParser.parse(new TestUtils.SimpleTestStream(), tp);
			assertEquals(TOPIC, activityInfo.getFieldValue("Topic"));
			assertEquals(PARTITION, activityInfo.getFieldValue("Partition"));
		} else {
			fail("Data Class nor supported");
		}
	}

	private ActivityParser getActivityParser(String parserName)
			throws ParserConfigurationException, SAXException, IOException {

		return MsgTraceReporter.getParser("#" + parserName); // NON-NLS
	}

	public interface TestActivityInfoConsumer {
		void test(ActivityInfo ai);
	}
}


text:
$(function() {

    "use strict";

    //INLINE VALIDATION
    // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    $("#inline-validation").validate({

        highlight: function(label) {
            $(label).closest('.form-group').removeClass('has-success').addClass('has-error');
        },
        success: function(label) {
            $(label).closest('.form-group').removeClass('has-error');
            label.remove();
        },

        rules: {
            name: {
                required: true,
                minlength: 2,
                maxlength: 8
            },
            username: {
                required: true,
                minlength: 2,
                maxlength: 8
            },
            email: {
                required: true,
                email: true
            },
            password: {
                required: true,
                minlength: 4,
                maxlength: 10
            },
            'confirmation': {
                required: true,
                minlength: 4,
                maxlength: 10,
                equalTo: "#password"
            },
            age: {
                required: true,
                number: true,
                range: [18, 100]
            },
            url: {
                url: true
            }
        }
    });

    //MESSAGE BOX VALIDATION
    // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    var form = $("#messagebox-validation");

    $("#messagebox-validation").validate({

        errorContainer: form.find('.message-container'),
        errorLabelContainer: form.find('.message-container ul'),
        wrapper: 'li',

        rules: {
            username: {
                required: true
            },
            email: {
                required: true,
                email: true
            },
            password: {
                required: true
            }
        },

        messages: {
            username: {
                required: "Please enter your username"
            },
            email: {
                required: "Please enter your email address",
                email: "Please enter a valid email address"
            },
            password: {
                required: "Please enter your password",
            }
        }
    });
});


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.batch.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** Defines values for CertificateVisibility. */
public enum CertificateVisibility {
    /** Enum value StartTask. */
    START_TASK("StartTask"),

    /** Enum value Task. */
    TASK("Task"),

    /** Enum value RemoteUser. */
    REMOTE_USER("RemoteUser");

    /** The actual serialized value for a CertificateVisibility instance. */
    private final String value;

    CertificateVisibility(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a CertificateVisibility instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed CertificateVisibility object, or null if unable to parse.
     */
    @JsonCreator
    public static CertificateVisibility fromString(String value) {
        if (value == null) {
            return null;
        }
        CertificateVisibility[] items = CertificateVisibility.values();
        for (CertificateVisibility item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    /** {@inheritDoc} */
    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}


text:
const expect = require('chai').expect;
const PluginInterface = require('../../../src/plugins/plugin-interface');

describe('Plugin Interface', function() {
  it('should throw when no name defined', function() {
    expect(() => {
      new PluginInterface();
    }).to.throw('You must define a plugin name.');
  })
});


text:
using System;

namespace AlchemyAPIClient.Requests
{
    public sealed class AlchemyUrlConceptsRequest : AlchemyHtmlConceptsRequestBase, IAlchemyAPIUrlRequest, ICombinableAlchemyAPIRequest, IAlchemyAPIUrlCombinableRequest
    {
        private const string baseUrlKey = "baseUrl";
        public AlchemyUrlConceptsRequest(Uri url, AlchemyClient client)
            : base(client)
        {
            AddRequiredParameter(urlKey);
            Url = url;
        }
        protected override string RequestPath
        {
            get { return "url/URLGetRankedConcepts"; }
        }
        public Uri BaseUrl { get { return GetUriParameter(baseUrlKey); } set { AddOrUpdateParameter(baseUrlKey, value); } }
    }
}


text:
""" Concurrent logging handler (drop-in replacement for RotatingFileHandler)

Overview
========
This module provides an additional log handler for Python's standard logging
package (PEP 282). This handler will write log events to log file which is
rotated when the log file reaches a certain size.  Multiple processes can
safely write to the same log file concurrently.

Details
=======
.. _portalocker:  http://code.activestate.com/recipes/65203/

The ``ConcurrentRotatingFileHandler`` class is a drop-in replacement for
Python's standard log handler ``RotatingFileHandler``. This module uses file
locking so that multiple processes can concurrently log to a single file without
dropping or clobbering log events. This module provides a file rotation scheme
like with ``RotatingFileHanler``.  Extra care is taken to ensure that logs
can be safely rotated before the rotation process is started. (This module works
around the file rename issue with ``RotatingFileHandler`` on Windows, where a
rotation failure means that all subsequent log events are dropped).

This module attempts to preserve log records at all cost. This means that log
files will grow larger than the specified maximum (rotation) size. So if disk
space is tight, you may want to stick with ``RotatingFileHandler``, which will
strictly adhere to the maximum file size.

If you have multiple instances of a script (or multiple scripts) all running at
the same time and writing to the same log file, then *all* of the scripts should
be using ``ConcurrentRotatingFileHandler``. You should not attempt to mix
and match ``RotatingFileHandler`` and ``ConcurrentRotatingFileHandler``.

This package bundles `portalocker`_ to deal with file locking.  Please be aware
that portalocker only supports Unix (posix) an NT platforms at this time, and
therefore this package only supports those platforms as well.

Installation
============
Use the following command to install this package::

    pip install ConcurrentLogHandler

If you are installing from source, you can use::

    python setup.py install

Examples
========

Simple Example
--------------
Here is a example demonstrating how to use this module directly (from within
Python code)::

    from logging import getLogger, INFO
    from cloghandler import ConcurrentRotatingFileHandler
    import os

    log = getLogger()
    # Use an absolute path to prevent file rotation trouble.
    logfile = os.path.abspath("mylogfile.log")
    # Rotate log after reaching 512K, keep 5 old copies.
    rotateHandler = ConcurrentRotatingFileHandler(logfile, "a", 512*1024, 5)
    log.addHandler(rotateHandler)
    log.setLevel(INFO)

    log.info("Here is a very exciting log message, just for you")

Automatic fallback example
--------------------------
If you are distributing your code and you are unsure if the
`ConcurrentLogHandler` package has been installed everywhere your code will run,
Python makes it easy to gracefully fallback to the built in
`RotatingFileHandler`, here is an example::

    try:
        from cloghandler import ConcurrentRotatingFileHandler as RFHandler
    except ImportError:
        # Next 2 lines are optional:  issue a warning to the user
        from warnings import warn
        warn("ConcurrentLogHandler package not installed.  Using builtin log handler")
        from logging.handlers import RotatingFileHandler as RFHandler

    log = getLogger()
    rotateHandler = RFHandler("/path/to/mylogfile.log", "a", 1048576, 15)
    log.addHandler(rotateHandler)

Config file example
-------------------
This example shows you how to use this log handler with the logging config file
parser. This allows you to keep your logging configuration code separate from
your application code.

Example config file: ``logging.ini``::

    [loggers]
    keys=root

    [handlers]
    keys=hand01

    [formatters]
    keys=form01

    [logger_root]
    level=NOTSET
    handlers=hand01

    [handler_hand01]
    class=handlers.ConcurrentRotatingFileHandler
    level=NOTSET
    formatter=form01
    args=("rotating.log", "a", 512*1024, 5)

    [formatter_form01]
    format=%(asctime)s %(levelname)s %(message)s

Example Python code: ``app.py``::

    import logging, logging.config
    import cloghandler

    logging.config.fileConfig("logging.ini")
    log = logging.getLogger()
    log.info("Here is a very exciting log message, just for you")

Change Log
==========

.. _Red Hat Bug #858912: https://bugzilla.redhat.com/show_bug.cgi?id=858912
.. _Python Bug #15960: http://bugs.python.org/issue15960
.. _LP Bug 1199332: https://bugs.launchpad.net/python-concurrent-log-handler/+bug/1199332
.. _LP Bug 1199333: https://bugs.launchpad.net/python-concurrent-log-handler/+bug/1199333

- 0.8.7:  Bug fixes - `LP Bug 1199332`_ and `LP Bug 1199333`_.
   * More gracefully handle out of disk space scenarios. Prevent release() from
     throwing an exception.
   * Handle logging.shutdown() in Python 2.7+. Close the lock file stream via
     close().
   * Big thanks to Dan Callaghan for forwarding these issues and patches.

- 0.8.6:  Fixed packaging bug with test script
   * Fix a small packaging bug from the 0.8.5 release.  (Thanks to Björn Häuser
     for bringing this to my attention.)
   * Updated stresstest.py to always use the correct python version when
     launching sub-processes instead of the system's default "python".

- 0.8.5:  Fixed ValueError: I/O operation on closed file
   * Thanks to Vince Carney, Arif Kasim, Matt Drew, Nick Coghlan, and
     Dan Callaghan for bug reports.  Bugs can now be filled here:
     https://bugs.launchpad.net/python-concurrent-log-handler.  Bugs resolved
     `Red Hat Bug #858912`_ and `Python Bug #15960`_
   * Updated ez_setup.py to 0.7.7
   * Updated portalocker to 0.3 (now maintained by Rick van Hattem)
   * Initial Python 3 support (needs more testing)
   * Fixed minor spelling mistakes

- 0.8.4:  Fixed lock-file naming issue
   * Resolved a minor issue where lock-files would be improperly named if the
     log file contained ".log" in the middle of the log name.  For example, if
     you log file was "/var/log/mycompany.logging.mysource.log", the lock file
     would be named "/var/log/mycompany.ging.mysource.lock", which is not correct.
     Thanks to Dirk Rothe for pointing this out.  Since this introduce a slight
     lock-file behavior difference, make sure all concurrent writers are updated
     to 0.8.4 at the same time if this issue effects you.
   * Updated ez_setup.py to 0.6c11

- 0.8.3:  Fixed a log file rotation bug and updated docs
   * Fixed a bug that happens after log rotation when multiple processes are
     witting to the same log file. Each process ends up writing to their own
     log file ("log.1" or "log.2" instead of "log"). The fix is simply to reopen
     the log file and check the size again.  I do not believe this bug results in
     data loss; however, this certainly was not the desired behavior.  (A big
     thanks goes to Oliver Tonnhofer for finding, documenting, and providing a
     patch for this bug.)
   * Cleanup the docs. (aka "the page you are reading right now") I fixed some
     silly mistakes and typos... who writes this stuff?

- 0.8.2:  Minor bug fix release (again)
   * Found and resolved another issue with older logging packages that do not
     support encoding.

- 0.8.1:  Minor bug fix release
   * Now importing "codecs" directly; I found some slight differences in the
     logging module in different Python 2.4.x releases that caused the module to
     fail to load.

- 0.8.0:  Minor feature release
    * Add better support for using ``logging.config.fileConfig()``. This class
      is now available using ``class=handlers.ConcurrentRotatingFileHandler``.
    * Minor changes in how the ``filename`` parameter is handled when given a
      relative path.

- 0.7.4:  Minor bug fix
    * Fixed a typo in the package description (incorrect class name)
    * Added a change log; which you are reading now.
    * Fixed the ``close()`` method to no longer assume that stream is still
      open.

To-do
=====
* This module has had minimal testing in a multi-threaded process.  I see no
  reason why this should be an issue, but no stress-testing has been done in a
  threaded situation. If this is important to you, you could always add
  threading support to the ``stresstest.py`` script and send me the patch.

"""
import sys

extra = {}
if sys.version_info >= (3, 0):
    extra.update(use_2to3=True)

from ez_setup import use_setuptools
use_setuptools()

from setuptools import setup

VERSION = "0.8.7"
classifiers = """\
Development Status :: 5 - Production/Stable
Topic :: System :: Logging
Operating System :: POSIX
Operating System :: Microsoft :: Windows
Programming Language :: Python
Programming Language :: Python :: 2.4
Programming Language :: Python :: 2.5
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Topic :: Software Development :: Libraries :: Python Modules
License :: OSI Approved :: Apache Software License
"""
doc = __doc__.splitlines()

setup(name='ConcurrentLogHandler',
      version=VERSION,
      author="Lowell Alleman",
      author_email="lowell87@gmail.com",
      py_modules=[
        "cloghandler",
        "portalocker",
        ],
      package_dir={ '' : 'src', },
      data_files=[
        ('tests', ["stresstest.py"]),
        ('docs', [
            'README',
            'LICENSE',
            ]),
      ],
      url="http://launchpad.net/python-concurrent-log-handler",
      license = "http://www.apache.org/licenses/LICENSE-2.0",
      description=doc.pop(0),
      long_description="\n".join(doc),
      platforms = [ "nt", "posix" ],
      keywords = "logging, windows, linux, unix, rotate, portalocker",
      classifiers=classifiers.splitlines(),
      zip_safe=True,
      #test_suite=unittest.TestSuite,
      **extra
)


text:
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
 * Delimiter rule end renderer for Xhtml
 *
 * PHP versions 4 and 5
 *
 * @category   Text
 * @package    Text_Wiki
 * @author     Paul M. Jones <pmjones@php.net>
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version    CVS: $Id: Delimiter.php,v 1.5 2005/07/30 08:03:28 toggg Exp $
 * @link       http://pear.php.net/package/Text_Wiki
 */

/**
 * This class set back the replaced delimiters in XHTML.
 *
 * @category   Text
 * @package    Text_Wiki
 * @author     Paul M. Jones <pmjones@php.net>
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version    Release: @package_version@
 * @link       http://pear.php.net/package/Text_Wiki
 */
class Text_Wiki_Render_Xhtml_Delimiter extends Text_Wiki_Render {

    /**
    *
    * Renders a token into text matching the requested format.
    *
    * @access public
    *
    * @param array $options The "options" portion of the token (second
    * element).
    *
    * @return string The text rendered from the token options.
    *
    */

    function token($options)
    {
        return $options['text'];
    }
}
?>


text:
import time
from appium import webdriver
import Public_functions
import unittest

class test_xlsb(unittest.TestCase):

    global driver
    @classmethod
    def setUpClass(cls):
        '''
        desired_caps = {
                'platformName':'Android',
                'deviceName':'G40GLD4572500169',
                'platformVersion':'6.0',
                'appPackage':'com.fiberhome.waiqin365.client',
                'appActivity':'com.waiqin365.base.login.LoginSplashActivity',
                'unicodeKeyboard':True,
                'resetKeyboard':True
                }
        cls.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)
        time.sleep(2)
        a=cls.driver.find_elements_by_class_name('android.widget.Button')
        if a:
            textfields = cls.driver.find_elements_by_class_name("android.widget.EditText")
            textfields[0].send_keys('dongshichao')
            textfields[1].send_keys('dong')
            textfields[2].send_keys('a111111')
            cls.driver.find_element_by_id('com.fiberhome.waiqin365.client:id/btn_login').click()
            time.sleep(2)
        else:
            time.sleep(2)
        '''
        cls.driver=Public_functions.login()

    @classmethod
    def tearDownClass(cls):
        # Public_functions.logout()
        cls.driver.quit()

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_1xlsb(self):
        self.driver.find_element_by_name(u"管理驾驶舱").click()
        self.driver.implicitly_wait(5)
        context=self.driver.contexts
        print context
        time.sleep(5)
        self.driver.switch_to.context('WEBVIEW')
        time.sleep(2)

if __name__=="__main__":
    '''
    suit=unittest.TestSuite()
    suit.addTest(test_xlsb("xlsb"))
    runner=unittest.TextTestRunner()
    runner.run(suit)
    '''
    unittest.main()


text:
#include "curlcheck.h"

#include <curl/curl.h>

static CURLcode unit_setup(void)
{
  return CURLE_OK;
}

static void unit_stop(void)
{

}

static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
{
  fwrite(buf, len, 1, stdout);
  (*(size_t *) arg) += len;
  return len;
}

UNITTEST_START
  int rc;
  struct curl_httppost* post = NULL;
  struct curl_httppost* last = NULL;
  size_t total_size = 0;
  char buffer[] = "test buffer";

  rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name",
                    CURLFORM_COPYCONTENTS, "content", CURLFORM_END);

  fail_unless(rc == 0, "curl_formadd returned error");

  /* after the first curl_formadd when there's a single entry, both pointers
     should point to the same struct */
  fail_unless(post == last, "post and last weren't the same");

  rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode",
                    CURLFORM_COPYCONTENTS, "<HTML></HTML>",
                    CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END);

  fail_unless(rc == 0, "curl_formadd returned error");

  rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent",
                   CURLFORM_PTRCONTENTS, buffer, CURLFORM_END);

  fail_unless(rc == 0, "curl_formadd returned error");

  rc = curl_formget(post, &total_size, print_httppost_callback);

  fail_unless(rc == 0, "curl_formget returned error");

  fail_unless(total_size == 486, "curl_formget got wrong size back");

  curl_formfree(post);

  /* start a new formpost with a file upload and formget */
  post = last = NULL;

  rc = curl_formadd(&post, &last,
                    CURLFORM_PTRNAME, "name of file field",
                    CURLFORM_FILE, "log/test-1308",
                    CURLFORM_FILENAME, "custom named file",
                    CURLFORM_END);

  fail_unless(rc == 0, "curl_formadd returned error");

  rc = curl_formget(post, &total_size, print_httppost_callback);
  fail_unless(rc == 0, "curl_formget returned error");
  fail_unless(total_size == 847, "curl_formget got wrong size back");

  curl_formfree(post);

UNITTEST_STOP


text: export { ShoppingCartArrowDown32 as default } from "../../";


text:
package org.apache.ignite.internal.processors.affinity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.testframework.GridTestNode;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;

/**
 * Tests affinity history assignment diff calculation for history assignment.
 */
public class GridHistoryAffinityAssignmentTest extends GridCommonAbstractTest {
    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME));

        return cfg;
    }

    /** */
    @Test
    public void testSimple() {
        int cnt = 128;

        List<List<ClusterNode>> curr = new ArrayList<>();
        List<List<ClusterNode>> ideal = new ArrayList<>();

        for(int i = 0; i < cnt; i++) {
            List<ClusterNode> nodes = Arrays.asList(new GridTestNode(UUID.randomUUID()), new GridTestNode(UUID.randomUUID()));
            curr.add(nodes);
            ideal.add(Arrays.asList(nodes.get(1), nodes.get(0)));
        }

        AffinityTopologyVersion topVer = new AffinityTopologyVersion(1, 0);
        HistoryAffinityAssignment lateAssign =
            new HistoryAffinityAssignment(new GridAffinityAssignmentV2(topVer, curr, ideal), 1);

        assertEquals("Late", curr, lateAssign.assignment());
        assertEquals("Ideal late", ideal, lateAssign.idealAssignment());

        HistoryAffinityAssignment idealAssign = new
            HistoryAffinityAssignment(new GridAffinityAssignmentV2(topVer, ideal, ideal), 1);

        assertSame(idealAssign.assignment(), idealAssign.idealAssignment());

        assertEquals("Ideal", ideal, idealAssign.idealAssignment());
    }

    /** */
    @Test
    public void testHistoryAffinityAssignmentCalculation() throws Exception {
        try {
            IgniteEx grid0 = startGrid(0);

            AffinityAssignment a0 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(1, 0));

            startGrid(1);

            awaitPartitionMapExchange();

            AffinityAssignment a1 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(1, 0));

            assertTrue(a1 instanceof HistoryAffinityAssignment);

            AffinityAssignment a2 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(2, 0));
            AffinityAssignment a3 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(2, 1));

            // Compare head with history assignment.
            assertEquals(a0.assignment(), a1.assignment());
            assertEquals(a0.idealAssignment(), a1.idealAssignment());

            startGrid(2);

            awaitPartitionMapExchange();

            AffinityAssignment a5 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(2, 0));
            AffinityAssignment a6 = affinityCache(grid0).cachedAffinity(new AffinityTopologyVersion(2, 1));

            assertTrue(a5 instanceof HistoryAffinityAssignment);
            assertTrue(a6 instanceof HistoryAffinityAssignment);

            assertEquals(a2.assignment(), a5.assignment());
            assertEquals(a2.idealAssignment(), a5.idealAssignment());

            assertEquals(a3.assignment(), a6.assignment());
            assertEquals(a3.idealAssignment(), a6.idealAssignment());
        }
        finally {
            stopAllGrids();
        }
    }

    /**
     * @param ignite Ignite.
     */
    private GridAffinityAssignmentCache affinityCache(IgniteEx ignite) {
        GridCacheProcessor proc = ignite.context().cache();

        GridCacheContext cctx = proc.context().cacheContext(CU.cacheId(DEFAULT_CACHE_NAME));

        return GridTestUtils.getFieldValue(cctx.affinity(), "aff");
    }
}


text:
  UpdateMe
  Update


text:
<?php
/**
 * DO NOT EDIT THIS FILE!
 *
 * This file was automatically generated from external sources.
 *
 * Any manual change here will be lost the next time the SDK
 * is updated. You've been warned!
 */

namespace DTS\eBaySDK\Trading\Types;

/**
 *
 * @property string $ItemID
 * @property integer $VeROReasonCodeID
 * @property string $MessageToSeller
 * @property boolean $CopyEmailToRightsOwner
 * @property \DTS\eBaySDK\Trading\Enums\ShippingRegionCodeType[] $Region
 * @property \DTS\eBaySDK\Trading\Enums\CountryCodeType[] $Country
 * @property string $Patent
 * @property string $DetailedMessage
 */
class VeROReportItemType extends \DTS\eBaySDK\Types\BaseType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = [
        'ItemID' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'ItemID'
        ],
        'VeROReasonCodeID' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'VeROReasonCodeID'
        ],
        'MessageToSeller' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'MessageToSeller'
        ],
        'CopyEmailToRightsOwner' => [
            'type' => 'boolean',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'CopyEmailToRightsOwner'
        ],
        'Region' => [
            'type' => 'string',
            'repeatable' => true,
            'attribute' => false,
            'elementName' => 'Region'
        ],
        'Country' => [
            'type' => 'string',
            'repeatable' => true,
            'attribute' => false,
            'elementName' => 'Country'
        ],
        'Patent' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'Patent'
        ],
        'DetailedMessage' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'DetailedMessage'
        ]
    ];

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = [])
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
            self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"';
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
package nl.knaw.dans.common.fedora;

import static org.junit.Assert.assertEquals;
import nl.knaw.dans.common.lang.test.Tester;

import org.junit.Test;

public class TesterTest
{
    @Test
    public void getString()
    {
        assertEquals("testing nl.knaw.dans.common.fedora", Tester.getString(Tester.KEY_TEST));
    }

}


text:
"use strict";

var visibilityApiSupport = typeof document.hidden === 'boolean',
    noop = function noop () {},
    expectedSteps = ['update', 'postUpdate', 'preRender', 'render', 'postRender', 'pause', 'resume'];

/**
 *
 * @param {object} steps
 * @returns {object} Steps object with noop for any missing step
 */
function prepareSteps (steps) {
    var mergedSteps = {},
        i = 0,
        key;

    for (; i < expectedSteps.length; i++) {
        key = expectedSteps[i];

        if (steps && typeof steps[key] === 'function') {
            mergedSteps[key] = steps[key];
        } else {
            mergedSteps[key] = noop;
        }
    }

    return mergedSteps;
}

/**
 *
 * @param {object} steps
 * @param {VRDisplay|Window} display
 * @constructor
 */
var BaseLoop = function (steps, display) {
    this.steps = prepareSteps(steps);

    this.frameRate = null;
    this.frameDuration = null;
    this.lastTime = null;
    this.running = false;
    this.runningMethod = this.run.bind(this);
    this.paused = false;

    this.setDisplay(display);

    if (visibilityApiSupport) {
        this.observePageVisibility();
    }
};

/**
 * Set the display, either a VRDisplay instance or the window object
 * @param {VRDisplay|Window} display
 */
BaseLoop.prototype.setDisplay = function (display) {
    display = display || window;

    var previousCancelFrame = this.cancelFrame;

    this.requestFrame = (
        display.requestAnimationFrame ||
        display.webkitRequestAnimationFrame ||
        display.mozRequestAnimationFrame
    );

    this.cancelFrame = (
        display.cancelAnimationFrame ||
        display.webkitCancelAnimationFrame ||
        display.webkitCancelRequestAnimationFrame ||
        display.mozCancelAnimationFrame
    );

    if (!this.requestFrame || !this.cancelFrame) {
        throw new Error('requestAnimationFrame and cancelAnimationFrame are not supported by the display object');
    }

    this.requestFrame = this.requestFrame.bind(display);
    this.cancelFrame = this.cancelFrame.bind(display);

    if (this.running !== false) {
        previousCancelFrame(this.running);
        this.running = this.requestFrame(this.runningMethod);
    }
};

BaseLoop.prototype.steps = null;
BaseLoop.prototype.lastTime = null;
BaseLoop.prototype.running = null;
BaseLoop.prototype.runningMethod = null;
BaseLoop.prototype.paused = null;

/**
 * Start the game loop
 */
BaseLoop.prototype.start = function () {
    if (this.running === false) {
        this.running = this.requestFrame(this.runningMethod);
    }

    this.paused = false;
};

/**
 * Stop the game loop
 */
BaseLoop.prototype.stop = function () {
    if (this.running !== false) {
        this.cancelFrame(this.running);
        this.running = false;
        this.paused = false;
        this.lastTime = null;
    }
};

/**
 * Add an event listener to the document's visibilitychange to stop the loop when the page is hidden
 * @protected
 */
BaseLoop.prototype.observePageVisibility = function () {
    var self = this;

    var visibilityChangeHandler = function visibilityChangeHandler () {
        if (self.running !== false) {
            if (!self.paused && !!document.hidden) {
                self.paused = true;
                self.lastTime = null;
                self.steps.pause();
            } else if (self.paused) {
                self.start();
                self.steps.resume();
            }
        }
    };

    window.document.addEventListener('visibilitychange', visibilityChangeHandler);
};

/**
 * Main method called at each interval
 * @protected
 * @param time
 */
BaseLoop.prototype.run = function (time) {
    console.log('BaseLoop.prototype.run', time);
};

module.exports = BaseLoop;


text:
<!DOCTYPE html>

    <title>RTL support</title>
    <meta charset="utf-8">
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

        Back

                    Choose date:
                    <input id="datepicker" />


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <title>Archivo: 2016 | La Red Semanario</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="Noticias del Sur del Estado de Mexico">
<meta property="og:type" content="website">
<meta property="og:title" content="La Red Semanario">
<meta property="og:url" content="https://laredsemanario.com/archives/2016/page/5/index.html">
<meta property="og:site_name" content="La Red Semanario">
<meta property="og:description" content="Noticias del Sur del Estado de Mexico">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="La Red Semanario">
<meta name="twitter:description" content="Noticias del Sur del Estado de Mexico">
<meta name="twitter:creator" content="@3171117842">
<meta property="fb:app_id" content="956176474392711">

        <link rel="icon" href="/favicon.ico" />

    <link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/vendor/titillium-web/styles.css">
    <link rel="stylesheet" href="/vendor/source-code-pro/styles.css">

    <link rel="stylesheet" href="/css/style.css">

        <link rel="stylesheet" href="/vendor/fancybox/jquery.fancybox.css">

        <link rel="stylesheet" href="/vendor/scrollLoading/style.css">

                                    Inicio

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="Buscar" />
        <button type="submit" class="search-form-submit"></button>
    </form>

            <input type="text" class="ins-search-input" placeholder="Escribe algo..." />

    Archivo: 2016

                2016

        0

            Espectaculos

<time datetime="2016-05-04T18:56:02.000Z" itemprop="datePublished">2016-05-04</time>

        Kate Upton se casa

Trabajando en el mundo de los medios a veces se deben dar noticias que no siempre resultan agradables, y a las que es imposible ser ajenos pues lo humano le gana a lo profesional. Por eso, hoy nos se

        0

            Deportes

<time datetime="2016-05-04T18:51:29.000Z" itemprop="datePublished">2016-05-04</time>

        Paul Aguilar podria emigrar a Europa

Paul Aguilar es uno de los mejores laterales de México, aunque esta posición se ha visto escasa en los últimos años. Esto ha provocado que despierte el interés de varios equipos en el viejo continent

        0

            Nacional

<time datetime="2016-05-04T18:45:27.000Z" itemprop="datePublished">2016-05-04</time>

        El Cártel de Sinaloa tiene la flota aérea más grande de México

Según informes de El Universal el cártel de Sinaloa tiene una flota aérea mucho mayor que la aerolínea más grande de México, Aeromexico. A decir verdad no es algo que realmente nos extrañe, sin embar

        0

            Politica

<time datetime="2016-05-04T18:37:15.000Z" itemprop="datePublished">2016-05-04</time>

        Hijo de candidato del PAN a diputado es exhibido con armas

Dado la cantidad de personas que tienen a "bien" tomarse fotos con sus respectivas pistolas, para muchos estas imágenes pasarían desapercibidas… no fue así para varios habitantes de Hidalgo.
Y mucho

        Página 5 de 24
        «1…34567…24»

seguir:

recientes

Nacional

Detienen a Leopoldo Duarte, acusado de abuso sexual en el Colegio Matatena

<time datetime="2016-05-11T14:29:50.000Z" itemprop="datePublished">2016-05-11</time>

Ciencia

Telescopio espacial Kepler descubre 1284 nuevos planetas fuera del sistema solar

<time datetime="2016-05-11T14:24:56.000Z" itemprop="datePublished">2016-05-11</time>

Deportes

Billy Álvarez dejaría Cruz Azul

<time datetime="2016-05-11T14:14:24.000Z" itemprop="datePublished">2016-05-11</time>

Politica

Por ser desproporcionadas, El Bronco cancelará 10 mil becas estudiantiles

<time datetime="2016-05-11T14:08:06.000Z" itemprop="datePublished">2016-05-11</time>

Cultura

Los 11 mandamientos de la Iglesia de Satán son mucho más sensatos de lo que imaginarías

<time datetime="2016-05-10T14:05:56.000Z" itemprop="datePublished">2016-05-10</time>

© 2014 - 2016 La Red Semanario


text:
title: Mixtures
localeTitle: Misturas
---
## Problema 478: Misturas

Este é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-478-mixtures/index.md) .

[Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
import {ProcessRequirement} from "./ProcessRequirement";

/**
 * Indicate that the workflow platform must support the `valueFrom` field
 * of [WorkflowStepInput](#WorkflowStepInput).
 *
 */

export interface StepInputExpressionRequirement extends ProcessRequirement {

}


text:
'use strict';

var CLEANUP_TIMEOUT = 30000;
var RenderingStates = {
  INITIAL: 0,
  RUNNING: 1,
  PAUSED: 2,
  FINISHED: 3
};
var PDFRenderingQueue = function PDFRenderingQueueClosure() {
  function PDFRenderingQueue() {
    this.pdfViewer = null;
    this.pdfThumbnailViewer = null;
    this.onIdle = null;
    this.highestPriorityPage = null;
    this.idleTimeout = null;
    this.printing = false;
    this.isThumbnailViewEnabled = false;
  }
  PDFRenderingQueue.prototype = {
    setViewer: function PDFRenderingQueue_setViewer(pdfViewer) {
      this.pdfViewer = pdfViewer;
    },
    setThumbnailViewer: function PDFRenderingQueue_setThumbnailViewer(pdfThumbnailViewer) {
      this.pdfThumbnailViewer = pdfThumbnailViewer;
    },
    isHighestPriority: function PDFRenderingQueue_isHighestPriority(view) {
      return this.highestPriorityPage === view.renderingId;
    },
    renderHighestPriority: function PDFRenderingQueue_renderHighestPriority(currentlyVisiblePages) {
      if (this.idleTimeout) {
        clearTimeout(this.idleTimeout);
        this.idleTimeout = null;
      }
      if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {
        return;
      }
      if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) {
        if (this.pdfThumbnailViewer.forceRendering()) {
          return;
        }
      }
      if (this.printing) {
        return;
      }
      if (this.onIdle) {
        this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);
      }
    },
    getHighestPriority: function PDFRenderingQueue_getHighestPriority(visible, views, scrolledDown) {
      var visibleViews = visible.views;
      var numVisible = visibleViews.length;
      if (numVisible === 0) {
        return false;
      }
      for (var i = 0; i < numVisible; ++i) {
        var view = visibleViews[i].view;
        if (!this.isViewFinished(view)) {
          return view;
        }
      }
      if (scrolledDown) {
        var nextPageIndex = visible.last.id;
        if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) {
          return views[nextPageIndex];
        }
      } else {
        var previousPageIndex = visible.first.id - 2;
        if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) {
          return views[previousPageIndex];
        }
      }
      return null;
    },
    isViewFinished: function PDFRenderingQueue_isViewFinished(view) {
      return view.renderingState === RenderingStates.FINISHED;
    },
    renderView: function PDFRenderingQueue_renderView(view) {
      var state = view.renderingState;
      switch (state) {
        case RenderingStates.FINISHED:
          return false;
        case RenderingStates.PAUSED:
          this.highestPriorityPage = view.renderingId;
          view.resume();
          break;
        case RenderingStates.RUNNING:
          this.highestPriorityPage = view.renderingId;
          break;
        case RenderingStates.INITIAL:
          this.highestPriorityPage = view.renderingId;
          var continueRendering = function () {
            this.renderHighestPriority();
          }.bind(this);
          view.draw().then(continueRendering, continueRendering);
          break;
      }
      return true;
    }
  };
  return PDFRenderingQueue;
}();
exports.RenderingStates = RenderingStates;
exports.PDFRenderingQueue = PDFRenderingQueue;


text:
package com.google.classyshark.silverghost.translator;

import com.google.classyshark.silverghost.FullArchiveReader;
import com.google.classyshark.silverghost.plugins.EmptyFullArchiveReader;
import com.google.classyshark.silverghost.translator.apk.ApkTranslator;
import com.google.classyshark.silverghost.translator.dex.DexInfoTranslator;
import com.google.classyshark.silverghost.translator.elf.ElfTranslator;
import com.google.classyshark.silverghost.translator.jar.JarInfoTranslator;
import com.google.classyshark.silverghost.translator.java.JavaTranslator;
import com.google.classyshark.silverghost.translator.xml.AndroidXmlTranslator;
import java.io.File;
import java.util.LinkedList;
import java.util.List;

/**
 * Creates translators based on class names and archives
 */
public class TranslatorFactory {

    public static Translator createTranslator(String className, File archiveFile) {
        return createTranslator(className, archiveFile, new LinkedList<String>(), null);
    }

    public static Translator createTranslator(String className, File archiveFile,
                                              List<String> allClassNames) {
        return createTranslator(className, archiveFile, allClassNames, null);
    }

    public static Translator createTranslator(String className, File archiveFile,
                                              List<String> allClassNames, FullArchiveReader fullArchiveReader) {
        if (className.endsWith(".xml")) {
            return new AndroidXmlTranslator(className, archiveFile);
        }

        if (className.endsWith(".dex")) {
            return new DexInfoTranslator(className, archiveFile);
        }

        if (className.endsWith(".jar")) {
            // TODO: does it make any sense to check for jayce subvariant?
            // size does not make much sense as jayce jar may include other files beyond the code
            return new JarInfoTranslator(archiveFile, allClassNames);
        }

        if (className.endsWith(".apk")) {
            return new ApkTranslator(archiveFile);
        }

        if (className.endsWith(".so")) {
            return new ElfTranslator(className, archiveFile);
        }

        if (fullArchiveReader != null &&
                !(fullArchiveReader instanceof EmptyFullArchiveReader)) {
            return fullArchiveReader.buildTranslator(className, archiveFile);
        }

        return new JavaTranslator(className, archiveFile);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Ziti C SDK: Globals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Ziti C SDK

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- t -

tag_bool
: model_support.h

tag_null
: model_support.h

tag_number
: model_support.h

tag_string
: model_support.h

tag_type
: model_support.h

timestamp
: model_support.h

to_str
: ziti_log.h

TRACE
: ziti_log.h

Generated by  1.9.1


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/sbeio/sbe_stashKeyAddr.C $                            */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2012,2017                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/**
* @file sbe_stashKeyAddr.C
* @brief Send command to stash key-value pair in the SBE
*/

#include <config.h>
#include <trace/interface.H>
#include <errl/errlmanager.H>
#include <sbeio/sbeioif.H>
#include <sbeio/sbe_psudd.H>

extern trace_desc_t* g_trac_sbeio;

#define SBE_TRACD(printf_string,args...) \
TRACDCOMP(g_trac_sbeio,"psuStashKeyAddr: " printf_string,##args)

#define SBE_TRACF(printf_string,args...) \
TRACFCOMP(g_trac_sbeio,"psuStashKeyAddr: " printf_string,##args)

namespace SBEIO
{

    /**
    * @brief Sends a PSU chipOp to stash a key-address pair in the SBE
    *
    * @return errlHndl_t Error log handle on failure.
    *
    */
    errlHndl_t sendPsuStashKeyAddrRequest(const uint8_t i_key,
                                          const uint64_t i_value,
                                          TARGETING::Target * i_procChip)
    {
        errlHndl_t errl = NULL;

        SBE_TRACD(ENTER_MRK "sending psu stashKeyAddr request from HB to SBE on proc %d",
                    i_procChip->getAttr<TARGETING::ATTR_POSITION>());

        // set up PSU command message
        SbePsu::psuCommand   l_psuCommand(
                                  SbePsu::SBE_REQUIRE_RESPONSE |
                                  SbePsu::SBE_REQUIRE_ACK, //control flags
                                  SbePsu::SBE_PSU_GENERIC_MESSAGE, //command class
                                  SbePsu::SBE_PSU_MSG_STASH_KEY_ADDR); //command
        SbePsu::psuResponse  l_psuResponse;

        l_psuCommand.cd7_stashKeyAddr_Key = i_key;
        l_psuCommand.cd7_stashKeyAddr_Value = i_value;

        errl =  SBEIO::SbePsu::getTheInstance().performPsuChipOp(i_procChip,
                                &l_psuCommand,
                                &l_psuResponse,
                                SbePsu::MAX_PSU_SHORT_TIMEOUT_NS,
                                SbePsu::SBE_STASH_KEY_ADDR_REQ_USED_REGS,
                                SbePsu::SBE_STASH_KEY_ADDR_RSP_USED_REGS);

        if (errl)
        {
            SBE_TRACF(ERR_MRK "sendPsuStashKeyAddrRequest: PSU Cmd Failed: "
            "err rc=0x%.4X plid=0x%.8X",
            ERRL_GETRC_SAFE(errl), ERRL_GETPLID_SAFE(errl));

            // If the error states that the command is not supported on SBE then set as informational log
            if ((l_psuResponse.primaryStatus ==
                SBE_PRI_INVALID_COMMAND) &&
                (l_psuResponse.secondaryStatus ==
                SBE_SEC_COMMAND_NOT_SUPPORTED)
                )
            {
                SBE_TRACF(ERR_MRK "sendPsuStashKeyAddrRequest: Changing 'Command  Not Supported' Error Log To Informational.");
                errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
                errl->collectTrace(SBEIO_COMP_NAME);
            }
            else if (l_psuResponse.secondaryStatus == SBE_SEC_INPUT_BUFFER_OVERFLOW)
            {
                SBE_TRACF(ERR_MRK "sendPsuStashKeyAddrRequest: Input buffer overflow, we are attempting to stash too many pairs");
                errl->collectTrace(SBEIO_COMP_NAME);
            }
        }

        SBE_TRACD(EXIT_MRK "stashKeyAddr");

        return errl;
    };

} //end namespace SBEIO


text:
<?php
################################################################################
#                                  CHANGELOG                                   #
################################################################################
#  11/2002 - G. hartlieb: Created                                              #
################################################################################

include_once("../include/irm_conf.php");
include_once("../include/func.header_footer");
include_once("../include/class.user");

AuthCheck("post-only");

commonHeader("Daedalus Help Desk - Is this the computer?");

print "Click on the computer's name to select.";

print "
";

// Check Table 'computer'
$query = "SELECT COUNT(*) FROM computer
          WHERE weight > 0 AND
                (owner LIKE '%$name%' OR user LIKE '%$name%')";
$sth = $adb->prepare($query);
$res = $sth->execute() or print( mysql_error().': '.$query );

// Number of rows returned from above query.
list($numrows) = $sth->fetchrow_array();

//Check Table 'odin'
$query = "SELECT COUNT(*) FROM odin
          WHERE (owner LIKE '%$name%')";
$sth = $adb->prepare($query);
$res = $sth->execute() or print( mysql_error().': '.$query );

// Number of rows returned from above query.
list($odin_numrows) = $sth->fetchrow_array();

$numrows += $odin_numrows;

if ( $numrows < 1 ) {
   print "Bad Daedalus ID or search terms";

} elseif ($numRows > 10) {
print "Your search terms were to vague, and yeilded more than 10 results.
       Please try again.";

} else {

   // Get Info from Table 'computers'
   $query = "SELECT computer_id,NEMS,owner,user,type,building
               FROM computer
              WHERE weight > 0 AND
                    (owner LIKE '%$name%' OR user LIKE '%$name%')";
   $sth = $adb->prepare($query);
   $res = $sth->execute() or print( mysql_error().': '.$query );

   echo "
";
   echo "Computer ID	OwnerUser		Type	Location	";
   while ( $row = $sth->fetchrow_hash() ) {
      extract($row);

      echo "
";
      echo "";
  echo "$NEMS";
      echo "	";
      echo "$owner	";
      echo "$user	";
      echo "$type	";
      echo "$building	";
      echo "
";

   } // End While
   echo "
";

   // Get Info from Table 'odin'
   $query = "SELECT odin_id,ODIN_Number,owner,type,building
               FROM odin
              WHERE owner LIKE '%$name%' ";
   $sth = $adb->prepare($query);
   $res = $sth->execute() or print( mysql_error().': '.$query );

   echo "
";
   echo "
";
   echo "ODIN ID	OwnerUser		Type	Location	";
   while ( $row = $sth->fetchrow_hash() ) {
      extract($row);

      echo "
";
      echo "";
  echo "$ODIN_Number";
      echo "	";
      echo "$owner	";
      echo "$user	";
      echo "$type	";
      echo "$building	";
      echo "
";

   } // End While
   echo "
";
   echo "
";

} // End If

commonFooter();

?>


text:
It's expense tracker application
compiled on xcode 12 and fixed issues for ios 14